@authme/liveness 2.8.42 → 2.8.44

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/index.cjs.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
@@ -1,43 +1,15 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
3
+ require('core-js/modules/es.promise.js');
4
+ require('core-js/modules/esnext.iterator.constructor.js');
5
+ require('core-js/modules/esnext.iterator.map.js');
5
6
  var engine = require('@authme/engine');
6
- require('core-js/modules/es.regexp.to-string.js');
7
+ require('core-js/modules/es.json.stringify.js');
7
8
  require('core-js/modules/es.object.assign.js');
9
+ require('core-js/modules/es.regexp.to-string.js');
10
+ require('core-js/modules/esnext.iterator.for-each.js');
8
11
  var core = require('@authme/core');
9
12
  var util = require('@authme/util');
10
- require('core-js/modules/es.symbol.description.js');
11
-
12
- /******************************************************************************
13
- Copyright (c) Microsoft Corporation.
14
-
15
- Permission to use, copy, modify, and/or distribute this software for any
16
- purpose with or without fee is hereby granted.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
19
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
20
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
21
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
- PERFORMANCE OF THIS SOFTWARE.
25
- ***************************************************************************** */
26
-
27
- function __awaiter(thisArg, _arguments, P, generator) {
28
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29
- return new (P || (P = Promise))(function (resolve, reject) {
30
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
31
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
32
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
33
- step((generator = generator.apply(thisArg, _arguments || [])).next());
34
- });
35
- }
36
-
37
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
38
- var e = new Error(message);
39
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
40
- };
41
13
 
42
14
  class FasService extends engine.AuthmeEngineModuleBase {
43
15
  constructor(engine$1) {
@@ -50,15 +22,11 @@ class FasService extends engine.AuthmeEngineModuleBase {
50
22
  stageList: stageStrList
51
23
  });
52
24
  }
53
- setPublicKeyForJson(pubKey) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- yield this.engine.setPublicKeyForJson(pubKey);
56
- });
25
+ async setPublicKeyForJson(pubKey) {
26
+ await this.engine.setPublicKeyForJson(pubKey);
57
27
  }
58
- getNormalizedFaceROI() {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- return yield this.engine.run(this.moduleName, 'getNormalizedFaceROI');
61
- });
28
+ async getNormalizedFaceROI() {
29
+ return await this.engine.run(this.moduleName, 'getNormalizedFaceROI');
62
30
  }
