@kwik-id/sdk-react-native 0.0.0-stage → 0.1.0-alpha.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/LICENSE +22 -0
- package/README.md +81 -2
- package/app.plugin.js +40 -0
- package/lib/commonjs/api/api-client.js +213 -0
- package/lib/commonjs/api/api-client.js.map +1 -0
- package/lib/commonjs/api/api-error.js +29 -0
- package/lib/commonjs/api/api-error.js.map +1 -0
- package/lib/commonjs/api/index.js +33 -0
- package/lib/commonjs/api/index.js.map +1 -0
- package/lib/commonjs/api/upload.js +74 -0
- package/lib/commonjs/api/upload.js.map +1 -0
- package/lib/commonjs/camera/camera-view.js +227 -0
- package/lib/commonjs/camera/camera-view.js.map +1 -0
- package/lib/commonjs/camera/index.js +20 -0
- package/lib/commonjs/camera/index.js.map +1 -0
- package/lib/commonjs/camera/photo-capture.js +50 -0
- package/lib/commonjs/camera/photo-capture.js.map +1 -0
- package/lib/commonjs/crypto/fingerprint.js +43 -0
- package/lib/commonjs/crypto/fingerprint.js.map +1 -0
- package/lib/commonjs/crypto/hmac.js +150 -0
- package/lib/commonjs/crypto/hmac.js.map +1 -0
- package/lib/commonjs/crypto/index.js +39 -0
- package/lib/commonjs/crypto/index.js.map +1 -0
- package/lib/commonjs/crypto/session-manager.js +173 -0
- package/lib/commonjs/crypto/session-manager.js.map +1 -0
- package/lib/commonjs/i18n/en.js +297 -0
- package/lib/commonjs/i18n/en.js.map +1 -0
- package/lib/commonjs/i18n/fr.js +294 -0
- package/lib/commonjs/i18n/fr.js.map +1 -0
- package/lib/commonjs/i18n/index.js +34 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/locale.js +20 -0
- package/lib/commonjs/i18n/locale.js.map +1 -0
- package/lib/commonjs/i18n/translator.js +37 -0
- package/lib/commonjs/i18n/translator.js.map +1 -0
- package/lib/commonjs/index.js +187 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/lib/device-detector.js +34 -0
- package/lib/commonjs/lib/device-detector.js.map +1 -0
- package/lib/commonjs/lib/event-emitter.js +85 -0
- package/lib/commonjs/lib/event-emitter.js.map +1 -0
- package/lib/commonjs/lib/index.js +63 -0
- package/lib/commonjs/lib/index.js.map +1 -0
- package/lib/commonjs/lib/kwik-id-rn-sdk.js +156 -0
- package/lib/commonjs/lib/kwik-id-rn-sdk.js.map +1 -0
- package/lib/commonjs/lib/verification-machine.js +276 -0
- package/lib/commonjs/lib/verification-machine.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types/events.js +6 -0
- package/lib/commonjs/types/events.js.map +1 -0
- package/lib/commonjs/types/index.js +2 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/ui/components/KwikIDVerificationModal.js +407 -0
- package/lib/commonjs/ui/components/KwikIDVerificationModal.js.map +1 -0
- package/lib/commonjs/ui/components/screens.js +338 -0
- package/lib/commonjs/ui/components/screens.js.map +1 -0
- package/lib/commonjs/ui/context/kwik-id-provider.js +52 -0
- package/lib/commonjs/ui/context/kwik-id-provider.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-kwik-verification.js +77 -0
- package/lib/commonjs/ui/hooks/use-kwik-verification.js.map +1 -0
- package/lib/commonjs/ui/index.js +33 -0
- package/lib/commonjs/ui/index.js.map +1 -0
- package/lib/module/api/api-client.js +208 -0
- package/lib/module/api/api-client.js.map +1 -0
- package/lib/module/api/api-error.js +24 -0
- package/lib/module/api/api-error.js.map +1 -0
- package/lib/module/api/index.js +6 -0
- package/lib/module/api/index.js.map +1 -0
- package/lib/module/api/upload.js +68 -0
- package/lib/module/api/upload.js.map +1 -0
- package/lib/module/camera/camera-view.js +222 -0
- package/lib/module/camera/camera-view.js.map +1 -0
- package/lib/module/camera/index.js +5 -0
- package/lib/module/camera/index.js.map +1 -0
- package/lib/module/camera/photo-capture.js +45 -0
- package/lib/module/camera/photo-capture.js.map +1 -0
- package/lib/module/crypto/fingerprint.js +37 -0
- package/lib/module/crypto/fingerprint.js.map +1 -0
- package/lib/module/crypto/hmac.js +143 -0
- package/lib/module/crypto/hmac.js.map +1 -0
- package/lib/module/crypto/index.js +6 -0
- package/lib/module/crypto/index.js.map +1 -0
- package/lib/module/crypto/session-manager.js +169 -0
- package/lib/module/crypto/session-manager.js.map +1 -0
- package/lib/module/i18n/en.js +293 -0
- package/lib/module/i18n/en.js.map +1 -0
- package/lib/module/i18n/fr.js +290 -0
- package/lib/module/i18n/fr.js.map +1 -0
- package/lib/module/i18n/index.js +11 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/locale.js +15 -0
- package/lib/module/i18n/locale.js.map +1 -0
- package/lib/module/i18n/translator.js +34 -0
- package/lib/module/i18n/translator.js.map +1 -0
- package/lib/module/index.js +30 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lib/device-detector.js +26 -0
- package/lib/module/lib/device-detector.js.map +1 -0
- package/lib/module/lib/event-emitter.js +80 -0
- package/lib/module/lib/event-emitter.js.map +1 -0
- package/lib/module/lib/index.js +6 -0
- package/lib/module/lib/index.js.map +1 -0
- package/lib/module/lib/kwik-id-rn-sdk.js +150 -0
- package/lib/module/lib/kwik-id-rn-sdk.js.map +1 -0
- package/lib/module/lib/verification-machine.js +268 -0
- package/lib/module/lib/verification-machine.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types/events.js +4 -0
- package/lib/module/types/events.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/ui/components/KwikIDVerificationModal.js +402 -0
- package/lib/module/ui/components/KwikIDVerificationModal.js.map +1 -0
- package/lib/module/ui/components/screens.js +328 -0
- package/lib/module/ui/components/screens.js.map +1 -0
- package/lib/module/ui/context/kwik-id-provider.js +46 -0
- package/lib/module/ui/context/kwik-id-provider.js.map +1 -0
- package/lib/module/ui/hooks/use-kwik-verification.js +72 -0
- package/lib/module/ui/hooks/use-kwik-verification.js.map +1 -0
- package/lib/module/ui/index.js +6 -0
- package/lib/module/ui/index.js.map +1 -0
- package/lib/typescript/commonjs/api/api-client.d.ts +82 -0
- package/lib/typescript/commonjs/api/api-client.d.ts.map +1 -0
- package/lib/typescript/commonjs/api/api-error.d.ts +13 -0
- package/lib/typescript/commonjs/api/api-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/api/index.d.ts +6 -0
- package/lib/typescript/commonjs/api/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/api/upload.d.ts +19 -0
- package/lib/typescript/commonjs/api/upload.d.ts.map +1 -0
- package/lib/typescript/commonjs/camera/camera-view.d.ts +25 -0
- package/lib/typescript/commonjs/camera/camera-view.d.ts.map +1 -0
- package/lib/typescript/commonjs/camera/index.d.ts +5 -0
- package/lib/typescript/commonjs/camera/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/camera/photo-capture.d.ts +9 -0
- package/lib/typescript/commonjs/camera/photo-capture.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/fingerprint.d.ts +3 -0
- package/lib/typescript/commonjs/crypto/fingerprint.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/hmac.d.ts +18 -0
- package/lib/typescript/commonjs/crypto/hmac.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/index.d.ts +4 -0
- package/lib/typescript/commonjs/crypto/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/session-manager.d.ts +27 -0
- package/lib/typescript/commonjs/crypto/session-manager.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/en.d.ts +291 -0
- package/lib/typescript/commonjs/i18n/en.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/fr.d.ts +6 -0
- package/lib/typescript/commonjs/i18n/fr.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/index.d.ts +10 -0
- package/lib/typescript/commonjs/i18n/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/locale.d.ts +4 -0
- package/lib/typescript/commonjs/i18n/locale.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/translator.d.ts +15 -0
- package/lib/typescript/commonjs/i18n/translator.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +24 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/lib/device-detector.d.ts +5 -0
- package/lib/typescript/commonjs/lib/device-detector.d.ts.map +1 -0
- package/lib/typescript/commonjs/lib/event-emitter.d.ts +19 -0
- package/lib/typescript/commonjs/lib/event-emitter.d.ts.map +1 -0
- package/lib/typescript/commonjs/lib/index.d.ts +5 -0
- package/lib/typescript/commonjs/lib/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/lib/kwik-id-rn-sdk.d.ts +43 -0
- package/lib/typescript/commonjs/lib/kwik-id-rn-sdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/lib/verification-machine.d.ts +78 -0
- package/lib/typescript/commonjs/lib/verification-machine.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/types/events.d.ts +94 -0
- package/lib/typescript/commonjs/types/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/index.d.ts +242 -0
- package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/KwikIDVerificationModal.d.ts +21 -0
- package/lib/typescript/commonjs/ui/components/KwikIDVerificationModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/screens.d.ts +46 -0
- package/lib/typescript/commonjs/ui/components/screens.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/kwik-id-provider.d.ts +19 -0
- package/lib/typescript/commonjs/ui/context/kwik-id-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/use-kwik-verification.d.ts +29 -0
- package/lib/typescript/commonjs/ui/hooks/use-kwik-verification.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/index.d.ts +7 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -0
- package/lib/typescript/module/api/api-client.d.ts +82 -0
- package/lib/typescript/module/api/api-client.d.ts.map +1 -0
- package/lib/typescript/module/api/api-error.d.ts +13 -0
- package/lib/typescript/module/api/api-error.d.ts.map +1 -0
- package/lib/typescript/module/api/index.d.ts +6 -0
- package/lib/typescript/module/api/index.d.ts.map +1 -0
- package/lib/typescript/module/api/upload.d.ts +19 -0
- package/lib/typescript/module/api/upload.d.ts.map +1 -0
- package/lib/typescript/module/camera/camera-view.d.ts +25 -0
- package/lib/typescript/module/camera/camera-view.d.ts.map +1 -0
- package/lib/typescript/module/camera/index.d.ts +5 -0
- package/lib/typescript/module/camera/index.d.ts.map +1 -0
- package/lib/typescript/module/camera/photo-capture.d.ts +9 -0
- package/lib/typescript/module/camera/photo-capture.d.ts.map +1 -0
- package/lib/typescript/module/crypto/fingerprint.d.ts +3 -0
- package/lib/typescript/module/crypto/fingerprint.d.ts.map +1 -0
- package/lib/typescript/module/crypto/hmac.d.ts +18 -0
- package/lib/typescript/module/crypto/hmac.d.ts.map +1 -0
- package/lib/typescript/module/crypto/index.d.ts +4 -0
- package/lib/typescript/module/crypto/index.d.ts.map +1 -0
- package/lib/typescript/module/crypto/session-manager.d.ts +27 -0
- package/lib/typescript/module/crypto/session-manager.d.ts.map +1 -0
- package/lib/typescript/module/i18n/en.d.ts +291 -0
- package/lib/typescript/module/i18n/en.d.ts.map +1 -0
- package/lib/typescript/module/i18n/fr.d.ts +6 -0
- package/lib/typescript/module/i18n/fr.d.ts.map +1 -0
- package/lib/typescript/module/i18n/index.d.ts +10 -0
- package/lib/typescript/module/i18n/index.d.ts.map +1 -0
- package/lib/typescript/module/i18n/locale.d.ts +4 -0
- package/lib/typescript/module/i18n/locale.d.ts.map +1 -0
- package/lib/typescript/module/i18n/translator.d.ts +15 -0
- package/lib/typescript/module/i18n/translator.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +24 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/lib/device-detector.d.ts +5 -0
- package/lib/typescript/module/lib/device-detector.d.ts.map +1 -0
- package/lib/typescript/module/lib/event-emitter.d.ts +19 -0
- package/lib/typescript/module/lib/event-emitter.d.ts.map +1 -0
- package/lib/typescript/module/lib/index.d.ts +5 -0
- package/lib/typescript/module/lib/index.d.ts.map +1 -0
- package/lib/typescript/module/lib/kwik-id-rn-sdk.d.ts +43 -0
- package/lib/typescript/module/lib/kwik-id-rn-sdk.d.ts.map +1 -0
- package/lib/typescript/module/lib/verification-machine.d.ts +78 -0
- package/lib/typescript/module/lib/verification-machine.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/types/events.d.ts +94 -0
- package/lib/typescript/module/types/events.d.ts.map +1 -0
- package/lib/typescript/module/types/index.d.ts +242 -0
- package/lib/typescript/module/types/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/KwikIDVerificationModal.d.ts +21 -0
- package/lib/typescript/module/ui/components/KwikIDVerificationModal.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/screens.d.ts +46 -0
- package/lib/typescript/module/ui/components/screens.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/kwik-id-provider.d.ts +19 -0
- package/lib/typescript/module/ui/context/kwik-id-provider.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/use-kwik-verification.d.ts +29 -0
- package/lib/typescript/module/ui/hooks/use-kwik-verification.d.ts.map +1 -0
- package/lib/typescript/module/ui/index.d.ts +7 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -0
- package/package.json +121 -3
- package/src/api/api-client.ts +319 -0
- package/src/api/api-error.ts +28 -0
- package/src/api/index.ts +12 -0
- package/src/api/upload.ts +87 -0
- package/src/camera/camera-view.tsx +217 -0
- package/src/camera/index.ts +4 -0
- package/src/camera/photo-capture.ts +58 -0
- package/src/crypto/fingerprint.ts +46 -0
- package/src/crypto/hmac.ts +172 -0
- package/src/crypto/index.ts +3 -0
- package/src/crypto/session-manager.ts +200 -0
- package/src/i18n/en.ts +315 -0
- package/src/i18n/fr.ts +325 -0
- package/src/i18n/index.ts +9 -0
- package/src/i18n/locale.ts +15 -0
- package/src/i18n/translator.ts +37 -0
- package/src/index.ts +102 -0
- package/src/lib/device-detector.ts +32 -0
- package/src/lib/event-emitter.ts +90 -0
- package/src/lib/index.ts +15 -0
- package/src/lib/kwik-id-rn-sdk.ts +160 -0
- package/src/lib/verification-machine.ts +273 -0
- package/src/types/events.ts +75 -0
- package/src/types/index.ts +309 -0
- package/src/ui/components/KwikIDVerificationModal.tsx +450 -0
- package/src/ui/components/screens.tsx +283 -0
- package/src/ui/context/kwik-id-provider.tsx +72 -0
- package/src/ui/hooks/use-kwik-verification.ts +121 -0
- package/src/ui/index.ts +9 -0
package/src/i18n/fr.ts
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* French message catalog for the React Native KYC flow. Must cover the same keys
|
|
3
|
+
* as `en.ts` (enforced by the i18n parity test). Missing keys fall back to English.
|
|
4
|
+
*/
|
|
5
|
+
export const fr: Record<string, string> = {
|
|
6
|
+
"branding.builtBy": "Conçu par {name}",
|
|
7
|
+
"branding.poweredBy": "Vérification d'identité propulsée par",
|
|
8
|
+
"branding.secureCompliant": "Sécurisé • Conforme WCAG 2.1",
|
|
9
|
+
"camera.accessError":
|
|
10
|
+
"Impossible d'accéder à la caméra. Vérifiez les autorisations ou importez un fichier.",
|
|
11
|
+
"camera.accessRequiredTitle": "Accès à la caméra requis",
|
|
12
|
+
"camera.adjust": "Ajustez",
|
|
13
|
+
"camera.adjusting": "Ajustement…",
|
|
14
|
+
"camera.captureFailedMobile": "Impossible de prendre la photo. Veuillez réessayer.",
|
|
15
|
+
"camera.errorImageType": "Veuillez sélectionner un fichier image",
|
|
16
|
+
"camera.finalStep": "Dernière étape",
|
|
17
|
+
"camera.initializing": "Initialisation de la caméra…",
|
|
18
|
+
"camera.instructionBack": "Alignez le verso de votre document dans le cadre",
|
|
19
|
+
"camera.instructionBackMobile": "Capturez le verso de votre document",
|
|
20
|
+
"camera.instructionFront": "Alignez le recto de votre document dans le cadre",
|
|
21
|
+
"camera.instructionFrontMobile": "Capturez le recto de votre document",
|
|
22
|
+
"camera.instructionSelfie": "Placez votre visage au centre du cadre",
|
|
23
|
+
"camera.instructionSelfieMobile": "Centrez votre visage et capturez un selfie",
|
|
24
|
+
"camera.openSettingsMobile": "Ouvrir les réglages",
|
|
25
|
+
"camera.permissionBodyMobile":
|
|
26
|
+
"Autorisez l'accès à la caméra dans les réglages pour poursuivre la vérification.",
|
|
27
|
+
"camera.permissionTitleMobile": "Accès à la caméra nécessaire",
|
|
28
|
+
"camera.ready": "Prêt",
|
|
29
|
+
"camera.readyToCapture": "Parfait ! Prêt à capturer",
|
|
30
|
+
"camera.tooBlurry": "Trop flou",
|
|
31
|
+
"camera.tooBlurryHint": "Restez stable et gardez l'objectif propre",
|
|
32
|
+
"camera.tooBright": "Trop lumineux",
|
|
33
|
+
"camera.tooBrightHint": "Réduisez l'éclairage ou éloignez-vous de la lumière",
|
|
34
|
+
"camera.tooDark": "Trop sombre",
|
|
35
|
+
"camera.tooDarkHint": "Déplacez-vous vers un endroit plus lumineux",
|
|
36
|
+
"common.back": "Retour",
|
|
37
|
+
"common.backSide": "Verso",
|
|
38
|
+
"common.cancel": "Annuler",
|
|
39
|
+
"common.capturePhoto": "Prendre la photo",
|
|
40
|
+
"common.close": "Fermer",
|
|
41
|
+
"common.continue": "Continuer",
|
|
42
|
+
"common.done": "Terminé",
|
|
43
|
+
"common.frontSide": "Recto",
|
|
44
|
+
"common.goBack": "Retour",
|
|
45
|
+
"common.goodLighting": "Bon éclairage",
|
|
46
|
+
"common.identityVerification": "Vérification d'identité",
|
|
47
|
+
"common.imReady": "Je suis prêt",
|
|
48
|
+
"common.or": "ou",
|
|
49
|
+
"common.retake": "Reprendre",
|
|
50
|
+
"common.selfie": "Selfie",
|
|
51
|
+
"common.step1of2": "1 sur 2",
|
|
52
|
+
"common.step2of2": "2 sur 2",
|
|
53
|
+
"common.stepOf": "Étape {current} sur {total}",
|
|
54
|
+
"common.uploadFromDevice": "Importer depuis l'appareil",
|
|
55
|
+
"confirm.backTitle": "Vérifiez le verso",
|
|
56
|
+
"confirm.checklistDesc":
|
|
57
|
+
"Si la photo ne respecte pas ces critères, reprenez-la pour de meilleurs résultats",
|
|
58
|
+
"confirm.checklistTitle": "Liste de vérification qualité",
|
|
59
|
+
"confirm.confirmContinue": "Confirmer et continuer",
|
|
60
|
+
"confirm.docCheck1": "Tous les coins sont visibles",
|
|
61
|
+
"confirm.docCheck2": "Le texte est net et lisible",
|
|
62
|
+
"confirm.docCheck3": "Aucun reflet ni éblouissement",
|
|
63
|
+
"confirm.docCheck4": "La photo n'est pas floue",
|
|
64
|
+
"confirm.frontTitle": "Vérifiez le recto",
|
|
65
|
+
"confirm.looksGood": "C'est bon",
|
|
66
|
+
"confirm.looksGoodTitle": "Cela vous convient ?",
|
|
67
|
+
"confirm.selfieCheck1": "Votre visage est bien visible",
|
|
68
|
+
"confirm.selfieCheck2": "Bon éclairage sans ombres",
|
|
69
|
+
"confirm.selfieCheck3": "Les yeux sont ouverts et regardent la caméra",
|
|
70
|
+
"confirm.selfieDisclaimer":
|
|
71
|
+
"En confirmant, vous attestez que les informations fournies sont exactes et vous appartiennent",
|
|
72
|
+
"confirm.selfieReview": "Vérifiez votre selfie et confirmez s'il vous convient",
|
|
73
|
+
"confirm.selfieTitle": "Est-ce que cela vous convient ?",
|
|
74
|
+
"confirm.subtitle": "Assurez-vous que tout est net et visible",
|
|
75
|
+
"confirm.useThisPhoto": "Utiliser cette photo",
|
|
76
|
+
"consent.agreePrivacySuffix":
|
|
77
|
+
"et je consens à ce que {appName} traite mes données à des fins de vérification",
|
|
78
|
+
"consent.agreeTerms1": "J'accepte les",
|
|
79
|
+
"consent.docsRequired": "Documents requis",
|
|
80
|
+
"consent.docsRequiredDesc":
|
|
81
|
+
"Pièce d'identité officielle valide (passeport, carte nationale d'identité ou permis de conduire)",
|
|
82
|
+
"consent.errorPrivacy": "Vous devez accepter la politique de confidentialité",
|
|
83
|
+
"consent.errorTerms": "Vous devez accepter les conditions générales",
|
|
84
|
+
"consent.privacyDesc":
|
|
85
|
+
"Vos données sont chiffrées et stockées en toute sécurité. Nous ne partageons jamais vos informations sans consentement.",
|
|
86
|
+
"consent.privacyLink": "Politique de confidentialité",
|
|
87
|
+
"consent.privacyTitle": "Votre confidentialité",
|
|
88
|
+
"consent.securityNote":
|
|
89
|
+
"🔒 Vos informations sont protégées par un chiffrement de niveau bancaire",
|
|
90
|
+
"consent.subtitle":
|
|
91
|
+
"Nous devons vérifier votre identité pour respecter la réglementation et garantir la sécurité de votre compte.",
|
|
92
|
+
"consent.termsLink": "Conditions générales",
|
|
93
|
+
"documentType.chooseTitle": "Choisissez votre document",
|
|
94
|
+
"documentType.driversLicense": "Permis de conduire",
|
|
95
|
+
"documentType.driversLicenseDesc": "Permis de conduire valide",
|
|
96
|
+
"documentType.idCard": "Carte nationale d'identité",
|
|
97
|
+
"documentType.idCardDesc": "Carte d'identité officielle",
|
|
98
|
+
"documentType.note":
|
|
99
|
+
"Assurez-vous que votre document est valide et non expiré. Nous devrons capturer le recto et le verso (le cas échéant).",
|
|
100
|
+
"documentType.passport": "Passeport",
|
|
101
|
+
"documentType.passportDesc": "Document de voyage international",
|
|
102
|
+
"documentType.residencePermit": "Titre de séjour",
|
|
103
|
+
"documentType.subtitle": "Choisissez le type de pièce d'identité à vérifier",
|
|
104
|
+
"documentType.title": "Sélectionnez le type de document",
|
|
105
|
+
"documentType.votersCard": "Carte d'électeur",
|
|
106
|
+
"documentType.votersCardDesc": "Carte d'identification électorale",
|
|
107
|
+
"errors.sessionExpiredShort": "Votre session de vérification a expiré. Fermez et recommencez.",
|
|
108
|
+
"errors.unexpected": "Une erreur inattendue s'est produite.",
|
|
109
|
+
"handoff.abandonedDesc":
|
|
110
|
+
"La vérification sur votre téléphone a été interrompue. Réessayez ou continuez ici.",
|
|
111
|
+
"handoff.abandonedTitle": "Téléphone déconnecté",
|
|
112
|
+
"handoff.chooseSubtitle":
|
|
113
|
+
"Pour de meilleurs résultats, nous recommandons d'utiliser votre téléphone — les caméras mobiles capturent des images plus nettes des documents.",
|
|
114
|
+
"handoff.chooseTitle": "Comment souhaitez-vous vérifier ?",
|
|
115
|
+
"handoff.completeDesc": "Identité vérifiée sur votre téléphone. Vous pouvez continuer.",
|
|
116
|
+
"handoff.completeTitle": "Vérification terminée !",
|
|
117
|
+
"handoff.connected": "Connecté à votre téléphone",
|
|
118
|
+
"handoff.connectedDesc":
|
|
119
|
+
"Votre téléphone est connecté. Terminez les étapes sur votre téléphone pour continuer.",
|
|
120
|
+
"handoff.continueDesktop": "Continuer sur cet appareil",
|
|
121
|
+
"handoff.continueDesktopDesc": "Utilisez votre webcam pour capturer les documents",
|
|
122
|
+
"handoff.continueInstead": "Continuer sur cet appareil à la place",
|
|
123
|
+
"handoff.copied": "Copié !",
|
|
124
|
+
"handoff.copyLink": "Copier le lien à la place",
|
|
125
|
+
"handoff.expiredDesc": "Générez un nouveau code pour continuer.",
|
|
126
|
+
"handoff.expiredTitle": "Code QR expiré",
|
|
127
|
+
"handoff.expiresIn": "Expire dans {time}",
|
|
128
|
+
"handoff.generateNew": "Générer un nouveau code",
|
|
129
|
+
"handoff.inProgress": "Vérification en cours",
|
|
130
|
+
"handoff.inProgressDesc": "Votre téléphone capture et traite vos documents…",
|
|
131
|
+
"handoff.qrAlt": "Scannez ce code QR avec votre téléphone",
|
|
132
|
+
"handoff.recommended": "Recommandé",
|
|
133
|
+
"handoff.scanDesc":
|
|
134
|
+
"Ouvrez l'appareil photo de votre téléphone et pointez-le vers le code QR pour continuer sur votre téléphone.",
|
|
135
|
+
"handoff.scanTitle": "Scannez avec votre téléphone",
|
|
136
|
+
"handoff.startError":
|
|
137
|
+
"Impossible de démarrer le transfert mobile. Réessayez ou continuez sur cet appareil.",
|
|
138
|
+
"handoff.tryAgain": "Réessayer",
|
|
139
|
+
"handoff.usePhone": "Utilisez votre téléphone",
|
|
140
|
+
"handoff.usePhoneDesc": "Scannez un code QR et terminez sur votre téléphone",
|
|
141
|
+
"handoff.waitingCompletion": "En attente de la fin…",
|
|
142
|
+
"intro.bodyMobile":
|
|
143
|
+
"Vous photographierez votre pièce d'identité et prendrez un selfie. Cela prend environ une minute.",
|
|
144
|
+
"intro.getStarted": "Commencer",
|
|
145
|
+
"intro.govIdDesc": "Passeport, permis de conduire ou carte nationale d'identité",
|
|
146
|
+
"intro.govIdTitle": "Pièce d'identité officielle",
|
|
147
|
+
"intro.orgUsesKwikID": "{orgName} utilise KwikID pour vérifier votre identité.",
|
|
148
|
+
"intro.privacyNote":
|
|
149
|
+
"Vos données sont chiffrées et traitées en toute sécurité. Nous respectons votre vie privée et appliquons des normes strictes de protection des données.",
|
|
150
|
+
"intro.selfieDesc": "Nous utiliserons la caméra de votre appareil",
|
|
151
|
+
"intro.selfieTitle": "Un selfie",
|
|
152
|
+
"intro.subtitle":
|
|
153
|
+
"Nous devons vérifier votre identité pour sécuriser votre compte et respecter la réglementation",
|
|
154
|
+
"intro.timeDesc": "Le processus est rapide et sécurisé",
|
|
155
|
+
"intro.timeTitle": "Environ 2 à 3 minutes",
|
|
156
|
+
"intro.tipFlat": "Placez les documents à plat sur une surface stable",
|
|
157
|
+
"intro.tipLighting": "Utilisez un bon éclairage sans reflets",
|
|
158
|
+
"intro.tipText": "Assurez-vous que le texte est net et lisible",
|
|
159
|
+
"intro.tipsTitle": "Conseils pour de meilleurs résultats",
|
|
160
|
+
"intro.title": "Vérifiez votre identité",
|
|
161
|
+
"intro.whatYouNeed": "Ce dont vous aurez besoin",
|
|
162
|
+
"prepareBack.almostDone": "Presque terminé !",
|
|
163
|
+
"prepareBack.almostDoneDesc":
|
|
164
|
+
"Après le verso, nous prendrons un rapide selfie pour terminer la vérification.",
|
|
165
|
+
"prepareBack.bodyMobile":
|
|
166
|
+
"Retournez maintenant le document et capturez le verso de la même manière.",
|
|
167
|
+
"prepareBack.standardsTitle": "Mêmes critères de qualité",
|
|
168
|
+
"prepareBack.subtitle": "Retournez votre {document} et préparez-vous à capturer le verso",
|
|
169
|
+
"prepareBack.tipClear": "Assurez-vous que toutes les informations sont nettes et lisibles",
|
|
170
|
+
"prepareBack.tipFlat": "Gardez le document à plat et stable",
|
|
171
|
+
"prepareBack.tipFlip": "Retournez votre document pour montrer le verso",
|
|
172
|
+
"prepareBack.tipLighting": "Utilisez le même bon éclairage qu'avant",
|
|
173
|
+
"prepareBack.title": "Maintenant le verso",
|
|
174
|
+
"prepareBack.titleMobile": "Verso du document",
|
|
175
|
+
"prepareFront.bodyMobile":
|
|
176
|
+
"Placez le recto de votre document sur une surface plane et bien éclairée, et faites-le tenir dans le cadre.",
|
|
177
|
+
"prepareFront.subtitle":
|
|
178
|
+
"Préparez votre document {document}. Nous capturerons d'abord le recto.",
|
|
179
|
+
"prepareFront.tipClearDesc":
|
|
180
|
+
"Assurez-vous que le texte, la photo et les détails sont bien visibles.",
|
|
181
|
+
"prepareFront.tipClearTitle": "Net et lisible",
|
|
182
|
+
"prepareFront.tipFlatDesc": "Placez votre document sur une surface plane et contrastée.",
|
|
183
|
+
"prepareFront.tipFlatTitle": "Surface plane",
|
|
184
|
+
"prepareFront.tipLightingDesc":
|
|
185
|
+
"Utilisez la lumière naturelle ou une pièce bien éclairée. Évitez les reflets et les ombres.",
|
|
186
|
+
"prepareFront.tipsTitle": "Conseils pour une bonne photo",
|
|
187
|
+
"prepareFront.title": "Préparez votre {document}",
|
|
188
|
+
"prepareFront.titleMobile": "Recto du document",
|
|
189
|
+
"prepareSelfie.bodyMobile":
|
|
190
|
+
"Placez votre visage dans le cadre avec un bon éclairage, puis capturez.",
|
|
191
|
+
"prepareSelfie.privacyNote":
|
|
192
|
+
"Votre selfie est utilisé uniquement pour la vérification et stocké en toute sécurité",
|
|
193
|
+
"prepareSelfie.subtitle":
|
|
194
|
+
"Prenez un selfie pour que nous puissions le comparer à la photo de votre pièce d'identité.",
|
|
195
|
+
"prepareSelfie.takeSelfie": "Prendre un selfie",
|
|
196
|
+
"prepareSelfie.tipClearDesc":
|
|
197
|
+
"Retirez lunettes, chapeaux ou masques qui pourraient masquer votre visage",
|
|
198
|
+
"prepareSelfie.tipClearTitle": "Bonne visibilité",
|
|
199
|
+
"prepareSelfie.tipFaceDesc": "Placez votre visage au centre et regardez directement la caméra",
|
|
200
|
+
"prepareSelfie.tipFaceTitle": "Regardez la caméra",
|
|
201
|
+
"prepareSelfie.tipLightingDesc":
|
|
202
|
+
"Assurez-vous que votre visage est bien éclairé, sans ombres marquées",
|
|
203
|
+
"prepareSelfie.tipsTitle": "Conseils pour votre selfie",
|
|
204
|
+
"prepareSelfie.title": "Vérifions maintenant que c'est bien vous",
|
|
205
|
+
"prepareSelfie.titleMobile": "Prenez un selfie",
|
|
206
|
+
"processing.pleaseWait": "Veuillez patienter pendant l'envoi de vos informations…",
|
|
207
|
+
"processing.preliminaryChecks": "Vérifications préliminaires…",
|
|
208
|
+
"processing.submitting": "Envoi…",
|
|
209
|
+
"processing.title": "Envoi de vos documents",
|
|
210
|
+
"processing.uploadBack": "Envoi du document (verso)",
|
|
211
|
+
"processing.uploadFront": "Envoi du document (recto)",
|
|
212
|
+
"processing.uploadSelfie": "Envoi du selfie",
|
|
213
|
+
"processing.uploadingBack": "Envoi du verso…",
|
|
214
|
+
"processing.uploadingFront": "Envoi du recto…",
|
|
215
|
+
"processing.uploadingSelfie": "Envoi du selfie…",
|
|
216
|
+
"processing.working": "Traitement…",
|
|
217
|
+
"result.commonIssues": "Problèmes courants :",
|
|
218
|
+
"result.couldNotComplete": "La vérification n'a pas pu être effectuée.",
|
|
219
|
+
"result.docFailedMessage": "Le document ({side}) a échoué : {message}",
|
|
220
|
+
"result.docFailedQuality": "Le document ({side}) a échoué au contrôle qualité",
|
|
221
|
+
"result.documentsSubmitted": "Documents soumis",
|
|
222
|
+
"result.failedTitle": "Échec de la soumission",
|
|
223
|
+
"result.identityDocument": "Pièce d'identité",
|
|
224
|
+
"result.issue1": "Assurez-vous que votre document est net et non flou",
|
|
225
|
+
"result.issue2": "Assurez-vous que votre visage est bien éclairé sur le selfie",
|
|
226
|
+
"result.issue3": "Vérifiez que toutes les informations de votre document sont visibles",
|
|
227
|
+
"result.issue4": "Utilisez une pièce d'identité officielle valide et non expirée",
|
|
228
|
+
"result.nextStep1":
|
|
229
|
+
"La vérification prend généralement quelques minutes, mais peut aller jusqu'à quelques heures dans de rares cas",
|
|
230
|
+
"result.nextStep2": "Vous recevrez une notification par e-mail une fois vérifié",
|
|
231
|
+
"result.nextStep3": "Consultez vos e-mails pour les mises à jour et instructions",
|
|
232
|
+
"result.selfiePhoto": "Photo selfie",
|
|
233
|
+
"result.sessionExpiredMessage":
|
|
234
|
+
"Votre session de vérification a expiré. Fermez et démarrez une nouvelle vérification.",
|
|
235
|
+
"result.sessionExpiredTitle": "Session expirée",
|
|
236
|
+
"result.sideBack": "verso",
|
|
237
|
+
"result.sideFront": "recto",
|
|
238
|
+
"result.somethingWrong": "Un problème est survenu",
|
|
239
|
+
"result.submissionError": "Une erreur s'est produite lors de la soumission",
|
|
240
|
+
"result.submittedFromPhone": "Vos documents ont été soumis depuis votre téléphone !",
|
|
241
|
+
"result.submittedMessage": "Vos documents ont été soumis pour vérification !",
|
|
242
|
+
"result.submittedMessageMobile": "Vos documents ont été soumis pour vérification.",
|
|
243
|
+
"result.submittedShort": "Soumis",
|
|
244
|
+
"result.successBody":
|
|
245
|
+
"Contrôles préliminaires réussis. Vos documents ont été soumis pour examen complet — nous vous préviendrons une fois terminé.",
|
|
246
|
+
"result.successTitle": "Soumis pour examen",
|
|
247
|
+
"result.tryAgain": "Réessayer",
|
|
248
|
+
"result.whatNext": "Et ensuite ?",
|
|
249
|
+
"selfie.beforeBegin": "Avant de commencer :",
|
|
250
|
+
"selfie.brightTip1": "Éloignez-vous de la lumière directe du soleil ou des lumières vives",
|
|
251
|
+
"selfie.brightTip2": "Ajustez l'éclairage pour réduire les reflets",
|
|
252
|
+
"selfie.brightTip3": "Tournez le dos aux fenêtres ou éteignez quelques lumières",
|
|
253
|
+
"selfie.captureSelfie": "Capturer le selfie",
|
|
254
|
+
"selfie.darkTip1": "Déplacez-vous vers un endroit plus lumineux ou allumez plus de lumières",
|
|
255
|
+
"selfie.darkTip2": "Faites face à une fenêtre ou une source de lumière",
|
|
256
|
+
"selfie.darkTip3": "Évitez le contre-jour (lumière derrière vous)",
|
|
257
|
+
"selfie.deniedDesc":
|
|
258
|
+
"Activez les autorisations de la caméra dans les paramètres de votre navigateur, puis réessayez",
|
|
259
|
+
"selfie.deniedTitle": "Accès à la caméra refusé",
|
|
260
|
+
"selfie.errorCapture": "Veuillez capturer votre selfie pour continuer",
|
|
261
|
+
"selfie.errorDenied":
|
|
262
|
+
"Accès à la caméra refusé. Autorisez la caméra dans les paramètres de votre navigateur.",
|
|
263
|
+
"selfie.errorGeneric": "Impossible d'accéder à la caméra. Veuillez réessayer.",
|
|
264
|
+
"selfie.errorInUse": "La caméra est déjà utilisée par une autre application.",
|
|
265
|
+
"selfie.errorNoCamera": "Aucune caméra détectée. Connectez une caméra et réessayez.",
|
|
266
|
+
"selfie.errorNoTracks": "Aucun flux vidéo disponible",
|
|
267
|
+
"selfie.errorNotSupported": "Caméra non prise en charge sur cet appareil",
|
|
268
|
+
"selfie.errorStartStream": "Impossible de démarrer le flux vidéo",
|
|
269
|
+
"selfie.errorTrackInactive": "Le flux de la caméra n'est pas actif",
|
|
270
|
+
"selfie.errorUnknown": "Une erreur inconnue s'est produite lors de l'accès à la caméra.",
|
|
271
|
+
"selfie.improveLighting": "Améliorez l'éclairage",
|
|
272
|
+
"selfie.improveToContinue": "Améliorez l'éclairage pour continuer",
|
|
273
|
+
"selfie.lightExcellent": "Excellent éclairage",
|
|
274
|
+
"selfie.lightPoor": "Éclairage insuffisant – améliorez-le",
|
|
275
|
+
"selfie.lightTooBright": "Trop lumineux – réduisez la lumière",
|
|
276
|
+
"selfie.lightTooDark": "Trop sombre – ajoutez de la lumière",
|
|
277
|
+
"selfie.livenessBlink": "Clignez des yeux deux fois lentement",
|
|
278
|
+
"selfie.livenessCenter": "Placez votre visage au centre",
|
|
279
|
+
"selfie.livenessComplete": "Parfait ! Traitement…",
|
|
280
|
+
"selfie.livenessLeft": "Tournez légèrement la tête vers la gauche",
|
|
281
|
+
"selfie.livenessRight": "Tournez légèrement la tête vers la droite",
|
|
282
|
+
"selfie.permissionDenied": "Autorisation refusée",
|
|
283
|
+
"selfie.pleaseAllow": "Veuillez autoriser l'accès à la caméra dans votre navigateur",
|
|
284
|
+
"selfie.poorTip1": "Ajoutez des sources de lumière face à vous",
|
|
285
|
+
"selfie.poorTip2": "Assurez-vous que votre visage est uniformément éclairé",
|
|
286
|
+
"selfie.poorTip3": "Évitez les ombres sur votre visage",
|
|
287
|
+
"selfie.requesting": "Demande d'accès à la caméra…",
|
|
288
|
+
"selfie.requiredDesc":
|
|
289
|
+
"Nous avons besoin d'accéder à votre caméra pour vérifier votre identité",
|
|
290
|
+
"selfie.requiredTitle": "Accès à la caméra requis",
|
|
291
|
+
"selfie.startCamera": "Démarrer la caméra",
|
|
292
|
+
"selfie.subtitle":
|
|
293
|
+
"Nous vérifierons que vous êtes une personne réelle en capturant une photo en direct",
|
|
294
|
+
"selfie.tip1": "Assurez-vous que votre visage est bien éclairé et visible",
|
|
295
|
+
"selfie.tip2": "Retirez lunettes, chapeaux ou masques",
|
|
296
|
+
"selfie.tip3": "Placez votre visage dans le repère ovale",
|
|
297
|
+
"selfie.tip4": "Suivez attentivement les instructions à l'écran",
|
|
298
|
+
"selfie.title": "Prenez un selfie",
|
|
299
|
+
"upload.alignCorners": "Alignez tous les coins dans le cadre",
|
|
300
|
+
"upload.alignInstruction":
|
|
301
|
+
"Alignez votre document dans le cadre. Assurez-vous que tous les coins sont visibles et que le texte est net.",
|
|
302
|
+
"upload.backOfDocument": "Verso du document",
|
|
303
|
+
"upload.cameraActive": "Caméra active",
|
|
304
|
+
"upload.cameraFailed":
|
|
305
|
+
"Impossible d'accéder à la caméra. Veuillez importer un fichier à la place.",
|
|
306
|
+
"upload.errorBack": "Veuillez importer le verso de votre document",
|
|
307
|
+
"upload.errorFileSize": "La taille du fichier doit être inférieure à 10 Mo",
|
|
308
|
+
"upload.errorFront": "Veuillez importer le recto de votre document",
|
|
309
|
+
"upload.errorImageType": "Veuillez importer un fichier image",
|
|
310
|
+
"upload.errorSelectType": "Veuillez sélectionner un type de document",
|
|
311
|
+
"upload.frontOfDocument": "Recto du document",
|
|
312
|
+
"upload.positionDocument": "Placez le document dans le cadre",
|
|
313
|
+
"upload.subtitle": "Prenez une photo nette de votre pièce d'identité officielle",
|
|
314
|
+
"upload.takePhotoOfBack": "Photographier le verso",
|
|
315
|
+
"upload.takePhotoOfFront": "Photographier le recto",
|
|
316
|
+
"upload.tapToOpenCamera": "Touchez pour ouvrir la caméra",
|
|
317
|
+
"upload.tipFit": "Faites tenir tout le document dans les repères du cadre",
|
|
318
|
+
"upload.tipFlat": "Placez le document sur une surface plane et contrastée",
|
|
319
|
+
"upload.tipLighting": "Utilisez un bon éclairage, évitez les reflets et les ombres",
|
|
320
|
+
"upload.tipSteady": "Tenez votre téléphone stable lors de la capture",
|
|
321
|
+
"upload.tipsTitle": "📸 Conseils pour de bonnes photos :",
|
|
322
|
+
"upload.title": "Photographiez votre document",
|
|
323
|
+
"upload.uploadFromDeviceLabel": "Importer depuis l'appareil",
|
|
324
|
+
"uploadLabel.documentTypeLabel": "Type de document",
|
|
325
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RN KYC-flow i18n (EN + FR). Locale is supplied by the host app via SDK config
|
|
3
|
+
* and threaded to screens as a `t` prop.
|
|
4
|
+
*/
|
|
5
|
+
export { en } from "./en";
|
|
6
|
+
export { fr } from "./fr";
|
|
7
|
+
export { getDeviceLocale } from "./locale";
|
|
8
|
+
export { createTranslator } from "./translator";
|
|
9
|
+
export type { MessageKey, Translate, TranslateParams } from "./translator";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device-locale detection for the default UI language.
|
|
3
|
+
*/
|
|
4
|
+
import { getLocales } from "expo-localization";
|
|
5
|
+
|
|
6
|
+
import type { Locale } from "../types";
|
|
7
|
+
|
|
8
|
+
/** 'fr' when the device's preferred language is French, otherwise 'en'. */
|
|
9
|
+
export function getDeviceLocale(): Locale {
|
|
10
|
+
try {
|
|
11
|
+
return getLocales()[0]?.languageCode === "fr" ? "fr" : "en";
|
|
12
|
+
} catch {
|
|
13
|
+
return "en";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny dependency-free translator for the RN KYC flow (mirrors the web SDK's).
|
|
3
|
+
* The host app supplies the locale via SDK config; missing keys fall back to English.
|
|
4
|
+
*/
|
|
5
|
+
import type { Locale } from "../types";
|
|
6
|
+
import { en } from "./en";
|
|
7
|
+
import { fr } from "./fr";
|
|
8
|
+
|
|
9
|
+
/** All message keys, derived from the English catalog (the source of truth). */
|
|
10
|
+
export type MessageKey = keyof typeof en;
|
|
11
|
+
|
|
12
|
+
/** Interpolation values for `{placeholder}` tokens in a message. */
|
|
13
|
+
export type TranslateParams = Record<string, string | number>;
|
|
14
|
+
|
|
15
|
+
/** Translate a key to the active locale, interpolating any `{param}` tokens. */
|
|
16
|
+
export type Translate = (key: MessageKey, params?: TranslateParams) => string;
|
|
17
|
+
|
|
18
|
+
const catalogs: Record<Locale, Partial<Record<MessageKey, string>>> = {
|
|
19
|
+
en,
|
|
20
|
+
fr,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function interpolate(template: string, params?: TranslateParams): string {
|
|
24
|
+
if (!params) return template;
|
|
25
|
+
return template.replace(/\{(\w+)\}/g, (match, name: string) =>
|
|
26
|
+
name in params ? String(params[name]) : match
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Build a translator bound to a locale, falling back to English then the raw key. */
|
|
31
|
+
export function createTranslator(locale: Locale = "en"): Translate {
|
|
32
|
+
const table = catalogs[locale] ?? en;
|
|
33
|
+
return (key, params) => {
|
|
34
|
+
const template = table[key] ?? en[key] ?? key;
|
|
35
|
+
return interpolate(template, params);
|
|
36
|
+
};
|
|
37
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @kwik-id/sdk-react-native — public API.
|
|
3
|
+
*
|
|
4
|
+
* Phase 1: on-device document + selfie capture, upload, and submit, plus the
|
|
5
|
+
* headless protocol foundation. On-device liveness (passive + active challenges)
|
|
6
|
+
* lands in Phase 2.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ---- UI (primary integration) ----
|
|
12
|
+
export { useKwikVerification, KwikIDVerificationModal, KwikIDProvider, useKwikID } from "./ui";
|
|
13
|
+
export type {
|
|
14
|
+
UseKwikVerification,
|
|
15
|
+
UseKwikVerificationOptions,
|
|
16
|
+
KwikIDVerificationModalProps,
|
|
17
|
+
KwikIDProviderProps,
|
|
18
|
+
KwikIDContextValue,
|
|
19
|
+
} from "./ui";
|
|
20
|
+
|
|
21
|
+
// ---- Camera ----
|
|
22
|
+
export { CameraView, compressCapture } from "./camera";
|
|
23
|
+
export type { CameraViewProps, RawPhoto } from "./camera";
|
|
24
|
+
|
|
25
|
+
// ---- Headless orchestrator ----
|
|
26
|
+
export { KwikIdRNSDK } from "./lib/kwik-id-rn-sdk";
|
|
27
|
+
export type { KwikIdRNSDKOptions } from "./lib/kwik-id-rn-sdk";
|
|
28
|
+
|
|
29
|
+
// ---- API ----
|
|
30
|
+
export { ApiClient, ApiError, DEFAULT_BASE_URL, uploadMultipart } from "./api";
|
|
31
|
+
export type {
|
|
32
|
+
ApiClientConfig,
|
|
33
|
+
UploadResponse,
|
|
34
|
+
SubmitResponse,
|
|
35
|
+
StatusResponse,
|
|
36
|
+
HandoffValidateResponse,
|
|
37
|
+
HandoffRedeemResponse,
|
|
38
|
+
Uploader,
|
|
39
|
+
UploadResult,
|
|
40
|
+
} from "./api";
|
|
41
|
+
|
|
42
|
+
// ---- i18n (EN + FR) ----
|
|
43
|
+
export { createTranslator, getDeviceLocale, en as messagesEn, fr as messagesFr } from "./i18n";
|
|
44
|
+
export type { MessageKey, Translate, TranslateParams } from "./i18n";
|
|
45
|
+
|
|
46
|
+
// ---- Crypto / session ----
|
|
47
|
+
export {
|
|
48
|
+
SessionManager,
|
|
49
|
+
generateFingerprint,
|
|
50
|
+
hmacSha256Hex,
|
|
51
|
+
sha256Hex,
|
|
52
|
+
generateNonce,
|
|
53
|
+
} from "./crypto";
|
|
54
|
+
|
|
55
|
+
// ---- Headless orchestration primitives ----
|
|
56
|
+
export {
|
|
57
|
+
EventEmitter,
|
|
58
|
+
reducer,
|
|
59
|
+
initialState,
|
|
60
|
+
needsBackImage,
|
|
61
|
+
getStepProgress,
|
|
62
|
+
computeUploadProgress,
|
|
63
|
+
isExpoGo,
|
|
64
|
+
assertSupportedRuntime,
|
|
65
|
+
isRealDevice,
|
|
66
|
+
} from "./lib";
|
|
67
|
+
export type { MachineState, MachineContext, MachineEvent, MachineOptions } from "./lib";
|
|
68
|
+
|
|
69
|
+
// ---- Types ----
|
|
70
|
+
export type {
|
|
71
|
+
KwikIdConfig,
|
|
72
|
+
KwikIdTheme,
|
|
73
|
+
Locale,
|
|
74
|
+
LivenessMode,
|
|
75
|
+
DocumentType,
|
|
76
|
+
CaptureType,
|
|
77
|
+
CaptureAsset,
|
|
78
|
+
CaptureMetadata,
|
|
79
|
+
CaptureSlot,
|
|
80
|
+
QualityResult,
|
|
81
|
+
QualityGuidance,
|
|
82
|
+
QualityCheckResult,
|
|
83
|
+
FacePose,
|
|
84
|
+
FaceSignals,
|
|
85
|
+
ChallengeType,
|
|
86
|
+
Challenge,
|
|
87
|
+
ChallengeResult,
|
|
88
|
+
PassiveLivenessResult,
|
|
89
|
+
LivenessResult,
|
|
90
|
+
DeviceFingerprint,
|
|
91
|
+
Session,
|
|
92
|
+
SecurePayload,
|
|
93
|
+
VerificationScores,
|
|
94
|
+
ExtractedData,
|
|
95
|
+
VerificationResult,
|
|
96
|
+
VerificationOutcome,
|
|
97
|
+
SessionInfo,
|
|
98
|
+
VerificationSubStep,
|
|
99
|
+
KwikIdEvents,
|
|
100
|
+
KwikIdEventName,
|
|
101
|
+
KwikIdEventHandler,
|
|
102
|
+
} from "./types";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device / runtime environment detection.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the web SDK's emulator + automation heuristics. The most important
|
|
5
|
+
* check is Expo Go detection: vision-camera frame processors are native and
|
|
6
|
+
* cannot run in Expo Go, so the SDK fails fast with an actionable message.
|
|
7
|
+
*/
|
|
8
|
+
import Constants, { AppOwnership, ExecutionEnvironment } from "expo-constants";
|
|
9
|
+
import * as Device from "expo-device";
|
|
10
|
+
|
|
11
|
+
export function isExpoGo(): boolean {
|
|
12
|
+
return (
|
|
13
|
+
Constants.appOwnership === AppOwnership.Expo ||
|
|
14
|
+
Constants.executionEnvironment === ExecutionEnvironment.StoreClient
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Throws an actionable error when running in an unsupported runtime. */
|
|
19
|
+
export function assertSupportedRuntime(): void {
|
|
20
|
+
if (isExpoGo()) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
"[KwikID] This SDK requires a custom dev build or EAS build and cannot run in Expo Go. " +
|
|
23
|
+
"Run `expo prebuild` and build a development client (or `eas build`). " +
|
|
24
|
+
"See https://docs.expo.dev/develop/development-builds/introduction/"
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function isRealDevice(): boolean {
|
|
30
|
+
// false on iOS Simulator / Android emulator.
|
|
31
|
+
return Device.isDevice === true;
|
|
32
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-safe event emitter (ported from @kwik-id/sdk-core, framework-agnostic).
|
|
3
|
+
*/
|
|
4
|
+
import type { KwikIdEventHandler, KwikIdEventName, KwikIdEvents } from "../types";
|
|
5
|
+
|
|
6
|
+
type WildcardHandler = (event: KwikIdEventName, data: unknown) => void;
|
|
7
|
+
|
|
8
|
+
export class EventEmitter {
|
|
9
|
+
private listeners: Map<KwikIdEventName, Set<KwikIdEventHandler<KwikIdEventName>>> = new Map();
|
|
10
|
+
private wildcardListeners: Set<WildcardHandler> = new Set();
|
|
11
|
+
private onceListeners: Map<KwikIdEventName, Set<KwikIdEventHandler<KwikIdEventName>>> =
|
|
12
|
+
new Map();
|
|
13
|
+
|
|
14
|
+
on<T extends KwikIdEventName>(event: T, handler: KwikIdEventHandler<T>): () => void {
|
|
15
|
+
if (!this.listeners.has(event)) {
|
|
16
|
+
this.listeners.set(event, new Set());
|
|
17
|
+
}
|
|
18
|
+
this.listeners.get(event)!.add(handler as KwikIdEventHandler<KwikIdEventName>);
|
|
19
|
+
return () => this.off(event, handler);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
once<T extends KwikIdEventName>(event: T, handler: KwikIdEventHandler<T>): () => void {
|
|
23
|
+
if (!this.onceListeners.has(event)) {
|
|
24
|
+
this.onceListeners.set(event, new Set());
|
|
25
|
+
}
|
|
26
|
+
this.onceListeners.get(event)!.add(handler as KwikIdEventHandler<KwikIdEventName>);
|
|
27
|
+
return () => {
|
|
28
|
+
this.onceListeners.get(event)?.delete(handler as KwikIdEventHandler<KwikIdEventName>);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
onAny(handler: WildcardHandler): () => void {
|
|
33
|
+
this.wildcardListeners.add(handler);
|
|
34
|
+
return () => this.wildcardListeners.delete(handler);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
off<T extends KwikIdEventName>(event: T, handler: KwikIdEventHandler<T>): void {
|
|
38
|
+
this.listeners.get(event)?.delete(handler as KwikIdEventHandler<KwikIdEventName>);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
emit<T extends KwikIdEventName>(event: T, data: KwikIdEvents[T]): void {
|
|
42
|
+
const handlers = this.listeners.get(event);
|
|
43
|
+
if (handlers) {
|
|
44
|
+
handlers.forEach((handler) => {
|
|
45
|
+
try {
|
|
46
|
+
handler(data);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(`Error in event handler for ${event}:`, error);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const onceHandlers = this.onceListeners.get(event);
|
|
54
|
+
if (onceHandlers) {
|
|
55
|
+
onceHandlers.forEach((handler) => {
|
|
56
|
+
try {
|
|
57
|
+
handler(data);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error(`Error in once handler for ${event}:`, error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.onceListeners.delete(event);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
this.wildcardListeners.forEach((handler) => {
|
|
66
|
+
try {
|
|
67
|
+
handler(event, data);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error(`Error in wildcard handler for ${event}:`, error);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
removeAllListeners(event?: KwikIdEventName): void {
|
|
75
|
+
if (event) {
|
|
76
|
+
this.listeners.delete(event);
|
|
77
|
+
this.onceListeners.delete(event);
|
|
78
|
+
} else {
|
|
79
|
+
this.listeners.clear();
|
|
80
|
+
this.onceListeners.clear();
|
|
81
|
+
this.wildcardListeners.clear();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
listenerCount(event: KwikIdEventName): number {
|
|
86
|
+
const regularCount = this.listeners.get(event)?.size || 0;
|
|
87
|
+
const onceCount = this.onceListeners.get(event)?.size || 0;
|
|
88
|
+
return regularCount + onceCount;
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/lib/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { EventEmitter } from "./event-emitter";
|
|
2
|
+
export {
|
|
3
|
+
reducer,
|
|
4
|
+
initialState,
|
|
5
|
+
needsBackImage,
|
|
6
|
+
getStepProgress,
|
|
7
|
+
computeUploadProgress,
|
|
8
|
+
} from "./verification-machine";
|
|
9
|
+
export type {
|
|
10
|
+
MachineState,
|
|
11
|
+
MachineContext,
|
|
12
|
+
MachineEvent,
|
|
13
|
+
MachineOptions,
|
|
14
|
+
} from "./verification-machine";
|
|
15
|
+
export { isExpoGo, assertSupportedRuntime, isRealDevice } from "./device-detector";
|