@trpc/server 11.0.0-alpha-tmp-export-from-main.218 → 11.0.0-alpha-tmp-export-from-main-nuke-core.239
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/@trpc/server/http.d.ts +7 -0
- package/dist/@trpc/server/http.d.ts.map +1 -0
- package/dist/@trpc/server/index.d.ts +69 -0
- package/dist/@trpc/server/index.d.ts.map +1 -0
- package/dist/@trpc/server/rpc.d.ts +3 -0
- package/dist/@trpc/server/rpc.d.ts.map +1 -0
- package/dist/adapters/aws-lambda/index.d.ts +1 -2
- package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/index.js +6 -4
- package/dist/adapters/aws-lambda/index.mjs +4 -2
- package/dist/adapters/aws-lambda/utils.d.ts +2 -3
- package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/utils.js +5 -4
- package/dist/adapters/aws-lambda/utils.mjs +3 -2
- package/dist/adapters/express.d.ts +1 -2
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +2 -2
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.js +6 -3
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +4 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -2
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -1
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -2
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/fetchRequestHandler.js +6 -4
- package/dist/adapters/fetch/fetchRequestHandler.mjs +4 -2
- package/dist/adapters/fetch/types.d.ts +2 -3
- package/dist/adapters/fetch/types.d.ts.map +1 -1
- package/dist/adapters/next.d.ts +1 -3
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/next.js +6 -4
- package/dist/adapters/next.mjs +4 -2
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.js +4 -2
- package/dist/adapters/node-http/content-type/json/getPostBody.mjs +3 -1
- package/dist/adapters/node-http/content-type/json/index.js +4 -2
- package/dist/adapters/node-http/content-type/json/index.mjs +3 -1
- package/dist/adapters/node-http/internals/contentType.d.ts +2 -2
- package/dist/adapters/node-http/internals/contentType.d.ts.map +1 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +1 -2
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +6 -4
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +4 -2
- package/dist/adapters/node-http/types.d.ts +3 -4
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/adapters/standalone.d.ts +1 -2
- package/dist/adapters/standalone.d.ts.map +1 -1
- package/dist/adapters/standalone.js +1 -0
- package/dist/adapters/standalone.mjs +1 -0
- package/dist/adapters/ws.d.ts +3 -2
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +33 -26
- package/dist/adapters/ws.mjs +8 -1
- package/dist/bundle-analysis.json +757 -0
- package/dist/http.d.ts +1 -6
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +11 -21
- package/dist/http.mjs +6 -1
- package/dist/index.d.ts +1 -68
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -41
- package/dist/index.mjs +8 -1
- package/dist/observable/index.d.ts +5 -0
- package/dist/observable/index.d.ts.map +1 -0
- package/dist/observable/index.js +13 -0
- package/dist/observable/index.mjs +2 -0
- package/dist/observable/observable.d.ts +13 -0
- package/dist/observable/observable.d.ts.map +1 -0
- package/dist/observable/observable.js +126 -0
- package/dist/observable/observable.mjs +122 -0
- package/dist/observable/operators.d.ts +8 -0
- package/dist/observable/operators.d.ts.map +1 -0
- package/dist/observable/operators.js +103 -0
- package/dist/observable/operators.mjs +99 -0
- package/dist/observable/types.d.ts +26 -0
- package/dist/observable/types.d.ts.map +1 -0
- package/dist/rpc.d.ts +1 -2
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +6 -13
- package/dist/rpc.mjs +3 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +6 -9
- package/dist/shared.mjs +4 -1
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +6 -0
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/createProxy.d.ts +19 -0
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/createProxy.js +52 -0
- package/dist/unstable-core-do-not-import/createProxy.mjs +49 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +13 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.js +67 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.mjs +63 -0
- package/dist/unstable-core-do-not-import/error/formatter.d.ts +33 -0
- package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/formatter.js +7 -0
- package/dist/unstable-core-do-not-import/error/formatter.mjs +5 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +15 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.js +31 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +29 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +24 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.js +32 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.mjs +30 -0
- package/dist/unstable-core-do-not-import/http/contentType.d.ts +29 -0
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/contentType.js +54 -0
- package/dist/unstable-core-do-not-import/http/contentType.mjs +52 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +5 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +51 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +48 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts +7 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +51 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.js +295 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs +293 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts +96 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/index.d.ts +37 -0
- package/dist/unstable-core-do-not-import/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/index.js +48 -0
- package/dist/unstable-core-do-not-import/index.mjs +16 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +96 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/initTRPC.js +95 -0
- package/dist/unstable-core-do-not-import/initTRPC.mjs +93 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts +105 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/middleware.js +95 -0
- package/dist/unstable-core-do-not-import/middleware.mjs +89 -0
- package/dist/unstable-core-do-not-import/parser.d.ts +30 -0
- package/dist/unstable-core-do-not-import/parser.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/parser.js +37 -0
- package/dist/unstable-core-do-not-import/parser.mjs +35 -0
- package/dist/unstable-core-do-not-import/procedure.d.ts +72 -0
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/procedure.js +9 -0
- package/dist/unstable-core-do-not-import/procedure.mjs +7 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +101 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.js +176 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +173 -0
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +75 -0
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rootConfig.js +8 -0
- package/dist/unstable-core-do-not-import/rootConfig.mjs +6 -0
- package/dist/unstable-core-do-not-import/router.d.ts +85 -0
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/router.js +156 -0
- package/dist/unstable-core-do-not-import/router.mjs +151 -0
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +51 -0
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/codes.js +38 -0
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +35 -0
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +97 -0
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/index.d.ts +5 -0
- package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +5 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +59 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +57 -0
- package/dist/unstable-core-do-not-import/serialize.d.ts +62 -0
- package/dist/unstable-core-do-not-import/serialize.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts +107 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/transformer.js +107 -0
- package/dist/unstable-core-do-not-import/transformer.mjs +102 -0
- package/dist/unstable-core-do-not-import/types.d.ts +98 -0
- package/dist/unstable-core-do-not-import/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/utils.d.ts +27 -0
- package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/utils.js +44 -0
- package/dist/unstable-core-do-not-import/utils.mjs +39 -0
- package/package.json +53 -125
- package/src/@trpc/server/http.ts +26 -0
- package/src/@trpc/server/index.ts +105 -0
- package/src/@trpc/server/rpc.ts +26 -0
- package/src/adapters/aws-lambda/index.ts +4 -5
- package/src/adapters/aws-lambda/utils.ts +3 -4
- package/src/adapters/express.ts +1 -3
- package/src/adapters/fastify/fastifyRequestHandler.ts +6 -4
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +1 -2
- package/src/adapters/fetch/fetchRequestHandler.ts +6 -4
- package/src/adapters/fetch/types.ts +2 -3
- package/src/adapters/next.ts +2 -4
- package/src/adapters/node-http/content-type/form-data/index.ts +1 -1
- package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -2
- package/src/adapters/node-http/content-type/json/index.ts +1 -1
- package/src/adapters/node-http/internals/contentType.ts +2 -2
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +6 -4
- package/src/adapters/node-http/types.ts +4 -5
- package/src/adapters/standalone.ts +2 -2
- package/src/adapters/ws.ts +14 -13
- package/src/http.ts +1 -26
- package/src/index.ts +1 -105
- package/src/observable/index.ts +10 -0
- package/src/observable/observable.ts +158 -0
- package/src/observable/operators.ts +119 -0
- package/src/observable/types.ts +76 -0
- package/src/rpc.ts +1 -26
- package/src/shared.ts +1 -1
- package/src/unstable-core-do-not-import/TRPCInferrable.ts +9 -0
- package/src/unstable-core-do-not-import/createProxy.ts +59 -0
- package/src/unstable-core-do-not-import/error/TRPCError.ts +82 -0
- package/src/unstable-core-do-not-import/error/formatter.ts +51 -0
- package/src/unstable-core-do-not-import/error/getErrorShape.ts +36 -0
- package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +29 -0
- package/src/unstable-core-do-not-import/http/contentType.ts +99 -0
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +57 -0
- package/src/unstable-core-do-not-import/http/index.ts +23 -0
- package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +458 -0
- package/src/unstable-core-do-not-import/http/types.ts +111 -0
- package/src/unstable-core-do-not-import/index.ts +110 -0
- package/src/unstable-core-do-not-import/initTRPC.ts +206 -0
- package/src/unstable-core-do-not-import/middleware.ts +233 -0
- package/src/unstable-core-do-not-import/parser.ts +94 -0
- package/src/unstable-core-do-not-import/procedure.ts +108 -0
- package/src/unstable-core-do-not-import/procedureBuilder.ts +458 -0
- package/src/unstable-core-do-not-import/rootConfig.ts +90 -0
- package/src/unstable-core-do-not-import/router.ts +370 -0
- package/src/unstable-core-do-not-import/rpc/codes.ts +44 -0
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +136 -0
- package/src/unstable-core-do-not-import/rpc/index.ts +21 -0
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +85 -0
- package/src/unstable-core-do-not-import/serialize.ts +122 -0
- package/src/unstable-core-do-not-import/transformer.ts +202 -0
- package/src/unstable-core-do-not-import/types.ts +151 -0
- package/src/unstable-core-do-not-import/utils.ts +59 -0
- package/unstable-core-do-not-import/index.d.ts +1 -0
- package/unstable-core-do-not-import/index.js +1 -0
- package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts +0 -10
- package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts.map +0 -1
- package/dist/@trpc-server/http.d.ts +0 -2
- package/dist/@trpc-server/http.d.ts.map +0 -1
- package/dist/observable.d.ts +0 -3
- package/dist/observable.d.ts.map +0 -1
- package/dist/observable.js +0 -30
- package/dist/observable.mjs +0 -1
- package/src/@trpc-core-unstable-do-not-import-this-please.ts +0 -146
- package/src/@trpc-server/http.ts +0 -2
- package/src/observable.ts +0 -16
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { isObject } from './utils.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/ function getDataTransformer(transformer) {
|
|
6
|
+
if ('input' in transformer) {
|
|
7
|
+
return transformer;
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
input: transformer,
|
|
11
|
+
output: transformer
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/ const defaultTransformer = {
|
|
17
|
+
_default: true,
|
|
18
|
+
input: {
|
|
19
|
+
serialize: (obj)=>obj,
|
|
20
|
+
deserialize: (obj)=>obj
|
|
21
|
+
},
|
|
22
|
+
output: {
|
|
23
|
+
serialize: (obj)=>obj,
|
|
24
|
+
deserialize: (obj)=>obj
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function transformTRPCResponseItem(config, item) {
|
|
28
|
+
if ('error' in item) {
|
|
29
|
+
return {
|
|
30
|
+
...item,
|
|
31
|
+
error: config.transformer.output.serialize(item.error)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if ('data' in item.result) {
|
|
35
|
+
return {
|
|
36
|
+
...item,
|
|
37
|
+
result: {
|
|
38
|
+
...item.result,
|
|
39
|
+
data: config.transformer.output.serialize(item.result.data)
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return item;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Takes a unserialized `TRPCResponse` and serializes it with the router's transformers
|
|
47
|
+
**/ function transformTRPCResponse(config, itemOrItems) {
|
|
48
|
+
return Array.isArray(itemOrItems) ? itemOrItems.map((item)=>transformTRPCResponseItem(config, item)) : transformTRPCResponseItem(config, itemOrItems);
|
|
49
|
+
}
|
|
50
|
+
// FIXME:
|
|
51
|
+
// - the generics here are probably unnecessary
|
|
52
|
+
// - the RPC-spec could probably be simplified to combine HTTP + WS
|
|
53
|
+
/** @internal */ function transformResultInner(response, transformer) {
|
|
54
|
+
if ('error' in response) {
|
|
55
|
+
const error = transformer.deserialize(response.error);
|
|
56
|
+
return {
|
|
57
|
+
ok: false,
|
|
58
|
+
error: {
|
|
59
|
+
...response,
|
|
60
|
+
error
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const result = {
|
|
65
|
+
...response.result,
|
|
66
|
+
...(!response.result.type || response.result.type === 'data') && {
|
|
67
|
+
type: 'data',
|
|
68
|
+
data: transformer.deserialize(response.result.data)
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
ok: true,
|
|
73
|
+
result
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
class TransformResultError extends Error {
|
|
77
|
+
constructor(){
|
|
78
|
+
super('Unable to transform response from server');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Transforms and validates that the result is a valid TRPCResponse
|
|
83
|
+
* @internal
|
|
84
|
+
*/ function transformResult(response, transformer) {
|
|
85
|
+
let result;
|
|
86
|
+
try {
|
|
87
|
+
// Use the data transformers on the JSON-response
|
|
88
|
+
result = transformResultInner(response, transformer);
|
|
89
|
+
} catch (err) {
|
|
90
|
+
throw new TransformResultError();
|
|
91
|
+
}
|
|
92
|
+
// check that output of the transformers is a valid TRPCResponse
|
|
93
|
+
if (!result.ok && (!isObject(result.error.error) || typeof result.error.error['code'] !== 'number')) {
|
|
94
|
+
throw new TransformResultError();
|
|
95
|
+
}
|
|
96
|
+
if (result.ok && !isObject(result.result)) {
|
|
97
|
+
throw new TransformResultError();
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { defaultTransformer, getDataTransformer, transformResult, transformTRPCResponse };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ================================
|
|
3
|
+
* Useful utility types that doesn't have anything to do with tRPC in particular
|
|
4
|
+
* ================================
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export type Maybe<TType> = TType | null | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* @link https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
13
|
+
*/
|
|
14
|
+
export type Simplify<TType> = TType extends any[] | Date ? TType : {
|
|
15
|
+
[K in keyof TType]: TType[K];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export type Dict<TType> = Record<string, TType | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export type MaybePromise<TType> = Promise<TType> | TType;
|
|
25
|
+
export type FilterKeys<TObj extends object, TFilter> = {
|
|
26
|
+
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
|
|
27
|
+
}[keyof TObj];
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export type Filter<TObj extends object, TFilter> = Pick<TObj, FilterKeys<TObj, TFilter>>;
|
|
32
|
+
/**
|
|
33
|
+
* Unwrap return type if the type is a function (sync or async), else use the type as is
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export type Unwrap<TType> = TType extends (...args: any[]) => infer R ? Awaited<R> : TType;
|
|
37
|
+
/**
|
|
38
|
+
* Makes the object recursively optional
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export type DeepPartial<TObject> = TObject extends object ? {
|
|
42
|
+
[P in keyof TObject]?: DeepPartial<TObject[P]>;
|
|
43
|
+
} : TObject;
|
|
44
|
+
/**
|
|
45
|
+
* Omits the key without removing a potential union
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export type DistributiveOmit<TObj, TKey extends keyof any> = TObj extends any ? Omit<TObj, TKey> : never;
|
|
49
|
+
/**
|
|
50
|
+
* See https://github.com/microsoft/TypeScript/issues/41966#issuecomment-758187996
|
|
51
|
+
* Fixes issues with iterating over keys of objects with index signatures.
|
|
52
|
+
* Without this, iterations over keys of objects with index signatures will lose
|
|
53
|
+
* type information about the keys and only the index signature will remain.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export type WithoutIndexSignature<TObj> = {
|
|
57
|
+
[K in keyof TObj as string extends K ? never : number extends K ? never : K]: TObj[K];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
* Overwrite properties in `TType` with properties in `TWith`
|
|
62
|
+
* Only overwrites properties when the type to be overwritten
|
|
63
|
+
* is an object. Otherwise it will just use the type from `TWith`.
|
|
64
|
+
*/
|
|
65
|
+
export type Overwrite<TType, TWith> = TWith extends any ? TType extends object ? {
|
|
66
|
+
[K in keyof WithoutIndexSignature<TType> | keyof WithoutIndexSignature<TWith>]: K extends keyof TWith ? TWith[K] : K extends keyof TType ? TType[K] : never;
|
|
67
|
+
} & (string extends keyof TWith ? {
|
|
68
|
+
[key: string]: TWith[string];
|
|
69
|
+
} : number extends keyof TWith ? {
|
|
70
|
+
[key: number]: TWith[number];
|
|
71
|
+
} : {}) : TWith : never;
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export type ValidateShape<TActualShape, TExpectedShape> = TActualShape extends TExpectedShape ? Exclude<keyof TActualShape, keyof TExpectedShape> extends never ? TActualShape : TExpectedShape : never;
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export type PickFirstDefined<TType, TPick> = undefined extends TType ? undefined extends TPick ? never : TPick : TType;
|
|
80
|
+
/**
|
|
81
|
+
* ================================
|
|
82
|
+
* tRPC specific types
|
|
83
|
+
* ================================
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
export type IntersectionError<TKey extends string> = `The property '${TKey}' in your router collides with a built-in method, rename this router or procedure on your backend.`;
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
export type ProtectedIntersection<TType, TWith> = keyof TType & keyof TWith extends never ? TType & TWith : IntersectionError<string & keyof TType & keyof TWith>;
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
* Returns the raw input type of a procedure
|
|
96
|
+
*/
|
|
97
|
+
export type GetRawInputFn = () => Promise<unknown>;
|
|
98
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type KeyFromValue<TValue, TType extends Record<PropertyKey, PropertyKey>> = {
|
|
2
|
+
[K in keyof TType]: TValue extends TType[K] ? K : never;
|
|
3
|
+
}[keyof TType];
|
|
4
|
+
type Invert<TType extends Record<PropertyKey, PropertyKey>> = {
|
|
5
|
+
[TValue in TType[keyof TType]]: KeyFromValue<TValue, TType>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function invert<TRecord extends Record<PropertyKey, PropertyKey>>(obj: TRecord): Invert<TRecord>;
|
|
11
|
+
/**
|
|
12
|
+
* Ensures there are no duplicate keys when building a procedure.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function mergeWithoutOverrides<TType extends Record<string, unknown>>(obj1: TType, ...objs: Partial<TType>[]): TType;
|
|
16
|
+
/**
|
|
17
|
+
* Check that value is object
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Create an object without inheriting anything from `Object.prototype`
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function omitPrototype<TObj extends Record<string, unknown>>(obj: TObj): TObj;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/utils.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,CAAC,MAAM,EAAE,KAAK,SAAS,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI;KACzE,CAAC,IAAI,MAAM,KAAK,GAAG,MAAM,SAAS,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CACxD,CAAC,MAAM,KAAK,CAAC,CAAC;AAEf,KAAK,MAAM,CAAC,KAAK,SAAS,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI;KAC3D,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC;CAC5D,CAAC;AACF;;GAEG;AACH,wBAAgB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,EACrE,GAAG,EAAE,OAAO,GACX,MAAM,CAAC,OAAO,CAAC,CAOjB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzE,IAAI,EAAE,KAAK,EACX,GAAG,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,GACxB,KAAK,CAYP;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,GAAG,EAAE,IAAI,GACR,IAAI,CAEN"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/ function invert(obj) {
|
|
6
|
+
const newObj = Object.create(null);
|
|
7
|
+
for(const key in obj){
|
|
8
|
+
const v = obj[key];
|
|
9
|
+
newObj[v] = key;
|
|
10
|
+
}
|
|
11
|
+
return newObj;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Ensures there are no duplicate keys when building a procedure.
|
|
15
|
+
* @internal
|
|
16
|
+
*/ function mergeWithoutOverrides(obj1, ...objs) {
|
|
17
|
+
const newObj = Object.assign(Object.create(null), obj1);
|
|
18
|
+
for (const overrides of objs){
|
|
19
|
+
for(const key in overrides){
|
|
20
|
+
if (key in newObj && newObj[key] !== overrides[key]) {
|
|
21
|
+
throw new Error(`Duplicate key ${key}`);
|
|
22
|
+
}
|
|
23
|
+
newObj[key] = overrides[key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return newObj;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Check that value is object
|
|
30
|
+
* @internal
|
|
31
|
+
*/ function isObject(value) {
|
|
32
|
+
return !!value && !Array.isArray(value) && typeof value === 'object';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create an object without inheriting anything from `Object.prototype`
|
|
36
|
+
* @internal
|
|
37
|
+
*/ function omitPrototype(obj) {
|
|
38
|
+
return Object.assign(Object.create(null), obj);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.invert = invert;
|
|
42
|
+
exports.isObject = isObject;
|
|
43
|
+
exports.mergeWithoutOverrides = mergeWithoutOverrides;
|
|
44
|
+
exports.omitPrototype = omitPrototype;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/ function invert(obj) {
|
|
4
|
+
const newObj = Object.create(null);
|
|
5
|
+
for(const key in obj){
|
|
6
|
+
const v = obj[key];
|
|
7
|
+
newObj[v] = key;
|
|
8
|
+
}
|
|
9
|
+
return newObj;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Ensures there are no duplicate keys when building a procedure.
|
|
13
|
+
* @internal
|
|
14
|
+
*/ function mergeWithoutOverrides(obj1, ...objs) {
|
|
15
|
+
const newObj = Object.assign(Object.create(null), obj1);
|
|
16
|
+
for (const overrides of objs){
|
|
17
|
+
for(const key in overrides){
|
|
18
|
+
if (key in newObj && newObj[key] !== overrides[key]) {
|
|
19
|
+
throw new Error(`Duplicate key ${key}`);
|
|
20
|
+
}
|
|
21
|
+
newObj[key] = overrides[key];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return newObj;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check that value is object
|
|
28
|
+
* @internal
|
|
29
|
+
*/ function isObject(value) {
|
|
30
|
+
return !!value && !Array.isArray(value) && typeof value === 'object';
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create an object without inheriting anything from `Object.prototype`
|
|
34
|
+
* @internal
|
|
35
|
+
*/ function omitPrototype(obj) {
|
|
36
|
+
return Object.assign(Object.create(null), obj);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { invert, isObject, mergeWithoutOverrides, omitPrototype };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-export-from-main.
|
|
3
|
+
"version": "11.0.0-alpha-tmp-export-from-main-nuke-core.239+7e973d54e",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,154 +24,84 @@
|
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|
|
26
26
|
".": {
|
|
27
|
-
"import":
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
"require": {
|
|
32
|
-
"types": "./dist/index.d.ts",
|
|
33
|
-
"default": "./dist/index.js"
|
|
34
|
-
}
|
|
27
|
+
"import": "./dist/index.mjs",
|
|
28
|
+
"require": "./dist/index.js",
|
|
29
|
+
"default": "./dist/index.js"
|
|
35
30
|
},
|
|
36
31
|
"./adapters/aws-lambda": {
|
|
37
|
-
"import":
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
"require": {
|
|
42
|
-
"types": "./dist/adapters/aws-lambda/index.d.ts",
|
|
43
|
-
"default": "./dist/adapters/aws-lambda/index.js"
|
|
44
|
-
}
|
|
32
|
+
"import": "./dist/adapters/aws-lambda/index.mjs",
|
|
33
|
+
"require": "./dist/adapters/aws-lambda/index.js",
|
|
34
|
+
"default": "./dist/adapters/aws-lambda/index.js"
|
|
45
35
|
},
|
|
46
36
|
"./adapters/express": {
|
|
47
|
-
"import":
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
"require": {
|
|
52
|
-
"types": "./dist/adapters/express.d.ts",
|
|
53
|
-
"default": "./dist/adapters/express.js"
|
|
54
|
-
}
|
|
37
|
+
"import": "./dist/adapters/express.mjs",
|
|
38
|
+
"require": "./dist/adapters/express.js",
|
|
39
|
+
"default": "./dist/adapters/express.js"
|
|
55
40
|
},
|
|
56
41
|
"./adapters/fastify": {
|
|
57
|
-
"import":
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
"require": {
|
|
62
|
-
"types": "./dist/adapters/fastify/index.d.ts",
|
|
63
|
-
"default": "./dist/adapters/fastify/index.js"
|
|
64
|
-
}
|
|
42
|
+
"import": "./dist/adapters/fastify/index.mjs",
|
|
43
|
+
"require": "./dist/adapters/fastify/index.js",
|
|
44
|
+
"default": "./dist/adapters/fastify/index.js"
|
|
65
45
|
},
|
|
66
46
|
"./adapters/fetch": {
|
|
67
|
-
"import":
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
"require": {
|
|
72
|
-
"types": "./dist/adapters/fetch/index.d.ts",
|
|
73
|
-
"default": "./dist/adapters/fetch/index.js"
|
|
74
|
-
}
|
|
47
|
+
"import": "./dist/adapters/fetch/index.mjs",
|
|
48
|
+
"require": "./dist/adapters/fetch/index.js",
|
|
49
|
+
"default": "./dist/adapters/fetch/index.js"
|
|
75
50
|
},
|
|
76
51
|
"./adapters/next": {
|
|
77
|
-
"import":
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
"require": {
|
|
82
|
-
"types": "./dist/adapters/next.d.ts",
|
|
83
|
-
"default": "./dist/adapters/next.js"
|
|
84
|
-
}
|
|
52
|
+
"import": "./dist/adapters/next.mjs",
|
|
53
|
+
"require": "./dist/adapters/next.js",
|
|
54
|
+
"default": "./dist/adapters/next.js"
|
|
85
55
|
},
|
|
86
56
|
"./adapters/node-http/content-type/form-data": {
|
|
87
|
-
"import":
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
"require": {
|
|
92
|
-
"types": "./dist/adapters/node-http/content-type/form-data/index.d.ts",
|
|
93
|
-
"default": "./dist/adapters/node-http/content-type/form-data/index.js"
|
|
94
|
-
}
|
|
57
|
+
"import": "./dist/adapters/node-http/content-type/form-data/index.mjs",
|
|
58
|
+
"require": "./dist/adapters/node-http/content-type/form-data/index.js",
|
|
59
|
+
"default": "./dist/adapters/node-http/content-type/form-data/index.js"
|
|
95
60
|
},
|
|
96
61
|
"./adapters/node-http/content-type/json": {
|
|
97
|
-
"import":
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
"require": {
|
|
102
|
-
"types": "./dist/adapters/node-http/content-type/json/index.d.ts",
|
|
103
|
-
"default": "./dist/adapters/node-http/content-type/json/index.js"
|
|
104
|
-
}
|
|
62
|
+
"import": "./dist/adapters/node-http/content-type/json/index.mjs",
|
|
63
|
+
"require": "./dist/adapters/node-http/content-type/json/index.js",
|
|
64
|
+
"default": "./dist/adapters/node-http/content-type/json/index.js"
|
|
105
65
|
},
|
|
106
66
|
"./adapters/node-http": {
|
|
107
|
-
"import":
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
"require": {
|
|
112
|
-
"types": "./dist/adapters/node-http/index.d.ts",
|
|
113
|
-
"default": "./dist/adapters/node-http/index.js"
|
|
114
|
-
}
|
|
67
|
+
"import": "./dist/adapters/node-http/index.mjs",
|
|
68
|
+
"require": "./dist/adapters/node-http/index.js",
|
|
69
|
+
"default": "./dist/adapters/node-http/index.js"
|
|
115
70
|
},
|
|
116
71
|
"./adapters/standalone": {
|
|
117
|
-
"import":
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
"require": {
|
|
122
|
-
"types": "./dist/adapters/standalone.d.ts",
|
|
123
|
-
"default": "./dist/adapters/standalone.js"
|
|
124
|
-
}
|
|
72
|
+
"import": "./dist/adapters/standalone.mjs",
|
|
73
|
+
"require": "./dist/adapters/standalone.js",
|
|
74
|
+
"default": "./dist/adapters/standalone.js"
|
|
125
75
|
},
|
|
126
76
|
"./adapters/ws": {
|
|
127
|
-
"import":
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
"require": {
|
|
132
|
-
"types": "./dist/adapters/ws.d.ts",
|
|
133
|
-
"default": "./dist/adapters/ws.js"
|
|
134
|
-
}
|
|
77
|
+
"import": "./dist/adapters/ws.mjs",
|
|
78
|
+
"require": "./dist/adapters/ws.js",
|
|
79
|
+
"default": "./dist/adapters/ws.js"
|
|
135
80
|
},
|
|
136
81
|
"./http": {
|
|
137
|
-
"import":
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
"require": {
|
|
142
|
-
"types": "./dist/http.d.ts",
|
|
143
|
-
"default": "./dist/http.js"
|
|
144
|
-
}
|
|
82
|
+
"import": "./dist/http.mjs",
|
|
83
|
+
"require": "./dist/http.js",
|
|
84
|
+
"default": "./dist/http.js"
|
|
145
85
|
},
|
|
146
86
|
"./observable": {
|
|
147
|
-
"import":
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
},
|
|
151
|
-
"require": {
|
|
152
|
-
"types": "./dist/observable.d.ts",
|
|
153
|
-
"default": "./dist/observable.js"
|
|
154
|
-
}
|
|
87
|
+
"import": "./dist/observable/index.mjs",
|
|
88
|
+
"require": "./dist/observable/index.js",
|
|
89
|
+
"default": "./dist/observable/index.js"
|
|
155
90
|
},
|
|
156
91
|
"./rpc": {
|
|
157
|
-
"import":
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
"require": {
|
|
162
|
-
"types": "./dist/rpc.d.ts",
|
|
163
|
-
"default": "./dist/rpc.js"
|
|
164
|
-
}
|
|
92
|
+
"import": "./dist/rpc.mjs",
|
|
93
|
+
"require": "./dist/rpc.js",
|
|
94
|
+
"default": "./dist/rpc.js"
|
|
165
95
|
},
|
|
166
96
|
"./shared": {
|
|
167
|
-
"import":
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
97
|
+
"import": "./dist/shared.mjs",
|
|
98
|
+
"require": "./dist/shared.js",
|
|
99
|
+
"default": "./dist/shared.js"
|
|
100
|
+
},
|
|
101
|
+
"./unstable-core-do-not-import": {
|
|
102
|
+
"import": "./dist/unstable-core-do-not-import/index.mjs",
|
|
103
|
+
"require": "./dist/unstable-core-do-not-import/index.js",
|
|
104
|
+
"default": "./dist/unstable-core-do-not-import/index.js"
|
|
175
105
|
}
|
|
176
106
|
},
|
|
177
107
|
"files": [
|
|
@@ -184,14 +114,12 @@
|
|
|
184
114
|
"observable",
|
|
185
115
|
"rpc",
|
|
186
116
|
"shared",
|
|
117
|
+
"unstable-core-do-not-import",
|
|
187
118
|
"!**/*.test.*"
|
|
188
119
|
],
|
|
189
120
|
"publishConfig": {
|
|
190
121
|
"access": "public"
|
|
191
122
|
},
|
|
192
|
-
"dependencies": {
|
|
193
|
-
"@trpc/core": "11.0.0-alpha-tmp-export-from-main.218+73e2565a7"
|
|
194
|
-
},
|
|
195
123
|
"devDependencies": {
|
|
196
124
|
"@fastify/websocket": "^7.1.2",
|
|
197
125
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -229,5 +157,5 @@
|
|
|
229
157
|
"funding": [
|
|
230
158
|
"https://trpc.io/sponsor"
|
|
231
159
|
],
|
|
232
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "7e973d54e3a2ff7a02e95c195824599050d2f085"
|
|
233
161
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export {
|
|
2
|
+
getHTTPStatusCode,
|
|
3
|
+
getHTTPStatusCodeFromError,
|
|
4
|
+
} from '../../unstable-core-do-not-import';
|
|
5
|
+
export { resolveHTTPResponse } from '../../unstable-core-do-not-import';
|
|
6
|
+
export type {
|
|
7
|
+
BaseHandlerOptions,
|
|
8
|
+
HTTPBaseHandlerOptions,
|
|
9
|
+
HTTPHeaders,
|
|
10
|
+
HTTPRequest,
|
|
11
|
+
HTTPResponse,
|
|
12
|
+
OnErrorFunction,
|
|
13
|
+
ProcedureCall,
|
|
14
|
+
ResolveHTTPRequestOptionsContextFn,
|
|
15
|
+
ResponseChunk,
|
|
16
|
+
ResponseMeta,
|
|
17
|
+
ResponseMetaFn,
|
|
18
|
+
TRPCRequestInfo,
|
|
19
|
+
} from '../../unstable-core-do-not-import';
|
|
20
|
+
|
|
21
|
+
export { getBatchStreamFormatter } from '../../unstable-core-do-not-import';
|
|
22
|
+
export type {
|
|
23
|
+
BaseContentTypeHandler,
|
|
24
|
+
BodyResult,
|
|
25
|
+
} from '../../unstable-core-do-not-import';
|
|
26
|
+
export { getJsonContentTypeInputs } from '../../unstable-core-do-not-import';
|