@trpc/client 10.0.0-alpha.22 → 10.0.0-alpha.25

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.
@@ -1,6 +1,5 @@
1
1
  import type { AnyRouter } from '@trpc/server';
2
2
  import { TRPCClient as Client, CreateTRPCClientOptions } from './internals/TRPCClient';
3
3
  export declare function createTRPCClient<TRouter extends AnyRouter>(opts: CreateTRPCClientOptions<TRouter>): Client<TRouter>;
4
- export declare type TRPCClient<TRouter extends AnyRouter> = Client<TRouter>;
5
- export type { TRPCRequestOptions, CreateTRPCClientOptions, } from './internals/TRPCClient';
4
+ export type { TRPCRequestOptions, CreateTRPCClientOptions, TRPCClient, } from './internals/TRPCClient';
6
5
  //# sourceMappingURL=createTRPCClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTRPCClient.d.ts","sourceRoot":"","sources":["../src/createTRPCClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,UAAU,IAAI,MAAM,EACpB,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,IAAI,EAAE,uBAAuB,CAAC,OAAO,CAAC,mBAGvC;AAED,oBAAY,UAAU,CAAC,OAAO,SAAS,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AAEpE,YAAY,EACV,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"createTRPCClient.d.ts","sourceRoot":"","sources":["../src/createTRPCClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,UAAU,IAAI,MAAM,EACpB,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,IAAI,EAAE,uBAAuB,CAAC,OAAO,CAAC,mBAGvC;AAED,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,GACX,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -1069,6 +1069,8 @@ function createWSClient(opts) {
1069
1069
  close: function close() {
1070
1070
  state = 'closed';
1071
1071
  closeIfNoPending(activeConnection);
1072
+ clearTimeout(connectTimer);
1073
+ connectTimer = null;
1072
1074
  },
1073
1075
  request: request,
