wirejs-deploy-amplify-basic 0.0.109-realtime → 0.0.111-realtime

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.
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.41",
6
- "wirejs-resources": "^0.1.77-realtime"
6
+ "wirejs-resources": "^0.1.79-realtime"
7
7
  }
8
8
  }
@@ -53,7 +53,7 @@ async function callApi(INTERNAL_API_URL, method, ...args) {
53
53
  throw new Error(error);
54
54
  }
55
55
  const value = body[0].data;
56
- if (typeof value === 'object' && value.__wjstype === 'realtime') {
56
+ if (typeof value === 'object' && value?.__wjstype === 'realtime') {
57
57
  return {
58
58
  subscribe(subscriber) {
59
59
  rt.subscribe(value.url, value.channel, value.token, value.authHost, subscriber);
@@ -78,8 +78,9 @@ export function subscribe(url, channel, token, authHost, subscriber) {
78
78
  }
79
79
  };
80
80
  const notifyClosed = () => {
81
- const subscriptionIds = Array.from(channelSubs.keys())
82
- .filter(id => id.startsWith(`${url}#`));
81
+ const subscriptionIds = Array.from(channelSubs.entries())
82
+ .filter(([urlChannel, _subId]) => urlChannel.startsWith(`${url}#`))
83
+ .map(([_urlChannel, subId]) => subId);
83
84
  for (const subscriptionId of subscriptionIds) {
84
85
  subscriptionState.set(subscriptionId, 'closed');
85
86
  const subs = subscribers.get(subscriptionId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.109-realtime",
3
+ "version": "0.0.111-realtime",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "recursive-copy": "^2.0.14",
42
42
  "rimraf": "^6.0.1",
43
43
  "wirejs-dom": "^1.0.41",
44
- "wirejs-resources": "^0.1.77-realtime"
44
+ "wirejs-resources": "^0.1.79-realtime"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@aws-amplify/backend": "^1.14.0",