@trpc/client 10.0.0-alpha.13 → 10.0.0-alpha.16
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/index.js +972 -35
- package/dist/index.mjs +953 -21
- package/dist/links/wsLink.d.ts.map +1 -1
- package/dist/observable/index.js +3 -5
- package/dist/observable/index.mjs +1 -3
- package/dist/observable/{util → internals}/identity.d.ts +0 -0
- package/dist/observable/internals/identity.d.ts.map +1 -0
- package/dist/observable/{util → internals}/observableToPromise.d.ts +0 -0
- package/dist/observable/internals/observableToPromise.d.ts.map +1 -0
- package/dist/observable/{util → internals}/pipe.d.ts +0 -0
- package/dist/observable/internals/pipe.d.ts.map +1 -0
- package/dist/{share-9f12d26c.mjs → tap-4bc60fb0.mjs} +131 -1
- package/dist/{share-4afc084f.js → tap-fcd41ae6.js} +132 -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/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/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/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/wsLink/dist/trpc-client-links-wsLink.cjs.d.ts +11 -0
- package/links/wsLink/dist/trpc-client-links-wsLink.cjs.js +16 -0
- package/package.json +43 -8
- package/src/internals/TRPCClient.ts +1 -1
- package/src/links/wsLink.ts +1 -2
- package/src/observable/{util → internals}/identity.ts +0 -0
- package/src/observable/{util → internals}/observableToPromise.ts +0 -0
- package/src/observable/{util → internals}/pipe.ts +0 -0
- package/src/observable/observable.ts +1 -1
- package/dist/httpUtils-27640b42.js +0 -97
- package/dist/httpUtils-b92552af.mjs +0 -91
- package/dist/links/httpBatchLink.js +0 -195
- package/dist/links/httpBatchLink.mjs +0 -191
- package/dist/links/httpBatchLink.ts.js +0 -1
- package/dist/links/httpLink.js +0 -44
- package/dist/links/httpLink.mjs +0 -40
- package/dist/links/httpLink.ts.js +0 -1
- package/dist/links/loggerLink.js +0 -108
- package/dist/links/loggerLink.mjs +0 -99
- package/dist/links/loggerLink.ts.js +0 -1
- package/dist/links/splitLink.js +0 -10
- package/dist/links/splitLink.mjs +0 -2
- package/dist/links/splitLink.ts.js +0 -1
- package/dist/links/transformerLink.js +0 -79
- package/dist/links/transformerLink.mjs +0 -71
- package/dist/links/transformerLink.ts.js +0 -1
- package/dist/links/wsLink.js +0 -19
- package/dist/links/wsLink.mjs +0 -10
- package/dist/links/wsLink.ts.js +0 -1
- package/dist/observable/util/identity.d.ts.map +0 -1
- package/dist/observable/util/observableToPromise.d.ts.map +0 -1
- package/dist/observable/util/pipe.d.ts.map +0 -1
- package/dist/observable-16fde241.mjs +0 -102
- package/dist/observable-9aaca086.js +0 -104
- package/dist/splitLink-8635d455.js +0 -52
- package/dist/splitLink-a736378a.mjs +0 -49
- package/dist/tap-aacf31bf.js +0 -32
- package/dist/tap-f567ea97.mjs +0 -30
- package/dist/wsLink-a6a0f3a8.mjs +0 -440
- package/dist/wsLink-c9323097.js +0 -455
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsLink.d.ts","sourceRoot":"","sources":["../../src/links/wsLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAOxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"wsLink.d.ts","sourceRoot":"","sources":["../../src/links/wsLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAOxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAc,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,UAAU,CAAC;CAClC;AACD,wBAAgB,cAAc,CAAC,IAAI,EAAE,sBAAsB;;kBA8LpC,SAAS,kEAA0B,aAAa;;EAgDtE;AACD,oBAAY,mBAAmB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAEpE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAiBD,wBAAgB,MAAM,CAAC,OAAO,SAAS,SAAS,EAC9C,IAAI,EAAE,oBAAoB,GACzB,QAAQ,CAAC,OAAO,CAAC,CAkDnB"}
|
package/dist/observable/index.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var share = require('../share-4afc084f.js');
|
|
7
|
-
var tap = require('../tap-aacf31bf.js');
|
|
5
|
+
var tap = require('../tap-fcd41ae6.js');
|
|
8
6
|
|
|
9
7
|
function map(project) {
|
|
10
8
|
return function (originalObserver) {
|
|
@@ -34,7 +32,7 @@ function map(project) {
|
|
|
34
32
|
};
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
exports.observable =
|
|
38
|
-
exports.share =
|
|
35
|
+
exports.observable = tap.observable;
|
|
36
|
+
exports.share = tap.share;
|
|
39
37
|
exports.tap = tap.tap;
|
|
40
38
|
exports.map = map;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { o as observable } from '../
|
|
2
|
-
export { s as share } from '../share-9f12d26c.mjs';
|
|
3
|
-
export { t as tap } from '../tap-f567ea97.mjs';
|
|
1
|
+
export { o as observable, s as share, t as tap } from '../tap-4bc60fb0.mjs';
|
|
4
2
|
|
|
5
3
|
function map(project) {
|
|
6
4
|
return function (originalObserver) {
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/observable/internals/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/observable/internals/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/observable/internals/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"}
|
|
@@ -1,3 +1,104 @@
|
|
|
1
|
+
function identity(x) {
|
|
2
|
+
return x;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/** @internal */
|
|
6
|
+
function pipeFromArray(fns) {
|
|
7
|
+
if (fns.length === 0) {
|
|
8
|
+
return identity;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (fns.length === 1) {
|
|
12
|
+
return fns[0];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return function piped(input) {
|
|
16
|
+
return fns.reduce(function (prev, fn) {
|
|
17
|
+
return fn(prev);
|
|
18
|
+
}, input);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function observable(_subscribe) {
|
|
23
|
+
var self = {
|
|
24
|
+
subscribe: function subscribe(observer) {
|
|
25
|
+
var teardownRef = null;
|
|
26
|
+
var isDone = false;
|
|
27
|
+
var unsubscribed = false;
|
|
28
|
+
var teardownImmediately = false;
|
|
29
|
+
|
|
30
|
+
function unsubscribe() {
|
|
31
|
+
if (teardownRef === null) {
|
|
32
|
+
teardownImmediately = true;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (unsubscribed) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
unsubscribed = true;
|
|
41
|
+
|
|
42
|
+
if (typeof teardownRef === 'function') {
|
|
43
|
+
teardownRef();
|
|
44
|
+
} else if (teardownRef) {
|
|
45
|
+
teardownRef.unsubscribe();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
teardownRef = _subscribe({
|
|
50
|
+
next: function next(value) {
|
|
51
|
+
var _observer$next;
|
|
52
|
+
|
|
53
|
+
if (isDone) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, value);
|
|
58
|
+
},
|
|
59
|
+
error: function error(err) {
|
|
60
|
+
var _observer$error;
|
|
61
|
+
|
|
62
|
+
if (isDone) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
isDone = true;
|
|
67
|
+
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, err);
|
|
68
|
+
unsubscribe();
|
|
69
|
+
},
|
|
70
|
+
complete: function complete() {
|
|
71
|
+
var _observer$complete;
|
|
72
|
+
|
|
73
|
+
if (isDone) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
isDone = true;
|
|
78
|
+
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
79
|
+
unsubscribe();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (teardownImmediately) {
|
|
84
|
+
unsubscribe();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
unsubscribe: unsubscribe
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
pipe: function pipe() {
|
|
92
|
+
for (var _len = arguments.length, operations = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
93
|
+
operations[_key] = arguments[_key];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return pipeFromArray(operations)(self);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return self;
|
|
100
|
+
}
|
|
101
|
+
|
|
1
102
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
103
|
|
|
3
104
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -105,4 +206,33 @@ _opts) {
|
|
|
105
206
|
};
|
|
106
207
|
}
|
|
107
208
|
|
|
108
|
-
|
|
209
|
+
function tap(observer) {
|
|
210
|
+
return function (originalObserver) {
|
|
211
|
+
return {
|
|
212
|
+
subscribe: function subscribe(observer2) {
|
|
213
|
+
return originalObserver.subscribe({
|
|
214
|
+
next: function next(v) {
|
|
215
|
+
var _observer$next, _observer2$next;
|
|
216
|
+
|
|
217
|
+
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, v);
|
|
218
|
+
(_observer2$next = observer2.next) === null || _observer2$next === void 0 ? void 0 : _observer2$next.call(observer2, v);
|
|
219
|
+
},
|
|
220
|
+
error: function error(v) {
|
|
221
|
+
var _observer$error, _observer2$error;
|
|
222
|
+
|
|
223
|
+
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, v);
|
|
224
|
+
(_observer2$error = observer2.error) === null || _observer2$error === void 0 ? void 0 : _observer2$error.call(observer2, v);
|
|
225
|
+
},
|
|
226
|
+
complete: function complete() {
|
|
227
|
+
var _observer$complete, _observer2$complete;
|
|
228
|
+
|
|
229
|
+
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
230
|
+
(_observer2$complete = observer2.complete) === null || _observer2$complete === void 0 ? void 0 : _observer2$complete.call(observer2);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export { observable as o, share as s, tap as t };
|
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
function identity(x) {
|
|
4
|
+
return x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** @internal */
|
|
8
|
+
function pipeFromArray(fns) {
|
|
9
|
+
if (fns.length === 0) {
|
|
10
|
+
return identity;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (fns.length === 1) {
|
|
14
|
+
return fns[0];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return function piped(input) {
|
|
18
|
+
return fns.reduce(function (prev, fn) {
|
|
19
|
+
return fn(prev);
|
|
20
|
+
}, input);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function observable(_subscribe) {
|
|
25
|
+
var self = {
|
|
26
|
+
subscribe: function subscribe(observer) {
|
|
27
|
+
var teardownRef = null;
|
|
28
|
+
var isDone = false;
|
|
29
|
+
var unsubscribed = false;
|
|
30
|
+
var teardownImmediately = false;
|
|
31
|
+
|
|
32
|
+
function unsubscribe() {
|
|
33
|
+
if (teardownRef === null) {
|
|
34
|
+
teardownImmediately = true;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (unsubscribed) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
unsubscribed = true;
|
|
43
|
+
|
|
44
|
+
if (typeof teardownRef === 'function') {
|
|
45
|
+
teardownRef();
|
|
46
|
+
} else if (teardownRef) {
|
|
47
|
+
teardownRef.unsubscribe();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
teardownRef = _subscribe({
|
|
52
|
+
next: function next(value) {
|
|
53
|
+
var _observer$next;
|
|
54
|
+
|
|
55
|
+
if (isDone) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, value);
|
|
60
|
+
},
|
|
61
|
+
error: function error(err) {
|
|
62
|
+
var _observer$error;
|
|
63
|
+
|
|
64
|
+
if (isDone) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
isDone = true;
|
|
69
|
+
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, err);
|
|
70
|
+
unsubscribe();
|
|
71
|
+
},
|
|
72
|
+
complete: function complete() {
|
|
73
|
+
var _observer$complete;
|
|
74
|
+
|
|
75
|
+
if (isDone) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
isDone = true;
|
|
80
|
+
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
81
|
+
unsubscribe();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
if (teardownImmediately) {
|
|
86
|
+
unsubscribe();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
unsubscribe: unsubscribe
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
pipe: function pipe() {
|
|
94
|
+
for (var _len = arguments.length, operations = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
95
|
+
operations[_key] = arguments[_key];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return pipeFromArray(operations)(self);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return self;
|
|
102
|
+
}
|
|
103
|
+
|
|
3
104
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
105
|
|
|
5
106
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -107,4 +208,35 @@ _opts) {
|
|
|
107
208
|
};
|
|
108
209
|
}
|
|
109
210
|
|
|
211
|
+
function tap(observer) {
|
|
212
|
+
return function (originalObserver) {
|
|
213
|
+
return {
|
|
214
|
+
subscribe: function subscribe(observer2) {
|
|
215
|
+
return originalObserver.subscribe({
|
|
216
|
+
next: function next(v) {
|
|
217
|
+
var _observer$next, _observer2$next;
|
|
218
|
+
|
|
219
|
+
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, v);
|
|
220
|
+
(_observer2$next = observer2.next) === null || _observer2$next === void 0 ? void 0 : _observer2$next.call(observer2, v);
|
|
221
|
+
},
|
|
222
|
+
error: function error(v) {
|
|
223
|
+
var _observer$error, _observer2$error;
|
|
224
|
+
|
|
225
|
+
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, v);
|
|
226
|
+
(_observer2$error = observer2.error) === null || _observer2$error === void 0 ? void 0 : _observer2$error.call(observer2, v);
|
|
227
|
+
},
|
|
228
|
+
complete: function complete() {
|
|
229
|
+
var _observer$complete, _observer2$complete;
|
|
230
|
+
|
|
231
|
+
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
232
|
+
(_observer2$complete = observer2.complete) === null || _observer2$complete === void 0 ? void 0 : _observer2$complete.call(observer2);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
exports.observable = observable;
|
|
110
241
|
exports.share = share;
|
|
242
|
+
exports.tap = tap;
|
|
@@ -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,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,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,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";
|
|
@@ -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/splitLink.ts");
|
|
15
|
+
|
|
16
|
+
unregister();
|
|
@@ -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/wsLink";
|
|
@@ -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/wsLink.ts");
|
|
15
|
+
|
|
16
|
+
unregister();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/client",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.16",
|
|
4
4
|
"description": "tRPC Client lib",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,10 +19,45 @@
|
|
|
19
19
|
"require": "./dist/index.js",
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
-
"./
|
|
23
|
-
"import": "./dist/
|
|
24
|
-
"require": "./dist/
|
|
25
|
-
"default": "./dist/
|
|
22
|
+
"./links/httpBatchLink": {
|
|
23
|
+
"import": "./dist/links/httpBatchLink.mjs",
|
|
24
|
+
"require": "./dist/links/httpBatchLink.js",
|
|
25
|
+
"default": "./dist/links/httpBatchLink.js"
|
|
26
|
+
},
|
|
27
|
+
"./links/httpLink": {
|
|
28
|
+
"import": "./dist/links/httpLink.mjs",
|
|
29
|
+
"require": "./dist/links/httpLink.js",
|
|
30
|
+
"default": "./dist/links/httpLink.js"
|
|
31
|
+
},
|
|
32
|
+
"./links/loggerLink": {
|
|
33
|
+
"import": "./dist/links/loggerLink.mjs",
|
|
34
|
+
"require": "./dist/links/loggerLink.js",
|
|
35
|
+
"default": "./dist/links/loggerLink.js"
|
|
36
|
+
},
|
|
37
|
+
"./links/splitLink": {
|
|
38
|
+
"import": "./dist/links/splitLink.mjs",
|
|
39
|
+
"require": "./dist/links/splitLink.js",
|
|
40
|
+
"default": "./dist/links/splitLink.js"
|
|
41
|
+
},
|
|
42
|
+
"./links/transformerLink": {
|
|
43
|
+
"import": "./dist/links/transformerLink.mjs",
|
|
44
|
+
"require": "./dist/links/transformerLink.js",
|
|
45
|
+
"default": "./dist/links/transformerLink.js"
|
|
46
|
+
},
|
|
47
|
+
"./links/wsLink": {
|
|
48
|
+
"import": "./dist/links/wsLink.mjs",
|
|
49
|
+
"require": "./dist/links/wsLink.js",
|
|
50
|
+
"default": "./dist/links/wsLink.js"
|
|
51
|
+
},
|
|
52
|
+
"./rx": {
|
|
53
|
+
"import": "./dist/rx/index.mjs",
|
|
54
|
+
"require": "./dist/rx/index.js",
|
|
55
|
+
"default": "./dist/rx/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./rx/operators": {
|
|
58
|
+
"import": "./dist/rx/operators/index.mjs",
|
|
59
|
+
"require": "./dist/rx/operators/index.js",
|
|
60
|
+
"default": "./dist/rx/operators/index.js"
|
|
26
61
|
}
|
|
27
62
|
},
|
|
28
63
|
"files": [
|
|
@@ -39,13 +74,13 @@
|
|
|
39
74
|
"@babel/runtime": "^7.9.0"
|
|
40
75
|
},
|
|
41
76
|
"peerDependencies": {
|
|
42
|
-
"@trpc/server": "10.0.0-alpha.
|
|
77
|
+
"@trpc/server": "10.0.0-alpha.16"
|
|
43
78
|
},
|
|
44
79
|
"devDependencies": {
|
|
45
|
-
"@trpc/server": "10.0.0-alpha.
|
|
80
|
+
"@trpc/server": "10.0.0-alpha.16"
|
|
46
81
|
},
|
|
47
82
|
"publishConfig": {
|
|
48
83
|
"access": "public"
|
|
49
84
|
},
|
|
50
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "08a4af55145d079964f6698130223ebe9b9bed6b"
|
|
51
86
|
}
|
|
@@ -22,7 +22,7 @@ import { Unsubscribable } from '../observable';
|
|
|
22
22
|
import { inferObservableValue } from '../observable/observable';
|
|
23
23
|
import { share } from '../observable/operators';
|
|
24
24
|
import { Observer } from '../observable/types';
|
|
25
|
-
import { observableToPromise } from '../observable/
|
|
25
|
+
import { observableToPromise } from '../observable/internals/observableToPromise';
|
|
26
26
|
import { TRPCClientError } from '../TRPCClientError';
|
|
27
27
|
import { getAbortController } from './fetchHelpers';
|
|
28
28
|
|
package/src/links/wsLink.ts
CHANGED
|
@@ -6,8 +6,7 @@ import {
|
|
|
6
6
|
TRPCResponse,
|
|
7
7
|
} from '@trpc/server/rpc';
|
|
8
8
|
import { retryDelay } from '../internals/retryDelay';
|
|
9
|
-
import { UnsubscribeFn } from '../observable';
|
|
10
|
-
import { observable } from '../observable/observable';
|
|
9
|
+
import { observable, UnsubscribeFn } from '../observable';
|
|
11
10
|
import { TRPCClientError } from '../TRPCClientError';
|
|
12
11
|
import { Operation, OperationResultObserver, TRPCLink } from './types';
|
|
13
12
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|