@ukeyfe/hardware-transport-emulator 1.1.25 → 1.1.26

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":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AA4BF,wBAAsB,OAAO,CAAC,OAAO,EAAE,kBAAkB,gBA6BxD"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AA4BF,wBAAsB,OAAO,CAAC,OAAO,EAAE,kBAAkB,gBA6BxD"}
package/dist/index.d.ts CHANGED
@@ -21,7 +21,13 @@ declare class EmulatorTransport {
21
21
  _silentInit(): Promise<string>;
22
22
  configure(signedData: any): void;
23
23
  listen(old?: Array<UKeyDeviceInfoWithSession>): Promise<UKeyDeviceInfoWithSession[]>;
24
- enumerate(): Promise<UKeyDeviceInfoWithSession[]>;
24
+ enumerate(): Promise<{
25
+ commType: string;
26
+ path: string;
27
+ session?: string | null | undefined;
28
+ debugSession?: string | null | undefined;
29
+ debug: boolean;
30
+ }[]>;
25
31
  _acquireMixed(input: AcquireInput): Promise<any>;
26
32
  acquire(input: AcquireInput): Promise<string>;
27
33
  release(session: string, onclose: boolean): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAA8B,MAAM,4BAA4B,CAAC;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAM1F,KAAK,wBAAwB,GAAG;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,IAAI,SAAuB;IAE3B,OAAO,SAAW;IAElB,UAAU,UAAS;IAEnB,OAAO,UAAS;IAEhB,UAAU,UAAS;IAEnB,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,CAAC,EAAE,GAAG,CAAC;gBAEE,GAAG,CAAC,EAAE,MAAM;IAIxB,KAAK,CAAC,OAAO,EAAE,wBAAwB;IAWjC,IAAI,CAAC,MAAM,EAAE,GAAG;IAMhB,WAAW;IAUjB,SAAS,CAAC,UAAU,EAAE,GAAG;IAMnB,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC;IAY7C,SAAS;IAMf,aAAa,CAAC,KAAK,EAAE,YAAY;IAS3B,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,M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,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;IAyBjE,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
@@ -103,7 +103,7 @@ axios__default["default"].interceptors.request.use((config) => {
103
103
  if ((_a = config.url) === null || _a === void 0 ? void 0 : _a.startsWith('http://localhost:21333')) {
104
104
  if (!config.headers.get('Origin')) {
105
105
  console.log('set node request origin');
106
- config.headers.set('Origin', 'https://jssdk.sanying.site');
106
+ config.headers.set('Origin', 'https://jssdk.ukey.io');
107
107
  }
108
108
  }
109
109
  return config;
@@ -167,7 +167,7 @@ class EmulatorTransport {
167
167
  return __awaiter(this, void 0, void 0, function* () {
168
168
  const devicesS = yield this._post({ url: '/enumerate' });
169
169
  const devices = check.devices(devicesS);
170
- return devices;
170
+ return devices.map(device => (Object.assign(Object.assign({}, device), { commType: 'emulator' })));
171
171
  });
172
172
  }
173
173
  _acquireMixed(input) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukeyfe/hardware-transport-emulator",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "hardware emulator transport",
5
5
  "author": "UKey",
6
6
  "homepage": "https://github.com/UKeyHQ/hardware-js-sdk#readme",
@@ -9,7 +9,7 @@
9
9
  "types": "dist/index.d.ts",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "git+https://github.com/bestyourwallet/hardware-js-sdk"
12
+ "url": "git+https://github.com/UKeyHQ/hardware-js-sdk.git"
13
13
  },
14
14
  "publishConfig": {
15
15
  "access": "public"
@@ -24,10 +24,10 @@
24
24
  "url": "https://github.com/UKeyHQ/hardware-js-sdk/issues"
25
25
  },
26
26
  "dependencies": {
27
- "@ukeyfe/hardware-shared": "1.1.25",
28
- "@ukeyfe/hardware-transport": "1.1.25",
27
+ "@ukeyfe/hardware-shared": "1.1.26",
28
+ "@ukeyfe/hardware-transport": "1.1.26",
29
29
  "axios": "1.12.2",
30
30
  "secure-json-parse": "^4.0.0"
31
31
  },
32
- "gitHead": "8f4ecd5e78a8cade44224204c4cf102e6e2a1712"
32
+ "gitHead": "ca0b502d1ac83fdd0883d5e278e20bd80ac08f29"
33
33
  }
package/src/http.ts CHANGED
@@ -1,7 +1,9 @@
1
- import axios, { AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios';
1
+ import axios from 'axios';
2
2
  import { HardwareError, HardwareErrorCode } from '@ukeyfe/hardware-shared';
3
3
  import secureJSON from 'secure-json-parse';
4
4
 
5
+ import type { AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios';
6
+
5
7
  export type HttpRequestOptions = {
6
8
  body?: Array<any> | Record<string, unknown> | string;
7
9
  url: string;
@@ -75,7 +77,7 @@ axios.interceptors.request.use((config: InternalAxiosRequestConfig) => {
75
77
  if (!config.headers.get('Origin')) {
76
78
  console.log('set node request origin');
77
79
  // add Origin field for request headers
78
- config.headers.set('Origin', 'https://jssdk.sanying.site');
80
+ config.headers.set('Origin', 'https://jssdk.ukey.io');
79
81
  }
80
82
  }
81
83
  return config;
package/src/index.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import transport, { LogBlockCommand } from '@ukeyfe/hardware-transport';
2
2
  import { ERRORS, HardwareErrorCode } from '@ukeyfe/hardware-shared';
3
- import type { AcquireInput, UKeyDeviceInfoWithSession } from '@ukeyfe/hardware-transport';
3
+
4
4
  import { request as http } from './http';
5
5
  import { DEFAULT_URL } from './constants';
6
6
 
7
+ import type { AcquireInput, UKeyDeviceInfoWithSession } from '@ukeyfe/hardware-transport';
8
+
7
9
  const { check, buildOne, receiveOne, parseConfigure } = transport;
8
10
 
9
11
  type IncompleteRequestOptions = {
@@ -81,7 +83,7 @@ export default class EmulatorTransport {
81
83
  async enumerate() {
82
84
  const devicesS = await this._post({ url: '/enumerate' });
83
85
  const devices = check.devices(devicesS);
84
- return devices;
86
+ return devices.map(device => ({ ...device, commType: 'emulator' }));
85
87
  }
86
88
 
87
89
  _acquireMixed(input: AcquireInput) {