@hippy/debug-server-next
Version:
Debug server for hippy.
223 lines (222 loc) • 9.54 kB
JavaScript
;
/*
* Tencent is pleased to support the open source community by making
* Hippy available.
*
* Copyright (C) 2017-2019 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppDriverType = exports.GatewayFamily = exports.LogLevel = exports.HMRSyncType = exports.HMRReportExt2 = exports.ReportEvent = exports.StaticFileStorage = exports.WSCode = exports.HMREvent = exports.OSType = exports.ChromeLogLevel = exports.InternalChannelEvent = exports.WinstonColor = exports.DBType = exports.MiddlewareType = exports.ChromePageType = exports.DeviceManagerEvent = exports.PH = exports.ClientRole = exports.ClientType = exports.DevicePlatform = exports.DebugTunnel = void 0;
var DebugTunnel;
(function (DebugTunnel) {
DebugTunnel["TCP"] = "TCP";
DebugTunnel["WS"] = "WS";
})(DebugTunnel = exports.DebugTunnel || (exports.DebugTunnel = {}));
var DevicePlatform;
(function (DevicePlatform) {
DevicePlatform["Unknown"] = "0";
DevicePlatform["IOS"] = "1";
DevicePlatform["Android"] = "2";
})(DevicePlatform = exports.DevicePlatform || (exports.DevicePlatform = {}));
var ClientType;
(function (ClientType) {
ClientType["App"] = "app";
ClientType["Devtools"] = "devtools";
ClientType["Unknown"] = "unknown";
})(ClientType = exports.ClientType || (exports.ClientType = {}));
var ClientRole;
(function (ClientRole) {
ClientRole["Android"] = "android_client";
ClientRole["Devtools"] = "devtools";
ClientRole["IOS"] = "ios_client";
ClientRole["HMRClient"] = "hmr_client";
ClientRole["HMRServer"] = "hmr_server";
// vue devtools
ClientRole["JSRuntime"] = "js_runtime";
// vanilla js devtools
ClientRole["VanillaJSRuntime"] = "vanilla_js_runtime";
// react devtools
ClientRole["ReactJSRuntime"] = "react_js_runtime";
// frontend vue devtools tab
ClientRole["VueDevtools"] = "vue_devtools";
ClientRole["ReactDevtools"] = "react_devtools";
})(ClientRole = exports.ClientRole || (exports.ClientRole = {}));
/**
* flame chart frame type
*/
var PH;
(function (PH) {
PH["Begin"] = "B";
PH["End"] = "E";
PH["MetaData"] = "M";
PH["Complete"] = "X";
})(PH = exports.PH || (exports.PH = {}));
var DeviceManagerEvent;
(function (DeviceManagerEvent) {
DeviceManagerEvent["AddDevice"] = "addDevice";
DeviceManagerEvent["RemoveDevice"] = "removeDevice";
DeviceManagerEvent["AppDidDisConnect"] = "appDidDisConnect";
DeviceManagerEvent["AppDidConnect"] = "appDidConnect";
DeviceManagerEvent["GetDeviceList"] = "getDeviceList";
})(DeviceManagerEvent = exports.DeviceManagerEvent || (exports.DeviceManagerEvent = {}));
var ChromePageType;
(function (ChromePageType) {
ChromePageType["Page"] = "page";
ChromePageType["Node"] = "node";
})(ChromePageType = exports.ChromePageType || (exports.ChromePageType = {}));
var MiddlewareType;
(function (MiddlewareType) {
MiddlewareType["Upward"] = "upward";
MiddlewareType["Downward"] = "downward";
})(MiddlewareType = exports.MiddlewareType || (exports.MiddlewareType = {}));
var DBType;
(function (DBType) {
DBType["Redis"] = "redis";
DBType["Memory"] = "memory";
})(DBType = exports.DBType || (exports.DBType = {}));
var WinstonColor;
(function (WinstonColor) {
WinstonColor["BgRed"] = "bgRed";
WinstonColor["Black"] = "black";
WinstonColor["Red"] = "red";
WinstonColor["Green"] = "green";
WinstonColor["Yellow"] = "yellow";
WinstonColor["Blue"] = "blue";
WinstonColor["Magenta"] = "magenta";
WinstonColor["Cyan"] = "cyan";
WinstonColor["White"] = "white";
WinstonColor["Gray"] = "gray";
WinstonColor["Grey"] = "grey";
WinstonColor["BrightRed"] = "brightRed";
WinstonColor["BrightGreen"] = "brightGreen";
WinstonColor["BrightYellow"] = "brightYellow";
WinstonColor["BrightBlue"] = "brightBlue";
WinstonColor["BrightMagenta"] = "brightMagenta";
WinstonColor["BrightCyan"] = "brightCyan";
WinstonColor["BrightWhite"] = "brightWhite";
})(WinstonColor = exports.WinstonColor || (exports.WinstonColor = {}));
var InternalChannelEvent;
(function (InternalChannelEvent) {
InternalChannelEvent["AppWSClose"] = "AppWSClose";
InternalChannelEvent["DevtoolsConnected"] = "DevtoolsConnected";
})(InternalChannelEvent = exports.InternalChannelEvent || (exports.InternalChannelEvent = {}));
var ChromeLogLevel;
(function (ChromeLogLevel) {
ChromeLogLevel["Info"] = "info";
ChromeLogLevel["Error"] = "error";
ChromeLogLevel["Verbose"] = "verbose";
ChromeLogLevel["Warning"] = "warning";
})(ChromeLogLevel = exports.ChromeLogLevel || (exports.ChromeLogLevel = {}));
var OSType;
(function (OSType) {
OSType["Darwin"] = "Darwin";
OSType["Linux"] = "Linux";
OSType["Windows"] = "Windows_NT";
})(OSType = exports.OSType || (exports.OSType = {}));
var HMREvent;
(function (HMREvent) {
HMREvent["Hot"] = "hot";
HMREvent["LiveReload"] = "liveReload";
HMREvent["Invalid"] = "invalid";
HMREvent["Hash"] = "hash";
HMREvent["Logging"] = "logging";
HMREvent["Overlay"] = "overlay";
HMREvent["Reconnect"] = "reconnect";
HMREvent["Progress"] = "progress";
HMREvent["Ok"] = "ok";
HMREvent["Warnings"] = "warnings";
HMREvent["Errors"] = "errors";
HMREvent["Error"] = "error";
HMREvent["Close"] = "close";
HMREvent["ProgressUpdate"] = "progress-update";
HMREvent["StillOk"] = "still-ok";
HMREvent["ContentChanged"] = "content-changed";
HMREvent["StaticChanged"] = "static-changed";
HMREvent["TransferFile"] = "transfer-file";
})(HMREvent = exports.HMREvent || (exports.HMREvent = {}));
var WSCode;
(function (WSCode) {
// close without close frame, such as app is killed, or adb disconnected
WSCode[WSCode["CloseAbnormal"] = 1006] = "CloseAbnormal";
WSCode[WSCode["InvalidRequestParams"] = 4000] = "InvalidRequestParams";
WSCode[WSCode["HMRServerClosed"] = 4001] = "HMRServerClosed";
WSCode[WSCode["NoDebugTarget"] = 4002] = "NoDebugTarget";
WSCode[WSCode["ClosePage"] = 4003] = "ClosePage";
WSCode[WSCode["ReloadPage"] = 4004] = "ReloadPage";
WSCode[WSCode["AppClientDestroyed"] = 4005] = "AppClientDestroyed";
})(WSCode = exports.WSCode || (exports.WSCode = {}));
var StaticFileStorage;
(function (StaticFileStorage) {
StaticFileStorage["Local"] = "local";
StaticFileStorage["COS"] = "COS";
})(StaticFileStorage = exports.StaticFileStorage || (exports.StaticFileStorage = {}));
var ReportEvent;
(function (ReportEvent) {
ReportEvent["StartDev"] = "start-dev";
ReportEvent["RemoteDebug"] = "remote-debug";
ReportEvent["DisRemoteDebug"] = "dis-remote-debug";
ReportEvent["ConnectFrontend"] = "connect-frontend";
ReportEvent["ConnectFrontend2"] = "connect-frontend2";
ReportEvent["DisConnectFrontend"] = "disconnect-frontend";
ReportEvent["UpdateContext"] = "update-context";
ReportEvent["HMR"] = "hmr";
ReportEvent["COSUpload"] = "cos-upload";
ReportEvent["RemoteHMR"] = "remote-hmr";
ReportEvent["VueDevtools"] = "vue-devtools";
ReportEvent["ReactDevtools"] = "react-devtools";
ReportEvent["VanillaJSRuntime"] = "vanilla_js_runtime";
ReportEvent["VanillaIOSJSRuntime"] = "vanilla_ios_js_runtime";
ReportEvent["DevtoolsToDebugServer"] = "devtools-to-debug-server";
ReportEvent["DebugServerToDevtools"] = "debug-server-to-devtools";
ReportEvent["PubSub"] = "pub-sub";
ReportEvent["RedisConnection"] = "redis-connection";
ReportEvent["RedisError"] = "redis-error";
ReportEvent["CDPTotal"] = "CDP-total";
ReportEvent["HMRPCToServer"] = "HMR-PC-to-server";
ReportEvent["HMRServerToApp"] = "HMR-server-to-app";
ReportEvent["HMRTotal"] = "HMR-total";
})(ReportEvent = exports.ReportEvent || (exports.ReportEvent = {}));
var HMRReportExt2;
(function (HMRReportExt2) {
HMRReportExt2["Server"] = "server";
HMRReportExt2["Client"] = "client";
})(HMRReportExt2 = exports.HMRReportExt2 || (exports.HMRReportExt2 = {}));
var HMRSyncType;
(function (HMRSyncType) {
HMRSyncType["FirstTime"] = "first-time";
HMRSyncType["Patch"] = "patch";
})(HMRSyncType = exports.HMRSyncType || (exports.HMRSyncType = {}));
var LogLevel;
(function (LogLevel) {
LogLevel["Error"] = "error";
LogLevel["Warn"] = "warn";
LogLevel["Info"] = "info";
LogLevel["Http"] = "http";
LogLevel["Verbose"] = "verbose";
LogLevel["Debug"] = "debug";
LogLevel["Silly"] = "silly";
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
var GatewayFamily;
(function (GatewayFamily) {
GatewayFamily["V4"] = "v4";
GatewayFamily["V6"] = "v6";
})(GatewayFamily = exports.GatewayFamily || (exports.GatewayFamily = {}));
var AppDriverType;
(function (AppDriverType) {
AppDriverType["React"] = "React";
AppDriverType["Vue"] = "Vue";
AppDriverType["Other"] = "Other";
})(AppDriverType = exports.AppDriverType || (exports.AppDriverType = {}));