@bytexbyte/berifyme-react-sdk 1.0.1 → 1.0.2

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.
@@ -34,39 +34,38 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
+ import { environmentDomains } from '../lib/environmentDomains';
38
+ import { PageStatus } from '../enum';
37
39
  import { Box, CircularProgress, CssBaseline, ThemeProvider } from '@mui/material';
38
40
  import React, { useEffect, useState } from 'react';
39
- import '../../index.css';
41
+ import theme from '../components/theme';
40
42
  import berifymeApi, { initializeBerifymeApi } from '../api/api';
43
+ import { incode } from '../vender/incode/incode';
41
44
  import AllSet from '../components/AllSet';
45
+ import Modal from './MainModal';
46
+ import RedirectToMobile from '../components/RedirectToMobile';
47
+ import ScreenRotation from '../components/ScreenRotation';
48
+ import TryAgainInModal from '../components/TryAgainInModal';
42
49
  import { createDeveloperLog } from '../components/createDeveloperLog';
43
50
  import { AuthidLogin } from '../components/Login/authid';
44
51
  import { ClearLogin } from '../components/Login/clear';
45
52
  import { ClearLoginAllSet } from '../components/Login/clearAllSet';
46
53
  import { IncodeLogin } from '../components/Login/incode';
47
- import SumsubLogin from '../components/Login/sumsub';
48
- import VeriffLogin from '../components/Login/veriff';
49
- import YotiLogin from '../components/Login/yoti';
54
+ //[Wings] import SumsubLogin from './login/sumsub';
55
+ //[Wings] import VeriffLogin from './login/veriff';
50
56
  import AuthID from '../components/OnBoarding/authId';
51
57
  import IdOrPassport from '../components/OnBoarding/authId/idOrPassport';
52
58
  import { ClearOnboarding } from '../components/OnBoarding/clear';
53
59
  import { ClearOnboardingAllSet } from '../components/OnBoarding/clear/clearAllSet';
54
60
  import { IncodeOnBoarding } from '../components/OnBoarding/incode';
55
- import SumsubOnBoarding from '../components/OnBoarding/sumsub';
61
+ //[Wings] import SumsubOnBoarding from './onBoarding/sumsub';
56
62
  import Vender from '../components/OnBoarding/vender';
57
- import VeriffOnBoarding from '../components/OnBoarding/veriff';
58
- import YotiOnBoarding from '../components/OnBoarding/yoti';
59
- import RedirectToMobile from '../components/RedirectToMobile';
60
- import ScreenRotation from '../components/ScreenRotation';
63
+ //[Wings] import VeriffOnBoarding from './onBoarding/veriff';
64
+ //[Wings] import YotiOnBoarding from './onBoarding/yoti';
61
65
  import SendSns from '../components/SendSns';
62
- import theme from '../components/theme';
63
- import TryAgainInModal from '../components/TryAgainInModal';
64
66
  import VerifyNewUser from '../components/VerifyWithPhoneNumber/NewUser';
65
67
  import VerifyUser from '../components/VerifyWithPhoneNumber/User';
66
- import { PageStatus } from '../enum';
67
- import { environmentDomains } from '../lib/environmentDomains';
68
- import { incode } from '../vender/incode/incode';
69
- import Modal from './MainModal';
68
+ import '../../index.css';
70
69
  var HomeModal = function (_a) {
71
70
  var apiKeyId = _a.apiKeyId, secretKey = _a.secretKey, redirectUrl = _a.redirectUrl, _b = _a.initialPhoneNumber, initialPhoneNumber = _b === void 0 ? '' : _b, environment = _a.environment, forceQrcode = _a.forceQrcode;
72
71
  var _c = useState(window.innerWidth > window.innerHeight), isLandscape = _c[0], setIsLandscape = _c[1];
@@ -185,7 +184,7 @@ var HomeModal = function (_a) {
185
184
  setPageStatus(7);
186
185
  }
187
186
  else {
188
- setPageStatus(PageStatus.SendSns);
187
+ setPageStatus(0);
189
188
  }
190
189
  }, []);
