@bytexbyte/berifyme-react-sdk 1.0.17 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/BerifymeModal/index.js +4 -4
  2. package/dist/api/api.js +39 -6
  3. package/dist/components/AllSet/index.js +3 -3
  4. package/dist/components/OnBoarding/incode/SelectType.js +7 -3
  5. package/dist/components/OnBoarding/incode/index.js +13 -14
  6. package/dist/components/SendSns/index.js +18 -15
  7. package/dist/components/SnapMatch/ExceptionView.js +22 -0
  8. package/dist/components/SnapMatch/LangSelector.js +26 -0
  9. package/dist/components/SnapMatch/SnapMatchStep.js +122 -0
  10. package/dist/components/SnapMatch/SuccessView.js +22 -0
  11. package/dist/components/SnapMatch/TryAgainView.js +19 -0
  12. package/dist/components/SnapMatch/index.js +281 -0
  13. package/dist/components/SnapMatch/translations.js +32 -0
  14. package/dist/components/VerifyWithPhoneNumber/User/index.js +12 -9
  15. package/dist/index.js +6 -1
  16. package/dist/types/api/api.d.ts +7 -1
  17. package/dist/types/components/OnBoarding/incode/SelectType.d.ts +2 -1
  18. package/dist/types/components/OnBoarding/incode/index.d.ts +1 -0
  19. package/dist/types/components/SnapMatch/ExceptionView.d.ts +11 -0
  20. package/dist/types/components/SnapMatch/LangSelector.d.ts +11 -0
  21. package/dist/types/components/SnapMatch/SnapMatchStep.d.ts +23 -0
  22. package/dist/types/components/SnapMatch/SuccessView.d.ts +11 -0
  23. package/dist/types/components/SnapMatch/TryAgainView.d.ts +11 -0
  24. package/dist/types/components/SnapMatch/index.d.ts +20 -0
  25. package/dist/types/components/SnapMatch/translations.d.ts +54 -0
  26. package/dist/types/index.d.ts +6 -1
  27. package/dist/types/vender/incode/incode.d.ts +6 -2
  28. package/dist/types/vender/incode/translations/en.d.ts +2638 -0
  29. package/dist/types/vender/incode/translations/zh-TW.d.ts +2634 -0
  30. package/dist/vender/incode/incode.js +81 -5
  31. package/dist/vender/incode/translations/en.js +2638 -0
  32. package/dist/vender/incode/translations/zh-TW.js +2634 -0
  33. package/package.json +5 -2
  34. package/dist/components/Login/sumsub/index.js +0 -212
  35. package/dist/components/Login/veriff/Login.js +0 -168
  36. package/dist/components/Login/veriff/index.js +0 -14
  37. package/dist/components/Login/yoti/Login.js +0 -245
  38. package/dist/components/Login/yoti/index.js +0 -14
  39. package/dist/components/OnBoarding/sumsub/index.js +0 -183
  40. package/dist/components/OnBoarding/veriff/index.js +0 -152
  41. package/dist/components/OnBoarding/yoti/OnBoarding.js +0 -238
  42. package/dist/components/OnBoarding/yoti/index.js +0 -14
  43. package/dist/components/TryAgain.js +0 -16
  44. package/dist/components/TryAgainInModal.js +0 -15
  45. package/dist/event.js +0 -18
  46. package/dist/types/components/Login/sumsub/index.d.ts +0 -10
  47. package/dist/types/components/Login/veriff/Login.d.ts +0 -12
  48. package/dist/types/components/Login/veriff/index.d.ts +0 -11
  49. package/dist/types/components/Login/yoti/Login.d.ts +0 -11
  50. package/dist/types/components/Login/yoti/index.d.ts +0 -10
  51. package/dist/types/components/OnBoarding/sumsub/index.d.ts +0 -10
  52. package/dist/types/components/OnBoarding/veriff/index.d.ts +0 -11
  53. package/dist/types/components/OnBoarding/yoti/OnBoarding.d.ts +0 -12
  54. package/dist/types/components/OnBoarding/yoti/index.d.ts +0 -11
  55. package/dist/types/components/TryAgain.d.ts +0 -6
  56. package/dist/types/components/TryAgainInModal.d.ts +0 -6
  57. package/dist/types/event.d.ts +0 -9
@@ -1,13 +1,89 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
1
37
  import { create } from "@incodetech/welcome";
2
- var apiURL = 'https://saas-api.incodesmile.com/0';
3
- var loginApiURL = 'https://saas-api.incodesmile.com';
38
+ import en from "./translations/en";
39
+ import zhTW from "./translations/zh-TW";
40
+ var apiURL = "https://saas-api.incodesmile.com/0";
41
+ var loginApiURL = "https://saas-api.incodesmile.com";
4
42
  var incode = create({
5
43
  apiURL: apiURL,
6
- lang: 'en-US',
44
+ lang: "en-US",
7
45
  });
8
46
  var incodeLogin = create({
9
47
  apiURL: loginApiURL,
10
- clientId: 'berifyprod883',
11
- apiKey: 'ca8626ee3fdb329af413088b13d034bc6896b678',
48
+ clientId: "berifyprod883",
49
+ apiKey: "ca8626ee3fdb329af413088b13d034bc6896b678",
12
50
  });
51
+ /** 與網頁 Frontend 一致:繁中時傳 lang: "en" + translations: zhTW,英文時傳 lang: "en" + translations: en。
52
+ * 一律用 "en" 當 key,不碰 "zh",就不會觸發 Backend 載入簡體,setup 會先 changeLanguage("en") 再 addResourceBundle("en", ...)。 */
53
+ export function createIncodeLogin(lang) {
54
+ return __awaiter(this, void 0, void 0, function () {
55
+ var isZhTW, bundle, options, instance, init, i18n;
56
+ return __generator(this, function (_a) {
57
+ switch (_a.label) {
58
+ case 0:
59
+ isZhTW = lang === "zh-TW";
60
+ bundle = isZhTW ? zhTW : en;
61
+ options = {
62
+ apiURL: loginApiURL,
63
+ clientId: "berifyprod883",
64
+ apiKey: "ca8626ee3fdb329af413088b13d034bc6896b678",
65
+ lang: "en",
66
+ translations: bundle,
67
+ };
68
+ return [4 /*yield*/, Promise.resolve(create(options))];
69
+ case 1:
70
+ instance = _a.sent();
71
+ init = instance && instance.initialize;
72
+ if (!(typeof init === "function")) return [3 /*break*/, 3];
73
+ return [4 /*yield*/, init()];
74
+ case 2:
75
+ _a.sent();
76
+ _a.label = 3;
77
+ case 3:
78
+ i18n = instance === null || instance === void 0 ? void 0 : instance.i18n;
79
+ if (!(i18n === null || i18n === void 0 ? void 0 : i18n.changeLanguage)) return [3 /*break*/, 5];
80
+ return [4 /*yield*/, i18n.changeLanguage("en")];
81
+ case 4:
82
+ _a.sent();
83
+ _a.label = 5;
84
+ case 5: return [2 /*return*/, instance];
85
+ }
86
+ });
87
+ });
88
+ }
13
89
  export { incode, incodeLogin };