@live-change/dao 0.9.137 → 0.9.139

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/index.js CHANGED
@@ -86,8 +86,13 @@ import Path from "./lib/Path.js"
86
86
  rd.Path = Path
87
87
  export { Path }
88
88
 
89
- import { sourceSymbol } from "./lib/ReactiveConnection.js"
89
+ import { sourceSymbol, originalCredentialsSymbol } from "./lib/ReactiveConnection.js"
90
90
  rd.sourceSymbol = sourceSymbol
91
- export { sourceSymbol }
91
+ rd.originalCredentialsSymbol = originalCredentialsSymbol
92
+ export { sourceSymbol, originalCredentialsSymbol }
93
+
94
+ import DummyConnection from "./lib/DummyConnection.js"
95
+ rd.DummyConnection = DummyConnection
96
+ export { DummyConnection }
92
97
 
93
98
  export default rd
@@ -0,0 +1,37 @@
1
+ import WebSocket from 'universal-websocket-client'
2
+ import { ReactiveConnection } from '@live-change/dao'
3
+ import Debug from 'debug'
4
+ const debug = Debug('reactive-dao-ws')
5
+
6
+ class WebSocketConnection extends ReactiveConnection {
7
+ constructor(credentials, url, settings) {
8
+ super(credentials, settings)
9
+ this.url = url
10
+ this.initialize()
11
+ }
12
+
13
+ initialize() {
14
+ debug("TRYING CONNECT BUT OFFLINE DUMMY")
15
+ }
16
+
17
+ send(message) {
18
+ const data = JSON.stringify(message)
19
+ debug("OUTGOING MESSAGE", data, "IGNORED")
20
+ }
21
+
22
+ reconnect() {
23
+ debug("reconnect", this.url, "IGNORED")
24
+ }
25
+
26
+ dispose() {
27
+ debug("close", this.url, "IGNORED")
28
+
29
+ }
30
+
31
+ closeConnection() {
32
+ debug("closeConnection", this.url, "IGNORED")
33
+ }
34
+
35
+ }
36
+
37
+ export default WebSocketConnection
@@ -6,6 +6,7 @@ import * as utils from './utils.js'
6
6
  let lastUid = 0
7
7
 
8
8
  export const sourceSymbol = Symbol("source")
9
+ export const originalCredentialsSymbol = Symbol("originalCredentials")
9
10
 
10
11
  class Observation {
11
12
  constructor(connection, what, pushed) {
@@ -381,8 +382,11 @@ class Connection extends EventEmitter {
381
382
  if(this.settings.logLevel > 0) debug("connected")
382
383
  this.connected = true
383
384
  if(!this.settings.fastAuth) {
385
+ console.log("SENDING CREDENTIALS", this.credentials)
386
+ console.log("ORIGINAL CREDENTIALS", this.credentials[originalCredentialsSymbol])
384
387
  this.send({
385
- ...this.credentials
388
+ ...this.credentials[originalCredentialsSymbol],
389
+ ...this.credentials,
386
390
  })
387
391
  }
388
392
  /// REFRESH OBSERVABLES!
package/package.json CHANGED
@@ -35,6 +35,6 @@
35
35
  "scripts": {
36
36
  "test": "NODE_ENV=test tape tests/*"
37
37
  },
38
- "version": "0.9.137",
39
- "gitHead": "762fcddea43fa160b99ee72eb29219a5e0048498"
38
+ "version": "0.9.139",
39
+ "gitHead": "9202c36abc25e3baf5fe39806d89c3fab203f428"
40
40
  }