vesant-sdk 2.0.0-dev.93ecc12 → 2.0.0-dev.9a74cc1

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.mts CHANGED
@@ -2,7 +2,7 @@ import { L as Logger } from './client-BolQlL5e.mjs';
2
2
  export { B as BaseClient, a as BaseClientConfig, C as CGSConfig, b as CircuitBreaker, c as CircuitBreakerConfig, d as CircuitBreakerState, e as CircuitBreakerStatus, f as RateLimitStatus, g as RateLimitTracker, h as RequestInterceptor, R as RequestOptions, i as RequiredBaseClientConfig, j as RequiredCGSConfig, k as RequiredVesantConfig, V as VesantConfig } from './client-BolQlL5e.mjs';
3
3
  import { B as BlockReason } from './types-CBQRNL-l.mjs';
4
4
  export { A as APIResponse, C as CustomerStatus, E as EntityType, b as ErrorResponse, L as LocationCompliance, a as PaginatedResponse, P as PaginationParams, c as Reason, d as Result, R as RiskLevel, S as SuccessResponse, T as Timestamp, U as UUID, V as VerificationEventType } from './types-CBQRNL-l.mjs';
5
- export { BaseWebhookEvent, ComplianceCheckFailedPayload, DecisionRecordedPayload, GeolocationBlockedPayload, GeolocationVerifiedPayload, KycStatusChangedPayload, LabelAppliedPayload, LocationRequestCompletedPayload, ProfileCreatedPayload, ProfileUpdatedPayload, RiskCategoryChangedPayload, RiskScoreChangedPayload, WebhookAnyHandler, WebhookEvent, WebhookEventHandler, WebhookEventType, WebhookHandler, WebhookHandlerConfig, WebhookMiddlewareOptions, createNextWebhookHandler, createWebhookMiddleware, verifyWebhookSignature } from './webhooks/index.mjs';
5
+ export { BaseWebhookEvent, ComplianceCheckFailedPayload, DecisionRecordedPayload, GeolocationBlockedPayload, GeolocationVerifiedPayload, KycStatusChangedPayload, LabelAppliedPayload, LocationRequestCompletedPayload, ProfileCreatedPayload, ProfileUpdatedPayload, RiskCategoryChangedPayload, RiskScoreChangedPayload, TaxReminderSentPayload, WebhookAnyHandler, WebhookEvent, WebhookEventHandler, WebhookEventType, WebhookHandler, WebhookHandlerConfig, WebhookMiddlewareOptions, createNextWebhookHandler, createWebhookMiddleware, verifyWebhookSignature } from './webhooks/index.mjs';
6
6
  export { A as APIError, d as AlertFilters, e as AlertListResponse, f as AlertSeverity, g as AlertStatus, h as AlertType, C as CipherTextCustomerData, i as CipherTextOptions, j as CipherTextPayload, k as CipherTextReason, l as CipherTextResult, m as ComplianceCheckResponse, n as CreateGeofenceRuleRequest, o as CreateJurisdictionRequest, p as CreateLocationRequestRequest, q as DashboardMetrics, r as DecryptedCipherText, s as DeviceFingerprint, D as DeviceFingerprintRequest, t as DeviceTrustResult, u as GeoIPResult, v as GeofenceAction, w as GeofenceEvaluation, x as GeofenceRule, y as GeofenceRuleType, z as GeolocationAlert, G as GeolocationClient, B as GeolocationClientConfig, E as GeolocationConfigResponse, F as GeolocationRecord, J as JurisdictionConfig, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, L as LocationVerification, R as ResendLocationRequestRequest, U as UpdateDeviceTrustRequest, P as UpdateGeofenceRuleRequest, Q as UpdateJurisdictionRequest, S as UseAlertsOptions, T as UseAlertsResult, W as UseGeolocationOptions, X as UseGeolocationResult, Y as UseLocationCaptureOptions, Z as UseLocationCaptureResult, _ as UseLocationRequestsOptions, $ as UseLocationRequestsResult, a0 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a1 as VerifyIPRequest, a2 as WiFiNetwork } from './client-BwkGrRW9.mjs';
