@onekeyfe/hd-ble-sdk 1.2.0-alpha.21 → 1.2.0-alpha.22
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/__tests__/device-state-events.test.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/package.json +5 -5
- package/src/index.ts +4 -2
|
@@ -6,7 +6,7 @@ describe('hd-ble-sdk device state events', () => {
|
|
|
6
6
|
const source = readFileSync(resolve(__dirname, '../src/index.ts'), 'utf8');
|
|
7
7
|
const deviceEventHandler = source.slice(
|
|
8
8
|
source.indexOf('case DEVICE_EVENT:'),
|
|
9
|
-
source.indexOf('case IFRAME.CALLBACK:')
|
|
9
|
+
source.indexOf('case IFRAME.CALLBACK:')
|
|
10
10
|
);
|
|
11
11
|
|
|
12
12
|
expect(deviceEventHandler).toContain('DEVICE.STATE');
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AASpD,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;CAAO,CAAC;AAuJpE,QAAA,MAAM,cAAc,qCASlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -621,11 +621,12 @@ const init = (settings) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
621
621
|
});
|
|
622
622
|
const call = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
623
623
|
var _a, _b, _c;
|
|
624
|
-
|
|
624
|
+
const blockLog = HardwareSdk.getLogBlockLabel(params);
|
|
625
|
+
Log.debug('call: ', blockLog !== null && blockLog !== void 0 ? blockLog : params);
|
|
625
626
|
try {
|
|
626
627
|
const response = yield postMessage({ event: HardwareSdk.IFRAME.CALL, type: HardwareSdk.IFRAME.CALL, payload: params });
|
|
627
628
|
if (response) {
|
|
628
|
-
Log.debug('response: ', response);
|
|
629
|
+
Log.debug('response: ', blockLog ? '[REDACTED]' : response);
|
|
629
630
|
if (!response.success) {
|
|
630
631
|
if (((_a = response.payload) === null || _a === void 0 ? void 0 : _a.code) === hdShared.HardwareErrorCode.BlePermissionError) {
|
|
631
632
|
postMessage(HardwareSdk.createUiMessage(HardwareSdk.UI_REQUEST.BLUETOOTH_PERMISSION), false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-ble-sdk",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.22",
|
|
4
4
|
"author": "OneKey",
|
|
5
5
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-core": "1.2.0-alpha.
|
|
24
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
25
|
-
"@onekeyfe/hd-transport-react-native": "1.2.0-alpha.
|
|
23
|
+
"@onekeyfe/hd-core": "1.2.0-alpha.22",
|
|
24
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.22",
|
|
25
|
+
"@onekeyfe/hd-transport-react-native": "1.2.0-alpha.22"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "ce94a5ebbe141b0c15db7c68d08085ca1ddb0166"
|
|
28
28
|
}
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import HardwareSdk, {
|
|
|
14
14
|
enableLog,
|
|
15
15
|
executeCallback,
|
|
16
16
|
getLogger,
|
|
17
|
+
getLogBlockLabel,
|
|
17
18
|
initCore,
|
|
18
19
|
parseConnectSettings,
|
|
19
20
|
setLoggerPostMessage,
|
|
@@ -144,12 +145,13 @@ const init = async (settings: Partial<ConnectSettings>) => {
|
|
|
144
145
|
};
|
|
145
146
|
|
|
146
147
|
const call = async (params: any) => {
|
|
147
|
-
|
|
148
|
+
const blockLog = getLogBlockLabel(params);
|
|
149
|
+
Log.debug('call: ', blockLog ?? params);
|
|
148
150
|
|
|
149
151
|
try {
|
|
150
152
|
const response = await postMessage({ event: IFRAME.CALL, type: IFRAME.CALL, payload: params });
|
|
151
153
|
if (response) {
|
|
152
|
-
Log.debug('response: ', response);
|
|
154
|
+
Log.debug('response: ', blockLog ? '[REDACTED]' : response);
|
|
153
155
|
|
|
154
156
|
if (!response.success) {
|
|
155
157
|
if (response.payload?.code === HardwareErrorCode.BlePermissionError) {
|