sunuid-sdk 1.0.52 → 1.0.54

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 CHANGED
@@ -46,7 +46,7 @@ const secureConfig = {
46
46
 
47
47
  // Activer l'initialisation sécurisée
48
48
  secureInit: true,
49
- secureInitUrl: '/secure-init.php', // Votre endpoint sécurisé
49
+ secureInitUrl: '/secure-init.php', // Votre endpoint sécurisé (voir examples/secure-init.php)
50
50
 
51
51
  // Options de sécurité
52
52
  enableSecurityLogs: true,
@@ -145,7 +145,7 @@ if (sunuid.validateCallback(callbackData)) {
145
145
  Le SDK supporte l'initialisation sécurisée via un endpoint PHP qui génère des tokens temporaires :
146
146
 
147
147
  ```php
148
- // secure-init.php
148
+ // secure-init.php (fourni dans examples/secure-init.php)
149
149
  <?php
150
150
  $SUNUID_CONFIG = [
151
151
  'client_id' => $_ENV['SUNUID_CLIENT_ID'],
@@ -300,7 +300,7 @@ const prodConfig = {
300
300
  type: 2,
301
301
  partnerName: 'MonApp',
302
302
  secureInit: true,
303
- secureInitUrl: '/secure-init.php',
303
+ secureInitUrl: '/secure-init.php', // Voir examples/secure-init.php
304
304
  onSuccess: (data) => {
305
305
  console.log('🎉 Authentification réussie:', data);
306
306
  document.getElementById('qr-container').innerHTML =
@@ -455,7 +455,7 @@ npm run security-check
455
455
  const config = { clientId: '...', secretId: '...' };
456
456
 
457
457
  // Après (v2.0)
458
- const config = { secureInit: true, secureInitUrl: '/secure-init.php' };
458
+ const config = { secureInit: true, secureInitUrl: '/secure-init.php' }; // Voir examples/secure-init.php
459
459
  ```
460
460
 
461
461
  2. **Nouvelles Méthodes**
@@ -37,20 +37,20 @@ function _classCallCheck(a, n) {
37
37
  function _defineProperties(e, r) {
38
38
  for (var t = 0; t < r.length; t++) {
39
39
  var o = r[t];
40
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
40
+ o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
41
41
  }
42
42
  }
43
43
  function _createClass(e, r, t) {
44
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
45
- writable: !1
44
+ return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
45
+ writable: false
46
46
  }), e;
47
47
  }
48
48
  function _defineProperty(e, r, t) {
49
49
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
50
50
  value: t,
51
- enumerable: !0,
52
- configurable: !0,
53
- writable: !0
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true
54
54
  }) : e[r] = t, e;
55
55
  }
56
56
  function _iterableToArrayLimit(r, l) {
@@ -61,15 +61,12 @@ function _iterableToArrayLimit(r, l) {
61
61
  i,
62
62
  u,
63
63
  a = [],
64
- f = !0,
65
- o = !1;
64
+ f = true,
65
+ o = false;
66
66
  try {
67
- if (i = (t = t.call(r)).next, 0 === l) {
68
- if (Object(t) !== t) return;
69
- f = !1;
70
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
67
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
71
68
  } catch (r) {
72
- o = !0, n = r;
69
+ o = true, n = r;
73
70
  } finally {
74
71
  try {
75
72
  if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
@@ -96,7 +93,7 @@ function ownKeys(e, r) {
96
93
  function _objectSpread2(e) {
97
94
  for (var r = 1; r < arguments.length; r++) {
98
95
  var t = null != arguments[r] ? arguments[r] : {};
99
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
96
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
100
97
  _defineProperty(e, r, t[r]);
101
98
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
102
99
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
@@ -120,7 +117,7 @@ function _regenerator() {
120
117
  u,
121
118
  f = 0,
122
119
  p = o || [],
123
- y = !1,
120
+ y = false,
124
121
  G = {
125
122
  p: 0,
126
123
  n: 0,
@@ -140,7 +137,7 @@ function _regenerator() {
140
137
  r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
141
138
  }
142
139
  if (o || r > 1) return a;
143
- throw y = !0, n;
140
+ throw y = true, n;
144
141
  }
145
142
  return function (o, p, l) {
146
143
  if (f > 1) throw TypeError("Generator is already running");
@@ -166,7 +163,7 @@ function _regenerator() {
166
163
  done: y
167
164
  };
168
165
  };
169
- }(r, o, i), !0), u;
166
+ }(r, o, i), true), u;
170
167
  }
171
168
  var a = {};
172
169
  function Generator() {}
@@ -236,11 +233,11 @@ function _toPrimitive(t, r) {
236
233
  if ("object" != typeof t || !t) return t;
237
234
  var e = t[Symbol.toPrimitive];
238
235
  if (void 0 !== e) {
239
- var i = e.call(t, r || "default");
236
+ var i = e.call(t, r);
240
237
  if ("object" != typeof i) return i;
241
238
  throw new TypeError("@@toPrimitive must return a primitive value.");
242
239
  }
243
- return ("string" === r ? String : Number)(t);
240
+ return (String )(t);
244
241
  }
245
242
  function _toPropertyKey(t) {
246
243
  var i = _toPrimitive(t, "string");
@@ -304,9 +301,9 @@ function _unsupportedIterableToArray(r, a) {
304
301
  secureInit: false,
305
302
  secureInitUrl: function (_window$SunuIDConfig2, _window$SunuIDConfig3) {
306
303
  if ((_window$SunuIDConfig2 = window.SunuIDConfig) !== null && _window$SunuIDConfig2 !== void 0 && (_window$SunuIDConfig2 = _window$SunuIDConfig2.apiUrl) !== null && _window$SunuIDConfig2 !== void 0 && _window$SunuIDConfig2.includes('api.sunuid.fayma.sn')) {
307
- return 'https://api.sunuid.fayma.sn/secure-init.php';
304
+ return 'https://api.sunuid.fayma.sn/secure-init';
308
305
  }
309
- 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';
306
+ 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' || 'https://api.sunuid.fayma.sn/secure-init';
310
307
  }(),
311
308
  token: null,
312
309
  // Configuration pour forcer l'utilisation du serveur distant
@@ -474,7 +471,7 @@ function _unsupportedIterableToArray(r, a) {
474
471
  return _doInit;
475
472
  }()
476
473
  /**
477
- * Initialisation sécurisée via PHP
474
+ * Initialisation sécurisée via endpoint serveur
478
475
  */
479
476
  )
480
477
  }, {
@@ -1559,7 +1556,7 @@ function _unsupportedIterableToArray(r, a) {
1559
1556
  }
1560
1557
 
1561
1558
  /**
1562
- * Générer un QR code personnalisé avec PHP Endroid
1559
+ * Générer un QR code personnalisé avec bibliothèque locale
1563
1560
  */
1564
1561
  }, {
1565
1562
  key: "generateCustomQRCode",
@@ -1691,7 +1688,7 @@ function _unsupportedIterableToArray(r, a) {
1691
1688
  return generateQRClientSide;
1692
1689
  }()
1693
1690
  /**
1694
- * Générer un QR code via endpoint PHP (fallback)
1691
+ * Générer un QR code via endpoint serveur (fallback)
1695
1692
  */
1696
1693
  )
1697
1694
  }, {