@jskit-ai/realtime 0.1.8 → 0.1.10
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.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
packageVersion: 1,
|
|
3
3
|
packageId: "@jskit-ai/realtime",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.10",
|
|
5
5
|
description: "Thin, generic realtime runtime wrappers for socket.io server and client.",
|
|
6
6
|
options: {
|
|
7
7
|
"realtime-redis-url": {
|
|
@@ -93,7 +93,7 @@ export default Object.freeze({
|
|
|
93
93
|
mutations: {
|
|
94
94
|
dependencies: {
|
|
95
95
|
runtime: {
|
|
96
|
-
"@jskit-ai/kernel": "0.1.
|
|
96
|
+
"@jskit-ai/kernel": "0.1.10",
|
|
97
97
|
"@socket.io/redis-adapter": "^8.3.0",
|
|
98
98
|
"redis": "^5.8.2",
|
|
99
99
|
"socket.io": "^4.8.3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/realtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"./client": "./src/client/RealtimeClientProvider.js",
|
|
13
13
|
"./client/RealtimeClientProvider": "./src/client/RealtimeClientProvider.js",
|
|
14
14
|
"./client/listeners": "./src/client/listeners.js",
|
|
15
|
-
"./client/composables
|
|
15
|
+
"./client/composables/useRealtimeEvent": "./src/client/composables/useRealtimeEvent.js",
|
|
16
16
|
"./client/runtime": "./src/client/runtime.js",
|
|
17
17
|
"./client/tokens": "./src/client/tokens.js"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@socket.io/redis-adapter": "^8.3.0",
|
|
21
|
-
"@jskit-ai/kernel": "0.1.
|
|
21
|
+
"@jskit-ai/kernel": "0.1.10",
|
|
22
22
|
"redis": "^5.8.2",
|
|
23
23
|
"socket.io": "^4.8.3",
|
|
24
24
|
"socket.io-client": "^4.8.3"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSocketIoClient, disconnectSocketIoClient } from "./runtime.js";
|
|
2
2
|
import { normalizeObject, normalizeText } from "@jskit-ai/kernel/shared/support/normalize";
|
|
3
|
+
import { createProviderLogger as createSharedProviderLogger } from "@jskit-ai/kernel/shared/support/providerLogger";
|
|
3
4
|
import {
|
|
4
5
|
CLIENT_MODULE_ENV_TOKEN,
|
|
5
6
|
CLIENT_MODULE_VUE_APP_TOKEN
|
|
@@ -20,42 +21,6 @@ const REALTIME_RUNTIME_CLIENT_API = Object.freeze({
|
|
|
20
21
|
disconnectSocketIoClient
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
function createProviderLogger(app, { debugEnabled = false } = {}) {
|
|
24
|
-
return Object.freeze({
|
|
25
|
-
debug: (...args) => {
|
|
26
|
-
if (debugEnabled !== true) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (app && typeof app.info === "function") {
|
|
30
|
-
app.info(...args);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
console.info(...args);
|
|
34
|
-
},
|
|
35
|
-
info: (...args) => {
|
|
36
|
-
if (app && typeof app.info === "function") {
|
|
37
|
-
app.info(...args);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
console.info(...args);
|
|
41
|
-
},
|
|
42
|
-
warn: (...args) => {
|
|
43
|
-
if (app && typeof app.warn === "function") {
|
|
44
|
-
app.warn(...args);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
console.warn(...args);
|
|
48
|
-
},
|
|
49
|
-
error: (...args) => {
|
|
50
|
-
if (app && typeof app.error === "function") {
|
|
51
|
-
app.error(...args);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
console.error(...args);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
24
|
function resolveRealtimeClientConfig(app) {
|
|
60
25
|
const appConfig = app && typeof app.has === "function" && app.has("appConfig") ? normalizeObject(app.make("appConfig")) : {};
|
|
61
26
|
const env = app && typeof app.has === "function" && app.has(CLIENT_MODULE_ENV_TOKEN) ? normalizeObject(app.make(CLIENT_MODULE_ENV_TOKEN)) : {};
|
|
@@ -115,7 +80,7 @@ class RealtimeClientProvider {
|
|
|
115
80
|
}
|
|
116
81
|
|
|
117
82
|
const realtimeClientConfig = resolveRealtimeClientConfig(app);
|
|
118
|
-
const logger =
|
|
83
|
+
const logger = createSharedProviderLogger(app, {
|
|
119
84
|
debugEnabled: realtimeClientConfig.debugEnabled
|
|
120
85
|
});
|
|
121
86
|
const socket = app.make(REALTIME_SOCKET_CLIENT_TOKEN);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KERNEL_TOKENS } from "@jskit-ai/kernel/shared/support/tokens";
|
|
2
2
|
import { normalizePositiveInteger, normalizeText } from "@jskit-ai/kernel/shared/support/normalize";
|
|
3
|
+
import { createProviderLogger as createSharedProviderLogger } from "@jskit-ai/kernel/shared/support/providerLogger";
|
|
3
4
|
import {
|
|
4
5
|
registerDomainEventListener,
|
|
5
6
|
resolveServiceRegistrations
|
|
@@ -85,40 +86,7 @@ function parseCookieHeader(value = "") {
|
|
|
85
86
|
function createProviderLogger(scope, { debugEnabled = false } = {}) {
|
|
86
87
|
const logger =
|
|
87
88
|
scope && typeof scope.has === "function" && scope.has(KERNEL_TOKENS.Logger) ? scope.make(KERNEL_TOKENS.Logger) : null;
|
|
88
|
-
|
|
89
|
-
return Object.freeze({
|
|
90
|
-
debug: (...args) => {
|
|
91
|
-
if (debugEnabled !== true) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (logger && typeof logger.info === "function") {
|
|
95
|
-
logger.info(...args);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
console.info(...args);
|
|
99
|
-
},
|
|
100
|
-
info: (...args) => {
|
|
101
|
-
if (logger && typeof logger.info === "function") {
|
|
102
|
-
logger.info(...args);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
console.info(...args);
|
|
106
|
-
},
|
|
107
|
-
warn: (...args) => {
|
|
108
|
-
if (logger && typeof logger.warn === "function") {
|
|
109
|
-
logger.warn(...args);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
console.warn(...args);
|
|
113
|
-
},
|
|
114
|
-
error: (...args) => {
|
|
115
|
-
if (logger && typeof logger.error === "function") {
|
|
116
|
-
logger.error(...args);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
console.error(...args);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
89
|
+
return createSharedProviderLogger(logger, { debugEnabled });
|
|
122
90
|
}
|
|
123
91
|
|
|
124
92
|
function parseDebugFlag(value, fallback = null) {
|