@voltom.io/sdk 1.0.6 → 1.0.7

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 (41) hide show
  1. package/dist/assets/locales/ar.json +34 -2
  2. package/dist/assets/locales/ch.json +34 -2
  3. package/dist/assets/locales/de.json +34 -2
  4. package/dist/assets/locales/en.json +34 -2
  5. package/dist/assets/locales/es.json +34 -2
  6. package/dist/assets/locales/fr.json +34 -2
  7. package/dist/assets/locales/it.json +34 -2
  8. package/dist/assets/locales/ja.json +34 -2
  9. package/dist/assets/locales/pt.json +34 -2
  10. package/dist/assets/locales/ru.json +34 -2
  11. package/dist/assets/locales/zh.json +34 -2
  12. package/dist/sdk/PoseSilhouette-D2pGu7Lh.js +2 -0
  13. package/dist/sdk/PoseSuccess-R_8JYo--.js +2 -0
  14. package/dist/sdk/errors.d.ts +121 -0
  15. package/dist/sdk/facegate.d.ts +24 -18
  16. package/dist/sdk/facegate.dist.js +5 -5
  17. package/dist/sdk/facegate.js +1 -1
  18. package/dist/sdk/facekey.browser-VlDa2K-w.js +2 -0
  19. package/dist/sdk/facekey.d.ts +18 -8
  20. package/dist/sdk/facekey.dist.js +6 -6
  21. package/dist/sdk/facekey.js +1 -1
  22. package/dist/sdk/presentation-COhoAxj3.js +8 -0
  23. package/dist/sdk/presentation-ye0KVm6U.js +2 -0
  24. package/dist/sdk/requests-DW8zDX51.js +65 -0
  25. package/dist/sdk/verify.d.ts +37 -18
  26. package/dist/sdk/verify.dist.js +18 -18
  27. package/dist/sdk/verify.js +1 -1
  28. package/dist/sdk/view-CF_YOVly.js +3 -0
  29. package/dist/sdk/view-Cb4XCb-z.js +3 -0
  30. package/dist/sdk/view-DcbwHph_.js +2 -0
  31. package/package.json +4 -3
  32. package/dist/sdk/PoseSilhouette-V9BxuMwo.js +0 -2
  33. package/dist/sdk/PoseSuccess-DDx23oJD.js +0 -2
  34. package/dist/sdk/eyeLevelCamera-aDRPs63K.js +0 -65
  35. package/dist/sdk/facekey.browser-bs8vp3ON.js +0 -2
  36. package/dist/sdk/media-Cejmtltt.js +0 -2
  37. package/dist/sdk/presentation-B4P1537m.js +0 -2
  38. package/dist/sdk/presentation-Cg1Ec60l.js +0 -8
  39. package/dist/sdk/view-DTvcOVnH.js +0 -3
  40. package/dist/sdk/view-ObOGpVdZ.js +0 -3
  41. package/dist/sdk/view-iMF-mWfw.js +0 -2
@@ -1,6 +1,9 @@
1
- export type Mode = "hard";
1
+ import type { ErrorCode, Errors, isSdkError, VoltomSdkError } from "./errors.js";
2
+
3
+ export { type ErrorCode, Errors, isSdkError, type VoltomSdkError } from "./errors.js";
2
4
 
3
5
  export type Pose =
6
+ | "faceReference"
4
7
  | "faceStraight"
5
8
  | "faceUp"
6
9
  | "faceDown"
@@ -27,9 +30,9 @@ export type OcrEngine =
27
30
 
28
31
  export type FaceDetectorName = "high" | "standard" | "low";
29
32
 
30
- export type VerificationCapability = "verifyHuman" | "verifyDocument" | "matchID" | "matchPicture";
33
+ export type VerificationCapability = "acquireFace" | "acquireDocument" | "acquireReference" | "matchID" | "matchReference";
31
34
 
32
- export type VerificationAction = "human" | "document" | "match_id" | "match_picture";
35
+ export type VerificationAction = "verify_face" | "verify_document" | "match_id" | "match_reference";
33
36
 
