@onekeyfe/hd-transport-http 1.2.8-alpha.19 → 1.2.8-alpha.20
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/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/package.json +4 -4
- package/src/index.ts +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ type IncompleteRequestOptions = {
|
|
|
7
7
|
timeout?: number;
|
|
8
8
|
};
|
|
9
9
|
declare class HttpTransport {
|
|
10
|
-
private readonly requestTimeout?;
|
|
11
10
|
_messages: ReturnType<typeof _onekeyfe_hd_transport__default.parseConfigure> | undefined;
|
|
12
11
|
name: string;
|
|
13
12
|
configured: boolean;
|
|
@@ -15,14 +14,14 @@ declare class HttpTransport {
|
|
|
15
14
|
url: string;
|
|
16
15
|
Log?: any;
|
|
17
16
|
getProtocolType(_path: string): ProtocolType;
|
|
18
|
-
constructor(url?: string
|
|
17
|
+
constructor(url?: string);
|
|
19
18
|
_post(options: IncompleteRequestOptions): Promise<any>;
|
|
20
19
|
init(logger: any): Promise<string>;
|
|
21
20
|
_silentInit(): Promise<string>;
|
|
22
21
|
configure(signedData: any): void;
|
|
23
22
|
listen(old?: Array<OneKeyDeviceInfoWithSession>): Promise<OneKeyDeviceInfoWithSession[]>;
|
|
24
23
|
enumerate(): Promise<{
|
|
25
|
-
commType:
|
|
24
|
+
commType: string;
|
|
26
25
|
path: string;
|
|
27
26
|
session?: string | null | undefined;
|
|
28
27
|
debugSession?: string | null | undefined;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAM/C,OAAO,KAAK,EACV,YAAY,EACZ,2BAA2B,EAC3B,YAAY,EACb,MAAM,wBAAwB,CAAC;AAIhC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,OAAO,CAAC,KAAK,EAAE,YAAY;IAK3B,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAUzC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAmBjE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAYjE,IAAI,CAAC,OAAO,EAAE,MAAM;IAe1B,aAAa;IAKb,IAAI;IAIJ,MAAM;CAGP"}
|
package/dist/index.js
CHANGED
|
@@ -132,19 +132,17 @@ class HttpTransport {
|
|
|
132
132
|
getProtocolType(_path) {
|
|
133
133
|
return 'V1';
|
|
134
134
|
}
|
|
135
|
-
constructor(url
|
|
136
|
-
this.requestTimeout = requestTimeout;
|
|
135
|
+
constructor(url) {
|
|
137
136
|
this.name = 'HttpTransport';
|
|
138
137
|
this.configured = false;
|
|
139
138
|
this.stopped = false;
|
|
140
139
|
this.url = url == null ? DEFAULT_URL : url;
|
|
141
140
|
}
|
|
142
141
|
_post(options) {
|
|
143
|
-
var _a;
|
|
144
142
|
if (this.stopped) {
|
|
145
143
|
return Promise.reject(hdShared.ERRORS.TypedError('Transport stopped.'));
|
|
146
144
|
}
|
|
147
|
-
return request(Object.assign(Object.assign({}, options), {
|
|
145
|
+
return request(Object.assign(Object.assign({}, options), { method: 'POST', url: this.url + options.url }));
|
|
148
146
|
}
|
|
149
147
|
init(logger) {
|
|
150
148
|
return __awaiter(this, void 0, void 0, function* () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-http",
|
|
3
|
-
"version": "1.2.8-alpha.
|
|
3
|
+
"version": "1.2.8-alpha.20",
|
|
4
4
|
"description": "hardware http transport",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@onekeyfe/hd-shared": "1.2.8-alpha.
|
|
28
|
-
"@onekeyfe/hd-transport": "1.2.8-alpha.
|
|
27
|
+
"@onekeyfe/hd-shared": "1.2.8-alpha.20",
|
|
28
|
+
"@onekeyfe/hd-transport": "1.2.8-alpha.20",
|
|
29
29
|
"axios": "1.15.2",
|
|
30
30
|
"secure-json-parse": "^4.0.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "973f059fe93a58fdcf098ddb32ba63f621a2c78e"
|
|
33
33
|
}
|
package/src/index.ts
CHANGED
|
@@ -36,7 +36,7 @@ export default class HttpTransport {
|
|
|
36
36
|
return 'V1';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
constructor(url?: string
|
|
39
|
+
constructor(url?: string) {
|
|
40
40
|
this.url = url == null ? DEFAULT_URL : url;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -46,7 +46,6 @@ export default class HttpTransport {
|
|
|
46
46
|
}
|
|
47
47
|
return http({
|
|
48
48
|
...options,
|
|
49
|
-
timeout: options.timeout ?? this.requestTimeout,
|
|
50
49
|
method: 'POST',
|
|
51
50
|
url: this.url + options.url,
|
|
52
51
|
});
|
|
@@ -89,7 +88,7 @@ export default class HttpTransport {
|
|
|
89
88
|
async enumerate() {
|
|
90
89
|
const devicesS = await this._post({ url: '/enumerate' });
|
|
91
90
|
const devices = check.devices(devicesS);
|
|
92
|
-
return devices.map(device => ({ ...device, commType: 'bridge'
|
|
91
|
+
return devices.map(device => ({ ...device, commType: 'bridge' }));
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
_acquireMixed(input: AcquireInput) {
|