@trpc/client 10.0.0-alpha.14 → 10.0.0-alpha.15
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/TRPCClientError-17b117e1.mjs +81 -0
- package/dist/TRPCClientError-ec6bd2ca.js +94 -0
- package/dist/createChain-389cc116.mjs +25 -0
- package/dist/createChain-864dbb30.js +27 -0
- package/dist/{httpUtils-27640b42.js → httpUtils-1f9e4e3c.js} +0 -0
- package/dist/{httpUtils-b92552af.mjs → httpUtils-c09d7b79.mjs} +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -140
- package/dist/index.mjs +11 -130
- package/dist/internals/TRPCClient.d.ts +3 -3
- package/dist/internals/TRPCClient.d.ts.map +1 -1
- package/dist/links/httpBatchLink.d.ts +1 -1
- package/dist/links/httpBatchLink.d.ts.map +1 -1
- package/dist/links/httpBatchLink.js +2 -2
- package/dist/links/httpBatchLink.mjs +2 -2
- package/dist/links/httpLink.d.ts +1 -1
- package/dist/links/httpLink.d.ts.map +1 -1
- package/dist/links/httpLink.js +2 -2
- package/dist/links/httpLink.mjs +2 -2
- package/dist/links/{internals/httpUtils.d.ts → httpUtils.d.ts} +1 -1
- package/dist/links/httpUtils.d.ts.map +1 -0
- package/dist/links/loggerLink.js +2 -2
- package/dist/links/loggerLink.mjs +2 -2
- package/dist/links/splitLink.js +25 -3
- package/dist/links/splitLink.mjs +28 -2
- package/dist/links/transformerLink.d.ts.map +1 -1
- package/dist/links/transformerLink.js +5 -9
- package/dist/links/transformerLink.mjs +5 -9
- package/dist/links/types.d.ts +1 -1
- package/dist/links/types.d.ts.map +1 -1
- package/dist/links/wsLink.d.ts +1 -1
- package/dist/links/wsLink.d.ts.map +1 -1
- package/dist/links/wsLink.js +377 -11
- package/dist/links/wsLink.mjs +369 -9
- package/dist/{observable-16fde241.mjs → observable-7e66cb56.mjs} +0 -0
- package/dist/{observable-9aaca086.js → observable-85669100.js} +0 -0
- package/dist/rx/index.d.ts +3 -0
- package/dist/rx/index.d.ts.map +1 -0
- package/dist/rx/index.js +9 -0
- package/dist/rx/index.mjs +1 -0
- package/dist/{observable → rx}/index.ts.js +0 -0
- package/dist/{observable → rx}/observable.d.ts +0 -0
- package/dist/rx/observable.d.ts.map +1 -0
- package/dist/{observable → rx}/operators/index.d.ts +0 -0
- package/dist/rx/operators/index.d.ts.map +1 -0
- package/dist/{observable → rx/operators}/index.js +2 -4
- package/dist/{observable → rx/operators}/index.mjs +2 -3
- package/dist/rx/operators/index.ts.js +1 -0
- package/dist/{observable → rx}/operators/map.d.ts +0 -0
- package/dist/rx/operators/map.d.ts.map +1 -0
- package/dist/{observable → rx}/operators/share.d.ts +0 -0
- package/dist/rx/operators/share.d.ts.map +1 -0
- package/dist/{observable → rx}/operators/tap.d.ts +0 -0
- package/dist/rx/operators/tap.d.ts.map +1 -0
- package/dist/{observable → rx}/types.d.ts +0 -0
- package/dist/rx/types.d.ts.map +1 -0
- package/dist/{observable/internals → rx/util}/identity.d.ts +0 -0
- package/dist/rx/util/identity.d.ts.map +1 -0
- package/dist/{observable/internals → rx/util}/observableToPromise.d.ts +0 -0
- package/dist/rx/util/observableToPromise.d.ts.map +1 -0
- package/dist/{observable/internals → rx/util}/pipe.d.ts +0 -0
- package/dist/rx/util/pipe.d.ts.map +1 -0
- package/dist/{share-4afc084f.js → share-4d79dc49.js} +0 -0
- package/dist/{share-9f12d26c.mjs → share-671b63fa.mjs} +0 -0
- package/dist/{tap-f567ea97.mjs → tap-538fa07f.mjs} +0 -0
- package/dist/{tap-aacf31bf.js → tap-799a2d33.js} +0 -0
- package/links/httpBatchLink/dist/trpc-client-links-httpBatchLink.cjs.d.ts +11 -0
- package/links/httpBatchLink/dist/trpc-client-links-httpBatchLink.cjs.js +16 -0
- package/links/httpBatchLink/index.d.ts +1 -0
- package/links/httpBatchLink/index.js +1 -0
- package/links/httpLink/dist/trpc-client-links-httpLink.cjs.d.ts +11 -0
- package/links/httpLink/dist/trpc-client-links-httpLink.cjs.js +16 -0
- package/links/httpLink/index.d.ts +1 -0
- package/links/httpLink/index.js +1 -0
- package/links/loggerLink/dist/trpc-client-links-loggerLink.cjs.d.ts +11 -0
- package/links/loggerLink/dist/trpc-client-links-loggerLink.cjs.js +16 -0
- package/links/loggerLink/index.d.ts +1 -0
- package/links/loggerLink/index.js +1 -0
- package/links/splitLink/dist/trpc-client-links-splitLink.cjs.d.ts +11 -0
- package/links/splitLink/dist/trpc-client-links-splitLink.cjs.js +16 -0
- package/links/splitLink/index.d.ts +1 -0
- package/links/splitLink/index.js +1 -0
- package/links/transformerLink/index.d.ts +1 -0
- package/links/transformerLink/index.js +1 -0
- package/links/wsLink/dist/trpc-client-links-wsLink.cjs.d.ts +11 -0
- package/links/wsLink/dist/trpc-client-links-wsLink.cjs.js +16 -0
- package/links/wsLink/index.d.ts +1 -0
- package/links/wsLink/index.js +1 -0
- package/package.json +43 -8
- package/rx/index.d.ts +1 -0
- package/rx/index.js +1 -0
- package/rx/operators/index.d.ts +1 -0
- package/rx/operators/index.js +1 -0
- package/src/index.ts +1 -1
- package/src/internals/TRPCClient.ts +10 -7
- package/src/links/dedupeLink.test.ts +1 -1
- package/src/links/dedupeLink.ts +5 -5
- package/src/links/httpBatchLink.ts +2 -6
- package/src/links/httpLink.ts +2 -2
- package/src/links/{internals/httpUtils.ts → httpUtils.ts} +1 -1
- package/src/links/internals/createChain.test.ts +5 -5
- package/src/links/internals/createChain.ts +3 -3
- package/src/links/loggerLink.ts +2 -2
- package/src/links/retryLink.ts +2 -2
- package/src/links/splitLink.test.ts +1 -1
- package/src/links/splitLink.ts +1 -1
- package/src/links/transformerLink.ts +5 -9
- package/src/links/types.ts +1 -1
- package/src/links/wsLink.ts +2 -2
- package/src/{observable → rx}/index.ts +0 -1
- package/src/{observable → rx}/observable.test.ts +1 -21
- package/src/{observable → rx}/observable.ts +1 -1
- package/src/{observable → rx}/operators/index.ts +0 -0
- package/src/{observable → rx}/operators/map.test.ts +0 -0
- package/src/{observable → rx}/operators/map.ts +0 -0
- package/src/{observable → rx}/operators/share.test.ts +0 -0
- package/src/{observable → rx}/operators/share.ts +0 -0
- package/src/{observable → rx}/operators/tap.ts +0 -0
- package/src/{observable → rx}/types.ts +0 -0
- package/src/{observable/internals → rx/util}/identity.ts +0 -0
- package/src/{observable/internals → rx/util}/observableToPromise.ts +0 -0
- package/src/{observable/internals → rx/util}/pipe.ts +0 -0
- package/dist/links/index.d.ts +0 -11
- package/dist/links/index.d.ts.map +0 -1
- package/dist/links/internals/httpUtils.d.ts.map +0 -1
- package/dist/observable/index.d.ts +0 -4
- package/dist/observable/index.d.ts.map +0 -1
- package/dist/observable/internals/identity.d.ts.map +0 -1
- package/dist/observable/internals/observableToPromise.d.ts.map +0 -1
- package/dist/observable/internals/pipe.d.ts.map +0 -1
- package/dist/observable/observable.d.ts.map +0 -1
- package/dist/observable/operators/index.d.ts.map +0 -1
- package/dist/observable/operators/map.d.ts.map +0 -1
- package/dist/observable/operators/share.d.ts.map +0 -1
- package/dist/observable/operators/tap.d.ts.map +0 -1
- package/dist/observable/types.d.ts.map +0 -1
- package/dist/splitLink-8635d455.js +0 -52
- package/dist/splitLink-a736378a.mjs +0 -49
- package/dist/wsLink-a6a0f3a8.mjs +0 -440
- package/dist/wsLink-c9323097.js +0 -455
- package/src/links/index.ts +0 -10
package/dist/links/wsLink.mjs
CHANGED
|
@@ -1,10 +1,370 @@
|
|
|
1
|
-
import '@babel/runtime/helpers/createClass';
|
|
2
|
-
import '@babel/runtime/helpers/classCallCheck';
|
|
3
|
-
import '@babel/runtime/helpers/assertThisInitialized';
|
|
4
|
-
import '@babel/runtime/helpers/inherits';
|
|
5
|
-
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
6
|
-
import '@babel/runtime/helpers/getPrototypeOf';
|
|
7
|
-
import '@babel/runtime/helpers/wrapNativeSuper';
|
|
8
|
-
|
|
9
|
-
import '../
|
|
1
|
+
import _createClass from '@babel/runtime/helpers/createClass';
|
|
2
|
+
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
3
|
+
import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized';
|
|
4
|
+
import _inherits from '@babel/runtime/helpers/inherits';
|
|
5
|
+
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
6
|
+
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
7
|
+
import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
|
|
8
|
+
import { o as observable } from '../observable-7e66cb56.mjs';
|
|
9
|
+
import { T as TRPCClientError } from '../TRPCClientError-17b117e1.mjs';
|
|
10
10
|
import '@babel/runtime/helpers/defineProperty';
|
|
11
|
+
|
|
12
|
+
/* istanbul ignore next */
|
|
13
|
+
var retryDelay = function retryDelay(attemptIndex) {
|
|
14
|
+
return attemptIndex === 0 ? 0 : Math.min(1000 * Math.pow(2, attemptIndex), 30000);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
function createWSClient(opts) {
|
|
21
|
+
var url = opts.url,
|
|
22
|
+
_opts$WebSocket = opts.WebSocket,
|
|
23
|
+
WebSocketImpl = _opts$WebSocket === void 0 ? WebSocket : _opts$WebSocket,
|
|
24
|
+
_opts$retryDelayMs = opts.retryDelayMs,
|
|
25
|
+
retryDelayFn = _opts$retryDelayMs === void 0 ? retryDelay : _opts$retryDelayMs;
|
|
26
|
+
/* istanbul ignore next */
|
|
27
|
+
|
|
28
|
+
if (!WebSocketImpl) {
|
|
29
|
+
throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* outgoing messages buffer whilst not open
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var outgoing = [];
|
|
37
|
+
/**
|
|
38
|
+
* pending outgoing requests that are awaiting callback
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
var pendingRequests = Object.create(null);
|
|
42
|
+
var connectAttempt = 0;
|
|
43
|
+
var dispatchTimer = null;
|
|
44
|
+
var connectTimer = null;
|
|
45
|
+
var activeConnection = createWS();
|
|
46
|
+
var state = 'connecting';
|
|
47
|
+
/**
|
|
48
|
+
* tries to send the list of messages
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
function dispatch() {
|
|
52
|
+
if (state !== 'open' || dispatchTimer) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dispatchTimer = setTimeout(function () {
|
|
57
|
+
dispatchTimer = null;
|
|
58
|
+
|
|
59
|
+
if (outgoing.length === 1) {
|
|
60
|
+
// single send
|
|
61
|
+
activeConnection.send(JSON.stringify(outgoing.pop()));
|
|
62
|
+
} else {
|
|
63
|
+
// batch send
|
|
64
|
+
activeConnection.send(JSON.stringify(outgoing));
|
|
65
|
+
} // clear
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
outgoing = [];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function tryReconnect() {
|
|
73
|
+
if (connectTimer || state === 'closed') {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var timeout = retryDelayFn(connectAttempt++);
|
|
78
|
+
reconnectInMs(timeout);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function reconnect() {
|
|
82
|
+
state = 'connecting';
|
|
83
|
+
var oldConnection = activeConnection;
|
|
84
|
+
activeConnection = createWS();
|
|
85
|
+
closeIfNoPending(oldConnection);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function reconnectInMs(ms) {
|
|
89
|
+
if (connectTimer) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
state = 'connecting';
|
|
94
|
+
connectTimer = setTimeout(reconnect, ms);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function closeIfNoPending(conn) {
|
|
98
|
+
// disconnect as soon as there are are no pending result
|
|
99
|
+
var hasPendingRequests = Object.values(pendingRequests).some(function (p) {
|
|
100
|
+
return p.ws === conn;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (!hasPendingRequests) {
|
|
104
|
+
conn.close();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function resumeSubscriptionOnReconnect(req) {
|
|
109
|
+
if (outgoing.some(function (r) {
|
|
110
|
+
return r.id === req.op.id;
|
|
111
|
+
})) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
request(req.op, req.callbacks);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function createWS() {
|
|
119
|
+
var conn = new WebSocket(url);
|
|
120
|
+
clearTimeout(connectTimer);
|
|
121
|
+
connectTimer = null;
|
|
122
|
+
conn.addEventListener('open', function () {
|
|
123
|
+
/* istanbul ignore next */
|
|
124
|
+
if (conn !== activeConnection) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
connectAttempt = 0;
|
|
129
|
+
state = 'open';
|
|
130
|
+
dispatch();
|
|
131
|
+
});
|
|
132
|
+
conn.addEventListener('error', function () {
|
|
133
|
+
if (conn === activeConnection) {
|
|
134
|
+
tryReconnect();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
var handleIncomingRequest = function handleIncomingRequest(req) {
|
|
139
|
+
if (req.method === 'reconnect' && conn === activeConnection) {
|
|
140
|
+
reconnect(); // notify subscribers
|
|
141
|
+
|
|
142
|
+
for (var _i = 0, _Object$values = Object.values(pendingRequests); _i < _Object$values.length; _i++) {
|
|
143
|
+
var pendingReq = _Object$values[_i];
|
|
144
|
+
|
|
145
|
+
if (pendingReq.type === 'subscription') {
|
|
146
|
+
resumeSubscriptionOnReconnect(pendingReq);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var handleIncomingResponse = function handleIncomingResponse(data) {
|
|
153
|
+
var _req$callbacks$next, _req$callbacks;
|
|
154
|
+
|
|
155
|
+
var req = data.id !== null && pendingRequests[data.id];
|
|
156
|
+
|
|
157
|
+
if (!req) {
|
|
158
|
+
// do something?
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
(_req$callbacks$next = (_req$callbacks = req.callbacks).next) === null || _req$callbacks$next === void 0 ? void 0 : _req$callbacks$next.call(_req$callbacks, {
|
|
163
|
+
data: data
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
if (req.ws !== activeConnection && conn === activeConnection) {
|
|
167
|
+
var oldWs = req.ws; // gracefully replace old connection with this
|
|
168
|
+
|
|
169
|
+
req.ws = activeConnection;
|
|
170
|
+
closeIfNoPending(oldWs);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if ('result' in data && data.result.type === 'stopped' && conn === activeConnection) {
|
|
174
|
+
req.callbacks.complete();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
conn.addEventListener('message', function (_ref) {
|
|
179
|
+
var data = _ref.data;
|
|
180
|
+
var msg = JSON.parse(data);
|
|
181
|
+
|
|
182
|
+
if ('method' in msg) {
|
|
183
|
+
handleIncomingRequest(msg);
|
|
184
|
+
} else {
|
|
185
|
+
handleIncomingResponse(msg);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (conn !== activeConnection || state === 'closed') {
|
|
189
|
+
// when receiving a message, we close old connection that has no pending requests
|
|
190
|
+
closeIfNoPending(conn);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
conn.addEventListener('close', function () {
|
|
194
|
+
if (activeConnection === conn) {
|
|
195
|
+
// connection might have been replaced already
|
|
196
|
+
tryReconnect();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
for (var key in pendingRequests) {
|
|
200
|
+
var _req$callbacks$error, _req$callbacks2;
|
|
201
|
+
|
|
202
|
+
var req = pendingRequests[key];
|
|
203
|
+
|
|
204
|
+
if (req.ws !== conn) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
(_req$callbacks$error = (_req$callbacks2 = req.callbacks).error) === null || _req$callbacks$error === void 0 ? void 0 : _req$callbacks$error.call(_req$callbacks2, TRPCClientError.from(new TRPCWebSocketClosedError('WebSocket closed prematurely')));
|
|
209
|
+
|
|
210
|
+
if (req.type !== 'subscription') {
|
|
211
|
+
var _req$callbacks$comple, _req$callbacks3;
|
|
212
|
+
|
|
213
|
+
delete pendingRequests[key];
|
|
214
|
+
(_req$callbacks$comple = (_req$callbacks3 = req.callbacks).complete) === null || _req$callbacks$comple === void 0 ? void 0 : _req$callbacks$comple.call(_req$callbacks3);
|
|
215
|
+
} else if (state !== 'closed') {
|
|
216
|
+
// request restart of sub with next connection
|
|
217
|
+
resumeSubscriptionOnReconnect(req);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
return conn;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function request(op, callbacks) {
|
|
225
|
+
var type = op.type,
|
|
226
|
+
input = op.input,
|
|
227
|
+
path = op.path,
|
|
228
|
+
id = op.id;
|
|
229
|
+
var envelope = {
|
|
230
|
+
id: id,
|
|
231
|
+
jsonrpc: '2.0',
|
|
232
|
+
method: type,
|
|
233
|
+
params: {
|
|
234
|
+
input: input,
|
|
235
|
+
path: path
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
pendingRequests[id] = {
|
|
239
|
+
ws: activeConnection,
|
|
240
|
+
type: type,
|
|
241
|
+
callbacks: callbacks,
|
|
242
|
+
op: op
|
|
243
|
+
}; // enqueue message
|
|
244
|
+
|
|
245
|
+
outgoing.push(envelope);
|
|
246
|
+
dispatch();
|
|
247
|
+
return function () {
|
|
248
|
+
var _pendingRequests$id, _callbacks$complete;
|
|
249
|
+
|
|
250
|
+
var callbacks = (_pendingRequests$id = pendingRequests[id]) === null || _pendingRequests$id === void 0 ? void 0 : _pendingRequests$id.callbacks;
|
|
251
|
+
delete pendingRequests[id];
|
|
252
|
+
outgoing = outgoing.filter(function (msg) {
|
|
253
|
+
return msg.id !== id;
|
|
254
|
+
});
|
|
255
|
+
callbacks === null || callbacks === void 0 ? void 0 : (_callbacks$complete = callbacks.complete) === null || _callbacks$complete === void 0 ? void 0 : _callbacks$complete.call(callbacks);
|
|
256
|
+
|
|
257
|
+
if (op.type === 'subscription') {
|
|
258
|
+
outgoing.push({
|
|
259
|
+
id: id,
|
|
260
|
+
method: 'subscription.stop',
|
|
261
|
+
params: undefined
|
|
262
|
+
});
|
|
263
|
+
dispatch();
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
close: function close() {
|
|
270
|
+
state = 'closed';
|
|
271
|
+
closeIfNoPending(activeConnection);
|
|
272
|
+
},
|
|
273
|
+
request: request,
|
|
274
|
+
getConnection: function getConnection() {
|
|
275
|
+
return activeConnection;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
var TRPCWebSocketClosedError = /*#__PURE__*/function (_Error) {
|
|
281
|
+
_inherits(TRPCWebSocketClosedError, _Error);
|
|
282
|
+
|
|
283
|
+
var _super = /*#__PURE__*/_createSuper(TRPCWebSocketClosedError);
|
|
284
|
+
|
|
285
|
+
function TRPCWebSocketClosedError(message) {
|
|
286
|
+
var _this;
|
|
287
|
+
|
|
288
|
+
_classCallCheck(this, TRPCWebSocketClosedError);
|
|
289
|
+
|
|
290
|
+
_this = _super.call(this, message);
|
|
291
|
+
_this.name = 'TRPCWebSocketClosedError';
|
|
292
|
+
Object.setPrototypeOf(_assertThisInitialized(_this), TRPCWebSocketClosedError.prototype);
|
|
293
|
+
return _this;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return _createClass(TRPCWebSocketClosedError);
|
|
297
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
298
|
+
|
|
299
|
+
var TRPCSubscriptionEndedError = /*#__PURE__*/function (_Error2) {
|
|
300
|
+
_inherits(TRPCSubscriptionEndedError, _Error2);
|
|
301
|
+
|
|
302
|
+
var _super2 = /*#__PURE__*/_createSuper(TRPCSubscriptionEndedError);
|
|
303
|
+
|
|
304
|
+
function TRPCSubscriptionEndedError(message) {
|
|
305
|
+
var _this2;
|
|
306
|
+
|
|
307
|
+
_classCallCheck(this, TRPCSubscriptionEndedError);
|
|
308
|
+
|
|
309
|
+
_this2 = _super2.call(this, message);
|
|
310
|
+
_this2.name = 'TRPCSubscriptionEndedError';
|
|
311
|
+
Object.setPrototypeOf(_assertThisInitialized(_this2), TRPCSubscriptionEndedError.prototype);
|
|
312
|
+
return _this2;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return _createClass(TRPCSubscriptionEndedError);
|
|
316
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
317
|
+
|
|
318
|
+
function wsLink(opts) {
|
|
319
|
+
return function () {
|
|
320
|
+
var client = opts.client;
|
|
321
|
+
return function (_ref2) {
|
|
322
|
+
var op = _ref2.op;
|
|
323
|
+
return observable(function (observer) {
|
|
324
|
+
var type = op.type,
|
|
325
|
+
input = op.input,
|
|
326
|
+
path = op.path,
|
|
327
|
+
id = op.id,
|
|
328
|
+
context = op.context;
|
|
329
|
+
var isDone = false;
|
|
330
|
+
var unsub = client.request({
|
|
331
|
+
type: type,
|
|
332
|
+
path: path,
|
|
333
|
+
input: input,
|
|
334
|
+
id: id,
|
|
335
|
+
context: context
|
|
336
|
+
}, {
|
|
337
|
+
error: function error(err) {
|
|
338
|
+
isDone = true;
|
|
339
|
+
observer.error(err);
|
|
340
|
+
unsub();
|
|
341
|
+
},
|
|
342
|
+
complete: function complete() {
|
|
343
|
+
if (!isDone) {
|
|
344
|
+
isDone = true;
|
|
345
|
+
observer.error(TRPCClientError.from(new TRPCSubscriptionEndedError('Operation ended prematurely')));
|
|
346
|
+
} else {
|
|
347
|
+
observer.complete();
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
next: function next(result) {
|
|
351
|
+
observer.next(result);
|
|
352
|
+
|
|
353
|
+
if (op.type !== 'subscription') {
|
|
354
|
+
// if it isn't a subscription we don't care about next response
|
|
355
|
+
isDone = true;
|
|
356
|
+
unsub();
|
|
357
|
+
observer.complete();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
return function () {
|
|
362
|
+
isDone = true;
|
|
363
|
+
unsub();
|
|
364
|
+
};
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export { createWSClient, wsLink };
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rx/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/dist/rx/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { o as observable } from '../observable-7e66cb56.mjs';
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observable.d.ts","sourceRoot":"","sources":["../../src/rx/observable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEhF,oBAAY,oBAAoB,CAAC,WAAW,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,IACvE,WAAW,SAAS,UAAU,CAAC,MAAM,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAErE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,EACjD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,aAAa,GAC/D,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CA6D5B"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var tap = require('../tap-aacf31bf.js');
|
|
5
|
+
var share = require('../../share-4d79dc49.js');
|
|
6
|
+
var tap = require('../../tap-799a2d33.js');
|
|
8
7
|
|
|
9
8
|
function map(project) {
|
|
10
9
|
return function (originalObserver) {
|
|
@@ -34,7 +33,6 @@ function map(project) {
|
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
exports.observable = observable.observable;
|
|
38
36
|
exports.share = share.share;
|
|
39
37
|
exports.tap = tap.tap;
|
|
40
38
|
exports.map = map;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { t as tap } from '../tap-f567ea97.mjs';
|
|
1
|
+
export { s as share } from '../../share-671b63fa.mjs';
|
|
2
|
+
export { t as tap } from '../../tap-538fa07f.mjs';
|
|
4
3
|
|
|
5
4
|
function map(project) {
|
|
6
5
|
return function (originalObserver) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,wBAAgB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EACnD,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,GAC3D,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAoB7D"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/share.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA4B,MAAM,UAAU,CAAC;AAG9E,UAAU,WAAW;CAAG;AACxB,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAElC,KAAK,CAAC,EAAE,WAAW,GAClB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CA2D1C"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tap.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/tap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9D,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC1C,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAqB1C"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rx/types.ts"],"names":[],"mappings":"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"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/rx/util/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAEnC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observableToPromise.d.ts","sourceRoot":"","sources":["../../../src/rx/util/observableToPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAK5B;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,MAAM,EACxC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC;;iBAEtB,IAAI;EAkCtB"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../../src/rx/util/pipe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAChC,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAC9B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAerB"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
+
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
+
|
|
4
|
+
// curious why you need to?
|
|
5
|
+
// this file exists so that you can import from the entrypoint normally
|
|
6
|
+
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
+
// which means we need to re-export all of the modules from your source file
|
|
8
|
+
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
+
// to check for a default export and re-export it if it exists
|
|
10
|
+
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
+
export * from "../../../src/links/httpBatchLink";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// this file might look strange and you might be wondering what it's for
|
|
3
|
+
// it's lets you import your source files by importing this entrypoint
|
|
4
|
+
// as you would import it if it was built with preconstruct build
|
|
5
|
+
// this file is slightly different to some others though
|
|
6
|
+
// it has a require hook which compiles your code with Babel
|
|
7
|
+
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
+
// but you can still require this module and it'll be compiled
|
|
9
|
+
|
|
10
|
+
// this bit of code imports the require hook and registers it
|
|
11
|
+
let unregister = require("../../../../../node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
+
|
|
13
|
+
// this re-exports the source file
|
|
14
|
+
module.exports = require("../../../src/links/httpBatchLink.ts");
|
|
15
|
+
|
|
16
|
+
unregister();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/links/httpBatchLink';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../dist/links/httpBatchLink');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
+
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
+
|
|
4
|
+
// curious why you need to?
|
|
5
|
+
// this file exists so that you can import from the entrypoint normally
|
|
6
|
+
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
+
// which means we need to re-export all of the modules from your source file
|
|
8
|
+
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
+
// to check for a default export and re-export it if it exists
|
|
10
|
+
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
+
export * from "../../../src/links/httpLink";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// this file might look strange and you might be wondering what it's for
|
|
3
|
+
// it's lets you import your source files by importing this entrypoint
|
|
4
|
+
// as you would import it if it was built with preconstruct build
|
|
5
|
+
// this file is slightly different to some others though
|
|
6
|
+
// it has a require hook which compiles your code with Babel
|
|
7
|
+
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
+
// but you can still require this module and it'll be compiled
|
|
9
|
+
|
|
10
|
+
// this bit of code imports the require hook and registers it
|
|
11
|
+
let unregister = require("../../../../../node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
+
|
|
13
|
+
// this re-exports the source file
|
|
14
|
+
module.exports = require("../../../src/links/httpLink.ts");
|
|
15
|
+
|
|
16
|
+
unregister();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/links/httpLink';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../dist/links/httpLink');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
+
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
+
|
|
4
|
+
// curious why you need to?
|
|
5
|
+
// this file exists so that you can import from the entrypoint normally
|
|
6
|
+
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
+
// which means we need to re-export all of the modules from your source file
|
|
8
|
+
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
+
// to check for a default export and re-export it if it exists
|
|
10
|
+
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
+
export * from "../../../src/links/loggerLink";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// this file might look strange and you might be wondering what it's for
|
|
3
|
+
// it's lets you import your source files by importing this entrypoint
|
|
4
|
+
// as you would import it if it was built with preconstruct build
|
|
5
|
+
// this file is slightly different to some others though
|
|
6
|
+
// it has a require hook which compiles your code with Babel
|
|
7
|
+
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
+
// but you can still require this module and it'll be compiled
|
|
9
|
+
|
|
10
|
+
// this bit of code imports the require hook and registers it
|
|
11
|
+
let unregister = require("../../../../../node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
+
|
|
13
|
+
// this re-exports the source file
|
|
14
|
+
module.exports = require("../../../src/links/loggerLink.ts");
|
|
15
|
+
|
|
16
|
+
unregister();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/links/loggerLink';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../dist/links/loggerLink');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
+
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
+
|
|
4
|
+
// curious why you need to?
|
|
5
|
+
// this file exists so that you can import from the entrypoint normally
|
|
6
|
+
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
+
// which means we need to re-export all of the modules from your source file
|
|
8
|
+
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
+
// to check for a default export and re-export it if it exists
|
|
10
|
+
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
+
export * from "../../../src/links/splitLink";
|