statebus 6.2.3 → 6.2.5

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.
Files changed (98) hide show
  1. package/client.js +2 -2
  2. package/extras/tests.js +60 -0
  3. package/package.json +9 -2
  4. package/server.js +4 -4
  5. package/statebus.js +39 -7
  6. package/extras/#test_save_delay.js# +0 -11
  7. package/extras/abort-test.html +0 -10
  8. package/extras/abort-test.js +0 -17
  9. package/extras/backups/db.2021-11-13 +0 -12
  10. package/extras/backups/db.2021-11-14 +0 -12
  11. package/extras/backups/db.2021-11-15 +0 -25
  12. package/extras/backups/db.2021-11-16 +0 -25
  13. package/extras/backups/db.2022-01-14 +0 -24
  14. package/extras/backups/db.2022-01-15 +0 -29
  15. package/extras/backups/db.2022-01-16 +0 -29
  16. package/extras/backups/db.2022-01-17 +0 -29
  17. package/extras/backups/db.2022-01-18 +0 -29
  18. package/extras/backups/db.2022-01-19 +0 -29
  19. package/extras/backups/db.2022-01-20 +0 -32
  20. package/extras/backups/db.2022-01-21 +0 -32
  21. package/extras/backups/db.2022-01-22 +0 -47
  22. package/extras/backups/db.2022-01-23 +0 -47
  23. package/extras/backups/db.2022-02-20 +0 -53
  24. package/extras/backups/db.2022-09-08 +0 -48
  25. package/extras/backups/db.2022-09-09 +0 -48
  26. package/extras/backups/db.2022-09-10 +0 -48
  27. package/extras/backups/db.2022-09-11 +0 -48
  28. package/extras/backups/db.2022-09-12 +0 -48
  29. package/extras/backups/db.2022-09-13 +0 -48
  30. package/extras/backups/db.2022-09-14 +0 -48
  31. package/extras/backups/pdb.2017-08-21 +0 -46
  32. package/extras/braid-client.html +0 -12
  33. package/extras/braid-client2.html +0 -9
  34. package/extras/braid-client3.html +0 -0
  35. package/extras/braid-server.js +0 -37
  36. package/extras/braid-server2.js +0 -35
  37. package/extras/chokitest.js +0 -142
  38. package/extras/clientless.js +0 -4
  39. package/extras/css.html +0 -4
  40. package/extras/ct.js +0 -24
  41. package/extras/ctests.js +0 -8
  42. package/extras/db +0 -48
  43. package/extras/ds.html +0 -8
  44. package/extras/ds.js +0 -17
  45. package/extras/email.html +0 -12
  46. package/extras/express-experiment.js +0 -15
  47. package/extras/f.js +0 -21
  48. package/extras/file-test.js +0 -12
  49. package/extras/flash.html +0 -8
  50. package/extras/flash.js +0 -7
  51. package/extras/fullnode-test.html +0 -4
  52. package/extras/fullnode-test.js +0 -26
  53. package/extras/hello-react/index.html +0 -24
  54. package/extras/hello-react.html +0 -4
  55. package/extras/hello.html +0 -4
  56. package/extras/k.js +0 -12
  57. package/extras/load-from-file.html +0 -4
  58. package/extras/multi-chat/1.html +0 -39
  59. package/extras/multicriteria +0 -52054
  60. package/extras/nested +0 -425965
  61. package/extras/new-react.html +0 -20
  62. package/extras/pdb +0 -46
  63. package/extras/perf.js +0 -68
  64. package/extras/perf2.js +0 -69
  65. package/extras/perf3.js +0 -14
  66. package/extras/pgt.js +0 -61
  67. package/extras/pointers-test.js +0 -17
  68. package/extras/pointers-test2.js +0 -83
  69. package/extras/ptest.js +0 -19
  70. package/extras/react-example.html +0 -32
  71. package/extras/react-example.jsx.html +0 -41
  72. package/extras/react.12.js +0 -18116
  73. package/extras/react.12.min.js +0 -16
  74. package/extras/react.15.min.js +0 -28
  75. package/extras/react.3.min.js +0 -19
  76. package/extras/remote-hello.html +0 -9
  77. package/extras/reset_pass.coffee +0 -101
  78. package/extras/reset_pass.html +0 -116
  79. package/extras/rocks-test.js +0 -6
  80. package/extras/s4.js +0 -2
  81. package/extras/sbdb +0 -4
  82. package/extras/slideboard +0 -4
  83. package/extras/smaller-file.js +0 -8
  84. package/extras/sqls-test.js +0 -6
  85. package/extras/stateb.us.coffee +0 -92
  86. package/extras/syncie.html +0 -31
  87. package/extras/syncie.js +0 -15
  88. package/extras/test2.js +0 -48
  89. package/extras/test_client.html +0 -8
  90. package/extras/test_client.js +0 -19
  91. package/extras/test_save_delay.js +0 -11
  92. package/extras/test_timeouts.js +0 -10
  93. package/extras/tests-val.js +0 -1572
  94. package/extras/tests.html +0 -5
  95. package/extras/uni.js +0 -7
  96. package/extras/usage_test.html +0 -3
  97. package/extras/usage_test.js +0 -32
  98. package/extras/vtest.js +0 -17
