@neofaceid/web-sdk 1.38.2 → 1.39.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.
package/dist/index.d.ts CHANGED
@@ -180,14 +180,6 @@ declare interface BiometricCaptureOptions {
180
180
  autoLighting?: boolean;
181
181
  }
182
182
 
183
- /**
184
- * Função de conveniência para login biométrico simples
185
- * @param applicationToken Token da aplicação
186
- * @param mode Modo de captura ('face', 'hand' ou 'auto')
187
- * @returns Promise que resolve com o resultado do login
188
- */
189
- export declare function biometricLogin(applicationToken: string, mode?: 'face' | 'hand' | 'auto'): Promise<BiometricLoginResult>;
190
-
191
183
  export declare interface BiometricLoginOptions {
192
184
  applicationToken: string;
193
185
  /**
@@ -229,14 +221,6 @@ declare const BiometricLoginResultSchema: z.ZodObject<{
229
221
  message: z.ZodOptional<z.ZodString>;
230
222
  }, z.core.$strip>;
231
223
 
232
- /**
233
- * Inicia o processo de login biométrico com fallback para email e senha se não houver match (assumindo purpose LOGIN).
234
- * @param applicationToken Token da aplicação
235
- * @param mode Modo de captura ('face', 'hand' ou 'auto')
236
- * @returns Promise que resolve com o resultado do login
237
- */
238
- export declare function biometricLoginWithFallback(applicationToken: string, mode?: 'face' | 'hand' | 'auto'): Promise<BiometricLoginResult>;
239
-
240
224
  declare interface BiometricRegistrationCallbacks {
241
225
  onSuccess(result: BiometricRegistrationResult): void;
242
226
  onError(code: string, message: string): void;
@@ -1722,7 +1706,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
1722
1706
  * MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
1723
1707
  * PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
1724
1708
  */
1725
- export declare const VERSION = "1.38.2";
1709
+ export declare const VERSION = "1.39.0";
1726
1710
 
1727
1711
  /**
1728
1712
  * Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),
@@ -6760,6 +6760,62 @@ const NEOFACEID_MARK_MONO_SVG = markMonoSvg;
6760
6760
  function brandMarkMono(sizePx = 18) {
6761
6761
  return `<span class="neoface-brand-mark" style="display:inline-flex;align-items:center;justify-content:center;width:${sizePx}px;height:${sizePx}px;color:currentColor;">${markMonoSvg}</span>`;
6762
6762
  }
6763
+ const CONTAINER_BASE = {
6764
+ display: "flex",
6765
+ alignItems: "center",
6766
+ justifyContent: "center",
6767
+ gap: 6,
6768
+ color: "var(--nfid-text-subtle)",
6769
+ fontFamily: "inherit",
6770
+ lineHeight: 1
6771
+ };
6772
+ const MARK_BASE = {
6773
+ display: "inline-flex",
6774
+ alignItems: "center",
6775
+ justifyContent: "center",
6776
+ color: "currentColor"
6777
+ };
6778
+ const NAME_STYLE = {
6779
+ fontSize: 12,
6780
+ fontWeight: 600,
6781
+ letterSpacing: 0.2,
6782
+ color: "var(--nfid-text-muted)"
6783
+ };
6784
+ const BY_STYLE = {
6785
+ fontSize: 9,
6786
+ fontWeight: 400,
6787
+ color: "var(--nfid-text-subtle)",
6788
+ opacity: 0.75
6789
+ };
6790
+ const ORG_STYLE = {
6791
+ fontSize: 9,
6792
+ fontWeight: 500,
6793
+ color: "var(--nfid-text-subtle)",
6794
+ opacity: 0.75
6795
+ };
6796
+ function BrandFooter({ size = 16, style }) {
6797
+ return /* @__PURE__ */ jsxs("div", { className: "neofaceid-brand-footer", style: { ...CONTAINER_BASE, ...style }, children: [
6798
+ /* @__PURE__ */ jsx(
6799
+ "span",
6800
+ {
6801
+ "aria-hidden": "true",
6802
+ style: { ...MARK_BASE, width: size, height: size },
6803
+ dangerouslySetInnerHTML: { __html: NEOFACEID_MARK_MONO_SVG }
6804
+ }
6805
+ ),
6806
+ /* @__PURE__ */ jsx("span", { style: NAME_STYLE, children: "NeoFaceID" }),
6807
+ /* @__PURE__ */ jsx("span", { style: BY_STYLE, children: "by" }),
6808
+ /* @__PURE__ */ jsx("span", { style: ORG_STYLE, children: "Octa" })
6809
+ ] });
6810
+ }
6811
+ function renderBrandFooter(size = 16) {
6812
+ const containerCss = "display:flex;align-items:center;justify-content:center;gap:6px;color:var(--nfid-text-subtle);font-family:inherit;line-height:1;";
6813
+ const markCss = `display:inline-flex;align-items:center;justify-content:center;color:currentColor;width:${size}px;height:${size}px;`;
6814
+ const nameCss = "font-size:12px;font-weight:600;letter-spacing:0.2px;color:var(--nfid-text-muted);";
6815
+ const byCss = "font-size:9px;font-weight:400;color:var(--nfid-text-subtle);opacity:0.75;";
6816
+ const orgCss = "font-size:9px;font-weight:500;color:var(--nfid-text-subtle);opacity:0.75;";
6817
+ return `<div class="neofaceid-brand-footer" style="${containerCss}"><span aria-hidden="true" style="${markCss}">${NEOFACEID_MARK_MONO_SVG}</span><span style="${nameCss}">NeoFaceID</span><span style="${byCss}">by</span><span style="${orgCss}">Octa</span></div>`;
6818
+ }
6763
6819
  class ForgotPasswordModal {
6764
6820
  constructor(applicationToken) {
6765
6821
  __publicField(this, "applicationToken");
@@ -6819,9 +6875,7 @@ class ForgotPasswordModal {
6819
6875
  </button>
6820
6876
 
6821
6877
  <div class="neoface-forgot-branding">
6822
- ${brandMarkMono(18)}
6823
- <span>NeoFaceId by</span>
6824
- <span class="neoface-forgot-brand-name">OCTA</span>
6878
+ ${renderBrandFooter()}
6825
6879
  </div>
6826
6880
  </div>
6827
6881
  </div>
@@ -6854,9 +6908,7 @@ class ForgotPasswordModal {
6854
6908
  </button>
6855
6909
 
6856
6910
  <div class="neoface-forgot-branding">
6857
- ${brandMarkMono(18)}
6858
- <span>NeoFaceId by</span>
6859
- <span class="neoface-forgot-brand-name">OCTA</span>
6911
+ ${renderBrandFooter()}
6860
6912
  </div>
6861
6913
  `;
6862
6914
  const closeBtn = content.querySelector(".neoface-forgot-close-success");
@@ -7753,18 +7805,7 @@ function BiometricRegistrationModal({
7753
7805
  children: "Não consigo fazer esse movimento"
7754
7806
  }
7755
7807
  ),
7756
- /* @__PURE__ */ jsxs("div", { className: "branding-small", children: [
7757
- /* @__PURE__ */ jsx(
7758
- "span",
7759
- {
7760
- className: "brand-logo-small",
7761
- style: { display: "inline-flex", width: 18, height: 18, color: "currentColor" },
7762
- dangerouslySetInnerHTML: { __html: NEOFACEID_MARK_MONO_SVG }
7763
- }
7764
- ),
7765
- /* @__PURE__ */ jsx("span", { children: "NeoFaceId by" }),
7766
- /* @__PURE__ */ jsx("span", { className: "brand-name", children: "OCTA" })
7767
- ] })
7808
+ /* @__PURE__ */ jsx("div", { className: "branding-small", children: /* @__PURE__ */ jsx(BrandFooter, {}) })
7768
7809
  ] });
7769
7810
  };
7770
7811
  const renderProcessing = () => /* @__PURE__ */ jsxs("div", { className: "processing-container", children: [
@@ -7774,7 +7815,7 @@ function BiometricRegistrationModal({
7774
7815
  ] }),
7775
7816
  /* @__PURE__ */ jsx("h3", { children: "Processando biometria" }),
7776
7817
  /* @__PURE__ */ jsx("p", { children: "Analisando suas capturas faciais..." }),
7777
- /* @__PURE__ */ jsxs(
7818
+ /* @__PURE__ */ jsx(
7778
7819
  "div",
7779
7820
  {
7780
7821
  className: "branding",
@@ -7783,10 +7824,7 @@ function BiometricRegistrationModal({
7783
7824
  paddingTop: "24px",
7784
7825
  borderTop: "1px solid rgba(255, 255, 255, 0.1)"
7785
7826
  },
7786
- children: [
7787
- /* @__PURE__ */ jsx("span", { children: "NeoFaceId by" }),
7788
- /* @__PURE__ */ jsx("span", { className: "brand-name", children: "OCTA" })
7789
- ]
7827
+ children: /* @__PURE__ */ jsx(BrandFooter, {})
7790
7828
  }
7791
7829
  )
7792
7830
  ] });
@@ -7828,7 +7866,7 @@ function BiometricRegistrationModal({
7828
7866
  ] }),
7829
7867
  /* @__PURE__ */ jsx("h3", { children: "Inicializando câmera" }),
7830
7868
  /* @__PURE__ */ jsx("p", { children: "Aguarde enquanto preparamos a câmera..." }),
7831
- /* @__PURE__ */ jsxs(
7869
+ /* @__PURE__ */ jsx(
7832
7870
  "div",
7833
7871
  {
7834
7872
  className: "branding",
@@ -7837,10 +7875,7 @@ function BiometricRegistrationModal({
7837
7875
  paddingTop: "24px",
7838
7876
  borderTop: "1px solid rgba(255, 255, 255, 0.1)"
7839
7877
  },
7840
- children: [
7841
- /* @__PURE__ */ jsx("span", { children: "NeoFaceId by" }),
7842
- /* @__PURE__ */ jsx("span", { className: "brand-name", children: "OCTA" })
7843
- ]
7878
+ children: /* @__PURE__ */ jsx(BrandFooter, {})
7844
7879
  }
7845
7880
  )
7846
7881
  ] });
@@ -7907,7 +7942,7 @@ function BiometricRegistrationModal({
7907
7942
  )
7908
7943
  ] })
7909
7944
  ] }),
7910
- /* @__PURE__ */ jsxs(
7945
+ /* @__PURE__ */ jsx(
7911
7946
  "div",
7912
7947
  {
7913
7948
  className: "branding",
@@ -7917,18 +7952,7 @@ function BiometricRegistrationModal({
7917
7952
  borderTop: "1px solid rgba(255, 255, 255, 0.08)",
7918
7953
  width: "100%"
7919
7954
  },
7920
- children: [
7921
- /* @__PURE__ */ jsx(
7922
- "span",
7923
- {
7924
- className: "brand-logo",
7925
- style: { display: "inline-flex", width: 18, height: 18, color: "currentColor" },
7926
- dangerouslySetInnerHTML: { __html: NEOFACEID_MARK_MONO_SVG }
7927
- }
7928
- ),
7929
- /* @__PURE__ */ jsx("span", { children: "NeoFaceId by" }),
7930
- /* @__PURE__ */ jsx("span", { className: "brand-name", children: "OCTA" })
7931
- ]
7955
+ children: /* @__PURE__ */ jsx(BrandFooter, {})
7932
7956
  }
7933
7957
  )
7934
7958
  ] });
@@ -8909,7 +8933,7 @@ function ConsentModalComponent({
8909
8933
  }
8910
8934
  )
8911
8935
  ] }),
8912
- /* @__PURE__ */ jsx("div", { className: "neofaceid-consent-footer", children: /* @__PURE__ */ jsx("span", { className: "neofaceid-consent-seal", children: "Protegido por NeoFaceID" }) })
8936
+ /* @__PURE__ */ jsx("div", { className: "neofaceid-consent-footer", children: /* @__PURE__ */ jsx(BrandFooter, {}) })
8913
8937
  ] }) })
8914
8938
  ] });
8915
8939
  }
@@ -9170,7 +9194,7 @@ class BiometricCaptureModal {
9170
9194
  <button class="neofaceid-capture-btn" type="button" disabled>Capturar</button>
9171
9195
  </div>
9172
9196
  <div class="neofaceid-seal-row">
9173
- <span class="neofaceid-seal">Protegido por NeoFaceID</span>
9197
+ ${renderBrandFooter()}
9174
9198
  </div>
9175
9199
  </div>
9176
9200
  </div>
@@ -10143,9 +10167,7 @@ class EmailPasswordModal {
10143
10167
 
10144
10168
  <!-- Branding -->
10145
10169
  <div class="neoface-email-branding">
10146
- ${brandMarkMono(18)}
10147
- <span>NeoFaceId by</span>
10148
- <span class="neoface-email-brand-name">OCTA</span>
10170
+ ${renderBrandFooter()}
10149
10171
  </div>
10150
10172
  </div>
10151
10173
  </div>
@@ -10972,64 +10994,6 @@ async function startAutoLogin(options) {
10972
10994
  );
10973
10995
  }
10974
10996
  }
10975
- function biometricLogin(applicationToken, mode = "auto") {
10976
- return new Promise((resolve, reject) => {
10977
- const options = {
10978
- applicationToken,
10979
- onSuccess: resolve,
10980
- onError: reject
10981
- };
10982
- switch (mode) {
10983
- case "face":
10984
- startFaceLogin(options);
10985
- break;
10986
- case "hand":
10987
- startHandLogin(options);
10988
- break;
10989
- case "auto":
10990
- startAutoLogin(options);
10991
- break;
10992
- default:
10993
- reject(new NeoFaceError("Modo de login inválido", ErrorType.VALIDATION_ERROR));
10994
- }
10995
- });
10996
- }
10997
- function biometricLoginWithFallback(applicationToken, mode = "auto") {
10998
- return new Promise((resolve, reject) => {
10999
- const options = {
11000
- applicationToken,
11001
- onSuccess: resolve,
11002
- onError: (error) => {
11003
- if (error.type === ErrorType.LOGIN_FAILED) {
11004
- const fallbackOptions = {
11005
- applicationToken,
11006
- onSuccess: resolve,
11007
- onError: reject,
11008
- title: "Login Alternativo",
11009
- subtitle: "Biometria não reconhecida. Por favor, informe email e senha."
11010
- };
11011
- const modal = new EmailPasswordModal(fallbackOptions);
11012
- modal.open();
11013
- } else {
11014
- reject(error);
11015
- }
11016
- }
11017
- };
11018
- switch (mode) {
11019
- case "face":
11020
- startFaceLogin(options);
11021
- break;
11022
- case "hand":
11023
- startHandLogin(options);
11024
- break;
11025
- case "auto":
11026
- startAutoLogin(options);
11027
- break;
11028
- default:
11029
- reject(new NeoFaceError("Modo de login inválido", ErrorType.VALIDATION_ERROR));
11030
- }
11031
- });
11032
- }
11033
10997
  async function detectBiometricType(imageData) {
11034
10998
  try {
11035
10999
  const img = await loadImageFromBase64(imageData);
@@ -11199,7 +11163,7 @@ const biometricDetection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
11199
11163
  initializeBiometricDetection,
11200
11164
  isAdvancedDetectionAvailable
11201
11165
  }, Symbol.toStringTag, { value: "Module" }));
11202
- const VERSION = "1.38.2";
11166
+ const VERSION = "1.39.0";
11203
11167
  const RELEASE_DATE = "2026-09-06";
11204
11168
  let cachedSession = null;
11205
11169
  function getCachedCaptureSession() {
@@ -11537,7 +11501,7 @@ class OnboardingCaptureModal {
11537
11501
  <button class="neofaceid-capture-btn" disabled>Capturar</button>
11538
11502
  </div>
11539
11503
  <div class="neofaceid-seal-row">
11540
- <span class="neofaceid-seal">Protegido por NeoFaceID</span>
11504
+ ${renderBrandFooter()}
11541
11505
  </div>
11542
11506
  </div>
11543
11507
  `;
@@ -13069,7 +13033,7 @@ function AuthorizeModalComponent({
13069
13033
  ] }),
13070
13034
  phase === "preparing" && /* @__PURE__ */ jsx("p", { className: "nfid-authorize-support", children: "Ligando sua câmera…" }),
13071
13035
  /* @__PURE__ */ jsx("div", { className: "nfid-authorize-actions", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleClose, children: "Não consigo fazer esse movimento" }) }),
13072
- /* @__PURE__ */ jsx("div", { className: "nfid-authorize-footer", children: /* @__PURE__ */ jsx("span", { className: "nfid-authorize-seal", children: "Protegido por NeoFaceID" }) })
13036
+ /* @__PURE__ */ jsx("div", { className: "nfid-authorize-footer", children: /* @__PURE__ */ jsx(BrandFooter, {}) })
13073
13037
  ] })
13074
13038
  ] });
13075
13039
  }
@@ -13396,10 +13360,7 @@ class DocumentCaptureModal {
13396
13360
  renderBranding() {
13397
13361
  return `
13398
13362
  <div class="neoface-doc-branding">
13399
- ${brandMarkMono(18)}
13400
- <span class="neoface-doc-brand-name-text">NeoFaceId</span>
13401
- <span class="neoface-doc-brand-text">by</span>
13402
- <span class="neoface-doc-brand-name">OCTA</span>
13363
+ ${renderBrandFooter()}
13403
13364
  </div>
13404
13365
  `;
13405
13366
  }
@@ -14300,8 +14261,6 @@ export {
14300
14261
  VERSION,
14301
14262
  authorize,
14302
14263
  authorizeOperation,
14303
- biometricLogin,
14304
- biometricLoginWithFallback,
14305
14264
  checkUserExistence,
14306
14265
  completeOnboarding,
14307
14266
  completeOnboardingWithData,