191
190
  useEffect(function () {
@@ -214,61 +213,58 @@ var HomeModal = function (_a) {
214
213
  else if (isLandscape) {
215
214
  setModalHeight('100vh');
216
215
  }
217
- else if (pageStatus === PageStatus.SendSns) {
216
+ else if (pageStatus === 0) {
218
217
  setModalHeight('58vh');
219
218
  }
220
- else if (pageStatus === PageStatus.VerifyNewUser) {
219
+ else if (pageStatus === 1) {
221
220
  setModalHeight('64vh');
222
221
  }
223
- else if (pageStatus === PageStatus.AuthIdOnboarding) {
224
- setModalHeight('100vh');
222
+ else if (pageStatus === 2) {
223
+ setModalHeight('90vh');
225
224
  }
226
- else if (pageStatus === PageStatus.ClearLogin) {
225
+ else if (pageStatus === 4) {
227
226
  setModalHeight('100vh');
228
227
  }
229
- else if (pageStatus === PageStatus.IncodeLogin) {
228
+ else if (pageStatus === 5) {
230
229
  setModalHeight('100vh');
231
230
  }
232
- else if (pageStatus === PageStatus.ClearLoginAllSet) {
231
+ else if (pageStatus === 6) {
233
232
  setModalHeight('58vh');
234
233
  }
235
- else if (pageStatus === PageStatus.ClearOnboardingAllSet) {
234
+ else if (pageStatus === 7) {
236
235
  setModalHeight('58vh');
237
236
  }
238
- else if (pageStatus === PageStatus.SumsubLogin) {
237
+ else if (pageStatus === 8) {
239
238
  setModalHeight('80vh');
240
239
  }
241
- else if (pageStatus === PageStatus.VeriffLogin) {
240
+ else if (pageStatus === 9) {
242
241
  setModalHeight('100vh');
243
242
  }
244
- else if (pageStatus === PageStatus.YotiLogin) {
245
- setModalHeight('80vh');
246
- }
247
- else if (pageStatus === PageStatus.Vender) {
243
+ else if (pageStatus === 1.1) {
248
244
  setModalHeight('80vh');
249
245
  }
250
- else if (pageStatus === PageStatus.IdOrPassport) {
246
+ else if (pageStatus === 1.2) {
251
247
  setModalHeight('55vh');
252
248
  }
253
- else if (pageStatus === PageStatus.VerifyUser) {
249
+ else if (pageStatus === 1.5) {
254
250
  setModalHeight('46vh');
255
251
  }
256
- else if (pageStatus === PageStatus.ClearOnboarding) {
252
+ else if (pageStatus === 2.1) {
257
253
  setModalHeight('100vh');
258
254
  }
259
- else if (pageStatus === PageStatus.IncodeOnBoarding) {
255
+ else if (pageStatus === 2.2) {
260
256
  setModalHeight('100vh');
261
257
  }
262
- else if (pageStatus === PageStatus.SumsubOnBoarding) {
258
+ else if (pageStatus === 2.3) {
263
259
  setModalHeight('80vh');
264
260
  }
265
- else if (pageStatus === PageStatus.VeriffOnBoarding) {
261
+ else if (pageStatus === 2.4) {
266
262
  setModalHeight('100vh');
267
263
  }
268
- else if (pageStatus === PageStatus.YotiOnBoarding) {
264
+ else if (pageStatus === 2.5) {
269
265
  setModalHeight('80vh');
270
266
  }
271
- else if (pageStatus === PageStatus.AllSet) {
267
+ else if (pageStatus === 10) {
272
268
  setModalHeight('58vh');
273
269
  }
274
270
  else {
@@ -314,33 +310,21 @@ var HomeModal = function (_a) {
314
310
  pageStatus === PageStatus.VerifyUser &&
315
311
  React.createElement(VerifyUser, { token: token, inputValue: inputValue, setError: setError, setPageStatus: setPageStatus, setModalHeight: setModalHeight, setUser: setUser, environment: environment }),
316
312
  pageStatus === PageStatus.AuthIdOnboarding && user &&
317
- React.createElement(AuthID, { token: token, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); }, setError: setError, userId: user.id, setUser: setUser, selectedIdType: authIdSelectedIdType, setSelectedIdType: setAuthIdSelectedIdType, setPageStatus: setPageStatus }),
313
+ React.createElement(AuthID, { token: token, goToAllSet: function () { return setPageStatus(10); }, setError: setError, userId: user.id, setUser: setUser, selectedIdType: authIdSelectedIdType }),
318
314
  pageStatus === PageStatus.ClearOnboarding && user &&
319
315
  React.createElement(ClearOnboarding, { token: token, user: user, desktopRedirectUrlId: desktopRedirectUrlId }),
320
316
  pageStatus === PageStatus.IncodeOnBoarding && user &&
321
- React.createElement(IncodeOnBoarding, { user: user, setUser: setUser, token: token, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); } }),
322
- pageStatus === PageStatus.SumsubOnBoarding && user &&
323
- React.createElement(SumsubOnBoarding, { user: user, setUser: setUser, token: token, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); } }),
324
- pageStatus === PageStatus.VeriffOnBoarding && user &&
325
- React.createElement(VeriffOnBoarding, { user: user, setUser: setUser, token: token, goBack: function () { return setPageStatus(1.1); }, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); } }),
326
- pageStatus === PageStatus.YotiOnBoarding && user &&
327
- React.createElement(YotiOnBoarding, { user: user, setUser: setUser, token: token, onSuccess: function () { return setPageStatus(PageStatus.AllSet); }, onGoBack: function () { return setPageStatus(1.1); } }),
317
+ React.createElement(IncodeOnBoarding, { user: user, setUser: setUser, token: token, goToAllSet: function () { return setPageStatus(10); } }),
328
318
  pageStatus === PageStatus.AuthidLogin && processedPhoneNumber &&
329
- React.createElement(AuthidLogin, { token: token, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); }, phoneNumber: processedPhoneNumber, setUser: setUser }),
319
+ React.createElement(AuthidLogin, { token: token, goToAllSet: function () { return setPageStatus(10); }, phoneNumber: processedPhoneNumber, setUser: setUser }),
330
320
  pageStatus === PageStatus.ClearLogin &&
331
321
  React.createElement(ClearLogin, { token: token, userId: user === null || user === void 0 ? void 0 : user.id, desktopRedirectUrlId: desktopRedirectUrlId }),
332
322
  pageStatus === PageStatus.IncodeLogin &&
333
- React.createElement(IncodeLogin, { token: token, user: user, setUser: setUser, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); } }),
323
+ React.createElement(IncodeLogin, { token: token, user: user, setUser: setUser, goToAllSet: function () { return setPageStatus(10); } }),
334
324
  pageStatus === PageStatus.ClearLoginAllSet &&
335
325
  React.createElement(ClearLoginAllSet, { token: token, desktopRedirectUrlId: desktopRedirectUrlId }),
336
326
  pageStatus === PageStatus.ClearOnboardingAllSet &&
337
327
  React.createElement(ClearOnboardingAllSet, { token: token, desktopRedirectUrlId: desktopRedirectUrlId }),
338
- pageStatus === PageStatus.SumsubLogin && user &&
339
- React.createElement(SumsubLogin, { user: user, setUser: setUser, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); }, token: token }),
340
- pageStatus === PageStatus.VeriffLogin && user &&
341
- React.createElement(VeriffLogin, { user: user, setUser: setUser, onGoBack: function () { return setPageStatus(PageStatus.SendSns); }, onSuccess: function () { return setPageStatus(PageStatus.AllSet); }, token: token }),
342
- pageStatus === PageStatus.YotiLogin && user &&
343
- React.createElement(YotiLogin, { user: user, setUser: setUser, onSuccess: function () { return setPageStatus(PageStatus.AllSet); }, token: token }),
344
328
  pageStatus === PageStatus.AllSet &&
345
329
  React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId })))))))));
