@lynx-js/devtool-connector 0.13.1 → 0.16.2
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/CHANGELOG.md +13 -0
- package/LICENSE +1 -1
- package/README.md +18 -134
- package/dist/2.js +2019 -0
- package/dist/{346.js → a.js} +102 -143
- package/dist/client-id.d.ts +0 -6
- package/dist/command/client.d.ts +8 -7
- package/dist/command/contract.d.ts +82 -24
- package/dist/command/core.d.ts +11 -10
- package/dist/command/in-process-client.d.ts +16 -0
- package/dist/command/index.d.ts +28 -20
- package/dist/command/index.js +177 -159
- package/dist/command/list-clients.d.ts +6 -0
- package/dist/command/list-sessions.d.ts +5 -0
- package/dist/command/open.d.ts +5 -0
- package/dist/command/query.d.ts +1 -1
- package/dist/command/reactlynx/controller.d.ts +3 -3
- package/dist/command/reactlynx/model.d.ts +7 -7
- package/dist/command/reactlynx/protocol.d.ts +0 -1
- package/dist/command/reactlynx/session.d.ts +3 -3
- package/dist/command/reactlynx/types.d.ts +7 -7
- package/dist/command/ref-actions.d.ts +4 -4
- package/dist/command/result.d.ts +0 -1
- package/dist/command/screenshot-annotation.d.ts +2 -2
- package/dist/command/screenshot.d.ts +2 -2
- package/dist/command/snapshot.d.ts +2 -2
- package/dist/command/source-info.d.ts +20 -0
- package/dist/command/targets.d.ts +8 -10
- package/dist/command/timeout.d.ts +3 -0
- package/dist/command/wait-for-client.d.ts +5 -0
- package/dist/daemon/device-connection.d.ts +4 -3
- package/dist/daemon/entry.js +18 -20
- package/dist/daemon/index.d.ts +7 -2
- package/dist/daemon/index.js +7 -3
- package/dist/daemon/inspector-assets.d.ts +11 -0
- package/dist/daemon/manager.d.ts +12 -4
- package/dist/daemon/protocol.d.ts +20 -16
- package/dist/daemon/server.d.ts +7 -1
- package/dist/daemon/static-server.d.ts +3 -1
- package/dist/f.js +5790 -0
- package/dist/f1.js +737 -0
- package/dist/{962.js → h.js} +841 -3259
- package/dist/{712.js → hb.js} +26 -19
- package/dist/i.js +2505 -0
- package/dist/index.d.ts +13 -18
- package/dist/index.js +3 -2
- package/dist/main.d.ts +2 -0
- package/dist/main.js +3 -0
- package/dist/request-id.d.ts +1 -0
- package/dist/streams/cdp.d.ts +3 -3
- package/dist/streams/customized.d.ts +5 -5
- package/dist/streams/index.d.ts +4 -3
- package/dist/streams/index.js +1 -1
- package/dist/streams/utils.d.ts +3 -3
- package/dist/{872.js → t.js} +364 -301
- package/dist/transport/adb-shell-types.d.ts +14 -0
- package/dist/transport/android-app-icon-helper.d.ts +1 -0
- package/dist/transport/android.d.ts +13 -3
- package/dist/transport/base.d.ts +2 -9
- package/dist/transport/daemon.d.ts +3 -2
- package/dist/transport/desktop.d.ts +1 -1
- package/dist/transport/hdt.d.ts +13 -0
- package/dist/transport/index.d.ts +9 -9
- package/dist/transport/index.js +2 -3
- package/dist/transport/ios.d.ts +2 -2
- package/dist/transport/peertalk.d.ts +4 -3
- package/dist/transport/stream-lifecycle.d.ts +4 -0
- package/dist/transport/transport.d.ts +4 -8
- package/dist/transport/usbmux.d.ts +5 -5
- package/dist/transport/ws-stream.d.ts +3 -10
- package/dist/types.d.ts +27 -54
- package/dist/{63.js → ws-stream.js} +23 -24
- package/package.json +32 -22
- package/dist/390.js +0 -329
- package/dist/556.js +0 -258
- package/dist/61.js +0 -3432
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ReadableStream, type TransformStream } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { ReadableStream, type TransformStream } from "node:stream/web";
|
|
2
|
+
import { CDPOutputTransformStream, CDPRequestTransformStream, CDPResponseTransformStream } from "./streams/cdp.js";
|
|
3
|
+
export { CDPOutputTransformStream, CDPRequestTransformStream, CDPResponseTransformStream };
|
|
4
|
+
import { ClientId } from "./client-id.js";
|
|
5
|
+
import type { App, Client, Device, OpenAppOptions, Transport } from "./transport/transport.js";
|
|
6
|
+
import { type CDPRequestMessage, type GlobalKeys, type HeadlessPrepareState, type ListSessionResponse, type Session } from "./types.js";
|
|
6
7
|
interface OutputStream<O> extends AsyncDisposable, ReadableStream<O> {
|
|
7
8
|
inputClosed: Promise<void>;
|
|
8
9
|
}
|
|
@@ -19,15 +20,6 @@ export declare class Connector {
|
|
|
19
20
|
listAvailableApps(deviceId: string): Promise<App[]>;
|
|
20
21
|
openApp(deviceId: string, packageName: string, options?: OpenAppOptions): Promise<string>;
|
|
21
22
|
sendMessage<T, R>(clientId: string, message: T, pipeline?: Pipeline): Promise<R>;
|
|
22
|
-
/**
|
|
23
|
-
* Send a message to the device without waiting for a response.
|
|
24
|
-
*
|
|
25
|
-
* Unlike {@link sendMessage}, this method does not wait for the output
|
|
26
|
-
* stream to produce a value. It connects, writes the message, and then
|
|
27
|
-
* disposes of the connection. This is useful for fire-and-forget messages
|
|
28
|
-
* such as `xdb_proxy_config` where the device does not send a reply.
|
|
29
|
-
*/
|
|
30
|
-
sendMessageNoReply<T>(clientId: string, message: T): Promise<void>;
|
|
31
23
|
sendAppMessage<Output, Params = never>(clientId: string, method: string, params?: Params): Promise<Output>;
|
|
32
24
|
/**
|
|
33
25
|
* Open a page on the given client by sending an `OpenCard` Customized event.
|
|
@@ -49,16 +41,17 @@ export declare class Connector {
|
|
|
49
41
|
* single request timeout. A transient `error` is tolerated until the overall
|
|
50
42
|
* deadline because the transport retries the download on the next poll.
|
|
51
43
|
*
|
|
52
|
-
* Intended to be called
|
|
53
|
-
*
|
|
44
|
+
* Intended to be called by the open ActionCore command before opening a page
|
|
45
|
+
* on the headless client.
|
|
54
46
|
*/
|
|
55
47
|
waitForHeadlessReady(clientId: string, options?: {
|
|
56
48
|
timeoutMs?: number;
|
|
57
49
|
pollIntervalMs?: number;
|
|
50
|
+
signal?: AbortSignal;
|
|
58
51
|
}): Promise<void>;
|
|
59
52
|
getGlobalSwitch(clientId: string, key: GlobalKeys): Promise<boolean>;
|
|
60
53
|
setGlobalSwitch(clientId: string, key: GlobalKeys, value: boolean): Promise<void>;
|
|
61
|
-
sendStream<I, O>(clientId: string, inputStream: ReadableStream<I>, { signal, pipeline
|
|
54
|
+
sendStream<I, O>(clientId: string, inputStream: ReadableStream<I>, { signal, pipeline }?: {
|
|
62
55
|
signal?: AbortSignal | undefined;
|
|
63
56
|
pipeline?: Pipeline | undefined;
|
|
64
57
|
}): Promise<OutputStream<O>>;
|
|
@@ -66,4 +59,6 @@ export declare class Connector {
|
|
|
66
59
|
signal?: AbortSignal;
|
|
67
60
|
}): Promise<OutputStream<CDPRequestMessage>>;
|
|
68
61
|
}
|
|
69
|
-
export * from
|
|
62
|
+
export * from "./types.js";
|
|
63
|
+
export type { ClientTarget } from "./client-id.js";
|
|
64
|
+
export { nextRequestId } from "./request-id.js";
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { CDPOutputTransformStream, CDPRequestTransformStream, CDPResponseTransformStream, createCorrelatedFilter, isCustomizedResponseWithType, isGetGlobalSwitchResponse, isHeadlessPrepareResponse, isInitializeResponse, isListSessionResponse, isSetGlobalSwitchResponse } from "./
|
|
2
|
-
export { ClientId
|
|
1
|
+
export { CDPOutputTransformStream, CDPRequestTransformStream, CDPResponseTransformStream, createCorrelatedFilter, isCustomizedResponseWithType, isGetGlobalSwitchResponse, isHeadlessPrepareResponse, isInitializeResponse, isListSessionResponse, isSetGlobalSwitchResponse, nextRequestId } from "./hb.js";
|
|
2
|
+
export { ClientId } from "./f1.js";
|
|
3
|
+
export { Connector } from "./a.js";
|
package/dist/main.d.ts
ADDED
package/dist/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nextRequestId(): number;
|
package/dist/streams/cdp.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { CDPRequestMessage, CDPResponseMessage } from
|
|
2
|
-
import { CustomizedRequestTransformStream, CustomizedResponseTransformStream, ResponseParserTransformStream } from
|
|
1
|
+
import type { CDPRequestMessage, CDPResponseMessage } from "../types.js";
|
|
2
|
+
import { CustomizedRequestTransformStream, CustomizedResponseTransformStream, ResponseParserTransformStream } from "./customized.js";
|
|
3
3
|
export declare class CDPRequestTransformStream extends CustomizedRequestTransformStream<CDPRequestMessage> {
|
|
4
4
|
constructor(sessionId: number, fixedId?: number);
|
|
5
5
|
}
|
|
6
|
-
export declare class CDPResponseTransformStream<Output = CDPResponseMessage> extends CustomizedResponseTransformStream<
|
|
6
|
+
export declare class CDPResponseTransformStream<Output = CDPResponseMessage> extends CustomizedResponseTransformStream<"CDP", Output> {
|
|
7
7
|
constructor(id?: number);
|
|
8
8
|
}
|
|
9
9
|
export declare class CDPOutputTransformStream<Output> extends ResponseParserTransformStream<CDPResponseMessage, Output> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TransformStream } from
|
|
2
|
-
import type { ClientTarget } from
|
|
3
|
-
import { type AppResponseMessage, type
|
|
1
|
+
import { TransformStream } from "node:stream/web";
|
|
2
|
+
import type { ClientTarget } from "../client-id.js";
|
|
3
|
+
import { type AppResponseMessage, type CustomizedResponse, type CustomizedResponseMessageMap, type Response } from "../types.js";
|
|
4
4
|
export declare class CustomizedClientIdTransformStream extends TransformStream {
|
|
5
5
|
constructor(clientId: ClientTarget);
|
|
6
6
|
}
|
|
@@ -11,7 +11,7 @@ export declare class CustomizedRequestTransformStream<T = unknown> extends Trans
|
|
|
11
11
|
messageBuilder: (chunk: T) => unknown;
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
export declare class CustomizedResponseTransformStream<T extends
|
|
14
|
+
export declare class CustomizedResponseTransformStream<T extends string, Output = T extends keyof CustomizedResponseMessageMap ? CustomizedResponseMessageMap[T] : unknown, Input extends Response | CustomizedResponse = Response | CustomizedResponse> extends TransformStream<Input, Output> {
|
|
15
15
|
constructor(type: T, id?: number);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -30,5 +30,5 @@ export declare class GlobalSwitchRequestTransformStream extends CustomizedReques
|
|
|
30
30
|
key: string;
|
|
31
31
|
value?: boolean;
|
|
32
32
|
}> {
|
|
33
|
-
constructor(type:
|
|
33
|
+
constructor(type: "SetGlobalSwitch" | "GetGlobalSwitch");
|
|
34
34
|
}
|
package/dist/streams/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export { nextRequestId } from "../request-id.js";
|
|
2
|
+
export * from "./cdp.js";
|
|
3
|
+
export * from "./customized.js";
|
|
4
|
+
export * from "./utils.js";
|
package/dist/streams/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AppResponseTransformStream, CDPOutputTransformStream, CDPRequestTransformStream, CDPResponseTransformStream, CustomizedClientIdTransformStream, CustomizedRequestTransformStream, CustomizedResponseTransformStream, FilterTransformStream, GlobalSwitchRequestTransformStream, InspectStream, ResponseParserTransformStream, SessionGuardTransformStream } from "../
|
|
1
|
+
export { AppResponseTransformStream, CDPOutputTransformStream, CDPRequestTransformStream, CDPResponseTransformStream, CustomizedClientIdTransformStream, CustomizedRequestTransformStream, CustomizedResponseTransformStream, FilterTransformStream, GlobalSwitchRequestTransformStream, InspectStream, ResponseParserTransformStream, SessionGuardTransformStream, nextRequestId } from "../hb.js";
|
package/dist/streams/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TransformStream } from
|
|
2
|
-
import type { Response } from
|
|
1
|
+
import { TransformStream } from "node:stream/web";
|
|
2
|
+
import type { CustomizedResponse, Response } from "../types.js";
|
|
3
3
|
export declare class FilterTransformStream<T, P extends T> extends TransformStream<T, P> {
|
|
4
4
|
constructor(filter: (chunk: T) => chunk is P);
|
|
5
5
|
}
|
|
@@ -13,6 +13,6 @@ export declare class InspectStream<T> extends TransformStream<T, T> {
|
|
|
13
13
|
* though the underlying transport connection remains open (shared with other
|
|
14
14
|
* sessions on the same device:port).
|
|
15
15
|
*/
|
|
16
|
-
export declare class SessionGuardTransformStream extends TransformStream<
|
|
16
|
+
export declare class SessionGuardTransformStream<Input extends Response | CustomizedResponse = Response> extends TransformStream<Input, Input> {
|
|
17
17
|
constructor(sessionId: number);
|
|
18
18
|
}
|