datakeen-session-react 1.1.140-dev.153 → 1.1.140-dev.154
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/template/ComplementaryMandateNodeHandler.js +36 -0
- package/dist/cjs/components/template/ComplementaryMandateNodeHandler.js.map +1 -0
- package/dist/cjs/components/template/TemplateNodeRenderer.js +3 -0
- package/dist/cjs/components/template/TemplateNodeRenderer.js.map +1 -1
- package/dist/cjs/hooks/useStepNavigation.js +1 -1
- package/dist/cjs/hooks/useStepNavigation.js.map +1 -1
- package/dist/cjs/i18n/en.json.js +22 -1
- package/dist/cjs/i18n/en.json.js.map +1 -1
- package/dist/cjs/i18n/es.json.js +22 -1
- package/dist/cjs/i18n/es.json.js.map +1 -1
- package/dist/cjs/i18n/fr.json.js +22 -1
- package/dist/cjs/i18n/fr.json.js.map +1 -1
- package/dist/cjs/services/sessionService.js +33 -6
- package/dist/cjs/services/sessionService.js.map +1 -1
- package/dist/cjs/types/session.js.map +1 -1
- package/dist/esm/components/template/ComplementaryMandateNodeHandler.js +32 -0
- package/dist/esm/components/template/ComplementaryMandateNodeHandler.js.map +1 -0
- package/dist/esm/components/template/TemplateNodeRenderer.js +3 -0
- package/dist/esm/components/template/TemplateNodeRenderer.js.map +1 -1
- package/dist/esm/hooks/useStepNavigation.js +1 -1
- package/dist/esm/hooks/useStepNavigation.js.map +1 -1
- package/dist/esm/i18n/en.json.js +22 -2
- package/dist/esm/i18n/en.json.js.map +1 -1
- package/dist/esm/i18n/es.json.js +22 -2
- package/dist/esm/i18n/es.json.js.map +1 -1
- package/dist/esm/i18n/fr.json.js +22 -2
- package/dist/esm/i18n/fr.json.js.map +1 -1
- package/dist/esm/services/sessionService.js +33 -7
- package/dist/esm/services/sessionService.js.map +1 -1
- package/dist/esm/types/session.js.map +1 -1
- package/docs/COMPLEMENTARY_MANDATE.md +22 -0
- package/docs/JOURNEY_NODE_BUILDER.md +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var useI18n = require('../../hooks/useI18n.js');
|
|
8
|
+
var sessionService = require('../../services/sessionService.js');
|
|
9
|
+
var LoadingState = require('../states/LoadingState.js');
|
|
10
|
+
var Button = require('../ui/Button.js');
|
|
11
|
+
|
|
12
|
+
function ComplementaryMandateNodeHandler(_a) {
|
|
13
|
+
var sessionId = _a.sessionId, nodeId = _a.nodeId, onOutcome = _a.onOutcome;
|
|
14
|
+
var t = useI18n.useI18n().t;
|
|
15
|
+
var _b = React.useState(false), error = _b[0], setError = _b[1];
|
|
16
|
+
var _c = React.useState(0), attempt = _c[0], setAttempt = _c[1];
|
|
17
|
+
var callback = React.useRef(onOutcome);
|
|
18
|
+
callback.current = onOutcome;
|
|
19
|
+
React.useEffect(function () {
|
|
20
|
+
var active = true;
|
|
21
|
+
setError(false);
|
|
22
|
+
sessionService.checkComplementaryMandate(sessionId, nodeId).then(function (_a) {
|
|
23
|
+
var outcome = _a.outcome;
|
|
24
|
+
if (active)
|
|
25
|
+
callback.current(outcome);
|
|
26
|
+
}).catch(function () { if (active)
|
|
27
|
+
setError(true); });
|
|
28
|
+
return function () { active = false; };
|
|
29
|
+
}, [sessionId, nodeId, attempt]);
|
|
30
|
+
if (!error)
|
|
31
|
+
return jsxRuntime.jsx(LoadingState.default, { message: t('complementary_mandate.loading') });
|
|
32
|
+
return jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-4 p-6", children: [jsxRuntime.jsx("p", { role: "alert", children: t('complementary_mandate.error') }), jsxRuntime.jsx(Button.default, { onClick: function () { return setAttempt(function (value) { return value + 1; }); }, children: t('complementary_mandate.retry') })] });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.default = ComplementaryMandateNodeHandler;
|
|
36
|
+
//# sourceMappingURL=ComplementaryMandateNodeHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComplementaryMandateNodeHandler.js","sources":["../../../../../src/components/template/ComplementaryMandateNodeHandler.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { useI18n } from '../../hooks/useI18n';\nimport { checkComplementaryMandate } from '../../services/sessionService';\nimport type { ComplementaryMandateOutcome } from '../../types/session';\nimport LoadingState from '../states/LoadingState';\nimport Button from '../ui/Button';\n\nexport default function ComplementaryMandateNodeHandler({ sessionId, nodeId, onOutcome }: { sessionId: string; nodeId: string; onOutcome: (outcome: ComplementaryMandateOutcome) => void }) {\n const { t } = useI18n();\n const [error, setError] = useState(false);\n const [attempt, setAttempt] = useState(0);\n const callback = useRef(onOutcome);\n callback.current = onOutcome;\n useEffect(() => {\n let active = true;\n setError(false);\n checkComplementaryMandate(sessionId, nodeId).then(({ outcome }) => {\n if (active) callback.current(outcome);\n }).catch(() => { if (active) setError(true); });\n return () => { active = false; };\n }, [sessionId, nodeId, attempt]);\n if (!error) return <LoadingState message={t('complementary_mandate.loading')} />;\n return <div className=\"flex flex-col items-center gap-4 p-6\">\n <p role=\"alert\">{t('complementary_mandate.error')}</p>\n <Button onClick={() => setAttempt(value => value + 1)}>{t('complementary_mandate.retry')}</Button>\n </div>;\n}\n"],"names":["useI18n","useState","useRef","useEffect","checkComplementaryMandate","_jsx","LoadingState","_jsxs","Button"],"mappings":";;;;;;;;;;;AAOc,SAAU,+BAA+B,CAAC,EAAkI,EAAA;AAAhI,IAAA,IAAA,SAAS,eAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SAAA;AAC5E,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IACH,IAAA,EAAA,GAAoBC,cAAQ,CAAC,KAAK,CAAC,EAAlC,KAAK,GAAA,EAAA,CAAA,CAAA,CA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,EAAI,OAAA,KAAK,GAAG,CAAC,CAAA,CAAT,CAAS,CAAC,CAAA,CAA9B,CAA8B,YAAG,CAAC,CAAC,6BAA6B,CAAC,EAAA,CAAU,IAC9F;AACR;;;;"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var ComplementaryMandateNodeHandler = require('./ComplementaryMandateNodeHandler.js');
|
|
7
8
|
var React = require('react');
|
|
8
9
|
var Selfie = require('../session/Selfie.js');
|
|
9
10
|
var VideoWorkInProgress = require('../session/VideoWorkInProgress.js');
|
|
@@ -127,6 +128,8 @@ var TemplateNodeRenderer = function (_a) {
|
|
|
127
128
|
case "condition":
|
|
128
129
|
console.debug("🔀 Rendering Condition Node Handler component and well");
|
|
129
130
|
return (jsxRuntime.jsx(ConditionNodeHandler.default, { node: node, session: session, templateNodes: templateNodes, stepObject: stepObject, userInput: userInput, contactInfo: contactInfo }));
|
|
131
|
+
case "complementary-mandate":
|
|
132
|
+
return jsxRuntime.jsx(ComplementaryMandateNodeHandler.default, { sessionId: sessionId, nodeId: node.id, onOutcome: function (outcome) { return stepObject.goToNextStep(node.id, session.template, outcome); } });
|
|
130
133
|
case "external-verification":
|
|
131
134
|
console.debug("🔍 Rendering External Verification Node Handler");
|
|
132
135
|
return (jsxRuntime.jsx(ExternalVerificationNodeHandler.default, { node: node, session: session, userInput: userInput, setUserInput: setUserInput, onNext: function () { return stepObject.goToNextStep(node.id, session.template); }, onPrevious: function () { return stepObject.goBack(); }, onNavigateToNode: function (nodeId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateNodeRenderer.js","sources":["../../../../../src/components/template/TemplateNodeRenderer.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport Selfie from \"../session/Selfie\";\nimport VideoWorkInProgress from \"../session/VideoWorkInProgress\";\nimport DocumentCheck, { NodeIdentityControl } from \"../session/DocumentCheck\";\nimport DocumentCollection, {\n DocumentTypeSide,\n NodeDocumentCollection,\n} from \"../document-collection/DocumentCollection\";\nimport EndFlow from \"../session/EndFlow\";\nimport LoadingState from \"../states/LoadingState\";\nimport JDDWorkInProgress from \"../jdi/JDDWorkInProgress\";\nimport { getOrderedJourneySteps, getRunPrefillData } from \"../../services/sessionService\";\nimport type { SessionData, stepObject } from \"../../types/session\";\nimport type { UserInput } from \"../../types/userInput\";\nimport type { ContactInfo } from \"../../types/contactInfo\";\nimport UserInputForm from \"../session/UserInputForm\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport ConditionNodeHandler from \"./ConditionNodeHandler\";\nimport SignatureElectronic from \"../signature-electronic/SignatureElectronic\";\nimport ExternalVerificationNodeHandler from \"./ExternalVerificationNodeHandler\";\nimport PdfGeneration from \"../session/PdfGeneration\";\nimport LegalConsentNode from \"../legal-consent/LegalConsentNode\";\n\ninterface TemplateNodeRendererProps {\n session: SessionData;\n sessionId: string;\n stepObject: stepObject;\n stepHistory: number[];\n templateIndex: number;\n onContinueOnPC: () => void;\n userInput: UserInput;\n setUserInput: React.Dispatch<React.SetStateAction<UserInput>>;\n contactInfo: ContactInfo;\n setContactInfo: React.Dispatch<React.SetStateAction<ContactInfo>>;\n isMobileTemplate: boolean;\n}\n\nconst TemplateNodeRenderer: React.FC<TemplateNodeRendererProps> = ({\n session,\n sessionId,\n stepObject,\n stepHistory,\n templateIndex,\n onContinueOnPC,\n userInput,\n setUserInput,\n contactInfo,\n setContactInfo,\n isMobileTemplate,\n}) => {\n const { t } = useI18n();\n\n if (!session?.template) {\n console.error(t(\"template.error.console_no_template\"));\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"template.error.configuration\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">{t(\"template.error.no_template\")}</p>\n </div>\n );\n }\n\n // Check if session is ended before rendering nodes\n if (session.status === \"ended\") {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session.status}\n callbackURL={session.callbackURL}\n compliantCase={session.template?.endScreenConfig?.compliant}\n nonCompliantCase={session.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // Use getOrderedWorkflowSteps to get sorted and filtered nodes\n const templateNodes = useMemo(\n () => getOrderedJourneySteps(session.template),\n [session.template],\n );\n\n // Check if index is valid\n if (templateNodes.length === 0) {\n console.warn(\"No valid template nodes found after filtering\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n />\n );\n }\n\n if (templateIndex < 0 || templateIndex >= templateNodes.length) {\n console.warn(\n `Invalid template index: ${templateIndex}, max index: ${templateNodes.length - 1\n }`,\n );\n\n // If we're beyond the maximum index, it means we've completed all nodes\n if (templateIndex >= templateNodes.length) {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // If index is negative, redirect to start\n if (templateIndex < 0) {\n setTimeout(() => stepObject.setStep(0), 0);\n return <LoadingState message={t(\"loading.step\")} subtitle=\"\" />;\n }\n }\n\n // At this point, we should have a valid node\n const node = templateNodes[templateIndex];\n if (!node) {\n console.error(\n `Node at index ${templateIndex} is undefined. Available nodes:`,\n templateNodes,\n );\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"template.error.render\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"template.error.node_not_found\")}\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n {t(\"template.buttons.restart\")}\n </button>\n </div>\n );\n }\n\n switch (node.type) {\n case \"end\":\n console.log(\"📄 Rendering EndFlow component\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n endNodeId={node.id}\n expectedResult={node.expectedResult}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n\n case \"information-input\": {\n // runIndex = nombre de fois que ce step a déjà été visité dans l'historique\n // (0 = premier passage, 1 = deuxième, …).\n // On compte les occurrences de (templateIndex + 1) dans stepHistory,\n // minus 1 car le step courant est déjà dans l'historique.\n const currentStep = templateIndex + 1;\n const visitCount = stepHistory.filter((s) => s === currentStep).length;\n const runIndex = Math.max(0, visitCount - 1);\n\n // Pré-remplissage multi-ENTITÉS : si _list présent, utiliser _list[runIndex]\n // (ou {} hors borne). L'énumération de plusieurs entités successives passe\n // exclusivement par _list (cf. docs/multi-runs.md).\n // Sans _list : on pré-remplit TOUJOURS depuis le userInput persisté — y compris\n // sur une ré-entrée (boucle condition de correction, retour arrière, bouton\n // \"Corriger ma saisie\"). Une ré-entrée sans _list = corriger les MÊMES données,\n // pas en saisir de nouvelles → on ne doit pas vider le formulaire.\n const hasList = Array.isArray(\n (session.userInput as Record<string, unknown>)?._list,\n );\n let initialUserInput: UserInput;\n if (hasList) {\n const prefill = getRunPrefillData(\n session.userInput as Record<string, unknown>,\n runIndex,\n );\n initialUserInput = (prefill ?? {}) as UserInput;\n } else {\n initialUserInput = userInput;\n }\n return (\n // key={node.id} : remonte le formulaire à chaque changement de nœud, pour\n // qu'il se ré-initialise depuis initialUserInput (comportement \"refresh sans\n // refresh\"). Évite la réutilisation d'instance qui laissait customFormData\n // périmé au retour arrière entre deux nœuds information-input.\n <UserInputForm\n key={node.id}\n stepObject={stepObject}\n node={node}\n template={session.template}\n setUserInput={setUserInput}\n initialUserInput={initialUserInput}\n contactInfo={contactInfo}\n setContactInfo={setContactInfo}\n sessionId={sessionId}\n />\n );\n }\n\n case \"document-collection\": {\n return (\n <DocumentCollection\n key={`doc-collection-${templateIndex}`}\n node={node as NodeDocumentCollection}\n stepObject={stepObject}\n sessionId={sessionId}\n template={session.template}\n onContinueOnPC={onContinueOnPC}\n allowedDocumentTypes={(node.allowedDocumentTypes || []).map(\n (docType: any) => ({\n ...docType,\n side:\n typeof docType.side === \"string\" ||\n typeof docType.side === \"number\"\n ? (docType.side as DocumentTypeSide)\n : undefined,\n }),\n )}\n allowedAddingMethods={node.allowedAddingMethods || [\"download\"]}\n introductionPage={node.introductionPage}\n documentSelection={node.documentSelection}\n allowResubmission={node.allowResubmission}\n maxResubmissionAttempts={node.maxResubmissionAttempts}\n />\n );\n }\n\n case \"document-selection\":\n case \"controle-jdi\": {\n if (!node.requiredDocumentType) {\n console.error(\n \"Missing requiredDocumentType in document-selection node:\",\n node,\n );\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n Erreur de configuration\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type de document requis n'est pas spécifié dans le template.\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n Recommencer\n </button>\n </div>\n );\n }\n\n // Determine if current device is mobile for capture method\n const isMobile =\n /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(\n navigator.userAgent,\n );\n\n return (\n <DocumentCheck\n key={`doc-check-${templateIndex}`}\n stepObject={stepObject}\n node={node as NodeIdentityControl}\n sessionId={sessionId}\n documentTypeId={node.requiredDocumentType}\n acceptedCountries={node.acceptedCountries}\n onContinueOnPC={onContinueOnPC}\n isMobileCapture={isMobileTemplate && isMobile}\n allowedAddingMethods={\n node.allowedAddingMethods || [\"download\", \"picture\"]\n }\n template={session.template}\n templateIndex={templateIndex}\n setUserInput={setUserInput}\n />\n );\n // }\n }\n\n case \"biometric-capture\":\n case \"selfie-capture\":\n return (\n <Selfie\n key={`selfie-${templateIndex}`}\n stepObject={stepObject}\n sessionId={sessionId}\n node={node}\n template={session.template}\n />\n );\n\n case \"signature-electronic\":\n return (\n <SignatureElectronic\n key={`signature-${templateIndex}`}\n sessionId={sessionId}\n stepObject={stepObject}\n node={node}\n session={session}\n title={node.title}\n description={node.description}\n // Always pass a stable node identifier so backend can resolve\n // either a static DocuSeal template OR a generated PDF source.\n external_id={node.templateId || node.external_id || node.id}\n fieldMappings={node.fieldMappings}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"video-capture\":\n console.log(\"🎥 Rendering Video Work in Progress component\");\n return <VideoWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"jdd\":\n console.log(\"🚧 Rendering JDD Work in Progress component\");\n return <JDDWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"condition\":\n console.debug(\"🔀 Rendering Condition Node Handler component and well\");\n return (\n <ConditionNodeHandler\n node={node}\n session={session}\n templateNodes={templateNodes}\n stepObject={stepObject}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"external-verification\":\n console.debug(\"🔍 Rendering External Verification Node Handler\");\n return (\n <ExternalVerificationNodeHandler\n node={node}\n session={session}\n userInput={userInput}\n setUserInput={setUserInput}\n onNext={() => stepObject.goToNextStep(node.id, session.template)}\n onPrevious={() => stepObject.goBack()}\n onNavigateToNode={(nodeId: string) => {\n const idx = templateNodes.findIndex((n: any) => n.id === nodeId);\n // idx est 0-based, les steps sont 1-based → idx + 1.\n // goBackToStep tronque l'historique pour que le nœud corrigé\n // redevienne runIndex 0 (formulaire pré-rempli).\n if (idx !== -1) stepObject.goBackToStep(idx + 1);\n else stepObject.goBack();\n }}\n />\n );\n\n case \"pdf-generation\":\n console.debug(\"📄 Rendering PDF Generation component\");\n return (\n <PdfGeneration\n key={`pdf-generation-${templateIndex}`}\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n userInput={userInput}\n />\n );\n\n case \"legal-consent\":\n return (\n <LegalConsentNode\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n />\n );\n\n case \"custom\":\n // For custom nodes, we provide a basic structure that can be extended\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-blue-500 text-4xl mb-4\">🔧</div>\n <h2 className=\"text-xl font-bold text-blue-600 mb-2\">\n Nœud personnalisé\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Implémentation personnalisée requise pour: \"{node.title || node.id}\"\n </p>\n <div className=\"bg-blue-50 border border-blue-200 rounded p-3 text-left text-sm mb-4 max-w-md\">\n <p className=\"font-semibold text-blue-700 mb-2\">\n Configuration du nœud:\n </p>\n <pre className=\"text-xs overflow-auto max-h-32\">\n {JSON.stringify(\n {\n id: node.id,\n title: node.title,\n description: node.description,\n options: node.options,\n selectedOptions: node.selectedOptions,\n },\n null,\n 2,\n )}\n </pre>\n </div>\n <button\n className=\"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors\"\n onClick={() => {\n console.log(\"Custom node action:\", node);\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n\n default:\n console.warn(`❌ Type de nœud non supporté: ${node.type}`, node);\n console.log(\"❓ Available supported types:\", [\n \"end\",\n \"information-input\",\n \"document-collection\",\n \"document-selection\",\n \"document-upload\",\n \"controle-jdi\",\n \"selfie-capture\",\n \"video-capture\",\n \"country-selection\",\n \"identity-control\",\n \"jdd\",\n \"condition\",\n \"custom\",\n ]);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-yellow-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-yellow-600 mb-2\">\n Étape non supportée\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type d'étape \"{node.type}\" n'est pas pris en charge.\n </p>\n <div className=\"bg-gray-100 p-4 rounded mb-4 text-left text-xs overflow-auto max-h-32\">\n <pre>{JSON.stringify(node, null, 2)}</pre>\n </div>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => {\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n }\n};\n\nexport default TemplateNodeRenderer;\n"],"names":["useI18n","_jsxs","_jsx","EndFlow","useMemo","getOrderedJourneySteps","LoadingState","getRunPrefillData","UserInputForm","DocumentCollection","__assign","DocumentCheck","Selfie","SignatureElectronic","VideoWorkInProgress","JDDWorkInProgress","ConditionNodeHandler","ExternalVerificationNodeHandler","PdfGeneration","LegalConsentNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,oBAAoB,GAAwC,UAAC,EAYlE,EAAA;;AAXC,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,aAAa,mBAAA,EACb,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,gBAAgB,GAAA,EAAA,CAAA,gBAAA;AAER,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IAET,IAAI,EAAC,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,MAAA,GAAA,MAAA,GAAP,OAAO,CAAE,QAAQ,CAAA,EAAE;QACtB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC;AACtD,QAAA,QACEC,eAAA,CAAA,K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C,EAAA,CAAO,EAAA,CACtC,EACNA,cAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,YAAA;4BACP,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC;wBACpD,CAAC,EAAA,QAAA,EAEA,CAAC,CAAC,2BAA2B,CAAC,EAAA,CACxB,CAAA,EAAA,CACL;;AAGd;;;;"}
|
|
1
|
+
{"version":3,"file":"TemplateNodeRenderer.js","sources":["../../../../../src/components/template/TemplateNodeRenderer.tsx"],"sourcesContent":["import ComplementaryMandateNodeHandler from './ComplementaryMandateNodeHandler';\nimport React, { useMemo } from \"react\";\nimport Selfie from \"../session/Selfie\";\nimport VideoWorkInProgress from \"../session/VideoWorkInProgress\";\nimport DocumentCheck, { NodeIdentityControl } from \"../session/DocumentCheck\";\nimport DocumentCollection, {\n DocumentTypeSide,\n NodeDocumentCollection,\n} from \"../document-collection/DocumentCollection\";\nimport EndFlow from \"../session/EndFlow\";\nimport LoadingState from \"../states/LoadingState\";\nimport JDDWorkInProgress from \"../jdi/JDDWorkInProgress\";\nimport { getOrderedJourneySteps, getRunPrefillData } from \"../../services/sessionService\";\nimport type { SessionData, stepObject } from \"../../types/session\";\nimport type { UserInput } from \"../../types/userInput\";\nimport type { ContactInfo } from \"../../types/contactInfo\";\nimport UserInputForm from \"../session/UserInputForm\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport ConditionNodeHandler from \"./ConditionNodeHandler\";\nimport SignatureElectronic from \"../signature-electronic/SignatureElectronic\";\nimport ExternalVerificationNodeHandler from \"./ExternalVerificationNodeHandler\";\nimport PdfGeneration from \"../session/PdfGeneration\";\nimport LegalConsentNode from \"../legal-consent/LegalConsentNode\";\n\ninterface TemplateNodeRendererProps {\n session: SessionData;\n sessionId: string;\n stepObject: stepObject;\n stepHistory: number[];\n templateIndex: number;\n onContinueOnPC: () => void;\n userInput: UserInput;\n setUserInput: React.Dispatch<React.SetStateAction<UserInput>>;\n contactInfo: ContactInfo;\n setContactInfo: React.Dispatch<React.SetStateAction<ContactInfo>>;\n isMobileTemplate: boolean;\n}\n\nconst TemplateNodeRenderer: React.FC<TemplateNodeRendererProps> = ({\n session,\n sessionId,\n stepObject,\n stepHistory,\n templateIndex,\n onContinueOnPC,\n userInput,\n setUserInput,\n contactInfo,\n setContactInfo,\n isMobileTemplate,\n}) => {\n const { t } = useI18n();\n\n if (!session?.template) {\n console.error(t(\"template.error.console_no_template\"));\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"template.error.configuration\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">{t(\"template.error.no_template\")}</p>\n </div>\n );\n }\n\n // Check if session is ended before rendering nodes\n if (session.status === \"ended\") {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session.status}\n callbackURL={session.callbackURL}\n compliantCase={session.template?.endScreenConfig?.compliant}\n nonCompliantCase={session.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // Use getOrderedWorkflowSteps to get sorted and filtered nodes\n const templateNodes = useMemo(\n () => getOrderedJourneySteps(session.template),\n [session.template],\n );\n\n // Check if index is valid\n if (templateNodes.length === 0) {\n console.warn(\"No valid template nodes found after filtering\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n />\n );\n }\n\n if (templateIndex < 0 || templateIndex >= templateNodes.length) {\n console.warn(\n `Invalid template index: ${templateIndex}, max index: ${templateNodes.length - 1\n }`,\n );\n\n // If we're beyond the maximum index, it means we've completed all nodes\n if (templateIndex >= templateNodes.length) {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // If index is negative, redirect to start\n if (templateIndex < 0) {\n setTimeout(() => stepObject.setStep(0), 0);\n return <LoadingState message={t(\"loading.step\")} subtitle=\"\" />;\n }\n }\n\n // At this point, we should have a valid node\n const node = templateNodes[templateIndex];\n if (!node) {\n console.error(\n `Node at index ${templateIndex} is undefined. Available nodes:`,\n templateNodes,\n );\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"template.error.render\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"template.error.node_not_found\")}\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n {t(\"template.buttons.restart\")}\n </button>\n </div>\n );\n }\n\n switch (node.type) {\n case \"end\":\n console.log(\"📄 Rendering EndFlow component\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n endNodeId={node.id}\n expectedResult={node.expectedResult}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n\n case \"information-input\": {\n // runIndex = nombre de fois que ce step a déjà été visité dans l'historique\n // (0 = premier passage, 1 = deuxième, …).\n // On compte les occurrences de (templateIndex + 1) dans stepHistory,\n // minus 1 car le step courant est déjà dans l'historique.\n const currentStep = templateIndex + 1;\n const visitCount = stepHistory.filter((s) => s === currentStep).length;\n const runIndex = Math.max(0, visitCount - 1);\n\n // Pré-remplissage multi-ENTITÉS : si _list présent, utiliser _list[runIndex]\n // (ou {} hors borne). L'énumération de plusieurs entités successives passe\n // exclusivement par _list (cf. docs/multi-runs.md).\n // Sans _list : on pré-remplit TOUJOURS depuis le userInput persisté — y compris\n // sur une ré-entrée (boucle condition de correction, retour arrière, bouton\n // \"Corriger ma saisie\"). Une ré-entrée sans _list = corriger les MÊMES données,\n // pas en saisir de nouvelles → on ne doit pas vider le formulaire.\n const hasList = Array.isArray(\n (session.userInput as Record<string, unknown>)?._list,\n );\n let initialUserInput: UserInput;\n if (hasList) {\n const prefill = getRunPrefillData(\n session.userInput as Record<string, unknown>,\n runIndex,\n );\n initialUserInput = (prefill ?? {}) as UserInput;\n } else {\n initialUserInput = userInput;\n }\n return (\n // key={node.id} : remonte le formulaire à chaque changement de nœud, pour\n // qu'il se ré-initialise depuis initialUserInput (comportement \"refresh sans\n // refresh\"). Évite la réutilisation d'instance qui laissait customFormData\n // périmé au retour arrière entre deux nœuds information-input.\n <UserInputForm\n key={node.id}\n stepObject={stepObject}\n node={node}\n template={session.template}\n setUserInput={setUserInput}\n initialUserInput={initialUserInput}\n contactInfo={contactInfo}\n setContactInfo={setContactInfo}\n sessionId={sessionId}\n />\n );\n }\n\n case \"document-collection\": {\n return (\n <DocumentCollection\n key={`doc-collection-${templateIndex}`}\n node={node as NodeDocumentCollection}\n stepObject={stepObject}\n sessionId={sessionId}\n template={session.template}\n onContinueOnPC={onContinueOnPC}\n allowedDocumentTypes={(node.allowedDocumentTypes || []).map(\n (docType: any) => ({\n ...docType,\n side:\n typeof docType.side === \"string\" ||\n typeof docType.side === \"number\"\n ? (docType.side as DocumentTypeSide)\n : undefined,\n }),\n )}\n allowedAddingMethods={node.allowedAddingMethods || [\"download\"]}\n introductionPage={node.introductionPage}\n documentSelection={node.documentSelection}\n allowResubmission={node.allowResubmission}\n maxResubmissionAttempts={node.maxResubmissionAttempts}\n />\n );\n }\n\n case \"document-selection\":\n case \"controle-jdi\": {\n if (!node.requiredDocumentType) {\n console.error(\n \"Missing requiredDocumentType in document-selection node:\",\n node,\n );\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n Erreur de configuration\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type de document requis n'est pas spécifié dans le template.\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n Recommencer\n </button>\n </div>\n );\n }\n\n // Determine if current device is mobile for capture method\n const isMobile =\n /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(\n navigator.userAgent,\n );\n\n return (\n <DocumentCheck\n key={`doc-check-${templateIndex}`}\n stepObject={stepObject}\n node={node as NodeIdentityControl}\n sessionId={sessionId}\n documentTypeId={node.requiredDocumentType}\n acceptedCountries={node.acceptedCountries}\n onContinueOnPC={onContinueOnPC}\n isMobileCapture={isMobileTemplate && isMobile}\n allowedAddingMethods={\n node.allowedAddingMethods || [\"download\", \"picture\"]\n }\n template={session.template}\n templateIndex={templateIndex}\n setUserInput={setUserInput}\n />\n );\n // }\n }\n\n case \"biometric-capture\":\n case \"selfie-capture\":\n return (\n <Selfie\n key={`selfie-${templateIndex}`}\n stepObject={stepObject}\n sessionId={sessionId}\n node={node}\n template={session.template}\n />\n );\n\n case \"signature-electronic\":\n return (\n <SignatureElectronic\n key={`signature-${templateIndex}`}\n sessionId={sessionId}\n stepObject={stepObject}\n node={node}\n session={session}\n title={node.title}\n description={node.description}\n // Always pass a stable node identifier so backend can resolve\n // either a static DocuSeal template OR a generated PDF source.\n external_id={node.templateId || node.external_id || node.id}\n fieldMappings={node.fieldMappings}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"video-capture\":\n console.log(\"🎥 Rendering Video Work in Progress component\");\n return <VideoWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"jdd\":\n console.log(\"🚧 Rendering JDD Work in Progress component\");\n return <JDDWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"condition\":\n console.debug(\"🔀 Rendering Condition Node Handler component and well\");\n return (\n <ConditionNodeHandler\n node={node}\n session={session}\n templateNodes={templateNodes}\n stepObject={stepObject}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"complementary-mandate\":\n return <ComplementaryMandateNodeHandler sessionId={sessionId} nodeId={node.id} onOutcome={outcome => stepObject.goToNextStep(node.id, session.template, outcome)} />;\n\n case \"external-verification\":\n console.debug(\"🔍 Rendering External Verification Node Handler\");\n return (\n <ExternalVerificationNodeHandler\n node={node}\n session={session}\n userInput={userInput}\n setUserInput={setUserInput}\n onNext={() => stepObject.goToNextStep(node.id, session.template)}\n onPrevious={() => stepObject.goBack()}\n onNavigateToNode={(nodeId: string) => {\n const idx = templateNodes.findIndex((n: any) => n.id === nodeId);\n // idx est 0-based, les steps sont 1-based → idx + 1.\n // goBackToStep tronque l'historique pour que le nœud corrigé\n // redevienne runIndex 0 (formulaire pré-rempli).\n if (idx !== -1) stepObject.goBackToStep(idx + 1);\n else stepObject.goBack();\n }}\n />\n );\n\n case \"pdf-generation\":\n console.debug(\"📄 Rendering PDF Generation component\");\n return (\n <PdfGeneration\n key={`pdf-generation-${templateIndex}`}\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n userInput={userInput}\n />\n );\n\n case \"legal-consent\":\n return (\n <LegalConsentNode\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n />\n );\n\n case \"custom\":\n // For custom nodes, we provide a basic structure that can be extended\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-blue-500 text-4xl mb-4\">🔧</div>\n <h2 className=\"text-xl font-bold text-blue-600 mb-2\">\n Nœud personnalisé\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Implémentation personnalisée requise pour: \"{node.title || node.id}\"\n </p>\n <div className=\"bg-blue-50 border border-blue-200 rounded p-3 text-left text-sm mb-4 max-w-md\">\n <p className=\"font-semibold text-blue-700 mb-2\">\n Configuration du nœud:\n </p>\n <pre className=\"text-xs overflow-auto max-h-32\">\n {JSON.stringify(\n {\n id: node.id,\n title: node.title,\n description: node.description,\n options: node.options,\n selectedOptions: node.selectedOptions,\n },\n null,\n 2,\n )}\n </pre>\n </div>\n <button\n className=\"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors\"\n onClick={() => {\n console.log(\"Custom node action:\", node);\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n\n default:\n console.warn(`❌ Type de nœud non supporté: ${node.type}`, node);\n console.log(\"❓ Available supported types:\", [\n \"end\",\n \"information-input\",\n \"document-collection\",\n \"document-selection\",\n \"document-upload\",\n \"controle-jdi\",\n \"selfie-capture\",\n \"video-capture\",\n \"country-selection\",\n \"identity-control\",\n \"jdd\",\n \"condition\",\n \"custom\",\n ]);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-yellow-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-yellow-600 mb-2\">\n Étape non supportée\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type d'étape \"{node.type}\" n'est pas pris en charge.\n </p>\n <div className=\"bg-gray-100 p-4 rounded mb-4 text-left text-xs overflow-auto max-h-32\">\n <pre>{JSON.stringify(node, null, 2)}</pre>\n </div>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => {\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n }\n};\n\nexport default TemplateNodeRenderer;\n"],"names":["useI18n","_jsxs","_jsx","EndFlow","useMemo","getOrderedJourneySteps","LoadingState","getRunPrefillData","UserInputForm","DocumentCollection","__assign","DocumentCheck","Selfie","SignatureElectronic","VideoWorkInProgress","JDDWorkInProgress","ConditionNodeHandler","ComplementaryMandateNodeHandler","ExternalVerificationNodeHandler","PdfGeneration","LegalConsentNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsCA,IAAM,oBAAoB,GAAwC,UAAC,EAYlE,EAAA;;AAXC,IAAA,IAAA,OAAO,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5
5
|
var sessionService = require('../services/sessionService.js');
|
|
6
6
|
|
|
7
7
|
/** Node types that auto-execute and should be skipped when going back */
|
|
8
|
-
var AUTO_EXECUTING_TYPES = new Set(["external-verification", "condition"]);
|
|
8
|
+
var AUTO_EXECUTING_TYPES = new Set(["external-verification", "condition", "complementary-mandate"]);
|
|
9
9
|
var COMMITTED_NODE_TYPES = new Set(["selfie-capture", "biometric-capture"]);
|
|
10
10
|
var getNodeTypeAtStep = function (step, template) { var _a; return (_a = sessionService.getOrderedJourneySteps(template)[step - 1]) === null || _a === void 0 ? void 0 : _a.type; };
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStepNavigation.js","sources":["../../../../src/hooks/useStepNavigation.ts"],"sourcesContent":["import { useState, useEffect, useRef } from \"react\";\nimport {\n updateSessionCurrentStep,\n getNextStepIndex,\n getOrderedJourneySteps,\n reconstructHistoryToStep,\n} from \"../services/sessionService\";\nimport type { SessionTemplate } from \"../types/session\";\n\n/** Node types that auto-execute and should be skipped when going back */\nconst AUTO_EXECUTING_TYPES = new Set([\"external-verification\", \"condition\"]);\nconst COMMITTED_NODE_TYPES = new Set([\"selfie-capture\", \"biometric-capture\"]);\n\nconst getNodeTypeAtStep = (\n step: number,\n template: SessionTemplate,\n): string | undefined => getOrderedJourneySteps(template)[step - 1]?.type;\n\n/**\n * Rebuilds only the reversible part of a path after a committed node.\n * Auto-executing nodes immediately following the commit are excluded so the\n * first interactive destination remains the history boundary after reload.\n */\nconst trimHistoryAfterCommittedNode = (\n reconstructedHistory: number[],\n template: SessionTemplate,\n): number[] => {\n let committedHistoryIndex = -1;\n\n for (let index = reconstructedHistory.length - 2; index >= 0; index -= 1) {\n const nodeType = getNodeTypeAtStep(reconstructedHistory[index], template);\n if (nodeType && COMMITTED_NODE_TYPES.has(nodeType)) {\n committedHistoryIndex = index;\n break;\n }\n }\n\n if (committedHistoryIndex === -1) {\n return reconstructedHistory;\n }\n\n let reversibleHistoryStart = committedHistoryIndex + 1;\n while (reversibleHistoryStart < reconstructedHistory.length - 1) {\n const nodeType = getNodeTypeAtStep(\n reconstructedHistory[reversibleHistoryStart],\n template,\n );\n if (!nodeType || !AUTO_EXECUTING_TYPES.has(nodeType)) {\n break;\n }\n reversibleHistoryStart += 1;\n }\n\n return reconstructedHistory.slice(reversibleHistoryStart);\n};\n\nexport const useStepNavigation = (\n sessionId: string,\n sessionStatus?: string,\n initialStep?: number,\n template?: SessionTemplate,\n) => {\n const [step, setStepState] = useState(initialStep ?? 0);\n const [history, setHistory] = useState<number[]>(initialStep !== undefined ? [initialStep] : [0]);\n const hasInitialized = useRef(false);\n const committedNavigationPending = useRef(false);\n\n const setStep = (newStep: number, skipHistory = false) => {\n if (!skipHistory && newStep !== step) {\n setHistory((prev) => {\n if (prev[prev.length - 1] === newStep) return prev;\n return [...prev, newStep];\n });\n }\n setStepState(newStep);\n\n // Update current step in database\n if (sessionId) {\n updateSessionCurrentStep(sessionId, newStep).catch((error) => {\n console.error(\"Failed to update current step in database:\", error);\n // Non-blocking error - the step is still updated locally\n });\n }\n };\n\n const goBack = () => {\n if (history.length > 1) {\n let newHistory = [...history];\n newHistory.pop(); // Remove current step\n\n // Skip auto-executing nodes when going back\n if (template) {\n const orderedNodes = getOrderedJourneySteps(template);\n while (newHistory.length > 1) {\n const candidateStep = newHistory[newHistory.length - 1];\n // steps are 1-indexed (step 0 = start, step 1 = first node, etc.)\n const nodeIndex = candidateStep - 1;\n const candidateNode = orderedNodes[nodeIndex];\n if (candidateNode && AUTO_EXECUTING_TYPES.has(candidateNode.type)) {\n newHistory.pop();\n } else {\n break;\n }\n }\n }\n\n const previousStep = newHistory[newHistory.length - 1];\n setHistory(newHistory);\n setStep(previousStep, true);\n } else {\n console.warn(\"[goBack] BLOCKED — history.length <= 1, history:\", [...history]);\n }\n };\n\n /**\n * Retour arrière vers un nœud précis (ex: bouton \"Corriger ma saisie\").\n * Contrairement à `setStep`, on TRONQUE l'historique jusqu'à la dernière\n * occurrence de `targetStep` au lieu de l'empiler : le nœud cible cesse\n * ainsi d'être compté comme un \"revisit\" (runIndex 0 côté\n * TemplateNodeRenderer → formulaire pré-rempli). Si la cible n'est pas dans\n * l'historique, on retombe sur un `setStep` classique.\n */\n const goBackToStep = (targetStep: number) => {\n const idx = history.lastIndexOf(targetStep);\n if (idx !== -1) {\n const newHistory = history.slice(0, idx + 1);\n setHistory(newHistory);\n setStep(targetStep, true);\n } else {\n console.warn(\"[goBackToStep] target not in history — pushing instead:\", targetStep);\n setStep(targetStep);\n }\n };\n\n const goToNextStep = (\n currentNodeId: string,\n template: SessionTemplate,\n handle?: string\n ) => {\n const nextStepIndex = getNextStepIndex(currentNodeId, template, handle);\n\n if (nextStepIndex !== null) {\n if (committedNavigationPending.current) {\n const destinationType = getNodeTypeAtStep(nextStepIndex, template);\n committedNavigationPending.current = Boolean(\n destinationType && AUTO_EXECUTING_TYPES.has(destinationType),\n );\n setHistory([nextStepIndex]);\n setStep(nextStepIndex, true);\n } else {\n setStep(nextStepIndex);\n }\n } else {\n committedNavigationPending.current = false;\n console.warn(\n `[useStepNavigation] Could not find next step for node ${currentNodeId}. Staying on current step.`\n );\n }\n };\n\n /**\n * Navigates through the graph and makes the destination a point of no return.\n * The destination remains persisted by setStep, while prior history is discarded.\n */\n const goToNextStepCommitted = (\n currentNodeId: string,\n template: SessionTemplate,\n handle?: string,\n ) => {\n const nextStepIndex = getNextStepIndex(currentNodeId, template, handle);\n\n if (nextStepIndex !== null) {\n const destinationType = getNodeTypeAtStep(nextStepIndex, template);\n committedNavigationPending.current = Boolean(\n destinationType && AUTO_EXECUTING_TYPES.has(destinationType),\n );\n setHistory([nextStepIndex]);\n setStep(nextStepIndex, true);\n } else {\n committedNavigationPending.current = false;\n console.warn(\n `[useStepNavigation] Could not find next step for node ${currentNodeId}. Staying on current step.`,\n );\n }\n };\n\n // Initialize step from session data or status\n useEffect(() => {\n if (!sessionId) {\n return;\n }\n\n // Check if session is already ended\n if (sessionStatus === \"ended\") {\n setStepState(100);\n return;\n }\n\n // Only initialize once when initialStep becomes available\n if (initialStep !== undefined && !hasInitialized.current) {\n setStepState(initialStep);\n setHistory((prev) => {\n // Preserve history if the user already navigated past the initial step\n if (prev.length > 1 && prev[prev.length - 1] === initialStep) {\n return prev;\n }\n // Reconstruct history by following the graph from step 0\n const reconstructed = template\n ? trimHistoryAfterCommittedNode(\n reconstructHistoryToStep(initialStep, template),\n template,\n )\n : initialStep > 0 ? [0, initialStep] : [initialStep];\n return reconstructed;\n });\n hasInitialized.current = true;\n }\n }, [sessionId, sessionStatus, initialStep]);\n\n const stepObject = {\n setStep,\n goBack,\n goBackToStep,\n goToNextStep,\n goToNextStepCommitted,\n step,\n canGoBack: history.length > 1,\n };\n\n return {\n step,\n setStep,\n goBack,\n goBackToStep,\n goToNextStep,\n goToNextStepCommitted,\n stepObject,\n history,\n };\n};\n"],"names":["getOrderedJourneySteps","useState","useRef","__spreadArray","updateSessionCurrentStep","getNextStepIndex","useEffect","reconstructHistoryToStep"],"mappings":";;;;;;AASA;AACA,IAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC;AAC5E,IAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;AAE7E,IAAM,iBAAiB,GAAG,UACxB,IAAY,EACZ,QAAyB,EAAA,EAAA,IAAA,EAAA,CAAA,CACF,OAAA,CAAA,EAAA,GAAAA,qCAAsB,CAAC,QAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAA,CAAA,CAAA;AAEzE;;;;AAIG;AACH,IAAM,6BAA6B,GAAG,UACpC,oBAA8B,EAC9B,QAAyB,EAAA;AAEzB,IAAA,IAAI,qBAAqB,GAAG,EAAE;AAE9B,IAAA,KAAK,IAAI,KAA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AA,OAAA;KACR;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"useStepNavigation.js","sources":["../../../../src/hooks/useStepNavigation.ts"],"sourcesContent":["import { useState, useEffect, useRef } from \"react\";\nimport {\n updateSessionCurrentStep,\n getNextStepIndex,\n getOrderedJourneySteps,\n reconstructHistoryToStep,\n} from \"../services/sessionService\";\nimport type { SessionTemplate } from \"../types/session\";\n\n/** Node types that auto-execute and should be skipped when going back */\nconst AUTO_EXECUTING_TYPES = new Set([\"external-verification\", \"condition\", \"complementary-mandate\"]);\nconst COMMITTED_NODE_TYPES = new Set([\"selfie-capture\", \"biometric-capture\"]);\n\nconst getNodeTypeAtStep = (\n step: number,\n template: SessionTemplate,\n): string | undefined => getOrderedJourneySteps(template)[step - 1]?.type;\n\n/**\n * Rebuilds only the reversible part of a path after a committed node.\n * Auto-executing nodes immediately following the commit are excluded so the\n * first interactive destination remains the history boundary after reload.\n */\nconst trimHistoryAfterCommittedNode = (\n reconstructedHistory: number[],\n template: SessionTemplate,\n): number[] => {\n let committedHistoryIndex = -1;\n\n for (let index = reconstructedHistory.length - 2; index >= 0; index -= 1) {\n const nodeType = getNodeTypeAtStep(reconstructedHistory[index], template);\n if (nodeType && COMMITTED_NODE_TYPES.has(nodeType)) {\n committedHistoryIndex = index;\n break;\n }\n }\n\n if (committedHistoryIndex === -1) {\n return reconstructedHistory;\n }\n\n let reversibleHistoryStart = committedHistoryIndex + 1;\n while (reversibleHistoryStart < reconstructedHistory.length - 1) {\n const nodeType = getNodeTypeAtStep(\n reconstructedHistory[reversibleHistoryStart],\n template,\n );\n if (!nodeType || !AUTO_EXECUTING_TYPES.has(nodeType)) {\n break;\n }\n reversibleHistoryStart += 1;\n }\n\n return reconstructedHistory.slice(reversibleHistoryStart);\n};\n\nexport const useStepNavigation = (\n sessionId: string,\n sessionStatus?: string,\n initialStep?: number,\n template?: SessionTemplate,\n) => {\n const [step, setStepState] = useState(initialStep ?? 0);\n const [history, setHistory] = useState<number[]>(initialStep !== undefined ? [initialStep] : [0]);\n const hasInitialized = useRef(false);\n const committedNavigationPending = useRef(false);\n\n const setStep = (newStep: number, skipHistory = false) => {\n if (!skipHistory && newStep !== step) {\n setHistory((prev) => {\n if (prev[prev.length - 1] === newStep) return prev;\n return [...prev, newStep];\n });\n }\n setStepState(newStep);\n\n // Update current step in database\n if (sessionId) {\n updateSessionCurrentStep(sessionId, newStep).catch((error) => {\n console.error(\"Failed to update current step in database:\", error);\n // Non-blocking error - the step is still updated locally\n });\n }\n };\n\n const goBack = () => {\n if (history.length > 1) {\n let newHistory = [...history];\n newHistory.pop(); // Remove current step\n\n // Skip auto-executing nodes when going back\n if (template) {\n const orderedNodes = getOrderedJourneySteps(template);\n while (newHistory.length > 1) {\n const candidateStep = newHistory[newHistory.length - 1];\n // steps are 1-indexed (step 0 = start, step 1 = first node, etc.)\n const nodeIndex = candidateStep - 1;\n const candidateNode = orderedNodes[nodeIndex];\n if (candidateNode && AUTO_EXECUTING_TYPES.has(candidateNode.type)) {\n newHistory.pop();\n } else {\n break;\n }\n }\n }\n\n const previousStep = newHistory[newHistory.length - 1];\n setHistory(newHistory);\n setStep(previousStep, true);\n } else {\n console.warn(\"[goBack] BLOCKED — history.length <= 1, history:\", [...history]);\n }\n };\n\n /**\n * Retour arrière vers un nœud précis (ex: bouton \"Corriger ma saisie\").\n * Contrairement à `setStep`, on TRONQUE l'historique jusqu'à la dernière\n * occurrence de `targetStep` au lieu de l'empiler : le nœud cible cesse\n * ainsi d'être compté comme un \"revisit\" (runIndex 0 côté\n * TemplateNodeRenderer → formulaire pré-rempli). Si la cible n'est pas dans\n * l'historique, on retombe sur un `setStep` classique.\n */\n const goBackToStep = (targetStep: number) => {\n const idx = history.lastIndexOf(targetStep);\n if (idx !== -1) {\n const newHistory = history.slice(0, idx + 1);\n setHistory(newHistory);\n setStep(targetStep, true);\n } else {\n console.warn(\"[goBackToStep] target not in history — pushing instead:\", targetStep);\n setStep(targetStep);\n }\n };\n\n const goToNextStep = (\n currentNodeId: string,\n template: SessionTemplate,\n handle?: string\n ) => {\n const nextStepIndex = getNextStepIndex(currentNodeId, template, handle);\n\n if (nextStepIndex !== null) {\n if (committedNavigationPending.current) {\n const destinationType = getNodeTypeAtStep(nextStepIndex, template);\n committedNavigationPending.current = Boolean(\n destinationType && AUTO_EXECUTING_TYPES.has(destinationType),\n );\n setHistory([nextStepIndex]);\n setStep(nextStepIndex, true);\n } else {\n setStep(nextStepIndex);\n }\n } else {\n committedNavigationPending.current = false;\n console.warn(\n `[useStepNavigation] Could not find next step for node ${currentNodeId}. Staying on current step.`\n );\n }\n };\n\n /**\n * Navigates through the graph and makes the destination a point of no return.\n * The destination remains persisted by setStep, while prior history is discarded.\n */\n const goToNextStepCommitted = (\n currentNodeId: string,\n template: SessionTemplate,\n handle?: string,\n ) => {\n const nextStepIndex = getNextStepIndex(currentNodeId, template, handle);\n\n if (nextStepIndex !== null) {\n const destinationType = getNodeTypeAtStep(nextStepIndex, template);\n committedNavigationPending.current = Boolean(\n destinationType && AUTO_EXECUTING_TYPES.has(destinationType),\n );\n setHistory([nextStepIndex]);\n setStep(nextStepIndex, true);\n } else {\n committedNavigationPending.current = false;\n console.warn(\n `[useStepNavigation] Could not find next step for node ${currentNodeId}. Staying on current step.`,\n );\n }\n };\n\n // Initialize step from session data or status\n useEffect(() => {\n if (!sessionId) {\n return;\n }\n\n // Check if session is already ended\n if (sessionStatus === \"ended\") {\n setStepState(100);\n return;\n }\n\n // Only initialize once when initialStep becomes available\n if (initialStep !== undefined && !hasInitialized.current) {\n setStepState(initialStep);\n setHistory((prev) => {\n // Preserve history if the user already navigated past the initial step\n if (prev.length > 1 && prev[prev.length - 1] === initialStep) {\n return prev;\n }\n // Reconstruct history by following the graph from step 0\n const reconstructed = template\n ? trimHistoryAfterCommittedNode(\n reconstructHistoryToStep(initialStep, template),\n template,\n )\n : initialStep > 0 ? [0, initialStep] : [initialStep];\n return reconstructed;\n });\n hasInitialized.current = true;\n }\n }, [sessionId, sessionStatus, initialStep]);\n\n const stepObject = {\n setStep,\n goBack,\n goBackToStep,\n goToNextStep,\n goToNextStepCommitted,\n step,\n canGoBack: history.length > 1,\n };\n\n return {\n step,\n setStep,\n goBack,\n goBackToStep,\n goToNextStep,\n goToNextStepCommitted,\n stepObject,\n history,\n };\n};\n"],"names":["getOrderedJourneySteps","useState","useRef","__spreadArray","updateSessionCurrentStep","getNextStepIndex","useEffect","reconstructHistoryToStep"],"mappings":";;;;;;AASA;AACA,IAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,uBAAuB,EAAE,WAAW,EAAE,uBAAuB,CAAC,CAAC;AACrG,IAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;AAE7E,IAAM,iBAAiB,GAAG,UACxB,IAAY,EACZ,QAAyB,EAAA,EAAA,IAAA,EAAA,CAAA,CACF,OAAA,CAAA,EAAA,GAAAA,qCAAsB,CAAC,QAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAA,CAAA,CAAA;AAEzE;;;;AAIG;AACH,IAAM,6BAA6B,GAAG,UACpC,oBAA8B,EAC9B,QAAyB,EAAA;AAEzB,IAAA,IAAI,qBAAqB,GAAG,EAAE;AAE9B,IAAA,KAAK,IAAI,KAAK,GAAG,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;QACxE,IAAM,QAAQ,GAAG,iBAAiB,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;QACzE,IAAI,QAAQ,IAAI,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAClD,qBAAqB,GAAG,KAAK;YAC7B;QACF;IACF;AAEA,IAAA,IAAI,qBAAqB,KAAK,EAAE,EAAE;AAChC,QAAA,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gBACb;;gBAEA,IAAM,aAAa,GAAG;sBAClB,6BAA6B,CAC3BC,uCAAwB,CAAC,WAAW,EAAE,QAAQ,CAAC,EAC/C,QAAQ;AAEZ,sBAAE,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;AACtD,gBAAA,OAAO,aAAa;AACtB,YAAA,CAAC,CAAC;AACF,YAAA,cAAc,CAAC,OAAO,GAAG,IAAI;QAC/B;IACF,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AAE3C,IAAA,IAAM,UAAU,GAAG;AACjB,QAAA,OAAO,EAAA,OAAA;AACP,QAAA,MAAM,EAAA,MAAA;AACN,QAAA,YAAY,EAAA,YAAA;AACZ,QAAA,YAAY,EAAA,YAAA;AACZ,QAAA,qBAAqB,EAAA,qBAAA;AACrB,QAAA,IAAI,EAAA,IAAA;AACJ,QAAA,SAAS,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC;KAC9B;IAED,OAAO;AACL,QAAA,IAAI,EAAA,IAAA;AACJ,QAAA,OAAO,EAAA,OAAA;AACP,QAAA,MAAM,EAAA,MAAA;AACN,QAAA,YAAY,EAAA,YAAA;AACZ,QAAA,YAAY,EAAA,YAAA;AACZ,QAAA,qBAAqB,EAAA,qBAAA;AACrB,QAAA,UAAU,EAAA,UAAA;AACV,QAAA,OAAO,EAAA,OAAA;KACR;AACH;;;;"}
|
package/dist/cjs/i18n/en.json.js
CHANGED
|
@@ -1085,6 +1085,25 @@ var signed_document = {
|
|
|
1085
1085
|
declined: "You declined to sign this document.",
|
|
1086
1086
|
expired: "The signing link has expired."
|
|
1087
1087
|
};
|
|
1088
|
+
var complementary_mandate = {
|
|
1089
|
+
title: "Complementary mandate",
|
|
1090
|
+
description: "Reuse an approved mandate for the same SIREN",
|
|
1091
|
+
source: "Source journey",
|
|
1092
|
+
current: "This journey",
|
|
1093
|
+
age: "Mandate validity (months)",
|
|
1094
|
+
excluded: "Fields excluded from inheritance (comma separated)",
|
|
1095
|
+
risk: "First and last names are sufficient to skip a new identity check. This information may be public; no OTP is verified.",
|
|
1096
|
+
same_signer: "Same signer",
|
|
1097
|
+
new_signer: "New signer",
|
|
1098
|
+
no_mandate: "No mandate",
|
|
1099
|
+
checked: "Complementary mandate checked",
|
|
1100
|
+
validation_outputs: "Connect all three complementary mandate outputs.",
|
|
1101
|
+
validation_identity: "A form requiring first and last names must precede the complementary mandate on every branch.",
|
|
1102
|
+
validation_age: "Validity must be a whole number of months between 1 and 1200.",
|
|
1103
|
+
loading: "Checking mandate…",
|
|
1104
|
+
error: "The mandate check failed. Please try again.",
|
|
1105
|
+
retry: "Try again"
|
|
1106
|
+
};
|
|
1088
1107
|
var enTranslations = {
|
|
1089
1108
|
start: start,
|
|
1090
1109
|
user_input_form: user_input_form,
|
|
@@ -1142,7 +1161,8 @@ var enTranslations = {
|
|
|
1142
1161
|
signature: signature,
|
|
1143
1162
|
nfc_scan: nfc_scan,
|
|
1144
1163
|
inpi_verification: inpi_verification,
|
|
1145
|
-
signed_document: signed_document
|
|
1164
|
+
signed_document: signed_document,
|
|
1165
|
+
complementary_mandate: complementary_mandate
|
|
1146
1166
|
};
|
|
1147
1167
|
|
|
1148
1168
|
exports.LEGAL_CONSENT = LEGAL_CONSENT;
|
|
@@ -1150,6 +1170,7 @@ exports.before = before;
|
|
|
1150
1170
|
exports.before_verso = before_verso;
|
|
1151
1171
|
exports.buttons = buttons;
|
|
1152
1172
|
exports.camera = camera;
|
|
1173
|
+
exports.complementary_mandate = complementary_mandate;
|
|
1153
1174
|
exports.custom_form = custom_form;
|
|
1154
1175
|
exports.default = enTranslations;
|
|
1155
1176
|
exports.documentTypes = documentTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/i18n/es.json.js
CHANGED
|
@@ -1085,6 +1085,25 @@ var signed_document = {
|
|
|
1085
1085
|
declined: "Ha rechazado firmar este documento.",
|
|
1086
1086
|
expired: "El enlace de firma ha caducado."
|
|
1087
1087
|
};
|
|
1088
|
+
var complementary_mandate = {
|
|
1089
|
+
title: "Mandato complementario",
|
|
1090
|
+
description: "Reutilizar un mandato aprobado para el mismo SIREN",
|
|
1091
|
+
source: "Recorrido de origen",
|
|
1092
|
+
current: "Este recorrido",
|
|
1093
|
+
age: "Validez del mandato (meses)",
|
|
1094
|
+
excluded: "Campos excluidos de la herencia (separados por comas)",
|
|
1095
|
+
risk: "El nombre y el apellido bastan para omitir una nueva verificación de identidad. Esta información puede ser pública; no se verifica ningún OTP.",
|
|
1096
|
+
same_signer: "Mismo firmante",
|
|
1097
|
+
new_signer: "Nuevo firmante",
|
|
1098
|
+
no_mandate: "Sin mandato",
|
|
1099
|
+
checked: "Mandato complementario verificado",
|
|
1100
|
+
validation_outputs: "Conecte las tres salidas del mandato complementario.",
|
|
1101
|
+
validation_identity: "Un formulario con nombre y apellido obligatorios debe preceder al mandato complementario en cada rama.",
|
|
1102
|
+
validation_age: "La validez debe ser un número entero de meses entre 1 y 1200.",
|
|
1103
|
+
loading: "Verificando el mandato…",
|
|
1104
|
+
error: "La verificación del mandato ha fallado. Inténtelo de nuevo.",
|
|
1105
|
+
retry: "Reintentar"
|
|
1106
|
+
};
|
|
1088
1107
|
var esTranslations = {
|
|
1089
1108
|
start: start,
|
|
1090
1109
|
user_input_form: user_input_form,
|
|
@@ -1142,7 +1161,8 @@ var esTranslations = {
|
|
|
1142
1161
|
signature: signature,
|
|
1143
1162
|
nfc_scan: nfc_scan,
|
|
1144
1163
|
inpi_verification: inpi_verification,
|
|
1145
|
-
signed_document: signed_document
|
|
1164
|
+
signed_document: signed_document,
|
|
1165
|
+
complementary_mandate: complementary_mandate
|
|
1146
1166
|
};
|
|
1147
1167
|
|
|
1148
1168
|
exports.LEGAL_CONSENT = LEGAL_CONSENT;
|
|
@@ -1150,6 +1170,7 @@ exports.before = before;
|
|
|
1150
1170
|
exports.before_verso = before_verso;
|
|
1151
1171
|
exports.buttons = buttons;
|
|
1152
1172
|
exports.camera = camera;
|
|
1173
|
+
exports.complementary_mandate = complementary_mandate;
|
|
1153
1174
|
exports.custom_form = custom_form;
|
|
1154
1175
|
exports.default = esTranslations;
|
|
1155
1176
|
exports.documentTypes = documentTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/i18n/fr.json.js
CHANGED
|
@@ -1085,6 +1085,25 @@ var signed_document = {
|
|
|
1085
1085
|
declined: "Vous avez refusé de signer ce document.",
|
|
1086
1086
|
expired: "Le lien de signature a expiré."
|
|
1087
1087
|
};
|
|
1088
|
+
var complementary_mandate = {
|
|
1089
|
+
title: "Mandat complémentaire",
|
|
1090
|
+
description: "Réutiliser un mandat approuvé pour le même SIREN",
|
|
1091
|
+
source: "Parcours source",
|
|
1092
|
+
current: "Ce parcours",
|
|
1093
|
+
age: "Validité du mandat (mois)",
|
|
1094
|
+
excluded: "Champs exclus de l’héritage (séparés par des virgules)",
|
|
1095
|
+
risk: "Le nom et le prénom suffisent à éviter un nouveau contrôle d’identité. Ces informations peuvent être publiques ; aucun OTP n’est vérifié.",
|
|
1096
|
+
same_signer: "Même signataire",
|
|
1097
|
+
new_signer: "Nouveau signataire",
|
|
1098
|
+
no_mandate: "Aucun mandat",
|
|
1099
|
+
checked: "Mandat complémentaire vérifié",
|
|
1100
|
+
validation_outputs: "Reliez les trois sorties du mandat complémentaire.",
|
|
1101
|
+
validation_identity: "Un formulaire avec prénom et nom obligatoires doit précéder le mandat complémentaire sur chaque branche.",
|
|
1102
|
+
validation_age: "La validité doit être un nombre entier de mois entre 1 et 1200.",
|
|
1103
|
+
loading: "Vérification du mandat…",
|
|
1104
|
+
error: "La vérification du mandat a échoué. Veuillez réessayer.",
|
|
1105
|
+
retry: "Réessayer"
|
|
1106
|
+
};
|
|
1088
1107
|
var frTranslations = {
|
|
1089
1108
|
start: start,
|
|
1090
1109
|
user_input_form: user_input_form,
|
|
@@ -1142,7 +1161,8 @@ var frTranslations = {
|
|
|
1142
1161
|
signature: signature,
|
|
1143
1162
|
nfc_scan: nfc_scan,
|
|
1144
1163
|
inpi_verification: inpi_verification,
|
|
1145
|
-
signed_document: signed_document
|
|
1164
|
+
signed_document: signed_document,
|
|
1165
|
+
complementary_mandate: complementary_mandate
|
|
1146
1166
|
};
|
|
1147
1167
|
|
|
1148
1168
|
exports.LEGAL_CONSENT = LEGAL_CONSENT;
|
|
@@ -1150,6 +1170,7 @@ exports.before = before;
|
|
|
1150
1170
|
exports.before_verso = before_verso;
|
|
1151
1171
|
exports.buttons = buttons;
|
|
1152
1172
|
exports.camera = camera;
|
|
1173
|
+
exports.complementary_mandate = complementary_mandate;
|
|
1153
1174
|
exports.custom_form = custom_form;
|
|
1154
1175
|
exports.default = frTranslations;
|
|
1155
1176
|
exports.documentTypes = documentTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.json.js","sources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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,12 +5,6 @@ var api = require('./api.js');
|
|
|
5
5
|
var auditTrailService = require('./auditTrailService.js');
|
|
6
6
|
var sessionMemoryStore = require('./sessionMemoryStore.js');
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Session Service
|
|
10
|
-
*
|
|
11
|
-
* Service for interacting with the Datakeen Session API.
|
|
12
|
-
* Handles fetching session data by ID.
|
|
13
|
-
*/
|
|
14
8
|
/**
|
|
15
9
|
* Fetches session data by ID from the Datakeen backend
|
|
16
10
|
*
|
|
@@ -481,7 +475,40 @@ var getRunPrefillData = function (userInput, runIndex) {
|
|
|
481
475
|
return null;
|
|
482
476
|
return (_a = list[runIndex]) !== null && _a !== void 0 ? _a : null;
|
|
483
477
|
};
|
|
478
|
+
/**
|
|
479
|
+
* Checks en cours par nœud : un double montage (StrictMode, remontage) partage
|
|
480
|
+
* la même requête au lieu d'en lancer une seconde qui entrerait en concurrence
|
|
481
|
+
* avec la première côté serveur. L'entrée est libérée dès que l'appel aboutit,
|
|
482
|
+
* pour qu'un réessai reparte bien du serveur.
|
|
483
|
+
*/
|
|
484
|
+
var pendingMandateChecks = new Map();
|
|
485
|
+
/** The server reads persisted identity; no identity or verdict is submitted. */
|
|
486
|
+
function checkComplementaryMandate(sessionId, nodeId) {
|
|
487
|
+
var _this = this;
|
|
488
|
+
var key = "".concat(sessionId, ":").concat(nodeId);
|
|
489
|
+
var pending = pendingMandateChecks.get(key);
|
|
490
|
+
if (pending)
|
|
491
|
+
return pending;
|
|
492
|
+
var request = (function () { return tslib_es6.__awaiter(_this, void 0, void 0, function () {
|
|
493
|
+
var response, outcome;
|
|
494
|
+
var _a;
|
|
495
|
+
return tslib_es6.__generator(this, function (_b) {
|
|
496
|
+
switch (_b.label) {
|
|
497
|
+
case 0: return [4 /*yield*/, api.apiService.post("/session/sdk/".concat(sessionId, "/complementary-mandate/").concat(encodeURIComponent(nodeId)))];
|
|
498
|
+
case 1:
|
|
499
|
+
response = _b.sent();
|
|
500
|
+
outcome = (_a = response.data) === null || _a === void 0 ? void 0 : _a.outcome;
|
|
501
|
+
if (!['same_signer', 'new_signer', 'no_mandate'].includes(outcome))
|
|
502
|
+
throw new Error('Invalid complementary mandate outcome');
|
|
503
|
+
return [2 /*return*/, { outcome: outcome }];
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}); })().finally(function () { return pendingMandateChecks.delete(key); });
|
|
507
|
+
pendingMandateChecks.set(key, request);
|
|
508
|
+
return request;
|
|
509
|
+
}
|
|
484
510
|
|
|
511
|
+
exports.checkComplementaryMandate = checkComplementaryMandate;
|
|
485
512
|
exports.clearSessionSensitiveData = clearSessionSensitiveData;
|
|
486
513
|
exports.fetchSessionById = fetchSessionById;
|
|
487
514
|
exports.findOutgoingEdge = findOutgoingEdge;
|