63
31
  getStageParams(stageIndex) {
64
32
  return this.engine.run(this.moduleName, 'getStageParams', {
@@ -74,15 +42,12 @@ class FasService extends engine.AuthmeEngineModuleBase {
74
42
  }
75
43
 
76
44
  var name = "authme/sdk";
77
- var version$1 = "2.8.42";
78
- var date = "2026-02-03T09:36:05+0000";
45
+ var version$1 = "2.8.44";
79
46
  var packageInfo = {
80
47
  name: name,
81
- version: version$1,
82
- date: date
83
- };
48
+ version: version$1};
84
49
 
85
- const init = url => (Immediately, passive, compareCustomerClientId) => __awaiter(void 0, void 0, void 0, function* () {
50
+ const init = url => async (Immediately, passive, compareCustomerClientId) => {
86
51
  const body = {
87
52
  Immediately,
88
53
  passive: passive,
@@ -100,8 +65,8 @@ const init = url => (Immediately, passive, compareCustomerClientId) => __awaiter
100
65
  return core.sendRequest(url, 'POST', {
101
66
  body: JSON.stringify(body)
102
67
  });
103
- });
104
- const detect = url => data => __awaiter(void 0, void 0, void 0, function* () {
68
+ };
69
+ const detect = url => async data => {
105
70
  const formData = new FormData();
106
71
  formData.append('id', data.id);
107
72
  formData.append('score', data.score.toString());
@@ -117,20 +82,19 @@ const detect = url => data => __awaiter(void 0, void 0, void 0, function* () {
117
82
  body: formData,
118
83
  contentType: 'multipart/form-data'
119
84
  });
120
- });
121
- const uploadFrameFile = url => data => __awaiter(void 0, void 0, void 0, function* () {
122
- var _a;
85
+ };
86
+ const uploadFrameFile = url => async data => {
87
+ var _data$index;
123
88
  const formData = new FormData();
124
89
  formData.append('id', data.id);
125
- formData.append('index', (_a = data.index) === null || _a === void 0 ? void 0 : _a.toString());
90
+ formData.append('index', (_data$index = data.index) == null ? void 0 : _data$index.toString());
126
91
  formData.append('data', util.dataURItoBlob(data.data));
127
92
  return core.sendRequest(url, 'POST', {
128
93
  body: formData,
129
94
  contentType: 'multipart/form-data'
130
95
  });
131
- });
132
- const uploadFrame = url => body => __awaiter(void 0, void 0, void 0, function* () {
133
- var _b;
96
+ };
97
+ const uploadFrame = url => async body => {
134
98
  let encryptApiPath = '';
135
99
  if (body.encryptedBase64String) {
136
100
  encryptApiPath = `/encrypted`;
@@ -138,14 +102,15 @@ const uploadFrame = url => body => __awaiter(void 0, void 0, void 0, function* (
138
102
  body: JSON.stringify(body)
139
103
  });
140
104
  } else {
105
+ var _body$data;
141
106
  return core.sendRequest(url, 'POST', {
142
- body: JSON.stringify(Object.assign(Object.assign({}, body), {
143
- data: (_b = body.data) === null || _b === void 0 ? void 0 : _b.split('base64,')[1]
107
+ body: JSON.stringify(Object.assign({}, body, {
108
+ data: (_body$data = body.data) == null ? void 0 : _body$data.split('base64,')[1]
144
109
  }))
145
110
  });
146
111
  }
147
- });
148
- const uploadMeta = url => data => __awaiter(void 0, void 0, void 0, function* () {
112
+ };
113
+ const uploadMeta = url => async data => {
149
114
  let encryptApiPath = '';
150
115
  if (data.encryptedBase64String) {
151
116
  encryptApiPath = `/encrypted`;
@@ -153,17 +118,13 @@ const uploadMeta = url => data => __awaiter(void 0, void 0, void 0, function* ()
153
118
  return core.sendRequest(`${url}${encryptApiPath}`, 'POST', {
154
119
  body: JSON.stringify(data)
155
120
  });
156
- });
157
- const getResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
158
- return core.sendRequest(`${url}/${id}`, 'GET');
159
- });
160
- const getVerifyResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
161
- return core.sendRequest(`${url}/${id}`, 'GET');
162
- });
163
- const option = url => deviceType => __awaiter(void 0, void 0, void 0, function* () {
121
+ };
122
+ const getResult = url => async id => core.sendRequest(`${url}/${id}`, 'GET');
123
+ const getVerifyResult = url => async id => core.sendRequest(`${url}/${id}`, 'GET');
124
+ const option = url => async deviceType => {
164
125
  return core.sendRequest(`${url}${deviceType ? '?deviceType=' + deviceType : ''}`, 'GET');
165
- });
166
- const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* () {
126
+ };
127
+ const themeUI = url => async themeId => {
167
128
  // const url = `/api/identity-verification/v1/ui-themes/${themeId}`;
168
129
  // const accessToken = Storage.getItem('token') as string | null;
169
130
  // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
@@ -192,7 +153,7 @@ const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* ()
192
153
  // return {}; // 或拋出錯誤,視需求而定
193
154
  // }
194
155
  return core.sendRequest(`${url}/${themeId}`, 'GET');
195
- });
156
+ };
196
157
  const IdentityVerification = {
197
158
  init: init('/api/identity-verification/v3/liveness/init'),
198
159
  detect: detect('/api/identity-verification/v3/liveness/detect'),
@@ -220,35 +181,34 @@ exports.LivenessResultStatus = void 0;
220
181
  LivenessResultStatus["UPLOADING"] = "Uploading";
221
182
  })(exports.LivenessResultStatus || (exports.LivenessResultStatus = {}));
222
183
 
223
- var _a;
224
- var _b, _c;
184
+ var _window, _Symbol$for, _window$_Symbol$for;
225
185
  const version = packageInfo.version;
226
- (_a = (_b = window)[_c = Symbol.for('authme-sdk')]) !== null && _a !== void 0 ? _a : _b[_c] = {};
186
+ (_window$_Symbol$for = (_window = window)[_Symbol$for = Symbol.for('authme-sdk')]) != null ? _window$_Symbol$for : _window[_Symbol$for] = {};
227
187
  window[Symbol.for('authme-sdk')][packageInfo.name] = version;
228
188
 
229
- Object.defineProperty(exports, 'EAuthMeEyeStatus', {
230
- enumerable: true,
231
- get: function () { return engine.EAuthMeEyeStatus; }
189
+ Object.defineProperty(exports, "EAuthMeEyeStatus", {
190
+ enumerable: true,
191
+ get: function () { return engine.EAuthMeEyeStatus; }
232
192
  });
233
- Object.defineProperty(exports, 'EAuthMeFASServiceStage', {
234
- enumerable: true,
235
- get: function () { return engine.EAuthMeFASServiceStage; }
193
+ Object.defineProperty(exports, "EAuthMeFASServiceStage", {
194
+ enumerable: true,
195
+ get: function () { return engine.EAuthMeFASServiceStage; }
236
196
  });
237
- Object.defineProperty(exports, 'EAuthMeFaceAntiSpoofingStatus', {
238
- enumerable: true,
239
- get: function () { return engine.EAuthMeFaceAntiSpoofingStatus; }
197
+ Object.defineProperty(exports, "EAuthMeFaceAntiSpoofingStatus", {
198
+ enumerable: true,
199
+ get: function () { return engine.EAuthMeFaceAntiSpoofingStatus; }
240
200
  });
241
- Object.defineProperty(exports, 'EAuthMeFacePose', {
242
- enumerable: true,
243
- get: function () { return engine.EAuthMeFacePose; }
201
+ Object.defineProperty(exports, "EAuthMeFacePose", {
202
+ enumerable: true,
203
+ get: function () { return engine.EAuthMeFacePose; }
244
204
  });
245
- Object.defineProperty(exports, 'EAuthMeMouthStatus', {
246
- enumerable: true,
247
- get: function () { return engine.EAuthMeMouthStatus; }
205
+ Object.defineProperty(exports, "EAuthMeMouthStatus", {
206
+ enumerable: true,
207
+ get: function () { return engine.EAuthMeMouthStatus; }
248
208
  });
249
- Object.defineProperty(exports, 'FasRecognitionResult', {
250
- enumerable: true,
251
- get: function () { return engine.EAuthMeFASServiceStatus; }
209
+ Object.defineProperty(exports, "FasRecognitionResult", {
210
+ enumerable: true,
211
+ get: function () { return engine.EAuthMeFASServiceStatus; }
252
212
  });
253
213
  exports.FasService = FasService;
254
214
  exports.LivenessAPI = LivenessAPI;
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
@@ -1,40 +1,14 @@
1
+ import 'core-js/modules/es.promise.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.map.js';
1
4
  import { AuthmeEngineModuleBase, EngineModule } from '@authme/engine';
2
5
  export { EAuthMeEyeStatus, EAuthMeFASServiceStage, EAuthMeFaceAntiSpoofingStatus, EAuthMeFacePose, EAuthMeMouthStatus, EAuthMeFASServiceStatus as FasRecognitionResult } from '@authme/engine';
3
- import 'core-js/modules/es.regexp.to-string.js';
6
+ import 'core-js/modules/es.json.stringify.js';
4
7
  import 'core-js/modules/es.object.assign.js';
8
+ import 'core-js/modules/es.regexp.to-string.js';
9
+ import 'core-js/modules/esnext.iterator.for-each.js';
5
10
  import { sendRequest } from '@authme/core';
6
11
  import { osVersion, Storage, dataURItoBlob } from '@authme/util';
7
- import 'core-js/modules/es.symbol.description.js';
8
-
9
- /******************************************************************************
10
- Copyright (c) Microsoft Corporation.
11
-
12
- Permission to use, copy, modify, and/or distribute this software for any
13
- purpose with or without fee is hereby granted.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
- PERFORMANCE OF THIS SOFTWARE.
22
- ***************************************************************************** */
23
-
24
- function __awaiter(thisArg, _arguments, P, generator) {
25
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26
- return new (P || (P = Promise))(function (resolve, reject) {
27
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
30
- step((generator = generator.apply(thisArg, _arguments || [])).next());
31
- });
32
- }
33
-
34
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
35
- var e = new Error(message);
36
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
37
- };
38
12
 
39
13
  class FasService extends AuthmeEngineModuleBase {
40
14
  constructor(engine) {
@@ -47,15 +21,11 @@ class FasService extends AuthmeEngineModuleBase {
47
21
  stageList: stageStrList
48
22
  });
49
23
  }
50
- setPublicKeyForJson(pubKey) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- yield this.engine.setPublicKeyForJson(pubKey);
53
- });
24
+ async setPublicKeyForJson(pubKey) {
25
+ await this.engine.setPublicKeyForJson(pubKey);
54
26
  }
55
- getNormalizedFaceROI() {
56
- return __awaiter(this, void 0, void 0, function* () {
57
- return yield this.engine.run(this.moduleName, 'getNormalizedFaceROI');
58
- });
27
+ async getNormalizedFaceROI() {
28
+ return await this.engine.run(this.moduleName, 'getNormalizedFaceROI');
59
29
  }
60
30
  getStageParams(stageIndex) {
61
31
  return this.engine.run(this.moduleName, 'getStageParams', {
@@ -71,15 +41,12 @@ class FasService extends AuthmeEngineModuleBase {
71
41
  }
72
42
 
73
43
  var name = "authme/sdk";
74
- var version$1 = "2.8.42";
75
- var date = "2026-02-03T09:36:05+0000";
44
+ var version$1 = "2.8.44";
76
45
  var packageInfo = {
77
46
  name: name,
78
- version: version$1,
79
- date: date
80
- };
47
+ version: version$1};
81
48
 
82
- const init = url => (Immediately, passive, compareCustomerClientId) => __awaiter(void 0, void 0, void 0, function* () {
49
+ const init = url => async (Immediately, passive, compareCustomerClientId) => {
83
50
  const body = {
84
51
  Immediately,
85
52
  passive: passive,
@@ -97,8 +64,8 @@ const init = url => (Immediately, passive, compareCustomerClientId) => __awaiter
97
64
  return sendRequest(url, 'POST', {
98
65
  body: JSON.stringify(body)
99
66
  });
100
- });
101
- const detect = url => data => __awaiter(void 0, void 0, void 0, function* () {
67
+ };
68
+ const detect = url => async data => {
102
69
  const formData = new FormData();
103
70
  formData.append('id', data.id);
104
71
  formData.append('score', data.score.toString());
@@ -114,20 +81,19 @@ const detect = url => data => __awaiter(void 0, void 0, void 0, function* () {
114
81
  body: formData,
115
82
  contentType: 'multipart/form-data'
116
83
  });
117
- });
118
- const uploadFrameFile = url => data => __awaiter(void 0, void 0, void 0, function* () {
119
- var _a;
84
+ };
85
+ const uploadFrameFile = url => async data => {
86
+ var _data$index;
120
87
  const formData = new FormData();
121
88
  formData.append('id', data.id);
122
- formData.append('index', (_a = data.index) === null || _a === void 0 ? void 0 : _a.toString());
89
+ formData.append('index', (_data$index = data.index) == null ? void 0 : _data$index.toString());
123
90
  formData.append('data', dataURItoBlob(data.data));
124
91
  return sendRequest(url, 'POST', {
125
92
  body: formData,
126
93
  contentType: 'multipart/form-data'
127
94
  });
128
- });
129
- const uploadFrame = url => body => __awaiter(void 0, void 0, void 0, function* () {
130
- var _b;
95
+ };
96
+ const uploadFrame = url => async body => {
131
97
  let encryptApiPath = '';
132
98
  if (body.encryptedBase64String) {
133
99
  encryptApiPath = `/encrypted`;
@@ -135,14 +101,15 @@ const uploadFrame = url => body => __awaiter(void 0, void 0, void 0, function* (
135
101
  body: JSON.stringify(body)
136
102
  });
137
103
  } else {
104
+ var _body$data;
138
105
  return sendRequest(url, 'POST', {
139
- body: JSON.stringify(Object.assign(Object.assign({}, body), {
140
- data: (_b = body.data) === null || _b === void 0 ? void 0 : _b.split('base64,')[1]
106
+ body: JSON.stringify(Object.assign({}, body, {
107
+ data: (_body$data = body.data) == null ? void 0 : _body$data.split('base64,')[1]
141
108
  }))
142
109
  });
143
110
  }
144
- });
145
- const uploadMeta = url => data => __awaiter(void 0, void 0, void 0, function* () {
111
+ };
112
+ const uploadMeta = url => async data => {
146
113
  let encryptApiPath = '';
147
114
  if (data.encryptedBase64String) {
148
115
  encryptApiPath = `/encrypted`;
@@ -150,17 +117,13 @@ const uploadMeta = url => data => __awaiter(void 0, void 0, void 0, function* ()
150
117
  return sendRequest(`${url}${encryptApiPath}`, 'POST', {
151
118
  body: JSON.stringify(data)
152
119
  });
153
- });
154
- const getResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
155
- return sendRequest(`${url}/${id}`, 'GET');
156
- });
157
- const getVerifyResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
158
- return sendRequest(`${url}/${id}`, 'GET');
159
- });
160
- const option = url => deviceType => __awaiter(void 0, void 0, void 0, function* () {
120
+ };
121
+ const getResult = url => async id => sendRequest(`${url}/${id}`, 'GET');
122
+ const getVerifyResult = url => async id => sendRequest(`${url}/${id}`, 'GET');
123
+ const option = url => async deviceType => {
161
124
  return sendRequest(`${url}${deviceType ? '?deviceType=' + deviceType : ''}`, 'GET');
162
- });
163
- const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* () {
125
+ };
126
+ const themeUI = url => async themeId => {
164
127
  // const url = `/api/identity-verification/v1/ui-themes/${themeId}`;
165
128
  // const accessToken = Storage.getItem('token') as string | null;
166
129
  // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
@@ -189,7 +152,7 @@ const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* ()
189
152
  // return {}; // 或拋出錯誤,視需求而定
190
153
  // }
191
154
  return sendRequest(`${url}/${themeId}`, 'GET');
192
- });
155
+ };
193
156
  const IdentityVerification = {
194
157
  init: init('/api/identity-verification/v3/liveness/init'),
195
158
  detect: detect('/api/identity-verification/v3/liveness/detect'),
@@ -217,10 +180,9 @@ var LivenessResultStatus;
217
180
  LivenessResultStatus["UPLOADING"] = "Uploading";
218
181
  })(LivenessResultStatus || (LivenessResultStatus = {}));
219
182
 
220
- var _a;
221
- var _b, _c;
183
+ var _window, _Symbol$for, _window$_Symbol$for;
222
184
  const version = packageInfo.version;
223
- (_a = (_b = window)[_c = Symbol.for('authme-sdk')]) !== null && _a !== void 0 ? _a : _b[_c] = {};
185
+ (_window$_Symbol$for = (_window = window)[_Symbol$for = Symbol.for('authme-sdk')]) != null ? _window$_Symbol$for : _window[_Symbol$for] = {};
224
186
  window[Symbol.for('authme-sdk')][packageInfo.name] = version;
225
187
 
226
188
  export { FasService, LivenessAPI, LivenessResultStatus, version };
package/package.json CHANGED
@@ -1,15 +1,10 @@
1
1
  {
2
2
  "name": "@authme/liveness",
3
- "version": "2.8.42",
3
+ "version": "2.8.44",
4
4
  "peerDependencies": {
5
- "core-js": "^3.6.0",
6
- "@authme/core": "2.8.42",
7
- "@authme/engine": "2.8.42",
8
- "@authme/util": "2.8.42"
5
+ "core-js": "^3.6.0"
9
6
  },
10
- "module": "./index.js",
11
- "main": "./index.cjs",
12
- "type": "module",
13
- "types": "./src/index.d.ts",
14
- "dependencies": {}
15
- }
7
+ "module": "./index.esm.js",
8
+ "main": "./index.cjs.js",
9
+ "types": "./index.esm.d.ts"
10
+ }
package/src/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './lib/modules-liveness-feature-liveness';
2
- export * from './lib/enum';
3
- export * from './lib/interface';
4
- export * from './lib/data-access';
5
- export { version } from './lib/version';
1
+ export * from './lib/modules-liveness-feature-liveness';
2
+ export * from './lib/enum';
3
+ export * from './lib/interface';
4
+ export * from './lib/data-access';
5
+ export { version } from './lib/version';
@@ -1,25 +1,25 @@
1
- import { LivenessDetectBody, LivenessResultResponse, LivenessUploadFrameBody, LivenessUploadMetaBody } from './dto.interface';
2
- import { DEVICE_TYPE } from '@authme/util';
3
- export declare const LivenessAPI: {
4
- IdentityVerification: {
5
- init: (Immediately: boolean, passive?: boolean | null, compareCustomerClientId?: string | null) => Promise<any>;
6
- detect: (data: LivenessDetectBody) => Promise<{
7
- isLiveness?: boolean;
8
- score?: number;
9
- }>;
10
- uploadFrame: (body: LivenessUploadFrameBody) => Promise<void>;
11
- uploadFrameFile: (data: LivenessUploadFrameBody) => Promise<void>;
12
- uploadMeta: (data: LivenessUploadMetaBody) => Promise<void>;
13
- getResult: (id: string) => Promise<LivenessResultResponse>;
14
- option: (deviceType?: DEVICE_TYPE | null) => Promise<any>;
15
- themeUI: (themeId: string) => Promise<any>;
16
- };
17
- CustomerManagement: {
18
- getVerifyResult: (id: string) => Promise<any>;
19
- init: (Immediately: boolean, passive?: boolean | null, compareCustomerClientId?: string | null) => Promise<any>;
20
- detect: (data: LivenessDetectBody) => Promise<{
21
- isLiveness?: boolean;
22
- score?: number;
23
- }>;
24
- };
25
- };
1
+ import { LivenessDetectBody, LivenessResultResponse, LivenessUploadFrameBody, LivenessUploadMetaBody } from './dto.interface';
2
+ import { DEVICE_TYPE } from '@authme/util';
3
+ export declare const LivenessAPI: {
4
+ IdentityVerification: {
5
+ init: (Immediately: boolean, passive?: boolean | null, compareCustomerClientId?: string | null) => Promise<any>;
6
+ detect: (data: LivenessDetectBody) => Promise<{
7
+ isLiveness?: boolean;
8
+ score?: number;
9
+ }>;
10
+ uploadFrame: (body: LivenessUploadFrameBody) => Promise<void>;
11
+ uploadFrameFile: (data: LivenessUploadFrameBody) => Promise<void>;
12
+ uploadMeta: (data: LivenessUploadMetaBody) => Promise<void>;
13
+ getResult: (id: string) => Promise<LivenessResultResponse>;
14
+ option: (deviceType?: DEVICE_TYPE | null) => Promise<any>;
15
+ themeUI: (themeId: string) => Promise<any>;
16
+ };
17
+ CustomerManagement: {
18
+ getVerifyResult: (id: string) => Promise<any>;
19
+ init: (Immediately: boolean, passive?: boolean | null, compareCustomerClientId?: string | null) => Promise<any>;
20
+ detect: (data: LivenessDetectBody) => Promise<{
21
+ isLiveness?: boolean;
22
+ score?: number;
23
+ }>;
24
+ };
25
+ };
@@ -1,46 +1,46 @@
1
- export interface LivenessDetectBody {
2
- id: string;
3
- frames: Blob[];
4
- score: number;
5
- isLiveness: boolean;
6
- results: {
7
- status: string;
8
- stage: string;
9
- }[];
10
- }
11
- export interface LivenessUploadFrameBody {
12
- id?: string;
13
- index?: number;
14
- data?: string;
15
- encryptedBase64String?: string;
16
- }
17
- export interface LivenessUploadMetaBody {
18
- id?: string;
19
- data?: string;
20
- encryptedBase64String?: string;
21
- }
22
- export interface LivenessInitResponse {
23
- id: string;
24
- expiredIn: number;
25
- shouldEncrypt?: boolean;
26
- parameters: {
27
- fasThreshold: number;
28
- fasTimeout: number;
29
- fasMaxFps: number;
30
- fasStages: string[];
31
- pubKey: string;
32
- };
33
- }
34
- export interface LivenessResultResponse {
35
- state: LivenessResultStatus;
36
- isPass: boolean;
37
- score: number;
38
- createTime: string;
39
- updateTime: string;
40
- expiryTime: string;
41
- }
42
- export declare enum LivenessResultStatus {
43
- DONE = "Done",
44
- VALIDATING = "Validating",
45
- UPLOADING = "Uploading"
46
- }
1
+ export interface LivenessDetectBody {
2
+ id: string;
3
+ frames: Blob[];
4
+ score: number;
5
+ isLiveness: boolean;
6
+ results: {
7
+ status: string;
8
+ stage: string;
9
+ }[];
10
+ }
11
+ export interface LivenessUploadFrameBody {
12
+ id?: string;
13
+ index?: number;
14
+ data?: string;
15
+ encryptedBase64String?: string;
16
+ }
17
+ export interface LivenessUploadMetaBody {
18
+ id?: string;
19
+ data?: string;
20
+ encryptedBase64String?: string;
21
+ }
22
+ export interface LivenessInitResponse {
23
+ id: string;
24
+ expiredIn: number;
25
+ shouldEncrypt?: boolean;
26
+ parameters: {
27
+ fasThreshold: number;
28
+ fasTimeout: number;
29
+ fasMaxFps: number;
30
+ fasStages: string[];
31
+ pubKey: string;
32
+ };
33
+ }
34
+ export interface LivenessResultResponse {
35
+ state: LivenessResultStatus;
36
+ isPass: boolean;
37
+ score: number;
38
+ createTime: string;
39
+ updateTime: string;
40
+ expiryTime: string;
41
+ }
42
+ export declare enum LivenessResultStatus {
43
+ DONE = "Done",
44
+ VALIDATING = "Validating",
45
+ UPLOADING = "Uploading"
46
+ }
@@ -1,2 +1,2 @@
1
- export * from './api';
2
- export * from './dto.interface';
1
+ export * from './api';
2
+ export * from './dto.interface';
@@ -1 +1 @@
1
- export { EAuthMeEyeStatus, EAuthMeFaceAntiSpoofingStatus, EAuthMeFacePose, EAuthMeFASServiceStage, EAuthMeMouthStatus, EAuthMeFASServiceStatus as FasRecognitionResult, } from '@authme/engine';
1
+ export { EAuthMeEyeStatus, EAuthMeFaceAntiSpoofingStatus, EAuthMeFacePose, EAuthMeFASServiceStage, EAuthMeMouthStatus, EAuthMeFASServiceStatus as FasRecognitionResult, } from '@authme/engine';
@@ -1 +1 @@
1
- export * from './fas-recognition.enum';
1
+ export * from './fas-recognition.enum';
@@ -1,36 +1,36 @@
1
- import { AuthMeRectFloat } from '@authme/engine';
2
- import { EAuthMeEyeStatus, EAuthMeFaceAntiSpoofingStatus, EAuthMeFacePose, EAuthMeFASServiceStage, EAuthMeMouthStatus, FasRecognitionResult } from '../enum';
3
- export interface FasResult {
4
- info: AuthMeFASServiceInfo;
5
- iIsKeyFrame: 0 | 1;
6
- eStatus: FasRecognitionResult;
7
- eStage: EAuthMeFASServiceStage;
8
- }
9
- export interface AuthMeFASServiceInfo {
10
- face: AuthMeFaceInfo;
11
- eye: AuthMeEyeInfo;
12
- mouth: AuthMeMouthInfo;
13
- pose: AuthMeFacePoseInfo;
14
- fas: AuthMeFASInfo;
15
- }
16
- export interface AuthMeFaceInfo {
17
- fScore: number;
18
- fMask: number;
19
- box: AuthMeRectFloat;
20
- afLandmark: number[];
21
- }
22
- export interface AuthMeEyeInfo {
23
- fScore: number;
24
- eStatus: EAuthMeEyeStatus;
25
- }
26
- export interface AuthMeMouthInfo {
27
- fScore: number;
28
- eStatus: EAuthMeMouthStatus;
29
- }
30
- export interface AuthMeFacePoseInfo {
31
- ePose: EAuthMeFacePose;
32
- }
33
- export interface AuthMeFASInfo {
34
- eStatus: EAuthMeFaceAntiSpoofingStatus;
35
- fScore: number;
36
- }
1
+ import { AuthMeRectFloat } from '@authme/engine';
2
+ import { EAuthMeEyeStatus, EAuthMeFaceAntiSpoofingStatus, EAuthMeFacePose, EAuthMeFASServiceStage, EAuthMeMouthStatus, FasRecognitionResult } from '../enum';
3
+ export interface FasResult {
4
+ info: AuthMeFASServiceInfo;
5
+ iIsKeyFrame: 0 | 1;
6
+ eStatus: FasRecognitionResult;
7
+ eStage: EAuthMeFASServiceStage;
8
+ }
9
+ export interface AuthMeFASServiceInfo {
10
+ face: AuthMeFaceInfo;
11
+ eye: AuthMeEyeInfo;
12
+ mouth: AuthMeMouthInfo;
13
+ pose: AuthMeFacePoseInfo;
14
+ fas: AuthMeFASInfo;
15
+ }
16
+ export interface AuthMeFaceInfo {
17
+ fScore: number;
18
+ fMask: number;
19
+ box: AuthMeRectFloat;
20
+ afLandmark: number[];
21
+ }
22
+ export interface AuthMeEyeInfo {
23
+ fScore: number;
24
+ eStatus: EAuthMeEyeStatus;
25
+ }
26
+ export interface AuthMeMouthInfo {
27
+ fScore: number;
28
+ eStatus: EAuthMeMouthStatus;
29
+ }
30
+ export interface AuthMeFacePoseInfo {
31
+ ePose: EAuthMeFacePose;
32
+ }
33
+ export interface AuthMeFASInfo {
34
+ eStatus: EAuthMeFaceAntiSpoofingStatus;
35
+ fScore: number;
36
+ }
@@ -1 +1 @@
1
- export * from './fas.interface';
1
+ export * from './fas.interface';
@@ -1,19 +1,19 @@
1
- import { AuthmeEngineModuleBase, MlEngine } from '@authme/engine';
2
- import { EAuthMeFASServiceStage } from './enum';
3
- import { FasResult } from './interface';
4
- export declare class FasService extends AuthmeEngineModuleBase<FasResult> {
5
- constructor(engine: MlEngine);
6
- setStage(stageList: EAuthMeFASServiceStage[]): Promise<unknown>;
7
- setPublicKeyForJson(pubKey: string): Promise<void>;
8
- getNormalizedFaceROI(): Promise<unknown>;
9
- getStageParams(stageIndex: number): Promise<{
10
- applyFAS: 0 | 1;
11
- fThreshold: number;
12
- iFrameNum: number;
13
- }>;
14
- setStageParams(stageIndex: number, value: {
15
- applyFAS: 0 | 1;
16
- fThreshold: number;
17
- iFrameNum: number;
18
- }): Promise<unknown>;
19
- }
1
+ import { AuthmeEngineModuleBase, MlEngine } from '@authme/engine';
2
+ import { EAuthMeFASServiceStage } from './enum';
3
+ import { FasResult } from './interface';
4
+ export declare class FasService extends AuthmeEngineModuleBase<FasResult> {
5
+ constructor(engine: MlEngine);
6
+ setStage(stageList: EAuthMeFASServiceStage[]): Promise<unknown>;
7
+ setPublicKeyForJson(pubKey: string): Promise<void>;
8
+ getNormalizedFaceROI(): Promise<unknown>;
9
+ getStageParams(stageIndex: number): Promise<{
10
+ applyFAS: 0 | 1;
11
+ fThreshold: number;
12
+ iFrameNum: number;
13
+ }>;
14
+ setStageParams(stageIndex: number, value: {
15
+ applyFAS: 0 | 1;
16
+ fThreshold: number;
17
+ iFrameNum: number;
18
+ }): Promise<unknown>;
19
+ }
@@ -1 +1 @@
1
- export declare const version: string;
1
+ export declare const version: string;