datakeen-session-react 1.1.161 → 1.1.162
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/cjs/components/selfie/SelfieConfirmation.js +1 -1
- package/dist/cjs/components/selfie/SelfieConfirmation.js.map +1 -1
- package/dist/cjs/components/selfie/Video.js +2 -2
- package/dist/cjs/components/selfie/Video.js.map +1 -1
- package/dist/cjs/components/selfie/hooks/useVideoRecorderStyles.js +2 -2
- package/dist/cjs/components/selfie/hooks/useVideoRecorderStyles.js.map +1 -1
- package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js +7 -3
- package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
- package/dist/cjs/components/selfie/selfie-flow/SelfieProcessing.js +2 -7
- package/dist/cjs/components/selfie/selfie-flow/SelfieProcessing.js.map +1 -1
- package/dist/cjs/components/selfie/selfie-flow/SelfieRecorder.js +2 -2
- package/dist/cjs/components/selfie/selfie-flow/SelfieRecorder.js.map +1 -1
- package/dist/cjs/components/session/Selfie.js +7 -5
- package/dist/cjs/components/session/Selfie.js.map +1 -1
- package/dist/cjs/components/ui/Button.js +5 -3
- package/dist/cjs/components/ui/Button.js.map +1 -1
- package/dist/cjs/services/documentTemplate.js +1 -1
- package/dist/cjs/services/documentTemplate.js.map +1 -1
- package/dist/esm/components/selfie/SelfieConfirmation.js +1 -1
- package/dist/esm/components/selfie/SelfieConfirmation.js.map +1 -1
- package/dist/esm/components/selfie/Video.js +2 -2
- package/dist/esm/components/selfie/Video.js.map +1 -1
- package/dist/esm/components/selfie/hooks/useVideoRecorderStyles.js +2 -2
- package/dist/esm/components/selfie/hooks/useVideoRecorderStyles.js.map +1 -1
- package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js +7 -3
- package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
- package/dist/esm/components/selfie/selfie-flow/SelfieProcessing.js +2 -7
- package/dist/esm/components/selfie/selfie-flow/SelfieProcessing.js.map +1 -1
- package/dist/esm/components/selfie/selfie-flow/SelfieRecorder.js +2 -2
- package/dist/esm/components/selfie/selfie-flow/SelfieRecorder.js.map +1 -1
- package/dist/esm/components/session/Selfie.js +7 -5
- package/dist/esm/components/session/Selfie.js.map +1 -1
- package/dist/esm/components/ui/Button.js +5 -3
- package/dist/esm/components/ui/Button.js.map +1 -1
- package/dist/esm/services/documentTemplate.js +1 -1
- package/dist/esm/services/documentTemplate.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,11 +10,12 @@ import { updateSessionCurrentStep } from '../../services/sessionService.js';
|
|
|
10
10
|
* Gère les étapes internes de capture et confirmation du selfie.
|
|
11
11
|
*/
|
|
12
12
|
var Selfie = function (_a) {
|
|
13
|
+
var _b, _c;
|
|
13
14
|
var stepObject = _a.stepObject, sessionId = _a.sessionId, node = _a.node, template = _a.template;
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
15
|
+
var _d = useState(0), internalStep = _d[0], setInternalStep = _d[1];
|
|
16
|
+
var _e = useState(null), selfieData = _e[0], setSelfieData = _e[1];
|
|
17
|
+
var _f = useState(null), selfiePhoto = _f[0], setSelfiePhoto = _f[1];
|
|
18
|
+
var _g = useState(false), isTransitioning = _g[0], setIsTransitioning = _g[1];
|
|
18
19
|
var handleConfirmSelfie = function () {
|
|
19
20
|
// Ajouter une transition visuelle avant de passer à l'étape suivante
|
|
20
21
|
setIsTransitioning(true);
|
|
@@ -51,7 +52,8 @@ var Selfie = function (_a) {
|
|
|
51
52
|
// Retourner à l'étape précédente du flow principal
|
|
52
53
|
stepObject.setStep(stepObject.step - 1);
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
+
console.log("[Selfie] buttonBgColor:", template.buttonBgColor, "buttonTextColor:", template.buttonTextColor);
|
|
56
|
+
return (jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsx(Video, { setSelfieData: setSelfieData, setStep: setInternalStep, onBack: handleBackToParent, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40" })), internalStep === 1 && selfieData && (jsx(SelfieConfirmation, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsx(SelfieProcessing, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake, onContinueAnyway: handleContinueAnyway }))] }));
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
export { Selfie as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selfie.js","sources":["../../../../../src/components/session/Selfie.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport {\n SessionTemplate,\n SessionTemplateNode,\n stepObject,\n} from \"../../types/session\";\nimport Video from \"../selfie/Video\";\nimport SelfieConfirmation from \"../selfie/SelfieConfirmation\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport SelfieProcessing from \"../selfie/selfie-flow/SelfieProcessing\";\nimport {\n updateSessionCurrentStep,\n getOrderedJourneySteps,\n} from \"../../services/sessionService\";\n\n/**\n * Composant de gestion du flux selfie.\n * Gère les étapes internes de capture et confirmation du selfie.\n */\nconst Selfie = ({\n stepObject,\n sessionId,\n node,\n template,\n}: {\n stepObject: stepObject;\n sessionId: string;\n node: SessionTemplateNode;\n template: SessionTemplate;\n}) => {\n const [internalStep, setInternalStep] = useState(0);\n const [selfieData, setSelfieData] = useState<SelfieCaptureData | null>(null);\n const [selfiePhoto, setSelfiePhoto] = useState<string | null>(null);\n const [isTransitioning, setIsTransitioning] = useState(false);\n\n const handleConfirmSelfie = () => {\n // Ajouter une transition visuelle avant de passer à l'étape suivante\n setIsTransitioning(true);\n\n // Attendre un peu pour l'animation avant de passer à l'étape suivante\n setTimeout(() => {\n setInternalStep(2); // Passer à l'étape de traitement du selfie\n setIsTransitioning(false);\n }, 500);\n };\n\n const selfieProcessed = (processed: boolean) => {\n // Callback pour indiquer que le selfie a été traité\n if (processed) {\n // Increment currentStep in database immediately after successful analysis\n // This prevents double analysis if the user refreshes the page\n updateSessionCurrentStep(sessionId, stepObject.step + 1).catch((error) => {\n console.error(\"Failed to update current step after successful analysis:\", error);\n });\n stepObject.goToNextStep(node.id, template);\n }\n };\n\n const handleContinueAnyway = () => {\n updateSessionCurrentStep(sessionId, stepObject.step + 1).catch((error) => {\n console.error(\"Failed to update current step after KO bypass:\", error);\n });\n stepObject.goToNextStep(node.id, template);\n };\n\n const onRetake = () => {\n setInternalStep(0);\n };\n\n const handleRetakeSelfie = () => {\n setInternalStep(0);\n };\n\n const handleBackToParent = () => {\n // Retourner à l'étape précédente du flow principal\n stepObject.setStep(stepObject.step - 1);\n };\n\n return (\n <div\n className={`h-full w-full transition-opacity duration-500 ${isTransitioning ? \"opacity-50\" : \"opacity-100\"\n }`}\n >\n {internalStep === 0 && (\n <Video\n setSelfieData={setSelfieData}\n setStep={setInternalStep}\n onBack={handleBackToParent}\n />\n )}\n {internalStep === 1 && selfieData && (\n <SelfieConfirmation\n selfieData={selfieData}\n onConfirm={handleConfirmSelfie}\n onRetake={handleRetakeSelfie}\n setSelfiePhoto={setSelfiePhoto}\n />\n )}\n {internalStep === 2 && selfieData && (\n <SelfieProcessing\n onProcessingComplete={selfieProcessed}\n selfieVideo={selfieData}\n selfiePhoto={selfiePhoto}\n onRetake={onRetake}\n onContinueAnyway={handleContinueAnyway}\n />\n )}\n </div>\n );\n};\n\nexport default Selfie;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAeA;;;AAGG;AACH,IAAM,MAAM,GAAG,UAAC,EAUf,EAAA
|
|
1
|
+
{"version":3,"file":"Selfie.js","sources":["../../../../../src/components/session/Selfie.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport {\n SessionTemplate,\n SessionTemplateNode,\n stepObject,\n} from \"../../types/session\";\nimport Video from \"../selfie/Video\";\nimport SelfieConfirmation from \"../selfie/SelfieConfirmation\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport SelfieProcessing from \"../selfie/selfie-flow/SelfieProcessing\";\nimport {\n updateSessionCurrentStep,\n getOrderedJourneySteps,\n} from \"../../services/sessionService\";\n\n/**\n * Composant de gestion du flux selfie.\n * Gère les étapes internes de capture et confirmation du selfie.\n */\nconst Selfie = ({\n stepObject,\n sessionId,\n node,\n template,\n}: {\n stepObject: stepObject;\n sessionId: string;\n node: SessionTemplateNode;\n template: SessionTemplate;\n}) => {\n const [internalStep, setInternalStep] = useState(0);\n const [selfieData, setSelfieData] = useState<SelfieCaptureData | null>(null);\n const [selfiePhoto, setSelfiePhoto] = useState<string | null>(null);\n const [isTransitioning, setIsTransitioning] = useState(false);\n\n const handleConfirmSelfie = () => {\n // Ajouter une transition visuelle avant de passer à l'étape suivante\n setIsTransitioning(true);\n\n // Attendre un peu pour l'animation avant de passer à l'étape suivante\n setTimeout(() => {\n setInternalStep(2); // Passer à l'étape de traitement du selfie\n setIsTransitioning(false);\n }, 500);\n };\n\n const selfieProcessed = (processed: boolean) => {\n // Callback pour indiquer que le selfie a été traité\n if (processed) {\n // Increment currentStep in database immediately after successful analysis\n // This prevents double analysis if the user refreshes the page\n updateSessionCurrentStep(sessionId, stepObject.step + 1).catch((error) => {\n console.error(\"Failed to update current step after successful analysis:\", error);\n });\n stepObject.goToNextStep(node.id, template);\n }\n };\n\n const handleContinueAnyway = () => {\n updateSessionCurrentStep(sessionId, stepObject.step + 1).catch((error) => {\n console.error(\"Failed to update current step after KO bypass:\", error);\n });\n stepObject.goToNextStep(node.id, template);\n };\n\n const onRetake = () => {\n setInternalStep(0);\n };\n\n const handleRetakeSelfie = () => {\n setInternalStep(0);\n };\n\n const handleBackToParent = () => {\n // Retourner à l'étape précédente du flow principal\n stepObject.setStep(stepObject.step - 1);\n };\n\n console.log(\"[Selfie] buttonBgColor:\", template.buttonBgColor, \"buttonTextColor:\", template.buttonTextColor);\n\n return (\n <div\n className={`h-full w-full transition-opacity duration-500 ${isTransitioning ? \"opacity-50\" : \"opacity-100\"\n }`}\n >\n {internalStep === 0 && (\n <Video\n setSelfieData={setSelfieData}\n setStep={setInternalStep}\n onBack={handleBackToParent}\n btnBg={template.buttonBgColor ?? \"#11E5C5\"}\n btnText={template.buttonTextColor ?? \"#3C3C40\"}\n />\n )}\n {internalStep === 1 && selfieData && (\n <SelfieConfirmation\n selfieData={selfieData}\n onConfirm={handleConfirmSelfie}\n onRetake={handleRetakeSelfie}\n setSelfiePhoto={setSelfiePhoto}\n />\n )}\n {internalStep === 2 && selfieData && (\n <SelfieProcessing\n onProcessingComplete={selfieProcessed}\n selfieVideo={selfieData}\n selfiePhoto={selfiePhoto}\n onRetake={onRetake}\n onContinueAnyway={handleContinueAnyway}\n />\n )}\n </div>\n );\n};\n\nexport default Selfie;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAeA;;;AAGG;AACH,IAAM,MAAM,GAAG,UAAC,EAUf,EAAA;;QATC,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,QAAQ,GAAA,EAAA,CAAA,QAAA;IAOF,IAAA,EAAA,GAAkC,QAAQ,CAAC,CAAC,CAAC,EAA5C,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAe;IAC7C,IAAA,EAAA,GAA8B,QAAQ,CAA2B,IAAI,CAAC,EAArE,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,GAAA,EAAA,CAAA,CAAA,CAA4C;IACtE,IAAA,EAAA,GAAgC,QAAQ,CAAgB,IAAI,CAAC,EAA5D,WAAW,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,cAAc,GAAA,EAAA,CA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
+
import { __assign } from '../../node_modules/tslib/tslib.es6.js';
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import useIsMobile from '../../hooks/useIsMobile.js';
|
|
3
4
|
|
|
4
5
|
var Button = function (_a) {
|
|
5
|
-
var _b
|
|
6
|
+
var _b, _c;
|
|
7
|
+
var _d = _a.variant, variant = _d === void 0 ? "primary" : _d, children = _a.children, _e = _a.className, className = _e === void 0 ? "" : _e, style = _a.style, onClick = _a.onClick, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.type, type = _g === void 0 ? "button" : _g;
|
|
6
8
|
var isMobile = useIsMobile(768);
|
|
7
9
|
var baseShared = "flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter";
|
|
8
10
|
var base = isMobile
|
|
@@ -16,8 +18,8 @@ var Button = function (_a) {
|
|
|
16
18
|
return (jsx("button", { type: type, className: "".concat(base, " ").concat(disabled
|
|
17
19
|
? "bg-gray-200 text-gray-400 cursor-not-allowed opacity-60"
|
|
18
20
|
: "hover:brightness-110 active:brightness-90 cursor-pointer", " ").concat(className), style: disabled
|
|
19
|
-
?
|
|
20
|
-
: { backgroundColor: "var(--dk-btn-bg)", color: "var(--dk-btn-text)" }, onClick: onClick, disabled: disabled, children: children }));
|
|
21
|
+
? style
|
|
22
|
+
: __assign(__assign({}, style), { backgroundColor: (_b = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _b !== void 0 ? _b : "var(--dk-btn-bg)", color: (_c = style === null || style === void 0 ? void 0 : style.color) !== null && _c !== void 0 ? _c : "var(--dk-btn-text)" }), onClick: onClick, disabled: disabled, children: children }));
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export { Button as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../../src/components/ui/Button.tsx"],"sourcesContent":["/**\n * Button component - Unified adaptive button\n *\n * Adapts automatically between mobile and desktop using useIsMobile hook\n * rather than CSS responsive classes, for build compatibility.\n *\n * - Mobile: full width, tall (h-[48px], rounded-[12px])\n * - Desktop: auto width, comfortable (h-10, px-8, min-w-[140px])\n *\n * @param variant - \"primary\" (filled, default) | \"secondary\" (outlined)\n */\nimport useIsMobile from \"../../hooks/useIsMobile\";\n\ninterface ButtonProps {\n variant?: \"primary\" | \"secondary\";\n children: React.ReactNode;\n className?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst Button = ({\n variant = \"primary\",\n children,\n className = \"\",\n onClick,\n disabled = false,\n type = \"button\",\n}: ButtonProps) => {\n const isMobile = useIsMobile(768);\n\n const baseShared = \"flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter\";\n const base = isMobile\n ? `${baseShared} w-full h-[48px] rounded-[12px]`\n : `${baseShared} h-10 rounded-md px-8 min-w-[140px]`;\n\n if (variant === \"secondary\") {\n return (\n <button\n type={type}\n className={`${base} bg-transparent border border-gray-300 text-gray-600 ${\n disabled\n ? \"opacity-60 cursor-not-allowed\"\n : \"hover:bg-black/5 cursor-pointer\"\n } ${className}`}\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n }\n\n return (\n <button\n type={type}\n className={`${base} ${\n disabled\n ? \"bg-gray-200 text-gray-400 cursor-not-allowed opacity-60\"\n : \"hover:brightness-110 active:brightness-90 cursor-pointer\"\n } ${className}`}\n style={\n disabled\n ?
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../../src/components/ui/Button.tsx"],"sourcesContent":["/**\n * Button component - Unified adaptive button\n *\n * Adapts automatically between mobile and desktop using useIsMobile hook\n * rather than CSS responsive classes, for build compatibility.\n *\n * - Mobile: full width, tall (h-[48px], rounded-[12px])\n * - Desktop: auto width, comfortable (h-10, px-8, min-w-[140px])\n *\n * @param variant - \"primary\" (filled, default) | \"secondary\" (outlined)\n */\nimport useIsMobile from \"../../hooks/useIsMobile\";\n\ninterface ButtonProps {\n variant?: \"primary\" | \"secondary\";\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst Button = ({\n variant = \"primary\",\n children,\n className = \"\",\n style,\n onClick,\n disabled = false,\n type = \"button\",\n}: ButtonProps) => {\n const isMobile = useIsMobile(768);\n\n const baseShared = \"flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter\";\n const base = isMobile\n ? `${baseShared} w-full h-[48px] rounded-[12px]`\n : `${baseShared} h-10 rounded-md px-8 min-w-[140px]`;\n\n if (variant === \"secondary\") {\n return (\n <button\n type={type}\n className={`${base} bg-transparent border border-gray-300 text-gray-600 ${\n disabled\n ? \"opacity-60 cursor-not-allowed\"\n : \"hover:bg-black/5 cursor-pointer\"\n } ${className}`}\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n }\n\n return (\n <button\n type={type}\n className={`${base} ${\n disabled\n ? \"bg-gray-200 text-gray-400 cursor-not-allowed opacity-60\"\n : \"hover:brightness-110 active:brightness-90 cursor-pointer\"\n } ${className}`}\n style={\n disabled\n ? style\n : { ...style, backgroundColor: style?.backgroundColor ?? \"var(--dk-btn-bg)\", color: style?.color ?? \"var(--dk-btn-text)\" }\n }\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n"],"names":["_jsx"],"mappings":";;;;AAuBA,IAAM,MAAM,GAAG,UAAC,EAQF,EAAA;;AAPZ,IAAA,IAAA,EAAA,GAAA,EAAA,CAAA,OAAmB,EAAnB,OAAO,GAAA,EAAA,KAAA,MAAA,GAAG,SAAS,KAAA,EACnB,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,iBAAc,EAAd,SAAS,GAAA,EAAA,KAAA,MAAA,GAAG,EAAE,KAAA,EACd,KAAK,GAAA,EAAA,CAAA,KAAA,E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AA,GAAI,kBAAkB,EAAE,KAAK,EAAE,CAAA,EAAA,GAAA,KAAK,KAAA,IAAA,IAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,oBAAoB,GAAE,EAE9H,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,YAEjB,QAAQ,EAAA,CACF;AAEb;;;;"}
|
|
@@ -86,7 +86,7 @@ var getDocumentTemplateId = function (params) {
|
|
|
86
86
|
var normalizedCountry = countryCode === null || countryCode === void 0 ? void 0 : countryCode.toUpperCase();
|
|
87
87
|
var resolvedType = resolveDocumentType(documentId);
|
|
88
88
|
var documents = (_a = acceptedCountries === null || acceptedCountries === void 0 ? void 0 : acceptedCountries.find(function (country) { var _a; return ((_a = country.code) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === normalizedCountry; })) === null || _a === void 0 ? void 0 : _a.documents;
|
|
89
|
-
if (resolvedType && ((_b = documents === null || documents === void 0 ? void 0 : documents[resolvedType]) === null || _b === void 0 ? void 0 : _b.length) && (documents === null || documents === void 0 ? void 0 : documents[resolvedType][0]) != "INT") {
|
|
89
|
+
if (resolvedType && ((_b = documents === null || documents === void 0 ? void 0 : documents[resolvedType]) === null || _b === void 0 ? void 0 : _b.length) && (documents === null || documents === void 0 ? void 0 : documents[resolvedType][0]) != "INT" && (documents === null || documents === void 0 ? void 0 : documents[resolvedType][0]) != "EU") {
|
|
90
90
|
// Special case for France pink driving license (1989 format)
|
|
91
91
|
var docName = (_d = (_c = documentTemplates === null || documentTemplates === void 0 ? void 0 : documentTemplates.data) === null || _c === void 0 ? void 0 : _c.find(function (tpl) { return tpl.id === documents[resolvedType][0]; })) === null || _d === void 0 ? void 0 : _d.name;
|
|
92
92
|
if (normalizedCountry === "FR" && resolvedType === "driverLicense" && docName === "france_driving_license_1989" && documents[resolvedType][1]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentTemplate.js","sources":["../../../../src/services/documentTemplate.ts"],"sourcesContent":["import { apiService } from \"./api\";\nimport type { AcceptedCountry } from \"../types/session\";\n\nexport interface DocumentTemplate {\n id: string;\n name: string;\n countryCode: string;\n acceptedFormats: string[];\n maxFiles: number;\n minFiles: number;\n maxPages: number;\n maxSize: number;\n sides: string;\n}\n\nexport interface FetchedDocumentTemplates {\n status: number;\n message: string;\n data: DocumentTemplate[];\n}\n\nconst DOCUMENT_ID_TO_TYPE: Record<string, keyof AcceptedCountry[\"documents\"]> = {\n passport: \"passport\",\n \"jdi-3\": \"passport\",\n idcard: \"idCard\",\n idCard: \"idCard\",\n \"jdi-2\": \"idCard\",\n driverlicense: \"driverLicense\",\n driverLicense: \"driverLicense\",\n \"jdi-4\": \"driverLicense\",\n residencepermit: \"residencePermit\",\n residencePermit: \"residencePermit\",\n \"jdi-5\": \"residencePermit\",\n pinkdriverlicense: \"pinkDriverLicense\",\n pinkDriverLicense: \"pinkDriverLicense\",\n};\n\n\n/**\n * Retrieves the document type key for API requests based on the document type.\n * \n * @param docType - The document type from the AcceptedCountry documents\n * @returns The corresponding document type key string used in API requests\n * \n * @example\n * ```typescript\n * getDocTypeKey('passport') // returns 'passport'\n * getDocTypeKey('idCard') // returns 'id_card'\n * getDocTypeKey('driverLicense') // returns 'driving_license'\n * ```\n */\nexport const getDocTypeKey = (docType: keyof AcceptedCountry[\"documents\"]): string => {\n switch (docType) {\n case \"passport\":\n return \"passport\";\n case \"idCard\":\n return \"id_card\";\n case \"residencePermit\":\n return \"residency_permit\";\n case \"driverLicense\":\n return \"driving_license\";\n case \"pinkDriverLicense\":\n return \"driving_license_1989\";\n default:\n return String(docType).toLowerCase();\n }\n};\n\n\n\n/**\n * Resolves a document ID string to its corresponding document type.\n * Performs case-insensitive matching against the DOCUMENT_ID_TO_TYPE mapping.\n * \n * @param documentId - The document identifier to resolve\n * @returns The resolved document type or undefined if no match is found\n * \n * @internal\n */\nconst resolveDocumentType = (documentId: string): keyof AcceptedCountry[\"documents\"] | undefined => {\n return DOCUMENT_ID_TO_TYPE[documentId] ?? DOCUMENT_ID_TO_TYPE[documentId.toLowerCase()];\n};\n\n\n/**\n * Retrieves the document template ID for a specific country and document type.\n * First attempts to find the template ID from acceptedCountries data.\n * If not found, falls back to searching through documentTemplates by matching country code and template name.\n * \n * @param params - Configuration object\n * @param params.countryCode - The ISO country code (case-insensitive)\n * @param params.documentId - The document type identifier\n * @param params.acceptedCountries - Optional array of accepted countries with their document configurations\n * @param params.documentTemplates - Optional fetched document templates to search through\n * @returns The document template ID if found, otherwise undefined\n * \n * @example\n * ```typescript\n * const templateId = getDocumentTemplateId({\n * countryCode: 'FR',\n * documentId: 'passport',\n * acceptedCountries: countries,\n * documentTemplates: templates\n * });\n * ```\n */\nexport const getDocumentTemplateId = (params: {\n countryCode: string;\n documentId: string;\n acceptedCountries?: AcceptedCountry[];\n documentTemplates?: FetchedDocumentTemplates;\n}): string | undefined => {\n const { countryCode, documentId, acceptedCountries, documentTemplates } = params;\n const normalizedCountry = countryCode?.toUpperCase();\n const resolvedType = resolveDocumentType(documentId);\n\n const documents = acceptedCountries?.find(\n (country) => country.code?.toUpperCase() === normalizedCountry\n )?.documents;\n\n if (resolvedType && documents?.[resolvedType]?.length && documents?.[resolvedType][0] != \"INT\") {\n // Special case for France pink driving license (1989 format)\n const docName = documentTemplates?.data?.find(tpl => tpl.id === documents[resolvedType][0])?.name;\n if (normalizedCountry === \"FR\" && resolvedType === \"driverLicense\" && docName === \"france_driving_license_1989\" && documents[resolvedType][1]) {\n return documents[resolvedType][1];\n }\n return documents[resolvedType][0];\n }\n\n if (!resolvedType) {\n return undefined;\n }\n\n const templateKey = getDocTypeKey(resolvedType).toLowerCase();\n const matchedTemplate = documentTemplates?.data?.findLast((tpl) => {\n return (\n tpl.countryCode === normalizedCountry &&\n (tpl.name?.toLowerCase() || \"\").includes(templateKey)\n );\n });\n\n return matchedTemplate?.id;\n};\n\n\n/**\n * Fetches all document templates from the API with optional filtering.\n * \n * @param params - Optional configuration object for filtering results\n * @param params.type - Filter templates by document type\n * @param params.tags - Filter templates by tags array\n * @returns Promise resolving to fetched document templates data\n * @throws {Error} Throws an error if the API request fails\n * \n * @example\n * ```typescript\n * // Fetch all templates\n * const allTemplates = await getAllDocumentTemplates();\n * \n * // Fetch templates with filters\n * const filteredTemplates = await getAllDocumentTemplates({\n * type: 'proof_of_identity',\n * tags: ['biometric', 'eu']\n * });\n * ```\n */\nexport const getAllDocumentTemplates = async (params?: {\n type?: string;\n tags?: string[];\n}): Promise<FetchedDocumentTemplates> => {\n const query = new URLSearchParams();\n if (params?.type) query.append(\"type\", params.type);\n if (params?.tags && params.tags.length > 0) {\n params.tags.forEach((tag) => query.append(\"tags\", tag));\n }\n\n const url = \"document/get-all-document-templates\";\n const response = await apiService.get<FetchedDocumentTemplates>(\n `${url}?${query.toString()}`\n );\n if (!response.success) {\n throw new Error(\"Failed to fetch document templates\");\n }\n return response.data;\n};\n"],"names":[],"mappings":";;;AAqBA,IAAM,mBAAmB,GAAuD;AAC9E,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,OAAO,EAAE,QAAQ;AACjB,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,OAAO,EAAE,eAAe;AACxB,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,iBAAiB,EAAE,mBAAmB;CACvC;AAGD;;;;;;;;;;;;AAYG;AACI,IAAM,aAAa,GAAG,UAAC,OAA2C,EAAA;IACvE,QAAQ,OAAO;AACb,QAAA,KAAK,UAAU;AACb,YAAA,OAAO,UAAU;AACnB,QAAA,KAAK,QAAQ;AACX,YAA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C/D,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,SAAS;AAEZ,IAAA,IAAI,YAAY,KAAI,CAAA,EAAA,GAAA,SAAS,KAAA,IAAA,IAAT,SAAS,
|
|
1
|
+
{"version":3,"file":"documentTemplate.js","sources":["../../../../src/services/documentTemplate.ts"],"sourcesContent":["import { apiService } from \"./api\";\nimport type { AcceptedCountry } from \"../types/session\";\n\nexport interface DocumentTemplate {\n id: string;\n name: string;\n countryCode: string;\n acceptedFormats: string[];\n maxFiles: number;\n minFiles: number;\n maxPages: number;\n maxSize: number;\n sides: string;\n}\n\nexport interface FetchedDocumentTemplates {\n status: number;\n message: string;\n data: DocumentTemplate[];\n}\n\nconst DOCUMENT_ID_TO_TYPE: Record<string, keyof AcceptedCountry[\"documents\"]> = {\n passport: \"passport\",\n \"jdi-3\": \"passport\",\n idcard: \"idCard\",\n idCard: \"idCard\",\n \"jdi-2\": \"idCard\",\n driverlicense: \"driverLicense\",\n driverLicense: \"driverLicense\",\n \"jdi-4\": \"driverLicense\",\n residencepermit: \"residencePermit\",\n residencePermit: \"residencePermit\",\n \"jdi-5\": \"residencePermit\",\n pinkdriverlicense: \"pinkDriverLicense\",\n pinkDriverLicense: \"pinkDriverLicense\",\n};\n\n\n/**\n * Retrieves the document type key for API requests based on the document type.\n * \n * @param docType - The document type from the AcceptedCountry documents\n * @returns The corresponding document type key string used in API requests\n * \n * @example\n * ```typescript\n * getDocTypeKey('passport') // returns 'passport'\n * getDocTypeKey('idCard') // returns 'id_card'\n * getDocTypeKey('driverLicense') // returns 'driving_license'\n * ```\n */\nexport const getDocTypeKey = (docType: keyof AcceptedCountry[\"documents\"]): string => {\n switch (docType) {\n case \"passport\":\n return \"passport\";\n case \"idCard\":\n return \"id_card\";\n case \"residencePermit\":\n return \"residency_permit\";\n case \"driverLicense\":\n return \"driving_license\";\n case \"pinkDriverLicense\":\n return \"driving_license_1989\";\n default:\n return String(docType).toLowerCase();\n }\n};\n\n\n\n/**\n * Resolves a document ID string to its corresponding document type.\n * Performs case-insensitive matching against the DOCUMENT_ID_TO_TYPE mapping.\n * \n * @param documentId - The document identifier to resolve\n * @returns The resolved document type or undefined if no match is found\n * \n * @internal\n */\nconst resolveDocumentType = (documentId: string): keyof AcceptedCountry[\"documents\"] | undefined => {\n return DOCUMENT_ID_TO_TYPE[documentId] ?? DOCUMENT_ID_TO_TYPE[documentId.toLowerCase()];\n};\n\n\n/**\n * Retrieves the document template ID for a specific country and document type.\n * First attempts to find the template ID from acceptedCountries data.\n * If not found, falls back to searching through documentTemplates by matching country code and template name.\n * \n * @param params - Configuration object\n * @param params.countryCode - The ISO country code (case-insensitive)\n * @param params.documentId - The document type identifier\n * @param params.acceptedCountries - Optional array of accepted countries with their document configurations\n * @param params.documentTemplates - Optional fetched document templates to search through\n * @returns The document template ID if found, otherwise undefined\n * \n * @example\n * ```typescript\n * const templateId = getDocumentTemplateId({\n * countryCode: 'FR',\n * documentId: 'passport',\n * acceptedCountries: countries,\n * documentTemplates: templates\n * });\n * ```\n */\nexport const getDocumentTemplateId = (params: {\n countryCode: string;\n documentId: string;\n acceptedCountries?: AcceptedCountry[];\n documentTemplates?: FetchedDocumentTemplates;\n}): string | undefined => {\n const { countryCode, documentId, acceptedCountries, documentTemplates } = params;\n const normalizedCountry = countryCode?.toUpperCase();\n const resolvedType = resolveDocumentType(documentId);\n\n const documents = acceptedCountries?.find(\n (country) => country.code?.toUpperCase() === normalizedCountry\n )?.documents;\n\n if (resolvedType && documents?.[resolvedType]?.length && documents?.[resolvedType][0] != \"INT\" && documents?.[resolvedType][0] != \"EU\") {\n // Special case for France pink driving license (1989 format)\n const docName = documentTemplates?.data?.find(tpl => tpl.id === documents[resolvedType][0])?.name;\n if (normalizedCountry === \"FR\" && resolvedType === \"driverLicense\" && docName === \"france_driving_license_1989\" && documents[resolvedType][1]) {\n return documents[resolvedType][1];\n }\n return documents[resolvedType][0];\n }\n\n if (!resolvedType) {\n return undefined;\n }\n\n const templateKey = getDocTypeKey(resolvedType).toLowerCase();\n const matchedTemplate = documentTemplates?.data?.findLast((tpl) => {\n return (\n tpl.countryCode === normalizedCountry &&\n (tpl.name?.toLowerCase() || \"\").includes(templateKey)\n );\n });\n\n return matchedTemplate?.id;\n};\n\n\n/**\n * Fetches all document templates from the API with optional filtering.\n * \n * @param params - Optional configuration object for filtering results\n * @param params.type - Filter templates by document type\n * @param params.tags - Filter templates by tags array\n * @returns Promise resolving to fetched document templates data\n * @throws {Error} Throws an error if the API request fails\n * \n * @example\n * ```typescript\n * // Fetch all templates\n * const allTemplates = await getAllDocumentTemplates();\n * \n * // Fetch templates with filters\n * const filteredTemplates = await getAllDocumentTemplates({\n * type: 'proof_of_identity',\n * tags: ['biometric', 'eu']\n * });\n * ```\n */\nexport const getAllDocumentTemplates = async (params?: {\n type?: string;\n tags?: string[];\n}): Promise<FetchedDocumentTemplates> => {\n const query = new URLSearchParams();\n if (params?.type) query.append(\"type\", params.type);\n if (params?.tags && params.tags.length > 0) {\n params.tags.forEach((tag) => query.append(\"tags\", tag));\n }\n\n const url = \"document/get-all-document-templates\";\n const response = await apiService.get<FetchedDocumentTemplates>(\n `${url}?${query.toString()}`\n );\n if (!response.success) {\n throw new Error(\"Failed to fetch document templates\");\n }\n return response.data;\n};\n"],"names":[],"mappings":";;;AAqBA,IAAM,mBAAmB,GAAuD;AAC9E,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,OAAO,EAAE,QAAQ;AACjB,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,OAAO,EAAE,eAAe;AACxB,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,iBAAiB,EAAE,mB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