@nanolink/mirrors 1.0.9 → 1.0.11
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/dist/DelegateMap.js +42 -37
- package/dist/DelegateMap.js.map +1 -1
- package/dist/MirrorSync.js +162 -110
- package/dist/MirrorSync.js.map +1 -1
- package/dist/SubscriptionClient.js +176 -109
- package/dist/SubscriptionClient.js.map +1 -1
- package/dist/index.js +115 -45
- package/dist/index.js.map +1 -1
- package/dist-compat/index.js +730 -13
- package/dist-compat/index.js.map +1 -1
- package/package.json +32 -11
|
@@ -1,22 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
4
24
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { createClient } from 'graphql-ws';
|
|
8
53
|
// Removed direct 'ws' import for browser compatibility; will resolve at runtime if needed.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
54
|
+
import EventEmitter from 'eventemitter3';
|
|
55
|
+
var SubscriptionClient = /** @class */ (function (_super) {
|
|
56
|
+
__extends(SubscriptionClient, _super);
|
|
57
|
+
function SubscriptionClient(opts) {
|
|
12
58
|
var _a, _b, _c, _d, _e;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
59
|
+
var _this = _super.call(this) || this;
|
|
60
|
+
_this.client = null;
|
|
61
|
+
_this.connectAttempt = 0;
|
|
62
|
+
_this.closedExplicitly = false;
|
|
63
|
+
_this.reconnecting = false;
|
|
64
|
+
_this.hasEverConnected = false;
|
|
65
|
+
_this.options = {
|
|
20
66
|
url: opts.url.replace(/^http/, "ws").replace(/^https/, "wss") + '/ws',
|
|
21
67
|
connectionParams: opts.connectionParams,
|
|
22
68
|
maxReconnectAttempts: (_a = opts.maxReconnectAttempts) !== null && _a !== void 0 ? _a : Infinity,
|
|
@@ -26,97 +72,109 @@ class SubscriptionClient extends eventemitter3_1.default {
|
|
|
26
72
|
webSocketImpl: (_e = opts.webSocketImpl) !== null && _e !== void 0 ? _e : undefined,
|
|
27
73
|
log: opts.log,
|
|
28
74
|
};
|
|
75
|
+
return _this;
|
|
29
76
|
}
|
|
30
|
-
resolveWebSocketImpl() {
|
|
77
|
+
SubscriptionClient.prototype.resolveWebSocketImpl = function () {
|
|
31
78
|
// Proxy-aware priority:
|
|
32
79
|
// 1. Explicit user-supplied impl
|
|
33
|
-
// 2.
|
|
34
|
-
// 3.
|
|
35
|
-
// 4.
|
|
80
|
+
// 2. Browser bundle: never load 'ws' — use global WebSocket
|
|
81
|
+
// 3. If proxy env detected (Node) -> prefer 'ws'
|
|
82
|
+
// 4. Global WebSocket (browser / Node >= 18 native)
|
|
83
|
+
// 5. Fallback to require('ws') (Node)
|
|
36
84
|
if (this.options.webSocketImpl)
|
|
37
85
|
return this.options.webSocketImpl;
|
|
38
|
-
|
|
39
|
-
|
|
86
|
+
if (process.env.BUILD_TARGET === 'browser') {
|
|
87
|
+
var g = globalThis;
|
|
88
|
+
if (typeof g.WebSocket === 'function')
|
|
89
|
+
return g.WebSocket;
|
|
90
|
+
throw new Error('No WebSocket implementation found in browser. Provide webSocketImpl.');
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
var proxyEnv = process.env.ALL_PROXY || process.env.HTTPS_PROXY || process.env.HTTP_PROXY || process.env.GLOBAL_AGENT_HTTP_PROXY;
|
|
94
|
+
if (proxyEnv) {
|
|
95
|
+
try {
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
97
|
+
return require('ws');
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
this.log('Proxy detected but failed to load ws package', e);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
var g = globalThis;
|
|
104
|
+
if (typeof g.WebSocket === 'function')
|
|
105
|
+
return g.WebSocket;
|
|
40
106
|
try {
|
|
41
107
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
42
108
|
return require('ws');
|
|
43
109
|
}
|
|
44
|
-
catch (
|
|
45
|
-
|
|
110
|
+
catch (_a) {
|
|
111
|
+
throw new Error('No WebSocket implementation found. Provide webSocketImpl in SubscriptionClientOptions.');
|
|
46
112
|
}
|
|
47
113
|
}
|
|
48
|
-
|
|
49
|
-
if (typeof g.WebSocket === 'function')
|
|
50
|
-
return g.WebSocket;
|
|
51
|
-
try {
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
53
|
-
return require('ws');
|
|
54
|
-
}
|
|
55
|
-
catch (_a) {
|
|
56
|
-
throw new Error('No WebSocket implementation found. Provide webSocketImpl in SubscriptionClientOptions.');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
114
|
+
};
|
|
59
115
|
/** Returns true if an underlying websocket client exists (connected or in-flight). */
|
|
60
|
-
isConnected() {
|
|
116
|
+
SubscriptionClient.prototype.isConnected = function () {
|
|
61
117
|
return !!this.client; // createClientIfNeeded only after socket open attempt
|
|
62
|
-
}
|
|
63
|
-
log(msg, meta) {
|
|
118
|
+
};
|
|
119
|
+
SubscriptionClient.prototype.log = function (msg, meta) {
|
|
64
120
|
if (this.options.log)
|
|
65
121
|
this.options.log(msg, meta);
|
|
66
|
-
}
|
|
67
|
-
createClientIfNeeded(isReconnect) {
|
|
122
|
+
};
|
|
123
|
+
SubscriptionClient.prototype.createClientIfNeeded = function (isReconnect) {
|
|
124
|
+
var _this = this;
|
|
68
125
|
if (this.client)
|
|
69
126
|
return; // already have client
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.client =
|
|
73
|
-
url,
|
|
74
|
-
connectionParams,
|
|
127
|
+
var _a = this.options, url = _a.url, connectionParams = _a.connectionParams;
|
|
128
|
+
var webSocketImpl = this.resolveWebSocketImpl();
|
|
129
|
+
this.client = createClient({
|
|
130
|
+
url: url,
|
|
131
|
+
connectionParams: connectionParams,
|
|
75
132
|
webSocketImpl: webSocketImpl,
|
|
76
133
|
lazy: false,
|
|
77
134
|
keepAlive: 12000,
|
|
78
135
|
retryAttempts: 0,
|
|
79
|
-
shouldRetry: ()
|
|
136
|
+
shouldRetry: function () { return false; },
|
|
80
137
|
on: {
|
|
81
|
-
connected: ()
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (wasReconnect &&
|
|
85
|
-
|
|
86
|
-
|
|
138
|
+
connected: function () {
|
|
139
|
+
var wasReconnect = isReconnect && _this.connectAttempt > 0;
|
|
140
|
+
_this.connectAttempt = 0;
|
|
141
|
+
if (wasReconnect && _this.hasEverConnected) {
|
|
142
|
+
_this.emit('reconnected');
|
|
143
|
+
_this.log('reconnected');
|
|
87
144
|
}
|
|
88
145
|
else {
|
|
89
|
-
|
|
90
|
-
|
|
146
|
+
_this.emit('connected');
|
|
147
|
+
_this.log('connected');
|
|
91
148
|
}
|
|
92
|
-
|
|
149
|
+
_this.hasEverConnected = true;
|
|
93
150
|
},
|
|
94
|
-
error: (err)
|
|
95
|
-
|
|
96
|
-
|
|
151
|
+
error: function (err) {
|
|
152
|
+
_this.emit('error', err);
|
|
153
|
+
_this.log('socket error', err);
|
|
97
154
|
},
|
|
98
|
-
closed: (ev)
|
|
155
|
+
closed: function (ev) {
|
|
99
156
|
var _a, _b, _c, _d;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (!
|
|
105
|
-
|
|
157
|
+
var e = ev;
|
|
158
|
+
_this.log('closed', e);
|
|
159
|
+
_this.emit('disconnected', { code: e.code, reason: (_c = (_b = (_a = e.reason) === null || _a === void 0 ? void 0 : _a.toString) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '', wasClean: (_d = e.wasClean) !== null && _d !== void 0 ? _d : false });
|
|
160
|
+
_this.client = null; // allow recreate
|
|
161
|
+
if (!_this.closedExplicitly)
|
|
162
|
+
_this.scheduleReconnect();
|
|
106
163
|
},
|
|
107
164
|
},
|
|
108
165
|
});
|
|
109
|
-
}
|
|
166
|
+
};
|
|
110
167
|
// assureConnected removed per revert request
|
|
111
168
|
/** Establish the WebSocket connection if not already created. Idempotent. */
|
|
112
|
-
connect() {
|
|
169
|
+
SubscriptionClient.prototype.connect = function () {
|
|
113
170
|
if (this.client)
|
|
114
171
|
return; // already created
|
|
115
172
|
this.emit('connecting');
|
|
116
173
|
this.log('connecting');
|
|
117
174
|
this.createClientIfNeeded(false);
|
|
118
|
-
}
|
|
119
|
-
scheduleReconnect() {
|
|
175
|
+
};
|
|
176
|
+
SubscriptionClient.prototype.scheduleReconnect = function () {
|
|
177
|
+
var _this = this;
|
|
120
178
|
if (this.reconnecting)
|
|
121
179
|
return;
|
|
122
180
|
if (this.connectAttempt >= this.options.maxReconnectAttempts) {
|
|
@@ -124,32 +182,32 @@ class SubscriptionClient extends eventemitter3_1.default {
|
|
|
124
182
|
return;
|
|
125
183
|
}
|
|
126
184
|
this.reconnecting = true;
|
|
127
|
-
|
|
185
|
+
var delay = Math.min(this.options.retryDelayMs * Math.pow(2, this.connectAttempt), this.options.maxRetryDelayMs);
|
|
128
186
|
this.emit('retry', { attempt: this.connectAttempt });
|
|
129
|
-
this.log('reconnect scheduled', { attempt: this.connectAttempt, delay });
|
|
130
|
-
setTimeout(()
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
187
|
+
this.log('reconnect scheduled', { attempt: this.connectAttempt, delay: delay });
|
|
188
|
+
setTimeout(function () {
|
|
189
|
+
_this.reconnecting = false;
|
|
190
|
+
_this.connectAttempt++;
|
|
191
|
+
_this.emit('connecting');
|
|
192
|
+
_this.log('connecting');
|
|
193
|
+
_this.createClientIfNeeded(true);
|
|
136
194
|
}, delay);
|
|
137
|
-
}
|
|
138
|
-
subscribe(options, observer) {
|
|
195
|
+
};
|
|
196
|
+
SubscriptionClient.prototype.subscribe = function (options, observer) {
|
|
139
197
|
var _a;
|
|
140
198
|
if (!this.client)
|
|
141
199
|
throw new Error('Client not connected - call connect() first');
|
|
142
|
-
|
|
200
|
+
var payload = {
|
|
143
201
|
query: options.query,
|
|
144
202
|
variables: options.variables,
|
|
145
203
|
operationName: options.operationName,
|
|
146
204
|
extensions: options.extensions,
|
|
147
205
|
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
206
|
+
var finished = false;
|
|
207
|
+
var timeoutMs = (_a = options.timeoutMs) !== null && _a !== void 0 ? _a : this.options.operationTimeoutMs;
|
|
208
|
+
var timeout;
|
|
151
209
|
if (timeoutMs > 0) {
|
|
152
|
-
timeout = setTimeout(()
|
|
210
|
+
timeout = setTimeout(function () {
|
|
153
211
|
var _a;
|
|
154
212
|
if (finished)
|
|
155
213
|
return;
|
|
@@ -158,9 +216,9 @@ class SubscriptionClient extends eventemitter3_1.default {
|
|
|
158
216
|
dispose();
|
|
159
217
|
}, timeoutMs);
|
|
160
218
|
}
|
|
161
|
-
|
|
162
|
-
next: (data)
|
|
163
|
-
error: (err)
|
|
219
|
+
var dispose = this.client.subscribe(payload, {
|
|
220
|
+
next: function (data) { var _a; return (_a = observer.next) === null || _a === void 0 ? void 0 : _a.call(observer, data); },
|
|
221
|
+
error: function (err) {
|
|
164
222
|
var _a;
|
|
165
223
|
if (finished)
|
|
166
224
|
return;
|
|
@@ -169,7 +227,7 @@ class SubscriptionClient extends eventemitter3_1.default {
|
|
|
169
227
|
clearTimeout(timeout);
|
|
170
228
|
(_a = observer.error) === null || _a === void 0 ? void 0 : _a.call(observer, err);
|
|
171
229
|
},
|
|
172
|
-
complete: ()
|
|
230
|
+
complete: function () {
|
|
173
231
|
var _a;
|
|
174
232
|
if (finished)
|
|
175
233
|
return;
|
|
@@ -179,7 +237,7 @@ class SubscriptionClient extends eventemitter3_1.default {
|
|
|
179
237
|
(_a = observer.complete) === null || _a === void 0 ? void 0 : _a.call(observer);
|
|
180
238
|
},
|
|
181
239
|
});
|
|
182
|
-
return ()
|
|
240
|
+
return function () {
|
|
183
241
|
if (finished)
|
|
184
242
|
return;
|
|
185
243
|
finished = true;
|
|
@@ -187,12 +245,12 @@ class SubscriptionClient extends eventemitter3_1.default {
|
|
|
187
245
|
clearTimeout(timeout);
|
|
188
246
|
dispose();
|
|
189
247
|
};
|
|
190
|
-
}
|
|
248
|
+
};
|
|
191
249
|
/** Async iterator variant (convenience wrapper around underlying client.iterate). */
|
|
192
|
-
iterate(options) {
|
|
250
|
+
SubscriptionClient.prototype.iterate = function (options) {
|
|
193
251
|
if (!this.client)
|
|
194
252
|
throw new Error('Client not connected - call connect() first');
|
|
195
|
-
|
|
253
|
+
var payload = {
|
|
196
254
|
query: options.query,
|
|
197
255
|
variables: options.variables,
|
|
198
256
|
operationName: options.operationName,
|
|
@@ -201,21 +259,30 @@ class SubscriptionClient extends eventemitter3_1.default {
|
|
|
201
259
|
// graphql-ws client.iterate returns AsyncIterableExecutionResult
|
|
202
260
|
// We forward it directly (user can for-await over it).
|
|
203
261
|
return this.client.iterate(payload);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
this
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
262
|
+
};
|
|
263
|
+
SubscriptionClient.prototype.close = function () {
|
|
264
|
+
return __awaiter(this, arguments, void 0, function (code, reason) {
|
|
265
|
+
var c;
|
|
266
|
+
if (code === void 0) { code = 1000; }
|
|
267
|
+
if (reason === void 0) { reason = 'Normal Closure'; }
|
|
268
|
+
return __generator(this, function (_a) {
|
|
269
|
+
this.closedExplicitly = true;
|
|
270
|
+
this.log('closing client');
|
|
271
|
+
c = this.client;
|
|
272
|
+
if (c) {
|
|
273
|
+
try {
|
|
274
|
+
c.dispose();
|
|
275
|
+
}
|
|
276
|
+
catch (_b) { }
|
|
277
|
+
}
|
|
278
|
+
this.client = null;
|
|
279
|
+
this.removeAllListeners();
|
|
280
|
+
return [2 /*return*/];
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
return SubscriptionClient;
|
|
285
|
+
}(EventEmitter));
|
|
286
|
+
export { SubscriptionClient };
|
|
287
|
+
export default SubscriptionClient;
|
|
221
288
|
//# sourceMappingURL=SubscriptionClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionClient.js","sourceRoot":"","sources":["../src/SubscriptionClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubscriptionClient.js","sourceRoot":"","sources":["../src/SubscriptionClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAA2C,MAAM,YAAY,CAAC;AACnF,2FAA2F;AAC3F,OAAO,YAAY,MAAM,eAAe,CAAC;AAoDzC;IAAwC,sCAAY;IAQhD,4BAAY,IAA+B;;QACvC,YAAA,MAAK,WAAE,SAAC;QAPJ,YAAM,GAAkB,IAAI,CAAC;QAC7B,oBAAc,GAAG,CAAC,CAAC;QACnB,sBAAgB,GAAG,KAAK,CAAC;QACzB,kBAAY,GAAG,KAAK,CAAC;QACrB,sBAAgB,GAAG,KAAK,CAAC;QAI7B,KAAI,CAAC,OAAO,GAAG;YACX,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,KAAK;YACrE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,oBAAoB,EAAE,MAAA,IAAI,CAAC,oBAAoB,mCAAI,QAAQ;YAC3D,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,GAAG;YACtC,eAAe,EAAE,MAAA,IAAI,CAAC,eAAe,mCAAI,KAAM;YAC/C,kBAAkB,EAAE,MAAA,IAAI,CAAC,kBAAkB,mCAAI,CAAC;YAChD,aAAa,EAAE,MAAA,IAAI,CAAC,aAAa,mCAAI,SAAS;YAC9C,GAAG,EAAE,IAAI,CAAC,GAAG;SACT,CAAC;;IACb,CAAC;IAEO,iDAAoB,GAA5B;QACI,wBAAwB;QACxB,iCAAiC;QACjC,4DAA4D;QAC5D,iDAAiD;QACjD,oDAAoD;QACpD,sCAAsC;QACtC,IAAI,IAAI,CAAC,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C,CAAC;QACF,iEAAiE;QACjE,uDAAuD;QACvD,OAAQ,IAAI,CAAC,MAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAEK,kCAAK,GAAX;4DAAY,IAAW,EAAE,MAAyB;;YAAtC,qBAAA,EAAA,WAAW;YAAE,uBAAA,EAAA,yBAAyB;;gBAC9C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;gBAC7B,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;gBACrB,CAAC,GAAG,IAAI,CAAC,MAAa,CAAC;gBAC7B,IAAI,CAAC,EAAE,CAAC;oBAAC,IAAI,CAAC;wBAAC,CAAC,CAAC,OAAO,EAAE,CAAC;oBAAC,CAAC;oBAAC,WAAM,CAAC,CAAC,CAAC;gBAAC,CAAC;gBACzC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBACnB,IAAI,CAAC,kBAAkB,EAAE,CAAC;;;;KAC7B;IACL,yBAAC;AAAD,CAAC,AAzMD,CAAwC,YAAY,GAyMnD;;AAED,eAAe,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,63 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
28
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
29
|
+
if (!m) return o;
|
|
30
|
+
var i = m.call(o), r, ar = [], e;
|
|
31
|
+
try {
|
|
32
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
33
|
+
}
|
|
34
|
+
catch (error) { e = { error: error }; }
|
|
35
|
+
finally {
|
|
36
|
+
try {
|
|
37
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
38
|
+
}
|
|
39
|
+
finally { if (e) throw e.error; }
|
|
40
|
+
}
|
|
41
|
+
return ar;
|
|
4
42
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
43
|
+
var __values = (this && this.__values) || function(o) {
|
|
44
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
45
|
+
if (m) return m.call(o);
|
|
46
|
+
if (o && typeof o.length === "number") return {
|
|
47
|
+
next: function () {
|
|
48
|
+
if (o && i >= o.length) o = void 0;
|
|
49
|
+
return { value: o && o[i++], done: !o };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
53
|
+
};
|
|
54
|
+
import { MirrorSync } from "./MirrorSync";
|
|
55
|
+
import { DelegatingObject, DelegatingMap } from "./DelegateMap";
|
|
56
|
+
import SubscriptionClient from "./SubscriptionClient";
|
|
57
|
+
export { SubscriptionClient, MirrorSync, DelegatingObject };
|
|
58
|
+
var Connection = /** @class */ (function (_super) {
|
|
59
|
+
__extends(Connection, _super);
|
|
60
|
+
function Connection(url, connectionParams) {
|
|
61
|
+
var _this = _super.call(this, {
|
|
17
62
|
url: url,
|
|
18
63
|
connectionParams: connectionParams
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
|
|
64
|
+
}) || this;
|
|
65
|
+
_this.mirrorMap = new Map();
|
|
66
|
+
_this.mirrors = new DelegatingObject(new DelegatingMap(function () { return _this.mirrorMap; }), function (v) { return v.sync.Storage; });
|
|
67
|
+
return _this;
|
|
22
68
|
}
|
|
23
|
-
|
|
24
|
-
|
|
69
|
+
Object.defineProperty(Connection.prototype, "Mirrors", {
|
|
70
|
+
get: function () { return this.mirrors.asObject(); },
|
|
71
|
+
enumerable: false,
|
|
72
|
+
configurable: true
|
|
73
|
+
});
|
|
74
|
+
Connection.prototype.getMirror = function (name, subscription, baseVariables) {
|
|
75
|
+
var _this = this;
|
|
76
|
+
var entry = this.mirrorMap.get(name);
|
|
25
77
|
if (!entry) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
78
|
+
var sync_1 = new MirrorSync(this, { subscription: subscription, baseVariables: baseVariables });
|
|
79
|
+
var forward_1 = function (event, payload) {
|
|
80
|
+
_this.emit("mirror:".concat(event), __assign({ mirrorName: name }, payload));
|
|
29
81
|
};
|
|
30
|
-
|
|
31
|
-
['start', (p)
|
|
32
|
-
['updated', (item, fullPhase)
|
|
33
|
-
['deleted', (p)
|
|
34
|
-
['done', (p)
|
|
35
|
-
['versionError', (p)
|
|
36
|
-
['resubscribe', (p)
|
|
37
|
-
['error', (p)
|
|
82
|
+
var handlers_1 = [
|
|
83
|
+
['start', function (p) { return forward_1('start', p); }],
|
|
84
|
+
['updated', function (item, fullPhase) { return forward_1('updated', { item: item, fullPhase: fullPhase }); }],
|
|
85
|
+
['deleted', function (p) { return forward_1('deleted', p); }],
|
|
86
|
+
['done', function (p) { return forward_1('done', p); }],
|
|
87
|
+
['versionError', function (p) { return forward_1('versionError', p); }],
|
|
88
|
+
['resubscribe', function (p) { return forward_1('resubscribe', p); }],
|
|
89
|
+
['error', function (p) { return forward_1('error', p); }],
|
|
38
90
|
];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
91
|
+
handlers_1.forEach(function (_a) {
|
|
92
|
+
var _b = __read(_a, 2), e = _b[0], h = _b[1];
|
|
93
|
+
return sync_1.on(e, h);
|
|
94
|
+
});
|
|
95
|
+
var detach = function () { return handlers_1.forEach(function (_a) {
|
|
96
|
+
var _b = __read(_a, 2), e = _b[0], h = _b[1];
|
|
97
|
+
return sync_1.off(e, h);
|
|
98
|
+
}); };
|
|
99
|
+
this.mirrorMap.set(name, { sync: sync_1, detach: detach });
|
|
100
|
+
entry = { sync: sync_1, detach: detach };
|
|
43
101
|
}
|
|
44
102
|
return entry.sync.load();
|
|
45
|
-
}
|
|
46
|
-
removeMirror(name) {
|
|
47
|
-
|
|
103
|
+
};
|
|
104
|
+
Connection.prototype.removeMirror = function (name) {
|
|
105
|
+
var entry = this.mirrorMap.get(name);
|
|
48
106
|
if (!entry)
|
|
49
107
|
return;
|
|
50
108
|
entry.detach();
|
|
51
109
|
entry.sync.stop();
|
|
52
110
|
this.mirrorMap.delete(name);
|
|
53
111
|
this.emit('mirror:removed', { mirrorName: name });
|
|
54
|
-
}
|
|
55
|
-
clearMirrors() {
|
|
56
|
-
|
|
57
|
-
|
|
112
|
+
};
|
|
113
|
+
Connection.prototype.clearMirrors = function () {
|
|
114
|
+
var e_1, _a;
|
|
115
|
+
try {
|
|
116
|
+
for (var _b = __values(Array.from(this.mirrorMap.keys())), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
117
|
+
var name_1 = _c.value;
|
|
118
|
+
this.removeMirror(name_1);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
122
|
+
finally {
|
|
123
|
+
try {
|
|
124
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
125
|
+
}
|
|
126
|
+
finally { if (e_1) throw e_1.error; }
|
|
58
127
|
}
|
|
59
128
|
this.emit('mirror:cleared');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
129
|
+
};
|
|
130
|
+
return Connection;
|
|
131
|
+
}(SubscriptionClient));
|
|
132
|
+
export { Connection };
|
|
63
133
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAmB,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;AAG5D;IAAgC,8BAAkB;IAK9C,oBAAY,GAAW,EAAE,gBAAkF;QACvG,YAAA,MAAK,YAAC;YACF,GAAG,EAAE,GAAG;YACR,gBAAgB,EAAE,gBAAgB;SACrC,CAAC,SAAC;QARC,eAAS,GAA0D,IAAI,GAAG,EAAE,CAAC;QAC7E,aAAO,GAAG,IAAI,gBAAgB,CAAc,IAAI,aAAa,CAAC,cAAM,OAAA,KAAI,CAAC,SAAS,EAAd,CAAc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