@knowlearning/agents 0.3.15 → 0.3.16
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/agents/browser/root.js +1 -1
- package/agents/deno.js +1 -1
- package/agents/generic.js +1 -1
- package/agents/node.js +1 -1
- package/package.json +1 -1
package/agents/browser/root.js
CHANGED
|
@@ -14,7 +14,7 @@ export default () => {
|
|
|
14
14
|
const agent = GenericAgent({
|
|
15
15
|
host: isLocal() ? DEVELOPMENT_HOST : REMOTE_HOST,
|
|
16
16
|
protocol: protocol === 'https:' ? 'wss' : 'ws',
|
|
17
|
-
token: new Promise(r => onAuth(({ getIdToken: g }) => r(g()))),
|
|
17
|
+
token: () => new Promise(r => onAuth(({ getIdToken: g }) => r(g()))),
|
|
18
18
|
WebSocket,
|
|
19
19
|
uuid,
|
|
20
20
|
fetch,
|
package/agents/deno.js
CHANGED
|
@@ -6,7 +6,7 @@ const SERVICE_ACCOUNT_TOKEN = Deno.env.get("SERVICE_ACCOUNT_TOKEN")
|
|
|
6
6
|
|
|
7
7
|
export default () => new Agent({
|
|
8
8
|
host: SERVE_HOST,
|
|
9
|
-
token: Deno.readTextFile(SERVICE_ACCOUNT_TOKEN),
|
|
9
|
+
token: () => Deno.readTextFile(SERVICE_ACCOUNT_TOKEN),
|
|
10
10
|
WebSocket,
|
|
11
11
|
uuid: () => crypto.randomUUID(),
|
|
12
12
|
fetch,
|
package/agents/generic.js
CHANGED
|
@@ -84,7 +84,7 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
|
|
|
84
84
|
ws.onopen = async () => {
|
|
85
85
|
log('AUTHORIZING NEWLY OPENED WS FOR SESSION:', session)
|
|
86
86
|
failedConnections = 0
|
|
87
|
-
ws.send(JSON.stringify({ token: await token, session }))
|
|
87
|
+
ws.send(JSON.stringify({ token: await token(), session }))
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
ws.onmessage = async ({ data }) => {
|
package/agents/node.js
CHANGED
|
@@ -9,7 +9,7 @@ const { SERVE_HOST, SERVICE_ACCOUNT_TOKEN } = process.env
|
|
|
9
9
|
|
|
10
10
|
export default () => new Agent({
|
|
11
11
|
host: SERVE_HOST,
|
|
12
|
-
token: fs.promises.readFile(SERVICE_ACCOUNT_TOKEN).then(f => f.toString()),
|
|
12
|
+
token: () => fs.promises.readFile(SERVICE_ACCOUNT_TOKEN).then(f => f.toString()),
|
|
13
13
|
WebSocket,
|
|
14
14
|
uuid,
|
|
15
15
|
fetch,
|