santoid-sdk 8.0.0 → 9.0.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +17 -3
  2. package/README.md +123 -244
  3. package/api/ApiLivenessSessionService.d.ts +14 -0
  4. package/api/ApiLivenessSessionService.js +4 -0
  5. package/browser/index.js +1 -1
  6. package/browser/liveness-capture.js +2 -0
  7. package/browser/liveness-capture.js.LICENSE.txt +350 -0
  8. package/client/age/index.d.ts +18 -0
  9. package/client/age/index.js +40 -0
  10. package/client/index.d.ts +4 -2
  11. package/client/index.js +4 -2
  12. package/client/liveness/index.d.ts +2 -2
  13. package/client/liveness/index.js +3 -3
  14. package/client/liveness/methods/livenessSession/Service.d.ts +7 -2
  15. package/client/liveness/methods/livenessSession/Service.js +14 -6
  16. package/client/liveness/methods/livenessSession/index.d.ts +13 -9
  17. package/client/liveness/methods/livenessSession/index.js +12 -9
  18. package/client/liveness/methods/livenessSession/isLivenessApproved.d.ts +6 -0
  19. package/client/liveness/methods/livenessSession/isLivenessApproved.js +13 -0
  20. package/client/liveness/methods/uploadIdentificationDocument/Service.d.ts +8 -29
  21. package/client/liveness/methods/uploadIdentificationDocument/Service.js +25 -66
  22. package/client/liveness/methods/uploadIdentificationDocument/index.d.ts +4 -18
  23. package/client/liveness/methods/uploadIdentificationDocument/index.js +4 -8
  24. package/client/liveness-capture/LivenessCapture.d.ts +13 -0
  25. package/client/liveness-capture/LivenessCapture.js +23 -0
  26. package/client/liveness-capture/displayText.d.ts +54 -0
  27. package/client/liveness-capture/displayText.js +57 -0
  28. package/client/liveness-capture/index.d.ts +36 -0
  29. package/client/liveness-capture/index.js +2 -0
  30. package/client/liveness-capture/index.js.LICENSE.txt +350 -0
  31. package/package.json +11 -4
  32. package/server/index.d.ts +0 -2
  33. package/server/index.js +0 -2
  34. package/server/liveness/index.d.ts +1 -2
  35. package/server/liveness/index.js +1 -3
  36. package/server/liveness/methods/uploadIdentificationDocument/Service.d.ts +3 -3
  37. package/server/liveness/methods/uploadIdentificationDocument/Service.js +2 -2
  38. package/server/liveness/methods/uploadIdentificationDocument/index.d.ts +7 -21
  39. package/server/liveness/methods/uploadIdentificationDocument/index.js +4 -10
  40. package/tsconfig.json +3 -0
  41. package/tsconfig.prod.json +3 -0
  42. package/utils/constants.d.ts +1 -2
  43. package/utils/constants.js +4 -3
  44. package/utils/error.d.ts +6 -5
  45. package/utils/error.js +7 -6
  46. package/utils/types.d.ts +0 -39
  47. package/webpack.config.cjs +45 -2
  48. package/client/liveness/methods/livenessDetection/Service.d.ts +0 -28
  49. package/client/liveness/methods/livenessDetection/Service.js +0 -138
  50. package/client/liveness/methods/livenessDetection/index.d.ts +0 -23
  51. package/client/liveness/methods/livenessDetection/index.js +0 -58
  52. package/server/liveness/methods/livenessDetection/Service.d.ts +0 -6
  53. package/server/liveness/methods/livenessDetection/Service.js +0 -20
  54. package/server/liveness/methods/livenessDetection/index.d.ts +0 -13
  55. package/server/liveness/methods/livenessDetection/index.js +0 -50
  56. package/utils/websocket.d.ts +0 -18
  57. package/utils/websocket.js +0 -62
