mongodb-livedata-server 0.0.1

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 (94) hide show
  1. package/README.md +63 -0
  2. package/dist/livedata_server.js +9 -0
  3. package/dist/meteor/binary-heap/max_heap.js +186 -0
  4. package/dist/meteor/binary-heap/min_heap.js +17 -0
  5. package/dist/meteor/binary-heap/min_max_heap.js +48 -0
  6. package/dist/meteor/callback-hook/hook.js +78 -0
  7. package/dist/meteor/ddp/crossbar.js +136 -0
  8. package/dist/meteor/ddp/heartbeat.js +77 -0
  9. package/dist/meteor/ddp/livedata_server.js +403 -0
  10. package/dist/meteor/ddp/method-invocation.js +72 -0
  11. package/dist/meteor/ddp/random-stream.js +100 -0
  12. package/dist/meteor/ddp/session-collection-view.js +106 -0
  13. package/dist/meteor/ddp/session-document-view.js +82 -0
  14. package/dist/meteor/ddp/session.js +570 -0
  15. package/dist/meteor/ddp/stream_server.js +181 -0
  16. package/dist/meteor/ddp/subscription.js +347 -0
  17. package/dist/meteor/ddp/utils.js +104 -0
  18. package/dist/meteor/ddp/writefence.js +111 -0
  19. package/dist/meteor/diff-sequence/diff.js +257 -0
  20. package/dist/meteor/ejson/ejson.js +569 -0
  21. package/dist/meteor/ejson/stringify.js +119 -0
  22. package/dist/meteor/ejson/utils.js +42 -0
  23. package/dist/meteor/id-map/id_map.js +92 -0
  24. package/dist/meteor/mongo/caching_change_observer.js +94 -0
  25. package/dist/meteor/mongo/doc_fetcher.js +53 -0
  26. package/dist/meteor/mongo/geojson_utils.js +41 -0
  27. package/dist/meteor/mongo/live_connection.js +264 -0
  28. package/dist/meteor/mongo/live_cursor.js +57 -0
  29. package/dist/meteor/mongo/minimongo_common.js +2002 -0
  30. package/dist/meteor/mongo/minimongo_matcher.js +217 -0
  31. package/dist/meteor/mongo/minimongo_sorter.js +268 -0
  32. package/dist/meteor/mongo/observe_driver_utils.js +73 -0
  33. package/dist/meteor/mongo/observe_multiplexer.js +228 -0
  34. package/dist/meteor/mongo/oplog-observe-driver.js +919 -0
  35. package/dist/meteor/mongo/oplog_tailing.js +352 -0
  36. package/dist/meteor/mongo/oplog_v2_converter.js +126 -0
  37. package/dist/meteor/mongo/polling_observe_driver.js +195 -0
  38. package/dist/meteor/mongo/synchronous-cursor.js +261 -0
  39. package/dist/meteor/mongo/synchronous-queue.js +110 -0
  40. package/dist/meteor/ordered-dict/ordered_dict.js +198 -0
  41. package/dist/meteor/random/AbstractRandomGenerator.js +92 -0
  42. package/dist/meteor/random/AleaRandomGenerator.js +90 -0
  43. package/dist/meteor/random/NodeRandomGenerator.js +42 -0
  44. package/dist/meteor/random/createAleaGenerator.js +32 -0
  45. package/dist/meteor/random/createRandom.js +22 -0
  46. package/dist/meteor/random/main.js +12 -0
  47. package/livedata_server.ts +3 -0
  48. package/meteor/LICENSE +28 -0
  49. package/meteor/binary-heap/max_heap.ts +225 -0
  50. package/meteor/binary-heap/min_heap.ts +15 -0
  51. package/meteor/binary-heap/min_max_heap.ts +53 -0
  52. package/meteor/callback-hook/hook.ts +85 -0
  53. package/meteor/ddp/crossbar.ts +148 -0
  54. package/meteor/ddp/heartbeat.ts +97 -0
  55. package/meteor/ddp/livedata_server.ts +473 -0
  56. package/meteor/ddp/method-invocation.ts +86 -0
  57. package/meteor/ddp/random-stream.ts +102 -0
  58. package/meteor/ddp/session-collection-view.ts +119 -0
  59. package/meteor/ddp/session-document-view.ts +92 -0
  60. package/meteor/ddp/session.ts +708 -0
  61. package/meteor/ddp/stream_server.ts +204 -0
  62. package/meteor/ddp/subscription.ts +392 -0
  63. package/meteor/ddp/utils.ts +119 -0
  64. package/meteor/ddp/writefence.ts +130 -0
  65. package/meteor/diff-sequence/diff.ts +295 -0
  66. package/meteor/ejson/ejson.ts +601 -0
  67. package/meteor/ejson/stringify.ts +122 -0
  68. package/meteor/ejson/utils.ts +38 -0
  69. package/meteor/id-map/id_map.ts +84 -0
  70. package/meteor/mongo/caching_change_observer.ts +120 -0
  71. package/meteor/mongo/doc_fetcher.ts +52 -0
  72. package/meteor/mongo/geojson_utils.ts +42 -0
  73. package/meteor/mongo/live_connection.ts +302 -0
  74. package/meteor/mongo/live_cursor.ts +79 -0
  75. package/meteor/mongo/minimongo_common.ts +2440 -0
  76. package/meteor/mongo/minimongo_matcher.ts +275 -0
  77. package/meteor/mongo/minimongo_sorter.ts +331 -0
  78. package/meteor/mongo/observe_driver_utils.ts +79 -0
  79. package/meteor/mongo/observe_multiplexer.ts +256 -0
  80. package/meteor/mongo/oplog-observe-driver.ts +1049 -0
  81. package/meteor/mongo/oplog_tailing.ts +414 -0
  82. package/meteor/mongo/oplog_v2_converter.ts +124 -0
  83. package/meteor/mongo/polling_observe_driver.ts +247 -0
  84. package/meteor/mongo/synchronous-cursor.ts +293 -0
  85. package/meteor/mongo/synchronous-queue.ts +119 -0
  86. package/meteor/ordered-dict/ordered_dict.ts +229 -0
  87. package/meteor/random/AbstractRandomGenerator.ts +99 -0
  88. package/meteor/random/AleaRandomGenerator.ts +96 -0
  89. package/meteor/random/NodeRandomGenerator.ts +37 -0
  90. package/meteor/random/createAleaGenerator.ts +31 -0
  91. package/meteor/random/createRandom.ts +19 -0
  92. package/meteor/random/main.ts +8 -0
  93. package/package.json +30 -0
  94. package/tsconfig.json +10 -0