1074
1076
  getConnection: function getConnection() {
@@ -1334,26 +1336,34 @@ var TRPCClient = /*#__PURE__*/function () {
1334
1336
  }, {
1335
1337
  key: "query",
1336
1338
  value: function query(path) {
1337
- var _ref2;
1339
+ var _args$;
1338
1340
 
1339
- var context = (_ref2 = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref2 === void 0 ? void 0 : _ref2.context;
1341
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1342
+ args[_key - 1] = arguments[_key];
1343
+ }
1344
+
1345
+ var context = (_args$ = args[1]) === null || _args$ === void 0 ? void 0 : _args$.context;
1340
1346
  return this.requestAsPromise({
1341
1347
  type: 'query',
1342
1348
  path: path,
1343
- input: arguments.length <= 1 ? undefined : arguments[1],
1349
+ input: args[0],
1344
1350
  context: context
1345
1351
  });
1346
1352
  }
1347
1353
  }, {
1348
1354
  key: "mutation",
1349
1355
  value: function mutation(path) {
1350
- var _ref3;
1356
+ var _args$2;
1357
+
1358
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1359
+ args[_key2 - 1] = arguments[_key2];
1360
+ }
1351
1361
 
1352
- var context = (_ref3 = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref3 === void 0 ? void 0 : _ref3.context;
1362
+ var context = (_args$2 = args[1]) === null || _args$2 === void 0 ? void 0 : _args$2.context;
1353
1363
  return this.requestAsPromise({
1354
1364
  type: 'mutation',
1355
1365
  path: path,
1356
- input: arguments.length <= 1 ? undefined : arguments[1],
1366
+ input: args[0],
1357
1367
  context: context
1358
1368
  });
1359
1369
  }
package/dist/index.mjs CHANGED
@@ -1053,6 +1053,8 @@ function createWSClient(opts) {
1053
1053
  close: function close() {
1054
1054
  state = 'closed';
1055
1055
  closeIfNoPending(activeConnection);
1056
+ clearTimeout(connectTimer);
1057
+ connectTimer = null;
1056
1058
  },
1057
1059
  request: request,
1058
1060
  getConnection: function getConnection() {
@@ -1318,26 +1320,34 @@ var TRPCClient = /*#__PURE__*/function () {
1318
1320
  }, {
1319
1321
  key: "query",
1320
1322
  value: function query(path) {
1321
- var _ref2;
1323
+ var _args$;
1322
1324
 
1323
- var context = (_ref2 = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref2 === void 0 ? void 0 : _ref2.context;
1325
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1326
+ args[_key - 1] = arguments[_key];
1327
+ }
1328
+
1329
+ var context = (_args$ = args[1]) === null || _args$ === void 0 ? void 0 : _args$.context;
1324
1330
  return this.requestAsPromise({
1325
1331
  type: 'query',
1326
1332
  path: path,
1327
- input: arguments.length <= 1 ? undefined : arguments[1],
1333
+ input: args[0],
1328
1334
  context: context
1329
1335
  });
1330
1336
  }
1331
1337
  }, {
1332
1338
  key: "mutation",
1333
1339
  value: function mutation(path) {
1334
- var _ref3;
1340
+ var _args$2;
1341
+
1342
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1343
+ args[_key2 - 1] = arguments[_key2];
1344
+ }
1335
1345
 
1336
- var context = (_ref3 = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref3 === void 0 ? void 0 : _ref3.context;
1346
+ var context = (_args$2 = args[1]) === null || _args$2 === void 0 ? void 0 : _args$2.context;
1337
1347
  return this.requestAsPromise({
1338
1348
  type: 'mutation',
1339
1349
  path: path,
1340
- input: arguments.length <= 1 ? undefined : arguments[1],
1350
+ input: args[0],
1341
1351
  context: context
1342
1352
  });
1343
1353
  }
@@ -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;AACxD,OAAO,EAAE,aAAa,EAAc,MAAM,yBAAyB,CAAC;AASpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,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;;EA8CtE;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,CAoDnB"}
1
+ {"version":3,"file":"wsLink.d.ts","sourceRoot":"","sources":["../../src/links/wsLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,aAAa,EAAc,MAAM,yBAAyB,CAAC;AASpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,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,CAoDnB"}
@@ -275,6 +275,8 @@ function createWSClient(opts) {
275
275
  close: function close() {
276
276
  state = 'closed';
277
277
  closeIfNoPending(activeConnection);
278
+ clearTimeout(connectTimer);
279
+ connectTimer = null;
278
280
  },
279
281
  request: request,
280
282
  getConnection: function getConnection() {
@@ -275,6 +275,8 @@ function createWSClient(opts) {
275
275
  close: function close() {
276
276
  state = 'closed';
277
277
  closeIfNoPending(activeConnection);
278
+ clearTimeout(connectTimer);
279
+ connectTimer = null;
278
280
  },
279
281
  request: request,
280
282
  getConnection: function getConnection() {
@@ -271,6 +271,8 @@ function createWSClient(opts) {
271
271
  close: function close() {
272
272
  state = 'closed';
273
273
  closeIfNoPending(activeConnection);
274
+ clearTimeout(connectTimer);
275
+ connectTimer = null;
274
276
  },
275
277
  request: request,
276
278
  getConnection: function getConnection() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/client",
3
- "version": "10.0.0-alpha.22",
3
+ "version": "10.0.0-alpha.25",
4
4
  "description": "tRPC Client lib",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -41,13 +41,13 @@
41
41
  "@babel/runtime": "^7.9.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@trpc/server": "10.0.0-alpha.22"
44
+ "@trpc/server": "10.0.0-alpha.25"
45
45
  },
46
46
  "devDependencies": {
47
- "@trpc/server": "10.0.0-alpha.22"
47
+ "@trpc/server": "10.0.0-alpha.25"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "d720eb2215f0fad6e70f4172a1bf084225d4d6de"
52
+ "gitHead": "7f35cc8aaf813e5f83fe3d7b8f4bfd851779aa99"
53
53
  }
@@ -11,9 +11,8 @@ export function createTRPCClient<TRouter extends AnyRouter>(
11
11
  return new Client<TRouter>(opts);
12
12
  }
13
13
 
14
- export type TRPCClient<TRouter extends AnyRouter> = Client<TRouter>;
15
-
16
14
  export type {
17
15
  TRPCRequestOptions,
18
16
  CreateTRPCClientOptions,
17
+ TRPCClient,
19
18
  } from './internals/TRPCClient';
@@ -246,6 +246,8 @@ export function createWSClient(opts: WebSocketClientOptions) {
246
246
  close: () => {
247
247
  state = 'closed';
248
248
  closeIfNoPending(activeConnection);
249
+ clearTimeout(connectTimer as any);
250
+ connectTimer = null;
249
251
  },
250
252
  request,
251
253
  getConnection() {