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.
- package/README.md +2 -2
- package/dist/livedata_server.d.ts +4 -4
- package/dist/livedata_server.js +11 -11
- package/dist/meteor/binary-heap/max_heap.d.ts +31 -31
- package/dist/meteor/binary-heap/max_heap.js +186 -186
- package/dist/meteor/binary-heap/min_heap.d.ts +6 -6
- package/dist/meteor/binary-heap/min_heap.js +17 -17
- package/dist/meteor/binary-heap/min_max_heap.d.ts +11 -11
- package/dist/meteor/binary-heap/min_max_heap.js +48 -48
- package/dist/meteor/callback-hook/hook.d.ts +11 -11
- package/dist/meteor/callback-hook/hook.js +78 -78
- package/dist/meteor/ddp/crossbar.d.ts +15 -15
- package/dist/meteor/ddp/crossbar.js +136 -136
- package/dist/meteor/ddp/heartbeat.d.ts +19 -19
- package/dist/meteor/ddp/heartbeat.js +77 -77
- package/dist/meteor/ddp/livedata_server.d.ts +141 -142
- package/dist/meteor/ddp/livedata_server.js +403 -403
- package/dist/meteor/ddp/method-invocation.d.ts +35 -35
- package/dist/meteor/ddp/method-invocation.js +72 -72
- package/dist/meteor/ddp/random-stream.d.ts +8 -8
- package/dist/meteor/ddp/random-stream.js +100 -100
- package/dist/meteor/ddp/session-collection-view.d.ts +20 -20
- package/dist/meteor/ddp/session-collection-view.js +106 -106
- package/dist/meteor/ddp/session-document-view.d.ts +8 -8
- package/dist/meteor/ddp/session-document-view.js +82 -82
- package/dist/meteor/ddp/session.d.ts +75 -75
- package/dist/meteor/ddp/session.js +590 -590
- package/dist/meteor/ddp/stream_server.d.ts +20 -21
- package/dist/meteor/ddp/stream_server.js +181 -181
- package/dist/meteor/ddp/subscription.d.ts +94 -94
- package/dist/meteor/ddp/subscription.js +370 -370
- package/dist/meteor/ddp/utils.d.ts +8 -8
- package/dist/meteor/ddp/utils.js +104 -104
- package/dist/meteor/ddp/writefence.d.ts +20 -20
- package/dist/meteor/ddp/writefence.js +111 -111
- package/dist/meteor/diff-sequence/diff.d.ts +17 -17
- package/dist/meteor/diff-sequence/diff.js +257 -257
- package/dist/meteor/ejson/ejson.d.ts +82 -82
- package/dist/meteor/ejson/ejson.js +568 -569
- package/dist/meteor/ejson/stringify.d.ts +2 -2
- package/dist/meteor/ejson/stringify.js +119 -119
- package/dist/meteor/ejson/utils.d.ts +12 -12
- package/dist/meteor/ejson/utils.js +42 -42
- package/dist/meteor/mongo/caching_change_observer.d.ts +16 -16
- package/dist/meteor/mongo/caching_change_observer.js +63 -63
- package/dist/meteor/mongo/doc_fetcher.d.ts +7 -7
- package/dist/meteor/mongo/doc_fetcher.js +53 -53
- package/dist/meteor/mongo/geojson_utils.d.ts +3 -3
- package/dist/meteor/mongo/geojson_utils.js +40 -41
- package/dist/meteor/mongo/live_connection.d.ts +28 -28
- package/dist/meteor/mongo/live_connection.js +264 -264
- package/dist/meteor/mongo/live_cursor.d.ts +25 -25
- package/dist/meteor/mongo/live_cursor.js +60 -60
- package/dist/meteor/mongo/minimongo_common.d.ts +84 -84
- package/dist/meteor/mongo/minimongo_common.js +1998 -1998
- package/dist/meteor/mongo/minimongo_matcher.d.ts +23 -23
- package/dist/meteor/mongo/minimongo_matcher.js +283 -283
- package/dist/meteor/mongo/minimongo_sorter.d.ts +16 -16
- package/dist/meteor/mongo/minimongo_sorter.js +268 -268
- package/dist/meteor/mongo/observe_driver_utils.d.ts +9 -9
- package/dist/meteor/mongo/observe_driver_utils.js +72 -73
- package/dist/meteor/mongo/observe_multiplexer.d.ts +46 -46
- package/dist/meteor/mongo/observe_multiplexer.js +203 -203
- package/dist/meteor/mongo/oplog-observe-driver.d.ts +68 -68
- package/dist/meteor/mongo/oplog-observe-driver.js +918 -918
- package/dist/meteor/mongo/oplog_tailing.d.ts +35 -35
- package/dist/meteor/mongo/oplog_tailing.js +352 -352
- package/dist/meteor/mongo/oplog_v2_converter.d.ts +1 -1
- package/dist/meteor/mongo/oplog_v2_converter.js +125 -126
- package/dist/meteor/mongo/polling_observe_driver.d.ts +30 -30
- package/dist/meteor/mongo/polling_observe_driver.js +216 -221
- package/dist/meteor/mongo/synchronous-cursor.d.ts +17 -17
- package/dist/meteor/mongo/synchronous-cursor.js +261 -261
- package/dist/meteor/mongo/synchronous-queue.d.ts +13 -13
- package/dist/meteor/mongo/synchronous-queue.js +110 -110
- package/dist/meteor/ordered-dict/ordered_dict.d.ts +31 -31
- package/dist/meteor/ordered-dict/ordered_dict.js +198 -198
- package/dist/meteor/random/AbstractRandomGenerator.d.ts +42 -42
- package/dist/meteor/random/AbstractRandomGenerator.js +92 -92
- package/dist/meteor/random/AleaRandomGenerator.d.ts +13 -13
- package/dist/meteor/random/AleaRandomGenerator.js +90 -90
- package/dist/meteor/random/NodeRandomGenerator.d.ts +16 -16
- package/dist/meteor/random/NodeRandomGenerator.js +42 -42
- package/dist/meteor/random/createAleaGenerator.d.ts +2 -2
- package/dist/meteor/random/createAleaGenerator.js +32 -32
- package/dist/meteor/random/createRandom.d.ts +1 -1
- package/dist/meteor/random/createRandom.js +22 -22
- package/dist/meteor/random/main.d.ts +1 -1
- package/dist/meteor/random/main.js +12 -12
- package/dist/meteor/types.d.ts +1 -1
- package/dist/meteor/types.js +2 -2
- package/package.json +5 -5
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Heartbeat options:
|
|
3
|
-
// heartbeatInterval: interval to send pings, in milliseconds.
|
|
4
|
-
// heartbeatTimeout: timeout to close the connection if a reply isn't
|
|
5
|
-
// received, in milliseconds.
|
|
6
|
-
// sendPing: function to call to send a ping on the connection.
|
|
7
|
-
// onTimeout: function to call to close the connection.
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Heartbeat = void 0;
|
|
10
|
-
class Heartbeat {
|
|
11
|
-
constructor(options) {
|
|
12
|
-
this.heartbeatInterval = options.heartbeatInterval;
|
|
13
|
-
this.heartbeatTimeout = options.heartbeatTimeout;
|
|
14
|
-
this._sendPing = options.sendPing;
|
|
15
|
-
this._onTimeout = options.onTimeout;
|
|
16
|
-
this._seenPacket = false;
|
|
17
|
-
this._heartbeatIntervalHandle = null;
|
|
18
|
-
this._heartbeatTimeoutHandle = null;
|
|
19
|
-
}
|
|
20
|
-
stop() {
|
|
21
|
-
this._clearHeartbeatIntervalTimer();
|
|
22
|
-
this._clearHeartbeatTimeoutTimer();
|
|
23
|
-
}
|
|
24
|
-
start() {
|
|
25
|
-
this.stop();
|
|
26
|
-
this._startHeartbeatIntervalTimer();
|
|
27
|
-
}
|
|
28
|
-
_startHeartbeatIntervalTimer() {
|
|
29
|
-
this._heartbeatIntervalHandle = setInterval(() => this._heartbeatIntervalFired(), this.heartbeatInterval);
|
|
30
|
-
}
|
|
31
|
-
_startHeartbeatTimeoutTimer() {
|
|
32
|
-
this._heartbeatTimeoutHandle = setTimeout(() => this._heartbeatTimeoutFired(), this.heartbeatTimeout);
|
|
33
|
-
}
|
|
34
|
-
_clearHeartbeatIntervalTimer() {
|
|
35
|
-
if (this._heartbeatIntervalHandle) {
|
|
36
|
-
clearInterval(this._heartbeatIntervalHandle);
|
|
37
|
-
this._heartbeatIntervalHandle = null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
_clearHeartbeatTimeoutTimer() {
|
|
41
|
-
if (this._heartbeatTimeoutHandle) {
|
|
42
|
-
clearTimeout(this._heartbeatTimeoutHandle);
|
|
43
|
-
this._heartbeatTimeoutHandle = null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// The heartbeat interval timer is fired when we should send a ping.
|
|
47
|
-
_heartbeatIntervalFired() {
|
|
48
|
-
// don't send ping if we've seen a packet since we last checked,
|
|
49
|
-
// *or* if we have already sent a ping and are awaiting a timeout.
|
|
50
|
-
// That shouldn't happen, but it's possible if
|
|
51
|
-
// `this.heartbeatInterval` is smaller than
|
|
52
|
-
// `this.heartbeatTimeout`.
|
|
53
|
-
if (!this._seenPacket && !this._heartbeatTimeoutHandle) {
|
|
54
|
-
this._sendPing();
|
|
55
|
-
// Set up timeout, in case a pong doesn't arrive in time.
|
|
56
|
-
this._startHeartbeatTimeoutTimer();
|
|
57
|
-
}
|
|
58
|
-
this._seenPacket = false;
|
|
59
|
-
}
|
|
60
|
-
// The heartbeat timeout timer is fired when we sent a ping, but we
|
|
61
|
-
// timed out waiting for the pong.
|
|
62
|
-
_heartbeatTimeoutFired() {
|
|
63
|
-
this._heartbeatTimeoutHandle = null;
|
|
64
|
-
this._onTimeout();
|
|
65
|
-
}
|
|
66
|
-
messageReceived() {
|
|
67
|
-
// Tell periodic checkin that we have seen a packet, and thus it
|
|
68
|
-
// does not need to send a ping this cycle.
|
|
69
|
-
this._seenPacket = true;
|
|
70
|
-
// If we were waiting for a pong, we got it.
|
|
71
|
-
if (this._heartbeatTimeoutHandle) {
|
|
72
|
-
this._clearHeartbeatTimeoutTimer();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.Heartbeat = Heartbeat;
|
|
77
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
// Heartbeat options:
|
|
3
|
+
// heartbeatInterval: interval to send pings, in milliseconds.
|
|
4
|
+
// heartbeatTimeout: timeout to close the connection if a reply isn't
|
|
5
|
+
// received, in milliseconds.
|
|
6
|
+
// sendPing: function to call to send a ping on the connection.
|
|
7
|
+
// onTimeout: function to call to close the connection.
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Heartbeat = void 0;
|
|
10
|
+
class Heartbeat {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this.heartbeatInterval = options.heartbeatInterval;
|
|
13
|
+
this.heartbeatTimeout = options.heartbeatTimeout;
|
|
14
|
+
this._sendPing = options.sendPing;
|
|
15
|
+
this._onTimeout = options.onTimeout;
|
|
16
|
+
this._seenPacket = false;
|
|
17
|
+
this._heartbeatIntervalHandle = null;
|
|
18
|
+
this._heartbeatTimeoutHandle = null;
|
|
19
|
+
}
|
|
20
|
+
stop() {
|
|
21
|
+
this._clearHeartbeatIntervalTimer();
|
|
22
|
+
this._clearHeartbeatTimeoutTimer();
|
|
23
|
+
}
|
|
24
|
+
start() {
|
|
25
|
+
this.stop();
|
|
26
|
+
this._startHeartbeatIntervalTimer();
|
|
27
|
+
}
|
|
28
|
+
_startHeartbeatIntervalTimer() {
|
|
29
|
+
this._heartbeatIntervalHandle = setInterval(() => this._heartbeatIntervalFired(), this.heartbeatInterval);
|
|
30
|
+
}
|
|
31
|
+
_startHeartbeatTimeoutTimer() {
|
|
32
|
+
this._heartbeatTimeoutHandle = setTimeout(() => this._heartbeatTimeoutFired(), this.heartbeatTimeout);
|
|
33
|
+
}
|
|
34
|
+
_clearHeartbeatIntervalTimer() {
|
|
35
|
+
if (this._heartbeatIntervalHandle) {
|
|
36
|
+
clearInterval(this._heartbeatIntervalHandle);
|
|
37
|
+
this._heartbeatIntervalHandle = null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
_clearHeartbeatTimeoutTimer() {
|
|
41
|
+
if (this._heartbeatTimeoutHandle) {
|
|
42
|
+
clearTimeout(this._heartbeatTimeoutHandle);
|
|
43
|
+
this._heartbeatTimeoutHandle = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// The heartbeat interval timer is fired when we should send a ping.
|
|
47
|
+
_heartbeatIntervalFired() {
|
|
48
|
+
// don't send ping if we've seen a packet since we last checked,
|
|
49
|
+
// *or* if we have already sent a ping and are awaiting a timeout.
|
|
50
|
+
// That shouldn't happen, but it's possible if
|
|
51
|
+
// `this.heartbeatInterval` is smaller than
|
|
52
|
+
// `this.heartbeatTimeout`.
|
|
53
|
+
if (!this._seenPacket && !this._heartbeatTimeoutHandle) {
|
|
54
|
+
this._sendPing();
|
|
55
|
+
// Set up timeout, in case a pong doesn't arrive in time.
|
|
56
|
+
this._startHeartbeatTimeoutTimer();
|
|
57
|
+
}
|
|
58
|
+
this._seenPacket = false;
|
|
59
|
+
}
|
|
60
|
+
// The heartbeat timeout timer is fired when we sent a ping, but we
|
|
61
|
+
// timed out waiting for the pong.
|
|
62
|
+
_heartbeatTimeoutFired() {
|
|
63
|
+
this._heartbeatTimeoutHandle = null;
|
|
64
|
+
this._onTimeout();
|
|
65
|
+
}
|
|
66
|
+
messageReceived() {
|
|
67
|
+
// Tell periodic checkin that we have seen a packet, and thus it
|
|
68
|
+
// does not need to send a ping this cycle.
|
|
69
|
+
this._seenPacket = true;
|
|
70
|
+
// If we were waiting for a pong, we got it.
|
|
71
|
+
if (this._heartbeatTimeoutHandle) {
|
|
72
|
+
this._clearHeartbeatTimeoutTimer();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.Heartbeat = Heartbeat;
|
|
77
|
+
;
|
|
@@ -1,142 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/******************************************************************************/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
private
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* @
|
|
45
|
-
* @
|
|
46
|
-
* @
|
|
47
|
-
* @
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* @
|
|
56
|
-
* @
|
|
57
|
-
* @
|
|
58
|
-
* @param
|
|
59
|
-
* @
|
|
60
|
-
* @
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
* @
|
|
66
|
-
* @
|
|
67
|
-
* @
|
|
68
|
-
* @
|
|
69
|
-
* @
|
|
70
|
-
* @
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
* @
|
|
76
|
-
* @
|
|
77
|
-
* @
|
|
78
|
-
* @
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* @param
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* @
|
|
104
|
-
* @
|
|
105
|
-
* @
|
|
106
|
-
* @
|
|
107
|
-
* @param {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
* @
|
|
114
|
-
* @
|
|
115
|
-
* @
|
|
116
|
-
* @
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
export declare function
|
|
125
|
-
export declare function
|
|
126
|
-
export declare function
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
details?: string;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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 {};
|