@lynx-js/devtool-connector 0.9.5 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/346.js +635 -0
- package/dist/390.js +262 -35
- package/dist/556.js +9 -4
- package/dist/61.js +3432 -0
- package/dist/63.js +112 -30
- package/dist/712.js +28 -2
- package/dist/872.js +552 -122
- package/dist/962.js +25 -17
- package/dist/client-discovery-errors.d.ts +1 -0
- package/dist/client-id.d.ts +9 -2
- package/dist/command/client.d.ts +28 -0
- package/dist/command/contract.d.ts +255 -0
- package/dist/command/core.d.ts +32 -0
- package/dist/command/index.d.ts +20 -0
- package/dist/command/index.js +224 -0
- package/dist/command/query.d.ts +5 -0
- package/dist/command/reactlynx/controller.d.ts +71 -0
- package/dist/command/reactlynx/model.d.ts +48 -0
- package/dist/command/reactlynx/protocol.d.ts +40 -0
- package/dist/command/reactlynx/session.d.ts +43 -0
- package/dist/command/reactlynx/types.d.ts +73 -0
- package/dist/command/ref-actions.d.ts +17 -0
- package/dist/command/result.d.ts +29 -0
- package/dist/command/screenshot-annotation.d.ts +22 -0
- package/dist/command/screenshot.d.ts +28 -0
- package/dist/command/snapshot.d.ts +79 -0
- package/dist/command/targets.d.ts +15 -0
- package/dist/daemon/device-connection.d.ts +3 -1
- package/dist/daemon/entry.js +11 -0
- package/dist/daemon/index.d.ts +1 -0
- package/dist/daemon/index.js +3 -0
- package/dist/daemon/manager.d.ts +11 -9
- package/dist/daemon/protocol.d.ts +24 -3
- package/dist/daemon/server.d.ts +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +2 -454
- package/dist/streams/customized.d.ts +2 -1
- package/dist/transport/android.d.ts +1 -1
- package/dist/transport/desktop.d.ts +1 -1
- package/dist/transport/index.js +2 -2
- package/dist/transport/ios.d.ts +1 -1
- package/dist/transport/transport.d.ts +7 -1
- package/dist/transport/ws-stream.d.ts +9 -0
- package/dist/types.d.ts +35 -0
- package/package.json +10 -2
- package/dist/187.js +0 -272
- package/dist/43.js +0 -20
- package/dist/677.js +0 -19
package/dist/187.js
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { isatty } from "node:tty";
|
|
2
|
-
import { formatWithOptions, inspect } from "node:util";
|
|
3
|
-
function coerce(value) {
|
|
4
|
-
if (value instanceof Error) return value.stack || value.message;
|
|
5
|
-
return value;
|
|
6
|
-
}
|
|
7
|
-
function selectColor(colors, namespace) {
|
|
8
|
-
let hash = 0;
|
|
9
|
-
for(let i = 0; i < namespace.length; i++){
|
|
10
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
11
|
-
hash |= 0;
|
|
12
|
-
}
|
|
13
|
-
return colors[Math.abs(hash) % colors.length];
|
|
14
|
-
}
|
|
15
|
-
function matchesTemplate(search, template) {
|
|
16
|
-
let searchIndex = 0;
|
|
17
|
-
let templateIndex = 0;
|
|
18
|
-
let starIndex = -1;
|
|
19
|
-
let matchIndex = 0;
|
|
20
|
-
while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || "*" === template[templateIndex])) if ("*" === template[templateIndex]) {
|
|
21
|
-
starIndex = templateIndex;
|
|
22
|
-
matchIndex = searchIndex;
|
|
23
|
-
templateIndex++;
|
|
24
|
-
} else {
|
|
25
|
-
searchIndex++;
|
|
26
|
-
templateIndex++;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
if (-1 === starIndex) return false;
|
|
30
|
-
templateIndex = starIndex + 1;
|
|
31
|
-
matchIndex++;
|
|
32
|
-
searchIndex = matchIndex;
|
|
33
|
-
}
|
|
34
|
-
while(templateIndex < template.length && "*" === template[templateIndex])templateIndex++;
|
|
35
|
-
return templateIndex === template.length;
|
|
36
|
-
}
|
|
37
|
-
function humanize(value) {
|
|
38
|
-
if (value >= 1e3) return `${(value / 1e3).toFixed(1)}s`;
|
|
39
|
-
return `${value}ms`;
|
|
40
|
-
}
|
|
41
|
-
let globalNamespaces = "";
|
|
42
|
-
function createDebug(namespace, options) {
|
|
43
|
-
let prevTime;
|
|
44
|
-
let enableOverride;
|
|
45
|
-
let namespacesCache;
|
|
46
|
-
let enabledCache;
|
|
47
|
-
const debug = (...args)=>{
|
|
48
|
-
if (!debug.enabled) return;
|
|
49
|
-
const curr = Date.now();
|
|
50
|
-
const diff = curr - (prevTime || curr);
|
|
51
|
-
prevTime = curr;
|
|
52
|
-
args[0] = coerce(args[0]);
|
|
53
|
-
if ("string" != typeof args[0]) args.unshift("%O");
|
|
54
|
-
let index = 0;
|
|
55
|
-
args[0] = args[0].replace(/%([a-z%])/gi, (match, format)=>{
|
|
56
|
-
if ("%%" === match) return "%";
|
|
57
|
-
index++;
|
|
58
|
-
const formatter = options.formatters[format];
|
|
59
|
-
if ("function" == typeof formatter) {
|
|
60
|
-
const value = args[index];
|
|
61
|
-
match = formatter.call(debug, value);
|
|
62
|
-
args.splice(index, 1);
|
|
63
|
-
index--;
|
|
64
|
-
}
|
|
65
|
-
return match;
|
|
66
|
-
});
|
|
67
|
-
options.formatArgs.call(debug, diff, args);
|
|
68
|
-
debug.log(...args);
|
|
69
|
-
};
|
|
70
|
-
debug.extend = function(namespace, delimiter = ":") {
|
|
71
|
-
return createDebug(this.namespace + delimiter + namespace, {
|
|
72
|
-
useColors: this.useColors,
|
|
73
|
-
color: this.color,
|
|
74
|
-
formatArgs: this.formatArgs,
|
|
75
|
-
formatters: this.formatters,
|
|
76
|
-
inspectOpts: this.inspectOpts,
|
|
77
|
-
log: this.log,
|
|
78
|
-
humanize: this.humanize
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
Object.assign(debug, options);
|
|
82
|
-
debug.namespace = namespace;
|
|
83
|
-
Object.defineProperty(debug, "enabled", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
configurable: false,
|
|
86
|
-
get: ()=>{
|
|
87
|
-
if (null != enableOverride) return enableOverride;
|
|
88
|
-
if (namespacesCache !== globalNamespaces) {
|
|
89
|
-
namespacesCache = globalNamespaces;
|
|
90
|
-
enabledCache = enabled(namespace);
|
|
91
|
-
}
|
|
92
|
-
return enabledCache;
|
|
93
|
-
},
|
|
94
|
-
set: (v)=>{
|
|
95
|
-
enableOverride = v;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
return debug;
|
|
99
|
-
}
|
|
100
|
-
let names = [];
|
|
101
|
-
let skips = [];
|
|
102
|
-
function enable(namespaces) {
|
|
103
|
-
globalNamespaces = namespaces;
|
|
104
|
-
names = [];
|
|
105
|
-
skips = [];
|
|
106
|
-
const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
107
|
-
for (const ns of split)if ("-" === ns[0]) skips.push(ns.slice(1));
|
|
108
|
-
else names.push(ns);
|
|
109
|
-
}
|
|
110
|
-
function enabled(name) {
|
|
111
|
-
for (const skip of skips)if (matchesTemplate(name, skip)) return false;
|
|
112
|
-
for (const ns of names)if (matchesTemplate(name, ns)) return true;
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
const node_colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
|
|
116
|
-
20,
|
|
117
|
-
21,
|
|
118
|
-
26,
|
|
119
|
-
27,
|
|
120
|
-
32,
|
|
121
|
-
33,
|
|
122
|
-
38,
|
|
123
|
-
39,
|
|
124
|
-
40,
|
|
125
|
-
41,
|
|
126
|
-
42,
|
|
127
|
-
43,
|
|
128
|
-
44,
|
|
129
|
-
45,
|
|
130
|
-
56,
|
|
131
|
-
57,
|
|
132
|
-
62,
|
|
133
|
-
63,
|
|
134
|
-
68,
|
|
135
|
-
69,
|
|
136
|
-
74,
|
|
137
|
-
75,
|
|
138
|
-
76,
|
|
139
|
-
77,
|
|
140
|
-
78,
|
|
141
|
-
79,
|
|
142
|
-
80,
|
|
143
|
-
81,
|
|
144
|
-
92,
|
|
145
|
-
93,
|
|
146
|
-
98,
|
|
147
|
-
99,
|
|
148
|
-
112,
|
|
149
|
-
113,
|
|
150
|
-
128,
|
|
151
|
-
129,
|
|
152
|
-
134,
|
|
153
|
-
135,
|
|
154
|
-
148,
|
|
155
|
-
149,
|
|
156
|
-
160,
|
|
157
|
-
161,
|
|
158
|
-
162,
|
|
159
|
-
163,
|
|
160
|
-
164,
|
|
161
|
-
165,
|
|
162
|
-
166,
|
|
163
|
-
167,
|
|
164
|
-
168,
|
|
165
|
-
169,
|
|
166
|
-
170,
|
|
167
|
-
171,
|
|
168
|
-
172,
|
|
169
|
-
173,
|
|
170
|
-
178,
|
|
171
|
-
179,
|
|
172
|
-
184,
|
|
173
|
-
185,
|
|
174
|
-
196,
|
|
175
|
-
197,
|
|
176
|
-
198,
|
|
177
|
-
199,
|
|
178
|
-
200,
|
|
179
|
-
201,
|
|
180
|
-
202,
|
|
181
|
-
203,
|
|
182
|
-
204,
|
|
183
|
-
205,
|
|
184
|
-
206,
|
|
185
|
-
207,
|
|
186
|
-
208,
|
|
187
|
-
209,
|
|
188
|
-
214,
|
|
189
|
-
215,
|
|
190
|
-
220,
|
|
191
|
-
221
|
|
192
|
-
] : [
|
|
193
|
-
6,
|
|
194
|
-
2,
|
|
195
|
-
3,
|
|
196
|
-
4,
|
|
197
|
-
5,
|
|
198
|
-
1
|
|
199
|
-
];
|
|
200
|
-
const inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
|
|
201
|
-
const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
|
|
202
|
-
let value = process.env[key];
|
|
203
|
-
const lowerCase = "string" == typeof value && value.toLowerCase();
|
|
204
|
-
value = "null" === value ? null : "yes" === lowerCase || "on" === lowerCase || "true" === lowerCase || "enabled" === lowerCase ? true : "no" === lowerCase || "off" === lowerCase || "false" === lowerCase || "disabled" === lowerCase ? false : Number(value);
|
|
205
|
-
obj[prop] = value;
|
|
206
|
-
return obj;
|
|
207
|
-
}, Object.create(null));
|
|
208
|
-
function node_useColors() {
|
|
209
|
-
return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
|
|
210
|
-
}
|
|
211
|
-
function getDate() {
|
|
212
|
-
if (inspectOpts.hideDate) return "";
|
|
213
|
-
return `${/* @__PURE__ */ new Date().toISOString()} `;
|
|
214
|
-
}
|
|
215
|
-
function formatArgs(diff, args) {
|
|
216
|
-
const { namespace: name, useColors } = this;
|
|
217
|
-
if (useColors) {
|
|
218
|
-
const c = this.color;
|
|
219
|
-
const colorCode = `\u001B[3${c < 8 ? c : `8;5;${c}`}`;
|
|
220
|
-
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
221
|
-
args[0] = prefix + args[0].split("\n").join(`\n${prefix}`);
|
|
222
|
-
args.push(`${colorCode}m+${this.humanize(diff)}\u001B[0m`);
|
|
223
|
-
} else args[0] = `${getDate()}${name} ${args[0]}`;
|
|
224
|
-
}
|
|
225
|
-
function log(...args) {
|
|
226
|
-
process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}\n`);
|
|
227
|
-
}
|
|
228
|
-
const defaultOptions = {
|
|
229
|
-
useColors: node_useColors(),
|
|
230
|
-
formatArgs: formatArgs,
|
|
231
|
-
formatters: {
|
|
232
|
-
o (v) {
|
|
233
|
-
this.inspectOpts.colors = this.useColors;
|
|
234
|
-
return inspect(v, this.inspectOpts).split("\n").map((str)=>str.trim()).join(" ");
|
|
235
|
-
},
|
|
236
|
-
O (v) {
|
|
237
|
-
this.inspectOpts.colors = this.useColors;
|
|
238
|
-
return inspect(v, this.inspectOpts);
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
inspectOpts: inspectOpts,
|
|
242
|
-
log: log,
|
|
243
|
-
humanize: humanize
|
|
244
|
-
};
|
|
245
|
-
function node_createDebug(namespace, options) {
|
|
246
|
-
var _ref;
|
|
247
|
-
const color = null != (_ref = options && options.color) ? _ref : selectColor(node_colors, namespace);
|
|
248
|
-
return createDebug(namespace, Object.assign(defaultOptions, {
|
|
249
|
-
color
|
|
250
|
-
}, options));
|
|
251
|
-
}
|
|
252
|
-
enable(process.env.DEBUG || "");
|
|
253
|
-
function isCustomizedMessage(msg) {
|
|
254
|
-
return 'object' == typeof msg && null !== msg && 'Customized' === msg.event;
|
|
255
|
-
}
|
|
256
|
-
function isControlRequest(msg) {
|
|
257
|
-
return 'object' == typeof msg && null !== msg && 'Control' === msg.event;
|
|
258
|
-
}
|
|
259
|
-
function isListClientsRequest(msg) {
|
|
260
|
-
return 'object' == typeof msg && null !== msg && 'ListClients' === msg.event;
|
|
261
|
-
}
|
|
262
|
-
function isPingEvent(msg) {
|
|
263
|
-
return 'object' == typeof msg && null !== msg && 'Ping' === msg.event;
|
|
264
|
-
}
|
|
265
|
-
function isRegisterEvent(msg) {
|
|
266
|
-
return 'object' == typeof msg && null !== msg && 'Register' === msg.event;
|
|
267
|
-
}
|
|
268
|
-
const DAEMON_WS_PATH = '/devtool/connector';
|
|
269
|
-
const DAEMON_VERSION_PATH = `${DAEMON_WS_PATH}/version`;
|
|
270
|
-
const DAEMON_SHUTDOWN_PATH = `${DAEMON_WS_PATH}/shutdown`;
|
|
271
|
-
const DAEMON_INSPECTOR_PATH = `${DAEMON_WS_PATH}/inspector`;
|
|
272
|
-
export { DAEMON_INSPECTOR_PATH, DAEMON_SHUTDOWN_PATH, DAEMON_VERSION_PATH, DAEMON_WS_PATH, isControlRequest, isCustomizedMessage, isListClientsRequest, isPingEvent, isRegisterEvent, node_createDebug };
|
package/dist/43.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
class ClientId {
|
|
2
|
-
static serialize(deviceId, port) {
|
|
3
|
-
return `${encodeURIComponent(deviceId)}:${port}`;
|
|
4
|
-
}
|
|
5
|
-
static deserialize(clientId) {
|
|
6
|
-
try {
|
|
7
|
-
const lastColonIndex = clientId.lastIndexOf(':');
|
|
8
|
-
if (-1 === lastColonIndex) return null;
|
|
9
|
-
const port = Number.parseInt(clientId.substring(lastColonIndex + 1), 10);
|
|
10
|
-
if (Number.isNaN(port)) return null;
|
|
11
|
-
return {
|
|
12
|
-
deviceId: decodeURIComponent(clientId.substring(0, lastColonIndex)),
|
|
13
|
-
port
|
|
14
|
-
};
|
|
15
|
-
} catch {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export { ClientId };
|
package/dist/677.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function isInitializeResponse(response) {
|
|
2
|
-
return 'Register' === response.event;
|
|
3
|
-
}
|
|
4
|
-
function isHeadlessPrepareResponse(response) {
|
|
5
|
-
return 'Customized' === response.event && 'HeadlessPrepare' === response.data.type;
|
|
6
|
-
}
|
|
7
|
-
function isListSessionResponse(response) {
|
|
8
|
-
return 'Customized' === response.event && 'SessionList' === response.data.type;
|
|
9
|
-
}
|
|
10
|
-
function isGetGlobalSwitchResponse(response) {
|
|
11
|
-
return 'Customized' === response.event && 'GetGlobalSwitch' === response.data.type;
|
|
12
|
-
}
|
|
13
|
-
function isSetGlobalSwitchResponse(response) {
|
|
14
|
-
return 'Customized' === response.event && 'SetGlobalSwitch' === response.data.type;
|
|
15
|
-
}
|
|
16
|
-
function isCustomizedResponseWithType(response, type) {
|
|
17
|
-
return 'Customized' === response.event && response.data.type === type;
|
|
18
|
-
}
|
|
19
|
-
export { isCustomizedResponseWithType, isGetGlobalSwitchResponse, isHeadlessPrepareResponse, isInitializeResponse, isListSessionResponse, isSetGlobalSwitchResponse };
|