346
330
  };
package/dist/api/api.js CHANGED
@@ -1186,12 +1186,12 @@ function getOrderByCountry(_a) {
1186
1186
  });
1187
1187
  });
1188
1188
  }
1189
- function createYotiIDVSession(_a) {
1189
+ function createYotiSession(_a) {
1190
1190
  return __awaiter(this, arguments, void 0, function (_b) {
1191
1191
  var url;
1192
1192
  var phoneNumber = _b.phoneNumber;
1193
1193
  return __generator(this, function (_c) {
1194
- url = "".concat(config.backendDomain, "/api/yoti/idvSession");
1194
+ url = "".concat(config.backendDomain, "/api/yoti/session");
1195
1195
  return [2 /*return*/, axios.post(url, { phoneNumber: phoneNumber })
1196
1196
  .then(function (res) {
1197
1197
  return res.data;
@@ -1203,23 +1203,6 @@ function createYotiIDVSession(_a) {
1203
1203
  });
1204
1204
  });
1205
1205
  }
1206
- function createYotiFaceLoginSession(_a) {
1207
- return __awaiter(this, arguments, void 0, function (_b) {
1208
- var url;
1209
- var sessionId = _b.sessionId;
1210
- return __generator(this, function (_c) {
1211
- url = "".concat(config.backendDomain, "/api/yoti/faceLoginSession");
1212
- return [2 /*return*/, axios.post(url, { sessionId: sessionId })
1213
- .then(function (res) {
1214
- return res.data;
1215
- })
1216
- .catch(function (err) {
1217
- var _a;
1218
- return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
1219
- })];
1220
- });
1221
- });
1222
- }
1223
1206
  function approveYotiUser(_a) {
1224
1207
  return __awaiter(this, arguments, void 0, function (_b) {
1225
1208
  var url;
@@ -1237,23 +1220,6 @@ function approveYotiUser(_a) {
1237
1220
  });
1238
1221
  });
1239
1222
  }
1240
- function getYotiFaceLoginResult(_a) {
1241
- return __awaiter(this, arguments, void 0, function (_b) {
1242
- var url;
1243
- var sessionId = _b.sessionId;
1244
- return __generator(this, function (_c) {
1245
- url = "".concat(config.backendDomain, "/api/yoti/faceLoginResult");
1246
- return [2 /*return*/, axios.get(url, { params: { sessionId: sessionId } })
1247
- .then(function (res) {
1248
- return res.data;
1249
- })
1250
- .catch(function (err) {
1251
- var _a;
1252
- return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
1253
- })];
1254
- });
1255
- });
1256
- }
1257
1223
  function getUserByYotiId(_a) {
1258
1224
  return __awaiter(this, arguments, void 0, function (_b) {
1259
1225
  var url;
@@ -1363,10 +1329,8 @@ var berifymeApi = {
1363
1329
  getVeriffFaceLoginResult: getVeriffFaceLoginResult
1364
1330
  },
1365
1331
  yoti: {
1366
- createYotiIDVSession: createYotiIDVSession,
1367
- createYotiFaceLoginSession: createYotiFaceLoginSession,
1368
- approveYotiUser: approveYotiUser,
1369
- getYotiFaceLoginResult: getYotiFaceLoginResult
1332
+ createYotiSession: createYotiSession,
1333
+ approveYotiUser: approveYotiUser
1370
1334
  },
1371
1335
  getOrderByCountry: getOrderByCountry,
1372
1336
  };
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
46
  }
47
47
  };
48
- import React, { useRef } from "react";
48
+ import React from "react";
49
49
  import AuthIDComponent from "@authid/react-component";
50
50
  import { Box, CircularProgress } from "@mui/material";
51
51
  import { useEffect, useState } from "react";
@@ -53,14 +53,10 @@ import berifymeApi, { ActionType } from "../../../api/api";
53
53
  import { useSpeedTest } from "../../speedTest/SpeedProvider";
54
54
  import { createAuthenticationLog, updateAuthenticationLog } from "../../AuthenticationLogs";
55
55
  import { createDeveloperLog } from "../../createDeveloperLog";
56
- import TryAgain from "../../TryAgain";
57
- import { PageStatus } from "../../../enum";
58
56
  var AuthID = function (_a) {
59
- var goToAllSet = _a.goToAllSet, setError = _a.setError, userId = _a.userId, setUser = _a.setUser, selectedIdType = _a.selectedIdType, setSelectedIdType = _a.setSelectedIdType, token = _a.token, setPageStatus = _a.setPageStatus;
57
+ var goToAllSet = _a.goToAllSet, setError = _a.setError, userId = _a.userId, setUser = _a.setUser, selectedIdType = _a.selectedIdType, token = _a.token;
60
58
  var _b = useState(''), operationId = _b[0], setOperationId = _b[1];
61
59
  var _c = useState(''), url = _c[0], setUrl = _c[1];
62
- var _d = useState(''), localError = _d[0], setLocalError = _d[1];
63
- var notFoundCount = useRef(0);
64
60
  var stopSpeedTest = useSpeedTest().stopSpeedTest;
65
61
  useEffect(function () { stopSpeedTest(); }, []);
66
62
  //第零部 準備URL
@@ -293,28 +289,13 @@ var AuthID = function (_a) {
293
289
  if (url) {
294
290
  window.addEventListener('message', function (e) {
295
291
  if (e.data.type === 'authid:page') {
292
+ console.log(e.data);
296
293
  if (e.data.pageName === 'verifiedPage') {
297
294
  setTimeout(function () {
298
295
  getProofTransactionStatus();
299
296
  }, 1000);
300
297
  }
301
298
  }
302
- if (e.data.type === 'authid:control:page') {
303
- // console.log('監聽器回傳e.data:', e.data);
304
- // console.log('監聽器回傳e.data.params',e.data.params);
305
- // console.log('監聽器回傳e.data.params.props',e.data.params.props);
306
- // console.log('監聽器回傳e.data.params.props.reason',e.data.params.props.reason);
307
- if (e.data.params.props.additionalReasons.length === 0 && e.data.params.props.reason === 'NOT_FOUND') {
308
- notFoundCount.current += 1;
309
- console.log('notFoundCount.current', notFoundCount.current);
310
- if (notFoundCount.current >= 2) {
311
- setLocalError('We are unable to verify your ID/Driver\'s License because it lacks a barcode.');
312
- if (!setPageStatus) {
313
- setError('We are unable to verify your ID/Driver\'s License because it lacks a barcode.');
314
- }
315
- }
316
- }
317
- }
318
299
  });
319
300
  }
320
301
  else {
@@ -328,30 +309,15 @@ var AuthID = function (_a) {
328
309
  });
329
310
  };
330
311
  }, [url]);
331
- return (React.createElement(React.Fragment, null, localError ?
332
- React.createElement(TryAgain, { message: localError, pressButton: function () {
333
- if (setPageStatus)
334
- setPageStatus(PageStatus.IdOrPassport);
335
- setSelectedIdType('');
336
- } }) :
337
- React.createElement(React.Fragment, null, url
338
- ? React.createElement(AuthIDComponent
339
- // 用上面監聽器即可
340
- , {
341
- // 用上面監聽器即可
342
- control: function (
343
- // msg: any, authidControlFace: any
344
- ) {
345
- // console.log('下方套件回傳, msg: ', msg);
346
- // console.log('下方套件回傳, authidControlFace: ', authidControlFace);
347
- }, url: url, webauth: true })
348
- : React.createElement(Box, { sx: {
349
- display: 'flex',
350
- justifyContent: 'center',
351
- alignItems: 'center',
352
- height: '100vh',
353
- background: '#FFFFFF'
354
- } },
355
- React.createElement(CircularProgress, null)))));
312
+ return (React.createElement(React.Fragment, null, React.createElement(React.Fragment, null, url
313
+ ? React.createElement(AuthIDComponent, { url: url, webauth: true })
314
+ : React.createElement(Box, { sx: {
315
+ display: 'flex',
316
+ justifyContent: 'center',
317
+ alignItems: 'center',
318
+ height: '100vh',
319
+ background: '#FFFFFF'
320
+ } },
321
+ React.createElement(CircularProgress, null)))));
356
322
  };
357
323
  export default AuthID;
@@ -41,9 +41,9 @@ import berifymeApi from "../../../../api/api";
41
41
  import AuthIdGrid from "./authIdGrid";
42
42
  import ClearGrid from "./clearGrid";
43
43
  import IncodeGrid from "./incodeGrid";
44
- import SumsubGrid from "./sumsubGrid";
45
- import VeriffGrid from "./veriffGrid";
46
- import YotiGrid from "./yotiGrid";
44
+ // import SumsubGrid from "./sumsubGrid";
45
+ // import VeriffGrid from "./veriffGrid";
46
+ // import YotiGrid from "./yotiGrid";
47
47
  var getCountryCodeFromPhoneNumber = function (phoneNumber) {
48
48
  try {
49
49
  var phoneNumberObj = parsePhoneNumber(phoneNumber);
@@ -91,12 +91,12 @@ var VenderGrid = function (_a) {
91
91
  return React.createElement(ClearGrid, { setPageStatus: setPageStatus });
92
92
  case 'incode':
93
93
  return React.createElement(IncodeGrid, { setPageStatus: setPageStatus });
94
- case 'sumsub':
95
- return React.createElement(SumsubGrid, { setPageStatus: setPageStatus });
96
- case 'veriff':
97
- return React.createElement(VeriffGrid, { setPageStatus: setPageStatus });
98
- case 'yoti':
99
- return React.createElement(YotiGrid, { setPageStatus: setPageStatus });
94
+ // case 'sumsub':
95
+ // return <SumsubGrid setPageStatus={setPageStatus} />;
96
+ // case 'veriff':
97
+ // return <VeriffGrid setPageStatus={setPageStatus} />;
98
+ // case 'yoti':
99
+ // return <YotiGrid setPageStatus={setPageStatus} />;
100
100
  default:
101
101
  return null;
102
102
  }
@@ -34,20 +34,20 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
+ import React from 'react';
38
+ import { environmentDomains } from '../../lib/environmentDomains';
37
39
  import { Box, Button, CircularProgress, Stack, Typography } from '@mui/material';
38
40
  import { isValidPhoneNumber } from 'libphonenumber-js';
39
- import React, { useState } from 'react';
41
+ import { useState } from 'react';
40
42
  import PhoneInput from 'react-phone-input-2';
43
+ import './style.css';
41
44
  import berifymeApi, { ActionType } from '../../api/api';
42
- import { PageStatus } from '../../enum';
43
- import { environmentDomains } from '../../lib/environmentDomains';
44
- import webauthn from '../../lib/webauthb';
45
+ import theme from "../theme";
45
46
  import { createAuthenticationLog } from '../AuthenticationLogs';
46
47
  import { createDeveloperLog } from '../createDeveloperLog';
47
48
  import Footer from '../Footer';
48
49
  import { processPhoneNumber } from '../phoneNumberProcesser';
49
- import theme from "../theme";
50
- import './style.css';
50
+ import webauthn from '../../lib/webauthb';
51
51
  var SendSns = function (_a) {
52
52
  var token = _a.token, inputValue = _a.inputValue, setInputValue = _a.setInputValue, setError = _a.setError, setPageStatus = _a.setPageStatus, setProcessedPhoneNumber = _a.setProcessedPhoneNumber, setModalHeight = _a.setModalHeight, setUser = _a.setUser, environment = _a.environment;
53
53
  var _b = useState(true), isValid = _b[0], setIsValid = _b[1];
@@ -159,7 +159,7 @@ var SendSns = function (_a) {
159
159
  });
160
160
  setUser(deviceUser.user);
161
161
  setModalHeight('60vh');
162
- setPageStatus(PageStatus.AllSet);
162
+ setPageStatus(10);
163
163
  setIsLoading(false);
164
164
  createDeveloperLog({
165
165
  userId: webauthnLogin.user.id,
@@ -195,37 +195,32 @@ var SendSns = function (_a) {
195
195
  // });
196
196
  // setUser(checkResult.user);
197
197
  // setModalHeight('60vh');
198
- // setPageStatus(PageStatus.AllSet);
198
+ // setPageStatus(10);
199
199
  // return;
200
200
  // }
201
201
  // }
202
202
  if (getVender.vender === 'authid') {
203
- setLogin(PageStatus.AuthidLogin);
203
+ setLogin(3);
204
204
  setModalHeight('50vh');
205
205
  setFullName(getVender.fullName);
206
206
  }
207
207
  else if (getVender.vender === 'clear') {
208
- setLogin(PageStatus.ClearLogin);
208
+ setLogin(4);
209
209
  setModalHeight('50vh');
210
210
  setFullName(getVender.fullName);
211
211
  }
212
212
  else if (getVender.vender === 'incode') {
213
- setLogin(PageStatus.IncodeLogin);
213
+ setLogin(5);
214
214
  setModalHeight('50vh');
215
215
  setFullName(getVender.fullName);
216
216
  }
217
217
  else if (getVender.vender === 'sumsub') {
218
- setLogin(PageStatus.SumsubLogin);
218
+ setLogin(8);
219
219
  setModalHeight('50vh');
220
220
  setFullName(getVender.fullName);
221
221
  }
222
222
  else if (getVender.vender === 'veriff') {
223
- setLogin(PageStatus.VeriffLogin);
224
- setModalHeight('50vh');
225
- setFullName(getVender.fullName);
226
- }
227
- else if (getVender.vender === 'yoti') {
228
- setLogin(PageStatus.YotiLogin);
223
+ setLogin(9);
229
224
  setModalHeight('50vh');
230
225
  setFullName(getVender.fullName);
231
226
  }
@@ -1,4 +1,4 @@
1
- import { Button, Stack, Typography } from '@mui/material';
1
+ import { Button, Container, Stack, Typography } from '@mui/material';
2
2
  import React from 'react';
3
3
  var TryAgain = function (_a) {
4
4
  var message = _a.message, pressButton = _a.pressButton;
@@ -8,8 +8,9 @@ var TryAgain = function (_a) {
8
8
  else
9
9
  window.location.reload();
10
10
  };
11
- return (React.createElement(Stack, { height: 1, width: 1, justifyContent: 'center', alignItems: 'center', spacing: 4 },
12
- React.createElement(Typography, { variant: "h3", fontWeight: 700, textAlign: "center" }, message ? message : 'Authentication Failed, Please Try Again.'),
13
- React.createElement(Button, { variant: "contained", color: "primary", onClick: handleContinue }, "Continue")));
11
+ return (React.createElement(Container, { maxWidth: 'sm', sx: { px: 3 } },
12
+ React.createElement(Stack, { height: '100vh', width: 1, maxHeight: 900, justifyContent: 'center', alignItems: 'center', spacing: 4 },
13
+ React.createElement(Typography, { variant: "h3", fontWeight: 700, textAlign: "center" }, message ? message : 'Authentication Failed, Please Try Again.'),
14
+ React.createElement(Button, { variant: "contained", color: "primary", onClick: handleContinue }, "Continue"))));
14
15
  };
15
16
  export default TryAgain;
@@ -34,18 +34,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
- import ArrowBackRoundedIcon from '@mui/icons-material/ArrowBackRounded';
38
- import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
37
+ import React from "react";
39
38
  import { Box, CircularProgress, IconButton, Input, Stack, Typography } from "@mui/material";
40
- import React, { useEffect, useState } from "react";
39
+ import theme from "../../theme";
40
+ import { useEffect, useState } from "react";
41
41
  import berifymeApi from "../../../api/api";
42
- import { PageStatus } from "../../../enum";
43
- import { environmentDomains } from "../../../lib/environmentDomains";
42
+ import ArrowBackRoundedIcon from '@mui/icons-material/ArrowBackRounded';
43
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
44
+ import Footer from "../../Footer";
44
45
  import webauthn from "../../../lib/webauthb";
46
+ import { environmentDomains } from "../../../lib/environmentDomains";
45
47
  import { createDeveloperLog } from "../../createDeveloperLog";
46
- import Footer from "../../Footer";
47
48
  import { processPhoneNumber } from "../../phoneNumberProcesser";
48
- import theme from "../../theme";
49
49
  var VerifyNewUser = function (_a) {
50
50
  var token = _a.token, inputValue = _a.inputValue, setPageStatus = _a.setPageStatus, setUser = _a.setUser, environment = _a.environment;
51
51
  var _b = useState(60), countdown = _b[0], setCountdown = _b[1]; // 倒數計時器,秒數為0表示可重新發送
@@ -152,7 +152,7 @@ var VerifyNewUser = function (_a) {
152
152
  React.createElement(Stack, { height: 1, spacing: 2, pt: 1 },
153
153
  React.createElement(Stack, { direction: 'row' },
154
154
  React.createElement(IconButton, { color: 'primary', onClick: function () {
155
- setPageStatus(PageStatus.SendSns);
155
+ setPageStatus(0);
156
156
  } },
157
157
  React.createElement(ArrowBackRoundedIcon, null))),
158
158
  React.createElement(Stack, { spacing: 2 },
@@ -34,18 +34,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
+ import React from "react";
38
+ import { environmentDomains } from "../../../lib/environmentDomains";
37
39
  import ArrowBackRoundedIcon from '@mui/icons-material/ArrowBackRounded';
38
40
  import { Box, Button, CircularProgress, IconButton, Input, Stack, Typography } from "@mui/material";
39
- import React, { useEffect, useState } from "react";
41
+ import { useEffect, useState } from "react";
40
42
  import berifymeApi, { ActionType } from "../../../api/api";
41
- import { PageStatus } from "../../../enum";
42
- import { environmentDomains } from "../../../lib/environmentDomains";
43
- import webauthn from "../../../lib/webauthb";
43
+ import theme from "../../theme";
44
44
  import { createAuthenticationLog } from "../../AuthenticationLogs";
45
45
  import { createDeveloperLog } from "../../createDeveloperLog";
46
46
  import Footer from "../../Footer";
47
+ import webauthn from "../../../lib/webauthb";
47
48
  import { processPhoneNumber } from "../../phoneNumberProcesser";
48
- import theme from "../../theme";
49
49
  var VerifyUser = function (_a) {
50
50
  var token = _a.token, inputValue = _a.inputValue, setError = _a.setError, setPageStatus = _a.setPageStatus, setUser = _a.setUser, setModalHeight = _a.setModalHeight, environment = _a.environment;
51
51
  var _b = useState(60), countdown = _b[0], setCountdown = _b[1]; // 倒數計時器,秒數為0表示可重新發送
@@ -166,7 +166,7 @@ var VerifyUser = function (_a) {
166
166
  });
167
167
  setUser(deviceUser.user);
168
168
  setModalHeight('60vh');
169
- setPageStatus(PageStatus.AllSet);
169
+ setPageStatus(10);
170
170
  createDeveloperLog({
171
171
  source: 'FRONTEND',
172
172
  action: 'handle phone number submit stop loading',
@@ -218,32 +218,27 @@ var VerifyUser = function (_a) {
218
218
  });
219
219
  }
220
220
  if (getVender.vender === 'authid') {
221
- setLogin(PageStatus.AuthidLogin);
221
+ setLogin(3);
222
222
  setModalHeight('50vh');
223
223
  setFullName(getVender.fullName);
224
224
  }
225
225
  else if (getVender.vender === 'clear') {
226
- setLogin(PageStatus.ClearLogin);
226
+ setLogin(4);
227
227
  setModalHeight('50vh');
228
228
  setFullName(getVender.fullName);
229
229
  }
230
230
  else if (getVender.vender === 'incode') {
231
- setLogin(PageStatus.IncodeLogin);
231
+ setLogin(5);
232
232
  setModalHeight('50vh');
233
233
  setFullName(getVender.fullName);
234
234
  }
235
235
  else if (getVender.vender === 'sumsub') {
236
- setLogin(PageStatus.SumsubLogin);
236
+ setLogin(8);
237
237
  setModalHeight('50vh');
238
238
  setFullName(getVender.fullName);
239
239
  }
240
240
  else if (getVender.vender === 'veriff') {
241
- setLogin(PageStatus.VeriffLogin);
242
- setModalHeight('50vh');
243
- setFullName(getVender.fullName);
244
- }
245
- else if (getVender.vender === 'yoti') {
246
- setLogin(PageStatus.YotiLogin);
241
+ setLogin(9);
247
242
  setModalHeight('50vh');
248
243
  setFullName(getVender.fullName);
249
244
  }
@@ -296,7 +291,7 @@ var VerifyUser = function (_a) {
296
291
  React.createElement(Stack, { height: 1, spacing: 2, pt: 1 },
297
292
  React.createElement(Stack, { direction: 'row' },
298
293
  React.createElement(IconButton, { color: 'primary', onClick: function () {
299
- setPageStatus(PageStatus.SendSns);
294
+ setPageStatus(0);
300
295
  } },
301
296
  React.createElement(ArrowBackRoundedIcon, null))),
302
297
  React.createElement(Stack, { spacing: 2 },
@@ -15,16 +15,10 @@ export var PageStatus;
15
15
  PageStatus[PageStatus["AuthIdOnboarding"] = 2] = "AuthIdOnboarding";
16
16
  PageStatus[PageStatus["ClearOnboarding"] = 2.1] = "ClearOnboarding";
17
17
  PageStatus[PageStatus["IncodeOnBoarding"] = 2.2] = "IncodeOnBoarding";
18
- PageStatus[PageStatus["SumsubOnBoarding"] = 2.3] = "SumsubOnBoarding";
19
- PageStatus[PageStatus["VeriffOnBoarding"] = 2.4] = "VeriffOnBoarding";
20
- PageStatus[PageStatus["YotiOnBoarding"] = 2.5] = "YotiOnBoarding";
21
18
  PageStatus[PageStatus["AuthidLogin"] = 3] = "AuthidLogin";
22
19
  PageStatus[PageStatus["ClearLogin"] = 4] = "ClearLogin";
23
20
  PageStatus[PageStatus["IncodeLogin"] = 5] = "IncodeLogin";
24
21
  PageStatus[PageStatus["ClearLoginAllSet"] = 6] = "ClearLoginAllSet";
25
22
  PageStatus[PageStatus["ClearOnboardingAllSet"] = 7] = "ClearOnboardingAllSet";
26
- PageStatus[PageStatus["SumsubLogin"] = 8] = "SumsubLogin";
27
- PageStatus[PageStatus["VeriffLogin"] = 9] = "VeriffLogin";
28
- PageStatus[PageStatus["YotiLogin"] = 11] = "YotiLogin";
29
23
  PageStatus[PageStatus["AllSet"] = 10] = "AllSet";
30
24
  })(PageStatus || (PageStatus = {}));
@@ -1,6 +1,6 @@
1
+ import { Environment } from '../enum';
1
2
  import React from 'react';
2
3
  import '../../index.css';
3
- import { Environment } from '../enum';
4
4
  declare const HomeModal: React.FC<{
5
5
  apiKeyId: string;
6
6
  secretKey: string;
@@ -484,7 +484,7 @@ declare function getOrderByCountry({ countryCode }: {
484
484
  order?: [];
485
485
  error?: string;
486
486
  }>;
487
- declare function createYotiIDVSession({ phoneNumber }: {
487
+ declare function createYotiSession({ phoneNumber }: {
488
488
  phoneNumber: string;
489
489
  }): Promise<{
490
490
  sessionId: string;
@@ -492,14 +492,6 @@ declare function createYotiIDVSession({ phoneNumber }: {
492
492
  } | {
493
493
  error: string;
494
494
  }>;
495
- declare function createYotiFaceLoginSession({ sessionId }: {
496
- sessionId: string;
497
- }): Promise<{
498
- sessionId: string;
499
- clientSessionToken: string;
500
- } | {
501
- error: string;
502
- }>;
503
495
  declare function approveYotiUser({ sessionId }: {
504
496
  sessionId: string;
505
497
  }): Promise<{
@@ -507,13 +499,6 @@ declare function approveYotiUser({ sessionId }: {
507
499
  } | {
508
500
  error: string;
509
501
  }>;
510
- declare function getYotiFaceLoginResult({ sessionId }: {
511
- sessionId: string;
512
- }): Promise<{
513
- isVerified: boolean;
514
- } | {
515
- error: string;
516
- }>;
517
502
  declare function getUserByYotiId({ yotiId }: {
518
503
  yotiId: string;
519
504
  }): Promise<{
@@ -613,10 +598,8 @@ declare const berifymeApi: {
613
598
  getVeriffFaceLoginResult: typeof getVeriffFaceLoginResult;
614
599
  };
615
600
  yoti: {
616
- createYotiIDVSession: typeof createYotiIDVSession;
617
- createYotiFaceLoginSession: typeof createYotiFaceLoginSession;
601
+ createYotiSession: typeof createYotiSession;
618
602
  approveYotiUser: typeof approveYotiUser;
619
- getYotiFaceLoginResult: typeof getYotiFaceLoginResult;
620
603
  };
621
604
  getOrderByCountry: typeof getOrderByCountry;
622
605
  };
@@ -1,13 +1,11 @@
1
1
  import React from "react";
2
2
  import { UserWithAgeAndFullName } from "../../../api/api";
3
- declare const AuthID: ({ goToAllSet, setError, userId, setUser, selectedIdType, setSelectedIdType, token, setPageStatus }: {
3
+ declare const AuthID: ({ goToAllSet, setError, userId, setUser, selectedIdType, token }: {
4
4
  goToAllSet: () => void;
5
5
  setError: React.Dispatch<React.SetStateAction<string | undefined>>;
6
6
  userId: string;
7
7
  setUser?: React.Dispatch<React.SetStateAction<UserWithAgeAndFullName | undefined>>;
8
8
  selectedIdType: string;
9
- setSelectedIdType: React.Dispatch<React.SetStateAction<string>>;
10
9
  token?: string;
11
- setPageStatus?: React.Dispatch<React.SetStateAction<number>>;
12
10
  }) => React.JSX.Element;
13
11
  export default AuthID;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { User } from '../../api/api';
3
2
  import { Environment } from '../../enum';
4
3
  import './style.css';
4
+ import { User } from '../../api/api';
5
5
  declare const SendSns: ({ token, inputValue, setInputValue, setError, setPageStatus, setProcessedPhoneNumber, setModalHeight, setUser, environment, }: {
6
6
  token: string | undefined;
7
7
  inputValue: string;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { UserWithAgeAndFullName } from "../../../api/api";
3
2
  import { Environment } from "../../../enum";
3
+ import { UserWithAgeAndFullName } from "../../../api/api";
4
4
  declare const VerifyUser: ({ token, inputValue, setError, setPageStatus, setUser, setModalHeight, environment, }: {
5
5
  token: string | undefined;
6
6
  inputValue: string;
@@ -13,16 +13,10 @@ export declare enum PageStatus {
13
13
  AuthIdOnboarding = 2,
14
14
  ClearOnboarding = 2.1,
15
15
  IncodeOnBoarding = 2.2,
16
- SumsubOnBoarding = 2.3,
17
- VeriffOnBoarding = 2.4,
18
- YotiOnBoarding = 2.5,
19
16
  AuthidLogin = 3,
20
17
  ClearLogin = 4,
21
18
  IncodeLogin = 5,
22
19
  ClearLoginAllSet = 6,
23
20
  ClearOnboardingAllSet = 7,
24
- SumsubLogin = 8,
25
- VeriffLogin = 9,
26
- YotiLogin = 11,
27
21
  AllSet = 10
28
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/berifyme-react-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",