mongodb-livedata-server 0.1.2 → 0.1.4

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 (91) hide show
  1. package/dist/livedata_server.d.ts +4 -4
  2. package/dist/livedata_server.js +11 -11
  3. package/dist/meteor/binary-heap/max_heap.d.ts +31 -31
  4. package/dist/meteor/binary-heap/max_heap.js +186 -186
  5. package/dist/meteor/binary-heap/min_heap.d.ts +6 -6
  6. package/dist/meteor/binary-heap/min_heap.js +17 -17
  7. package/dist/meteor/binary-heap/min_max_heap.d.ts +11 -11
  8. package/dist/meteor/binary-heap/min_max_heap.js +48 -48
  9. package/dist/meteor/callback-hook/hook.d.ts +11 -11
  10. package/dist/meteor/callback-hook/hook.js +78 -78
  11. package/dist/meteor/ddp/crossbar.d.ts +15 -15
  12. package/dist/meteor/ddp/crossbar.js +136 -136
  13. package/dist/meteor/ddp/heartbeat.d.ts +19 -19
  14. package/dist/meteor/ddp/heartbeat.js +77 -77
  15. package/dist/meteor/ddp/livedata_server.d.ts +141 -142
  16. package/dist/meteor/ddp/livedata_server.js +403 -403
  17. package/dist/meteor/ddp/method-invocation.d.ts +35 -35
  18. package/dist/meteor/ddp/method-invocation.js +72 -72
  19. package/dist/meteor/ddp/random-stream.d.ts +8 -8
  20. package/dist/meteor/ddp/random-stream.js +100 -100
  21. package/dist/meteor/ddp/session-collection-view.d.ts +20 -20
  22. package/dist/meteor/ddp/session-collection-view.js +106 -106
  23. package/dist/meteor/ddp/session-document-view.d.ts +8 -8
  24. package/dist/meteor/ddp/session-document-view.js +82 -82
  25. package/dist/meteor/ddp/session.d.ts +75 -74
  26. package/dist/meteor/ddp/session.js +590 -589
  27. package/dist/meteor/ddp/stream_server.d.ts +20 -21
  28. package/dist/meteor/ddp/stream_server.js +181 -181
  29. package/dist/meteor/ddp/subscription.d.ts +94 -94
  30. package/dist/meteor/ddp/subscription.js +370 -370
  31. package/dist/meteor/ddp/utils.d.ts +8 -8
  32. package/dist/meteor/ddp/utils.js +104 -104
  33. package/dist/meteor/ddp/writefence.d.ts +20 -20
  34. package/dist/meteor/ddp/writefence.js +111 -111
  35. package/dist/meteor/diff-sequence/diff.d.ts +17 -17
  36. package/dist/meteor/diff-sequence/diff.js +257 -257
  37. package/dist/meteor/ejson/ejson.d.ts +82 -82
  38. package/dist/meteor/ejson/ejson.js +568 -569
  39. package/dist/meteor/ejson/stringify.d.ts +2 -2
  40. package/dist/meteor/ejson/stringify.js +119 -119
  41. package/dist/meteor/ejson/utils.d.ts +12 -12
  42. package/dist/meteor/ejson/utils.js +42 -42
  43. package/dist/meteor/mongo/caching_change_observer.d.ts +16 -16
  44. package/dist/meteor/mongo/caching_change_observer.js +63 -63
  45. package/dist/meteor/mongo/doc_fetcher.d.ts +7 -7
  46. package/dist/meteor/mongo/doc_fetcher.js +53 -53
  47. package/dist/meteor/mongo/geojson_utils.d.ts +3 -3
  48. package/dist/meteor/mongo/geojson_utils.js +40 -41
  49. package/dist/meteor/mongo/live_connection.d.ts +28 -28
  50. package/dist/meteor/mongo/live_connection.js +264 -264
  51. package/dist/meteor/mongo/live_cursor.d.ts +25 -25
  52. package/dist/meteor/mongo/live_cursor.js +60 -60
  53. package/dist/meteor/mongo/minimongo_common.d.ts +84 -84
  54. package/dist/meteor/mongo/minimongo_common.js +1998 -2002
  55. package/dist/meteor/mongo/minimongo_matcher.d.ts +23 -23
  56. package/dist/meteor/mongo/minimongo_matcher.js +283 -283
  57. package/dist/meteor/mongo/minimongo_sorter.d.ts +16 -16
  58. package/dist/meteor/mongo/minimongo_sorter.js +268 -268
  59. package/dist/meteor/mongo/observe_driver_utils.d.ts +9 -9
  60. package/dist/meteor/mongo/observe_driver_utils.js +72 -73
  61. package/dist/meteor/mongo/observe_multiplexer.d.ts +46 -46
  62. package/dist/meteor/mongo/observe_multiplexer.js +203 -203
  63. package/dist/meteor/mongo/oplog-observe-driver.d.ts +68 -68
  64. package/dist/meteor/mongo/oplog-observe-driver.js +918 -918
  65. package/dist/meteor/mongo/oplog_tailing.d.ts +35 -35
  66. package/dist/meteor/mongo/oplog_tailing.js +352 -352
  67. package/dist/meteor/mongo/oplog_v2_converter.d.ts +1 -1
  68. package/dist/meteor/mongo/oplog_v2_converter.js +125 -126
  69. package/dist/meteor/mongo/polling_observe_driver.d.ts +30 -30
  70. package/dist/meteor/mongo/polling_observe_driver.js +216 -221
  71. package/dist/meteor/mongo/synchronous-cursor.d.ts +17 -17
  72. package/dist/meteor/mongo/synchronous-cursor.js +261 -261
  73. package/dist/meteor/mongo/synchronous-queue.d.ts +13 -13
  74. package/dist/meteor/mongo/synchronous-queue.js +110 -110
  75. package/dist/meteor/ordered-dict/ordered_dict.d.ts +31 -31
  76. package/dist/meteor/ordered-dict/ordered_dict.js +198 -198
  77. package/dist/meteor/random/AbstractRandomGenerator.d.ts +42 -42
  78. package/dist/meteor/random/AbstractRandomGenerator.js +92 -92
  79. package/dist/meteor/random/AleaRandomGenerator.d.ts +13 -13
  80. package/dist/meteor/random/AleaRandomGenerator.js +90 -90
  81. package/dist/meteor/random/NodeRandomGenerator.d.ts +16 -16
  82. package/dist/meteor/random/NodeRandomGenerator.js +42 -42
  83. package/dist/meteor/random/createAleaGenerator.d.ts +2 -2
  84. package/dist/meteor/random/createAleaGenerator.js +32 -32
  85. package/dist/meteor/random/createRandom.d.ts +1 -1
  86. package/dist/meteor/random/createRandom.js +22 -22
  87. package/dist/meteor/random/main.d.ts +1 -1
  88. package/dist/meteor/random/main.js +12 -12
  89. package/dist/meteor/types.d.ts +1 -1
  90. package/dist/meteor/types.js +2 -2
  91. package/package.json +6 -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;