@knowlearning/agents 0.9.164 → 0.9.165
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.
|
@@ -221,7 +221,7 @@ export default function EmbeddedAgent() {
|
|
|
221
221
|
return send({ type: 'login', provider, username, password })
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
function query(query, params, domain) { return send({ type: 'query', query, params, domain }) }
|
|
224
|
+
function query(query, params, domain, context=[]) { return send({ type: 'query', query, params, domain, context }) }
|
|
225
225
|
function logout() { return send({ type: 'logout' }) }
|
|
226
226
|
function disconnect() { return send({ type: 'disconnect' }) }
|
|
227
227
|
function reconnect() { return send({ type: 'reconnect' }) }
|
|
@@ -135,9 +135,9 @@ function embed(environment, iframe) {
|
|
|
135
135
|
sendDown(await Agent.patch(root, scopes))
|
|
136
136
|
}
|
|
137
137
|
else if (type === 'query') {
|
|
138
|
-
const { query, params, domain } = message
|
|
138
|
+
const { query, params, domain, context=[] } = message
|
|
139
139
|
Agent
|
|
140
|
-
.query(query, params, domain)
|
|
140
|
+
.query(query, params, domain, [environment.id, ...context])
|
|
141
141
|
.then(sendDown)
|
|
142
142
|
.catch(error => sendDown(null, error.error))
|
|
143
143
|
}
|
package/agents/browser/root.js
CHANGED
|
@@ -6,9 +6,9 @@ import GenericAgent from '../generic/index.js'
|
|
|
6
6
|
const TEST_DOMAIN = 'tests.knowlearning.systems'
|
|
7
7
|
const LANGUAGES = [...navigator.languages]
|
|
8
8
|
|
|
9
|
-
const API_HOST = localStorage.getItem('API_HOST') || 'api.knowlearning.systems'
|
|
9
|
+
//const API_HOST = localStorage.getItem('API_HOST') || 'api.knowlearning.systems'
|
|
10
10
|
// const API_HOST = 'api-test.knowlearning.systems'
|
|
11
|
-
|
|
11
|
+
const API_HOST = 'localhost:8765'
|
|
12
12
|
|
|
13
13
|
// TODO: remove this hack when we can set partitioned sid cookie through websocket handshake
|
|
14
14
|
// deno is partly in the way on teh set side, and browser support is in the way for
|
package/agents/generic/index.js
CHANGED
|
@@ -163,7 +163,7 @@ export default function Agent({ Connection, domain, token, sid, uuid, fetch, app
|
|
|
163
163
|
})
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
async function query(query, params, domain) {
|
|
166
|
+
async function query(query, params, domain, context=[]) {
|
|
167
167
|
const id = uuid()
|
|
168
168
|
const requested = Date.now()
|
|
169
169
|
const { session } = await environment()
|
|
@@ -172,7 +172,7 @@ export default function Agent({ Connection, domain, token, sid, uuid, fetch, app
|
|
|
172
172
|
{
|
|
173
173
|
op: 'add',
|
|
174
174
|
path: ['active', session, 'queries', id],
|
|
175
|
-
value: { query, params, domain }
|
|
175
|
+
value: { query, params, domain, context }
|
|
176
176
|
}
|
|
177
177
|
], false, false)
|
|
178
178
|
try {
|