@@ -0,0 +1,350 @@
1
+ /*!
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2016 Christian Speckner <cnspeckn@googlemail.com>
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ */
24
+
25
+ /*! *****************************************************************************
26
+ Copyright (c) Microsoft Corporation.
27
+
28
+ Permission to use, copy, modify, and/or distribute this software for any
29
+ purpose with or without fee is hereby granted.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
32
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
33
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
34
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
35
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
36
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
37
+ PERFORMANCE OF THIS SOFTWARE.
38
+ ***************************************************************************** */
39
+
40
+ /*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
41
+
42
+ /**
43
+ * @license
44
+ * Copyright 2017 Google LLC. All Rights Reserved.
45
+ * Licensed under the Apache License, Version 2.0 (the "License");
46
+ * you may not use this file except in compliance with the License.
47
+ * You may obtain a copy of the License at
48
+ *
49
+ * http://www.apache.org/licenses/LICENSE-2.0
50
+ *
51
+ * Unless required by applicable law or agreed to in writing, software
52
+ * distributed under the License is distributed on an "AS IS" BASIS,
53
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
+ * See the License for the specific language governing permissions and
55
+ * limitations under the License.
56
+ * =============================================================================
57
+ */
58
+
59
+ /**
60
+ * @license
61
+ * Copyright 2018 Google LLC. All Rights Reserved.
62
+ * Licensed under the Apache License, Version 2.0 (the "License");
63
+ * you may not use this file except in compliance with the License.
64
+ * You may obtain a copy of the License at
65
+ *
66
+ * http://www.apache.org/licenses/LICENSE-2.0
67
+ *
68
+ * Unless required by applicable law or agreed to in writing, software
69
+ * distributed under the License is distributed on an "AS IS" BASIS,
70
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71
+ * See the License for the specific language governing permissions and
72
+ * limitations under the License.
73
+ * =============================================================================
74
+ */
75
+
76
+ /**
77
+ * @license
78
+ * Copyright 2019 Google LLC. All Rights Reserved.
79
+ * Licensed under the Apache License, Version 2.0 (the "License");
80
+ * you may not use this file except in compliance with the License.
81
+ * You may obtain a copy of the License at
82
+ *
83
+ * http://www.apache.org/licenses/LICENSE-2.0
84
+ *
85
+ * Unless required by applicable law or agreed to in writing, software
86
+ * distributed under the License is distributed on an "AS IS" BASIS,
87
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
88
+ * See the License for the specific language governing permissions and
89
+ * limitations under the License.
90
+ * =============================================================================
91
+ */
92
+
93
+ /**
94
+ * @license
95
+ * Copyright 2019 Google LLC. All Rights Reserved.
96
+ * Licensed under the Apache License, Version 2.0 (the 'License');
97
+ * you may not use this file except in compliance with the License.
98
+ * You may obtain a copy of the License at
99
+ *
100
+ * http://www.apache.org/licenses/LICENSE-2.0
101
+ *
102
+ * Unless required by applicable law or agreed to in writing, software
103
+ * distributed under the License is distributed on an 'AS IS' BASIS,
104
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
+ * See the License for the specific language governing permissions and
106
+ * limitations under the License.
107
+ * =============================================================================
108
+ */
109
+
110
+ /**
111
+ * @license
112
+ * Copyright 2020 Google Inc. All Rights Reserved.
113
+ * Licensed under the Apache License, Version 2.0 (the "License");
114
+ * you may not use this file except in compliance with the License.
115
+ * You may obtain a copy of the License at
116
+ *
117
+ * http://www.apache.org/licenses/LICENSE-2.0
118
+ *
119
+ * Unless required by applicable law or agreed to in writing, software
120
+ * distributed under the License is distributed on an "AS IS" BASIS,
121
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122
+ * See the License for the specific language governing permissions and
123
+ * limitations under the License.
124
+ * =============================================================================
125
+ */
126
+
127
+ /**
128
+ * @license
129
+ * Copyright 2020 Google LLC. All Rights Reserved.
130
+ * Licensed under the Apache License, Version 2.0 (the "License");
131
+ * you may not use this file except in compliance with the License.
132
+ * You may obtain a copy of the License at
133
+ *
134
+ * http://www.apache.org/licenses/LICENSE-2.0
135
+ *
136
+ * Unless required by applicable law or agreed to in writing, software
137
+ * distributed under the License is distributed on an "AS IS" BASIS,
138
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139
+ * See the License for the specific language governing permissions and
140
+ * limitations under the License.
141
+ * =============================================================================
142
+ */
143
+
144
+ /**
145
+ * @license
146
+ * Copyright 2020 Google LLC. All Rights Reserved.
147
+ * Licensed under the Apache License, Version 2.0 (the License);
148
+ * you may not use this file except in compliance with the License.
149
+ * You may obtain a copy of the License at
150
+ *
151
+ * http://www.apache.org/licenses/LICENSE-2.0
152
+ *
153
+ * Unless required by applicable law or agreed to in writing, software
154
+ * distributed under the License is distributed on an AS IS BASIS,
155
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156
+ * See the License for the specific language governing permissions and
157
+ * limitations under the License.
158
+ * =============================================================================
159
+ */
160
+
161
+ /**
162
+ * @license
163
+ * Copyright 2021 Google LLC. All Rights Reserved.
164
+ * Licensed under the Apache License, Version 2.0 (the "License");
165
+ * you may not use this file except in compliance with the License.
166
+ * You may obtain a copy of the License at
167
+ *
168
+ * http://www.apache.org/licenses/LICENSE-2.0
169
+ *
170
+ * Unless required by applicable law or agreed to in writing, software
171
+ * distributed under the License is distributed on an "AS IS" BASIS,
172
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
173
+ * See the License for the specific language governing permissions and
174
+ * limitations under the License.
175
+ * =============================================================================
176
+ */
177
+
178
+ /**
179
+ * @license
180
+ * Copyright 2021 Google LLC. All Rights Reserved.
181
+ * Licensed under the Apache License, Version 2.0 (the "License");
182
+ * you may not use this file except in compliance with the License.
183
+ * You may obtain a copy of the License at
184
+ *
185
+ * https://www.apache.org/licenses/LICENSE-2.0
186
+ *
187
+ * Unless required by applicable law or agreed to in writing, software
188
+ * distributed under the License is distributed on an "AS IS" BASIS,
189
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ * See the License for the specific language governing permissions and
191
+ * limitations under the License.
192
+ * =============================================================================
193
+ */
194
+
195
+ /**
196
+ * @license
197
+ * Copyright 2022 Google LLC.
198
+ * Licensed under the Apache License, Version 2.0 (the "License");
199
+ * you may not use this file except in compliance with the License.
200
+ * You may obtain a copy of the License at
201
+ *
202
+ * http://www.apache.org/licenses/LICENSE-2.0
203
+ *
204
+ * Unless required by applicable law or agreed to in writing, software
205
+ * distributed under the License is distributed on an "AS IS" BASIS,
206
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
207
+ * See the License for the specific language governing permissions and
208
+ * limitations under the License.
209
+ * =============================================================================
210
+ */
211
+
212
+ /**
213
+ * @license
214
+ * Copyright 2022 Google LLC. All Rights Reserved.
215
+ * Licensed under the Apache License, Version 2.0 (the "License");
216
+ * you may not use this file except in compliance with the License.
217
+ * You may obtain a copy of the License at
218
+ *
219
+ * http://www.apache.org/licenses/LICENSE-2.0
220
+ *
221
+ * Unless required by applicable law or agreed to in writing, software
222
+ * distributed under the License is distributed on an "AS IS" BASIS,
223
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
+ * See the License for the specific language governing permissions and
225
+ * limitations under the License.
226
+ * =============================================================================
227
+ */
228
+
229
+ /**
230
+ * @license
231
+ * Copyright 2022 Google LLC. All Rights Reserved.
232
+ * Licensed under the Apache License, Version 2.0 (the 'License');
233
+ * you may not use this file except in compliance with the License.
234
+ * You may obtain a copy of the License at
235
+ *
236
+ * http://www.apache.org/licenses/LICENSE-2.0
237
+ *
238
+ * Unless required by applicable law or agreed to in writing, software
239
+ * distributed under the License is distributed on an 'AS IS' BASIS,
240
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
241
+ * See the License for the specific language governing permissions and
242
+ * limitations under the License.
243
+ * =============================================================================
244
+ */
245
+
246
+ /**
247
+ * @license
248
+ * Copyright 2023 Google LLC.
249
+ * Licensed under the Apache License, Version 2.0 (the "License");
250
+ * you may not use this file except in compliance with the License.
251
+ * You may obtain a copy of the License at
252
+ *
253
+ * http://www.apache.org/licenses/LICENSE-2.0
254
+ *
255
+ * Unless required by applicable law or agreed to in writing, software
256
+ * distributed under the License is distributed on an "AS IS" BASIS,
257
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
258
+ * See the License for the specific language governing permissions and
259
+ * limitations under the License.
260
+ * =============================================================================
261
+ */
262
+
263
+ /**
264
+ * @license
265
+ * Copyright 2023 Google LLC. All Rights Reserved.
266
+ * Licensed under the Apache License, Version 2.0 (the "License");
267
+ * you may not use this file except in compliance with the License.
268
+ * You may obtain a copy of the License at
269
+ *
270
+ * http://www.apache.org/licenses/LICENSE-2.0
271
+ *
272
+ * Unless required by applicable law or agreed to in writing, software
273
+ * distributed under the License is distributed on an "AS IS" BASIS,
274
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
275
+ * See the License for the specific language governing permissions and
276
+ * limitations under the License.
277
+ * =============================================================================
278
+ */
279
+
280
+ /**
281
+ * @license React
282
+ * react-dom-client.production.js
283
+ *
284
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
285
+ *
286
+ * This source code is licensed under the MIT license found in the
287
+ * LICENSE file in the root directory of this source tree.
288
+ */
289
+
290
+ /**
291
+ * @license React
292
+ * react-dom.production.js
293
+ *
294
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
295
+ *
296
+ * This source code is licensed under the MIT license found in the
297
+ * LICENSE file in the root directory of this source tree.
298
+ */
299
+
300
+ /**
301
+ * @license React
302
+ * react-jsx-runtime.production.js
303
+ *
304
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
305
+ *
306
+ * This source code is licensed under the MIT license found in the
307
+ * LICENSE file in the root directory of this source tree.
308
+ */
309
+
310
+ /**
311
+ * @license React
312
+ * react.production.js
313
+ *
314
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
315
+ *
316
+ * This source code is licensed under the MIT license found in the
317
+ * LICENSE file in the root directory of this source tree.
318
+ */
319
+
320
+ /**
321
+ * @license React
322
+ * scheduler.production.js
323
+ *
324
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
325
+ *
326
+ * This source code is licensed under the MIT license found in the
327
+ * LICENSE file in the root directory of this source tree.
328
+ */
329
+
330
+ /**
331
+ * @license React
332
+ * use-sync-external-store-shim.production.js
333
+ *
334
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
335
+ *
336
+ * This source code is licensed under the MIT license found in the
337
+ * LICENSE file in the root directory of this source tree.
338
+ */
339
+
340
+ /**
341
+ * @license React
342
+ * use-sync-external-store-shim/with-selector.production.js
343
+ *
344
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
345
+ *
346
+ * This source code is licensed under the MIT license found in the
347
+ * LICENSE file in the root directory of this source tree.
348
+ */
349
+
350
+ /** @license See the LICENSE file. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "santoid-sdk",
3
- "version": "8.0.0",
3
+ "version": "9.0.0",
4
4
  "description": "",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",
@@ -19,9 +19,11 @@
19
19
  "devDependencies": {
20
20
  "@types/jest": "^29.5.5",
21
21
  "@types/node": "^20.6.2",
22
- "@types/ws": "^8.5.6",
22
+ "@types/react": "^19.1.16",
23
+ "@types/react-dom": "^19.1.9",
23
24
  "@typescript-eslint/eslint-plugin": "^6.4.0",
24
25
  "clean-webpack-plugin": "^4.0.0",
26
+ "css-loader": "^7.1.5",
25
27
  "eslint": "^8.0.1",
26
28
  "eslint-config-standard-with-typescript": "^39.0.0",
27
29
  "eslint-plugin-import": "^2.25.2",
@@ -30,6 +32,7 @@
30
32
  "jest": "^29.7.0",
31
33
  "jest-canvas-mock": "^2.5.2",
32
34
  "jest-environment-jsdom": "^29.7.0",
35
+ "style-loader": "^4.0.0",
33
36
  "ts-jest": "^29.1.1",
34
37
  "ts-loader": "^9.4.4",
35
38
  "ts-node": "^10.9.1",
@@ -39,9 +42,13 @@
39
42
  "webpack-node-externals": "^3.0.0"
40
43
  },
41
44
  "dependencies": {
45
+ "@aws-amplify/ui-react": "^6.15.5",
46
+ "@aws-amplify/ui-react-liveness": "^3.6.8",
47
+ "aws-amplify": "^6.20.0",
42
48
  "axios": "^1.5.1",
43
49
  "form-data": "^4.0.0",
44
- "uuid": "^3.3.3",
45
- "ws": "^8.14.2"
50
+ "react": "^19.1.1",
51
+ "react-dom": "^19.1.1",
52
+ "uuid": "^3.3.3"
46
53
  }
47
54
  }
package/server/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import { livenessDetection } from './liveness/methods/livenessDetection';
2
1
  import { uploadIdentificationDocument } from './liveness/methods/uploadIdentificationDocument';
3
2
  import { typification } from './core/methods/typification';
4
3
  import { faceMatch } from './core/methods/faceMatch';
5
4
  import { ocr } from './core/methods/ocr';
6
5
  export default class SantoiDSDK {
7
- static readonly livenessDetection: typeof livenessDetection;
8
6
  static readonly uploadIdentificationDocument: typeof uploadIdentificationDocument;
9
7
  static readonly typification: typeof typification;
10
8
  static readonly faceMatch: typeof faceMatch;
package/server/index.js CHANGED
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const livenessDetection_1 = require("./liveness/methods/livenessDetection");
4
3
  const uploadIdentificationDocument_1 = require("./liveness/methods/uploadIdentificationDocument");
5
4
  const typification_1 = require("./core/methods/typification");
6
5
  const faceMatch_1 = require("./core/methods/faceMatch");
7
6
  const ocr_1 = require("./core/methods/ocr");
8
7
  class SantoiDSDK {
9
8
  }
10
- SantoiDSDK.livenessDetection = livenessDetection_1.livenessDetection;
11
9
  SantoiDSDK.uploadIdentificationDocument = uploadIdentificationDocument_1.uploadIdentificationDocument;
12
10
  SantoiDSDK.typification = typification_1.typification;
13
11
  SantoiDSDK.faceMatch = faceMatch_1.faceMatch;
@@ -1,3 +1,2 @@
1
- import { livenessDetection } from './methods/livenessDetection';
2
1
  import { uploadIdentificationDocument } from './methods/uploadIdentificationDocument';
3
- export { livenessDetection, uploadIdentificationDocument, };
2
+ export { uploadIdentificationDocument, };
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadIdentificationDocument = exports.livenessDetection = void 0;
4
- const livenessDetection_1 = require("./methods/livenessDetection");
5
- Object.defineProperty(exports, "livenessDetection", { enumerable: true, get: function () { return livenessDetection_1.livenessDetection; } });
3
+ exports.uploadIdentificationDocument = void 0;
6
4
  const uploadIdentificationDocument_1 = require("./methods/uploadIdentificationDocument");
7
5
  Object.defineProperty(exports, "uploadIdentificationDocument", { enumerable: true, get: function () { return uploadIdentificationDocument_1.uploadIdentificationDocument; } });
@@ -1,4 +1,4 @@
1
- import { UploadIdentificationDocumentService, type IServiceOptions, type IInternalServiceOptions } from '../../../../client/liveness/methods/uploadIdentificationDocument/Service';
2
- export declare class NodeUploadIdentificationDocumentService<TFrameType, TMediaType> extends UploadIdentificationDocumentService<TFrameType, TMediaType> {
3
- constructor(options: IServiceOptions<TFrameType, TMediaType>, internalOptions: IInternalServiceOptions<TFrameType, TMediaType>);
1
+ import { UploadIdentificationDocumentService, type IServiceOptions } from '../../../../client/liveness/methods/uploadIdentificationDocument/Service';
2
+ export declare class NodeUploadIdentificationDocumentService<TFrameType> extends UploadIdentificationDocumentService<TFrameType> {
3
+ constructor(options: IServiceOptions<TFrameType>);
4
4
  }
@@ -10,8 +10,8 @@ const ApiTypificationService_1 = require("../../../../api/ApiTypificationService
10
10
  const ApiFaceMatchService_1 = require("../../../../api/ApiFaceMatchService");
11
11
  const index_1 = require("../../utils/index");
12
12
  class NodeUploadIdentificationDocumentService extends Service_1.UploadIdentificationDocumentService {
13
- constructor(options, internalOptions) {
14
- super(options, internalOptions);
13
+ constructor(options) {
14
+ super(options);
15
15
  this.typificationService = new ApiTypificationService_1.ApiTypificationService(options, { FormDataClass: form_data_1.default, tryDecodeJwt: index_1.tryDecodeJwt });
16
16
  this.faceMatchService = new ApiFaceMatchService_1.ApiFaceMatchService(options, { FormDataClass: form_data_1.default, tryDecodeJwt: index_1.tryDecodeJwt });
17
17
  }
@@ -1,23 +1,9 @@
1
- /// <reference types="ws" />
1
+ /// <reference types="node" />
2
2
  import { type IServiceOptions } from '../../../../client/liveness/methods/uploadIdentificationDocument/Service';
3
- import { type TFrameType, type TMediaType } from '../livenessDetection';
4
- export declare function uploadIdentificationDocument(options: IServiceOptions<TFrameType, TMediaType>): {
5
- startDocumentUpload: (file: import("ws").Data) => Promise<void>;
6
- startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "token" | "track"> & {
7
- track?: string | undefined;
8
- token?: string | undefined;
9
- }) | undefined) => (Omit<{
10
- getVideoStream: () => import("../../../../client/liveness/methods/livenessDetection").TMediaType;
11
- stopLivenessDetection: () => Promise<void>;
12
- resumeGettingFrames: () => void;
13
- pauseGettingFrames: () => void;
14
- }, "getVideoStream"> & {
15
- getVideoStream?: (() => undefined) | undefined;
16
- }) | undefined;
17
- startFaceComparison: () => Promise<void>;
18
- startAll: (file: import("ws").Data, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "token" | "track"> & {
19
- track?: string | undefined;
20
- token?: string | undefined;
21
- }) | undefined) => void;
22
- getResults: () => import("../../../../client/liveness/methods/uploadIdentificationDocument/Service").IUploadIdentificationDocumentResults<import("ws").Data>;
3
+ export type TFrameType = string | Buffer | ArrayBuffer;
4
+ export declare function uploadIdentificationDocument(options: IServiceOptions<TFrameType>): {
5
+ startDocumentUpload: (file: TFrameType) => Promise<void>;
6
+ startFaceComparison: (selfie: TFrameType) => Promise<void>;
7
+ startAll: (file: TFrameType, selfie?: TFrameType | undefined) => Promise<void>;
8
+ getResults: () => import("../../../../client/liveness/methods/uploadIdentificationDocument/Service").IUploadIdentificationDocumentResults<TFrameType>;
23
9
  };
@@ -2,23 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.uploadIdentificationDocument = void 0;
4
4
  const Service_1 = require("./Service");
5
- const livenessDetection_1 = require("../livenessDetection");
6
5
  function uploadIdentificationDocument(options) {
7
- const uploadIdentificationDocumentService = new Service_1.NodeUploadIdentificationDocumentService(options, {
8
- livenessDetection: livenessDetection_1.livenessDetection,
9
- });
6
+ const uploadIdentificationDocumentService = new Service_1.NodeUploadIdentificationDocumentService(options);
10
7
  return {
11
8
  startDocumentUpload: async (...rest) => {
12
9
  await uploadIdentificationDocumentService.startDocumentUpload(...rest);
13
10
  },
14
- startLivenessDetection: (...rest) => {
15
- return uploadIdentificationDocumentService.startLivenessDetection(...rest);
16
- },
17
11
  startFaceComparison: async (...rest) => {
18
- await uploadIdentificationDocumentService.tryStartFaceMatch(...rest);
12
+ await uploadIdentificationDocumentService.startFaceComparison(...rest);
19
13
  },
20
- startAll: (...rest) => {
21
- uploadIdentificationDocumentService.startAll(...rest);
14
+ startAll: async (...rest) => {
15
+ await uploadIdentificationDocumentService.startAll(...rest);
22
16
  },
23
17
  getResults: (...rest) => {
24
18
  return uploadIdentificationDocumentService.getResults(...rest);
package/tsconfig.json CHANGED
@@ -9,6 +9,8 @@
9
9
  "declaration": true,
10
10
  "esModuleInterop": true,
11
11
  "strictNullChecks": true,
12
+ "jsx": "react-jsx",
13
+ "skipLibCheck": true,
12
14
  },
13
15
 
14
16
  "include": [
@@ -16,5 +18,6 @@
16
18
  "./webpack.config.cjs",
17
19
  "./jest.config.cjs",
18
20
  "**/*.ts",