34
37
  export type AuthorizedVerifyIntent = {
35
38
  resultId: string;
@@ -38,18 +41,16 @@ export type AuthorizedVerifyIntent = {
38
41
  action: string;
39
42
  };
40
43
 
41
- export type VerificationOperationOptions = {
44
+ export type VerificationConfiguration = {
42
45
  poses?: Pose[] | "all";
43
46
  randomizeFaceSequence?: boolean;
44
47
  showFaceOverlay?: boolean;
45
48
  showDocumentOverlay?: boolean;
46
49
  showTextOverlay?: boolean;
47
50
  debug?: boolean;
48
- signal?: AbortSignal;
49
51
  };
50
52
 
51
53
  export type VoltomOptions = {
52
- root?: HTMLElement;
53
54
  video?: HTMLVideoElement;
54
55
  ui?: boolean;
55
56
  prepare?: boolean;
@@ -61,6 +62,7 @@ export type VoltomOptions = {
61
62
  authorize?: (input: { action: string }) => Promise<AuthorizedVerifyIntent>;
62
63
  requireEyeLevelCamera?: boolean;
63
64
  apiUrl?: string;
65
+ sdkUrl?: string;
64
66
  threshold?: number;
65
67
  poses?: Pose[] | "all";
66
68
  randomizeFaceSequence?: boolean;
@@ -93,13 +95,24 @@ export type VoltomOptions = {
93
95
  capabilities?: VerificationCapability[];
94
96
  };
95
97
 
98
+ export type VoltomReferenceCandidate = { portrait: Blob; pose: { yaw: number; pitch: number; roll: number } };
99
+
100
+ export type VoltomReference = {
101
+ digest: string;
102
+ portrait: Blob;
103
+ pose: { yaw: number; pitch: number; roll: number };
104
+ candidates?: VoltomReferenceCandidate[];
105
+ poseGroups?: { candidateIndices: number[]; pose: { yaw: number; pitch: number; roll: number } }[];
106
+ picture?: Blob;
107
+ };
108
+
96
109
  export type VoltomBrowserSupport = { supported: boolean; unsupportedFeatures: string[] };
97
110
 
98
- export type VoltomCaptures = Partial<Record<Pose | "documentFront" | "documentBack", Blob>>;
111
+ export type VoltomCaptures = Partial<Record<Pose | `faceReference_${number}` | "documentFront" | "documentBack" | "reference", Blob>>;
99
112
 
100
113
  export type FaceImages = { rgb: Blob; greyscale: Blob };
101
114
 
102
- export type VoltomPreparedCaptures = Partial<Record<keyof VoltomCaptures | "picture", FaceImages>>;
115
+ export type VoltomPreparedCaptures = Partial<Record<keyof VoltomCaptures, FaceImages>>;
103
116
 
104
117
  export type IdentityPayload = {
105
118
  document: {
@@ -167,13 +180,12 @@ export type VoltomCaptureResult = {
167
180
 
168
181
  export type VoltomVerificationResult = {
169
182
  resultId: string;
170
- mode: Mode;
171
183
  action: VerificationAction;
172
- outcome: "pass" | "fail" | "error" | null;
173
- matched: boolean | null;
184
+ outcome: "pass" | "fail";
185
+ matched: boolean;
174
186
  score: number | null;
175
187
  threshold: number | null;
176
- reason: string | null;
188
+ reason: ErrorCode | null;
177
189
  documentCode: string | null;
178
190
  identity: VoltomIdentity | null;
179
191
  completedAt: string | null;
@@ -182,7 +194,7 @@ export type VoltomVerificationResult = {
182
194
 
183
195
  export type VerificationPresentationState = {
184
196
  activity: { message: string } | "matching" | null;
185
- error: unknown | null;
197
+ error: VoltomSdkError | null;
186
198
  retryAvailable: boolean;
187
199
  feedback:
188
200
  | { flow: "face"; pose: Pose; code: string | null }
@@ -192,17 +204,24 @@ export type VerificationPresentationState = {
192
204
  };
193
205
 
194
206
  declare class VoltomVerify {
207
+ static Errors: typeof Errors;
208
+ static isSdkError: typeof isSdkError;
209
+ events: EventTarget;
195
210
  constructor(options: VoltomOptions);
196
211
  preload(): Promise<void>;
197
212
  prepare(): Promise<void>;
198
213
  caniuse(): Promise<VoltomBrowserSupport>;
199
- verifyHuman(settings?: VerificationOperationOptions): Promise<VoltomVerificationResult>;
200
- verifyDocument(settings?: VerificationOperationOptions): Promise<VoltomVerificationResult>;
201
- matchID(settings?: VerificationOperationOptions): Promise<VoltomVerificationResult>;
214
+ configure(options: VerificationConfiguration): void;
215
+ acquireReference(file: Blob): Promise<VoltomReference>;
216
+ forgetReference(): void;
217
+ acquireFace(): Promise<VoltomVerificationResult>;
218
+ acquireDocument(): Promise<VoltomVerificationResult>;
219
+ matchID(): Promise<VoltomVerificationResult>;
202
220
  /** Accepts images or PDFs up to 10 MB. PDFs use only page 1, rendered at up to 1200 pixels. */
203
- matchPicture(picture: Blob, settings?: VerificationOperationOptions): Promise<VoltomVerificationResult>;
204
- forgetHuman(): void;
221
+ matchReference(file: Blob): Promise<VoltomVerificationResult>;
222
+ forgetFace(): void;
205
223
  forgetDocument(): void;
224
+ setDebug({ enabled }: { enabled: boolean }): void;
206
225
  stop(): void;
207
226
  dispose(): void;
208
227
  getState(): VerificationPresentationState;