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,142 +1,141 @@
1
- /// <reference types="node" />
2
- import { MethodInvocation } from "./method-invocation";
3
- import { StreamServerSocket } from "./stream_server";
4
- import { DDPSession, SessionConnectionHandle } from "./session";
5
- import { Server } from "http";
6
- import { Hook } from "../callback-hook/hook";
7
- import { Subscription } from "./subscription";
8
- export declare const DDP: {
9
- _CurrentPublicationInvocation: Subscription;
10
- _CurrentMethodInvocation: MethodInvocation;
11
- };
12
- /******************************************************************************/
13
- /******************************************************************************/
14
- interface PublicationStrategy {
15
- useCollectionView: boolean;
16
- doAccountingForCollection: boolean;
17
- }
18
- export declare class DDPServer {
19
- private options;
20
- private onConnectionHook;
21
- onMessageHook: Hook;
22
- private publish_handlers;
23
- universal_publish_handlers: any[];
24
- private method_handlers;
25
- private _publicationStrategies;
26
- private sessions;
27
- private stream_server;
28
- constructor(options: {}, httpServer: Server);
29
- static publicationStrategies: {
30
- SERVER_MERGE: {
31
- useCollectionView: boolean;
32
- doAccountingForCollection: boolean;
33
- };
34
- NO_MERGE_NO_HISTORY: {
35
- useCollectionView: boolean;
36
- doAccountingForCollection: boolean;
37
- };
38
- NO_MERGE: {
39
- useCollectionView: boolean;
40
- doAccountingForCollection: boolean;
41
- };
42
- };
43
- /**
44
- * @summary Register a callback to be called when a new DDP connection is made to the server.
45
- * @locus Server
46
- * @param {function} callback The function to call when a new DDP connection is established.
47
- * @memberOf Meteor
48
- * @importFromPackage meteor
49
- */
50
- onConnection(fn: (conn: SessionConnectionHandle) => void): {
51
- callback: any;
52
- stop: () => void;
53
- };
54
- /**
55
- * @summary Set publication strategy for the given publication. Publications strategies are available from `DDPServer.publicationStrategies`. You call this method from `Meteor.server`, like `Meteor.server.setPublicationStrategy()`
56
- * @locus Server
57
- * @alias setPublicationStrategy
58
- * @param publicationName {String}
59
- * @param strategy {{useCollectionView: boolean, doAccountingForCollection: boolean}}
60
- * @memberOf Meteor.server
61
- * @importFromPackage meteor
62
- */
63
- setPublicationStrategy(publicationName: string, strategy: PublicationStrategy): void;
64
- /**
65
- * @summary Gets the publication strategy for the requested publication. You call this method from `Meteor.server`, like `Meteor.server.getPublicationStrategy()`
66
- * @locus Server
67
- * @alias getPublicationStrategy
68
- * @param publicationName {String}
69
- * @memberOf Meteor.server
70
- * @importFromPackage meteor
71
- * @return {{useCollectionView: boolean, doAccountingForCollection: boolean}}
72
- */
73
- getPublicationStrategy(publicationName: string): PublicationStrategy;
74
- /**
75
- * @summary Register a callback to be called when a new DDP message is received.
76
- * @locus Server
77
- * @param {function} callback The function to call when a new DDP message is received.
78
- * @memberOf Meteor
79
- * @importFromPackage meteor
80
- */
81
- onMessage(fn: any): {
82
- callback: any;
83
- stop: () => void;
84
- };
85
- _handleConnect(socket: StreamServerSocket, msg: any): void;
86
- /**
87
- * Register a publish handler function.
88
- *
89
- * @param name {String} identifier for query
90
- * @param handler {Function} publish handler
91
- *
92
- * Server will call handler function on each new subscription,
93
- * either when receiving DDP sub message for a named subscription, or on
94
- * DDP connect for a universal subscription.
95
- *
96
- * If name is null, this will be a subscription that is
97
- * automatically established and permanently on for all connected
98
- * client, instead of a subscription that can be turned on and off
99
- * with subscribe().
100
- *
101
- */
102
- /**
103
- * @summary Publish a record set.
104
- * @memberOf Meteor
105
- * @importFromPackage meteor
106
- * @locus Server
107
- * @param {String|Object} name If String, name of the record set. If Object, publications Dictionary of publish functions by name. If `null`, the set has no name, and the record set is automatically sent to all connected clients.
108
- * @param {Function} func Function called on the server each time a client subscribes. Inside the function, `this` is the publish handler object, described below. If the client passed arguments to `subscribe`, the function is called with the same arguments.
109
- */
110
- publish(name: string | Record<string, (this: MethodInvocation, ...args: any[]) => Promise<any>> | null, handler?: (this: MethodInvocation, ...args: any[]) => Promise<any>): void;
111
- _removeSession(session: DDPSession): void;
112
- /**
113
- * @summary Defines functions that can be invoked over the network by clients.
114
- * @locus Anywhere
115
- * @param {Object} methods Dictionary whose keys are method names and values are functions.
116
- * @memberOf Meteor
117
- * @importFromPackage meteor
118
- */
119
- methods(methods: Record<string, (this: MethodInvocation, ...args: any[]) => Promise<any>>): void;
120
- callAsync(name: string, ...args: any[]): Promise<unknown>;
121
- applyAsync(name: string, args: any[]): Promise<unknown>;
122
- _urlForSession(sessionId: any): string;
123
- }
124
- export declare function _calculateVersion(clientSupportedVersions: any, serverSupportedVersions: any): any;
125
- export declare function wrapInternalException(exception: any, context: string): any;
126
- export declare function maybeAuditArgumentChecks<T>(f: (...args: any[]) => T, context: any, args: any[] | null, description: string): T;
127
- export declare function ddpError(error: string | number, reason?: string, details?: string): {
128
- isClientSafe: boolean;
129
- error: string | number;
130
- reason: string;
131
- message: string;
132
- errorType: string;
133
- };
134
- export declare class ClientSafeError extends Error {
135
- error: string | number;
136
- reason?: string;
137
- details?: string;
138
- constructor(error: string | number, reason?: string, details?: string);
139
- isClientSafe: boolean;
140
- errorType: string;
141
- }
142
- export {};
1
+ import { MethodInvocation } from "./method-invocation";
2
+ import { StreamServerSocket } from "./stream_server";
3
+ import { DDPSession, SessionConnectionHandle } from "./session";
4
+ import { Server } from "http";
5
+ import { Hook } from "../callback-hook/hook";
6
+ import { Subscription } from "./subscription";
7
+ export declare const DDP: {
8
+ _CurrentPublicationInvocation: Subscription;
9
+ _CurrentMethodInvocation: MethodInvocation;
10
+ };
11
+ /******************************************************************************/
12
+ /******************************************************************************/
13
+ interface PublicationStrategy {
14
+ useCollectionView: boolean;
15
+ doAccountingForCollection: boolean;
16
+ }
17
+ export declare class DDPServer {
18
+ private options;
19
+ private onConnectionHook;
20
+ onMessageHook: Hook;
21
+ private publish_handlers;
22
+ universal_publish_handlers: any[];
23
+ private method_handlers;
24
+ private _publicationStrategies;
25
+ private sessions;
26
+ private stream_server;
27
+ constructor(options: {}, httpServer: Server);
28
+ static publicationStrategies: {
29
+ SERVER_MERGE: {
30
+ useCollectionView: boolean;
31
+ doAccountingForCollection: boolean;
32
+ };
33
+ NO_MERGE_NO_HISTORY: {
34
+ useCollectionView: boolean;
35
+ doAccountingForCollection: boolean;
36
+ };
37
+ NO_MERGE: {
38
+ useCollectionView: boolean;
39
+ doAccountingForCollection: boolean;
40
+ };
41
+ };
42
+ /**
43
+ * @summary Register a callback to be called when a new DDP connection is made to the server.
44
+ * @locus Server
45
+ * @param {function} callback The function to call when a new DDP connection is established.
46
+ * @memberOf Meteor
47
+ * @importFromPackage meteor
48
+ */
49
+ onConnection(fn: (conn: SessionConnectionHandle) => void): {
50
+ callback: any;
51
+ stop: () => void;
52
+ };
53
+ /**
54
+ * @summary Set publication strategy for the given publication. Publications strategies are available from `DDPServer.publicationStrategies`. You call this method from `Meteor.server`, like `Meteor.server.setPublicationStrategy()`
55
+ * @locus Server
56
+ * @alias setPublicationStrategy
57
+ * @param publicationName {String}
58
+ * @param strategy {{useCollectionView: boolean, doAccountingForCollection: boolean}}
59
+ * @memberOf Meteor.server
60
+ * @importFromPackage meteor
61
+ */
62
+ setPublicationStrategy(publicationName: string, strategy: PublicationStrategy): void;
63
+ /**
64
+ * @summary Gets the publication strategy for the requested publication. You call this method from `Meteor.server`, like `Meteor.server.getPublicationStrategy()`
65
+ * @locus Server
66
+ * @alias getPublicationStrategy
67
+ * @param publicationName {String}
68
+ * @memberOf Meteor.server
69
+ * @importFromPackage meteor
70
+ * @return {{useCollectionView: boolean, doAccountingForCollection: boolean}}
71
+ */
72
+ getPublicationStrategy(publicationName: string): PublicationStrategy;
73
+ /**
74
+ * @summary Register a callback to be called when a new DDP message is received.
75
+ * @locus Server
76
+ * @param {function} callback The function to call when a new DDP message is received.
77
+ * @memberOf Meteor
78
+ * @importFromPackage meteor
79
+ */
80
+ onMessage(fn: any): {
81
+ callback: any;
82
+ stop: () => void;
83
+ };
84
+ _handleConnect(socket: StreamServerSocket, msg: any): void;
85
+ /**
86
+ * Register a publish handler function.
87
+ *
88
+ * @param name {String} identifier for query
89
+ * @param handler {Function} publish handler
90
+ *
91
+ * Server will call handler function on each new subscription,
92
+ * either when receiving DDP sub message for a named subscription, or on
93
+ * DDP connect for a universal subscription.
94
+ *
95
+ * If name is null, this will be a subscription that is
96
+ * automatically established and permanently on for all connected
97
+ * client, instead of a subscription that can be turned on and off
98
+ * with subscribe().
99
+ *
100
+ */
101
+ /**
102
+ * @summary Publish a record set.
103
+ * @memberOf Meteor
104
+ * @importFromPackage meteor
105
+ * @locus Server
106
+ * @param {String|Object} name If String, name of the record set. If Object, publications Dictionary of publish functions by name. If `null`, the set has no name, and the record set is automatically sent to all connected clients.
107
+ * @param {Function} func Function called on the server each time a client subscribes. Inside the function, `this` is the publish handler object, described below. If the client passed arguments to `subscribe`, the function is called with the same arguments.
108
+ */
109
+ publish(name: string | Record<string, (this: MethodInvocation, ...args: any[]) => Promise<any>> | null, handler?: (this: MethodInvocation, ...args: any[]) => Promise<any>): void;
110
+ _removeSession(session: DDPSession): void;
111
+ /**
112
+ * @summary Defines functions that can be invoked over the network by clients.
113
+ * @locus Anywhere
114
+ * @param {Object} methods Dictionary whose keys are method names and values are functions.
115
+ * @memberOf Meteor
116
+ * @importFromPackage meteor
117
+ */
118
+ methods(methods: Record<string, (this: MethodInvocation, ...args: any[]) => Promise<any>>): void;
119
+ callAsync(name: string, ...args: any[]): Promise<unknown>;
120
+ applyAsync(name: string, args: any[]): Promise<unknown>;
121
+ _urlForSession(sessionId: any): string;
122
+ }
123
+ export declare function _calculateVersion(clientSupportedVersions: any, serverSupportedVersions: any): any;
124
+ export declare function wrapInternalException(exception: any, context: string): any;
125
+ export declare function maybeAuditArgumentChecks<T>(f: (...args: any[]) => T, context: any, args: any[] | null, description: string): T;
126
+ export declare function ddpError(error: string | number, reason?: string, details?: string): {
127
+ isClientSafe: boolean;
128
+ error: string | number;
129
+ reason: string;
130
+ message: string;
131
+ errorType: string;
132
+ };
133
+ export declare class ClientSafeError extends Error {
134
+ error: string | number;
135
+ reason?: string;
136
+ details?: string;
137
+ constructor(error: string | number, reason?: string, details?: string);
138
+ isClientSafe: boolean;
139
+ errorType: string;
140
+ }
141
+ export {};