@trpc/client
Advanced tools
Comparing version 11.0.0-alpha-tmp-02-12-response-types-idea.837 to 11.0.0-alpha-tmp-02-12-response-types-idea.838
{ | ||
"bundleSize": 66911, | ||
"bundleOrigSize": 84076, | ||
"bundleReduction": 20.42, | ||
"bundleSize": 76292, | ||
"bundleOrigSize": 95275, | ||
"bundleReduction": 19.92, | ||
"modules": [ | ||
{ | ||
"id": "/src/links/wsLink.ts", | ||
"size": 18016, | ||
"origSize": 20084, | ||
"id": "/src/links/wsLink/wsClient/wsClient.ts", | ||
"size": 12353, | ||
"origSize": 12459, | ||
"renderedExports": [ | ||
"createWSClient", | ||
"wsLink" | ||
"WsClient" | ||
], | ||
"removedExports": [], | ||
"dependents": [], | ||
"percent": 26.93, | ||
"reduction": 10.3 | ||
"dependents": [ | ||
"/src/links/wsLink/createWsClient.ts" | ||
], | ||
"percent": 16.19, | ||
"reduction": 0.85 | ||
}, | ||
@@ -28,3 +29,3 @@ { | ||
"dependents": [], | ||
"percent": 11.91, | ||
"percent": 10.45, | ||
"reduction": 0 | ||
@@ -41,6 +42,21 @@ }, | ||
"dependents": [], | ||
"percent": 8.99, | ||
"percent": 7.89, | ||
"reduction": 4.66 | ||
}, | ||
{ | ||
"id": "/src/links/wsLink/wsClient/wsConnection.ts", | ||
"size": 5861, | ||
"origSize": 6205, | ||
"renderedExports": [ | ||
"WsConnection", | ||
"backwardCompatibility" | ||
], | ||
"removedExports": [], | ||
"dependents": [ | ||
"/src/links/wsLink/wsClient/wsClient.ts" | ||
], | ||
"percent": 7.68, | ||
"reduction": 5.54 | ||
}, | ||
{ | ||
"id": "/src/links/loggerLink.ts", | ||
@@ -54,6 +70,20 @@ "size": 5596, | ||
"dependents": [], | ||
"percent": 8.36, | ||
"percent": 7.33, | ||
"reduction": 19.44 | ||
}, | ||
{ | ||
"id": "/src/links/wsLink/wsClient/requestManager.ts", | ||
"size": 4792, | ||
"origSize": 5216, | ||
"renderedExports": [ | ||
"RequestManager" | ||
], | ||
"removedExports": [], | ||
"dependents": [ | ||
"/src/links/wsLink/wsClient/wsClient.ts" | ||
], | ||
"percent": 6.28, | ||
"reduction": 8.13 | ||
}, | ||
{ | ||
"id": "/src/links/httpBatchLink.ts", | ||
@@ -67,3 +97,3 @@ "size": 4097, | ||
"dependents": [], | ||
"percent": 6.12, | ||
"percent": 5.37, | ||
"reduction": 4.94 | ||
@@ -83,3 +113,3 @@ }, | ||
], | ||
"percent": 6.1, | ||
"percent": 5.35, | ||
"reduction": 5.64 | ||
@@ -107,3 +137,3 @@ }, | ||
], | ||
"percent": 5.74, | ||
"percent": 5.03, | ||
"reduction": 37.73 | ||
@@ -113,4 +143,4 @@ }, | ||
"id": "/src/links/httpLink.ts", | ||
"size": 3562, | ||
"origSize": 3993, | ||
"size": 3675, | ||
"origSize": 4051, | ||
"renderedExports": [ | ||
@@ -121,4 +151,4 @@ "httpLink" | ||
"dependents": [], | ||
"percent": 5.32, | ||
"reduction": 10.79 | ||
"percent": 4.82, | ||
"reduction": 9.28 | ||
}, | ||
@@ -137,3 +167,3 @@ { | ||
], | ||
"percent": 4.72, | ||
"percent": 4.14, | ||
"reduction": 31.02 | ||
@@ -153,11 +183,31 @@ }, | ||
"/src/links/httpLink.ts", | ||
"/src/links/wsLink.ts", | ||
"/src/links/httpBatchStreamLink.ts", | ||
"/src/links/httpSubscriptionLink.ts", | ||
"/src/internals/TRPCUntypedClient.ts" | ||
"/src/internals/TRPCUntypedClient.ts", | ||
"/src/links/wsLink/wsClient/wsClient.ts" | ||
], | ||
"percent": 4.17, | ||
"percent": 3.65, | ||
"reduction": 21.8 | ||
}, | ||
{ | ||
"id": "/src/links/wsLink/wsClient/utils.ts", | ||
"size": 2781, | ||
"origSize": 2794, | ||
"renderedExports": [ | ||
"TRPCWebSocketClosedError", | ||
"ResettableTimeout", | ||
"withResolvers", | ||
"prepareUrl", | ||
"buildConnectionMessage" | ||
], | ||
"removedExports": [], | ||
"dependents": [ | ||
"/src/links/wsLink/wsClient/wsClient.ts", | ||
"/src/links/wsLink/wsClient/requestManager.ts", | ||
"/src/links/wsLink/wsClient/wsConnection.ts" | ||
], | ||
"percent": 3.65, | ||
"reduction": 0.47 | ||
}, | ||
{ | ||
"id": "/src/links/retryLink.ts", | ||
@@ -171,3 +221,3 @@ "size": 2194, | ||
"dependents": [], | ||
"percent": 3.28, | ||
"percent": 2.88, | ||
"reduction": 18.8 | ||
@@ -189,3 +239,3 @@ }, | ||
], | ||
"percent": 1.78, | ||
"percent": 1.56, | ||
"reduction": 3.88 | ||
@@ -207,6 +257,19 @@ }, | ||
], | ||
"percent": 1.77, | ||
"percent": 1.55, | ||
"reduction": 74.76 | ||
}, | ||
{ | ||
"id": "/src/links/wsLink/wsLink.ts", | ||
"size": 939, | ||
"origSize": 1600, | ||
"renderedExports": [ | ||
"wsLink", | ||
"createWSClient" | ||
], | ||
"removedExports": [], | ||
"dependents": [], | ||
"percent": 1.23, | ||
"reduction": 41.31 | ||
}, | ||
{ | ||
"id": "/src/links/internals/createChain.ts", | ||
@@ -223,3 +286,3 @@ "size": 690, | ||
], | ||
"percent": 1.03, | ||
"percent": 0.9, | ||
"reduction": 32.75 | ||
@@ -236,3 +299,3 @@ }, | ||
"dependents": [], | ||
"percent": 0.91, | ||
"percent": 0.8, | ||
"reduction": 44.95 | ||
@@ -251,6 +314,22 @@ }, | ||
], | ||
"percent": 0.84, | ||
"percent": 0.74, | ||
"reduction": 66.71 | ||
}, | ||
{ | ||
"id": "/src/links/wsLink/wsClient/options.ts", | ||
"size": 485, | ||
"origSize": 2636, | ||
"renderedExports": [ | ||
"lazyDefaults", | ||
"keepAliveDefaults", | ||
"exponentialBackoff" | ||
], | ||
"removedExports": [], | ||
"dependents": [ | ||
"/src/links/wsLink/wsClient/wsClient.ts" | ||
], | ||
"percent": 0.64, | ||
"reduction": 81.6 | ||
}, | ||
{ | ||
"id": "/src/getFetch.ts", | ||
@@ -267,3 +346,3 @@ "size": 428, | ||
], | ||
"percent": 0.64, | ||
"percent": 0.56, | ||
"reduction": 33.54 | ||
@@ -282,3 +361,3 @@ }, | ||
"dependents": [], | ||
"percent": 0.49, | ||
"percent": 0.43, | ||
"reduction": 15.17 | ||
@@ -298,3 +377,3 @@ }, | ||
], | ||
"percent": 0.38, | ||
"percent": 0.33, | ||
"reduction": 6.96 | ||
@@ -311,6 +390,6 @@ }, | ||
"dependents": [ | ||
"/src/links/wsLink.ts", | ||
"/src/links/httpSubscriptionLink.ts" | ||
"/src/links/httpSubscriptionLink.ts", | ||
"/src/links/wsLink/wsClient/utils.ts" | ||
], | ||
"percent": 0.36, | ||
"percent": 0.31, | ||
"reduction": 76.38 | ||
@@ -329,18 +408,18 @@ }, | ||
], | ||
"percent": 0.15, | ||
"percent": 0.13, | ||
"reduction": 82.58 | ||
}, | ||
{ | ||
"id": "/src/unstable-internals.ts", | ||
"size": 0, | ||
"origSize": 90, | ||
"renderedExports": [], | ||
"id": "/src/links/wsLink/createWsClient.ts", | ||
"size": 73, | ||
"origSize": 315, | ||
"renderedExports": [ | ||
"createWSClient" | ||
], | ||
"removedExports": [], | ||
"dependents": [ | ||
"/src/links/wsLink.ts", | ||
"/src/links/httpSubscriptionLink.ts", | ||
"/src/links/internals/httpUtils.ts" | ||
"/src/links/wsLink/wsLink.ts" | ||
], | ||
"percent": 0, | ||
"reduction": 100 | ||
"percent": 0.1, | ||
"reduction": 76.83 | ||
}, | ||
@@ -356,5 +435,19 @@ { | ||
"reduction": 100 | ||
}, | ||
{ | ||
"id": "/src/unstable-internals.ts", | ||
"size": 0, | ||
"origSize": 90, | ||
"renderedExports": [], | ||
"removedExports": [], | ||
"dependents": [ | ||
"/src/links/wsLink/wsLink.ts", | ||
"/src/links/httpSubscriptionLink.ts", | ||
"/src/links/internals/httpUtils.ts" | ||
], | ||
"percent": 0, | ||
"reduction": 100 | ||
} | ||
], | ||
"moduleCount": 23 | ||
"moduleCount": 29 | ||
} |
@@ -13,6 +13,7 @@ 'use strict'; | ||
var splitLink = require('./links/splitLink.js'); | ||
var wsLink = require('./links/wsLink.js'); | ||
var wsLink = require('./links/wsLink/wsLink.js'); | ||
var httpSubscriptionLink = require('./links/httpSubscriptionLink.js'); | ||
var retryLink = require('./links/retryLink.js'); | ||
var TRPCUntypedClient = require('./internals/TRPCUntypedClient.js'); | ||
var createWsClient = require('./links/wsLink/createWsClient.js'); | ||
@@ -37,3 +38,2 @@ | ||
exports.splitLink = splitLink.splitLink; | ||
exports.createWSClient = wsLink.createWSClient; | ||
exports.wsLink = wsLink.wsLink; | ||
@@ -43,1 +43,2 @@ exports.unstable_httpSubscriptionLink = httpSubscriptionLink.unstable_httpSubscriptionLink; | ||
exports.TRPCUntypedClient = TRPCUntypedClient.TRPCUntypedClient; | ||
exports.createWSClient = createWsClient.createWSClient; |
@@ -8,5 +8,5 @@ export * from './links/types'; | ||
export * from './links/splitLink'; | ||
export * from './links/wsLink'; | ||
export * from './links/wsLink/wsLink'; | ||
export * from './links/httpSubscriptionLink'; | ||
export * from './links/retryLink'; | ||
//# sourceMappingURL=links.d.ts.map |
@@ -10,25 +10,27 @@ 'use strict'; | ||
const universalRequester = (opts)=>{ | ||
const input = httpUtils.getInput(opts); | ||
if (contentTypes.isFormData(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('FormData is only supported for mutations'); | ||
if ('input' in opts) { | ||
const { input } = opts; | ||
if (contentTypes.isFormData(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('FormData is only supported for mutations'); | ||
} | ||
return httpUtils.httpRequest({ | ||
...opts, | ||
// The browser will set this automatically and include the boundary= in it | ||
contentTypeHeader: undefined, | ||
getUrl: httpUtils.getUrl, | ||
getBody: ()=>input | ||
}); | ||
} | ||
return httpUtils.httpRequest({ | ||
...opts, | ||
// The browser will set this automatically and include the boundary= in it | ||
contentTypeHeader: undefined, | ||
getUrl: httpUtils.getUrl, | ||
getBody: ()=>input | ||
}); | ||
} | ||
if (contentTypes.isOctetType(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('Octet type input is only supported for mutations'); | ||
if (contentTypes.isOctetType(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('Octet type input is only supported for mutations'); | ||
} | ||
return httpUtils.httpRequest({ | ||
...opts, | ||
contentTypeHeader: 'application/octet-stream', | ||
getUrl: httpUtils.getUrl, | ||
getBody: ()=>input | ||
}); | ||
} | ||
return httpUtils.httpRequest({ | ||
...opts, | ||
contentTypeHeader: 'application/octet-stream', | ||
getUrl: httpUtils.getUrl, | ||
getBody: ()=>input | ||
}); | ||
} | ||
@@ -35,0 +37,0 @@ return httpUtils.jsonHttpRequester(opts); |
{ | ||
"name": "@trpc/client", | ||
"version": "11.0.0-alpha-tmp-02-12-response-types-idea.837+1ac5d03ce", | ||
"version": "11.0.0-alpha-tmp-02-12-response-types-idea.838+5e23cdfc1", | ||
"description": "The tRPC client library", | ||
@@ -58,6 +58,6 @@ "author": "KATT", | ||
}, | ||
"./links/wsLink": { | ||
"import": "./dist/links/wsLink.mjs", | ||
"require": "./dist/links/wsLink.js", | ||
"default": "./dist/links/wsLink.js" | ||
"./links/wsLink/wsLink": { | ||
"import": "./dist/links/wsLink/wsLink.mjs", | ||
"require": "./dist/links/wsLink/wsLink.js", | ||
"default": "./dist/links/wsLink/wsLink.js" | ||
}, | ||
@@ -81,7 +81,7 @@ "./unstable-internals": { | ||
"peerDependencies": { | ||
"@trpc/server": "11.0.0-alpha-tmp-02-12-response-types-idea.837+1ac5d03ce", | ||
"@trpc/server": "11.0.0-alpha-tmp-02-12-response-types-idea.838+5e23cdfc1", | ||
"typescript": ">=5.7.2" | ||
}, | ||
"devDependencies": { | ||
"@trpc/server": "11.0.0-alpha-tmp-02-12-response-types-idea.837+1ac5d03ce", | ||
"@trpc/server": "11.0.0-alpha-tmp-02-12-response-types-idea.838+5e23cdfc1", | ||
"@types/isomorphic-fetch": "^0.0.39", | ||
@@ -104,3 +104,3 @@ "@types/node": "^22.9.0", | ||
], | ||
"gitHead": "1ac5d03ced61c0dd7e3464ac2bc64529d11c71a6" | ||
"gitHead": "5e23cdfc1215dd81e03b2e032bebb4309b68819a" | ||
} |
@@ -9,3 +9,3 @@ export * from './links/types'; | ||
export * from './links/splitLink'; | ||
export * from './links/wsLink'; | ||
export * from './links/wsLink/wsLink'; | ||
export * from './links/httpSubscriptionLink'; | ||
@@ -12,0 +12,0 @@ export * from './links/retryLink'; |
@@ -14,3 +14,2 @@ import { observable } from '@trpc/server/observable'; | ||
import { | ||
getInput, | ||
getUrl, | ||
@@ -41,29 +40,30 @@ httpRequest, | ||
const universalRequester: Requester = (opts) => { | ||
const input = getInput(opts); | ||
if ('input' in opts) { | ||
const { input } = opts; | ||
if (isFormData(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('FormData is only supported for mutations'); | ||
} | ||
if (isFormData(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('FormData is only supported for mutations'); | ||
return httpRequest({ | ||
...opts, | ||
// The browser will set this automatically and include the boundary= in it | ||
contentTypeHeader: undefined, | ||
getUrl, | ||
getBody: () => input, | ||
}); | ||
} | ||
return httpRequest({ | ||
...opts, | ||
// The browser will set this automatically and include the boundary= in it | ||
contentTypeHeader: undefined, | ||
getUrl, | ||
getBody: () => input, | ||
}); | ||
} | ||
if (isOctetType(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('Octet type input is only supported for mutations'); | ||
} | ||
if (isOctetType(input)) { | ||
if (opts.type !== 'mutation' && opts.methodOverride !== 'POST') { | ||
throw new Error('Octet type input is only supported for mutations'); | ||
return httpRequest({ | ||
...opts, | ||
contentTypeHeader: 'application/octet-stream', | ||
getUrl, | ||
getBody: () => input, | ||
}); | ||
} | ||
return httpRequest({ | ||
...opts, | ||
contentTypeHeader: 'application/octet-stream', | ||
getUrl, | ||
getBody: () => input, | ||
}); | ||
} | ||
@@ -70,0 +70,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
360266
179
9356