@digipair/skill-client-websocket 0.49.1 → 0.49.3

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.
Files changed (3) hide show
  1. package/index.cjs.js +24 -4938
  2. package/index.esm.js +17 -17
  3. package/package.json +4 -2
package/index.esm.js CHANGED
@@ -23927,14 +23927,14 @@ function indent(str, spaces) {
23927
23927
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23928
23928
  // match is required
23929
23929
  if (!match) {
23930
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23930
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23931
23931
  v: nextMatch1
23932
23932
  };
23933
23933
  }
23934
23934
  var token = match.token, offset = match.offset;
23935
23935
  i1 += offset;
23936
23936
  if (token === " ") {
23937
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23937
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23938
23938
  }
23939
23939
  tokens1 = _to_consumable_array$1(tokens1).concat([
23940
23940
  token
@@ -23953,7 +23953,7 @@ function indent(str, spaces) {
23953
23953
  if (contextKeys.some(function(el) {
23954
23954
  return el.startsWith(name);
23955
23955
  })) {
23956
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23956
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23957
23957
  }
23958
23958
  if (dateTimeIdentifiers.some(function(el) {
23959
23959
  return el === name;
@@ -23972,9 +23972,9 @@ function indent(str, spaces) {
23972
23972
  if (dateTimeIdentifiers.some(function(el) {
23973
23973
  return el.startsWith(name);
23974
23974
  })) {
23975
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23975
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23976
23976
  }
23977
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23977
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23978
23978
  v: nextMatch1
23979
23979
  };
23980
23980
  };
@@ -32885,28 +32885,28 @@ let ClientWebSocketService = class ClientWebSocketService {
32885
32885
  signal: (_context_protected = context.protected) == null ? void 0 : _context_protected.signal
32886
32886
  });
32887
32887
  // Event onopen: Connexion réussie
32888
- this.ws.onopen = async ()=>{
32888
+ this.ws.on('open', async ()=>{
32889
32889
  this.retryCount = 0; // Réinitialise le compteur de tentatives après une connexion réussie
32890
32890
  await executePinsList(open, _extends({}, context));
32891
- };
32891
+ });
32892
32892
  // Event onmessage: Réception d'un message
32893
- this.ws.onmessage = (notification)=>{
32894
- executePinsList(message, _extends({}, context, {
32895
- message: JSON.parse(notification.data)
32893
+ this.ws.on('message', async (notification)=>{
32894
+ await executePinsList(message, _extends({}, context, {
32895
+ message: JSON.parse(notification)
32896
32896
  }));
32897
- };
32897
+ });
32898
32898
  // Event onclose: Déconnexion
32899
- this.ws.onclose = async ()=>{
32899
+ this.ws.on('close', async ()=>{
32900
32900
  await executePinsList(close, _extends({}, context));
32901
32901
  this.reconnectWebSocket(params, _pinsSettingsList, context);
32902
- };
32902
+ });
32903
32903
  // Event onerror: Erreur
32904
- this.ws.onerror = (err)=>{
32905
- this.ws.close(); // Ferme la connexion en cas d'erreur
32906
- executePinsList(error, _extends({}, context, {
32904
+ this.ws.on('error', async (err)=>{
32905
+ await executePinsList(error, _extends({}, context, {
32907
32906
  error: err
32908
32907
  }));
32909
- };
32908
+ this.ws.close(); // Ferme la connexion en cas d'erreur
32909
+ });
32910
32910
  return this.ws;
32911
32911
  }
32912
32912
  reconnectWebSocket(params, _pinsSettingsList, context) {
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@digipair/skill-client-websocket",
3
- "version": "0.49.1",
4
- "dependencies": {},
3
+ "version": "0.49.3",
4
+ "dependencies": {
5
+ "isomorphic-ws": "^5.0.0"
6
+ },
5
7
  "main": "./index.cjs.js",
6
8
  "module": "./index.esm.js"
7
9
  }