@authme/engine 2.2.0-rc.6 → 2.2.0-rc.8
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 +12 -0
- package/assets/engine-worker.js +11 -21
- package/assets/ml_engine_web.js +1 -1
- package/assets/ml_engine_web.simd.js +1 -1
- package/assets/ml_engine_web.simd.wasm +0 -0
- package/assets/ml_engine_web.wasm +0 -0
- package/assets/ml_engine_web_version.txt +1 -1
- package/package.json +3 -3
- package/src/lib/engine.d.ts +1 -1
- package/src/lib/engine.js +62 -3
- package/src/lib/engine.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [2.2.0-rc.8](https://github.com/AuthMe01/web-client-sdk/compare/v2.2.0-rc.7...v2.2.0-rc.8) (2022-12-07)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- update engine-lib to 4.7.0 ([968d200](https://github.com/AuthMe01/web-client-sdk/commit/968d2006d3834a187177384710e314e65bf333a0))
|
|
10
|
+
|
|
11
|
+
## [2.2.0-rc.7](https://github.com/AuthMe01/web-client-sdk/compare/v2.2.0-rc.6...v2.2.0-rc.7) (2022-12-07)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- cors problem on worker creating ([143cb33](https://github.com/AuthMe01/web-client-sdk/commit/143cb336982777a853b75ea88c038d8fa68e1dce))
|
|
16
|
+
|
|
5
17
|
## [2.2.0-rc.6](https://github.com/AuthMe01/web-client-sdk/compare/v2.2.0-rc.5...v2.2.0-rc.6) (2022-12-05)
|
|
6
18
|
|
|
7
19
|
## [2.2.0-rc.5](https://github.com/AuthMe01/web-client-sdk/compare/v2.2.0-rc.4...v2.2.0-rc.5) (2022-12-03)
|
package/assets/engine-worker.js
CHANGED
|
@@ -5,19 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
let modelSession = {};
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 9, 1,
|
|
15
|
-
7, 0, 65, 0, 253, 15, 26, 11,
|
|
16
|
-
])
|
|
17
|
-
);
|
|
18
|
-
} catch (e) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
8
|
+
function importScriptsViaJsContent(jsContent) {
|
|
9
|
+
const objectUrl = URL.createObjectURL(
|
|
10
|
+
new Blob([jsContent], { type: 'text/javascript' })
|
|
11
|
+
);
|
|
12
|
+
importScripts(objectUrl);
|
|
13
|
+
URL.revokeObjectURL(objectUrl);
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
function base64toBlob(data) {
|
|
@@ -52,7 +45,7 @@
|
|
|
52
45
|
}
|
|
53
46
|
}
|
|
54
47
|
|
|
55
|
-
async function loadWasm() {
|
|
48
|
+
async function loadWasm({ engineJsContent, engineWasmContent }) {
|
|
56
49
|
return new Promise((res, rej) => {
|
|
57
50
|
// console.log('load wasm');
|
|
58
51
|
if (wasm_loaded || wasm_loading) {
|
|
@@ -71,14 +64,11 @@
|
|
|
71
64
|
});
|
|
72
65
|
},
|
|
73
66
|
};
|
|
74
|
-
|
|
75
|
-
isSimdSupported()
|
|
76
|
-
? `${self.config.scriptPath}ml_engine_web.simd.js`
|
|
77
|
-
: `${self.config.scriptPath}ml_engine_web.js`
|
|
78
|
-
);
|
|
67
|
+
importScriptsViaJsContent(engineJsContent);
|
|
79
68
|
let tryInitEngineLib = async () => {
|
|
80
69
|
try {
|
|
81
70
|
const module = await AuthmeMLEngineLib({
|
|
71
|
+
wasmBinary: engineWasmContent,
|
|
82
72
|
print: (msg) => {
|
|
83
73
|
console.log(msg);
|
|
84
74
|
postMessage({
|
|
@@ -524,8 +514,8 @@
|
|
|
524
514
|
};
|
|
525
515
|
return true;
|
|
526
516
|
},
|
|
527
|
-
loadEngine: async function () {
|
|
528
|
-
return await loadWasm();
|
|
517
|
+
loadEngine: async function ({ engineJsContent, engineWasmContent }) {
|
|
518
|
+
return await loadWasm({ engineJsContent, engineWasmContent });
|
|
529
519
|
},
|
|
530
520
|
verify: async function (params) {
|
|
531
521
|
for (let index = 0; index < 20; index++) {
|