mongodb-livedata-server 0.1.3 → 0.1.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 (92) hide show
  1. package/README.md +2 -2
  2. package/dist/livedata_server.d.ts +4 -4
  3. package/dist/livedata_server.js +11 -11
  4. package/dist/meteor/binary-heap/max_heap.d.ts +31 -31
  5. package/dist/meteor/binary-heap/max_heap.js +186 -186
  6. package/dist/meteor/binary-heap/min_heap.d.ts +6 -6
  7. package/dist/meteor/binary-heap/min_heap.js +17 -17
  8. package/dist/meteor/binary-heap/min_max_heap.d.ts +11 -11
  9. package/dist/meteor/binary-heap/min_max_heap.js +48 -48
  10. package/dist/meteor/callback-hook/hook.d.ts +11 -11
  11. package/dist/meteor/callback-hook/hook.js +78 -78
  12. package/dist/meteor/ddp/crossbar.d.ts +15 -15
  13. package/dist/meteor/ddp/crossbar.js +136 -136
  14. package/dist/meteor/ddp/heartbeat.d.ts +19 -19
  15. package/dist/meteor/ddp/heartbeat.js +77 -77
  16. package/dist/meteor/ddp/livedata_server.d.ts +141 -142
  17. package/dist/meteor/ddp/livedata_server.js +403 -403
  18. package/dist/meteor/ddp/method-invocation.d.ts +35 -35
  19. package/dist/meteor/ddp/method-invocation.js +72 -72
  20. package/dist/meteor/ddp/random-stream.d.ts +8 -8
  21. package/dist/meteor/ddp/random-stream.js +100 -100
  22. package/dist/meteor/ddp/session-collection-view.d.ts +20 -20
  23. package/dist/meteor/ddp/session-collection-view.js +106 -106
  24. package/dist/meteor/ddp/session-document-view.d.ts +8 -8
  25. package/dist/meteor/ddp/session-document-view.js +82 -82
  26. package/dist/meteor/ddp/session.d.ts +75 -75
  27. package/dist/meteor/ddp/session.js +590 -590
  28. package/dist/meteor/ddp/stream_server.d.ts +20 -21
  29. package/dist/meteor/ddp/stream_server.js +181 -181
  30. package/dist/meteor/ddp/subscription.d.ts +94 -94
  31. package/dist/meteor/ddp/subscription.js +370 -370
  32. package/dist/meteor/ddp/utils.d.ts +8 -8
  33. package/dist/meteor/ddp/utils.js +104 -104
  34. package/dist/meteor/ddp/writefence.d.ts +20 -20
  35. package/dist/meteor/ddp/writefence.js +111 -111
  36. package/dist/meteor/diff-sequence/diff.d.ts +17 -17
  37. package/dist/meteor/diff-sequence/diff.js +257 -257
  38. package/dist/meteor/ejson/ejson.d.ts +82 -82
  39. package/dist/meteor/ejson/ejson.js +568 -569
  40. package/dist/meteor/ejson/stringify.d.ts +2 -2
  41. package/dist/meteor/ejson/stringify.js +119 -119
  42. package/dist/meteor/ejson/utils.d.ts +12 -12
  43. package/dist/meteor/ejson/utils.js +42 -42
  44. package/dist/meteor/mongo/caching_change_observer.d.ts +16 -16
  45. package/dist/meteor/mongo/caching_change_observer.js +63 -63
  46. package/dist/meteor/mongo/doc_fetcher.d.ts +7 -7
  47. package/dist/meteor/mongo/doc_fetcher.js +53 -53
  48. package/dist/meteor/mongo/geojson_utils.d.ts +3 -3
  49. package/dist/meteor/mongo/geojson_utils.js +40 -41
  50. package/dist/meteor/mongo/live_connection.d.ts +28 -28
  51. package/dist/meteor/mongo/live_connection.js +264 -264
  52. package/dist/meteor/mongo/live_cursor.d.ts +25 -25
  53. package/dist/meteor/mongo/live_cursor.js +60 -60
  54. package/dist/meteor/mongo/minimongo_common.d.ts +84 -84
  55. package/dist/meteor/mongo/minimongo_common.js +1998 -1998
  56. package/dist/meteor/mongo/minimongo_matcher.d.ts +23 -23
  57. package/dist/meteor/mongo/minimongo_matcher.js +283 -283
  58. package/dist/meteor/mongo/minimongo_sorter.d.ts +16 -16
  59. package/dist/meteor/mongo/minimongo_sorter.js +268 -268
  60. package/dist/meteor/mongo/observe_driver_utils.d.ts +9 -9
  61. package/dist/meteor/mongo/observe_driver_utils.js +72 -73
  62. package/dist/meteor/mongo/observe_multiplexer.d.ts +46 -46
  63. package/dist/meteor/mongo/observe_multiplexer.js +203 -203
  64. package/dist/meteor/mongo/oplog-observe-driver.d.ts +68 -68
  65. package/dist/meteor/mongo/oplog-observe-driver.js +918 -918
  66. package/dist/meteor/mongo/oplog_tailing.d.ts +35 -35
  67. package/dist/meteor/mongo/oplog_tailing.js +352 -352
  68. package/dist/meteor/mongo/oplog_v2_converter.d.ts +1 -1
  69. package/dist/meteor/mongo/oplog_v2_converter.js +125 -126
  70. package/dist/meteor/mongo/polling_observe_driver.d.ts +30 -30
  71. package/dist/meteor/mongo/polling_observe_driver.js +216 -221
  72. package/dist/meteor/mongo/synchronous-cursor.d.ts +17 -17
  73. package/dist/meteor/mongo/synchronous-cursor.js +261 -261
  74. package/dist/meteor/mongo/synchronous-queue.d.ts +13 -13
  75. package/dist/meteor/mongo/synchronous-queue.js +110 -110
  76. package/dist/meteor/ordered-dict/ordered_dict.d.ts +31 -31
  77. package/dist/meteor/ordered-dict/ordered_dict.js +198 -198
  78. package/dist/meteor/random/AbstractRandomGenerator.d.ts +42 -42
  79. package/dist/meteor/random/AbstractRandomGenerator.js +92 -92
  80. package/dist/meteor/random/AleaRandomGenerator.d.ts +13 -13
  81. package/dist/meteor/random/AleaRandomGenerator.js +90 -90
  82. package/dist/meteor/random/NodeRandomGenerator.d.ts +16 -16
  83. package/dist/meteor/random/NodeRandomGenerator.js +42 -42
  84. package/dist/meteor/random/createAleaGenerator.d.ts +2 -2
  85. package/dist/meteor/random/createAleaGenerator.js +32 -32
  86. package/dist/meteor/random/createRandom.d.ts +1 -1
  87. package/dist/meteor/random/createRandom.js +22 -22
  88. package/dist/meteor/random/main.d.ts +1 -1
  89. package/dist/meteor/random/main.js +12 -12
  90. package/dist/meteor/types.d.ts +1 -1
  91. package/dist/meteor/types.js +2 -2
  92. package/package.json +5 -5
