@digipair/skill-client-websocket 0.49.1 → 0.49.2

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 +12 -12
  2. package/index.esm.js +17 -17
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -4961,28 +4961,28 @@ let ClientWebSocketService = class ClientWebSocketService {
4961
4961
  signal: (_context_protected = context.protected) == null ? void 0 : _context_protected.signal
4962
4962
  });
4963
4963
  // Event onopen: Connexion réussie
4964
- this.ws.onopen = async ()=>{
4964
+ this.ws.on('open', async ()=>{
4965
4965
  this.retryCount = 0; // Réinitialise le compteur de tentatives après une connexion réussie
4966
4966
  await engine.executePinsList(open, _extends({}, context));
4967
- };
4967
+ });
4968
4968
  // Event onmessage: Réception d'un message
4969
- this.ws.onmessage = (notification)=>{
4970
- engine.executePinsList(message, _extends({}, context, {
4971
- message: JSON.parse(notification.data)
4969
+ this.ws.on('message', async (notification)=>{
4970
+ await engine.executePinsList(message, _extends({}, context, {
4971
+ message: JSON.parse(notification)
4972
4972
  }));
4973
- };
4973
+ });
4974
4974
  // Event onclose: Déconnexion
4975
- this.ws.onclose = async ()=>{
4975
+ this.ws.on('close', async ()=>{
4976
4976
  await engine.executePinsList(close, _extends({}, context));
4977
4977
  this.reconnectWebSocket(params, _pinsSettingsList, context);
4978
- };
4978
+ });
4979
4979
  // Event onerror: Erreur
4980
- this.ws.onerror = (err)=>{
4981
- this.ws.close(); // Ferme la connexion en cas d'erreur
4982
- engine.executePinsList(error, _extends({}, context, {
4980
+ this.ws.on('error', async (err)=>{
4981
+ await engine.executePinsList(error, _extends({}, context, {
4983
4982
  error: err
4984
4983
  }));
4985
- };
4984
+ this.ws.close(); // Ferme la connexion en cas d'erreur
4985
+ });
4986
4986
  return this.ws;
4987
4987
  }
4988
4988
  reconnectWebSocket(params, _pinsSettingsList, context) {
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 tokens = tokens1, nextMatch = nextMatch1, i = i1, {
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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23976
23976
  }
23977
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23977
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-client-websocket",
3
- "version": "0.49.1",
3
+ "version": "0.49.2",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"