@onekeyfe/hd-transport-web-device 1.1.27-alpha.42 → 1.1.27-alpha.45
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electron-ble-transport.d.ts","sourceRoot":"","sources":["../src/electron-ble-transport.ts"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"electron-ble-transport.d.ts","sourceRoot":"","sources":["../src/electron-ble-transport.ts"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AAevC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE,UAAU,CAAC;KACzB;CACF;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gBAAgB,CAAC,EAAE,YAAY,CAAC;CACjC,CAAC;AAuCF,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,OAAO,CAAC,SAAS,CAA0D;IAE3E,OAAO,CAAC,WAAW,CAA0D;IAE7E,IAAI,SAA0B;IAE9B,UAAU,UAAS;IAEnB,UAAU,EAAE,QAAQ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,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,sBAAsB;YAIhB,mBAAmB;IAiBjC,OAAO,CAAC,4BAA4B;IAgB9B,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,oBAAoB;YA+BlB,cAAc;YAuEd,cAAc;IAmF5B,OAAO,CAAC,6BAA6B;IAsCrC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;CAGxD"}
|
package/dist/index.js
CHANGED
|
@@ -57,9 +57,13 @@ function shouldSuppressWebUsbCallLog(name) {
|
|
|
57
57
|
const normalized = name.replace(/[_\s-]/g, '');
|
|
58
58
|
return WEBUSB_FILE_WRITE_LOG_BLOCK_PATTERN.test(normalized);
|
|
59
59
|
}
|
|
60
|
+
function isLogBlockCommand$1(name) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
return (_b = (_a = transport.LogBlockCommand === null || transport.LogBlockCommand === void 0 ? void 0 : transport.LogBlockCommand.has) === null || _a === void 0 ? void 0 : _a.call(transport.LogBlockCommand, name)) !== null && _b !== void 0 ? _b : false;
|
|
63
|
+
}
|
|
60
64
|
function shouldBlockWebUsbCallDataLog(name) {
|
|
61
65
|
const normalized = name.replace(/[_\s-]/g, '');
|
|
62
|
-
return
|
|
66
|
+
return isLogBlockCommand$1(name) || WEBUSB_FILE_WRITE_LOG_BLOCK_PATTERN.test(normalized);
|
|
63
67
|
}
|
|
64
68
|
function inferProtocolHintFromDeviceName$1(name) {
|
|
65
69
|
return /\bpro\s*2\b/i.test(name !== null && name !== void 0 ? name : '') ? 'V2' : undefined;
|
|
@@ -687,6 +691,10 @@ function shouldSuppressHighVolumeCallLog(name) {
|
|
|
687
691
|
const normalized = name.replace(/[_\s-]/g, '');
|
|
688
692
|
return FILE_WRITE_LOG_BLOCK_PATTERN.test(normalized);
|
|
689
693
|
}
|
|
694
|
+
function isLogBlockCommand(name) {
|
|
695
|
+
var _a, _b;
|
|
696
|
+
return (_b = (_a = transport.LogBlockCommand === null || transport.LogBlockCommand === void 0 ? void 0 : transport.LogBlockCommand.has) === null || _a === void 0 ? void 0 : _a.call(transport.LogBlockCommand, name)) !== null && _b !== void 0 ? _b : false;
|
|
697
|
+
}
|
|
690
698
|
const { parseConfigure, ProtocolV1, check } = transport__default["default"];
|
|
691
699
|
function inferProtocolHintFromDeviceName(name) {
|
|
692
700
|
return /\bpro\s*2\b/i.test(name !== null && name !== void 0 ? name : '') ? 'V2' : undefined;
|
|
@@ -1229,7 +1237,7 @@ class ElectronBleTransport {
|
|
|
1229
1237
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Device protocol has not been detected for ${uuid}`);
|
|
1230
1238
|
}
|
|
1231
1239
|
if (shouldSuppressHighVolumeCallLog(name)) ;
|
|
1232
|
-
else if (
|
|
1240
|
+
else if (isLogBlockCommand(name)) {
|
|
1233
1241
|
(_a = this.Log) === null || _a === void 0 ? void 0 : _a.debug('[Electron BLE] call', 'name:', name, 'protocol:', protocol);
|
|
1234
1242
|
}
|
|
1235
1243
|
else {
|
package/dist/webusb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webusb.d.ts","sourceRoot":"","sources":["../src/webusb.ts"],"names":[],"mappings":";AACA,OAAO,SAWN,MAAM,wBAAwB,CAAC;AAIhC,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"webusb.d.ts","sourceRoot":"","sources":["../src/webusb.ts"],"names":[],"mappings":";AACA,OAAO,SAWN,MAAM,wBAAwB,CAAC;AAIhC,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACrB,MAAM,w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AI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAIvE,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,wBAAwB;YAalB,yBAAyB;IAiCvC,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,aAAa;YASP,oBAAoB;YAoCpB,mBAAmB;YA2CnB,yBAAyB;YAuBzB,uBAAuB;YA4CvB,eAAe;YAcf,eAAe;IAiBvB,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,oBAAoB;YAkClB,cAAc;YAkCd,cAAc;YAmCd,sBAAsB;IA4C9B,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAgD5C,OAAO,CAAC,IAAI,EAAE,MAAM;IAiB1B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;CAGxD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-web-device",
|
|
3
|
-
"version": "1.1.27-alpha.
|
|
3
|
+
"version": "1.1.27-alpha.45",
|
|
4
4
|
"author": "OneKey",
|
|
5
5
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-shared": "1.1.27-alpha.
|
|
24
|
-
"@onekeyfe/hd-transport": "1.1.27-alpha.
|
|
23
|
+
"@onekeyfe/hd-shared": "1.1.27-alpha.45",
|
|
24
|
+
"@onekeyfe/hd-transport": "1.1.27-alpha.45"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@onekeyfe/hd-transport-electron": "1.1.27-alpha.
|
|
27
|
+
"@onekeyfe/hd-transport-electron": "1.1.27-alpha.45",
|
|
28
28
|
"@types/w3c-web-usb": "^1.0.6",
|
|
29
29
|
"@types/web-bluetooth": "^0.0.17"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "058b5f61f627da21171c74c93d2e4b87c1d8ade6"
|
|
32
32
|
}
|
|
@@ -29,6 +29,10 @@ function shouldSuppressHighVolumeCallLog(name: string) {
|
|
|
29
29
|
return FILE_WRITE_LOG_BLOCK_PATTERN.test(normalized);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
function isLogBlockCommand(name: string) {
|
|
33
|
+
return (LogBlockCommand as Set<string> | undefined)?.has?.(name) ?? false;
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
const { parseConfigure, ProtocolV1, check } = transport;
|
|
33
37
|
|
|
34
38
|
declare global {
|
|
@@ -684,7 +688,7 @@ export default class ElectronBleTransport {
|
|
|
684
688
|
}
|
|
685
689
|
if (shouldSuppressHighVolumeCallLog(name)) {
|
|
686
690
|
// 高频文件写入不要逐包发 debug 事件,否则调试日志会反向拖慢传输。
|
|
687
|
-
} else if (
|
|
691
|
+
} else if (isLogBlockCommand(name)) {
|
|
688
692
|
this.Log?.debug('[Electron BLE] call', 'name:', name, 'protocol:', protocol);
|
|
689
693
|
} else {
|
|
690
694
|
this.Log?.debug('[Electron BLE] call', 'name:', name, 'data:', data, 'protocol:', protocol);
|
package/src/webusb.ts
CHANGED
|
@@ -40,9 +40,13 @@ function shouldSuppressWebUsbCallLog(name: string) {
|
|
|
40
40
|
return WEBUSB_FILE_WRITE_LOG_BLOCK_PATTERN.test(normalized);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
function isLogBlockCommand(name: string) {
|
|
44
|
+
return (LogBlockCommand as Set<string> | undefined)?.has?.(name) ?? false;
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
function shouldBlockWebUsbCallDataLog(name: string) {
|
|
44
48
|
const normalized = name.replace(/[_\s-]/g, '');
|
|
45
|
-
return
|
|
49
|
+
return isLogBlockCommand(name) || WEBUSB_FILE_WRITE_LOG_BLOCK_PATTERN.test(normalized);
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
function inferProtocolHintFromDeviceName(name?: string | null): ProtocolType | undefined {
|