@@ -1,47 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections",
4
- "836c4b0f-5457-4bd5-9b01-5042f837f871": {
5
- "client": "836c4b0f-5457-4bd5-9b01-5042f837f871",
6
- "id": "836c4b0f-5457-4bd5-9b01-5042f837f871"
7
- }
8
- },
9
- "foo": {
10
- "key": "foo",
11
- "val": 3
12
- },
13
- "users/passwords": {
14
- "key": "users/passwords"
15
- },
16
- "some_text": {
17
- "key": "some_text",
18
- "val": "Hello! This is the text."
19
- },
20
- "stuff": {
21
- "key": "stuff",
22
- "val": {
23
- "stuff": {
24
- "Yeah": "man",
25
- "this_is": {
26
- "the": "stuff!"
27
- }
28
- },
29
- "fluff": true
30
- }
31
- },
32
- "bar": {
33
- "key": "bar",
34
- "val": {
35
- "me": "you"
36
- }
37
- },
38
- "link": {
39
- "key": "link",
40
- "val": {
41
- "key": "bar",
42
- "val": {
43
- "me": "you"
44
- }
45
- }
46
- }
47
- }
@@ -1,53 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections",
4
- "ec2ac2ea-dcd8-43fc-b498-c8e80634be15": {
5
- "client": "ec2ac2ea-dcd8-43fc-b498-c8e80634be15",
6
- "id": "ec2ac2ea-dcd8-43fc-b498-c8e80634be15"
7
- }
8
- },
9
- "foo": {
10
- "key": "foo",
11
- "val": 3
12
- },
13
- "users/passwords": {
14
- "key": "users/passwords"
15
- },
16
- "some_text": {
17
- "key": "some_text",
18
- "val": "Hello! This is the text."
19
- },
20
- "stuff": {
21
- "key": "stuff",
22
- "val": {
23
- "stuff": {
24
- "Yeah": "man",
25
- "this_is": {
26
- "the": "stuff!"
27
- }
28
- },
29
- "fluff": true
30
- }
31
- },
32
- "bar": {
33
- "key": "bar",
34
- "val": [
35
- "ok",
36
- {
37
- "a": "yay"
38
- }
39
- ]
40
- },
41
- "link": {
42
- "key": "link",
43
- "val": {
44
- "key": "bar",
45
- "val": [
46
- "ok",
47
- {
48
- "a": "yay"
49
- }
50
- ]
51
- }
52
- }
53
- }
@@ -1,48 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo"
7
- },
8
- "users/passwords": {
9
- "key": "users/passwords"
10
- },
11
- "some_text": {
12
- "key": "some_text",
13
- "val": "Hello! This is the text."
14
- },
15
- "stuff": {
16
- "key": "stuff",
17
- "val": {
18
- "stuff": {
19
- "Yeah": "man",
20
- "this_is": {
21
- "the": "stuff!"
22
- }
23
- },
24
- "fluff": true
25
- }
26
- },
27
- "bar": {
28
- "key": "bar",
29
- "val": [
30
- "ok",
31
- {
32
- "a": "yay"
33
- }
34
- ]
35
- },
36
- "link": {
37
- "key": "link",
38
- "val": {
39
- "key": "bar",
40
- "val": [
41
- "ok",
42
- {
43
- "a": "yay"
44
- }
45
- ]
46
- }
47
- }
48
- }
@@ -1,48 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo"
7
- },
8
- "users/passwords": {
9
- "key": "users/passwords"
10
- },
11
- "some_text": {
12
- "key": "some_text",
13
- "val": "Hello! This is the text."
14
- },
15
- "stuff": {
16
- "key": "stuff",
17
- "val": {
18
- "stuff": {
19
- "Yeah": "man",
20
- "this_is": {
21
- "the": "stuff!"
22
- }
23
- },
24
- "fluff": true
25
- }
26
- },
27
- "bar": {
28
- "key": "bar",
29
- "val": [
30
- "ok",
31
- {
32
- "a": "yay"
33
- }
34
- ]
35
- },
36
- "link": {
37
- "key": "link",
38
- "val": {
39
- "key": "bar",
40
- "val": [
41
- "ok",
42
- {
43
- "a": "yay"
44
- }
45
- ]
46
- }
47
- }
48
- }
@@ -1,48 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo"
7
- },
8
- "users/passwords": {
9
- "key": "users/passwords"
10
- },
11
- "some_text": {
12
- "key": "some_text",
13
- "val": "Hello! This is the text."
14
- },
15
- "stuff": {
16
- "key": "stuff",
17
- "val": {
18
- "stuff": {
19
- "Yeah": "man",
20
- "this_is": {
21
- "the": "stuff!"
22
- }
23
- },
24
- "fluff": true
25
- }
26
- },
27
- "bar": {
28
- "key": "bar",
29
- "val": [
30
- "ok",
31
- {
32
- "a": "yay"
33
- }
34
- ]
35
- },
36
- "link": {
37
- "key": "link",
38
- "val": {
39
- "key": "bar",
40
- "val": [
41
- "ok",
42
- {
43
- "a": "yay"
44
- }
45
- ]
46
- }
47
- }
48
- }
@@ -1,48 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo"
7
- },
8
- "users/passwords": {
9
- "key": "users/passwords"
10
- },
11
- "some_text": {
12
- "key": "some_text",
13
- "val": "Hello! This is the text."
14
- },
15
- "stuff": {
16
- "key": "stuff",
17
- "val": {
18
- "stuff": {
19
- "Yeah": "man",
20
- "this_is": {
21
- "the": "stuff!"
22
- }
23
- },
24
- "fluff": true
25
- }
26
- },
27
- "bar": {
28
- "key": "bar",
29
- "val": [
30
- "ok",
31
- {
32
- "a": "yay"
33
- }
34
- ]
35
- },
36
- "link": {
37
- "key": "link",
38
- "val": {
39
- "key": "bar",
40
- "val": [
41
- "ok",
42
- {
43
- "a": "yay"
44
- }
45
- ]
46
- }
47
- }
48
- }
@@ -1,48 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo"
7
- },
8
- "users/passwords": {
9
- "key": "users/passwords"
10
- },
11
- "some_text": {
12
- "key": "some_text",
13
- "val": "Hello! This is the text."
14
- },
15
- "stuff": {
16
- "key": "stuff",
17
- "val": {
18
- "stuff": {
19
- "Yeah": "man",
20
- "this_is": {
21
- "the": "stuff!"
22
- }
23
- },
24
- "fluff": true
25
- }
26
- },
27
- "bar": {
28
- "key": "bar",
29
- "val": [
30
- "ok",
31
- {
32
- "a": "yay"
33
- }
34
- ]
35
- },
36
- "link": {
37
- "key": "link",
38
- "val": {
39
- "key": "bar",
40
- "val": [
41
- "ok",
42
- {
43
- "a": "yay"
44
- }
45
- ]
46
- }
47
- }
48
- }
@@ -1,48 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo"
7
- },
8
- "users/passwords": {
9
- "key": "users/passwords"
10
- },
11
- "some_text": {
12
- "key": "some_text",
13
- "val": "Hello! This is the text."
14
- },
15
- "stuff": {
16
- "key": "stuff",
17
- "val": {
18
- "stuff": {
19
- "Yeah": "man",
20
- "this_is": {
21
- "the": "stuff!"
22
- }
23
- },
24
- "fluff": true
25
- }
26
- },
27
- "bar": {
28
- "key": "bar",
29
- "val": [
30
- "ok",
31
- {
32
- "a": "yay"
33
- }
34
- ]
35
- },
36
- "link": {
37
- "key": "link",
38
- "val": {
39
- "key": "bar",
40
- "val": [
41
- "ok",
42
- {
43
- "a": "yay"
44
- }
45
- ]
46
- }
47
- }
48
- }
@@ -1,48 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo"
7
- },
8
- "users/passwords": {
9
- "key": "users/passwords"
10
- },
11
- "some_text": {
12
- "key": "some_text",
13
- "val": "Hello! This is the text."
14
- },
15
- "stuff": {
16
- "key": "stuff",
17
- "val": {
18
- "stuff": {
19
- "Yeah": "man",
20
- "this_is": {
21
- "the": "stuff!"
22
- }
23
- },
24
- "fluff": true
25
- }
26
- },
27
- "bar": {
28
- "key": "bar",
29
- "val": [
30
- "ok",
31
- {
32
- "a": "yay"
33
- }
34
- ]
35
- },
36
- "link": {
37
- "key": "link",
38
- "val": {
39
- "key": "bar",
40
- "val": [
41
- "ok",
42
- {
43
- "a": "yay"
44
- }
45
- ]
46
- }
47
- }
48
- }
@@ -1,46 +0,0 @@
1
- {
2
- "connections": {
3
- "key": "connections"
4
- },
5
- "foo": {
6
- "key": "foo",
7
- "array": [
8
- {
9
- "_key": "foo1"
10
- },
11
- {
12
- "_key": "foo2"
13
- },
14
- {
15
- "_key": "foo3"
16
- }
17
- ]
18
- },
19
- "foo1": {
20
- "key": "foo1",
21
- "thing": 1
22
- },
23
- "foo2": {
24
- "key": "foo2",
25
- "thing": [
26
- {
27
- "_key": "foo2.1"
28
- },
29
- {
30
- "_key": "foo2.2"
31
- }
32
- ]
33
- },
34
- "foo2.1": {
35
- "key": "foo2.1",
36
- "thing": 2.1
37
- },
38
- "foo2.2": {
39
- "key": "foo2.2",
40
- "thing": 2.2
41
- },
42
- "foo3": {
43
- "key": "foo3",
44
- "thing": 3
45
- }
46
- }
@@ -1,12 +0,0 @@
1
- <script src="/braidify-client.js"></script> <!-- -*- mode: javascript -*- -->
2
- hello!
3
- <script>
4
-
5
- fetch('http://localhost:4736/foo', {subscribe: true}).andThen(console.log)
6
- fetch('http://localhost:4736/stuff', {subscribe: true}).andThen(console.log)
7
-
8
- function put_it () {
9
- fetch('http://localhost:4736/foo', {method: 'put', body: '{"foo": 3}'})
10
- }
11
-
12
- </script>
@@ -1,9 +0,0 @@
1
- <script type="coffee">
2
-
3
- dom.BODY = ->
4
- DIV
5
- onClick: -> bus.state['/foo']++
6
- 'Hi man. ' + bus.state['/foo'] + ' and ' + JSON.stringify(bus.state['/bar'])
7
-
8
- </script>
9
- <script src="/client.js" braid_mode=yah></script>
File without changes
@@ -1,37 +0,0 @@
1
- var bus = require('../statebus').serve({port: 4736})
2
- bus.http.get('/braidify-client.js', (req, res) => {
3
- var text = require('fs').readFileSync(__dirname + '/../node_modules/braidify/braidify-client.js')
4
- res.send(text)
5
- res.end()
6
- })
7
- bus.http.get('/', (req, res) => {
8
- res.sendFile(__dirname + '/braid-client.html')
9
- })
10
-
11
- bus.save({key: 'some_text', _: 'Hello! This is the text.'})
12
-
13
- var old_bodify = bus.to_http_body
14
- bus.to_http_body = (o) => {
15
- if (o.key === 'stuff')
16
- return JSON.stringify(o.stuff)
17
- else
18
- return old_bodify(o)
19
- }
20
-
21
- bus.save({key: 'stuff', stuff: {Yeah:'man', this_is:{the: 'stuff!'}}})
22
-
23
- // var braidify = require('braidify').http_server
24
-
25
- // bus.http.get('/foo', (req, res) => {
26
- // braidify(req, res)
27
- // if (req.subscribe) {
28
- // res.startSubscription({ onClose: x => null })
29
- // console.log('yay subscription!')
30
- // } else
31
- // res.statusCode = 200
32
-
33
- // res.sendVersion({
34
- // version: 'seph',
35
- // body: 'hellloooo'
36
- // })
37
- // })
@@ -1,35 +0,0 @@
1
- var bus = require('../statebus').serve({port: 4736, braid_mode: true})
2
- bus.serve_clientjs()
3
- bus.http.get('/braidify-client.js', (req, res) => {
4
- var text = require('fs').readFileSync(__dirname + '/../node_modules/braidify/braidify-client.js')
5
- res.send(text)
6
- res.end()
7
- })
8
- bus.http.get('/', (req, res) => {
9
- res.sendFile(__dirname + '/braid-client2.html')
10
- })
11
-
12
- bus.save({key: 'some_text', val: 'Hello! This is the text.'})
13
-
14
- bus.save({key: 'stuff', val: {stuff: {Yeah:'man', this_is:{the: 'stuff!'}}}})
15
-
16
- bus.state.foo = 3
17
- console.log('our stuff is', bus.state.stuff)
18
- bus.state.stuff.fluff = true
19
- console.log('our stuff is', bus.state.stuff)
20
-
21
- // var braidify = require('braidify').http_server
22
-
23
- // bus.http.get('/foo', (req, res) => {
24
- // braidify(req, res)
25
- // if (req.subscribe) {
26
- // res.startSubscription({ onClose: x => null })
27
- // console.log('yay subscription!')
28
- // } else
29
- // res.statusCode = 200
30
-
31
- // res.sendVersion({
32
- // version: 'seph',
33
- // body: 'hellloooo'
34
- // })
35
- // })