@yume-chan/adb-daemon-webusb 0.0.24 → 1.0.0
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 +37 -1
- package/README.md +6 -3
- package/esm/device.d.ts +11 -14
- package/esm/device.d.ts.map +1 -1
- package/esm/device.js +43 -52
- package/esm/device.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/manager.d.ts +6 -25
- package/esm/manager.d.ts.map +1 -1
- package/esm/manager.js +30 -60
- package/esm/manager.js.map +1 -1
- package/esm/observer.d.ts +17 -0
- package/esm/observer.d.ts.map +1 -0
- package/esm/observer.js +54 -0
- package/esm/observer.js.map +1 -0
- package/esm/utils.d.ts +22 -5
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js +76 -5
- package/esm/utils.js.map +1 -1
- package/package.json +13 -9
- package/src/device.ts +53 -65
- package/src/index.ts +1 -1
- package/src/manager.ts +49 -75
- package/src/observer.ts +90 -0
- package/src/utils.ts +142 -18
- package/tsconfig.build.json +2 -13
- package/tsconfig.build.tsbuildinfo +1 -1
- package/CHANGELOG.json +0 -199
- package/esm/watcher.d.ts +0 -7
- package/esm/watcher.d.ts.map +0 -1
- package/esm/watcher.js +0 -21
- package/esm/watcher.js.map +0 -1
- package/src/watcher.ts +0 -28
package/CHANGELOG.json
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@yume-chan/adb-daemon-webusb",
|
|
3
|
-
"entries": [
|
|
4
|
-
{
|
|
5
|
-
"version": "0.0.24",
|
|
6
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.24",
|
|
7
|
-
"date": "Tue, 18 Jun 2024 02:49:43 GMT",
|
|
8
|
-
"comments": {}
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"version": "0.0.23",
|
|
12
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.23",
|
|
13
|
-
"date": "Thu, 21 Mar 2024 03:15:10 GMT",
|
|
14
|
-
"comments": {
|
|
15
|
-
"none": [
|
|
16
|
-
{
|
|
17
|
-
"comment": "Fix `AdbDaemonWebUsbDeviceManager.getDevices` doesn't match auto-generated serial number against `filters.serialNumber` (if the device doesn't have a serial number)"
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"version": "0.0.22",
|
|
24
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.22",
|
|
25
|
-
"date": "Wed, 13 Dec 2023 05:57:27 GMT",
|
|
26
|
-
"comments": {
|
|
27
|
-
"none": [
|
|
28
|
-
{
|
|
29
|
-
"comment": "Check incoming packet size to prevent Chrome from crashing"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"comment": "Add `exclusionFilters` option to `AdbDaemonWebUsbDeviceManager#requestDevice` method"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"comment": "`AdbDaemonWebUsbDevice` will generate a fake serial number from vid and pid if the device serial number is empty"
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"version": "0.0.21",
|
|
42
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.21",
|
|
43
|
-
"date": "Fri, 25 Aug 2023 14:05:18 GMT",
|
|
44
|
-
"comments": {}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"version": "0.0.20",
|
|
48
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.20",
|
|
49
|
-
"date": "Mon, 05 Jun 2023 02:51:41 GMT",
|
|
50
|
-
"comments": {
|
|
51
|
-
"none": [
|
|
52
|
-
{
|
|
53
|
-
"comment": "Use ECMAScript private class fields syntax (supported by Chrome 74, Firefox 90, Safari 14.1 and Node.js 12.0.0)."
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"comment": "Rename package to `@yume-chan/adb-daemon-webusb` following the renaming of `AdbDaemonTransport`."
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"comment": "Rename `AdbWebUsbBackend` to `AdbDaemonWebUsbDevice` following the renaming of `AdbDaemonTransport`."
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"comment": "Add Support for detecting device disconnects. It no longer throws an `NetworkError` when the device is disconnected."
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"comment": "Add `filters` parameter to `AdbDaemonWebUsbDeviceManager#getDevices`. The filtration is manually implemented because WebUSB's `getDevice` API doesn't support filters."
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"version": "0.0.19",
|
|
72
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.19",
|
|
73
|
-
"date": "Sun, 09 Apr 2023 05:55:33 GMT",
|
|
74
|
-
"comments": {
|
|
75
|
-
"none": [
|
|
76
|
-
{
|
|
77
|
-
"comment": "Remove stream queuing"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"comment": "Add the `AdbWebUsbBackendManager` class to simplify the usage with custom WebUSB implementations (for example the `usb` NPM package)."
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"version": "0.0.18",
|
|
87
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.18",
|
|
88
|
-
"date": "Wed, 25 Jan 2023 21:33:49 GMT",
|
|
89
|
-
"comments": {
|
|
90
|
-
"none": [
|
|
91
|
-
{
|
|
92
|
-
"comment": "Add an option to specify USB filters"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"version": "0.0.17",
|
|
99
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.17",
|
|
100
|
-
"date": "Tue, 18 Oct 2022 09:32:30 GMT",
|
|
101
|
-
"comments": {
|
|
102
|
-
"none": [
|
|
103
|
-
{
|
|
104
|
-
"comment": "Update to use new stream util package"
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"version": "0.0.16",
|
|
111
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.16",
|
|
112
|
-
"date": "Sat, 28 May 2022 03:56:37 GMT",
|
|
113
|
-
"comments": {
|
|
114
|
-
"none": [
|
|
115
|
-
{
|
|
116
|
-
"comment": "Upgrade TypeScript to 4.7.2 to enable Node.js ESM"
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"version": "0.0.15",
|
|
123
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.15",
|
|
124
|
-
"date": "Mon, 02 May 2022 04:18:01 GMT",
|
|
125
|
-
"comments": {
|
|
126
|
-
"none": [
|
|
127
|
-
{
|
|
128
|
-
"comment": "Improve connection lifecycle handling"
|
|
129
|
-
}
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"version": "0.0.14",
|
|
135
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.14",
|
|
136
|
-
"date": "Sat, 30 Apr 2022 14:05:48 GMT",
|
|
137
|
-
"comments": {}
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"version": "0.0.13",
|
|
141
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.13",
|
|
142
|
-
"date": "Thu, 28 Apr 2022 01:23:53 GMT",
|
|
143
|
-
"comments": {
|
|
144
|
-
"none": [
|
|
145
|
-
{
|
|
146
|
-
"comment": "Workaround an issue in Chrome where `transferIn` never returns `babble` on Windows"
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"version": "0.0.12",
|
|
153
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.12",
|
|
154
|
-
"date": "Sun, 03 Apr 2022 11:18:47 GMT",
|
|
155
|
-
"comments": {}
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"version": "0.0.11",
|
|
159
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.11",
|
|
160
|
-
"date": "Sun, 03 Apr 2022 10:54:15 GMT",
|
|
161
|
-
"comments": {
|
|
162
|
-
"none": [
|
|
163
|
-
{
|
|
164
|
-
"comment": "Update to use Web Streams API"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"comment": "Improve compatibility with Node.js 12 ESM format"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"comment": "Update license year"
|
|
171
|
-
}
|
|
172
|
-
],
|
|
173
|
-
"dependency": [
|
|
174
|
-
{
|
|
175
|
-
"comment": "Updating dependency \"@yume-chan/adb\" from `^0.0.10` to `^0.0.11`"
|
|
176
|
-
}
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"version": "0.0.10",
|
|
182
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.10",
|
|
183
|
-
"date": "Sun, 09 Jan 2022 15:52:20 GMT",
|
|
184
|
-
"comments": {
|
|
185
|
-
"none": [
|
|
186
|
-
{
|
|
187
|
-
"comment": "Remove `encodeUtf8()` and `decodeUtf8()` from `AdbBackend`"
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"version": "0.0.9",
|
|
194
|
-
"tag": "@yume-chan/adb-daemon-webusb_v0.0.9",
|
|
195
|
-
"date": "Sun, 09 Jan 2022 15:50:20 GMT",
|
|
196
|
-
"comments": {}
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
}
|
package/esm/watcher.d.ts
DELETED
package/esm/watcher.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":";AAAA,qBAAa,4BAA4B;;gBAIzB,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,IAAI,EAAE,GAAG,EAAE,GAAG;IAQlE,OAAO,IAAI,IAAI;CAelB"}
|
package/esm/watcher.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class AdbDaemonWebUsbDeviceWatcher {
|
|
2
|
-
#callback;
|
|
3
|
-
#usbManager;
|
|
4
|
-
constructor(callback, usb) {
|
|
5
|
-
this.#callback = callback;
|
|
6
|
-
this.#usbManager = usb;
|
|
7
|
-
this.#usbManager.addEventListener("connect", this.#handleConnect);
|
|
8
|
-
this.#usbManager.addEventListener("disconnect", this.#handleDisconnect);
|
|
9
|
-
}
|
|
10
|
-
dispose() {
|
|
11
|
-
this.#usbManager.removeEventListener("connect", this.#handleConnect);
|
|
12
|
-
this.#usbManager.removeEventListener("disconnect", this.#handleDisconnect);
|
|
13
|
-
}
|
|
14
|
-
#handleConnect = (e) => {
|
|
15
|
-
this.#callback(e.device.serialNumber);
|
|
16
|
-
};
|
|
17
|
-
#handleDisconnect = () => {
|
|
18
|
-
this.#callback();
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=watcher.js.map
|
package/esm/watcher.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.js","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,4BAA4B;IACrC,SAAS,CAAqC;IAC9C,WAAW,CAAM;IAEjB,YAAY,QAA4C,EAAE,GAAQ;QAC9D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;QAEvB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO;QACH,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACrE,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAChC,YAAY,EACZ,IAAI,CAAC,iBAAiB,CACzB,CAAC;IACN,CAAC;IAED,cAAc,GAAG,CAAC,CAAqB,EAAE,EAAE;QACvC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,iBAAiB,GAAG,GAAG,EAAE;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC,CAAC;CACL"}
|
package/src/watcher.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export class AdbDaemonWebUsbDeviceWatcher {
|
|
2
|
-
#callback: (newDeviceSerial?: string) => void;
|
|
3
|
-
#usbManager: USB;
|
|
4
|
-
|
|
5
|
-
constructor(callback: (newDeviceSerial?: string) => void, usb: USB) {
|
|
6
|
-
this.#callback = callback;
|
|
7
|
-
this.#usbManager = usb;
|
|
8
|
-
|
|
9
|
-
this.#usbManager.addEventListener("connect", this.#handleConnect);
|
|
10
|
-
this.#usbManager.addEventListener("disconnect", this.#handleDisconnect);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
dispose(): void {
|
|
14
|
-
this.#usbManager.removeEventListener("connect", this.#handleConnect);
|
|
15
|
-
this.#usbManager.removeEventListener(
|
|
16
|
-
"disconnect",
|
|
17
|
-
this.#handleDisconnect,
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
#handleConnect = (e: USBConnectionEvent) => {
|
|
22
|
-
this.#callback(e.device.serialNumber);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
#handleDisconnect = () => {
|
|
26
|
-
this.#callback();
|
|
27
|
-
};
|
|
28
|
-
}
|