21
+ "**/*.tsx",
19
22
  ],
20
23
  }
@@ -9,6 +9,8 @@
9
9
  "declaration": true,
10
10
  "esModuleInterop": true,
11
11
  "strictNullChecks": true,
12
+ "jsx": "react-jsx",
13
+ "skipLibCheck": true,
12
14
 
13
15
  "rootDir": "src",
14
16
  },
@@ -18,6 +20,7 @@
18
20
  "./webpack.config.cjs",
19
21
  "./jest.config.cjs",
20
22
  "src/**/*.ts",
23
+ "src/**/*.tsx",
21
24
  ],
22
25
 
23
26
  "exclude": [
@@ -1,10 +1,9 @@
1
1
  export declare const LIVENESS_API_URL = "https://liveness.santoid.com.br";
2
- export declare const WEBSOCKET_BASE_URL: string;
3
2
  export declare const API_GATEWAY_URL = "https://api.santoid.com.br";
4
3
  export declare const APPLICATION_URL = "https://app.santoid.com.br";
5
- export declare const SEND_FRAMES_INTERVAL_MS = 100;
6
4
  export declare const DEFAULT_NUMBER_OF_RETRIES = 5;
7
5
  export declare const DEFAULT_RETRY_TIME_STEP = 1000;
8
6
  export declare const LIVENESS_PENDING_STATUSES: string[];
9
7
  export declare const LIVENESS_RESULT_MAX_ATTEMPTS = 8;
10
8
  export declare const LIVENESS_RESULT_RETRY_DELAY_MS = 1500;
9
+ export declare const LIVENESS_APPROVAL_THRESHOLD = 80;
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LIVENESS_RESULT_RETRY_DELAY_MS = exports.LIVENESS_RESULT_MAX_ATTEMPTS = exports.LIVENESS_PENDING_STATUSES = exports.DEFAULT_RETRY_TIME_STEP = exports.DEFAULT_NUMBER_OF_RETRIES = exports.SEND_FRAMES_INTERVAL_MS = exports.APPLICATION_URL = exports.API_GATEWAY_URL = exports.WEBSOCKET_BASE_URL = exports.LIVENESS_API_URL = void 0;
3
+ exports.LIVENESS_APPROVAL_THRESHOLD = exports.LIVENESS_RESULT_RETRY_DELAY_MS = exports.LIVENESS_RESULT_MAX_ATTEMPTS = exports.LIVENESS_PENDING_STATUSES = exports.DEFAULT_RETRY_TIME_STEP = exports.DEFAULT_NUMBER_OF_RETRIES = exports.APPLICATION_URL = exports.API_GATEWAY_URL = exports.LIVENESS_API_URL = void 0;
4
4
  exports.LIVENESS_API_URL = 'https://liveness.santoid.com.br';
5
- exports.WEBSOCKET_BASE_URL = `${exports.LIVENESS_API_URL.replace('https://', 'wss://')}/api/v1/liveness/ws`;
6
5
  exports.API_GATEWAY_URL = 'https://api.santoid.com.br';
7
6
  exports.APPLICATION_URL = 'https://app.santoid.com.br';
8
- exports.SEND_FRAMES_INTERVAL_MS = 100;
9
7
  exports.DEFAULT_NUMBER_OF_RETRIES = 5;
10
8
  exports.DEFAULT_RETRY_TIME_STEP = 1000;
11
9
  exports.LIVENESS_PENDING_STATUSES = ['CREATED', 'IN_PROGRESS'];
12
10
  exports.LIVENESS_RESULT_MAX_ATTEMPTS = 8;
13
11
  exports.LIVENESS_RESULT_RETRY_DELAY_MS = 1500;
12
+ // Abaixo disso a sessao terminou, mas a pessoa nao foi aprovada. O mesmo
13
+ // limiar e' exigido pela estimativa de idade no backend.
14
+ exports.LIVENESS_APPROVAL_THRESHOLD = 80;
package/utils/error.d.ts CHANGED
@@ -2,14 +2,15 @@ export declare enum EDefaultErrorCodes {
2
2
  INITIALIZATION_ERROR = "initialization-error",
3
3
  INTERNAL_ERROR = "internal-error"
4
4
  }
5
- export declare enum ELivenessDetectionErrorCodes {
6
- WRONG_POSITION = "liveness-detection/wrong-position"
5
+ export declare enum ELivenessCaptureErrorCodes {
6
+ SESSION_ERROR = "liveness-capture/session-error",
7
+ CAPTURE_ERROR = "liveness-capture/capture-error",
8
+ RESULT_ERROR = "liveness-capture/result-error"
7
9
  }
8
10
  export declare enum EUploadIdentificationDocumentErrorCodes {
9
11
  FACE_MATCH_ERROR = "upload-identification-document/face-match-error",
10
12
  FACE_MATCH_UNAVAILABLE_FACES_ERROR = "upload-identification-document/face-match-unavailable-faces-error",
11
- DOCUMENT_ANALYSIS_ERROR = "upload-identification-document/document-analysis-error",
12
- LIVENESS_DETECTION_ERROR = "upload-identification-document/liveness-detection-error"
13
+ DOCUMENT_ANALYSIS_ERROR = "upload-identification-document/document-analysis-error"
13
14
  }
14
15
  export declare enum EFaceMatchErrorCodes {
15
16
  FIRST_IMAGE_NOT_SELECTED = "face-match/first-image-not-selected"
@@ -28,7 +29,7 @@ export declare enum EProcessingErrorCodes {
28
29
  }
29
30
  interface ISDKErrorConstructorParams {
30
31
  message: string;
31
- code: EDefaultErrorCodes | ELivenessDetectionErrorCodes | EUploadIdentificationDocumentErrorCodes | EFaceMatchErrorCodes | EProcessingErrorCodes | ECameraErrorCodes;
32
+ code: EDefaultErrorCodes | ELivenessCaptureErrorCodes | EUploadIdentificationDocumentErrorCodes | EFaceMatchErrorCodes | EProcessingErrorCodes | ECameraErrorCodes;
32
33
  fatal: boolean;
33
34
  details?: any;
34
35
  }
package/utils/error.js CHANGED
@@ -1,21 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SDKError = exports.EProcessingErrorCodes = exports.ECameraErrorCodes = exports.EFaceMatchErrorCodes = exports.EUploadIdentificationDocumentErrorCodes = exports.ELivenessDetectionErrorCodes = exports.EDefaultErrorCodes = void 0;
3
+ exports.SDKError = exports.EProcessingErrorCodes = exports.ECameraErrorCodes = exports.EFaceMatchErrorCodes = exports.EUploadIdentificationDocumentErrorCodes = exports.ELivenessCaptureErrorCodes = exports.EDefaultErrorCodes = void 0;
4
4
  var EDefaultErrorCodes;
5
5
  (function (EDefaultErrorCodes) {
6
6
  EDefaultErrorCodes["INITIALIZATION_ERROR"] = "initialization-error";
7
7
  EDefaultErrorCodes["INTERNAL_ERROR"] = "internal-error";
8
8
  })(EDefaultErrorCodes || (exports.EDefaultErrorCodes = EDefaultErrorCodes = {}));
9
- var ELivenessDetectionErrorCodes;
10
- (function (ELivenessDetectionErrorCodes) {
11
- ELivenessDetectionErrorCodes["WRONG_POSITION"] = "liveness-detection/wrong-position";
12
- })(ELivenessDetectionErrorCodes || (exports.ELivenessDetectionErrorCodes = ELivenessDetectionErrorCodes = {}));
9
+ var ELivenessCaptureErrorCodes;
10
+ (function (ELivenessCaptureErrorCodes) {
11
+ ELivenessCaptureErrorCodes["SESSION_ERROR"] = "liveness-capture/session-error";
12
+ ELivenessCaptureErrorCodes["CAPTURE_ERROR"] = "liveness-capture/capture-error";
13
+ ELivenessCaptureErrorCodes["RESULT_ERROR"] = "liveness-capture/result-error";
14
+ })(ELivenessCaptureErrorCodes || (exports.ELivenessCaptureErrorCodes = ELivenessCaptureErrorCodes = {}));
13
15
  var EUploadIdentificationDocumentErrorCodes;
14
16
  (function (EUploadIdentificationDocumentErrorCodes) {
15
17
  EUploadIdentificationDocumentErrorCodes["FACE_MATCH_ERROR"] = "upload-identification-document/face-match-error";
16
18
  EUploadIdentificationDocumentErrorCodes["FACE_MATCH_UNAVAILABLE_FACES_ERROR"] = "upload-identification-document/face-match-unavailable-faces-error";
17
19
  EUploadIdentificationDocumentErrorCodes["DOCUMENT_ANALYSIS_ERROR"] = "upload-identification-document/document-analysis-error";
18
- EUploadIdentificationDocumentErrorCodes["LIVENESS_DETECTION_ERROR"] = "upload-identification-document/liveness-detection-error";
19
20
  })(EUploadIdentificationDocumentErrorCodes || (exports.EUploadIdentificationDocumentErrorCodes = EUploadIdentificationDocumentErrorCodes = {}));
20
21
  var EFaceMatchErrorCodes;
21
22
  (function (EFaceMatchErrorCodes) {