7
7
  export { decodeCipherText, generateCipherText, isCipherTextExpired } from './geolocation/index.mjs';
8
8
  export { RiskProfileClient } from './risk-profile/index.mjs';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { L as Logger } from './client-BolQlL5e.js';
2
2
  export { B as BaseClient, a as BaseClientConfig, C as CGSConfig, b as CircuitBreaker, c as CircuitBreakerConfig, d as CircuitBreakerState, e as CircuitBreakerStatus, f as RateLimitStatus, g as RateLimitTracker, h as RequestInterceptor, R as RequestOptions, i as RequiredBaseClientConfig, j as RequiredCGSConfig, k as RequiredVesantConfig, V as VesantConfig } from './client-BolQlL5e.js';
3
3
  import { B as BlockReason } from './types-CBQRNL-l.js';
4
4
  export { A as APIResponse, C as CustomerStatus, E as EntityType, b as ErrorResponse, L as LocationCompliance, a as PaginatedResponse, P as PaginationParams, c as Reason, d as Result, R as RiskLevel, S as SuccessResponse, T as Timestamp, U as UUID, V as VerificationEventType } from './types-CBQRNL-l.js';
5
- export { BaseWebhookEvent, ComplianceCheckFailedPayload, DecisionRecordedPayload, GeolocationBlockedPayload, GeolocationVerifiedPayload, KycStatusChangedPayload, LabelAppliedPayload, LocationRequestCompletedPayload, ProfileCreatedPayload, ProfileUpdatedPayload, RiskCategoryChangedPayload, RiskScoreChangedPayload, WebhookAnyHandler, WebhookEvent, WebhookEventHandler, WebhookEventType, WebhookHandler, WebhookHandlerConfig, WebhookMiddlewareOptions, createNextWebhookHandler, createWebhookMiddleware, verifyWebhookSignature } from './webhooks/index.js';
5
+ export { BaseWebhookEvent, ComplianceCheckFailedPayload, DecisionRecordedPayload, GeolocationBlockedPayload, GeolocationVerifiedPayload, KycStatusChangedPayload, LabelAppliedPayload, LocationRequestCompletedPayload, ProfileCreatedPayload, ProfileUpdatedPayload, RiskCategoryChangedPayload, RiskScoreChangedPayload, TaxReminderSentPayload, WebhookAnyHandler, WebhookEvent, WebhookEventHandler, WebhookEventType, WebhookHandler, WebhookHandlerConfig, WebhookMiddlewareOptions, createNextWebhookHandler, createWebhookMiddleware, verifyWebhookSignature } from './webhooks/index.js';
6
6
  export { A as APIError, d as AlertFilters, e as AlertListResponse, f as AlertSeverity, g as AlertStatus, h as AlertType, C as CipherTextCustomerData, i as CipherTextOptions, j as CipherTextPayload, k as CipherTextReason, l as CipherTextResult, m as ComplianceCheckResponse, n as CreateGeofenceRuleRequest, o as CreateJurisdictionRequest, p as CreateLocationRequestRequest, q as DashboardMetrics, r as DecryptedCipherText, s as DeviceFingerprint, D as DeviceFingerprintRequest, t as DeviceTrustResult, u as GeoIPResult, v as GeofenceAction, w as GeofenceEvaluation, x as GeofenceRule, y as GeofenceRuleType, z as GeolocationAlert, G as GeolocationClient, B as GeolocationClientConfig, E as GeolocationConfigResponse, F as GeolocationRecord, J as JurisdictionConfig, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, L as LocationVerification, R as ResendLocationRequestRequest, U as UpdateDeviceTrustRequest, P as UpdateGeofenceRuleRequest, Q as UpdateJurisdictionRequest, S as UseAlertsOptions, T as UseAlertsResult, W as UseGeolocationOptions, X as UseGeolocationResult, Y as UseLocationCaptureOptions, Z as UseLocationCaptureResult, _ as UseLocationRequestsOptions, $ as UseLocationRequestsResult, a0 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a1 as VerifyIPRequest, a2 as WiFiNetwork } from './client-DvobLmsc.js';