@@ -0,0 +1,229 @@
1
+ // This file defines an ordered dictionary abstraction that is useful for
2
+ // maintaining a dataset backed by observeChanges. It supports ordering items
3
+ // by specifying the item they now come before.
4
+
5
+ // The implementation is a dictionary that contains nodes of a doubly-linked
6
+ // list as its values.
7
+
8
+ // constructs a new element struct
9
+ // next and prev are whole elements, not keys.
10
+ function element(key, value, next, prev?) {
11
+ return {
12
+ key: key,
13
+ value: value,
14
+ next: next,
15
+ prev: prev
16
+ };
17
+ }
18
+
19
+ export class OrderedDict {
20
+ public static BREAK = { "break": true };
21
+
22
+ private _dict: Record<string, any>;
23
+ private _first: any;
24
+ private _last: any;
25
+ private _size: number;
26
+ private _stringify: Function;
27
+
28
+ constructor(...args) {
29
+ this._dict = Object.create(null);
30
+ this._first = null;
31
+ this._last = null;
32
+ this._size = 0;
33
+
34
+ if (typeof args[0] === 'function') {
35
+ this._stringify = args.shift();
36
+ } else {
37
+ this._stringify = function (x) { return x; };
38
+ }
39
+
40
+ args.forEach(kv => this.putBefore(kv[0], kv[1], null));
41
+ }
42
+
43
+ // the "prefix keys with a space" thing comes from here
44
+ // https://github.com/documentcloud/underscore/issues/376#issuecomment-2815649
45
+ _k(key: any) {
46
+ return " " + this._stringify(key);
47
+ }
48
+
49
+ empty() {
50
+ return !this._first;
51
+ }
52
+
53
+ size() {
54
+ return this._size;
55
+ }
56
+
57
+ _linkEltIn(elt) {
58
+ if (!elt.next) {
59
+ elt.prev = this._last;
60
+ if (this._last)
61
+ this._last.next = elt;
62
+ this._last = elt;
63
+ } else {
64
+ elt.prev = elt.next.prev;
65
+ elt.next.prev = elt;
66
+ if (elt.prev)
67
+ elt.prev.next = elt;
68
+ }
69
+ if (this._first === null || this._first === elt.next)
70
+ this._first = elt;
71
+ }
72
+
73
+ _linkEltOut(elt) {
74
+ if (elt.next)
75
+ elt.next.prev = elt.prev;
76
+ if (elt.prev)
77
+ elt.prev.next = elt.next;
78
+ if (elt === this._last)
79
+ this._last = elt.prev;
80
+ if (elt === this._first)
81
+ this._first = elt.next;
82
+ }
83
+
84
+ putBefore(key, item, before) {
85
+ if (this._dict[this._k(key)])
86
+ throw new Error("Item " + key + " already present in OrderedDict");
87
+ var elt = before ?
88
+ element(key, item, this._dict[this._k(before)]) :
89
+ element(key, item, null);
90
+ if (typeof elt.next === "undefined")
91
+ throw new Error("could not find item to put this one before");
92
+ this._linkEltIn(elt);
93
+ this._dict[this._k(key)] = elt;
94
+ this._size++;
95
+ }
96
+
97
+ append(key, item) {
98
+ this.putBefore(key, item, null);
99
+ }
100
+
101
+ remove(key) {
102
+ var elt = this._dict[this._k(key)];
103
+ if (typeof elt === "undefined")
104
+ throw new Error("Item " + key + " not present in OrderedDict");
105
+ this._linkEltOut(elt);
106
+ this._size--;
107
+ delete this._dict[this._k(key)];
108
+ return elt.value;
109
+ }
110
+
111
+ get(key) {
112
+ if (this.has(key)) {
113
+ return this._dict[this._k(key)].value;
114
+ }
115
+ }
116
+
117
+ has(key) {
118
+ return Object.prototype.hasOwnProperty.call(
119
+ this._dict,
120
+ this._k(key)
121
+ );
122
+ }
123
+
124
+ // Iterate through the items in this dictionary in order, calling
125
+ // iter(value, key, index) on each one.
126
+
127
+ // Stops whenever iter returns OrderedDict.BREAK, or after the last element.
128
+ forEach(iter, context = null) {
129
+ var i = 0;
130
+ var elt = this._first;
131
+ while (elt !== null) {
132
+ var b = iter.call(context, elt.value, elt.key, i);
133
+ if (b === OrderedDict.BREAK) return;
134
+ elt = elt.next;
135
+ i++;
136
+ }
137
+ }
138
+
139
+ first() {
140
+ if (this.empty()) {
141
+ return;
142
+ }
143
+ return this._first.key;
144
+ }
145
+
146
+ firstValue() {
147
+ if (this.empty()) {
148
+ return;
149
+ }
150
+ return this._first.value;
151
+ }
152
+
153
+ last() {
154
+ if (this.empty()) {
155
+ return;
156
+ }
157
+ return this._last.key;
158
+ }
159
+
160
+ lastValue() {
161
+ if (this.empty()) {
162
+ return;
163
+ }
164
+ return this._last.value;
165
+ }
166
+
167
+ prev(key) {
168
+ if (this.has(key)) {
169
+ var elt = this._dict[this._k(key)];
170
+ if (elt.prev)
171
+ return elt.prev.key;
172
+ }
173
+ return null;
174
+ }
175
+
176
+ next(key) {
177
+ if (this.has(key)) {
178
+ var elt = this._dict[this._k(key)];
179
+ if (elt.next)
180
+ return elt.next.key;
181
+ }
182
+ return null;
183
+ }
184
+
185
+ moveBefore(key, before) {
186
+ var elt = this._dict[this._k(key)];
187
+ var eltBefore = before ? this._dict[this._k(before)] : null;
188
+ if (typeof elt === "undefined") {
189
+ throw new Error("Item to move is not present");
190
+ }
191
+ if (typeof eltBefore === "undefined") {
192
+ throw new Error("Could not find element to move this one before");
193
+ }
194
+ if (eltBefore === elt.next) // no moving necessary
195
+ return;
196
+ // remove from its old place
197
+ this._linkEltOut(elt);
198
+ // patch into its new place
199
+ elt.next = eltBefore;
200
+ this._linkEltIn(elt);
201
+ }
202
+
203
+ // Linear, sadly.
204
+ indexOf(key) {
205
+ var ret = null;
206
+ this.forEach((v, k, i) => {
207
+ if (this._k(k) === this._k(key)) {
208
+ ret = i;
209
+ return OrderedDict.BREAK;
210
+ }
211
+ return;
212
+ });
213
+ return ret;
214
+ }
215
+
216
+ _checkRep() {
217
+ Object.keys(this._dict).forEach(k => {
218
+ const v = this._dict[k];
219
+ if (v.next === v) {
220
+ throw new Error("Next is a loop");
221
+ }
222
+ if (v.prev === v) {
223
+ throw new Error("Prev is a loop");
224
+ }
225
+ });
226
+ }
227
+
228
+ }
229
+
@@ -0,0 +1,99 @@
1
+ // We use cryptographically strong PRNGs (crypto.getRandomBytes() on the server,
2
+ // window.crypto.getRandomValues() in the browser) when available. If these
3
+ // PRNGs fail, we fall back to the Alea PRNG, which is not cryptographically
4
+ // strong, and we seed it with various sources such as the date, Math.random,
5
+ // and window size on the client. When using crypto.getRandomValues(), our
6
+ // primitive is hexString(), from which we construct fraction(). When using
7
+ // window.crypto.getRandomValues() or alea, the primitive is fraction and we use
8
+ // that to construct hex string.
9
+
10
+ const UNMISTAKABLE_CHARS = '23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz';
11
+ const BASE64_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' +
12
+ '0123456789-_';
13
+
14
+ // `type` is one of `RandomGenerator.Type` as defined below.
15
+ //
16
+ // options:
17
+ // - seeds: (required, only for RandomGenerator.Type.ALEA) an array
18
+ // whose items will be `toString`ed and used as the seed to the Alea
19
+ // algorithm
20
+ export default class RandomGenerator {
21
+
22
+ /**
23
+ * @name Random.fraction
24
+ * @summary Return a number between 0 and 1, like `Math.random`.
25
+ * @locus Anywhere
26
+ */
27
+ fraction (): number {
28
+ throw new Error(`Unknown random generator type`);
29
+ }
30
+
31
+ /**
32
+ * @name Random.hexString
33
+ * @summary Return a random string of `n` hexadecimal digits.
34
+ * @locus Anywhere
35
+ * @param {Number} n Length of the string
36
+ */
37
+ hexString (digits) {
38
+ return this._randomString(digits, '0123456789abcdef');
39
+ }
40
+
41
+ _randomString (charsCount, alphabet) {
42
+ let result = '';
43
+ for (let i = 0; i < charsCount; i++) {
44
+ result += this.choice(alphabet);
45
+ }
46
+ return result;
47
+ }
48
+
49
+ /**
50
+ * @name Random.id
51
+ * @summary Return a unique identifier, such as `"Jjwjg6gouWLXhMGKW"`, that is
52
+ * likely to be unique in the whole world.
53
+ * @locus Anywhere
54
+ * @param {Number} [n] Optional length of the identifier in characters
55
+ * (defaults to 17)
56
+ */
57
+ id (charsCount) {
58
+ // 17 characters is around 96 bits of entropy, which is the amount of
59
+ // state in the Alea PRNG.
60
+ if (charsCount === undefined) {
61
+ charsCount = 17;
62
+ }
63
+
64
+ return this._randomString(charsCount, UNMISTAKABLE_CHARS);
65
+ }
66
+
67
+ /**
68
+ * @name Random.secret
69
+ * @summary Return a random string of printable characters with 6 bits of
70
+ * entropy per character. Use `Random.secret` for security-critical secrets
71
+ * that are intended for machine, rather than human, consumption.
72
+ * @locus Anywhere
73
+ * @param {Number} [n] Optional length of the secret string (defaults to 43
74
+ * characters, or 256 bits of entropy)
75
+ */
76
+ secret (charsCount) {
77
+ // Default to 256 bits of entropy, or 43 characters at 6 bits per
78
+ // character.
79
+ if (charsCount === undefined) {
80
+ charsCount = 43;
81
+ }
82
+
83
+ return this._randomString(charsCount, BASE64_CHARS);
84
+ }
85
+
86
+ /**
87
+ * @name Random.choice
88
+ * @summary Return a random element of the given array or string.
89
+ * @locus Anywhere
90
+ * @param {Array|String} arrayOrString Array or string to choose from
91
+ */
92
+ choice (arrayOrString) {
93
+ const index = Math.floor(this.fraction() * arrayOrString.length);
94
+ if (typeof arrayOrString === 'string') {
95
+ return arrayOrString.substr(index, 1);
96
+ }
97
+ return arrayOrString[index];
98
+ }
99
+ }
@@ -0,0 +1,96 @@
1
+ import RandomGenerator from './AbstractRandomGenerator';
2
+
3
+ // Alea PRNG, which is not cryptographically strong
4
+ // see http://baagoe.org/en/wiki/Better_random_numbers_for_javascript
5
+ // for a full discussion and Alea implementation.
6
+ function Alea(seeds) {
7
+ function Mash() {
8
+ let n = 0xefc8249d;
9
+
10
+ const mash = (data) => {
11
+ data = data.toString();
12
+ for (let i = 0; i < data.length; i++) {
13
+ n += data.charCodeAt(i);
14
+ let h = 0.02519603282416938 * n;
15
+ n = h >>> 0;
16
+ h -= n;
17
+ h *= n;
18
+ n = h >>> 0;
19
+ h -= n;
20
+ n += h * 0x100000000; // 2^32
21
+ }
22
+ return (n >>> 0) * 2.3283064365386963e-10; // 2^-32
23
+ };
24
+
25
+ mash.version = 'Mash 0.9';
26
+ return mash;
27
+ }
28
+
29
+ let s0 = 0;
30
+ let s1 = 0;
31
+ let s2 = 0;
32
+ let c = 1;
33
+ if (seeds.length === 0) {
34
+ seeds = [+new Date];
35
+ }
36
+ let mash = Mash();
37
+ s0 = mash(' ');
38
+ s1 = mash(' ');
39
+ s2 = mash(' ');
40
+
41
+ for (let i = 0; i < seeds.length; i++) {
42
+ s0 -= mash(seeds[i]);
43
+ if (s0 < 0) {
44
+ s0 += 1;
45
+ }
46
+ s1 -= mash(seeds[i]);
47
+ if (s1 < 0) {
48
+ s1 += 1;
49
+ }
50
+ s2 -= mash(seeds[i]);
51
+ if (s2 < 0) {
52
+ s2 += 1;
53
+ }
54
+ }
55
+ mash = null;
56
+
57
+ const random = () => {
58
+ const t = (2091639 * s0) + (c * 2.3283064365386963e-10); // 2^-32
59
+ s0 = s1;
60
+ s1 = s2;
61
+ return s2 = t - (c = t | 0);
62
+ };
63
+
64
+ random.uint32 = () => random() * 0x100000000; // 2^32
65
+ random.fract53 = () => random() +
66
+ ((random() * 0x200000 | 0) * 1.1102230246251565e-16); // 2^-53
67
+
68
+ random.version = 'Alea 0.9';
69
+ random.args = seeds;
70
+ return random;
71
+ }
72
+
73
+ // options:
74
+ // - seeds: an array
75
+ // whose items will be `toString`ed and used as the seed to the Alea
76
+ // algorithm
77
+ export default class AleaRandomGenerator extends RandomGenerator {
78
+ private alea: ReturnType<typeof Alea>;
79
+
80
+ constructor ({ seeds = [] } = {}) {
81
+ super();
82
+ if (!seeds) {
83
+ throw new Error('No seeds were provided for Alea PRNG');
84
+ }
85
+ this.alea = Alea(seeds);
86
+ }
87
+
88
+ /**
89
+ * @name Random.fraction
90
+ * @summary Return a number between 0 and 1, like `Math.random`.
91
+ * @locus Anywhere
92
+ */
93
+ fraction () {
94
+ return this.alea();
95
+ }
96
+ }
@@ -0,0 +1,37 @@
1
+ import crypto from 'crypto';
2
+ import RandomGenerator from './AbstractRandomGenerator';
3
+
4
+ export default class NodeRandomGenerator extends RandomGenerator {
5
+ /**
6
+ * @name Random.fraction
7
+ * @summary Return a number between 0 and 1, like `Math.random`.
8
+ * @locus Anywhere
9
+ */
10
+ fraction () {
11
+ const numerator = Number.parseInt(this.hexString(8), 16);
12
+ return numerator * 2.3283064365386963e-10; // 2^-3;
13
+ }
14
+
15
+ /**
16
+ * @name Random.hexString
17
+ * @summary Return a random string of `n` hexadecimal digits.
18
+ * @locus Anywhere
19
+ * @param {Number} n Length of the string
20
+ */
21
+ hexString (digits) {
22
+ const numBytes = Math.ceil(digits / 2);
23
+ let bytes;
24
+ // Try to get cryptographically strong randomness. Fall back to
25
+ // non-cryptographically strong if not available.
26
+ try {
27
+ bytes = crypto.randomBytes(numBytes);
28
+ } catch (e) {
29
+ // XXX should re-throw any error except insufficient entropy
30
+ bytes = crypto.pseudoRandomBytes(numBytes);
31
+ }
32
+ const result = bytes.toString('hex');
33
+ // If the number of digits is odd, we'll have generated an extra 4 bits
34
+ // of randomness, so we need to trim the last digit.
35
+ return result.substring(0, digits);
36
+ }
37
+ }
@@ -0,0 +1,31 @@
1
+ import AleaRandomGenerator from './AleaRandomGenerator';
2
+
3
+ // instantiate RNG. Heuristically collect entropy from various sources when a
4
+ // cryptographic PRNG isn't available.
5
+
6
+ // client sources
7
+ const height = (typeof window !== 'undefined' && window.innerHeight) ||
8
+ (typeof document !== 'undefined'
9
+ && document.documentElement
10
+ && document.documentElement.clientHeight) ||
11
+ (typeof document !== 'undefined'
12
+ && document.body
13
+ && document.body.clientHeight) ||
14
+ 1;
15
+
16
+ const width = (typeof window !== 'undefined' && window.innerWidth) ||
17
+ (typeof document !== 'undefined'
18
+ && document.documentElement
19
+ && document.documentElement.clientWidth) ||
20
+ (typeof document !== 'undefined'
21
+ && document.body
22
+ && document.body.clientWidth) ||
23
+ 1;
24
+
25
+ const agent = (typeof navigator !== 'undefined' && navigator.userAgent) || '';
26
+
27
+ export default function createAleaGenerator() {
28
+ return new AleaRandomGenerator({
29
+ seeds: [new Date, height, width, agent, Math.random()],
30
+ });
31
+ }
@@ -0,0 +1,19 @@
1
+ import AleaRandomGenerator from './AleaRandomGenerator'
2
+ import createAleaGeneratorWithGeneratedSeed from './createAleaGenerator';
3
+
4
+ export default function createRandom(generator) {
5
+ // Create a non-cryptographically secure PRNG with a given seed (using
6
+ // the Alea algorithm)
7
+ generator.createWithSeeds = (...seeds) => {
8
+ if (seeds.length === 0) {
9
+ throw new Error('No seeds were provided');
10
+ }
11
+ return new AleaRandomGenerator({ seeds });
12
+ };
13
+
14
+ // Used like `Random`, but much faster and not cryptographically
15
+ // secure
16
+ generator.insecure = createAleaGeneratorWithGeneratedSeed();
17
+
18
+ return generator;
19
+ }
@@ -0,0 +1,8 @@
1
+ // We use cryptographically strong PRNGs (crypto.getRandomBytes())
2
+ // When using crypto.getRandomValues(), our primitive is hexString(),
3
+ // from which we construct fraction().
4
+
5
+ import NodeRandomGenerator from './NodeRandomGenerator';
6
+ import createRandom from './createRandom';
7
+
8
+ export const Random = createRandom(new NodeRandomGenerator());
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "mongodb-livedata-server",
3
+ "version": "0.0.1",
4
+ "description": "MongoDB live data server, extracted from Meteor, Fibers removed and converted to TypeScript",
5
+ "main": "dist/livedata_server.js",
6
+ "types": "livedata_server.ts",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [],
11
+ "author": "Andrei Markeev",
12
+ "license": "MIT",
13
+ "dependencies": {
14
+ "compression": "^1.7.4",
15
+ "connect": "^3.7.0",
16
+ "cookie-parser": "^1.4.6",
17
+ "double-ended-queue": "^2.1.0-0",
18
+ "mongodb": "^4.11.0",
19
+ "permessage-deflate": "^0.1.7",
20
+ "send": "^0.18.0",
21
+ "sockjs": "^0.3.24",
22
+ "useragent": "^2.3.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/connect": "^3.4.35",
26
+ "@types/double-ended-queue": "^2.1.1",
27
+ "@types/node": "^18.11.9",
28
+ "@types/sockjs": "^0.3.33"
29
+ }
30
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "module": "CommonJS",
5
+ "moduleResolution": "node",
6
+ "esModuleInterop": true,
7
+ "outDir": "dist",
8
+ "rootDir": "."
9
+ }
10
+ }