@knowlearning/agents 0.9.94 → 0.9.95
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
CHANGED
package/agents/generic/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const POSTGRES_QUERY_TYPE = 'application/json;type=postgres-query'
|
|
|
13
13
|
const TAG_TYPE = 'application/json;type=tag'
|
|
14
14
|
const DOMAIN_CLAIM_TYPE = 'application/json;type=domain-claim'
|
|
15
15
|
|
|
16
|
-
export default function Agent({ Connection, token, uuid, fetch, applyPatch, login, logout, reboot, handleDomainMessage }) {
|
|
16
|
+
export default function Agent({ Connection, domain, token, uuid, fetch, applyPatch, login, logout, reboot, handleDomainMessage }) {
|
|
17
17
|
const states = {}
|
|
18
18
|
const watchers = {}
|
|
19
19
|
const keyToSubscriptionId = {}
|
|
@@ -29,7 +29,7 @@ export default function Agent({ Connection, token, uuid, fetch, applyPatch, logi
|
|
|
29
29
|
reconnect,
|
|
30
30
|
synced,
|
|
31
31
|
environment
|
|
32
|
-
] = messageQueue({ token, Connection, watchers, states, applyPatch, log, login, interact, reboot, trigger, handleDomainMessage })
|
|
32
|
+
] = messageQueue({ token, domain, Connection, watchers, states, applyPatch, log, login, interact, reboot, trigger, handleDomainMessage })
|
|
33
33
|
|
|
34
34
|
// initialize session
|
|
35
35
|
environment()
|
|
@@ -15,7 +15,7 @@ function sanitizeJSONPatchPathSegment(s) {
|
|
|
15
15
|
else return s
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export default function messageQueue({ token, Connection, watchers, states, applyPatch, log, login, reboot, handleDomainMessage, trigger }) {
|
|
18
|
+
export default function messageQueue({ token, domain, Connection, watchers, states, applyPatch, log, login, reboot, handleDomainMessage, trigger }) {
|
|
19
19
|
let connection
|
|
20
20
|
let user
|
|
21
21
|
let authed = false
|
|
@@ -179,7 +179,7 @@ export default function messageQueue({ token, Connection, watchers, states, appl
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
else {
|
|
182
|
-
const d = message.domain ===
|
|
182
|
+
const d = message.domain === domain ? '' : message.domain
|
|
183
183
|
const u = message.user === user ? '' : message.user
|
|
184
184
|
const s = message.scope
|
|
185
185
|
const qualifiedScope = isUUID(s) ? s : `${d}/${u}/${s}`
|