@incodetech/welcome 1.85.0-20251216191730.0 → 1.85.0-20251217140239.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -351,7 +351,11 @@ tokboxApiKey, darkMode, hostingApp, unsafeMode, customHeaders, fingerprintApiKey
351
351
  token: string;
352
352
  interviewId: string;
353
353
  isSandbox?: boolean;
354
- }) => Promise<any>;
354
+ }) => Promise<{
355
+ updateConfig: (config: {
356
+ flow: string;
357
+ }) => void;
358
+ }>;
355
359
  getDeviceRiskModuleConfiguration: (token: string) => Promise<import('./risk/services').DeviceRiskResponse>;
356
360
  collectDeviceRiskResults: (token: string) => Promise<void>;
357
361
  addBankInfo: ({ token, bankData, }: {
@@ -4,5 +4,11 @@ type EnableDeviceRiskModuleParams = {
4
4
  interviewId: string;
5
5
  isSandbox?: boolean;
6
6
  };
7
- export declare const enableDeviceRiskModule: ({ token, isSandbox, interviewId, }: EnableDeviceRiskModuleParams) => Promise<any>;
7
+ type SardineContext = {
8
+ updateConfig: (config: {
9
+ flow: string;
10
+ }) => void;
11
+ };
12
+ export declare const getSardineContext: () => SardineContext | null;
13
+ export declare const enableDeviceRiskModule: ({ token, isSandbox, interviewId, }: EnableDeviceRiskModuleParams) => Promise<SardineContext>;
8
14
  export {};
@@ -1 +1 @@
1
- export { enableDeviceRiskModule } from './enableDeviceRiskModule';
1
+ export { enableDeviceRiskModule, getSardineContext, } from './enableDeviceRiskModule';
@@ -7699,7 +7699,7 @@ function getProfile(Be) {
7699
7699
  throw new Error(`Profile not found for type: ${Be}`);
7700
7700
  return Le;
7701
7701
  }
7702
- const wasmVersion = "v2.12.44";
7702
+ const wasmVersion = "v2.12.45";
7703
7703
  function generateBundle() {
7704
7704
  const Be = getFeatureFlag("id_text_barcode_readability") ? PipelineProfileName.IdCapture_3_02 : getFeatureFlag("id_model_hebrew_back_id") ? PipelineProfileName.IdCapture_2_02 : PipelineProfileName.IdCapture_2_01, Le = PipelineProfileName.SelfieWithQualityMetrics, Ye = PipelineProfileName.SelfieVideoSelfie, tt = PipelineProfileName.IdVideoSelfie_2_01;
7705
7705
  return [
@@ -8282,7 +8282,7 @@ class MlWasmJSApi {
8282
8282
  );
8283
8283
  }
8284
8284
  }
8285
- const MlWasmJSApi$1 = MlWasmJSApi.getInstance(), version$4 = "1.85.0-20251216191730.0";
8285
+ const MlWasmJSApi$1 = MlWasmJSApi.getInstance(), version$4 = "1.85.0-20251217140239.0";
8286
8286
  function e$2(Be, Le) {
8287
8287
  return function(Ye, tt) {
8288
8288
  return Object.prototype.hasOwnProperty.call(Ye, tt);
@@ -151303,7 +151303,118 @@ function preloadScript$6(Be) {
151303
151303
  loadingDelegate: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {})
151304
151304
  }, Le;
151305
151305
  }
151306
- const eventModuleNames = {
151306
+ const getCustomFields = ({ token: Be }) => api.get("/omni/get/custom-fields", {
151307
+ headers: {
151308
+ "X-Incode-Hardware-Id": Be
151309
+ }
151310
+ }).then((Le) => Le.data).catch((Le) => Promise.reject(Le.response.data)), getDeviceRiskModuleConfiguration = async (Be) => api.get("/omni/device-risk-client-id", {
151311
+ headers: {
151312
+ "X-Incode-Hardware-Id": Be
151313
+ }
151314
+ }).then((Ye) => Ye.data).catch(() => ({ enabled: !1 })), collectDeviceRiskResults = async (Be) => api.post(
151315
+ "/omni/collect-device-risk-results",
151316
+ null,
151317
+ // no data/body is required
151318
+ {
151319
+ headers: {
151320
+ "X-Incode-Hardware-Id": Be
151321
+ }
151322
+ }
151323
+ ).then((Ye) => Ye.data).catch(() => ({})), shouldDoSardineContextFromSardine = (Be) => Be === void 0 ? !1 : typeof Be.SardineClientID == "string" && typeof Be.SardineSessionKey == "string" && typeof Be.SardineUserID == "string", loadSardineSDK = async (Be) => {
151324
+ const Le = Be ? "api.sandbox.sardine.ai" : "api.sardine.ai", Ye = document.createElement("script");
151325
+ return Ye.type = "text/javascript", Ye.async = !0, Ye.src = `https://${Le}/assets/loader.min.js`, new Promise((tt) => {
151326
+ Ye.onload = () => tt();
151327
+ const nt = document.getElementsByTagName("script")[0];
151328
+ nt.parentNode.insertBefore(Ye, nt);
151329
+ });
151330
+ };
151331
+ let sardineContext = null;
151332
+ const getSardineContext = () => sardineContext, createSardineContextFromSardine = ({
151333
+ sardineClientId: Be,
151334
+ sardineSessionKey: Le,
151335
+ sardineUserId: Ye,
151336
+ isSandbox: tt,
151337
+ token: nt,
151338
+ interviewId: ft
151339
+ }) => window._Sardine.createContext({
151340
+ clientId: Be,
151341
+ sessionKey: ft,
151342
+ flow: `Landing page ${location.pathname}`,
151343
+ environment: tt ? "sandbox" : "production",
151344
+ parentElement: document.body,
151345
+ parentSessionKey: Le,
151346
+ userIdHash: Ye,
151347
+ // called when sardine generates/restores deviceID for given device.
151348
+ onDeviceResponse(ht) {
151349
+ addEvent({
151350
+ code: "externalRiskSDKInitialized",
151351
+ payload: {
151352
+ sardineData: {
151353
+ deviceId: ht.deviceId,
151354
+ uuid: ht.uuid
151355
+ },
151356
+ interviewId: ft,
151357
+ sardineClientId: Be,
151358
+ sardineSessionKey: Le,
151359
+ sardineUserId: Ye
151360
+ },
151361
+ token: nt
151362
+ });
151363
+ }
151364
+ }), createSardineContextIncode = ({
151365
+ sardineClientId: Be,
151366
+ isSandbox: Le,
151367
+ token: Ye,
151368
+ interviewId: tt
151369
+ }) => window._Sardine.createContext({
151370
+ clientId: Be,
151371
+ sessionKey: tt,
151372
+ flow: `Landing page ${location.pathname}`,
151373
+ environment: "production",
151374
+ parentElement: document.body,
151375
+ userIdHash: tt,
151376
+ onDeviceResponse(nt) {
151377
+ addEvent({
151378
+ code: "externalRiskSDKInitialized",
151379
+ payload: {
151380
+ sardineData: {
151381
+ deviceId: nt.deviceId,
151382
+ uuid: nt.uuid
151383
+ },
151384
+ interviewId: tt,
151385
+ sardineClientId: Be
151386
+ },
151387
+ token: Ye
151388
+ });
151389
+ }
151390
+ }), enableDeviceRiskModule = async ({
151391
+ token: Be,
151392
+ isSandbox: Le = !0,
151393
+ interviewId: Ye
151394
+ }) => {
151395
+ const { customFields: tt } = await getCustomFields({ token: Be }).catch(() => ({
151396
+ customFields: {
151397
+ SardineClientID: void 0,
151398
+ SardineSessionKey: void 0,
151399
+ SardineUserID: void 0
151400
+ }
151401
+ }));
151402
+ shouldDoSardineContextFromSardine(tt) && (await loadSardineSDK(Le), sardineContext = createSardineContextFromSardine({
151403
+ sardineClientId: tt.SardineClientID,
151404
+ sardineSessionKey: tt.SardineSessionKey,
151405
+ sardineUserId: tt.SardineUserID,
151406
+ isSandbox: Le,
151407
+ token: Be,
151408
+ interviewId: Ye
151409
+ }));
151410
+ const nt = await getDeviceRiskModuleConfiguration(Be);
151411
+ return nt.enabled && nt.riskClientId && (await loadSardineSDK(!1), sardineContext = createSardineContextIncode({
151412
+ sardineClientId: nt.riskClientId,
151413
+ isSandbox: !1,
151414
+ token: Be,
151415
+ interviewId: Ye
151416
+ })), sardineContext;
151417
+ }, eventModuleNames = {
151307
151418
  selfie: "SELFIE",
151308
151419
  authFace: "AUTH_FACE",
151309
151420
  mlConsent: "ML_CONSENT",
@@ -151516,36 +151627,39 @@ function useModuleEvents({
151516
151627
  token: Ye,
151517
151628
  screen: tt
151518
151629
  }) {
151519
- useLayoutEffect(() => ((async () => {
151520
- const ft = await getModuleFeatureFlags(Be);
151521
- screenEvent({
151522
- module: Be,
151523
- screen: tt,
151524
- payload: {
151525
- ...Le,
151526
- ...ft
151527
- },
151528
- code: "moduleOpened",
151529
- token: Ye
151530
- });
151531
- })(), () => {
151532
- const ft = async () => {
151630
+ useLayoutEffect(() => {
151631
+ const nt = async () => {
151533
151632
  const ht = await getModuleFeatureFlags(Be);
151534
151633
  screenEvent({
151535
151634
  module: Be,
151635
+ screen: tt,
151536
151636
  payload: {
151537
151637
  ...Le,
151538
151638
  ...ht
151539
151639
  },
151540
- screen: tt,
151541
- code: "moduleClosed",
151640
+ code: "moduleOpened",
151542
151641
  token: Ye
151543
151642
  });
151643
+ }, ft = getSardineContext();
151644
+ return ft && ft.updateConfig({ flow: Be }), nt(), () => {
151645
+ const ht = async () => {
151646
+ const gt = await getModuleFeatureFlags(Be);
151647
+ screenEvent({
151648
+ module: Be,
151649
+ payload: {
151650
+ ...Le,
151651
+ ...gt
151652
+ },
151653
+ screen: tt,
151654
+ code: "moduleClosed",
151655
+ token: Ye
151656
+ });
151657
+ };
151658
+ setTimeout(() => {
151659
+ ht();
151660
+ }, 0);
151544
151661
  };
151545
- setTimeout(() => {
151546
- ft();
151547
- }, 0);
151548
- }), []);
151662
+ }, []);
151549
151663
  }
151550
151664
  const addScreenEvent = ({
151551
151665
  module: Be,
@@ -365776,11 +365890,6 @@ function renderForms(Be, { onSuccess: Le, onError: Ye, token: tt, interviewId: n
365776
365890
  function getConnectionDetails(Be) {
365777
365891
  return api.get(`/omni/queue/conference/connection-details?uuid=${Be}`).then((Le) => Le.data).catch((Le) => ({ error: `Error: ${Le}` }));
365778
365892
  }
365779
- const getCustomFields = ({ token: Be }) => api.get("/omni/get/custom-fields", {
365780
- headers: {
365781
- "X-Incode-Hardware-Id": Be
365782
- }
365783
- }).then((Le) => Le.data).catch((Le) => Promise.reject(Le.response.data));
365784
365893
  async function getInstantVerifyMissingModules({
365785
365894
  token: Be
365786
365895
  }) {
@@ -374582,113 +374691,6 @@ function renderRetrySteps(Be, {
374582
374691
  At
374583
374692
  );
374584
374693
  }
374585
- const getDeviceRiskModuleConfiguration = async (Be) => api.get("/omni/device-risk-client-id", {
374586
- headers: {
374587
- "X-Incode-Hardware-Id": Be
374588
- }
374589
- }).then((Ye) => Ye.data).catch(() => ({ enabled: !1 })), collectDeviceRiskResults = async (Be) => api.post(
374590
- "/omni/collect-device-risk-results",
374591
- null,
374592
- // no data/body is required
374593
- {
374594
- headers: {
374595
- "X-Incode-Hardware-Id": Be
374596
- }
374597
- }
374598
- ).then((Ye) => Ye.data).catch(() => ({})), shouldDoSardineContextFromSardine = (Be) => Be === void 0 ? !1 : typeof Be.SardineClientID == "string" && typeof Be.SardineSessionKey == "string" && typeof Be.SardineUserID == "string", loadSardineSDK = async (Be) => {
374599
- const Le = Be ? "api.sandbox.sardine.ai" : "api.sardine.ai", Ye = document.createElement("script");
374600
- return Ye.type = "text/javascript", Ye.async = !0, Ye.src = `https://${Le}/assets/loader.min.js`, new Promise((tt) => {
374601
- Ye.onload = () => tt();
374602
- const nt = document.getElementsByTagName("script")[0];
374603
- nt.parentNode.insertBefore(Ye, nt);
374604
- });
374605
- }, createSardineContextFromSardine = ({
374606
- sardineClientId: Be,
374607
- sardineSessionKey: Le,
374608
- sardineUserId: Ye,
374609
- isSandbox: tt,
374610
- token: nt,
374611
- interviewId: ft
374612
- }) => window._Sardine.createContext({
374613
- clientId: Be,
374614
- sessionKey: ft,
374615
- flow: `Landing page ${location.pathname}`,
374616
- environment: tt ? "sandbox" : "production",
374617
- parentElement: document.body,
374618
- parentSessionKey: Le,
374619
- userIdHash: Ye,
374620
- // called when sardine generates/restores deviceID for given device.
374621
- onDeviceResponse(ht) {
374622
- addEvent({
374623
- code: "externalRiskSDKInitialized",
374624
- payload: {
374625
- sardineData: {
374626
- deviceId: ht.deviceId,
374627
- uuid: ht.uuid
374628
- },
374629
- interviewId: ft,
374630
- sardineClientId: Be,
374631
- sardineSessionKey: Le,
374632
- sardineUserId: Ye
374633
- },
374634
- token: nt
374635
- });
374636
- }
374637
- }), createSardineContextIncode = ({
374638
- sardineClientId: Be,
374639
- isSandbox: Le,
374640
- token: Ye,
374641
- interviewId: tt
374642
- }) => window._Sardine.createContext({
374643
- clientId: Be,
374644
- sessionKey: tt,
374645
- flow: `Landing page ${location.pathname}`,
374646
- environment: "production",
374647
- parentElement: document.body,
374648
- userIdHash: tt,
374649
- onDeviceResponse(nt) {
374650
- addEvent({
374651
- code: "externalRiskSDKInitialized",
374652
- payload: {
374653
- sardineData: {
374654
- deviceId: nt.deviceId,
374655
- uuid: nt.uuid
374656
- },
374657
- interviewId: tt,
374658
- sardineClientId: Be
374659
- },
374660
- token: Ye
374661
- });
374662
- }
374663
- }), enableDeviceRiskModule = async ({
374664
- token: Be,
374665
- isSandbox: Le = !0,
374666
- interviewId: Ye
374667
- }) => {
374668
- const { customFields: tt } = await getCustomFields({ token: Be }).catch(() => ({
374669
- customFields: {
374670
- SardineClientID: void 0,
374671
- SardineSessionKey: void 0,
374672
- SardineUserID: void 0
374673
- }
374674
- }));
374675
- if (shouldDoSardineContextFromSardine(tt))
374676
- return await loadSardineSDK(Le), createSardineContextFromSardine({
374677
- sardineClientId: tt.SardineClientID,
374678
- sardineSessionKey: tt.SardineSessionKey,
374679
- sardineUserId: tt.SardineUserID,
374680
- isSandbox: Le,
374681
- token: Be,
374682
- interviewId: Ye
374683
- });
374684
- const nt = await getDeviceRiskModuleConfiguration(Be);
374685
- return nt.enabled && nt.riskClientId ? (await loadSardineSDK(!1), createSardineContextIncode({
374686
- sardineClientId: nt.riskClientId,
374687
- isSandbox: !1,
374688
- token: Be,
374689
- interviewId: Ye
374690
- })) : null;
374691
- };
374692
374694
  function sendEmail({ status: Be, token: Le }) {
374693
374695
  return api.post(
374694
374696
  "/omni/fanid/send-email",