@@ -1,60 +1,60 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LiveCursor = exports.CursorDescription = void 0;
4
- const main_1 = require("../random/main");
5
- class CursorDescription {
6
- constructor(collectionName, selector, options) {
7
- this.collectionName = collectionName;
8
- var self = this;
9
- self.collectionName = collectionName;
10
- self.selector = _rewriteSelector(selector);
11
- self.options = options || {};
12
- }
13
- }
14
- exports.CursorDescription = CursorDescription;
15
- class LiveCursor {
16
- constructor(mongo, collectionName, selector, options) {
17
- this.mongo = mongo;
18
- this.cursorDescription = new CursorDescription(collectionName, selector, options);
19
- }
20
- async _publishCursor(sub) {
21
- const observeHandle = await this.mongo._observeChanges(this.cursorDescription, false, {
22
- initialAdds: (docs) => {
23
- sub.initialAdds(this.cursorDescription.collectionName, docs);
24
- },
25
- added: (id, fields) => {
26
- sub.added(this.cursorDescription.collectionName, id, fields);
27
- },
28
- changed: (id, fields) => {
29
- sub.changed(this.cursorDescription.collectionName, id, fields);
30
- },
31
- removed: (id) => {
32
- sub.removed(this.cursorDescription.collectionName, id);
33
- },
34
- },
35
- // Publications don't mutate the documents
36
- // This is tested by the `livedata - publish callbacks clone` test
37
- true);
38
- // We don't call sub.ready() here: it gets called in livedata_server, after
39
- // possibly calling _publishCursor on multiple returned cursors.
40
- // register stop callback (expects lambda w/ no args).
41
- sub.onStop(function () {
42
- observeHandle.stop();
43
- });
44
- // return the observeHandle in case it needs to be stopped early
45
- return observeHandle;
46
- }
47
- }
48
- exports.LiveCursor = LiveCursor;
49
- function _rewriteSelector(selector) {
50
- if (Array.isArray(selector)) {
51
- // This is consistent with the Mongo console itself; if we don't do this
52
- // check passing an empty array ends up selecting all items
53
- throw new Error("Mongo selector can't be an array.");
54
- }
55
- if (!selector || ('_id' in selector && !selector._id)) {
56
- // can't match anything
57
- return { _id: main_1.Random.id() };
58
- }
59
- return selector;
60
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiveCursor = exports.CursorDescription = void 0;
4
+ const main_1 = require("../random/main");
5
+ class CursorDescription {
6
+ constructor(collectionName, selector, options) {
7
+ this.collectionName = collectionName;
8
+ var self = this;
9
+ self.collectionName = collectionName;
10
+ self.selector = _rewriteSelector(selector);
11
+ self.options = options || {};
12
+ }
13
+ }
14
+ exports.CursorDescription = CursorDescription;
15
+ class LiveCursor {
16
+ constructor(mongo, collectionName, selector, options) {
17
+ this.mongo = mongo;
18
+ this.cursorDescription = new CursorDescription(collectionName, selector, options);
19
+ }
20
+ async _publishCursor(sub) {
21
+ const observeHandle = await this.mongo._observeChanges(this.cursorDescription, false, {
22
+ initialAdds: (docs) => {
23
+ sub.initialAdds(this.cursorDescription.collectionName, docs);
24
+ },
25
+ added: (id, fields) => {
26
+ sub.added(this.cursorDescription.collectionName, id, fields);
27
+ },
28
+ changed: (id, fields) => {
29
+ sub.changed(this.cursorDescription.collectionName, id, fields);
30
+ },
31
+ removed: (id) => {
32
+ sub.removed(this.cursorDescription.collectionName, id);
33
+ },
34
+ },
35
+ // Publications don't mutate the documents
36
+ // This is tested by the `livedata - publish callbacks clone` test
37
+ true);
38
+ // We don't call sub.ready() here: it gets called in livedata_server, after
39
+ // possibly calling _publishCursor on multiple returned cursors.
40
+ // register stop callback (expects lambda w/ no args).
41
+ sub.onStop(function () {
42
+ observeHandle.stop();
43
+ });
44
+ // return the observeHandle in case it needs to be stopped early
45
+ return observeHandle;
46
+ }
47
+ }
48
+ exports.LiveCursor = LiveCursor;
49
+ function _rewriteSelector(selector) {
50
+ if (Array.isArray(selector)) {
51
+ // This is consistent with the Mongo console itself; if we don't do this
52
+ // check passing an empty array ends up selecting all items
53
+ throw new Error("Mongo selector can't be an array.");
54
+ }
55
+ if (!selector || ('_id' in selector && !selector._id)) {
56
+ // can't match anything
57
+ return { _id: main_1.Random.id() };
58
+ }
59
+ return selector;
60
+ }
@@ -1,84 +1,84 @@
1
- export declare const hasOwn: (v: PropertyKey) => boolean;
2
- export declare const ELEMENT_OPERATORS: {
3
- $lt: {
4
- compileElementSelector(operand: any): (value: any) => any;
5
- };
6
- $gt: {
7
- compileElementSelector(operand: any): (value: any) => any;
8
- };
9
- $lte: {
10
- compileElementSelector(operand: any): (value: any) => any;
11
- };
12
- $gte: {
13
- compileElementSelector(operand: any): (value: any) => any;
14
- };
15
- $mod: {
16
- compileElementSelector(operand: any): (value: any) => boolean;
17
- };
18
- $in: {
19
- compileElementSelector(operand: any): (value: any) => boolean;
20
- };
21
- $size: {
22
- dontExpandLeafArrays: boolean;
23
- compileElementSelector(operand: any): (value: any) => boolean;
24
- };
25
- $type: {
26
- dontIncludeLeafArrays: boolean;
27
- compileElementSelector(operand: any): (value: any) => boolean;
28
- };
29
- $bitsAllSet: {
30
- compileElementSelector(operand: any): (value: any) => boolean;
31
- };
32
- $bitsAnySet: {
33
- compileElementSelector(operand: any): (value: any) => boolean;
34
- };
35
- $bitsAllClear: {
36
- compileElementSelector(operand: any): (value: any) => boolean;
37
- };
38
- $bitsAnyClear: {
39
- compileElementSelector(operand: any): (value: any) => boolean;
40
- };
41
- $regex: {
42
- compileElementSelector(operand: any, valueSelector: any): (value: any) => any;
43
- };
44
- $elemMatch: {
45
- dontExpandLeafArrays: boolean;
46
- compileElementSelector(operand: any, valueSelector: any, matcher: any): (value: any) => number | false;
47
- };
48
- };
49
- export declare function compileDocumentSelector(docSelector: any, matcher: any, options?: {
50
- isRoot?: boolean;
51
- inElemMatch?: boolean;
52
- }): any;
53
- export declare function equalityElementMatcher(elementSelector: any): (value: any) => any;
54
- export declare function expandArraysInBranches(branches: any, skipTheArrays?: boolean): any[];
55
- export declare function isIndexable(obj: any): boolean;
56
- export declare function isNumericKey(s: any): boolean;
57
- export declare function isOperatorObject(valueSelector: any, inconsistentOK?: any): boolean;
58
- export declare function makeLookupFunction(key: any, options?: {
59
- forSort?: boolean;
60
- }): (doc: any, arrayIndices?: any[]) => any[];
61
- export declare function nothingMatcher(docOrBranchedValues: any): {
62
- result: boolean;
63
- };
64
- export declare function pathsToTree(paths: any, newLeafFn: any, conflictFn: any, root?: {}): {};
65
- export declare function populateDocumentWithQueryFields(query: any, document?: {}): {};
66
- export declare function projectionDetails(fields: any): {
67
- including: any;
68
- tree: {};
69
- };
70
- export declare function regexpElementMatcher(regexp: any): (value: any) => any;
71
- export declare const _f: {
72
- _type(v: any): 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 13;
73
- _equal(a: any, b: any): any;
74
- _typeorder(t: any): number;
75
- _cmp(a: any, b: any): any;
76
- };
77
- export declare function _checkSupportedProjection(fields: any): void;
78
- export declare function _modify(doc: any, modifier: any, options?: {
79
- isInsert?: boolean;
80
- arrayIndices?: number[];
81
- }): void;
82
- export declare function combineImportantPathsIntoProjection(paths: any, projection: any): {};
83
- export declare function _pathsElidingNumericKeys(paths: any): any;
84
- export declare function _compileProjection(fields: any): (doc: any) => any;
1
+ export declare const hasOwn: (v: PropertyKey) => boolean;
2
+ export declare const ELEMENT_OPERATORS: {
3
+ $lt: {
4
+ compileElementSelector(operand: any): (value: any) => any;
5
+ };
6
+ $gt: {
7
+ compileElementSelector(operand: any): (value: any) => any;
8
+ };
9
+ $lte: {
10
+ compileElementSelector(operand: any): (value: any) => any;
11
+ };
12
+ $gte: {
13
+ compileElementSelector(operand: any): (value: any) => any;
14
+ };
15
+ $mod: {
16
+ compileElementSelector(operand: any): (value: any) => boolean;
17
+ };
18
+ $in: {
19
+ compileElementSelector(operand: any): (value: any) => boolean;
20
+ };
21
+ $size: {
22
+ dontExpandLeafArrays: boolean;
23
+ compileElementSelector(operand: any): (value: any) => boolean;
24
+ };
25
+ $type: {
26
+ dontIncludeLeafArrays: boolean;
27
+ compileElementSelector(operand: any): (value: any) => boolean;
28
+ };
29
+ $bitsAllSet: {
30
+ compileElementSelector(operand: any): (value: any) => boolean;
31
+ };
32
+ $bitsAnySet: {
33
+ compileElementSelector(operand: any): (value: any) => boolean;
34
+ };
35
+ $bitsAllClear: {
36
+ compileElementSelector(operand: any): (value: any) => boolean;
37
+ };
38
+ $bitsAnyClear: {
39
+ compileElementSelector(operand: any): (value: any) => boolean;
40
+ };
41
+ $regex: {
42
+ compileElementSelector(operand: any, valueSelector: any): (value: any) => any;
43
+ };
44
+ $elemMatch: {
45
+ dontExpandLeafArrays: boolean;
46
+ compileElementSelector(operand: any, valueSelector: any, matcher: any): (value: any) => number | false;
47
+ };
48
+ };
49
+ export declare function compileDocumentSelector(docSelector: any, matcher: any, options?: {
50
+ isRoot?: boolean;
51
+ inElemMatch?: boolean;
52
+ }): any;
53
+ export declare function equalityElementMatcher(elementSelector: any): (value: any) => any;
54
+ export declare function expandArraysInBranches(branches: any, skipTheArrays?: boolean): any[];
55
+ export declare function isIndexable(obj: any): boolean;
56
+ export declare function isNumericKey(s: any): boolean;
57
+ export declare function isOperatorObject(valueSelector: any, inconsistentOK?: any): boolean;
58
+ export declare function makeLookupFunction(key: any, options?: {
59
+ forSort?: boolean;
60
+ }): (doc: any, arrayIndices?: any[]) => any[];
61
+ export declare function nothingMatcher(docOrBranchedValues: any): {
62
+ result: boolean;
63
+ };
64
+ export declare function pathsToTree(paths: any, newLeafFn: any, conflictFn: any, root?: {}): {};
65
+ export declare function populateDocumentWithQueryFields(query: any, document?: {}): {};
66
+ export declare function projectionDetails(fields: any): {
67
+ including: any;
68
+ tree: {};
69
+ };
70
+ export declare function regexpElementMatcher(regexp: any): (value: any) => any;
71
+ export declare const _f: {
72
+ _type(v: any): 1 | 2 | 3 | 4 | 8 | 5 | 10 | 7 | 11 | 9 | 13;
73
+ _equal(a: any, b: any): any;
74
+ _typeorder(t: any): number;
75
+ _cmp(a: any, b: any): any;
76
+ };
77
+ export declare function _checkSupportedProjection(fields: any): void;
78
+ export declare function _modify(doc: any, modifier: any, options?: {
79
+ isInsert?: boolean;
80
+ arrayIndices?: number[];
81
+ }): void;
82
+ export declare function combineImportantPathsIntoProjection(paths: any, projection: any): {};
83
+ export declare function _pathsElidingNumericKeys(paths: any): any;
84
+ export declare function _compileProjection(fields: any): (doc: any) => any;