sunuid-sdk 1.0.33 → 1.0.34
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/README.md +171 -499
- package/dist/sunuid-sdk.esm.js +936 -367
- package/dist/sunuid-sdk.esm.js.map +1 -1
- package/dist/sunuid-sdk.js +936 -367
- package/dist/sunuid-sdk.js.map +1 -1
- package/dist/sunuid-sdk.min.js +3 -3
- package/dist/sunuid-sdk.min.js.map +1 -1
- package/package.json +2 -2
package/dist/sunuid-sdk.js
CHANGED
|
@@ -283,11 +283,12 @@
|
|
|
283
283
|
secretId: null,
|
|
284
284
|
type: 2,
|
|
285
285
|
// Type par défaut (2 = authentification)
|
|
286
|
-
partnerName:
|
|
287
|
-
// Nom du partenaire
|
|
286
|
+
partnerName: null,
|
|
287
|
+
// Nom du partenaire récupéré depuis l'API
|
|
288
288
|
theme: 'light',
|
|
289
289
|
language: 'fr',
|
|
290
|
-
autoRefresh:
|
|
290
|
+
autoRefresh: false,
|
|
291
|
+
// Désactivé par défaut pour éviter les appels répétitifs
|
|
291
292
|
refreshInterval: 30000,
|
|
292
293
|
// 30 secondes
|
|
293
294
|
onSuccess: null,
|
|
@@ -308,7 +309,10 @@
|
|
|
308
309
|
}
|
|
309
310
|
return ((_window$SunuIDConfig3 = window.SunuIDConfig) === null || _window$SunuIDConfig3 === void 0 || (_window$SunuIDConfig3 = _window$SunuIDConfig3.apiUrl) === null || _window$SunuIDConfig3 === void 0 ? void 0 : _window$SunuIDConfig3.replace('/api', '')) + '/secure-init.php' || 'https://api.sunuid.fayma.sn/secure-init.php';
|
|
310
311
|
}(),
|
|
311
|
-
token: null
|
|
312
|
+
token: null,
|
|
313
|
+
// Configuration pour forcer l'utilisation du serveur distant
|
|
314
|
+
forceRemoteServer: true,
|
|
315
|
+
useLocalFallback: false
|
|
312
316
|
};
|
|
313
317
|
|
|
314
318
|
/**
|
|
@@ -359,31 +363,43 @@
|
|
|
359
363
|
this.logSecurityEvent('SDK_INIT_START', {
|
|
360
364
|
apiUrl: this.config.apiUrl,
|
|
361
365
|
type: this.config.type,
|
|
362
|
-
partnerName: this.config.partnerName,
|
|
363
366
|
secureInit: this.config.secureInit
|
|
364
367
|
});
|
|
365
368
|
|
|
369
|
+
// Récupérer les informations du partenaire depuis l'API
|
|
370
|
+
_context.n = 4;
|
|
371
|
+
return this.fetchPartnerInfo();
|
|
372
|
+
case 4:
|
|
366
373
|
// Obscurcir les credentials dans les logs
|
|
367
374
|
this.obfuscateCredentials();
|
|
368
375
|
this.isInitialized = true;
|
|
369
376
|
console.log('SunuID SDK initialisé avec succès');
|
|
377
|
+
console.log('📋 Configuration SDK:', {
|
|
378
|
+
apiUrl: this.config.apiUrl,
|
|
379
|
+
type: this.config.type,
|
|
380
|
+
partnerName: this.config.partnerName,
|
|
381
|
+
clientId: this.config.clientId ? '***' + this.config.clientId.slice(-4) : 'null',
|
|
382
|
+
secretId: this.config.secretId ? '***' + this.config.secretId.slice(-4) : 'null',
|
|
383
|
+
secureInit: this.config.secureInit,
|
|
384
|
+
theme: this.config.theme
|
|
385
|
+
});
|
|
370
386
|
this.logSecurityEvent('SDK_INIT_SUCCESS');
|
|
371
387
|
|
|
372
388
|
// Initialiser la connexion WebSocket
|
|
373
389
|
this.initWebSocket();
|
|
374
|
-
_context.n =
|
|
390
|
+
_context.n = 6;
|
|
375
391
|
break;
|
|
376
|
-
case
|
|
377
|
-
_context.p =
|
|
392
|
+
case 5:
|
|
393
|
+
_context.p = 5;
|
|
378
394
|
_t = _context.v;
|
|
379
395
|
this.logSecurityEvent('SDK_INIT_ERROR', {
|
|
380
396
|
error: _t.message
|
|
381
397
|
});
|
|
382
398
|
throw _t;
|
|
383
|
-
case
|
|
399
|
+
case 6:
|
|
384
400
|
return _context.a(2);
|
|
385
401
|
}
|
|
386
|
-
}, _callee, this, [[0,
|
|
402
|
+
}, _callee, this, [[0, 5]]);
|
|
387
403
|
}));
|
|
388
404
|
function init() {
|
|
389
405
|
return _init.apply(this, arguments);
|
|
@@ -430,6 +446,7 @@
|
|
|
430
446
|
return response.json();
|
|
431
447
|
case 3:
|
|
432
448
|
result = _context2.v;
|
|
449
|
+
console.log('📋 Réponse initialisation sécurisée:', result);
|
|
433
450
|
if (result.success) {
|
|
434
451
|
_context2.n = 4;
|
|
435
452
|
break;
|
|
@@ -537,25 +554,30 @@
|
|
|
537
554
|
|
|
538
555
|
// Initialiser la connexion WebSocket si elle n'existe pas
|
|
539
556
|
if (!this.socket) {
|
|
557
|
+
console.log('🌐 Initialisation Socket.IO...');
|
|
540
558
|
this.socket = io('wss://samasocket.fayma.sn:9443', {
|
|
541
559
|
query: {
|
|
542
560
|
token: this.config.clientId,
|
|
543
561
|
type: 'web',
|
|
544
562
|
userId: this.config.clientId,
|
|
545
563
|
username: ip
|
|
546
|
-
}
|
|
564
|
+
},
|
|
565
|
+
transports: ['websocket', 'polling']
|
|
547
566
|
});
|
|
548
567
|
|
|
549
568
|
// Gestion des événements WebSocket
|
|
550
569
|
this.socket.on('connect', function () {
|
|
551
570
|
console.log('🌐 WebSocket connecté avec succès');
|
|
552
571
|
console.log('📊 Socket ID:', _this.socket.id);
|
|
572
|
+
_this.socket.connected = true;
|
|
553
573
|
});
|
|
554
574
|
this.socket.on('disconnect', function (reason) {
|
|
555
575
|
console.log('❌ WebSocket déconnecté:', reason);
|
|
576
|
+
_this.socket.connected = false;
|
|
556
577
|
});
|
|
557
578
|
this.socket.on('connect_error', function (error) {
|
|
558
579
|
console.error('❌ Erreur connexion WebSocket:', error);
|
|
580
|
+
_this.socket.connected = false;
|
|
559
581
|
});
|
|
560
582
|
|
|
561
583
|
// Écouter les événements spécifiques
|
|
@@ -571,6 +593,8 @@
|
|
|
571
593
|
console.log('⏰ QR expiré reçu:', data);
|
|
572
594
|
_this.handleQRExpired(data);
|
|
573
595
|
});
|
|
596
|
+
} else {
|
|
597
|
+
console.log('🌐 WebSocket déjà connecté');
|
|
574
598
|
}
|
|
575
599
|
} catch (error) {
|
|
576
600
|
console.error('❌ Erreur initialisation WebSocket:', error);
|
|
@@ -758,8 +782,6 @@
|
|
|
758
782
|
if (this.socket && this.socket.connected) {
|
|
759
783
|
this.socket.emit(event, data);
|
|
760
784
|
console.log("\uD83D\uDCE4 \xC9v\xE9nement WebSocket \xE9mis: ".concat(event), data);
|
|
761
|
-
} else if (typeof io === 'undefined') {
|
|
762
|
-
console.warn('⚠️ Socket.IO non disponible, impossible d\'émettre l\'événement:', event);
|
|
763
785
|
} else {
|
|
764
786
|
console.warn('⚠️ WebSocket non connecté, impossible d\'émettre l\'événement:', event);
|
|
765
787
|
}
|
|
@@ -795,18 +817,23 @@
|
|
|
795
817
|
}, {
|
|
796
818
|
key: "generateQR",
|
|
797
819
|
value: (function () {
|
|
798
|
-
var _generateQR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(
|
|
799
|
-
var
|
|
800
|
-
|
|
820
|
+
var _generateQR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
821
|
+
var containerId,
|
|
822
|
+
options,
|
|
823
|
+
connectionStatus,
|
|
824
|
+
socketId,
|
|
825
|
+
qrContent,
|
|
826
|
+
partnerName,
|
|
801
827
|
response,
|
|
802
|
-
imageBaseUrl,
|
|
803
828
|
qrImageUrl,
|
|
804
|
-
|
|
829
|
+
isLocal,
|
|
805
830
|
_args3 = arguments,
|
|
806
|
-
_t3
|
|
831
|
+
_t3,
|
|
832
|
+
_t4;
|
|
807
833
|
return _regenerator().w(function (_context3) {
|
|
808
834
|
while (1) switch (_context3.p = _context3.n) {
|
|
809
835
|
case 0:
|
|
836
|
+
containerId = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : 'sunuid-qr-container';
|
|
810
837
|
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
|
811
838
|
if (!this.initPromise) {
|
|
812
839
|
_context3.n = 2;
|
|
@@ -823,68 +850,88 @@
|
|
|
823
850
|
}
|
|
824
851
|
throw new Error('SunuID: SDK non initialisé');
|
|
825
852
|
case 3:
|
|
826
|
-
|
|
827
|
-
|
|
853
|
+
console.log('🎯 generateQR appelé avec containerId:', containerId);
|
|
854
|
+
|
|
855
|
+
// Attendre que les connexions soient prêtes
|
|
856
|
+
console.log('🔍 Attente connexions API et WebSocket...');
|
|
857
|
+
_context3.p = 4;
|
|
858
|
+
_context3.n = 5;
|
|
859
|
+
return this.waitForConnections(5000);
|
|
860
|
+
case 5:
|
|
861
|
+
connectionStatus = _context3.v;
|
|
862
|
+
// 5 secondes max
|
|
863
|
+
console.log('✅ Connexions prêtes:', connectionStatus);
|
|
864
|
+
_context3.n = 7;
|
|
865
|
+
break;
|
|
866
|
+
case 6:
|
|
867
|
+
_context3.p = 6;
|
|
868
|
+
_t3 = _context3.v;
|
|
869
|
+
console.error('❌ Erreur connexions:', _t3.message);
|
|
870
|
+
throw new Error('Connexions non disponibles - Impossible de générer le QR code');
|
|
871
|
+
case 7:
|
|
872
|
+
_context3.p = 7;
|
|
873
|
+
// Utiliser uniquement le socketID comme contenu du QR
|
|
874
|
+
socketId = this.socket ? this.socket.id : 'timeout-socket-id';
|
|
875
|
+
qrContent = socketId;
|
|
876
|
+
console.log('📄 Contenu QR préparé:', qrContent);
|
|
877
|
+
console.log('🔌 Socket ID:', socketId);
|
|
878
|
+
|
|
879
|
+
// Générer le QR avec le contenu complet
|
|
880
|
+
partnerName = this.config.partnerName || 'Partner_unknown';
|
|
881
|
+
_context3.n = 8;
|
|
828
882
|
return this.makeRequest('/qr-generate', _objectSpread2({
|
|
829
|
-
type: this.config.type
|
|
883
|
+
type: this.config.type,
|
|
884
|
+
content: qrContent,
|
|
885
|
+
// Contenu personnalisé pour le QR
|
|
886
|
+
label: "".concat(this.getTypeName(this.config.type), " ").concat(partnerName)
|
|
830
887
|
}, options));
|
|
831
|
-
case
|
|
888
|
+
case 8:
|
|
832
889
|
response = _context3.v;
|
|
833
890
|
if (!response.success) {
|
|
834
|
-
_context3.n =
|
|
891
|
+
_context3.n = 9;
|
|
835
892
|
break;
|
|
836
893
|
}
|
|
837
|
-
// Construire l'URL complète
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
this.displayQRCode(containerId, qrImageUrl, this.config.type, options);
|
|
842
|
-
|
|
843
|
-
// Générer le QR code personnalisé avec le type + code de l'API + socket ID
|
|
844
|
-
if (this.pendingQRInfo && response.data.code) {
|
|
845
|
-
// Attendre que le socket ID soit bien défini
|
|
846
|
-
_waitForSocketId = function waitForSocketId() {
|
|
847
|
-
if (_this2.socket && _this2.socket.id && _this2.socket.id !== 'unknown') {
|
|
848
|
-
var socketId = _this2.socket.id;
|
|
849
|
-
var qrContent = "".concat(_this2.config.type, "-").concat(response.data.code, "-").concat(socketId);
|
|
850
|
-
|
|
851
|
-
// Utiliser le partnerName de la réponse API et le nom du type
|
|
852
|
-
var partnerName = response.data.partnerName || _this2.config.partnerName || 'SunuID';
|
|
853
|
-
var typeName = _this2.getTypeName(_this2.config.type);
|
|
854
|
-
var qrLabel = "".concat(typeName, " - ").concat(partnerName);
|
|
855
|
-
_this2.generateCustomQRCode(qrContent, qrLabel, _this2.pendingQRInfo.options);
|
|
856
|
-
_this2.pendingQRInfo = null; // Nettoyer
|
|
857
|
-
} else {
|
|
858
|
-
// Réessayer après un délai si le socket ID n'est pas encore disponible
|
|
859
|
-
setTimeout(_waitForSocketId, 100);
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
_waitForSocketId();
|
|
894
|
+
// Construire l'URL complète du QR code
|
|
895
|
+
qrImageUrl = response.data.qrCodeUrl; // Si l'URL est relative, la rendre absolue
|
|
896
|
+
if (qrImageUrl.startsWith('/')) {
|
|
897
|
+
qrImageUrl = "".concat(this.config.apiUrl).concat(qrImageUrl);
|
|
863
898
|
}
|
|
899
|
+
this.currentQRUrl = qrImageUrl;
|
|
900
|
+
console.log('✅ QR code généré par API principale:', qrImageUrl);
|
|
901
|
+
console.log('📄 Contenu QR final:', qrContent);
|
|
902
|
+
console.log('🏷️ Label QR:', response.data.label);
|
|
903
|
+
console.log('🆔 Session ID:', response.data.sessionId);
|
|
904
|
+
|
|
905
|
+
// Afficher le QR code
|
|
906
|
+
this.displayQRCode(containerId, qrImageUrl, this.config.type, options);
|
|
864
907
|
this.startAutoRefresh(containerId, this.config.type, options);
|
|
865
908
|
|
|
866
909
|
// Émettre un événement WebSocket pour la génération du QR
|
|
867
910
|
this.emitWebSocketEvent('qr_generated', {
|
|
868
|
-
serviceId: response.data.service_id,
|
|
869
911
|
type: this.config.type,
|
|
870
912
|
qrCodeUrl: qrImageUrl,
|
|
871
|
-
|
|
913
|
+
socketId: socketId,
|
|
914
|
+
qrContent: qrContent,
|
|
915
|
+
label: response.data.label,
|
|
916
|
+
sessionId: response.data.sessionId,
|
|
872
917
|
timestamp: Date.now()
|
|
873
918
|
});
|
|
874
919
|
return _context3.a(2, _objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
875
920
|
qrCodeUrl: qrImageUrl,
|
|
876
|
-
|
|
921
|
+
qrContent: qrContent,
|
|
922
|
+
label: response.data.label,
|
|
923
|
+
sessionId: response.data.sessionId
|
|
877
924
|
}));
|
|
878
|
-
case
|
|
925
|
+
case 9:
|
|
879
926
|
throw new Error(response.message || 'Erreur lors de la génération du QR code');
|
|
880
|
-
case
|
|
881
|
-
_context3.n =
|
|
927
|
+
case 10:
|
|
928
|
+
_context3.n = 12;
|
|
882
929
|
break;
|
|
883
|
-
case
|
|
884
|
-
_context3.p =
|
|
885
|
-
|
|
886
|
-
console.error('Erreur API détectée:',
|
|
887
|
-
console.error('Stack trace complet:',
|
|
930
|
+
case 11:
|
|
931
|
+
_context3.p = 11;
|
|
932
|
+
_t4 = _context3.v;
|
|
933
|
+
console.error('Erreur API détectée:', _t4.message);
|
|
934
|
+
console.error('Stack trace complet:', _t4.stack);
|
|
888
935
|
console.error('Configuration SDK:', {
|
|
889
936
|
apiUrl: this.config.apiUrl,
|
|
890
937
|
type: this.config.type,
|
|
@@ -892,15 +939,33 @@
|
|
|
892
939
|
clientId: this.config.clientId ? '***' + this.config.clientId.slice(-4) : 'null',
|
|
893
940
|
secretId: this.config.secretId ? '***' + this.config.secretId.slice(-4) : 'null'
|
|
894
941
|
});
|
|
942
|
+
|
|
943
|
+
// Fallback vers le service local seulement si activé
|
|
944
|
+
if (this.config.useLocalFallback) {
|
|
945
|
+
console.log('🔍 Vérification fallback local...');
|
|
946
|
+
console.log('🔍 Hostname:', window.location.hostname);
|
|
947
|
+
console.log('🔍 Protocol:', window.location.protocol);
|
|
948
|
+
console.log('🔍 URL complète:', window.location.href);
|
|
949
|
+
isLocal = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1' || window.location.protocol === 'file:';
|
|
950
|
+
console.log('🔍 Est local:', isLocal);
|
|
951
|
+
if (isLocal) {
|
|
952
|
+
console.log('🔄 Tentative fallback vers service QR local...');
|
|
953
|
+
console.log('❌ Fallback local non implémenté - utilisation serveur distant uniquement');
|
|
954
|
+
} else {
|
|
955
|
+
console.log('❌ Pas en local, pas de fallback');
|
|
956
|
+
}
|
|
957
|
+
} else {
|
|
958
|
+
console.log('🔒 Fallback local désactivé, utilisation serveur distant uniquement');
|
|
959
|
+
}
|
|
895
960
|
console.log('Affichage du message "Service non disponible" pour type ' + this.config.type);
|
|
896
961
|
this.displayServiceUnavailable(containerId, this.config.type);
|
|
897
962
|
throw new Error('Service non disponible');
|
|
898
|
-
case
|
|
963
|
+
case 12:
|
|
899
964
|
return _context3.a(2);
|
|
900
965
|
}
|
|
901
|
-
}, _callee3, this, [[
|
|
966
|
+
}, _callee3, this, [[7, 11], [4, 6]]);
|
|
902
967
|
}));
|
|
903
|
-
function generateQR(
|
|
968
|
+
function generateQR() {
|
|
904
969
|
return _generateQR.apply(this, arguments);
|
|
905
970
|
}
|
|
906
971
|
return generateQR;
|
|
@@ -913,14 +978,12 @@
|
|
|
913
978
|
key: "generateCustomQR",
|
|
914
979
|
value: (function () {
|
|
915
980
|
var _generateCustomQR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(containerId, type) {
|
|
916
|
-
var _this3 = this;
|
|
917
981
|
var options,
|
|
918
|
-
|
|
982
|
+
response,
|
|
919
983
|
imageBaseUrl,
|
|
920
984
|
qrImageUrl,
|
|
921
|
-
_waitForSocketId2,
|
|
922
985
|
_args4 = arguments,
|
|
923
|
-
|
|
986
|
+
_t5;
|
|
924
987
|
return _regenerator().w(function (_context4) {
|
|
925
988
|
while (1) switch (_context4.p = _context4.n) {
|
|
926
989
|
case 0:
|
|
@@ -946,52 +1009,35 @@
|
|
|
946
1009
|
type: type
|
|
947
1010
|
}, options));
|
|
948
1011
|
case 4:
|
|
949
|
-
|
|
950
|
-
if (!
|
|
1012
|
+
response = _context4.v;
|
|
1013
|
+
if (!response.success) {
|
|
951
1014
|
_context4.n = 5;
|
|
952
1015
|
break;
|
|
953
1016
|
}
|
|
954
1017
|
// Construire l'URL complète de l'image QR avec la base URL pour les images
|
|
955
1018
|
imageBaseUrl = 'https://sunuid.fayma.sn';
|
|
956
|
-
qrImageUrl = "".concat(imageBaseUrl).concat(
|
|
1019
|
+
qrImageUrl = "".concat(imageBaseUrl).concat(response.data.qrcode);
|
|
957
1020
|
this.displayQRCode(containerId, qrImageUrl, type, options);
|
|
958
1021
|
|
|
959
|
-
//
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
if (_this3.socket && _this3.socket.id && _this3.socket.id !== 'unknown') {
|
|
964
|
-
var socketId = _this3.socket.id;
|
|
965
|
-
var qrContent = "".concat(type, "-").concat(_response.data.code, "-").concat(socketId);
|
|
966
|
-
|
|
967
|
-
// Utiliser le partnerName de la réponse API et le nom du type
|
|
968
|
-
var partnerName = _response.data.partnerName || _this3.config.partnerName || 'SunuID';
|
|
969
|
-
var typeName = _this3.getTypeName(type);
|
|
970
|
-
var qrLabel = "".concat(typeName, " - ").concat(partnerName);
|
|
971
|
-
_this3.generateCustomQRCode(qrContent, qrLabel, _this3.pendingQRInfo.options);
|
|
972
|
-
_this3.pendingQRInfo = null; // Nettoyer
|
|
973
|
-
} else {
|
|
974
|
-
// Réessayer après un délai si le socket ID n'est pas encore disponible
|
|
975
|
-
setTimeout(_waitForSocketId2, 100);
|
|
976
|
-
}
|
|
977
|
-
};
|
|
978
|
-
_waitForSocketId2();
|
|
979
|
-
}
|
|
1022
|
+
// Le QR code est déjà généré par l'API principale
|
|
1023
|
+
console.log('✅ QR code personnalisé généré par API principale:', qrImageUrl);
|
|
1024
|
+
console.log('📄 Code de session:', response.data.code);
|
|
1025
|
+
console.log('🆔 Service ID:', response.data.service_id);
|
|
980
1026
|
this.startAutoRefresh(containerId, type, options);
|
|
981
|
-
return _context4.a(2, _objectSpread2(_objectSpread2({},
|
|
1027
|
+
return _context4.a(2, _objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
982
1028
|
qrCodeUrl: qrImageUrl,
|
|
983
|
-
sessionId:
|
|
1029
|
+
sessionId: response.data.service_id
|
|
984
1030
|
}));
|
|
985
1031
|
case 5:
|
|
986
|
-
throw new Error(
|
|
1032
|
+
throw new Error(response.message || 'Erreur lors de la génération du QR code');
|
|
987
1033
|
case 6:
|
|
988
1034
|
_context4.n = 8;
|
|
989
1035
|
break;
|
|
990
1036
|
case 7:
|
|
991
1037
|
_context4.p = 7;
|
|
992
|
-
|
|
993
|
-
console.error('Erreur API détectée:',
|
|
994
|
-
console.error('Stack trace complet:',
|
|
1038
|
+
_t5 = _context4.v;
|
|
1039
|
+
console.error('Erreur API détectée:', _t5.message);
|
|
1040
|
+
console.error('Stack trace complet:', _t5.stack);
|
|
995
1041
|
console.error('Configuration SDK (Custom):', {
|
|
996
1042
|
apiUrl: this.config.apiUrl,
|
|
997
1043
|
type: type,
|
|
@@ -1007,7 +1053,7 @@
|
|
|
1007
1053
|
}
|
|
1008
1054
|
}, _callee4, this, [[3, 7]]);
|
|
1009
1055
|
}));
|
|
1010
|
-
function generateCustomQR(
|
|
1056
|
+
function generateCustomQR(_x, _x2) {
|
|
1011
1057
|
return _generateCustomQR.apply(this, arguments);
|
|
1012
1058
|
}
|
|
1013
1059
|
return generateCustomQR;
|
|
@@ -1027,7 +1073,7 @@
|
|
|
1027
1073
|
}
|
|
1028
1074
|
}, _callee5, this);
|
|
1029
1075
|
}));
|
|
1030
|
-
function generateAuthQR(
|
|
1076
|
+
function generateAuthQR(_x3) {
|
|
1031
1077
|
return _generateAuthQR.apply(this, arguments);
|
|
1032
1078
|
}
|
|
1033
1079
|
return generateAuthQR;
|
|
@@ -1061,7 +1107,7 @@
|
|
|
1061
1107
|
}
|
|
1062
1108
|
}, _callee6, this, [[1,, 3, 4]]);
|
|
1063
1109
|
}));
|
|
1064
|
-
function generateKYCQR(
|
|
1110
|
+
function generateKYCQR(_x4) {
|
|
1065
1111
|
return _generateKYCQR.apply(this, arguments);
|
|
1066
1112
|
}
|
|
1067
1113
|
return generateKYCQR;
|
|
@@ -1095,7 +1141,7 @@
|
|
|
1095
1141
|
}
|
|
1096
1142
|
}, _callee7, this, [[1,, 3, 4]]);
|
|
1097
1143
|
}));
|
|
1098
|
-
function generateSignatureQR(
|
|
1144
|
+
function generateSignatureQR(_x5) {
|
|
1099
1145
|
return _generateSignatureQR.apply(this, arguments);
|
|
1100
1146
|
}
|
|
1101
1147
|
return generateSignatureQR;
|
|
@@ -1107,7 +1153,7 @@
|
|
|
1107
1153
|
key: "checkQRStatus",
|
|
1108
1154
|
value: (function () {
|
|
1109
1155
|
var _checkQRStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(sessionId) {
|
|
1110
|
-
var
|
|
1156
|
+
var response, _t6;
|
|
1111
1157
|
return _regenerator().w(function (_context8) {
|
|
1112
1158
|
while (1) switch (_context8.p = _context8.n) {
|
|
1113
1159
|
case 0:
|
|
@@ -1123,36 +1169,225 @@
|
|
|
1123
1169
|
serviceId: sessionId
|
|
1124
1170
|
});
|
|
1125
1171
|
case 2:
|
|
1126
|
-
|
|
1127
|
-
if (!
|
|
1172
|
+
response = _context8.v;
|
|
1173
|
+
if (!response.success) {
|
|
1128
1174
|
_context8.n = 3;
|
|
1129
1175
|
break;
|
|
1130
1176
|
}
|
|
1131
|
-
return _context8.a(2,
|
|
1177
|
+
return _context8.a(2, response.data);
|
|
1132
1178
|
case 3:
|
|
1133
|
-
throw new Error(
|
|
1179
|
+
throw new Error(response.message || 'Erreur lors de la vérification du statut');
|
|
1134
1180
|
case 4:
|
|
1135
1181
|
_context8.n = 6;
|
|
1136
1182
|
break;
|
|
1137
1183
|
case 5:
|
|
1138
1184
|
_context8.p = 5;
|
|
1139
|
-
|
|
1140
|
-
this.handleError(
|
|
1141
|
-
throw
|
|
1185
|
+
_t6 = _context8.v;
|
|
1186
|
+
this.handleError(_t6);
|
|
1187
|
+
throw _t6;
|
|
1142
1188
|
case 6:
|
|
1143
1189
|
return _context8.a(2);
|
|
1144
1190
|
}
|
|
1145
1191
|
}, _callee8, this, [[1, 5]]);
|
|
1146
1192
|
}));
|
|
1147
|
-
function checkQRStatus(
|
|
1193
|
+
function checkQRStatus(_x6) {
|
|
1148
1194
|
return _checkQRStatus.apply(this, arguments);
|
|
1149
1195
|
}
|
|
1150
1196
|
return checkQRStatus;
|
|
1151
1197
|
}()
|
|
1152
1198
|
/**
|
|
1153
|
-
*
|
|
1199
|
+
* Générer un QR code avec un contenu spécifique
|
|
1200
|
+
*/
|
|
1201
|
+
)
|
|
1202
|
+
}, {
|
|
1203
|
+
key: "generateQRWithContent",
|
|
1204
|
+
value: (function () {
|
|
1205
|
+
var _generateQRWithContent = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(content, containerId, type) {
|
|
1206
|
+
var options,
|
|
1207
|
+
localQRUrl,
|
|
1208
|
+
_args9 = arguments,
|
|
1209
|
+
_t7;
|
|
1210
|
+
return _regenerator().w(function (_context9) {
|
|
1211
|
+
while (1) switch (_context9.p = _context9.n) {
|
|
1212
|
+
case 0:
|
|
1213
|
+
options = _args9.length > 3 && _args9[3] !== undefined ? _args9[3] : {};
|
|
1214
|
+
console.log('🎨 Génération QR avec contenu:', content);
|
|
1215
|
+
_context9.p = 1;
|
|
1216
|
+
if (!(window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1' || window.location.protocol === 'file:')) {
|
|
1217
|
+
_context9.n = 3;
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
console.log('🏠 Utilisation service QR local...');
|
|
1221
|
+
_context9.n = 2;
|
|
1222
|
+
return this.generateQRLocal(content, containerId, type, options);
|
|
1223
|
+
case 2:
|
|
1224
|
+
localQRUrl = _context9.v;
|
|
1225
|
+
if (!localQRUrl) {
|
|
1226
|
+
_context9.n = 3;
|
|
1227
|
+
break;
|
|
1228
|
+
}
|
|
1229
|
+
return _context9.a(2, localQRUrl);
|
|
1230
|
+
case 3:
|
|
1231
|
+
// Fallback vers le service QR distant
|
|
1232
|
+
console.log('🌐 Utilisation service QR distant...');
|
|
1233
|
+
_context9.n = 4;
|
|
1234
|
+
return this.generateQRRemote(content, containerId, type, options);
|
|
1235
|
+
case 4:
|
|
1236
|
+
return _context9.a(2, _context9.v);
|
|
1237
|
+
case 5:
|
|
1238
|
+
_context9.p = 5;
|
|
1239
|
+
_t7 = _context9.v;
|
|
1240
|
+
console.error('❌ Erreur génération QR:', _t7);
|
|
1241
|
+
// Fallback vers affichage simple du contenu
|
|
1242
|
+
this.displayQRContent(containerId, content, type, options);
|
|
1243
|
+
return _context9.a(2, null);
|
|
1244
|
+
}
|
|
1245
|
+
}, _callee9, this, [[1, 5]]);
|
|
1246
|
+
}));
|
|
1247
|
+
function generateQRWithContent(_x7, _x8, _x9) {
|
|
1248
|
+
return _generateQRWithContent.apply(this, arguments);
|
|
1249
|
+
}
|
|
1250
|
+
return generateQRWithContent;
|
|
1251
|
+
}()
|
|
1252
|
+
/**
|
|
1253
|
+
* Générer QR code avec service local
|
|
1154
1254
|
*/
|
|
1155
1255
|
)
|
|
1256
|
+
}, {
|
|
1257
|
+
key: "generateQRLocal",
|
|
1258
|
+
value: (function () {
|
|
1259
|
+
var _generateQRLocal = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(content, containerId, type) {
|
|
1260
|
+
var options,
|
|
1261
|
+
response,
|
|
1262
|
+
data,
|
|
1263
|
+
qrUrl,
|
|
1264
|
+
_args0 = arguments,
|
|
1265
|
+
_t8;
|
|
1266
|
+
return _regenerator().w(function (_context0) {
|
|
1267
|
+
while (1) switch (_context0.p = _context0.n) {
|
|
1268
|
+
case 0:
|
|
1269
|
+
options = _args0.length > 3 && _args0[3] !== undefined ? _args0[3] : {};
|
|
1270
|
+
_context0.p = 1;
|
|
1271
|
+
_context0.n = 2;
|
|
1272
|
+
return fetch('http://localhost:8000/api/generate/text', {
|
|
1273
|
+
method: 'POST',
|
|
1274
|
+
headers: {
|
|
1275
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
1276
|
+
},
|
|
1277
|
+
body: "text=".concat(encodeURIComponent(content), "&size=300")
|
|
1278
|
+
});
|
|
1279
|
+
case 2:
|
|
1280
|
+
response = _context0.v;
|
|
1281
|
+
if (!response.ok) {
|
|
1282
|
+
_context0.n = 4;
|
|
1283
|
+
break;
|
|
1284
|
+
}
|
|
1285
|
+
_context0.n = 3;
|
|
1286
|
+
return response.json();
|
|
1287
|
+
case 3:
|
|
1288
|
+
data = _context0.v;
|
|
1289
|
+
qrUrl = "data:image/png;base64,".concat(data.qrcode);
|
|
1290
|
+
this.displayQRCode(containerId, qrUrl, type, options);
|
|
1291
|
+
return _context0.a(2, qrUrl);
|
|
1292
|
+
case 4:
|
|
1293
|
+
_context0.n = 6;
|
|
1294
|
+
break;
|
|
1295
|
+
case 5:
|
|
1296
|
+
_context0.p = 5;
|
|
1297
|
+
_t8 = _context0.v;
|
|
1298
|
+
console.log('❌ Service QR local non disponible:', _t8.message);
|
|
1299
|
+
case 6:
|
|
1300
|
+
return _context0.a(2, null);
|
|
1301
|
+
}
|
|
1302
|
+
}, _callee0, this, [[1, 5]]);
|
|
1303
|
+
}));
|
|
1304
|
+
function generateQRLocal(_x0, _x1, _x10) {
|
|
1305
|
+
return _generateQRLocal.apply(this, arguments);
|
|
1306
|
+
}
|
|
1307
|
+
return generateQRLocal;
|
|
1308
|
+
}()
|
|
1309
|
+
/**
|
|
1310
|
+
* Générer QR code avec service distant
|
|
1311
|
+
*/
|
|
1312
|
+
)
|
|
1313
|
+
}, {
|
|
1314
|
+
key: "generateQRRemote",
|
|
1315
|
+
value: (function () {
|
|
1316
|
+
var _generateQRRemote = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(content, containerId, type) {
|
|
1317
|
+
var options,
|
|
1318
|
+
response,
|
|
1319
|
+
data,
|
|
1320
|
+
qrUrl,
|
|
1321
|
+
_args1 = arguments,
|
|
1322
|
+
_t9;
|
|
1323
|
+
return _regenerator().w(function (_context1) {
|
|
1324
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
1325
|
+
case 0:
|
|
1326
|
+
options = _args1.length > 3 && _args1[3] !== undefined ? _args1[3] : {};
|
|
1327
|
+
_context1.p = 1;
|
|
1328
|
+
_context1.n = 2;
|
|
1329
|
+
return fetch('https://api.sunuid.fayma.sn/qr-generate', {
|
|
1330
|
+
method: 'POST',
|
|
1331
|
+
headers: {
|
|
1332
|
+
'Content-Type': 'application/json'
|
|
1333
|
+
},
|
|
1334
|
+
body: JSON.stringify({
|
|
1335
|
+
text: content,
|
|
1336
|
+
size: 300,
|
|
1337
|
+
type: type
|
|
1338
|
+
})
|
|
1339
|
+
});
|
|
1340
|
+
case 2:
|
|
1341
|
+
response = _context1.v;
|
|
1342
|
+
if (!response.ok) {
|
|
1343
|
+
_context1.n = 4;
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
_context1.n = 3;
|
|
1347
|
+
return response.json();
|
|
1348
|
+
case 3:
|
|
1349
|
+
data = _context1.v;
|
|
1350
|
+
qrUrl = "data:image/png;base64,".concat(data.qrcode);
|
|
1351
|
+
this.displayQRCode(containerId, qrUrl, type, options);
|
|
1352
|
+
return _context1.a(2, qrUrl);
|
|
1353
|
+
case 4:
|
|
1354
|
+
_context1.n = 6;
|
|
1355
|
+
break;
|
|
1356
|
+
case 5:
|
|
1357
|
+
_context1.p = 5;
|
|
1358
|
+
_t9 = _context1.v;
|
|
1359
|
+
console.error('❌ Erreur service QR distant:', _t9);
|
|
1360
|
+
case 6:
|
|
1361
|
+
// Fallback vers affichage du contenu
|
|
1362
|
+
this.displayQRContent(containerId, content, type, options);
|
|
1363
|
+
return _context1.a(2, null);
|
|
1364
|
+
}
|
|
1365
|
+
}, _callee1, this, [[1, 5]]);
|
|
1366
|
+
}));
|
|
1367
|
+
function generateQRRemote(_x11, _x12, _x13) {
|
|
1368
|
+
return _generateQRRemote.apply(this, arguments);
|
|
1369
|
+
}
|
|
1370
|
+
return generateQRRemote;
|
|
1371
|
+
}()
|
|
1372
|
+
/**
|
|
1373
|
+
* Afficher le contenu QR en texte (fallback)
|
|
1374
|
+
*/
|
|
1375
|
+
)
|
|
1376
|
+
}, {
|
|
1377
|
+
key: "displayQRContent",
|
|
1378
|
+
value: function displayQRContent(containerId, content, type) {
|
|
1379
|
+
var container = document.getElementById(containerId);
|
|
1380
|
+
if (!container) {
|
|
1381
|
+
throw new Error("Conteneur avec l'ID \"".concat(containerId, "\" non trouv\xE9"));
|
|
1382
|
+
}
|
|
1383
|
+
var typeName = this.getTypeName(type);
|
|
1384
|
+
container.innerHTML = "\n <div class=\"sunuid-qr-code\">\n <div class=\"sunuid-qr-header\">\n <h3>".concat(typeName, "</h3>\n </div>\n <div class=\"sunuid-qr-content\" style=\"text-align: center; padding: 20px; background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 5px; margin: 10px 0;\">\n <p><strong>Contenu QR Code:</strong></p>\n <p style=\"font-family: monospace; font-size: 14px; word-break: break-all;\">").concat(content, "</p>\n </div>\n <div class=\"sunuid-qr-instructions\">\n <p>Contenu QR g\xE9n\xE9r\xE9 avec le format: {type}-{code}-{socketid}</p>\n </div>\n </div>\n ");
|
|
1385
|
+
console.log('✅ Contenu QR affiché:', content);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Afficher un QR code dans un conteneur
|
|
1390
|
+
*/
|
|
1156
1391
|
}, {
|
|
1157
1392
|
key: "displayQRCode",
|
|
1158
1393
|
value: function displayQRCode(containerId, qrUrl, type) {
|
|
@@ -1169,20 +1404,14 @@
|
|
|
1169
1404
|
var qrElement = document.createElement('div');
|
|
1170
1405
|
qrElement.className = 'sunuid-qr-code';
|
|
1171
1406
|
|
|
1172
|
-
// Afficher
|
|
1173
|
-
this.getTypeName(type);
|
|
1174
|
-
qrElement.innerHTML = "\n <div class=\"sunuid-qr-header\">\n <h3>".concat(type === 1 ? 'Vérification KYC' : type === 2 ? 'Authentification' : type === 3 ? 'Signature' : 'Service Type ' + type, "</h3>\n </div>\n <div class=\"sunuid-qr-image\"
|
|
1407
|
+
// Afficher l'image QR avec les informations
|
|
1408
|
+
var typeName = this.getTypeName(type);
|
|
1409
|
+
qrElement.innerHTML = "\n <div class=\"sunuid-qr-header\">\n <h3>".concat(type === 1 ? 'Vérification KYC' : type === 2 ? 'Authentification' : type === 3 ? 'Signature' : 'Service Type ' + type, "</h3>\n </div>\n <div class=\"sunuid-qr-image\">\n <img src=\"").concat(qrUrl, "\" alt=\"QR Code ").concat(typeName, "\" style=\"max-width: 300px; border: 1px solid #ddd; border-radius: 5px;\" />\n </div>\n \n ");
|
|
1175
1410
|
container.appendChild(qrElement);
|
|
1176
1411
|
|
|
1177
|
-
// Stocker les informations pour la génération ultérieure
|
|
1178
|
-
this.pendingQRInfo = {
|
|
1179
|
-
containerId: containerId,
|
|
1180
|
-
type: type,
|
|
1181
|
-
options: options
|
|
1182
|
-
};
|
|
1183
|
-
|
|
1184
1412
|
// Appliquer le thème
|
|
1185
1413
|
this.applyTheme(options.theme || this.config.theme);
|
|
1414
|
+
console.log('✅ QR code affiché:', qrUrl);
|
|
1186
1415
|
}
|
|
1187
1416
|
|
|
1188
1417
|
/**
|
|
@@ -1191,199 +1420,306 @@
|
|
|
1191
1420
|
}, {
|
|
1192
1421
|
key: "generateCustomQRCode",
|
|
1193
1422
|
value: (function () {
|
|
1194
|
-
var _generateCustomQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1195
|
-
var
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
instructionsElement,
|
|
1200
|
-
statusElement,
|
|
1201
|
-
_t6;
|
|
1202
|
-
return _regenerator().w(function (_context9) {
|
|
1203
|
-
while (1) switch (_context9.p = _context9.n) {
|
|
1423
|
+
var _generateCustomQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(content, label) {
|
|
1424
|
+
var qrContainer,
|
|
1425
|
+
_t0;
|
|
1426
|
+
return _regenerator().w(function (_context10) {
|
|
1427
|
+
while (1) switch (_context10.p = _context10.n) {
|
|
1204
1428
|
case 0:
|
|
1205
|
-
|
|
1206
|
-
console.log('🎨 Début génération QR personnalisé avec PHP...');
|
|
1429
|
+
console.log('🎨 Début génération QR personnalisé...');
|
|
1207
1430
|
console.log('📄 Contenu:', content);
|
|
1208
1431
|
console.log('🏷️ Label:', label);
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1432
|
+
|
|
1433
|
+
// Chercher le conteneur QR
|
|
1434
|
+
qrContainer = document.getElementById('sunuid-qr-container');
|
|
1435
|
+
if (!qrContainer) {
|
|
1436
|
+
qrContainer = document.getElementById('qr-container');
|
|
1437
|
+
}
|
|
1438
|
+
if (qrContainer) {
|
|
1439
|
+
_context10.n = 1;
|
|
1212
1440
|
break;
|
|
1213
1441
|
}
|
|
1214
1442
|
console.error('❌ QR container not found');
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
case 2:
|
|
1443
|
+
return _context10.a(2);
|
|
1444
|
+
case 1:
|
|
1218
1445
|
console.log('✅ QR container trouvé');
|
|
1219
1446
|
|
|
1220
1447
|
// Nettoyer le conteneur
|
|
1221
|
-
|
|
1448
|
+
qrContainer.innerHTML = '<div style="text-align: center; padding: 20px;"><p>Génération QR code...</p></div>';
|
|
1449
|
+
_context10.p = 2;
|
|
1450
|
+
// Utiliser directement l'API principale (plus fiable)
|
|
1451
|
+
console.log('🎨 Tentative génération via API principale...');
|
|
1452
|
+
_context10.n = 3;
|
|
1453
|
+
return this.generateQRPHP(content, label, qrContainer);
|
|
1454
|
+
case 3:
|
|
1455
|
+
console.log('✅ QR code généré avec succès');
|
|
1456
|
+
_context10.n = 5;
|
|
1457
|
+
break;
|
|
1458
|
+
case 4:
|
|
1459
|
+
_context10.p = 4;
|
|
1460
|
+
_t0 = _context10.v;
|
|
1461
|
+
console.error('❌ Erreur génération API:', _t0);
|
|
1462
|
+
|
|
1463
|
+
// Fallback final : image par défaut
|
|
1464
|
+
console.log('⚠️ Affichage image par défaut');
|
|
1465
|
+
this.displayDefaultQR(qrContainer, content, label);
|
|
1466
|
+
case 5:
|
|
1467
|
+
return _context10.a(2);
|
|
1468
|
+
}
|
|
1469
|
+
}, _callee10, this, [[2, 4]]);
|
|
1470
|
+
}));
|
|
1471
|
+
function generateCustomQRCode(_x14, _x15) {
|
|
1472
|
+
return _generateCustomQRCode.apply(this, arguments);
|
|
1473
|
+
}
|
|
1474
|
+
return generateCustomQRCode;
|
|
1475
|
+
}()
|
|
1476
|
+
/**
|
|
1477
|
+
* Générer un QR code côté client (méthode principale)
|
|
1478
|
+
*/
|
|
1479
|
+
)
|
|
1480
|
+
}, {
|
|
1481
|
+
key: "generateQRClientSide",
|
|
1482
|
+
value: (function () {
|
|
1483
|
+
var _generateQRClientSide = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(content, label, qrContainer) {
|
|
1484
|
+
var _this2 = this;
|
|
1485
|
+
var canvas, ctx;
|
|
1486
|
+
return _regenerator().w(function (_context11) {
|
|
1487
|
+
while (1) switch (_context11.n) {
|
|
1488
|
+
case 0:
|
|
1489
|
+
_context11.n = 1;
|
|
1490
|
+
return this.ensureQRCodeLibrary();
|
|
1491
|
+
case 1:
|
|
1492
|
+
if (!(typeof QRCode === 'undefined')) {
|
|
1493
|
+
_context11.n = 2;
|
|
1494
|
+
break;
|
|
1495
|
+
}
|
|
1496
|
+
throw new Error('QRCode library non disponible');
|
|
1497
|
+
case 2:
|
|
1498
|
+
// Créer un canvas
|
|
1499
|
+
canvas = document.createElement('canvas');
|
|
1500
|
+
canvas.width = 300;
|
|
1501
|
+
canvas.height = 320;
|
|
1502
|
+
ctx = canvas.getContext('2d'); // Fond blanc
|
|
1503
|
+
ctx.fillStyle = '#FFFFFF';
|
|
1504
|
+
ctx.fillRect(0, 0, 300, 320);
|
|
1505
|
+
|
|
1506
|
+
// Générer le QR code
|
|
1507
|
+
return _context11.a(2, new Promise(function (resolve, reject) {
|
|
1508
|
+
QRCode.toCanvas(canvas, content, {
|
|
1509
|
+
width: 280,
|
|
1510
|
+
margin: 10,
|
|
1511
|
+
color: {
|
|
1512
|
+
dark: '#000000',
|
|
1513
|
+
light: '#FFFFFF'
|
|
1514
|
+
}
|
|
1515
|
+
}, function (error) {
|
|
1516
|
+
if (error) {
|
|
1517
|
+
reject(error);
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
// Ajouter le label
|
|
1522
|
+
ctx.fillStyle = '#333333';
|
|
1523
|
+
ctx.font = 'bold 14px Arial';
|
|
1524
|
+
ctx.textAlign = 'center';
|
|
1525
|
+
ctx.fillText(label, 150, 305);
|
|
1526
|
+
|
|
1527
|
+
// Convertir en data URL
|
|
1528
|
+
var dataUrl = canvas.toDataURL('image/png');
|
|
1529
|
+
|
|
1530
|
+
// Stocker l'URL
|
|
1531
|
+
_this2.currentQRUrl = dataUrl;
|
|
1222
1532
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
// Construire l'URL du QR generator de manière plus robuste
|
|
1533
|
+
// Afficher le QR code
|
|
1534
|
+
qrContainer.innerHTML = "\n <div style=\"text-align: center; padding: 20px;\">\n <img src=\"".concat(dataUrl, "\" alt=\"QR Code\" style=\"max-width: 300px; border: 2px solid #ddd; border-radius: 10px;\">\n </div>\n ");
|
|
1226
1535
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1536
|
+
// Afficher les instructions
|
|
1537
|
+
_this2.showQRInstructions(qrContainer);
|
|
1538
|
+
resolve();
|
|
1539
|
+
});
|
|
1540
|
+
}));
|
|
1541
|
+
}
|
|
1542
|
+
}, _callee11, this);
|
|
1543
|
+
}));
|
|
1544
|
+
function generateQRClientSide(_x16, _x17, _x18) {
|
|
1545
|
+
return _generateQRClientSide.apply(this, arguments);
|
|
1546
|
+
}
|
|
1547
|
+
return generateQRClientSide;
|
|
1548
|
+
}()
|
|
1549
|
+
/**
|
|
1550
|
+
* Générer un QR code via endpoint PHP (fallback)
|
|
1551
|
+
*/
|
|
1552
|
+
)
|
|
1553
|
+
}, {
|
|
1554
|
+
key: "generateQRPHP",
|
|
1555
|
+
value: (function () {
|
|
1556
|
+
var _generateQRPHP = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(content, label, qrContainer) {
|
|
1557
|
+
var qrGeneratorUrl, requestBody, contentType, response, responseData, qrImageUrl, imageBaseUrl;
|
|
1558
|
+
return _regenerator().w(function (_context12) {
|
|
1559
|
+
while (1) switch (_context12.n) {
|
|
1560
|
+
case 0:
|
|
1561
|
+
// Construire l'URL - Utiliser l'API principale qui fonctionne
|
|
1562
|
+
|
|
1563
|
+
if (this.config.forceRemoteServer) {
|
|
1564
|
+
qrGeneratorUrl = 'https://api.sunuid.fayma.sn/qr-generate';
|
|
1565
|
+
} else if (this.config.apiUrl.includes('api.sunuid.fayma.sn')) {
|
|
1566
|
+
qrGeneratorUrl = 'https://api.sunuid.fayma.sn/qr-generate';
|
|
1567
|
+
} else if (this.config.apiUrl.includes('localhost') || this.config.apiUrl.includes('127.0.0.1')) {
|
|
1568
|
+
qrGeneratorUrl = 'http://localhost:8000/api/generate/text';
|
|
1229
1569
|
} else {
|
|
1230
|
-
qrGeneratorUrl = this.config.apiUrl
|
|
1570
|
+
qrGeneratorUrl = this.config.apiUrl + '/qr-generate';
|
|
1231
1571
|
}
|
|
1232
1572
|
console.log('🔗 URL QR Generator:', qrGeneratorUrl);
|
|
1233
|
-
|
|
1573
|
+
|
|
1574
|
+
// Adapter le format selon l'URL
|
|
1575
|
+
|
|
1576
|
+
if (qrGeneratorUrl.includes('localhost:8000')) {
|
|
1577
|
+
// Service local - format form-data
|
|
1578
|
+
contentType = 'application/x-www-form-urlencoded';
|
|
1579
|
+
requestBody = new URLSearchParams({
|
|
1580
|
+
text: content,
|
|
1581
|
+
size: 300,
|
|
1582
|
+
margin: 10,
|
|
1583
|
+
foreground_color: '000000',
|
|
1584
|
+
background_color: 'FFFFFF'
|
|
1585
|
+
});
|
|
1586
|
+
} else {
|
|
1587
|
+
// Service distant - format JSON avec les paramètres de l'API principale
|
|
1588
|
+
contentType = 'application/json';
|
|
1589
|
+
requestBody = JSON.stringify({
|
|
1590
|
+
type: this.config.type,
|
|
1591
|
+
client_id: this.config.clientId,
|
|
1592
|
+
secret_id: this.config.secretId,
|
|
1593
|
+
content: content,
|
|
1594
|
+
label: label
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
_context12.n = 1;
|
|
1234
1598
|
return fetch(qrGeneratorUrl, {
|
|
1235
1599
|
method: 'POST',
|
|
1236
1600
|
headers: {
|
|
1237
|
-
'Content-Type':
|
|
1601
|
+
'Content-Type': contentType,
|
|
1238
1602
|
'Accept': 'application/json'
|
|
1239
1603
|
},
|
|
1240
|
-
body:
|
|
1241
|
-
content: content,
|
|
1242
|
-
label: label,
|
|
1243
|
-
size: 300,
|
|
1244
|
-
margin: 10
|
|
1245
|
-
})
|
|
1604
|
+
body: requestBody
|
|
1246
1605
|
});
|
|
1247
|
-
case
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
_context9.n = 4;
|
|
1606
|
+
case 1:
|
|
1607
|
+
response = _context12.v;
|
|
1608
|
+
if (response.ok) {
|
|
1609
|
+
_context12.n = 2;
|
|
1252
1610
|
break;
|
|
1253
1611
|
}
|
|
1254
|
-
throw new Error("Erreur HTTP: ".concat(
|
|
1255
|
-
case
|
|
1256
|
-
|
|
1257
|
-
return
|
|
1258
|
-
case
|
|
1259
|
-
responseData =
|
|
1612
|
+
throw new Error("Erreur HTTP: ".concat(response.status));
|
|
1613
|
+
case 2:
|
|
1614
|
+
_context12.n = 3;
|
|
1615
|
+
return response.json();
|
|
1616
|
+
case 3:
|
|
1617
|
+
responseData = _context12.v;
|
|
1260
1618
|
if (responseData.success) {
|
|
1261
|
-
|
|
1619
|
+
_context12.n = 4;
|
|
1262
1620
|
break;
|
|
1263
1621
|
}
|
|
1264
|
-
throw new Error("Erreur
|
|
1265
|
-
case
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
// Stocker l'URL du QR code pour getQRCode()
|
|
1271
|
-
this.currentQRUrl = responseData.data.dataUrl;
|
|
1272
|
-
|
|
1273
|
-
// Créer le conteneur avec le QR code PHP
|
|
1274
|
-
_qrContainer.innerHTML = "\n <div class=\"sunuid-qr-ready\" style=\"text-align: center; padding: 20px;\">\n <img src=\"".concat(responseData.data.dataUrl, "\" alt=\"QR Code ").concat(this.config.partnerName, "\" style=\"max-width: 300px; border: 2px solid #ddd; border-radius: 10px;\">\n </div>\n ");
|
|
1275
|
-
|
|
1276
|
-
// Afficher les instructions et le statut maintenant que le QR est prêt
|
|
1277
|
-
instructionsElement = _qrContainer.parentElement.querySelector('.sunuid-qr-instructions');
|
|
1278
|
-
statusElement = _qrContainer.parentElement.querySelector('.sunuid-qr-status');
|
|
1279
|
-
if (instructionsElement) {
|
|
1280
|
-
instructionsElement.style.display = 'block';
|
|
1281
|
-
instructionsElement.classList.add('sunuid-qr-ready');
|
|
1282
|
-
}
|
|
1283
|
-
if (statusElement) {
|
|
1284
|
-
statusElement.style.display = 'block';
|
|
1285
|
-
statusElement.classList.add('sunuid-qr-ready');
|
|
1286
|
-
}
|
|
1287
|
-
console.log('✅ QR code PHP affiché dans le conteneur');
|
|
1288
|
-
_context9.n = 8;
|
|
1289
|
-
break;
|
|
1290
|
-
case 7:
|
|
1291
|
-
_context9.p = 7;
|
|
1292
|
-
_t6 = _context9.v;
|
|
1293
|
-
console.error('❌ Erreur génération QR PHP:', _t6);
|
|
1294
|
-
console.error('Stack trace:', _t6.stack);
|
|
1295
|
-
|
|
1296
|
-
// Détecter les erreurs CORS ou 404 pour activer le fallback côté client
|
|
1297
|
-
if (_t6.message.includes('Failed to fetch') || _t6.message.includes('CORS') || _t6.message.includes('404') || _t6.message.includes('Not Found')) {
|
|
1298
|
-
console.warn('🚫 Erreur PHP détectée (CORS/404), tentative de génération QR côté client...');
|
|
1299
|
-
this.generateQRCodeClientSide(content, label, qrContainer);
|
|
1622
|
+
throw new Error("Erreur QR: ".concat(responseData.error));
|
|
1623
|
+
case 4:
|
|
1624
|
+
if (qrGeneratorUrl.includes('localhost:8000')) {
|
|
1625
|
+
// Service local
|
|
1626
|
+
qrImageUrl = responseData.data_uri;
|
|
1300
1627
|
} else {
|
|
1301
|
-
|
|
1628
|
+
// Service distant - utiliser le format de l'API principale
|
|
1629
|
+
imageBaseUrl = 'https://sunuid.fayma.sn';
|
|
1630
|
+
qrImageUrl = "".concat(imageBaseUrl).concat(responseData.data.qrcode);
|
|
1302
1631
|
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1632
|
+
|
|
1633
|
+
// Stocker l'URL
|
|
1634
|
+
this.currentQRUrl = qrImageUrl;
|
|
1635
|
+
|
|
1636
|
+
// Afficher le QR code
|
|
1637
|
+
qrContainer.innerHTML = "\n <div style=\"text-align: center; padding: 20px;\">\n <img src=\"".concat(qrImageUrl, "\" alt=\"QR Code\" style=\"max-width: 300px; border: 2px solid #ddd; border-radius: 10px;\">\n </div>\n ");
|
|
1638
|
+
|
|
1639
|
+
// Afficher les instructions
|
|
1640
|
+
this.showQRInstructions(qrContainer);
|
|
1641
|
+
case 5:
|
|
1642
|
+
return _context12.a(2);
|
|
1305
1643
|
}
|
|
1306
|
-
},
|
|
1644
|
+
}, _callee12, this);
|
|
1307
1645
|
}));
|
|
1308
|
-
function
|
|
1309
|
-
return
|
|
1646
|
+
function generateQRPHP(_x19, _x20, _x21) {
|
|
1647
|
+
return _generateQRPHP.apply(this, arguments);
|
|
1310
1648
|
}
|
|
1311
|
-
return
|
|
1649
|
+
return generateQRPHP;
|
|
1312
1650
|
}()
|
|
1313
1651
|
/**
|
|
1314
|
-
*
|
|
1652
|
+
* Afficher une image QR par défaut (fallback final)
|
|
1315
1653
|
*/
|
|
1316
1654
|
)
|
|
1317
1655
|
}, {
|
|
1318
|
-
key: "
|
|
1319
|
-
value: function
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
console.log('🎨 Génération QR côté client...');
|
|
1323
|
-
|
|
1324
|
-
// Vérifier si QRCode est disponible
|
|
1325
|
-
if (typeof QRCode === 'undefined') {
|
|
1326
|
-
console.error('❌ QRCode library non disponible');
|
|
1327
|
-
this.displayFallbackImage();
|
|
1328
|
-
return;
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
// Créer un canvas pour le QR code
|
|
1332
|
-
var canvas = document.createElement('canvas');
|
|
1333
|
-
canvas.width = 300;
|
|
1334
|
-
canvas.height = 320; // Plus d'espace pour le label
|
|
1335
|
-
var ctx = canvas.getContext('2d');
|
|
1336
|
-
|
|
1337
|
-
// Remplir le fond en blanc
|
|
1338
|
-
ctx.fillStyle = '#FFFFFF';
|
|
1339
|
-
ctx.fillRect(0, 0, 300, 320);
|
|
1340
|
-
|
|
1341
|
-
// Générer le QR code avec QRCode library
|
|
1342
|
-
QRCode.toCanvas(canvas, content, {
|
|
1343
|
-
width: 280,
|
|
1344
|
-
margin: 10,
|
|
1345
|
-
color: {
|
|
1346
|
-
dark: '#000000',
|
|
1347
|
-
light: '#FFFFFF'
|
|
1348
|
-
}
|
|
1349
|
-
}, function (error) {
|
|
1350
|
-
if (error) {
|
|
1351
|
-
console.error('❌ Erreur génération QR côté client:', error);
|
|
1352
|
-
_this4.displayFallbackImage();
|
|
1353
|
-
return;
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
// Ajouter le label en bas du QR code (sans afficher le contenu)
|
|
1357
|
-
ctx.fillStyle = '#333333';
|
|
1358
|
-
ctx.font = 'bold 14px Arial';
|
|
1359
|
-
ctx.textAlign = 'center';
|
|
1360
|
-
ctx.fillText(label, 150, 305);
|
|
1361
|
-
|
|
1362
|
-
// Convertir en data URL
|
|
1363
|
-
var dataUrl = canvas.toDataURL('image/png');
|
|
1364
|
-
|
|
1365
|
-
// Stocker l'URL du QR code pour getQRCode()
|
|
1366
|
-
_this4.currentQRUrl = dataUrl;
|
|
1367
|
-
|
|
1368
|
-
// Afficher le QR code (sans le contenu)
|
|
1369
|
-
qrContainer.innerHTML = "\n <div class=\"sunuid-qr-ready\" style=\"text-align: center; padding: 20px;\">\n <img src=\"".concat(dataUrl, "\" alt=\"QR Code ").concat(_this4.config.partnerName, "\" style=\"max-width: 300px; border: 2px solid #ddd; border-radius: 10px;\">\n </div>\n ");
|
|
1656
|
+
key: "displayDefaultQR",
|
|
1657
|
+
value: function displayDefaultQR(qrContainer, content, label) {
|
|
1658
|
+
qrContainer.innerHTML = "\n <div style=\"text-align: center; padding: 20px; color: #666;\">\n <div style=\"width: 300px; height: 300px; background: #f0f0f0; border: 2px solid #ddd; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin: 0 auto;\">\n <div>\n <p style=\"font-size: 24px; margin: 0;\">\uD83D\uDCF1</p>\n <p style=\"font-size: 14px; margin: 10px 0 0 0;\">QR Code</p>\n </div>\n </div>\n <p style=\"margin-top: 10px; font-size: 12px;\">".concat(label, "</p>\n <p style=\"font-size: 10px; color: #999; margin-top: 5px;\">Contenu: ").concat(content, "</p>\n </div>\n ");
|
|
1659
|
+
}
|
|
1370
1660
|
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1661
|
+
/**
|
|
1662
|
+
* S'assurer que la bibliothèque QRCode est disponible
|
|
1663
|
+
*/
|
|
1664
|
+
}, {
|
|
1665
|
+
key: "ensureQRCodeLibrary",
|
|
1666
|
+
value: (function () {
|
|
1667
|
+
var _ensureQRCodeLibrary = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
|
|
1668
|
+
return _regenerator().w(function (_context13) {
|
|
1669
|
+
while (1) switch (_context13.n) {
|
|
1670
|
+
case 0:
|
|
1671
|
+
if (!(typeof QRCode !== 'undefined')) {
|
|
1672
|
+
_context13.n = 1;
|
|
1673
|
+
break;
|
|
1674
|
+
}
|
|
1675
|
+
console.log('✅ QRCode library déjà disponible');
|
|
1676
|
+
return _context13.a(2, true);
|
|
1677
|
+
case 1:
|
|
1678
|
+
console.log('📦 Chargement QRCode library...');
|
|
1679
|
+
return _context13.a(2, new Promise(function (resolve, reject) {
|
|
1680
|
+
var script = document.createElement('script');
|
|
1681
|
+
script.src = 'https://cdn.jsdelivr.net/npm/qrcode@1.5.3/lib/browser.min.js';
|
|
1682
|
+
script.onload = function () {
|
|
1683
|
+
setTimeout(function () {
|
|
1684
|
+
if (typeof QRCode !== 'undefined') {
|
|
1685
|
+
console.log('✅ QRCode library chargée');
|
|
1686
|
+
resolve(true);
|
|
1687
|
+
} else {
|
|
1688
|
+
console.error('❌ QRCode non disponible après chargement');
|
|
1689
|
+
reject(new Error('QRCode library non disponible après chargement'));
|
|
1690
|
+
}
|
|
1691
|
+
}, 200);
|
|
1692
|
+
};
|
|
1693
|
+
script.onerror = function () {
|
|
1694
|
+
console.error('❌ Erreur chargement QRCode library');
|
|
1695
|
+
reject(new Error('Erreur chargement QRCode library'));
|
|
1696
|
+
};
|
|
1697
|
+
document.head.appendChild(script);
|
|
1698
|
+
}));
|
|
1381
1699
|
}
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1700
|
+
}, _callee13);
|
|
1701
|
+
}));
|
|
1702
|
+
function ensureQRCodeLibrary() {
|
|
1703
|
+
return _ensureQRCodeLibrary.apply(this, arguments);
|
|
1704
|
+
}
|
|
1705
|
+
return ensureQRCodeLibrary;
|
|
1706
|
+
}()
|
|
1707
|
+
/**
|
|
1708
|
+
* Afficher les instructions pour le QR code
|
|
1709
|
+
*/
|
|
1710
|
+
)
|
|
1711
|
+
}, {
|
|
1712
|
+
key: "showQRInstructions",
|
|
1713
|
+
value: function showQRInstructions(qrContainer) {
|
|
1714
|
+
var instructionsElement = qrContainer.parentElement.querySelector('.sunuid-qr-instructions');
|
|
1715
|
+
var statusElement = qrContainer.parentElement.querySelector('.sunuid-qr-status');
|
|
1716
|
+
if (instructionsElement) {
|
|
1717
|
+
instructionsElement.style.display = 'block';
|
|
1718
|
+
instructionsElement.classList.add('sunuid-qr-ready');
|
|
1719
|
+
}
|
|
1720
|
+
if (statusElement) {
|
|
1721
|
+
statusElement.style.display = 'block';
|
|
1722
|
+
statusElement.classList.add('sunuid-qr-ready');
|
|
1387
1723
|
}
|
|
1388
1724
|
}
|
|
1389
1725
|
|
|
@@ -1424,8 +1760,6 @@
|
|
|
1424
1760
|
var qrContainer = document.getElementById('sunuid-qr-container');
|
|
1425
1761
|
if (qrContainer) {
|
|
1426
1762
|
qrContainer.innerHTML = "\n <div style=\"text-align: center; padding: 20px; color: #666;\">\n <p>\u26A0\uFE0F G\xE9n\xE9ration QR personnalis\xE9 non disponible</p>\n <p>Utilisation de l'image par d\xE9faut</p>\n <p><strong>Debug:</strong> QRCode disponible: ".concat(typeof QRCode !== 'undefined', "</p>\n <p><strong>Debug:</strong> Container trouv\xE9: ").concat(qrContainer !== null, "</p>\n </div>\n ");
|
|
1427
|
-
} else {
|
|
1428
|
-
console.error('❌ Container QR non trouvé pour fallback');
|
|
1429
1763
|
}
|
|
1430
1764
|
}
|
|
1431
1765
|
|
|
@@ -1450,33 +1784,55 @@
|
|
|
1450
1784
|
}, {
|
|
1451
1785
|
key: "refreshQR",
|
|
1452
1786
|
value: (function () {
|
|
1453
|
-
var _refreshQR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1787
|
+
var _refreshQR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(containerId) {
|
|
1454
1788
|
var options,
|
|
1455
1789
|
result,
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1790
|
+
_result,
|
|
1791
|
+
_args14 = arguments,
|
|
1792
|
+
_t1;
|
|
1793
|
+
return _regenerator().w(function (_context14) {
|
|
1794
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
1460
1795
|
case 0:
|
|
1461
|
-
options =
|
|
1462
|
-
|
|
1463
|
-
|
|
1796
|
+
options = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {};
|
|
1797
|
+
_context14.p = 1;
|
|
1798
|
+
if (!this.currentQRUrl) {
|
|
1799
|
+
_context14.n = 3;
|
|
1800
|
+
break;
|
|
1801
|
+
}
|
|
1802
|
+
console.log('🔄 Vérification du statut du QR code existant...');
|
|
1803
|
+
|
|
1804
|
+
// Option 1: Vérifier le statut du QR code via l'API
|
|
1805
|
+
// (à implémenter si l'API le supporte)
|
|
1806
|
+
|
|
1807
|
+
// Option 2: Régénérer le QR code seulement si nécessaire
|
|
1808
|
+
// Pour l'instant, on régénère pour s'assurer qu'il est à jour
|
|
1809
|
+
_context14.n = 2;
|
|
1464
1810
|
return this.generateQR(containerId, options);
|
|
1465
1811
|
case 2:
|
|
1466
|
-
result =
|
|
1467
|
-
return
|
|
1812
|
+
result = _context14.v;
|
|
1813
|
+
return _context14.a(2, result);
|
|
1468
1814
|
case 3:
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
this.displayServiceUnavailable(containerId, this.config.type);
|
|
1473
|
-
throw _t7;
|
|
1815
|
+
console.log('🔄 Pas de QR code existant, génération d\'un nouveau...');
|
|
1816
|
+
_context14.n = 4;
|
|
1817
|
+
return this.generateQR(containerId, options);
|
|
1474
1818
|
case 4:
|
|
1475
|
-
|
|
1819
|
+
_result = _context14.v;
|
|
1820
|
+
return _context14.a(2, _result);
|
|
1821
|
+
case 5:
|
|
1822
|
+
_context14.n = 7;
|
|
1823
|
+
break;
|
|
1824
|
+
case 6:
|
|
1825
|
+
_context14.p = 6;
|
|
1826
|
+
_t1 = _context14.v;
|
|
1827
|
+
console.error('Erreur lors du rafraîchissement:', _t1.message);
|
|
1828
|
+
this.displayServiceUnavailable(containerId, this.config.type);
|
|
1829
|
+
throw _t1;
|
|
1830
|
+
case 7:
|
|
1831
|
+
return _context14.a(2);
|
|
1476
1832
|
}
|
|
1477
|
-
},
|
|
1833
|
+
}, _callee14, this, [[1, 6]]);
|
|
1478
1834
|
}));
|
|
1479
|
-
function refreshQR(
|
|
1835
|
+
function refreshQR(_x22) {
|
|
1480
1836
|
return _refreshQR.apply(this, arguments);
|
|
1481
1837
|
}
|
|
1482
1838
|
return refreshQR;
|
|
@@ -1488,28 +1844,36 @@
|
|
|
1488
1844
|
}, {
|
|
1489
1845
|
key: "startAutoRefresh",
|
|
1490
1846
|
value: function startAutoRefresh(containerId, type, options) {
|
|
1491
|
-
var
|
|
1847
|
+
var _this3 = this;
|
|
1492
1848
|
if (!this.config.autoRefresh) return;
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1849
|
+
|
|
1850
|
+
// Arrêter le timer existant s'il y en a un
|
|
1851
|
+
if (this.refreshTimer) {
|
|
1852
|
+
clearInterval(this.refreshTimer);
|
|
1853
|
+
console.log('🔄 Timer de rafraîchissement précédent arrêté');
|
|
1854
|
+
}
|
|
1855
|
+
this.refreshTimer = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
1856
|
+
var _t10;
|
|
1857
|
+
return _regenerator().w(function (_context15) {
|
|
1858
|
+
while (1) switch (_context15.p = _context15.n) {
|
|
1497
1859
|
case 0:
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1860
|
+
_context15.p = 0;
|
|
1861
|
+
console.log('🔄 Rafraîchissement automatique du QR code...');
|
|
1862
|
+
_context15.n = 1;
|
|
1863
|
+
return _this3.refreshQR(containerId, type, options);
|
|
1501
1864
|
case 1:
|
|
1502
|
-
|
|
1865
|
+
_context15.n = 3;
|
|
1503
1866
|
break;
|
|
1504
1867
|
case 2:
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
console.warn('Erreur lors du rafraîchissement automatique:',
|
|
1868
|
+
_context15.p = 2;
|
|
1869
|
+
_t10 = _context15.v;
|
|
1870
|
+
console.warn('Erreur lors du rafraîchissement automatique:', _t10);
|
|
1508
1871
|
case 3:
|
|
1509
|
-
return
|
|
1872
|
+
return _context15.a(2);
|
|
1510
1873
|
}
|
|
1511
|
-
},
|
|
1874
|
+
}, _callee15, null, [[0, 2]]);
|
|
1512
1875
|
})), this.config.refreshInterval);
|
|
1876
|
+
console.log("\uD83D\uDD04 Timer de rafra\xEEchissement d\xE9marr\xE9 (".concat(this.config.refreshInterval, "ms)"));
|
|
1513
1877
|
}
|
|
1514
1878
|
|
|
1515
1879
|
/**
|
|
@@ -1522,16 +1886,16 @@
|
|
|
1522
1886
|
}, {
|
|
1523
1887
|
key: "makeRequest",
|
|
1524
1888
|
value: (function () {
|
|
1525
|
-
var _makeRequest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1889
|
+
var _makeRequest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(endpoint, data) {
|
|
1526
1890
|
var _window$SunuIDConfig4,
|
|
1527
1891
|
_window$SunuIDConfig5,
|
|
1528
|
-
|
|
1892
|
+
_this4 = this;
|
|
1529
1893
|
var sanitizedData, endpointPath, url, retryCount, maxRetries, _loop, _ret;
|
|
1530
|
-
return _regenerator().w(function (
|
|
1531
|
-
while (1) switch (
|
|
1894
|
+
return _regenerator().w(function (_context17) {
|
|
1895
|
+
while (1) switch (_context17.n) {
|
|
1532
1896
|
case 0:
|
|
1533
1897
|
if (this.isInitialized) {
|
|
1534
|
-
|
|
1898
|
+
_context17.n = 1;
|
|
1535
1899
|
break;
|
|
1536
1900
|
}
|
|
1537
1901
|
this.logSecurityEvent('REQUEST_BEFORE_INIT', {
|
|
@@ -1540,12 +1904,12 @@
|
|
|
1540
1904
|
throw new Error('SDK non initialisé');
|
|
1541
1905
|
case 1:
|
|
1542
1906
|
if (!this.config.secureInit) {
|
|
1543
|
-
|
|
1907
|
+
_context17.n = 2;
|
|
1544
1908
|
break;
|
|
1545
1909
|
}
|
|
1546
1910
|
this.config.requestCount++;
|
|
1547
1911
|
if (!(this.config.requestCount > this.config.maxRequests)) {
|
|
1548
|
-
|
|
1912
|
+
_context17.n = 2;
|
|
1549
1913
|
break;
|
|
1550
1914
|
}
|
|
1551
1915
|
this.logSecurityEvent('API_REQUEST_LIMIT_EXCEEDED', {
|
|
@@ -1580,15 +1944,15 @@
|
|
|
1580
1944
|
retryCount = 0;
|
|
1581
1945
|
maxRetries = this.config.maxRetries;
|
|
1582
1946
|
_loop = /*#__PURE__*/_regenerator().m(function _loop() {
|
|
1583
|
-
var controller, timeoutId, headers,
|
|
1584
|
-
return _regenerator().w(function (
|
|
1585
|
-
while (1) switch (
|
|
1947
|
+
var controller, timeoutId, headers, response, errorText, errorData, result, _t11;
|
|
1948
|
+
return _regenerator().w(function (_context16) {
|
|
1949
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
1586
1950
|
case 0:
|
|
1587
|
-
|
|
1951
|
+
_context16.p = 0;
|
|
1588
1952
|
controller = new AbortController();
|
|
1589
1953
|
timeoutId = setTimeout(function () {
|
|
1590
1954
|
return controller.abort();
|
|
1591
|
-
},
|
|
1955
|
+
}, _this4.config.requestTimeout); // Headers minimaux (API SunuID n'accepte que les headers essentiels)
|
|
1592
1956
|
headers = {
|
|
1593
1957
|
'Content-Type': 'application/json'
|
|
1594
1958
|
}; // Note: En mode sécurisé, les credentials sont dans le body
|
|
@@ -1596,7 +1960,7 @@
|
|
|
1596
1960
|
// if (this.config.secureInit && this.config.token) {
|
|
1597
1961
|
// headers['X-Secure-Token'] = this.config.token;
|
|
1598
1962
|
// }
|
|
1599
|
-
|
|
1963
|
+
_context16.n = 1;
|
|
1600
1964
|
return fetch(url, {
|
|
1601
1965
|
method: 'POST',
|
|
1602
1966
|
headers: headers,
|
|
@@ -1604,16 +1968,16 @@
|
|
|
1604
1968
|
signal: controller.signal
|
|
1605
1969
|
});
|
|
1606
1970
|
case 1:
|
|
1607
|
-
|
|
1971
|
+
response = _context16.v;
|
|
1608
1972
|
clearTimeout(timeoutId);
|
|
1609
|
-
if (
|
|
1610
|
-
|
|
1973
|
+
if (response.ok) {
|
|
1974
|
+
_context16.n = 3;
|
|
1611
1975
|
break;
|
|
1612
1976
|
}
|
|
1613
|
-
|
|
1614
|
-
return
|
|
1977
|
+
_context16.n = 2;
|
|
1978
|
+
return response.text();
|
|
1615
1979
|
case 2:
|
|
1616
|
-
errorText =
|
|
1980
|
+
errorText = _context16.v;
|
|
1617
1981
|
try {
|
|
1618
1982
|
errorData = JSON.parse(errorText);
|
|
1619
1983
|
} catch (e) {
|
|
@@ -1621,90 +1985,90 @@
|
|
|
1621
1985
|
message: errorText
|
|
1622
1986
|
};
|
|
1623
1987
|
}
|
|
1624
|
-
|
|
1625
|
-
status:
|
|
1626
|
-
statusText:
|
|
1988
|
+
_this4.logSecurityEvent('API_REQUEST_ERROR', {
|
|
1989
|
+
status: response.status,
|
|
1990
|
+
statusText: response.statusText,
|
|
1627
1991
|
error: errorData.message
|
|
1628
1992
|
});
|
|
1629
|
-
throw new Error(errorData.message || "Erreur HTTP: ".concat(
|
|
1993
|
+
throw new Error(errorData.message || "Erreur HTTP: ".concat(response.status));
|
|
1630
1994
|
case 3:
|
|
1631
|
-
|
|
1632
|
-
return
|
|
1995
|
+
_context16.n = 4;
|
|
1996
|
+
return response.json();
|
|
1633
1997
|
case 4:
|
|
1634
|
-
result =
|
|
1635
|
-
|
|
1998
|
+
result = _context16.v;
|
|
1999
|
+
_this4.logSecurityEvent('API_REQUEST_SUCCESS', {
|
|
1636
2000
|
endpoint: endpointPath,
|
|
1637
2001
|
responseKeys: Object.keys(result)
|
|
1638
2002
|
});
|
|
1639
|
-
return
|
|
2003
|
+
return _context16.a(2, {
|
|
1640
2004
|
v: result
|
|
1641
2005
|
});
|
|
1642
2006
|
case 5:
|
|
1643
|
-
|
|
1644
|
-
|
|
2007
|
+
_context16.p = 5;
|
|
2008
|
+
_t11 = _context16.v;
|
|
1645
2009
|
retryCount++;
|
|
1646
|
-
if (!(
|
|
1647
|
-
|
|
2010
|
+
if (!(_t11.name === 'AbortError')) {
|
|
2011
|
+
_context16.n = 7;
|
|
1648
2012
|
break;
|
|
1649
2013
|
}
|
|
1650
|
-
|
|
2014
|
+
_this4.logSecurityEvent('API_REQUEST_TIMEOUT', {
|
|
1651
2015
|
retryCount: retryCount
|
|
1652
2016
|
});
|
|
1653
2017
|
if (!(retryCount > maxRetries)) {
|
|
1654
|
-
|
|
2018
|
+
_context16.n = 6;
|
|
1655
2019
|
break;
|
|
1656
2020
|
}
|
|
1657
2021
|
throw new Error('Timeout de la requête API');
|
|
1658
2022
|
case 6:
|
|
1659
|
-
return
|
|
2023
|
+
return _context16.a(2, 0);
|
|
1660
2024
|
case 7:
|
|
1661
2025
|
if (!(retryCount > maxRetries)) {
|
|
1662
|
-
|
|
2026
|
+
_context16.n = 8;
|
|
1663
2027
|
break;
|
|
1664
2028
|
}
|
|
1665
|
-
|
|
2029
|
+
_this4.logSecurityEvent('API_REQUEST_MAX_RETRIES', {
|
|
1666
2030
|
retryCount: retryCount,
|
|
1667
|
-
error:
|
|
2031
|
+
error: _t11.message
|
|
1668
2032
|
});
|
|
1669
|
-
throw
|
|
2033
|
+
throw _t11;
|
|
1670
2034
|
case 8:
|
|
1671
|
-
|
|
2035
|
+
_context16.n = 9;
|
|
1672
2036
|
return new Promise(function (resolve) {
|
|
1673
2037
|
return setTimeout(resolve, 1000 * retryCount);
|
|
1674
2038
|
});
|
|
1675
2039
|
case 9:
|
|
1676
|
-
return
|
|
2040
|
+
return _context16.a(2);
|
|
1677
2041
|
}
|
|
1678
2042
|
}, _loop, null, [[0, 5]]);
|
|
1679
2043
|
});
|
|
1680
2044
|
case 3:
|
|
1681
2045
|
if (!(retryCount <= maxRetries)) {
|
|
1682
|
-
|
|
2046
|
+
_context17.n = 7;
|
|
1683
2047
|
break;
|
|
1684
2048
|
}
|
|
1685
|
-
return
|
|
2049
|
+
return _context17.d(_regeneratorValues(_loop()), 4);
|
|
1686
2050
|
case 4:
|
|
1687
|
-
_ret =
|
|
2051
|
+
_ret = _context17.v;
|
|
1688
2052
|
if (!(_ret === 0)) {
|
|
1689
|
-
|
|
2053
|
+
_context17.n = 5;
|
|
1690
2054
|
break;
|
|
1691
2055
|
}
|
|
1692
|
-
return
|
|
2056
|
+
return _context17.a(3, 3);
|
|
1693
2057
|
case 5:
|
|
1694
2058
|
if (!_ret) {
|
|
1695
|
-
|
|
2059
|
+
_context17.n = 6;
|
|
1696
2060
|
break;
|
|
1697
2061
|
}
|
|
1698
|
-
return
|
|
2062
|
+
return _context17.a(2, _ret.v);
|
|
1699
2063
|
case 6:
|
|
1700
|
-
|
|
2064
|
+
_context17.n = 3;
|
|
1701
2065
|
break;
|
|
1702
2066
|
case 7:
|
|
1703
|
-
return
|
|
2067
|
+
return _context17.a(2);
|
|
1704
2068
|
}
|
|
1705
|
-
},
|
|
2069
|
+
}, _callee16, this);
|
|
1706
2070
|
}));
|
|
1707
|
-
function makeRequest(
|
|
2071
|
+
function makeRequest(_x23, _x24) {
|
|
1708
2072
|
return _makeRequest.apply(this, arguments);
|
|
1709
2073
|
}
|
|
1710
2074
|
return makeRequest;
|
|
@@ -1760,9 +2124,88 @@
|
|
|
1760
2124
|
return 'req_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);
|
|
1761
2125
|
}
|
|
1762
2126
|
|
|
2127
|
+
/**
|
|
2128
|
+
* Générer un code de session unique
|
|
2129
|
+
*/
|
|
2130
|
+
}, {
|
|
2131
|
+
key: "generateSessionCode",
|
|
2132
|
+
value: function generateSessionCode() {
|
|
2133
|
+
var timestamp = Date.now();
|
|
2134
|
+
var random = Math.random().toString(36).substr(2, 9);
|
|
2135
|
+
var code = "".concat(timestamp, "_").concat(random);
|
|
2136
|
+
return btoa(code); // Encoder en base64
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* Récupérer les informations du partenaire depuis l'API
|
|
2141
|
+
*/
|
|
2142
|
+
}, {
|
|
2143
|
+
key: "fetchPartnerInfo",
|
|
2144
|
+
value: (function () {
|
|
2145
|
+
var _fetchPartnerInfo = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
|
|
2146
|
+
var response, authTest, _t12;
|
|
2147
|
+
return _regenerator().w(function (_context18) {
|
|
2148
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
2149
|
+
case 0:
|
|
2150
|
+
_context18.p = 0;
|
|
2151
|
+
_context18.n = 1;
|
|
2152
|
+
return this.makeRequest('/debug', {
|
|
2153
|
+
type: this.config.type,
|
|
2154
|
+
client_id: this.config.clientId,
|
|
2155
|
+
secret_id: this.config.secretId
|
|
2156
|
+
});
|
|
2157
|
+
case 1:
|
|
2158
|
+
response = _context18.v;
|
|
2159
|
+
console.log('📋 Réponse debug API:', response);
|
|
2160
|
+
if (response.success && response.authentication && response.authentication.auth_test) {
|
|
2161
|
+
authTest = response.authentication.auth_test;
|
|
2162
|
+
this.config.partnerId = authTest.partner_id;
|
|
2163
|
+
|
|
2164
|
+
// Récupérer le service_id depuis la réponse
|
|
2165
|
+
if (response.service_id) {
|
|
2166
|
+
this.config.serviceId = response.service_id;
|
|
2167
|
+
} else {
|
|
2168
|
+
// Fallback: utiliser le partner_id comme service_id
|
|
2169
|
+
this.config.serviceId = authTest.partner_id;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
// Utiliser le partner_id pour déterminer le nom du partenaire
|
|
2173
|
+
// Pour l'instant, on utilise une logique simple basée sur l'ID
|
|
2174
|
+
if (authTest.partner_id === 21) {
|
|
2175
|
+
this.config.partnerName = 'Fayma';
|
|
2176
|
+
} else {
|
|
2177
|
+
this.config.partnerName = "Partner_".concat(authTest.partner_id);
|
|
2178
|
+
}
|
|
2179
|
+
console.log('✅ Informations partenaire récupérées:', {
|
|
2180
|
+
partnerName: this.config.partnerName,
|
|
2181
|
+
partnerId: this.config.partnerId,
|
|
2182
|
+
serviceId: this.config.serviceId
|
|
2183
|
+
});
|
|
2184
|
+
} else {
|
|
2185
|
+
console.warn('⚠️ Impossible de récupérer les informations du partenaire, utilisation du partner_id');
|
|
2186
|
+
this.config.partnerName = "Partner_".concat(this.config.partnerId || 'unknown');
|
|
2187
|
+
}
|
|
2188
|
+
_context18.n = 3;
|
|
2189
|
+
break;
|
|
2190
|
+
case 2:
|
|
2191
|
+
_context18.p = 2;
|
|
2192
|
+
_t12 = _context18.v;
|
|
2193
|
+
console.warn('⚠️ Erreur lors de la récupération des informations du partenaire:', _t12.message);
|
|
2194
|
+
this.config.partnerName = 'Partner_unknown';
|
|
2195
|
+
case 3:
|
|
2196
|
+
return _context18.a(2);
|
|
2197
|
+
}
|
|
2198
|
+
}, _callee17, this, [[0, 2]]);
|
|
2199
|
+
}));
|
|
2200
|
+
function fetchPartnerInfo() {
|
|
2201
|
+
return _fetchPartnerInfo.apply(this, arguments);
|
|
2202
|
+
}
|
|
2203
|
+
return fetchPartnerInfo;
|
|
2204
|
+
}()
|
|
1763
2205
|
/**
|
|
1764
2206
|
* Appliquer le thème
|
|
1765
2207
|
*/
|
|
2208
|
+
)
|
|
1766
2209
|
}, {
|
|
1767
2210
|
key: "applyTheme",
|
|
1768
2211
|
value: function applyTheme(theme) {
|
|
@@ -1784,9 +2227,124 @@
|
|
|
1784
2227
|
}
|
|
1785
2228
|
}
|
|
1786
2229
|
|
|
2230
|
+
/**
|
|
2231
|
+
* Vérifier le statut des connexions
|
|
2232
|
+
*/
|
|
2233
|
+
}, {
|
|
2234
|
+
key: "checkConnections",
|
|
2235
|
+
value: (function () {
|
|
2236
|
+
var _checkConnections = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
|
|
2237
|
+
var status, testResponse, debugData, _t13;
|
|
2238
|
+
return _regenerator().w(function (_context19) {
|
|
2239
|
+
while (1) switch (_context19.p = _context19.n) {
|
|
2240
|
+
case 0:
|
|
2241
|
+
status = {
|
|
2242
|
+
api: false,
|
|
2243
|
+
websocket: false,
|
|
2244
|
+
ready: false
|
|
2245
|
+
}; // Vérifier l'API en utilisant l'endpoint debug
|
|
2246
|
+
_context19.p = 1;
|
|
2247
|
+
_context19.n = 2;
|
|
2248
|
+
return fetch(this.config.apiUrl + '/debug', {
|
|
2249
|
+
method: 'GET',
|
|
2250
|
+
timeout: 3000
|
|
2251
|
+
});
|
|
2252
|
+
case 2:
|
|
2253
|
+
testResponse = _context19.v;
|
|
2254
|
+
if (!testResponse.ok) {
|
|
2255
|
+
_context19.n = 4;
|
|
2256
|
+
break;
|
|
2257
|
+
}
|
|
2258
|
+
_context19.n = 3;
|
|
2259
|
+
return testResponse.json();
|
|
2260
|
+
case 3:
|
|
2261
|
+
debugData = _context19.v;
|
|
2262
|
+
status.api = debugData.status === 'operational';
|
|
2263
|
+
console.log('🔍 API Status:', debugData.status);
|
|
2264
|
+
_context19.n = 5;
|
|
2265
|
+
break;
|
|
2266
|
+
case 4:
|
|
2267
|
+
status.api = false;
|
|
2268
|
+
case 5:
|
|
2269
|
+
_context19.n = 7;
|
|
2270
|
+
break;
|
|
2271
|
+
case 6:
|
|
2272
|
+
_context19.p = 6;
|
|
2273
|
+
_t13 = _context19.v;
|
|
2274
|
+
console.log('🔍 Test API échoué:', _t13.message);
|
|
2275
|
+
status.api = false;
|
|
2276
|
+
case 7:
|
|
2277
|
+
// Vérifier le WebSocket
|
|
2278
|
+
status.websocket = this.socket && this.socket.connected;
|
|
2279
|
+
|
|
2280
|
+
// Connexions prêtes si API est accessible
|
|
2281
|
+
status.ready = status.api;
|
|
2282
|
+
return _context19.a(2, status);
|
|
2283
|
+
}
|
|
2284
|
+
}, _callee18, this, [[1, 6]]);
|
|
2285
|
+
}));
|
|
2286
|
+
function checkConnections() {
|
|
2287
|
+
return _checkConnections.apply(this, arguments);
|
|
2288
|
+
}
|
|
2289
|
+
return checkConnections;
|
|
2290
|
+
}()
|
|
2291
|
+
/**
|
|
2292
|
+
* Attendre que les connexions soient prêtes
|
|
2293
|
+
*/
|
|
2294
|
+
)
|
|
2295
|
+
}, {
|
|
2296
|
+
key: "waitForConnections",
|
|
2297
|
+
value: (function () {
|
|
2298
|
+
var _waitForConnections = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19() {
|
|
2299
|
+
var timeout,
|
|
2300
|
+
startTime,
|
|
2301
|
+
status,
|
|
2302
|
+
_args20 = arguments;
|
|
2303
|
+
return _regenerator().w(function (_context20) {
|
|
2304
|
+
while (1) switch (_context20.n) {
|
|
2305
|
+
case 0:
|
|
2306
|
+
timeout = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : 5000;
|
|
2307
|
+
startTime = Date.now();
|
|
2308
|
+
case 1:
|
|
2309
|
+
if (!(Date.now() - startTime < timeout)) {
|
|
2310
|
+
_context20.n = 5;
|
|
2311
|
+
break;
|
|
2312
|
+
}
|
|
2313
|
+
_context20.n = 2;
|
|
2314
|
+
return this.checkConnections();
|
|
2315
|
+
case 2:
|
|
2316
|
+
status = _context20.v;
|
|
2317
|
+
if (!status.ready) {
|
|
2318
|
+
_context20.n = 3;
|
|
2319
|
+
break;
|
|
2320
|
+
}
|
|
2321
|
+
console.log('✅ Connexions prêtes');
|
|
2322
|
+
return _context20.a(2, status);
|
|
2323
|
+
case 3:
|
|
2324
|
+
console.log('⏳ Attente connexions...', status);
|
|
2325
|
+
_context20.n = 4;
|
|
2326
|
+
return new Promise(function (resolve) {
|
|
2327
|
+
return setTimeout(resolve, 1000);
|
|
2328
|
+
});
|
|
2329
|
+
case 4:
|
|
2330
|
+
_context20.n = 1;
|
|
2331
|
+
break;
|
|
2332
|
+
case 5:
|
|
2333
|
+
throw new Error('Timeout connexions - Impossible de générer le QR code');
|
|
2334
|
+
case 6:
|
|
2335
|
+
return _context20.a(2);
|
|
2336
|
+
}
|
|
2337
|
+
}, _callee19, this);
|
|
2338
|
+
}));
|
|
2339
|
+
function waitForConnections() {
|
|
2340
|
+
return _waitForConnections.apply(this, arguments);
|
|
2341
|
+
}
|
|
2342
|
+
return waitForConnections;
|
|
2343
|
+
}()
|
|
1787
2344
|
/**
|
|
1788
2345
|
* Obtenir l'URL du QR code généré
|
|
1789
2346
|
*/
|
|
2347
|
+
)
|
|
1790
2348
|
}, {
|
|
1791
2349
|
key: "getQRCode",
|
|
1792
2350
|
value: function getQRCode() {
|
|
@@ -1805,9 +2363,7 @@
|
|
|
1805
2363
|
}, {
|
|
1806
2364
|
key: "destroy",
|
|
1807
2365
|
value: function destroy() {
|
|
1808
|
-
|
|
1809
|
-
clearInterval(this.refreshTimer);
|
|
1810
|
-
}
|
|
2366
|
+
this.stopAutoRefresh();
|
|
1811
2367
|
|
|
1812
2368
|
// Fermer la connexion WebSocket
|
|
1813
2369
|
if (this.socket) {
|
|
@@ -1820,6 +2376,19 @@
|
|
|
1820
2376
|
console.log('SunuID SDK détruit');
|
|
1821
2377
|
}
|
|
1822
2378
|
|
|
2379
|
+
/**
|
|
2380
|
+
* Arrêter le rafraîchissement automatique
|
|
2381
|
+
*/
|
|
2382
|
+
}, {
|
|
2383
|
+
key: "stopAutoRefresh",
|
|
2384
|
+
value: function stopAutoRefresh() {
|
|
2385
|
+
if (this.refreshTimer) {
|
|
2386
|
+
clearInterval(this.refreshTimer);
|
|
2387
|
+
this.refreshTimer = null;
|
|
2388
|
+
console.log('🔄 Timer de rafraîchissement arrêté');
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
|
|
1823
2392
|
/**
|
|
1824
2393
|
* Obtenir les logs de sécurité
|
|
1825
2394
|
*/
|