7
7
  export { decodeCipherText, generateCipherText, isCipherTextExpired } from './geolocation/index.js';
8
8
  export { RiskProfileClient } from './risk-profile/index.js';
package/dist/react.js CHANGED
@@ -893,10 +893,10 @@ var Upload = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0i
893
893
  // src/kyc/FaceCaptureModal.tsx
894
894
  var MOBILE_UA = /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
895
895
  var LIVENESS_MESSAGES = [
896
- "Align your face in the oval",
897
- "Face too far. Please, move closer to the camera",
898
- "Looking good! Stay still...",
899
- "Processing liveness..."
896
+ "Position your face inside the circle",
897
+ "Make sure your face is well lit",
898
+ "Remove glasses or hats if possible",
899
+ "Look straight at the camera, then tap Capture"
900
900
  ];
901
901
  function headerSubtitle(stageKind) {
902
902
  switch (stageKind) {
@@ -905,7 +905,7 @@ function headerSubtitle(stageKind) {
905
905
  case "accepted":
906
906
  return "All set";
907
907
  case "declined":
908
- return "Verification didn't match \u2014 try once more";
908
+ return "Verification didn't match, try once more";
909
909
  case "max_attempts":
910
910
  return "We couldn't verify you";
911
911
  default:
@@ -1011,6 +1011,15 @@ function FaceCaptureModal({
1011
1011
  setStage({ kind: "submitting" });
1012
1012
  let settled = false;
1013
1013
  const ref = session.reference;
1014
+ const baselineAttempts = attempts;
1015
+ const isFreshPollResult = (r) => {
1016
+ if (r.status === "accepted") return true;
1017
+ if (r.status === "declined") {
1018
+ const derivedAttempts = maxAttempts - (r.data?.retries_remaining ?? 0);
1019
+ return derivedAttempts > baselineAttempts;
1020
+ }
1021
+ return false;
1022
+ };
1014
1023
  try {
1015
1024
  const postPromise = (async () => {
1016
1025
  try {
@@ -1031,7 +1040,7 @@ function FaceCaptureModal({
1031
1040
  if (settled || cancelledRef.current) return null;
1032
1041
  try {
1033
1042
  const r = await client.getReuseKycSessionStatus(ref);
1034
- if (r.status === "accepted" || r.status === "declined") return r;
1043
+ if (isFreshPollResult(r)) return r;
1035
1044
  } catch {
1036
1045
  }
1037
1046
  if (settled || cancelledRef.current) return null;
@@ -1182,6 +1191,7 @@ var keyframes = `
1182
1191
  @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
1183
1192
  @keyframes zoomIn { from { transform: scale(.96); opacity: 0 } to { transform: scale(1); opacity: 1 } }
1184
1193
  @keyframes spin { to { transform: rotate(360deg) } }
1194
+ @keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }
1185
1195
  `;
1186
1196
  var overlayStyle = {
1187
1197
  position: "fixed",
@@ -1429,7 +1439,7 @@ function LiveCamera({ onCapture, onCancel, message }) {
1429
1439
  autoPlay: true,
1430
1440
  style: videoStyle
1431
1441
  }
1432
- ), /* @__PURE__ */ React__default.default.createElement("div", { style: faceOvalOverlayStyle, "aria-hidden": "true" }), !ready && /* @__PURE__ */ React__default.default.createElement("div", { style: videoLoadingStyle }, "Starting camera\u2026")), message && /* @__PURE__ */ React__default.default.createElement("p", { style: livenessMessageStyle }, message), /* @__PURE__ */ React__default.default.createElement("div", { style: buttonsContainerStyle }, /* @__PURE__ */ React__default.default.createElement(
1442
+ ), /* @__PURE__ */ React__default.default.createElement("div", { style: faceOverlayContainerStyle, "aria-hidden": "true" }, /* @__PURE__ */ React__default.default.createElement("div", { style: faceRingWrapStyle }, /* @__PURE__ */ React__default.default.createElement("div", { style: faceDashedRingStyle }), /* @__PURE__ */ React__default.default.createElement("div", { style: faceCircleStyle }))), message && /* @__PURE__ */ React__default.default.createElement("div", { style: liveMessagePillContainerStyle }, /* @__PURE__ */ React__default.default.createElement("div", { style: liveMessagePillStyle }, /* @__PURE__ */ React__default.default.createElement("span", { style: liveMessagePillTextStyle }, message))), !ready && /* @__PURE__ */ React__default.default.createElement("div", { style: videoLoadingStyle }, "Starting camera\u2026")), /* @__PURE__ */ React__default.default.createElement("div", { style: buttonsContainerStyle }, /* @__PURE__ */ React__default.default.createElement(
1433
1443
  "button",
1434
1444
  {
1435
1445
  style: ready ? primaryButtonStyle : { ...primaryButtonStyle, opacity: 0.5, cursor: "not-allowed" },
@@ -1455,13 +1465,32 @@ var videoStyle = {
1455
1465
  transform: "scaleX(-1)"
1456
1466
  // mirror so the preview matches the user's POV
1457
1467
  };
1458
- var faceOvalOverlayStyle = {
1468
+ var faceOverlayContainerStyle = {
1459
1469
  position: "absolute",
1460
1470
  inset: 0,
1461
1471
  pointerEvents: "none",
1462
- background: "radial-gradient(ellipse 38% 50% at center, transparent 60%, rgba(15, 23, 42, 0.55) 62%)",
1463
- border: "2px solid rgba(0, 188, 125, 0.6)",
1464
- borderRadius: 12
1472
+ display: "flex",
1473
+ alignItems: "center",
1474
+ justifyContent: "center"
1475
+ };
1476
+ var faceRingWrapStyle = {
1477
+ position: "relative",
1478
+ width: "72%",
1479
+ aspectRatio: "1 / 1"
1480
+ };
1481
+ var faceDashedRingStyle = {
1482
+ position: "absolute",
1483
+ inset: -6,
1484
+ borderRadius: "50%",
1485
+ border: "6px dashed rgba(255, 255, 255, 0.4)",
1486
+ animation: "spin 10s linear infinite"
1487
+ };
1488
+ var faceCircleStyle = {
1489
+ position: "absolute",
1490
+ inset: 0,
1491
+ borderRadius: "50%",
1492
+ border: "4px solid #00bc7d",
1493
+ boxShadow: "0 0 0 1000px rgba(0, 0, 0, 0.5)"
1465
1494
  };
1466
1495
  var videoLoadingStyle = {
1467
1496
  position: "absolute",
@@ -1473,16 +1502,29 @@ var videoLoadingStyle = {
1473
1502
  fontSize: 14,
1474
1503
  fontWeight: 500
1475
1504
  };
1476
- var livenessMessageStyle = {
1477
- margin: 0,
1505
+ var liveMessagePillContainerStyle = {
1506
+ position: "absolute",
1507
+ top: 12,
1508
+ left: "50%",
1509
+ transform: "translateX(-50%)",
1510
+ maxWidth: "84%",
1511
+ pointerEvents: "none"
1512
+ };
1513
+ var liveMessagePillStyle = {
1514
+ background: "rgba(0, 0, 0, 0.7)",
1515
+ backdropFilter: "blur(6px)",
1516
+ border: "1px solid rgba(255, 255, 255, 0.2)",
1517
+ borderRadius: 999,
1518
+ padding: "6px 12px",
1478
1519
  textAlign: "center",
1479
- fontSize: 13,
1520
+ boxShadow: "0 10px 25px -5px rgba(0,0,0,.3)"
1521
+ };
1522
+ var liveMessagePillTextStyle = {
1523
+ margin: 0,
1524
+ fontSize: 12,
1480
1525
  fontWeight: 500,
1481
- color: "#374151",
1482
- background: "rgba(0, 188, 125, 0.08)",
1483
- border: "1px solid rgba(0, 188, 125, 0.25)",
1484
- borderRadius: 8,
1485
- padding: "8px 12px"
1526
+ color: "#ffffff",
1527
+ animation: "pulse 2s ease-in-out infinite"
1486
1528
  };
1487
1529
  var FaceCaptureModal_default = FaceCaptureModal;
1488
1530