santoid-sdk 5.3.0 → 7.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.
- package/CHANGELOG.md +11 -0
- package/README.md +251 -102
- package/api/AbstractService.d.ts +5 -4
- package/api/AbstractService.js +2 -5
- package/api/ApiFaceMatchService.d.ts +3 -4
- package/api/ApiLivenessSessionService.d.ts +27 -0
- package/api/ApiLivenessSessionService.js +30 -0
- package/api/ApiOcrService.d.ts +1 -0
- package/api/ApiTypificationService.d.ts +1 -1
- package/browser/index.js +1 -1
- package/client/core/commons/BaseCoreService.d.ts +3 -2
- package/client/core/commons/BaseCoreService.js +12 -6
- package/client/core/methods/faceMatch/Service.d.ts +0 -1
- package/client/core/methods/faceMatch/Service.js +0 -4
- package/client/core/methods/faceMatch/index.d.ts +1 -1
- package/client/core/methods/faceMatch/index.js +2 -2
- package/client/core/methods/ocr/Service.d.ts +3 -5
- package/client/core/methods/ocr/Service.js +0 -4
- package/client/core/methods/ocr/index.d.ts +1 -1
- package/client/core/methods/ocr/index.js +2 -2
- package/client/core/methods/typification/Service.d.ts +0 -1
- package/client/core/methods/typification/Service.js +0 -4
- package/client/core/methods/typification/index.d.ts +1 -1
- package/client/core/methods/typification/index.js +2 -3
- package/client/core/utils/types.d.ts +5 -1
- package/client/index.d.ts +2 -0
- package/client/index.js +2 -0
- package/client/liveness/index.d.ts +2 -1
- package/client/liveness/index.js +3 -1
- package/client/liveness/methods/livenessDetection/index.d.ts +8 -0
- package/client/liveness/methods/livenessDetection/index.js +8 -0
- package/client/liveness/methods/livenessSession/Service.d.ts +19 -0
- package/client/liveness/methods/livenessSession/Service.js +63 -0
- package/client/liveness/methods/livenessSession/index.d.ts +20 -0
- package/client/liveness/methods/livenessSession/index.js +44 -0
- package/client/liveness/methods/uploadIdentificationDocument/index.d.ts +2 -2
- package/client/liveness/utils/getNextFrame.d.ts +4 -1
- package/client/liveness/utils/getNextFrame.js +3 -2
- package/package.json +1 -1
- package/server/core/methods/faceMatch/Service.d.ts +1 -1
- package/server/core/methods/ocr/Service.d.ts +1 -1
- package/server/core/methods/typification/Service.d.ts +1 -1
- package/server/liveness/methods/uploadIdentificationDocument/index.d.ts +2 -2
- package/utils/constants.d.ts +5 -1
- package/utils/constants.js +6 -2
package/client/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const livenessDetection_1 = require("./liveness/methods/livenessDetection");
|
|
4
|
+
const livenessSession_1 = require("./liveness/methods/livenessSession");
|
|
4
5
|
const uploadIdentificationDocument_1 = require("./liveness/methods/uploadIdentificationDocument");
|
|
5
6
|
const insertUploadIdentificationDocument_1 = require("./embedded/methods/insertUploadIdentificationDocument");
|
|
6
7
|
const typification_1 = require("./core/methods/typification");
|
|
@@ -9,6 +10,7 @@ const ocr_1 = require("./core/methods/ocr");
|
|
|
9
10
|
class SantoiDSDK {
|
|
10
11
|
}
|
|
11
12
|
SantoiDSDK.livenessDetection = livenessDetection_1.livenessDetection;
|
|
13
|
+
SantoiDSDK.livenessSession = livenessSession_1.livenessSession;
|
|
12
14
|
SantoiDSDK.uploadIdentificationDocument = uploadIdentificationDocument_1.uploadIdentificationDocument;
|
|
13
15
|
SantoiDSDK.insertUploadIdentificationDocument = insertUploadIdentificationDocument_1.insertUploadIdentificationDocument;
|
|
14
16
|
SantoiDSDK.typification = typification_1.typification;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { livenessDetection } from './methods/livenessDetection';
|
|
2
|
+
import { livenessSession } from './methods/livenessSession';
|
|
2
3
|
import { uploadIdentificationDocument } from './methods/uploadIdentificationDocument';
|
|
3
|
-
export { livenessDetection, uploadIdentificationDocument, };
|
|
4
|
+
export { livenessDetection, livenessSession, uploadIdentificationDocument, };
|
package/client/liveness/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadIdentificationDocument = exports.livenessDetection = void 0;
|
|
3
|
+
exports.uploadIdentificationDocument = exports.livenessSession = exports.livenessDetection = void 0;
|
|
4
4
|
const livenessDetection_1 = require("./methods/livenessDetection");
|
|
5
5
|
Object.defineProperty(exports, "livenessDetection", { enumerable: true, get: function () { return livenessDetection_1.livenessDetection; } });
|
|
6
|
+
const livenessSession_1 = require("./methods/livenessSession");
|
|
7
|
+
Object.defineProperty(exports, "livenessSession", { enumerable: true, get: function () { return livenessSession_1.livenessSession; } });
|
|
6
8
|
const uploadIdentificationDocument_1 = require("./methods/uploadIdentificationDocument");
|
|
7
9
|
Object.defineProperty(exports, "uploadIdentificationDocument", { enumerable: true, get: function () { return uploadIdentificationDocument_1.uploadIdentificationDocument; } });
|
|
@@ -6,6 +6,14 @@ type ILivenessDetectionParams = Omit<ISDKOptions<TFrameType, TMediaType>, 'onSta
|
|
|
6
6
|
videoStream: TMediaType;
|
|
7
7
|
}) => void | Promise<void>;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Prova de vida v1, sobre o detector in-house (WebSocket com o
|
|
11
|
+
* desafio de cinco posicoes). Substituida por {@link livenessSession}, que usa
|
|
12
|
+
* o AWS Rekognition Face Liveness.
|
|
13
|
+
*
|
|
14
|
+
* Continua funcionando e sera mantida ate a migracao dos clientes, mas nao
|
|
15
|
+
* recebe mais evolucao. Codigo novo deve usar livenessSession.
|
|
16
|
+
*/
|
|
9
17
|
export declare function livenessDetection(options: ILivenessDetectionParams): {
|
|
10
18
|
getVideoStream: () => TMediaType;
|
|
11
19
|
stopLivenessDetection: () => Promise<void>;
|
|
@@ -5,6 +5,14 @@ const Service_1 = require("./Service");
|
|
|
5
5
|
const error_1 = require("../../../../utils/error");
|
|
6
6
|
const websocket_1 = require("../../../../utils/websocket");
|
|
7
7
|
const index_1 = require("../../utils/index");
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Prova de vida v1, sobre o detector in-house (WebSocket com o
|
|
10
|
+
* desafio de cinco posicoes). Substituida por {@link livenessSession}, que usa
|
|
11
|
+
* o AWS Rekognition Face Liveness.
|
|
12
|
+
*
|
|
13
|
+
* Continua funcionando e sera mantida ate a migracao dos clientes, mas nao
|
|
14
|
+
* recebe mais evolucao. Codigo novo deve usar livenessSession.
|
|
15
|
+
*/
|
|
8
16
|
function livenessDetection(options) {
|
|
9
17
|
var _a;
|
|
10
18
|
try {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApiLivenessSessionService, type ILivenessSessionResult } from '../../../../api/ApiLivenessSessionService';
|
|
2
|
+
import { type IBaseSDKOptions } from '../../../../utils/types';
|
|
3
|
+
import { SDKError } from '../../../../utils/error';
|
|
4
|
+
export type TLivenessSessionOptions = Omit<IBaseSDKOptions, 'track'> & {
|
|
5
|
+
track?: string;
|
|
6
|
+
customerRequestId?: string;
|
|
7
|
+
onSessionCreated?: (sessionId: string) => void | Promise<void>;
|
|
8
|
+
onResults?: (results: ILivenessSessionResult) => void | Promise<void>;
|
|
9
|
+
onError?: (error: SDKError) => void | Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export declare class LivenessSessionService {
|
|
12
|
+
options: TLivenessSessionOptions;
|
|
13
|
+
service: ApiLivenessSessionService;
|
|
14
|
+
sessionId: string | null;
|
|
15
|
+
constructor(options: TLivenessSessionOptions);
|
|
16
|
+
createSession(): Promise<string>;
|
|
17
|
+
getResults(sessionId?: string | null): Promise<ILivenessSessionResult>;
|
|
18
|
+
private fail;
|
|
19
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LivenessSessionService = void 0;
|
|
4
|
+
const ApiLivenessSessionService_1 = require("../../../../api/ApiLivenessSessionService");
|
|
5
|
+
const error_1 = require("../../../../utils/error");
|
|
6
|
+
const utils_1 = require("../../../../utils");
|
|
7
|
+
const constants_1 = require("../../../../utils/constants");
|
|
8
|
+
const index_1 = require("../../utils/index");
|
|
9
|
+
class LivenessSessionService {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.sessionId = null;
|
|
12
|
+
this.options = options;
|
|
13
|
+
this.service = new ApiLivenessSessionService_1.ApiLivenessSessionService(options, { FormDataClass: FormData, tryDecodeJwt: index_1.tryDecodeJwt });
|
|
14
|
+
}
|
|
15
|
+
async createSession() {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
try {
|
|
18
|
+
const session = await this.service.createSession(this.options.customerRequestId);
|
|
19
|
+
this.sessionId = session.SessionId;
|
|
20
|
+
await ((_b = (_a = this.options).onSessionCreated) === null || _b === void 0 ? void 0 : _b.call(_a, session.SessionId));
|
|
21
|
+
return session.SessionId;
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
throw await this.fail('Error while creating liveness session', err);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// A AWS avisa que terminou de transmitir os frames antes do Rekognition
|
|
28
|
+
// terminar de avaliar, entao o resultado fica CREATED/IN_PROGRESS por alguns
|
|
29
|
+
// instantes. Sem este polling o chamador recebe um status que ainda nao e'
|
|
30
|
+
// o final.
|
|
31
|
+
async getResults(sessionId = this.sessionId) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if (!sessionId) {
|
|
34
|
+
throw await this.fail('There is no liveness session to fetch results from');
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
let lastResult = null;
|
|
38
|
+
for (let attempt = 0; attempt < constants_1.LIVENESS_RESULT_MAX_ATTEMPTS; attempt++) {
|
|
39
|
+
lastResult = await this.service.getSessionResults(sessionId);
|
|
40
|
+
if (!constants_1.LIVENESS_PENDING_STATUSES.includes(lastResult.Status))
|
|
41
|
+
break;
|
|
42
|
+
await (0, utils_1.wait)(constants_1.LIVENESS_RESULT_RETRY_DELAY_MS);
|
|
43
|
+
}
|
|
44
|
+
await ((_b = (_a = this.options).onResults) === null || _b === void 0 ? void 0 : _b.call(_a, lastResult));
|
|
45
|
+
return lastResult;
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
throw await this.fail('Error while fetching liveness session results', err);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async fail(message, cause) {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const error = new error_1.SDKError({
|
|
54
|
+
message,
|
|
55
|
+
code: error_1.EDefaultErrorCodes.INITIALIZATION_ERROR,
|
|
56
|
+
fatal: true,
|
|
57
|
+
details: cause,
|
|
58
|
+
});
|
|
59
|
+
await ((_b = (_a = this.options).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error));
|
|
60
|
+
return error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.LivenessSessionService = LivenessSessionService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type TLivenessSessionOptions } from './Service';
|
|
2
|
+
export type { TLivenessSessionOptions };
|
|
3
|
+
/**
|
|
4
|
+
* Prova de vida v2, sobre o AWS Rekognition Face Liveness.
|
|
5
|
+
*
|
|
6
|
+
* Cobre o ciclo de sessao: cria a sessao e busca o resultado, com o polling
|
|
7
|
+
* necessario enquanto o Rekognition ainda avalia. A captura em si - camera,
|
|
8
|
+
* oval e desafio - fica a cargo do <FaceLivenessDetector> da AWS, que e' um
|
|
9
|
+
* componente React e por isso nao mora neste pacote.
|
|
10
|
+
*
|
|
11
|
+
* Fluxo esperado:
|
|
12
|
+
* 1. createSession() -> entrega o sessionId para o detector
|
|
13
|
+
* 2. o detector transmite os frames direto para a AWS
|
|
14
|
+
* 3. getResults() quando o detector sinalizar que terminou
|
|
15
|
+
*/
|
|
16
|
+
export declare function livenessSession(options: TLivenessSessionOptions): {
|
|
17
|
+
createSession: () => Promise<string>;
|
|
18
|
+
getResults: (sessionId?: string | null | undefined) => Promise<import("../../../../api/ApiLivenessSessionService").ILivenessSessionResult>;
|
|
19
|
+
getSessionId: () => string | null;
|
|
20
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.livenessSession = void 0;
|
|
4
|
+
const Service_1 = require("./Service");
|
|
5
|
+
const error_1 = require("../../../../utils/error");
|
|
6
|
+
/**
|
|
7
|
+
* Prova de vida v2, sobre o AWS Rekognition Face Liveness.
|
|
8
|
+
*
|
|
9
|
+
* Cobre o ciclo de sessao: cria a sessao e busca o resultado, com o polling
|
|
10
|
+
* necessario enquanto o Rekognition ainda avalia. A captura em si - camera,
|
|
11
|
+
* oval e desafio - fica a cargo do <FaceLivenessDetector> da AWS, que e' um
|
|
12
|
+
* componente React e por isso nao mora neste pacote.
|
|
13
|
+
*
|
|
14
|
+
* Fluxo esperado:
|
|
15
|
+
* 1. createSession() -> entrega o sessionId para o detector
|
|
16
|
+
* 2. o detector transmite os frames direto para a AWS
|
|
17
|
+
* 3. getResults() quando o detector sinalizar que terminou
|
|
18
|
+
*/
|
|
19
|
+
function livenessSession(options) {
|
|
20
|
+
try {
|
|
21
|
+
const service = new Service_1.LivenessSessionService(options);
|
|
22
|
+
// Arrow functions sao obrigatorias aqui para o "this" nao se perder
|
|
23
|
+
return {
|
|
24
|
+
createSession: async () => {
|
|
25
|
+
return await service.createSession();
|
|
26
|
+
},
|
|
27
|
+
getResults: async (...rest) => {
|
|
28
|
+
return await service.getResults(...rest);
|
|
29
|
+
},
|
|
30
|
+
getSessionId: () => {
|
|
31
|
+
return service.sessionId;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
throw new error_1.SDKError({
|
|
37
|
+
message: 'Error while starting SDK',
|
|
38
|
+
code: error_1.EDefaultErrorCodes.INITIALIZATION_ERROR,
|
|
39
|
+
fatal: true,
|
|
40
|
+
details: err,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.livenessSession = livenessSession;
|
|
@@ -2,7 +2,7 @@ import { type IServiceOptions } from './Service';
|
|
|
2
2
|
import { type TFrameType, type TMediaType } from '../livenessDetection';
|
|
3
3
|
export declare function uploadIdentificationDocument(options: IServiceOptions<TFrameType, TMediaType>): {
|
|
4
4
|
startDocumentUpload: (file: TFrameType) => Promise<void>;
|
|
5
|
-
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "
|
|
5
|
+
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "track" | "token"> & {
|
|
6
6
|
track?: string | undefined;
|
|
7
7
|
token?: string | undefined;
|
|
8
8
|
}) | undefined) => (Omit<{
|
|
@@ -14,7 +14,7 @@ export declare function uploadIdentificationDocument(options: IServiceOptions<TF
|
|
|
14
14
|
getVideoStream?: (() => TMediaType) | undefined;
|
|
15
15
|
}) | undefined;
|
|
16
16
|
startFaceComparison: () => Promise<void>;
|
|
17
|
-
startAll: (file: TFrameType, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "
|
|
17
|
+
startAll: (file: TFrameType, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "track" | "token"> & {
|
|
18
18
|
track?: string | undefined;
|
|
19
19
|
token?: string | undefined;
|
|
20
20
|
}) | undefined) => void;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
export interface IStartGettingFramesOptions {
|
|
2
|
+
facingMode?: 'user' | 'environment';
|
|
3
|
+
}
|
|
1
4
|
export interface IFrameControls<TFrameType, TMediaType> {
|
|
2
|
-
startGettingFrames?: () => TMediaType | Promise<TMediaType>;
|
|
5
|
+
startGettingFrames?: (cameraOptions?: IStartGettingFramesOptions) => TMediaType | Promise<TMediaType>;
|
|
3
6
|
getNextFrame?: () => TFrameType | Promise<TFrameType>;
|
|
4
7
|
stopGettingFrames?: () => void | Promise<void>;
|
|
5
8
|
videoStream?: TMediaType;
|
|
@@ -41,12 +41,13 @@ async function getDefaultFrameControls() {
|
|
|
41
41
|
videoStream = undefined;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
async function startGettingFrames() {
|
|
44
|
+
async function startGettingFrames(cameraOptions) {
|
|
45
|
+
var _a;
|
|
45
46
|
if (!videoStream || !videoElement || !canvasElement) {
|
|
46
47
|
videoStream = await navigator.mediaDevices.getUserMedia({
|
|
47
48
|
audio: false,
|
|
48
49
|
video: {
|
|
49
|
-
facingMode: '
|
|
50
|
+
facingMode: (_a = cameraOptions === null || cameraOptions === void 0 ? void 0 : cameraOptions.facingMode) !== null && _a !== void 0 ? _a : 'user',
|
|
50
51
|
},
|
|
51
52
|
});
|
|
52
53
|
videoElement = document.createElement('video');
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FaceMatchService, type TFaceMatchServiceOptions } from '../../../../client/core/methods/faceMatch/Service';
|
|
2
|
-
export type TNodeFaceMatchServiceOptions<TMediaType> = Omit<TFaceMatchServiceOptions<TMediaType>, 'onStart'> & {
|
|
2
|
+
export type TNodeFaceMatchServiceOptions<TMediaType> = Omit<TFaceMatchServiceOptions<TMediaType>, 'onStart' | 'onCameraStart' | 'onCameraStop'> & {
|
|
3
3
|
onStart?: () => void | Promise<void>;
|
|
4
4
|
};
|
|
5
5
|
export declare class NodeFaceMatchService<TFrameType, TMediaType> extends FaceMatchService<TFrameType, TMediaType> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OcrService, type TOcrServiceOptions } from '../../../../client/core/methods/ocr/Service';
|
|
2
|
-
export type TNodeOcrServiceOptions<TMediaType> = Omit<TOcrServiceOptions<TMediaType>, 'onStart'> & {
|
|
2
|
+
export type TNodeOcrServiceOptions<TMediaType> = Omit<TOcrServiceOptions<TMediaType>, 'onStart' | 'onCameraStart' | 'onCameraStop'> & {
|
|
3
3
|
onStart?: () => void | Promise<void>;
|
|
4
4
|
};
|
|
5
5
|
export declare class NodeOcrService<TFrameType, TMediaType> extends OcrService<TFrameType, TMediaType> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypificationService, type TTypificationServiceOptions } from '../../../../client/core/methods/typification/Service';
|
|
2
|
-
export type TNodeTypificationServiceOptions<TMediaType> = Omit<TTypificationServiceOptions<TMediaType>, 'onStart'> & {
|
|
2
|
+
export type TNodeTypificationServiceOptions<TMediaType> = Omit<TTypificationServiceOptions<TMediaType>, 'onStart' | 'onCameraStart' | 'onCameraStop'> & {
|
|
3
3
|
onStart?: () => void | Promise<void>;
|
|
4
4
|
};
|
|
5
5
|
export declare class NodeTypificationService<TFrameType, TMediaType> extends TypificationService<TFrameType, TMediaType> {
|
|
@@ -3,7 +3,7 @@ import { type IServiceOptions } from '../../../../client/liveness/methods/upload
|
|
|
3
3
|
import { type TFrameType, type TMediaType } from '../livenessDetection';
|
|
4
4
|
export declare function uploadIdentificationDocument(options: IServiceOptions<TFrameType, TMediaType>): {
|
|
5
5
|
startDocumentUpload: (file: import("ws").Data) => Promise<void>;
|
|
6
|
-
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "
|
|
6
|
+
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "track" | "token"> & {
|
|
7
7
|
track?: string | undefined;
|
|
8
8
|
token?: string | undefined;
|
|
9
9
|
}) | undefined) => (Omit<{
|
|
@@ -15,7 +15,7 @@ export declare function uploadIdentificationDocument(options: IServiceOptions<TF
|
|
|
15
15
|
getVideoStream?: (() => undefined) | undefined;
|
|
16
16
|
}) | undefined;
|
|
17
17
|
startFaceComparison: () => Promise<void>;
|
|
18
|
-
startAll: (file: import("ws").Data, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "
|
|
18
|
+
startAll: (file: import("ws").Data, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "track" | "token"> & {
|
|
19
19
|
track?: string | undefined;
|
|
20
20
|
token?: string | undefined;
|
|
21
21
|
}) | undefined) => void;
|
package/utils/constants.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const LIVENESS_API_URL = "https://liveness.santoid.com.br";
|
|
2
|
+
export declare const WEBSOCKET_BASE_URL: string;
|
|
2
3
|
export declare const API_GATEWAY_URL = "https://api.santoid.com.br";
|
|
3
4
|
export declare const APPLICATION_URL = "https://app.santoid.com.br";
|
|
4
5
|
export declare const SEND_FRAMES_INTERVAL_MS = 100;
|
|
5
6
|
export declare const DEFAULT_NUMBER_OF_RETRIES = 5;
|
|
6
7
|
export declare const DEFAULT_RETRY_TIME_STEP = 1000;
|
|
8
|
+
export declare const LIVENESS_PENDING_STATUSES: string[];
|
|
9
|
+
export declare const LIVENESS_RESULT_MAX_ATTEMPTS = 8;
|
|
10
|
+
export declare const LIVENESS_RESULT_RETRY_DELAY_MS = 1500;
|
package/utils/constants.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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 = void 0;
|
|
4
|
-
exports.
|
|
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;
|
|
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`;
|
|
5
6
|
exports.API_GATEWAY_URL = 'https://api.santoid.com.br';
|
|
6
7
|
exports.APPLICATION_URL = 'https://app.santoid.com.br';
|
|
7
8
|
exports.SEND_FRAMES_INTERVAL_MS = 100;
|
|
8
9
|
exports.DEFAULT_NUMBER_OF_RETRIES = 5;
|
|
9
10
|
exports.DEFAULT_RETRY_TIME_STEP = 1000;
|
|
11
|
+
exports.LIVENESS_PENDING_STATUSES = ['CREATED', 'IN_PROGRESS'];
|
|
12
|
+
exports.LIVENESS_RESULT_MAX_ATTEMPTS = 8;
|
|
13
|
+
exports.LIVENESS_RESULT_RETRY_DELAY_MS = 1500;
|