onfido-sdk-ui 14.34.0 → 14.35.1

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/LICENSE ADDED
@@ -0,0 +1,268 @@
1
+ Please see the terms of your Onfido Services Agreement which you are bound by with respect to your use of the Onfido
2
+ SDK. To the extent the Onfido SDK includes copies or substantial portions of software licensed under third party terms
3
+ and conditions this will be set out at https://documentation.onfido.com/sdk/sdk-licenses/
4
+
5
+ In the event of any inconsistency between the Onfido Services Agreement and any third party terms and conditions, the
6
+ third party terms and conditions shall take precedence over the rights and
7
+ restrictions granted in the Onfido Services Agreement solely in respect of such third party dependencies set out
8
+ at https://documentation.onfido.com/sdk/sdk-licenses/.
9
+
10
+ ------------------
11
+
12
+ Name: @onfido/capture-shared
13
+ Version: 2.4.6
14
+ License: null
15
+ Private: false
16
+ Description: A shared library to use in various capture packages
17
+
18
+ ---
19
+
20
+ Name: @sentry/utils
21
+ Version: 7.64.0
22
+ License: MIT
23
+ Private: false
24
+ Description: Utilities for all Sentry JavaScript SDKs
25
+ Repository: undefined
26
+ Homepage: https://github.com/getsentry/sentry-javascript/tree/master/packages/utils
27
+ Author: Sentry
28
+ License Copyright:
29
+ ===
30
+
31
+ Copyright (c) 2019 Sentry (https://sentry.io) and individual contributors. All rights reserved.
32
+
33
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
34
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
35
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
36
+ persons to whom the Software is furnished to do so, subject to the following conditions:
37
+
38
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
39
+ Software.
40
+
41
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
42
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
43
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
44
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45
+
46
+ ---
47
+
48
+ Name: uuid-random
49
+ Version: 1.3.2
50
+ License: MIT
51
+ Private: false
52
+ Description: Fastest UUIDv4 with good RNG
53
+ Repository: git+https://github.com/jchook/uuid-random.git
54
+ Homepage: https://github.com/jchook/uuid-random#readme
55
+ Author: Wes Roberts
56
+ License Copyright:
57
+ ===
58
+
59
+ Copyright (c) 2016-2019 Wes Roberts
60
+
61
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
62
+ this software and associated documentation files (the "Software"), to deal in
63
+ the Software without restriction, including without limitation the rights to
64
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
65
+ the Software, and to permit persons to whom the Software is furnished to do so,
66
+ subject to the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be included in all
69
+ copies or substantial portions of the Software.
70
+
71
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
73
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
74
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
75
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
76
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
77
+
78
+ ---
79
+
80
+ Name: ua-parser-js
81
+ Version: 1.0.36
82
+ License: MIT
83
+ Private: false
84
+ Description: Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment
85
+ Repository: https://github.com/faisalman/ua-parser-js.git
86
+ Homepage: https://github.com/faisalman/ua-parser-js
87
+ Author: Faisal Salman <f@faisalman.com> (http://faisalman.com)
88
+ Contributors:
89
+ Aamir Poonawalla <aamir@urx.com>
90
+ Admas <mollases@users.noreply.github.com>
91
+ algenon <m@antonz.ru>
92
+ Alvin Portillo <alvin@8thwall.com>
93
+ Amumu <yoyo837@hotmail.com>
94
+ Andrea Vaghi <andrea.vaghi@jobrapido.com>
95
+ Anton Zhiyanov <m@antonz.ru>
96
+ Arturo Mejia <amejia@blim.com>
97
+ Arun Rama Reddy <arunramareddy@gmail.com>
98
+ Austin Pray <austin@austinpray.com>
99
+ Bendeguz <symunona@gmail.com>
100
+ Benjamin Bertrand <bertrand.design@gmail.com>
101
+ Benjamin Urban <benjamin.urban@sueddeutsche.de>
102
+ boneyao <admin@boneyao.com>
103
+ Carl C Von Lewin <carlchristianlewin@gmail.com>
104
+ CESAR RAMOS <c@imagenproactiva.com>
105
+ Chad Killingsworth <ckillingsworth@jackhenry.com>
106
+ Christopher De Cairos <chris.decairos@gmail.com>
107
+ Cyrille David <cyrille@qonto.eu>
108
+ Dario Vladovic <d.vladimyr@gmail.com>
109
+ David Annez <david.annez@gmail.com>
110
+ Davit Barbakadze <jayarjo@gmail.com>
111
+ ddivernois <david-emmanuel.divernois@amadeus.com>
112
+ Deliaz <D3liaz@gmail.com>
113
+ Demis Palma <demis.palma@gmail.com>
114
+ dhoko <aurelien@protonmail.com>
115
+ dianhe <dianhe@webank.com>
116
+ dineshks1 <dineshks1@d.kumar44@outlook.com>
117
+ Dmitry Tyschenko <dtyschenko@gmail.com>
118
+ Douglas Li <doug@knotch.it>
119
+ Dumitru Uzun <contact@duzun.me>
120
+ Dustin <duburns@fanatics.com>
121
+ Elchin Valiyev <elchin.valiyev@autodesk.com>
122
+ Emil Hesslow <hesslow@gmail.com>
123
+ Eric Redon <eric.redon@coox.org>
124
+ Eric Schrenker <eric.schrenker@gmail.com>
125
+ Erik Hesselink <hesselink@gmail.com>
126
+ Fabian Becker <halfdan@xnorfz.de>
127
+ Faisal Salman <f@faisalman.com>
128
+ Frédéric Camblor <fcamblor@gmail.com>
129
+ Frederik Ring <frederik.ring@gmail.com>
130
+ Gerald Host <me@jacobford.co.uk>
131
+ Germán M. Bravo <german.mb@gmail.com>
132
+ Grigory Dmitrenko <grigory@snsk.ru>
133
+ gulpin <gulping.gulpin@gmail.com>
134
+ Hendrik Helwich <h.helwich@iplabs.de>
135
+ Hermann Ebert <ebbmo@HE.local>
136
+ hr6r <hedian@gmail.com>
137
+ Igor Topal <i.topal@smartweb.com.ua>
138
+ Ildar Kamalov <i.kamalov@adguard.com>
139
+ insanehong <insane.hong@navercorp.com>
140
+ jackpoll <jackpoll123456@gmail.com>
141
+ Jake Mc <startswithaj@users.noreply.github.com>
142
+ JBYoshi <12983479+JBYoshi@users.noreply.github.com>
143
+ Joey Parrish <joeyparrish@google.com>
144
+ John Tantalo <john.tantalo@gmail.com>
145
+ John Yanarella <jmy@codecatalyst.com>
146
+ Jon Buckley <jon@jbuckley.ca>
147
+ Josh Goldberg <joshuakgoldberg@outlook.com>
148
+ Junki-Ishida <junki_ishida@dwango.co.jp>
149
+ Kendall Buchanan <kendall@kendagriff.com>
150
+ Lee Treveil <leetreveil@gmail.com>
151
+ leonardo <leofiore@libero.it>
152
+ Levente Balogh <balogh.levente.hu@gmail.com>
153
+ Liam Quinn <lquinn@blackberry.com>
154
+ Lithin <lithin@webklipper.com>
155
+ ll-syber <670159357@qq.com>
156
+ Loris Guignard <loris.guignard@gmail.com>
157
+ Lukas Drgon <lukas.drgon@gmail.com>
158
+ Lukas Eipert <leipert@users.noreply.github.com>
159
+ Malash <i@malash.me>
160
+ Martynas <martynas@firmfirm.co>
161
+ Masahiko Sato <masasato@yahoo-corp.jp>
162
+ Matt Brophy <matt@brophy.org>
163
+ Matthew Origer <karatecowboy@gmail.com>
164
+ Maximilian Haupt <mail@maximilianhaupt.com>
165
+ Max Maurer <maxemanuel.maurer@gmail.com>
166
+ Max Nordlund <max.nordlund@gmail.com>
167
+ Michael Hess <mhess@connectify.me>
168
+ MimyyK <michele.marais@hakisa.com>
169
+ naoh <naoh.cs03g@nctu.edu.tw>
170
+ Nicholas Ionata <nionata@ufl.edu>
171
+ Nikhil Motiani <nikhil.motiani@outlook.com>
172
+ Nik Rolls <nik@rolls.cc>
173
+ nionata <n.ionata129@gmail.com>
174
+ niris <nirisix@gmail.com>
175
+ Nobuo Okada <nookada@yahoo-corp.jp>
176
+ o.drapeza <o.drapeza@tinkoff.ru>
177
+ otakuSiD <otakusid@gmail.com>
178
+ patrick-nurt <github@pereira.dk>
179
+ Pavel Studeny <studeny@avast.com>
180
+ Peter Dave Hello <PeterDaveHello@users.noreply.github.com>
181
+ philippsimon <github@philippsimon.de>
182
+ Pieter Hendrickx <pieter.hendrickx@belfius.be>
183
+ Piper Chester <piperchester@gmail.com>
184
+ Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>
185
+ Raine Makelainen <raine.makelainen@jolla.com>
186
+ Raman Savaryn <homeneartheocean@gmail.com>
187
+ Robert Tod <robert@qubit.com>
188
+ roman.savarin <roman.savarin@skywindgroup.com>
189
+ Ron Korland <ron@testim.io>
190
+ Ross Noble <rosshnoble@gmail.com>
191
+ ruicong <466403866@qq.com>
192
+ Sandro Sonntag <sandro.sonntag@adorsys.de>
193
+ sgautrea <shanegautreau@gmail.com>
194
+ Shane Gautreau <sgautrea@opentext.com>
195
+ Shane Thacker <shane@steadymade.com>
196
+ Shreedhar <shreedhar@uber.com>
197
+ Simon Eisenmann <simon@longsleep.org>
198
+ Simon Lang <me@simonlang.org>
199
+ Stiekel <histkc@gmail.com>
200
+ sUP <dani3l@gmail.com>
201
+ Sylvain Gizard <sylvain.gizard@gmail.com>
202
+ szchenghuang <szchenghuang@gmail.com>
203
+ Tanguy Krotoff <tkrotoff@gmail.com>
204
+ Tony Tomarchio <tony@tomarchio.cc>
205
+ Ulrich Schmidt <u.schmidt@velian.de>
206
+ Vadim Kurachevsky <vadim@hmvs.org>
207
+ Yılmaz <yilmazdemir36@gmail.com>
208
+ yuanyang <work_yuanyang@163.com>
209
+ Yun Young-jin <yupmin@yupmin-office-macmini.local>
210
+ Zach Bjornson <zbbjornson@gmail.com>
211
+ License Copyright:
212
+ ===
213
+
214
+ MIT License
215
+
216
+ Copyright (c) 2012-2023 Faisal Salman <<f@faisalman.com>>
217
+
218
+ Permission is hereby granted, free of charge, to any person obtaining a copy
219
+ of this software and associated documentation files (the "Software"), to deal
220
+ in the Software without restriction, including without limitation the rights
221
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
222
+ copies of the Software, and to permit persons to whom the Software is
223
+ furnished to do so, subject to the following conditions:
224
+
225
+ The above copyright notice and this permission notice shall be included in all
226
+ copies or substantial portions of the Software.
227
+
228
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
229
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
230
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
231
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
232
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
233
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
234
+ SOFTWARE.
235
+
236
+ ---
237
+
238
+ Name: js-cookie
239
+ Version: 3.0.5
240
+ License: MIT
241
+ Private: false
242
+ Description: A simple, lightweight JavaScript API for handling cookies
243
+ Repository: git://github.com/js-cookie/js-cookie.git
244
+ Author: Klaus Hartl
245
+ License Copyright:
246
+ ===
247
+
248
+ MIT License
249
+
250
+ Copyright (c) 2018 Copyright 2018 Klaus Hartl, Fagner Brack, GitHub Contributors
251
+
252
+ Permission is hereby granted, free of charge, to any person obtaining a copy
253
+ of this software and associated documentation files (the "Software"), to deal
254
+ in the Software without restriction, including without limitation the rights
255
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
256
+ copies of the Software, and to permit persons to whom the Software is
257
+ furnished to do so, subject to the following conditions:
258
+
259
+ The above copyright notice and this permission notice shall be included in all
260
+ copies or substantial portions of the Software.
261
+
262
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
263
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
264
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
265
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
266
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
267
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
268
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onfido-sdk-ui",
3
- "version": "14.34.0",
3
+ "version": "14.35.1",
4
4
  "description": "JavaScript SDK view layer for Onfido identity verification",
5
5
  "author": "Onfido Customer Support <support@onfido.com> (https://documentation.onfido.com/sdk/web/)",
6
6
  "repository": {
package/types/Events.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { CaptureModule } from '@onfido/capture-shared/Types';
2
- import type { SdkError } from '@onfido/capture-shared/Error';
3
- import type { Event } from '@onfido/capture-shared/EventEmitter';
4
- import type { CompleteData } from '@onfido/capture-shared/SdkParameters';
1
+ import type { CaptureModule } from './shared/Types';
2
+ import type { SdkError } from './shared/Error';
3
+ import type { Event } from './shared/EventEmitter';
4
+ import type { CompleteData } from './shared/SdkParameters';
5
5
  export type ModuleEvent<T extends string> = {
6
6
  module: CaptureModule;
7
7
  id: string;
package/types/Onfido.d.ts CHANGED
@@ -1,14 +1,293 @@
1
- import type { Listener } from '@onfido/capture-shared/EventEmitter';
2
- import type { SdkParameters } from '@onfido/capture-shared/SdkParameters';
3
- import type { CaptureRunEvents } from './Events';
4
- export type Handle = {
5
- addEventListener: <EventName extends keyof CaptureRunEvents>(eventName: EventName, listener: Listener<CaptureRunEvents[EventName]>) => void;
6
- removeEventListener: <EventName extends keyof CaptureRunEvents>(eventName: EventName, listener: Listener<CaptureRunEvents[EventName]>) => void;
7
- tearDown: () => Promise<void>;
8
- version?: string;
9
- };
10
- export declare const backwardCompatibility: (parameter: SdkParameters) => void;
11
- export type OnfidoApi = {
12
- init: (parameter: SdkParameters) => Handle;
13
- };
14
- export declare const Onfido: OnfidoApi;
1
+ import type { CaptureRunEvents } from './Events';
2
+
3
+ export declare const backwardCompatibility: (parameter: SdkParameters) => void;
4
+
5
+ declare type CaptureModule = HostedModule | ExternalModule;
6
+
7
+ declare enum CaptureModuleType {
8
+ HOSTED = "hosted",
9
+ EXTERNAL = "external"
10
+ }
11
+
12
+ declare type ChallengePayload = {
13
+ type: 'recite';
14
+ query: number[];
15
+ } | {
16
+ type: 'movement';
17
+ query: string;
18
+ };
19
+
20
+ export declare type ClassicSdkParameters = {
21
+ steps: LegacyStepDefinition[];
22
+ } & TokenParameters;
23
+
24
+ declare type Common = {
25
+ sdk_metadata: string;
26
+ sdk_source: string;
27
+ sdk_version: string;
28
+ };
29
+
30
+ declare type CommonSdkParameters = {
31
+ containerEl?: HTMLElement;
32
+ containerId?: string;
33
+ onError?: ErrorCallback_2;
34
+ onComplete?: (data: CompleteData) => void;
35
+ enterpriseFeatures?: EnterpriseFeatureParameter;
36
+ theme?: Theme;
37
+ customUI?: ThemeConfig;
38
+ language?: string | LegacyLanguageParameter;
39
+ translations?: Translations;
40
+ };
41
+
42
+ declare type CompleteData = Record<string, unknown>;
43
+
44
+ declare type CrossDeviceMethod = 'copy_link' | 'qr_code' | 'sms';
45
+
46
+ declare type CrossDevicePolicy = 'enable' | 'force' | 'disable';
47
+
48
+ declare type CrossDeviceSdkParameters = CommonSdkParameters & {
49
+ roomId?: string;
50
+ };
51
+
52
+ declare type CustomCallbackFormatterType = 'raw' | 'formData';
53
+
54
+ declare type DocumentImageResponse = {
55
+ applicant_id: string;
56
+ type: DocumentType_2;
57
+ side: DocumentSides;
58
+ issuing_country: string;
59
+ sdk_warnings: ImageQualityWarnings & {
60
+ image_quality: {
61
+ quality: string;
62
+ breakdown: {
63
+ document: {
64
+ has_document: boolean;
65
+ detection_score: number;
66
+ } & Score;
67
+ has_document: boolean;
68
+ cutoff: {
69
+ has_cutoff: boolean;
70
+ score: number;
71
+ } & Score;
72
+ blur: {
73
+ has_blur: boolean;
74
+ score: number;
75
+ blur_model: string;
76
+ } & Score;
77
+ glare: {
78
+ score: number;
79
+ bbox: [number, number, number, number];
80
+ has_glare: boolean;
81
+ threshold: number;
82
+ glare_model: string;
83
+ };
84
+ barcode: {
85
+ result: string;
86
+ properties: Record<string, string>;
87
+ };
88
+ };
89
+ image_quality_uuid: string;
90
+ };
91
+ };
92
+ classification: {
93
+ issuing_country: null;
94
+ document_version: null;
95
+ side?: DocumentSides;
96
+ document_type?: DocumentType_2;
97
+ };
98
+ document_features: {
99
+ has_nfc: boolean;
100
+ };
101
+ } & UploadFileResponse;
102
+
103
+ declare type DocumentSides = 'front' | 'back';
104
+
105
+ declare type DocumentType_2 = 'driving_licence' | 'national_identity_card' | 'residence_permit' | 'passport';
106
+
107
+ declare type EnterpriseCallbackResponse<T> = {
108
+ continueWithOnfidoSubmission?: boolean;
109
+ onfidoSuccessResponse?: T;
110
+ };
111
+
112
+ declare type EnterpriseFeatureCallback = {
113
+ useCustomizedApiRequests?: boolean;
114
+ formatter?: CustomCallbackFormatterType;
115
+ onSubmitDocument?: (data: FormData | SubmitDocument) => Promise<EnterpriseCallbackResponse<DocumentImageResponse>>;
116
+ onSubmitSelfie?: (data: FormData | SubmitSelfie) => Promise<EnterpriseCallbackResponse<UploadFileResponse>>;
117
+ onSubmitVideo?: (data: FormData | SubmitVideo) => Promise<EnterpriseCallbackResponse<FaceVideoResponse>>;
118
+ };
119
+
120
+ declare type EnterpriseFeatureParameter = EnterpriseFeatures & EnterpriseFeatureCallback;
121
+
122
+ declare type EnterpriseFeatures = {
123
+ hideOnfidoLogo?: boolean;
124
+ cobrand?: {
125
+ text?: string;
126
+ };
127
+ logoCobrand?: {
128
+ lightLogoSrc?: string;
129
+ darkLogoSrc?: string;
130
+ };
131
+ };
132
+
133
+ declare type ErrorCallback_2 = (error: {
134
+ type: SdkErrorTypes;
135
+ message: string;
136
+ exception?: Error | unknown;
137
+ }) => void;
138
+
139
+ declare type Event_2<T extends string> = {
140
+ type: T;
141
+ };
142
+
143
+ declare type ExternalModule = {
144
+ url: string;
145
+ } & ModuleType<CaptureModuleType.EXTERNAL>;
146
+
147
+ declare type FaceVideoResponse = {
148
+ challenge: ChallengePayload[];
149
+ languages: VideoChallengeLanguage[];
150
+ } & UploadFileResponse;
151
+
152
+ export declare type Handle = {
153
+ addEventListener: <EventName extends keyof CaptureRunEvents>(eventName: EventName, listener: Listener<CaptureRunEvents[EventName]>) => void;
154
+ removeEventListener: <EventName extends keyof CaptureRunEvents>(eventName: EventName, listener: Listener<CaptureRunEvents[EventName]>) => void;
155
+ tearDown: () => Promise<void>;
156
+ version?: string;
157
+ };
158
+
159
+ declare type HostedModule = {
160
+ version?: string;
161
+ module: string;
162
+ } & ModuleType<CaptureModuleType.HOSTED>;
163
+
164
+ declare type ImageQualityValidationTypes = 'detect_barcode' | 'detect_document' | 'detect_cutoff' | 'detect_glare' | 'detect_blur';
165
+
166
+ declare type ImageQualityWarnings = Partial<Record<ImageQualityValidationTypes, {
167
+ valid: boolean;
168
+ }>>;
169
+
170
+ declare type LegacyLanguageParameter = {
171
+ locale?: string;
172
+ phrases?: Record<string, string>;
173
+ mobilePhrases?: Record<string, string>;
174
+ direction?: LocaleDirection;
175
+ };
176
+
177
+ declare type LegacyStepDefinition = LegacyStepType | StepDefinition;
178
+
179
+ declare type LegacyStepType = 'welcome' | 'complete' | 'face' | 'consent' | 'document' | 'poa';
180
+
181
+ declare type Listener<E extends Event_2<any>> = (e: E) => void;
182
+
183
+ declare type LocaleDirection = 'ltr' | 'rtl';
184
+
185
+ declare type ModuleType<T extends CaptureModuleType> = {
186
+ type: T;
187
+ };
188
+
189
+ export declare const Onfido: OnfidoApi;
190
+
191
+ export declare type OnfidoApi = {
192
+ init: (parameter: SdkParameters) => Handle;
193
+ };
194
+
195
+ declare type Score = {
196
+ min: number;
197
+ max: number;
198
+ threshold: number;
199
+ };
200
+
201
+ declare type SdkErrorTypes = 'invalid_token' | 'expired_token' | 'expired_trial' | 'geoblocked_request' | 'permissions_unavailable' | 'exception' | 'unsupported' | 'unsupported_feature' | 'invalid_sdk_parameter' | 'restart' | 'desktop' | 'unsupported_sdk_version' | 'no_camera' | 'user_consent_denied' | 'uncaught_fetch_error' | 'api_error' | 'cross_device_verification_invalid' | 'cross_device_verification_abort' | 'workflow_abandoned' | 'workflow_error';
202
+
203
+ export declare type SdkParameters = StudioSdkParameters | ClassicSdkParameters | CrossDeviceSdkParameters;
204
+
205
+ declare type StepDefinition = {
206
+ type: LegacyStepType | string;
207
+ options?: Record<string, unknown>;
208
+ module?: CaptureModule;
209
+ /**
210
+ * the key used to serialize the output for onComplete
211
+ */
212
+ key?: string;
213
+ };
214
+
215
+ export declare type StudioSdkParameters = {
216
+ workflowRunId: string;
217
+ disableWelcomeScreen?: boolean;
218
+ } & TokenParameters;
219
+
220
+ declare type SubmitDocument = {
221
+ file: Blob;
222
+ side: DocumentSides;
223
+ type: string;
224
+ sdk_validations: string;
225
+ } & Common;
226
+
227
+ declare type SubmitSelfie = {
228
+ file: Blob;
229
+ snapshot: {
230
+ blob: Blob;
231
+ filename: string;
232
+ };
233
+ };
234
+
235
+ declare type SubmitVideo = {
236
+ file: Blob;
237
+ challenge: string;
238
+ challenge_id: string;
239
+ challenge_switch_at: number | undefined;
240
+ languages: string;
241
+ };
242
+
243
+ declare type Theme = {
244
+ name: 'light' | 'dark';
245
+ config?: ThemeConfig;
246
+ };
247
+
248
+ declare type ThemeConfig = Record<string, any>;
249
+
250
+ declare type TokenParameters = {
251
+ token: string;
252
+ language?: string | LegacyLanguageParameter;
253
+ translations?: Translations;
254
+ theme?: Theme;
255
+ /***
256
+ * You can change the default country for the SMS number input by passing the
257
+ * smsNumberCountryCode option when the SDK is initialized. The value should
258
+ * be a string containing a 2-character ISO Country code. If empty, the SMS
259
+ * number country code will default to GB.
260
+ */
261
+ smsNumberCountryCode?: string;
262
+ userDetails?: UserDetails;
263
+ _crossDeviceLinkMethods?: CrossDeviceMethod[];
264
+ crossDeviceClientIntroProductLogoSrc?: string;
265
+ crossDevicePolicy?: CrossDevicePolicy;
266
+ disableAnalytics?: boolean;
267
+ disableAnalyticsCookies?: boolean;
268
+ } & CommonSdkParameters;
269
+
270
+ declare type TranslationItem<T> = T | (() => Promise<T>);
271
+
272
+ declare type Translations<T = unknown> = Record<string, TranslationItem<T>>;
273
+
274
+ declare type UploadFileResponse = {
275
+ id: string;
276
+ created_at: string;
277
+ file_name: string;
278
+ file_type: string;
279
+ file_size: number;
280
+ href: string;
281
+ download_href: string;
282
+ };
283
+
284
+ declare type UserDetails = {
285
+ smsNumber?: string;
286
+ };
287
+
288
+ declare type VideoChallengeLanguage = {
289
+ source: string;
290
+ language_code: string;
291
+ };
292
+
293
+ export { }
@@ -0,0 +1,80 @@
1
+ export type DocumentType =
2
+ | 'driving_licence'
3
+ | 'national_identity_card'
4
+ | 'residence_permit'
5
+ | 'passport'
6
+ | 'passport_card'
7
+
8
+ export type DocumentTypeGeneric = 'generic_document'
9
+
10
+ export type DocumentCountrySelection = {
11
+ documentType: DocumentType
12
+ issuingCountry: string
13
+ }
14
+
15
+ export type DocumentAllSelection = {
16
+ documentType: DocumentType
17
+ allCountries: true
18
+ }
19
+
20
+ export type DocumentGenericSelection = {
21
+ documentType: DocumentTypeGeneric
22
+ id: string
23
+ }
24
+
25
+ export type DocumentSelection =
26
+ | DocumentCountrySelection
27
+ | DocumentAllSelection
28
+ | DocumentGenericSelection
29
+
30
+ export type DocumentSelectionFilter = {
31
+ include?: DocumentSelection[]
32
+ exclude?: DocumentSelection[]
33
+ }
34
+
35
+ export type GenericDocumentType = {
36
+ id: string
37
+ title: string
38
+ subTitle: string
39
+ country: string
40
+ pages: number
41
+ }
42
+
43
+ export type DocumentModuleConfiguration = {
44
+ filter?: DocumentSelectionFilter
45
+ extend?: GenericDocumentType[]
46
+ hideCountrySelection?: boolean
47
+ uploadFallback?: boolean
48
+ }
49
+
50
+ export type DocumentModuleInput = Record<string, unknown>
51
+
52
+ export type DocumentSideOutput = {
53
+ id: string
54
+ type?: string
55
+ }
56
+
57
+ export type Side = 'front' | 'back'
58
+
59
+ export type DocumentIds = Partial<
60
+ Record<`${Side}` | `${Side}_video`, DocumentSideOutput>
61
+ >
62
+
63
+ export type DocumentModuleOutput = {
64
+ type: string
65
+ sides: DocumentIds
66
+ }
67
+
68
+ export type EnabledDocumentType = {
69
+ country: string
70
+ document_type: string
71
+ }
72
+
73
+ export type DocumentFeatureFlags = {
74
+ auto_capture_enabled_documents: EnabledDocumentType[]
75
+ auto_capture_timeout_ms?: number
76
+ enable_auto_capture_doc_capture?: boolean
77
+ enable_js_camera_doc_capture?: boolean
78
+ max_total_retries?: number
79
+ enable_native_camera_fallback?: boolean
80
+ }
@@ -0,0 +1,14 @@
1
+ export type FaceModuleConfiguration = {
2
+ showIntro?: boolean
3
+ useMultipleSelfieCapture?: boolean
4
+ }
5
+
6
+ export type FaceModuleOutput = {
7
+ id: string
8
+ variant: 'standard'
9
+ }
10
+
11
+ export type FaceFeatureFlags = {
12
+ sign_upload?: boolean
13
+ enable_native_camera_fallback?: boolean
14
+ }
@@ -0,0 +1,9 @@
1
+ export type CrossDeviceMethod = 'copy_link' | 'qr_code' | 'sms';
2
+ export type CrossDeviceConnectModuleConfiguration = {
3
+ smsNumberCountryCode?: string;
4
+ smsNumber?: string;
5
+ methods?: CrossDeviceMethod[];
6
+ };
7
+ export type CrossDeviceConnectModuleInput = {
8
+ allowBack?: boolean;
9
+ };
@@ -0,0 +1,121 @@
1
+ export declare type EnterpriseCallbackResponse<T> = {
2
+ continueWithOnfidoSubmission?: boolean;
3
+ onfidoSuccessResponse?: T;
4
+ };
5
+ export type Common = {
6
+ sdk_metadata: string;
7
+ sdk_source: string;
8
+ sdk_version: string;
9
+ };
10
+ export type SubmitDocument = {
11
+ file: Blob;
12
+ side: DocumentSides;
13
+ type: string;
14
+ sdk_validations: string;
15
+ } & Common;
16
+ export type SubmitSelfie = {
17
+ file: Blob;
18
+ snapshot: {
19
+ blob: Blob;
20
+ filename: string;
21
+ };
22
+ };
23
+ export type SubmitVideo = {
24
+ file: Blob;
25
+ challenge: string;
26
+ challenge_id: string;
27
+ challenge_switch_at: number | undefined;
28
+ languages: string;
29
+ };
30
+ export declare type ImageQualityValidationTypes = 'detect_barcode' | 'detect_document' | 'detect_cutoff' | 'detect_glare' | 'detect_blur';
31
+ export declare type ImageQualityWarnings = Partial<Record<ImageQualityValidationTypes, {
32
+ valid: boolean;
33
+ }>>;
34
+ export declare type UploadFileResponse = {
35
+ id: string;
36
+ created_at: string;
37
+ file_name: string;
38
+ file_type: string;
39
+ file_size: number;
40
+ href: string;
41
+ download_href: string;
42
+ };
43
+ type Score = {
44
+ min: number;
45
+ max: number;
46
+ threshold: number;
47
+ };
48
+ export declare type DocumentSides = 'front' | 'back';
49
+ export declare type DocumentType = 'driving_licence' | 'national_identity_card' | 'residence_permit' | 'passport';
50
+ export declare type DocumentImageResponse = {
51
+ applicant_id: string;
52
+ type: DocumentType;
53
+ side: DocumentSides;
54
+ issuing_country: string;
55
+ sdk_warnings: ImageQualityWarnings & {
56
+ image_quality: {
57
+ quality: string;
58
+ breakdown: {
59
+ document: {
60
+ has_document: boolean;
61
+ detection_score: number;
62
+ } & Score;
63
+ has_document: boolean;
64
+ cutoff: {
65
+ has_cutoff: boolean;
66
+ score: number;
67
+ } & Score;
68
+ blur: {
69
+ has_blur: boolean;
70
+ score: number;
71
+ blur_model: string;
72
+ } & Score;
73
+ glare: {
74
+ score: number;
75
+ bbox: [number, number, number, number];
76
+ has_glare: boolean;
77
+ threshold: number;
78
+ glare_model: string;
79
+ };
80
+ barcode: {
81
+ result: string;
82
+ properties: Record<string, string>;
83
+ };
84
+ };
85
+ image_quality_uuid: string;
86
+ };
87
+ };
88
+ classification: {
89
+ issuing_country: null;
90
+ document_version: null;
91
+ side?: DocumentSides;
92
+ document_type?: DocumentType;
93
+ };
94
+ document_features: {
95
+ has_nfc: boolean;
96
+ };
97
+ } & UploadFileResponse;
98
+ export declare type VideoChallengeLanguage = {
99
+ source: string;
100
+ language_code: string;
101
+ };
102
+ export declare type ChallengePayload = {
103
+ type: 'recite';
104
+ query: number[];
105
+ } | {
106
+ type: 'movement';
107
+ query: string;
108
+ };
109
+ export declare type FaceVideoResponse = {
110
+ challenge: ChallengePayload[];
111
+ languages: VideoChallengeLanguage[];
112
+ } & UploadFileResponse;
113
+ export type CustomCallbackFormatterType = 'raw' | 'formData';
114
+ export type EnterpriseFeatureCallback = {
115
+ useCustomizedApiRequests?: boolean;
116
+ formatter?: CustomCallbackFormatterType;
117
+ onSubmitDocument?: (data: FormData | SubmitDocument) => Promise<EnterpriseCallbackResponse<DocumentImageResponse>>;
118
+ onSubmitSelfie?: (data: FormData | SubmitSelfie) => Promise<EnterpriseCallbackResponse<UploadFileResponse>>;
119
+ onSubmitVideo?: (data: FormData | SubmitVideo) => Promise<EnterpriseCallbackResponse<FaceVideoResponse>>;
120
+ };
121
+ export {};
@@ -0,0 +1,80 @@
1
+ import type { Configuration } from './Types';
2
+ export declare enum SdkErrorLevel {
3
+ EXTERNAL = "external",
4
+ INTERNAL = "internal"
5
+ }
6
+ export type SdkErrorTypes = 'invalid_token' | 'expired_token' | 'expired_trial' | 'geoblocked_request' | 'permissions_unavailable' | 'exception' | 'unsupported' | 'unsupported_feature' | 'invalid_sdk_parameter' | 'restart' | 'desktop' | 'unsupported_sdk_version' | 'no_camera' | 'user_consent_denied' | 'uncaught_fetch_error' | 'api_error' | 'cross_device_verification_invalid' | 'cross_device_verification_abort' | 'workflow_abandoned' | 'workflow_error';
7
+ export declare const isSdkError: (error: unknown) => boolean;
8
+ export type SdkErrors = {
9
+ type: SdkErrorTypes;
10
+ message: string;
11
+ level: SdkErrorLevel;
12
+ };
13
+ export declare const CrossDeviceRestartError: SdkErrors;
14
+ export declare const CrossDeviceDesktopError: SdkErrors;
15
+ export declare const CrossDeviceVerificationInvalidError: SdkErrors;
16
+ export declare const CrossDeviceVerificationAbortError: SdkErrors;
17
+ export declare const InvalidTokenError: SdkErrors;
18
+ export declare const WorkflowAbondonedError: SdkErrors;
19
+ export declare const WorkflowError: SdkErrors;
20
+ export declare const ExpiredTokenError: SdkErrors;
21
+ export declare const ExpiredTrialError: SdkErrors;
22
+ export declare const GeoblockedRequestError: SdkErrors;
23
+ export declare const PermissionsUnavailableError: SdkErrors;
24
+ export declare const ExceptionError: SdkErrors;
25
+ export declare const UnsupportedError: SdkErrors;
26
+ export declare const UnsupportedFeatureError: SdkErrors;
27
+ export declare const InvalidSdkParameter: SdkErrors;
28
+ export declare const UnsupportedSdkVersionError: SdkErrors;
29
+ export declare const NoCameraError: SdkErrors;
30
+ export declare const UserConsentDeniedError: SdkErrors;
31
+ export declare const ApiError: SdkErrors;
32
+ export declare const UncaughtFetchError: SdkErrors;
33
+ export type ErrorModuleConfiguration = Configuration & {
34
+ type: SdkErrorTypes;
35
+ };
36
+ export declare const SdkWarningType = "SdkWarning";
37
+ export declare class SdkError extends Error {
38
+ readonly name = "SdkError";
39
+ type: SdkErrorTypes;
40
+ exception?: Error | unknown;
41
+ level: SdkErrorLevel;
42
+ body?: unknown;
43
+ httpCode?: number;
44
+ stack?: string;
45
+ constructor({ type, message, level, exception, stack, body, httpCode, }: {
46
+ type: SdkErrorTypes;
47
+ message: string;
48
+ level: SdkErrorLevel;
49
+ exception?: Error | unknown;
50
+ stack?: string;
51
+ body?: unknown;
52
+ httpCode?: number;
53
+ });
54
+ encode(): {
55
+ name: string;
56
+ type: SdkErrorTypes;
57
+ message: string;
58
+ level: SdkErrorLevel;
59
+ stack: string | undefined;
60
+ exception: unknown;
61
+ body: unknown;
62
+ httpCode: number | undefined;
63
+ };
64
+ static decode(error: SdkError): SdkError;
65
+ }
66
+ export type ErrorCallback = (error: {
67
+ type: SdkErrorTypes;
68
+ message: string;
69
+ exception?: Error | unknown;
70
+ }) => void;
71
+ export declare const formatError: (error: SdkError | Error | unknown) => {
72
+ name: string;
73
+ type: SdkErrorTypes;
74
+ message: string;
75
+ level: SdkErrorLevel;
76
+ stack: string | undefined;
77
+ exception: unknown;
78
+ body: unknown;
79
+ httpCode: number | undefined;
80
+ };
@@ -0,0 +1,16 @@
1
+ export type EventMap = {
2
+ [eventName: string]: Event<string>;
3
+ };
4
+ export type Event<T extends string> = {
5
+ type: T;
6
+ };
7
+ export type Listener<E extends Event<any>> = (e: E) => void;
8
+ export declare class EventEmitter<Events extends EventMap> {
9
+ private readonly eventListener;
10
+ constructor();
11
+ addEventListener<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
12
+ removeEventListener<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): void;
13
+ trigger<EventName extends keyof Events>(eventName: EventName, e: Omit<Events[EventName], 'type'> & {
14
+ type?: EventName;
15
+ }): void;
16
+ }
@@ -1,5 +1,5 @@
1
- import type { DocumentFeatureFlags } from '@onfido/capture-contract/module/DocumentModule';
2
- import type { FaceFeatureFlags } from '@onfido/capture-contract/module/FaceModule';
1
+ import type { DocumentFeatureFlags } from '../contract/module/DocumentModule';
2
+ import type { FaceFeatureFlags } from '../contract/module/FaceModule';
3
3
  export type LogLevels = 'debug' | 'info' | 'warning' | 'error' | 'fatal';
4
4
  export type SdkFeatures = {
5
5
  enable_require_applicant_consents?: boolean;
@@ -0,0 +1,55 @@
1
+ import type { LegacyStepDefinition, LegacyStepType, CrossDevicePolicy, EnterpriseFeatures, LocaleDirection, Theme, ThemeConfig, Translations, UserDetails } from './Types';
2
+ import type { ErrorCallback } from './Error';
3
+ import type { CrossDeviceMethod } from './CrossDeviceConnect.types';
4
+ import type { EnterpriseFeatureCallback } from './Enterprise';
5
+ export declare const legacySteps: LegacyStepType[];
6
+ export declare const isLegacyStepType: (step: LegacyStepDefinition) => step is LegacyStepType;
7
+ export type CompleteData = Record<string, unknown>;
8
+ export type EnterpriseFeatureParameter = EnterpriseFeatures & EnterpriseFeatureCallback;
9
+ export type CommonSdkParameters = {
10
+ containerEl?: HTMLElement;
11
+ containerId?: string;
12
+ onError?: ErrorCallback;
13
+ onComplete?: (data: CompleteData) => void;
14
+ enterpriseFeatures?: EnterpriseFeatureParameter;
15
+ theme?: Theme;
16
+ customUI?: ThemeConfig;
17
+ language?: string | LegacyLanguageParameter;
18
+ translations?: Translations;
19
+ };
20
+ export type LegacyLanguageParameter = {
21
+ locale?: string;
22
+ phrases?: Record<string, string>;
23
+ mobilePhrases?: Record<string, string>;
24
+ direction?: LocaleDirection;
25
+ };
26
+ export type TokenParameters = {
27
+ token: string;
28
+ language?: string | LegacyLanguageParameter;
29
+ translations?: Translations;
30
+ theme?: Theme;
31
+ /***
32
+ * You can change the default country for the SMS number input by passing the
33
+ * smsNumberCountryCode option when the SDK is initialized. The value should
34
+ * be a string containing a 2-character ISO Country code. If empty, the SMS
35
+ * number country code will default to GB.
36
+ */
37
+ smsNumberCountryCode?: string;
38
+ userDetails?: UserDetails;
39
+ _crossDeviceLinkMethods?: CrossDeviceMethod[];
40
+ crossDeviceClientIntroProductLogoSrc?: string;
41
+ crossDevicePolicy?: CrossDevicePolicy;
42
+ disableAnalytics?: boolean;
43
+ disableAnalyticsCookies?: boolean;
44
+ } & CommonSdkParameters;
45
+ export type StudioSdkParameters = {
46
+ workflowRunId: string;
47
+ disableWelcomeScreen?: boolean;
48
+ } & TokenParameters;
49
+ export type ClassicSdkParameters = {
50
+ steps: LegacyStepDefinition[];
51
+ } & TokenParameters;
52
+ export type CrossDeviceSdkParameters = CommonSdkParameters & {
53
+ roomId?: string;
54
+ };
55
+ export type SdkParameters = StudioSdkParameters | ClassicSdkParameters | CrossDeviceSdkParameters;
@@ -0,0 +1,243 @@
1
+ import type { FeatureFlags } from './FeatureFlags';
2
+ export type ModuleError = {
3
+ type: 'no_camera';
4
+ message?: string;
5
+ };
6
+ export type ModuleFinish = {
7
+ type: 'finish';
8
+ output: Output;
9
+ options?: ModuleFinishOptions;
10
+ };
11
+ export type ModuleUnsupported = {
12
+ type: 'unsupported';
13
+ data?: unknown;
14
+ };
15
+ export type Outputs = ModuleFinish | ModuleUnsupported;
16
+ export type Output = unknown | ModuleError;
17
+ export type ModuleFinishOptions = {
18
+ complete?: boolean;
19
+ };
20
+ export type ExecutorMethod = 'bootstrap' | 'ping' | 'start';
21
+ export type CrossDeviceExecutorMethod = 'crossDevice.update';
22
+ export type RunnerMethod = 'captureModule.finish' | 'captureModule.error' | 'captureModule.unsupported' | 'crossDevice.start' | 'crossDevice.preload' | 'crossDevice.verify' | 'crossDevice.abort' | 'analytics.send' | 'analytics.userAnalytics' | 'navigation.back' | 'navigation.exit' | 'navigation.externalLink' | 'customCallback.invoke' | 'passkey.create' | 'passkey.get';
23
+ export type Configuration<T = unknown> = {
24
+ translations: T;
25
+ theme?: Theme;
26
+ language?: string;
27
+ workflowRunId?: string;
28
+ };
29
+ export type Input = Record<string, unknown>;
30
+ export type LocaleDirection = 'ltr' | 'rtl';
31
+ export type TranslationData<T> = T & {
32
+ meta?: {
33
+ legacy: Record<string, unknown>;
34
+ fallback?: Record<string, unknown>;
35
+ direction?: LocaleDirection;
36
+ convertLegacyTranslations?: boolean;
37
+ };
38
+ };
39
+ export type TranslationItem<T> = T | (() => Promise<T>);
40
+ export type Translations<T = unknown> = Record<string, TranslationItem<T>>;
41
+ export type ThemeConfig = Record<string, any>;
42
+ export type Theme = {
43
+ name: 'light' | 'dark';
44
+ config?: ThemeConfig;
45
+ };
46
+ export type Optional<T> = undefined | T;
47
+ export declare enum Platform {
48
+ WEB = "web",
49
+ IOS = "ios",
50
+ ANDROID = "android"
51
+ }
52
+ type ExecutionContextConfiguration = {
53
+ crossDevicePolicy?: CrossDevicePolicy;
54
+ supportsCrossDevice?: boolean;
55
+ supportsBack?: boolean;
56
+ supportsExit?: boolean;
57
+ supportsExternalLink?: boolean;
58
+ globalKit?: boolean;
59
+ };
60
+ export type CustomCallbacks = {
61
+ names: string[];
62
+ };
63
+ export type ExecutionContext = {
64
+ platform: Platform;
65
+ version: string;
66
+ module?: CaptureModule;
67
+ os?: {
68
+ name?: string;
69
+ version?: string;
70
+ };
71
+ configuration?: ExecutionContextConfiguration;
72
+ customCallbacks?: CustomCallbacks;
73
+ currentScriptHostname?: string;
74
+ };
75
+ export type UserDetails = {
76
+ smsNumber?: string;
77
+ };
78
+ export type ClientConfiguration = {
79
+ token: string;
80
+ sdkToken: SdkToken;
81
+ featureFlags: FeatureFlags;
82
+ theme?: Theme;
83
+ language?: string;
84
+ translations?: Translations;
85
+ analytics: {
86
+ enabled: boolean;
87
+ anonymousUuid: string;
88
+ sessionUuid: string;
89
+ workflowRunId: string | undefined;
90
+ steps: LegacyStepDefinition[];
91
+ source: {
92
+ platform: string;
93
+ version: string;
94
+ sdk_environment: string;
95
+ distribution_source: string;
96
+ pinned_version?: string;
97
+ };
98
+ };
99
+ logger: {
100
+ enabled: boolean;
101
+ levels: string[];
102
+ };
103
+ crossDevice: {
104
+ verification?: boolean;
105
+ };
106
+ enterpriseFeatures?: EnterpriseFeatures;
107
+ crossDeviceClientIntroProductName?: string;
108
+ crossDeviceClientIntroProductLogoSrc?: string;
109
+ smsNumberCountryCode?: string;
110
+ userDetails?: UserDetails;
111
+ };
112
+ export type SdkToken = {
113
+ exp: number;
114
+ payload: Payload;
115
+ enterpriseFeatures?: TokenEnterpriseFeatures;
116
+ urls: {
117
+ detectDocumentUrl: URL;
118
+ /**
119
+ * @deprecated
120
+ */
121
+ syncUrl: URL;
122
+ hostedSdkUrl: URL;
123
+ authUrl: URL;
124
+ onfidoApiUrl: URL;
125
+ telephonyUrl: URL;
126
+ };
127
+ type: 'studio' | 'sdk';
128
+ };
129
+ export type UUID = string;
130
+ export type URL = string;
131
+ export type Payload = {
132
+ applicantUuid: UUID;
133
+ applicationId?: string;
134
+ clientUuid: UUID;
135
+ isSandbox: boolean;
136
+ isTrial: boolean;
137
+ };
138
+ export type EnterpriseFeatures = {
139
+ hideOnfidoLogo?: boolean;
140
+ cobrand?: {
141
+ text?: string;
142
+ };
143
+ logoCobrand?: {
144
+ lightLogoSrc?: string;
145
+ darkLogoSrc?: string;
146
+ };
147
+ };
148
+ type TokenEnterpriseFeatures = {
149
+ cobrand: boolean;
150
+ logoCobrand: boolean;
151
+ hideOnfidoLogo: boolean;
152
+ useCustomizedApiRequests: boolean;
153
+ };
154
+ export type JWT = {
155
+ iss?: string;
156
+ exp: number;
157
+ payload: {
158
+ app: UUID;
159
+ application_id?: string;
160
+ client_uuid: UUID;
161
+ is_sandbox: boolean;
162
+ is_trial: boolean;
163
+ ref: string;
164
+ sardine_session: UUID;
165
+ };
166
+ enterprise_features: TokenEnterpriseFeatures;
167
+ urls: {
168
+ detect_document_url: URL;
169
+ sync_url: URL;
170
+ hosted_sdk_url: URL;
171
+ auth_url: URL;
172
+ onfido_api_url: URL;
173
+ telephony_url: URL;
174
+ };
175
+ };
176
+ export type TrackedEventTypes = 'screen' | 'action' | 'flow' | 'view';
177
+ export type AnalyticsEvent = {
178
+ eventName: string;
179
+ eventType: TrackedEventTypes;
180
+ };
181
+ export type UserAnalyticsEvent<N extends string = string, P extends Record<string, unknown> = Record<string, unknown>> = {
182
+ eventName: N;
183
+ properties: P;
184
+ };
185
+ export type DeviceTypes = 'desktop' | 'mobile';
186
+ export type TrackedEnvironmentData = {
187
+ device?: DeviceTypes;
188
+ os?: string;
189
+ os_version?: string;
190
+ browser?: string;
191
+ browser_version?: string;
192
+ brand?: string;
193
+ model?: string;
194
+ };
195
+ export declare enum CrossDeviceVerificationStatus {
196
+ VALID = "VALID",
197
+ INVALID = "INVALID",
198
+ PENDING = "PENDING",
199
+ ABORT = "ABORT"
200
+ }
201
+ export type CrossDeviceInitialState = unknown;
202
+ export type ConnectResult = {
203
+ roomId: string;
204
+ };
205
+ export type CrossDeviceDetails = ConnectResult & {
206
+ connected: boolean;
207
+ link: string;
208
+ code?: string;
209
+ verificationStatus?: CrossDeviceVerificationStatus;
210
+ };
211
+ export type CrossDeviceInput = {
212
+ backActionType?: 'module' | 'cross-module';
213
+ details: CrossDeviceDetails;
214
+ };
215
+ export declare enum CaptureModuleType {
216
+ HOSTED = "hosted",
217
+ EXTERNAL = "external"
218
+ }
219
+ export type ModuleType<T extends CaptureModuleType> = {
220
+ type: T;
221
+ };
222
+ export type HostedModule = {
223
+ version?: string;
224
+ module: string;
225
+ } & ModuleType<CaptureModuleType.HOSTED>;
226
+ export type ExternalModule = {
227
+ url: string;
228
+ } & ModuleType<CaptureModuleType.EXTERNAL>;
229
+ export type CaptureModule = HostedModule | ExternalModule;
230
+ export type CrossDevicePolicy = 'enable' | 'force' | 'disable';
231
+ export type LegacyStepType = 'welcome' | 'complete' | 'face' | 'consent' | 'document' | 'poa';
232
+ export type LegacyStepDefinition = LegacyStepType | StepDefinition;
233
+ export type StepDefinition = {
234
+ type: LegacyStepType | string;
235
+ options?: Record<string, unknown>;
236
+ module?: CaptureModule;
237
+ /**
238
+ * the key used to serialize the output for onComplete
239
+ */
240
+ key?: string;
241
+ };
242
+ export type ExternalLinkTarget = 'overlay' | 'browser';
243
+ export {};