@jskit-ai/realtime 0.2.4 → 0.2.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/realtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test --test-concurrency=1"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"socket.io-client": "^4.8.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@jskit-ai/kernel": "0.2.
|
|
24
|
+
"@jskit-ai/kernel": "0.2.3",
|
|
25
25
|
"vue": "^3.5.13"
|
|
26
26
|
},
|
|
27
27
|
"description": "Thin, generic realtime runtime wrappers for socket.io server and client.",
|
|
@@ -53,11 +53,6 @@ function roomForScope(scope = {}) {
|
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// Every room roomForScope() names has one of these prefixes.
|
|
57
|
-
function isScopeRoom(room) {
|
|
58
|
-
return /^(?:user|workspace):/u.test(String(room));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
56
|
// Packages that know which scopes an actor belongs to (for example workspace
|
|
62
57
|
// memberships) contribute them here; realtime only turns scopes into rooms.
|
|
63
58
|
function createAudienceContributors() {
|
|
@@ -74,9 +69,10 @@ function createAudienceContributors() {
|
|
|
74
69
|
}
|
|
75
70
|
contributors.set(contributorId, resolveActorScopes);
|
|
76
71
|
},
|
|
77
|
-
// Whether revalidation could make a socket join this room
|
|
72
|
+
// Whether revalidation could make a socket join this room: every room
|
|
73
|
+
// roomForScope() names starts with user: or workspace:.
|
|
78
74
|
mayContribute(room) {
|
|
79
|
-
return contributors.size > 0 &&
|
|
75
|
+
return contributors.size > 0 && /^(?:user|workspace):/u.test(String(room));
|
|
80
76
|
},
|
|
81
77
|
async resolveActorRooms(actorId) {
|
|
82
78
|
const rooms = new Set();
|