@knowlearning/agents 0.6.4 → 0.7.2

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.
@@ -9,20 +9,15 @@ function login() {
9
9
  }
10
10
 
11
11
  function logout() {
12
- localStorage.removeItem('token')
12
+ // TODO: hit logout url to refresh cookie
13
13
  window.location.reload()
14
14
  }
15
15
 
16
16
  async function getToken() {
17
+ // Browser tokens are 1 time use
17
18
  const token = localStorage.getItem('token')
18
- if (token) return token
19
- else {
20
- const randArr = new Uint32Array(16)
21
- crypto.getRandomValues(randArr)
22
- const anonymousCredential = [...randArr].map(x => x.toString(16).padStart(2, '0')).join('')
23
- localStorage.setItem('token', anonymousCredential)
24
- return anonymousCredential
25
- }
19
+ localStorage.removeItem('token')
20
+ return token
26
21
  }
27
22
 
28
23
  export {
package/browser.js CHANGED
@@ -1,4 +1,3 @@
1
- // TODO: export browser, node, deno, and generic agents
2
1
  export { default as GenericAgent } from './agents/generic.js'
3
2
  export { default as browserAgent } from './agents/browser/initialize.js'
4
3
  export { default as vuePersistentStore } from './persistence/vuex.js'
package/node.js CHANGED
@@ -1,3 +1,2 @@
1
- // TODO: export browser, node, deno, and generic agents
2
1
  export { default as NodeAgent } from '../agents/node.js'
3
2
  export { default as GenericAgent } from '../agents/generic.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.6.4",
3
+ "version": "0.7.2",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",