@digipair/skill-client-sse 0.119.5 → 0.119.7

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/index.cjs.js CHANGED
@@ -8,7 +8,7 @@ const fetchEventSource = typeof window === 'undefined' ? nodeFetchEventSource.fe
8
8
  let ClientSSEService = class ClientSSEService {
9
9
  async connect(params, _pinsSettingsList, context) {
10
10
  const { url = '', event = 'message', message = [], open = [], close = [], error = [], options = {} } = params;
11
- await fetchEventSource(url, {
11
+ return await fetchEventSource(url, {
12
12
  signal: context.protected?.signal,
13
13
  method: 'POST',
14
14
  headers: {
@@ -18,9 +18,15 @@ let ClientSSEService = class ClientSSEService {
18
18
  if (notification.event !== event) {
19
19
  return;
20
20
  }
21
+ let data = '';
22
+ try {
23
+ data = JSON.parse(notification.data);
24
+ } catch {
25
+ data = notification.data;
26
+ }
21
27
  engine.executePinsList(message, {
22
28
  ...context,
23
- message: JSON.parse(notification.data)
29
+ message: data
24
30
  }, `${context.__PATH__}.message`);
25
31
  },
26
32
  onopen: async ()=>{
package/dist/index.esm.js CHANGED
@@ -22840,14 +22840,14 @@ function indent(str, spaces) {
22840
22840
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
22841
22841
  // match is required
22842
22842
  if (!match) {
22843
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
22843
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
22844
22844
  v: nextMatch1
22845
22845
  };
22846
22846
  }
22847
22847
  var token = match.token, offset = match.offset;
22848
22848
  i1 += offset;
22849
22849
  if (token === ' ') {
22850
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
22850
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
22851
22851
  }
22852
22852
  tokens1 = _to_consumable_array$4(tokens1).concat([
22853
22853
  token
@@ -22866,7 +22866,7 @@ function indent(str, spaces) {
22866
22866
  if (contextKeys.some(function(el) {
22867
22867
  return el.startsWith(name);
22868
22868
  })) {
22869
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
22869
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
22870
22870
  }
22871
22871
  if (dateTimeIdentifiers.some(function(el) {
22872
22872
  return el === name;
@@ -22885,9 +22885,9 @@ function indent(str, spaces) {
22885
22885
  if (dateTimeIdentifiers.some(function(el) {
22886
22886
  return el.startsWith(name);
22887
22887
  })) {
22888
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
22888
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
22889
22889
  }
22890
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
22890
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
22891
22891
  v: nextMatch1
22892
22892
  };
22893
22893
  };
@@ -45096,7 +45096,7 @@ const fetchEventSource = typeof window === 'undefined' ? fetchEventSource$2 : fe
45096
45096
  let ClientSSEService = class ClientSSEService {
45097
45097
  async connect(params, _pinsSettingsList, context) {
45098
45098
  const { url = '', event = 'message', message = [], open = [], close = [], error = [], options = {} } = params;
45099
- await fetchEventSource(url, {
45099
+ return await fetchEventSource(url, {
45100
45100
  signal: context.protected?.signal,
45101
45101
  method: 'POST',
45102
45102
  headers: {
@@ -45106,9 +45106,15 @@ let ClientSSEService = class ClientSSEService {
45106
45106
  if (notification.event !== event) {
45107
45107
  return;
45108
45108
  }
45109
+ let data = '';
45110
+ try {
45111
+ data = JSON.parse(notification.data);
45112
+ } catch {
45113
+ data = notification.data;
45114
+ }
45109
45115
  executePinsList(message, {
45110
45116
  ...context,
45111
- message: JSON.parse(notification.data)
45117
+ message: data
45112
45118
  }, `${context.__PATH__}.message`);
45113
45119
  },
45114
45120
  onopen: async ()=>{
@@ -1 +1 @@
1
- {"version":3,"file":"skill-client-sse.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-client-sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AAiDjE,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBAChB,CAAC"}
1
+ {"version":3,"file":"skill-client-sse.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-client-sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AAwDjE,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-client-sse",
3
- "version": "0.119.5",
3
+ "version": "0.119.7",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",