@trpc/server 10.27.3 → 10.28.1
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/{TRPCError-61026c9a.js → TRPCError-7c3909ea.js} +47 -47
- package/dist/adapters/aws-lambda/index.d.ts +9 -9
- package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/index.js +4 -4
- package/dist/adapters/aws-lambda/index.mjs +4 -4
- package/dist/adapters/aws-lambda/utils.d.ts +37 -37
- package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
- package/dist/adapters/express.d.ts +5 -5
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/express.js +5 -5
- package/dist/adapters/express.mjs +5 -5
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +12 -12
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +11 -11
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/index.d.ts +2 -2
- package/dist/adapters/fastify/index.js +4 -4
- package/dist/adapters/fastify/index.mjs +4 -4
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +7 -7
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/index.d.ts +2 -2
- package/dist/adapters/fetch/index.js +4 -4
- package/dist/adapters/fetch/index.mjs +4 -4
- package/dist/adapters/fetch/types.d.ts +19 -19
- package/dist/adapters/fetch/types.d.ts.map +1 -1
- package/dist/adapters/lambda/index.d.ts +11 -11
- package/dist/adapters/lambda/index.d.ts.map +1 -1
- package/dist/adapters/next.d.ts +5 -5
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/next.js +5 -5
- package/dist/adapters/next.mjs +5 -5
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts +69 -69
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/index.d.ts +23 -23
- package/dist/adapters/node-http/content-type/form-data/index.js +1 -3
- package/dist/adapters/node-http/content-type/form-data/index.mjs +1 -3
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +30 -30
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts +10 -10
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +40 -39
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +6 -6
- package/dist/adapters/node-http/content-type/json/index.d.ts +1 -1
- package/dist/adapters/node-http/index.d.ts +2 -2
- package/dist/adapters/node-http/index.js +5 -5
- package/dist/adapters/node-http/index.mjs +5 -5
- package/dist/adapters/node-http/internals/contentType.d.ts +8 -8
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +3 -3
- package/dist/adapters/node-http/types.d.ts +63 -63
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/adapters/standalone.d.ts +13 -13
- package/dist/adapters/standalone.d.ts.map +1 -1
- package/dist/adapters/standalone.js +5 -5
- package/dist/adapters/standalone.mjs +5 -5
- package/dist/adapters/ws.d.ts +21 -21
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +3 -3
- package/dist/adapters/ws.mjs +3 -3
- package/dist/{codes-b3c262d8.js → codes-1c9ad84e.js} +44 -44
- package/dist/{config-91ab0b1d.js → config-54786004.js} +168 -192
- package/dist/{config-d1cf9de0.mjs → config-65c5b6d1.mjs} +5 -28
- package/dist/{config-f355c4d8.js → config-f3ce0144.js} +5 -28
- package/dist/{contentType-f27e4bfc.js → contentType-24c44bba.js} +2 -2
- package/dist/{contentType-a75c990c.js → contentType-7354963c.js} +54 -54
- package/dist/core/index.d.ts +8 -8
- package/dist/core/initTRPC.d.ts +104 -104
- package/dist/core/initTRPC.d.ts.map +1 -1
- package/dist/core/internals/config.d.ts +74 -74
- package/dist/core/internals/config.d.ts.map +1 -1
- package/dist/core/internals/getParseFn.d.ts +8 -8
- package/dist/core/internals/getParseFn.d.ts.map +1 -1
- package/dist/core/internals/mergeRouters.d.ts +17 -17
- package/dist/core/internals/mergeRouters.d.ts.map +1 -1
- package/dist/core/internals/mergeWithoutOverrides.d.ts +4 -4
- package/dist/core/internals/omitPrototype.d.ts +5 -5
- package/dist/core/internals/procedureBuilder.d.ts +115 -115
- package/dist/core/internals/procedureBuilder.d.ts.map +1 -1
- package/dist/core/internals/utils.d.ts +51 -51
- package/dist/core/internals/utils.d.ts.map +1 -1
- package/dist/core/middleware.d.ts +127 -127
- package/dist/core/middleware.d.ts.map +1 -1
- package/dist/core/parser.d.ts +27 -27
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/procedure.d.ts +72 -72
- package/dist/core/procedure.d.ts.map +1 -1
- package/dist/core/router.d.ts +111 -111
- package/dist/core/router.d.ts.map +1 -1
- package/dist/core/types.d.ts +28 -28
- package/dist/core/types.d.ts.map +1 -1
- package/dist/deprecated/internals/middlewares.d.ts +51 -51
- package/dist/deprecated/internals/middlewares.d.ts.map +1 -1
- package/dist/deprecated/internals/procedure.d.ts +95 -95
- package/dist/deprecated/internals/procedure.d.ts.map +1 -1
- package/dist/deprecated/interop.d.ts +43 -43
- package/dist/deprecated/interop.d.ts.map +1 -1
- package/dist/deprecated/router.d.ts +203 -203
- package/dist/deprecated/router.d.ts.map +1 -1
- package/dist/error/TRPCError.d.ts +11 -11
- package/dist/error/formatter.d.ts +32 -32
- package/dist/error/formatter.d.ts.map +1 -1
- package/dist/error/utils.d.ts +5 -5
- package/dist/http/contentType.d.ts +28 -28
- package/dist/http/contentType.d.ts.map +1 -1
- package/dist/http/getHTTPStatusCode.d.ts +23 -23
- package/dist/http/getHTTPStatusCode.d.ts.map +1 -1
- package/dist/http/index.d.ts +3 -3
- package/dist/http/index.js +4 -4
- package/dist/http/index.mjs +4 -4
- package/dist/http/internals/types.d.ts +24 -24
- package/dist/http/internals/types.d.ts.map +1 -1
- package/dist/http/resolveHTTPResponse.d.ts +16 -16
- package/dist/http/types.d.ts +24 -24
- package/dist/{index-315a9f08.mjs → index-044a193b.mjs} +3 -2
- package/dist/{index-8e243a74.js → index-4a823936.js} +3 -2
- package/dist/{index-cddfa242.js → index-ca9a128e.js} +88 -87
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/index.mjs +3 -3
- package/dist/internals/invert.d.ts +11 -11
- package/dist/internals/invert.d.ts.map +1 -1
- package/dist/internals/types.d.ts +25 -25
- package/dist/internals/types.d.ts.map +1 -1
- package/dist/internals.d.ts +9 -9
- package/dist/{nodeHTTPRequestHandler-8a261b10.mjs → nodeHTTPRequestHandler-0f979796.mjs} +1 -1
- package/dist/{nodeHTTPRequestHandler-7762c7d4.js → nodeHTTPRequestHandler-5bbf93f1.js} +1 -1
- package/dist/{nodeHTTPRequestHandler-fc509b47.js → nodeHTTPRequestHandler-bd47641d.js} +62 -62
- package/dist/observable/index.d.ts +4 -4
- package/dist/observable/internals/identity.d.ts +1 -1
- package/dist/observable/internals/observableToPromise.d.ts +9 -9
- package/dist/observable/internals/pipe.d.ts +3 -3
- package/dist/observable/observable.d.ts +4 -4
- package/dist/observable/observable.d.ts.map +1 -1
- package/dist/observable/operators/index.d.ts +3 -3
- package/dist/observable/operators/map.d.ts +2 -2
- package/dist/observable/operators/share.d.ts +5 -5
- package/dist/observable/operators/tap.d.ts +2 -2
- package/dist/observable/types.d.ts +28 -28
- package/dist/observable/types.d.ts.map +1 -1
- package/dist/{observable-a1c2103f.js → observable-15588f28.js} +76 -76
- package/dist/{resolveHTTPResponse-36f4e729.mjs → resolveHTTPResponse-4e576698.mjs} +3 -3
- package/dist/{resolveHTTPResponse-27fe1108.js → resolveHTTPResponse-9523b4e3.js} +3 -3
- package/dist/{resolveHTTPResponse-5f8945d7.js → resolveHTTPResponse-ba557d3e.js} +162 -162
- package/dist/rpc/codes.d.ts +52 -52
- package/dist/rpc/codes.d.ts.map +1 -1
- package/dist/rpc/envelopes.d.ts +98 -98
- package/dist/rpc/envelopes.d.ts.map +1 -1
- package/dist/rpc/index.d.ts +2 -2
- package/dist/shared/createProxy/index.d.ts +18 -18
- package/dist/shared/createProxy/index.d.ts.map +1 -1
- package/dist/shared/getErrorShape.d.ts +14 -14
- package/dist/shared/index.d.ts +5 -5
- package/dist/shared/index.js +2 -2
- package/dist/shared/index.mjs +2 -2
- package/dist/shared/internal/serialize.d.ts +29 -29
- package/dist/shared/internal/serialize.d.ts.map +1 -1
- package/dist/shared/jsonify.d.ts +9 -9
- package/dist/shared/jsonify.d.ts.map +1 -1
- package/dist/shared/transformTRPCResponse.d.ts +8 -8
- package/dist/shared/transformTRPCResponse.d.ts.map +1 -1
- package/dist/subscription.d.ts +12 -12
- package/dist/{transformTRPCResponse-6887ae6d.mjs → transformTRPCResponse-3dca0b20.mjs} +1 -1
- package/dist/{transformTRPCResponse-f7b2ffd1.js → transformTRPCResponse-48d70ef6.js} +1 -1
- package/dist/{transformTRPCResponse-8cb7e890.js → transformTRPCResponse-7fcbe472.js} +48 -48
- package/dist/transformer.d.ts +73 -73
- package/dist/transformer.d.ts.map +1 -1
- package/dist/types.d.ts +77 -77
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -6
- package/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts +3 -3
- package/src/adapters/node-http/content-type/form-data/uploadHandler.ts +3 -1
- package/src/core/router.ts +6 -41
- package/src/shared/createProxy/index.ts +3 -2
- package/src/adapters/node-http/content-type/json/getPostBody.test.ts +0 -49
- package/src/observable/observable.test.ts +0 -100
- package/src/observable/operators/map.test.ts +0 -91
- package/src/observable/operators/share.test.ts +0 -60
package/dist/types.d.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
[K in keyof TType]: undefined extends TType[K] ? K : never;
|
|
8
|
-
}[keyof TType];
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
[TKey in keyof TWith | keyof TType]: TKey extends keyof TWith ? TWith[TKey] : TKey extends keyof TType ? TType[TKey] : never;
|
|
14
|
-
}, UndefinedKeys<TType> | UndefinedKeys<TWith>>;
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export
|
|
27
|
-
/**
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export
|
|
31
|
-
/**
|
|
32
|
-
* @internal
|
|
33
|
-
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
34
|
-
*/
|
|
35
|
-
export
|
|
36
|
-
[K in keyof TType]: TType[K];
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
export
|
|
42
|
-
/**
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
|
-
export
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
*
|
|
49
|
-
* Creates a "lower-priority" type inference.
|
|
50
|
-
* https://github.com/microsoft/TypeScript/issues/14829#issuecomment-322267089
|
|
51
|
-
*/
|
|
52
|
-
export
|
|
53
|
-
[KeyType in keyof TType]: TType[KeyType];
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* @public
|
|
57
|
-
*/
|
|
58
|
-
export
|
|
59
|
-
export
|
|
60
|
-
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
|
|
61
|
-
}[keyof TObj];
|
|
62
|
-
/**
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
export
|
|
66
|
-
/**
|
|
67
|
-
* Unwrap return type if the type is a function (sync or async), else use the type as is
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
export
|
|
71
|
-
/**
|
|
72
|
-
* Makes the object recursively optional
|
|
73
|
-
* @internal
|
|
74
|
-
*/
|
|
75
|
-
export
|
|
76
|
-
[P in keyof TObject]?: DeepPartial<TObject[P]>;
|
|
77
|
-
} : TObject;
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export type identity<TType> = TType;
|
|
5
|
+
export type InferOptional<TType, TKeys extends keyof TType> = Partial<Pick<TType, TKeys>> & Omit<TType, TKeys>;
|
|
6
|
+
export type UndefinedKeys<TType> = {
|
|
7
|
+
[K in keyof TType]: undefined extends TType[K] ? K : never;
|
|
8
|
+
}[keyof TType];
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export type FlatOverwrite<TType, TWith> = InferOptional<{
|
|
13
|
+
[TKey in keyof TWith | keyof TType]: TKey extends keyof TWith ? TWith[TKey] : TKey extends keyof TType ? TType[TKey] : never;
|
|
14
|
+
}, UndefinedKeys<TType> | UndefinedKeys<TWith>>;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
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.`;
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export type ProtectedIntersection<TType, TWith> = keyof TType & keyof TWith extends never ? TType & TWith : IntersectionError<keyof TType & keyof TWith & string>;
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export type Maybe<TType> = TType | undefined | null;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export type ThenArg<TType> = TType extends PromiseLike<infer U> ? ThenArg<U> : TType;
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
34
|
+
*/
|
|
35
|
+
export type Simplify<TType> = TType extends any[] | Date ? TType : {
|
|
36
|
+
[K in keyof TType]: TType[K];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export type Dict<TType> = Record<string, TType | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export type MaybePromise<TType> = TType | Promise<TType>;
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*
|
|
49
|
+
* Creates a "lower-priority" type inference.
|
|
50
|
+
* https://github.com/microsoft/TypeScript/issues/14829#issuecomment-322267089
|
|
51
|
+
*/
|
|
52
|
+
export type InferLast<TType> = TType & {
|
|
53
|
+
[KeyType in keyof TType]: TType[KeyType];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export type inferAsyncReturnType<TFunction extends (...args: any) => any> = ThenArg<ReturnType<TFunction>>;
|
|
59
|
+
export type FilterKeys<TObj extends object, TFilter> = {
|
|
60
|
+
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
|
|
61
|
+
}[keyof TObj];
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export type Filter<TObj extends object, TFilter> = Pick<TObj, FilterKeys<TObj, TFilter>>;
|
|
66
|
+
/**
|
|
67
|
+
* Unwrap return type if the type is a function (sync or async), else use the type as is
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export type Unwrap<TType> = TType extends (...args: any[]) => infer R ? ThenArg<R> : TType;
|
|
71
|
+
/**
|
|
72
|
+
* Makes the object recursively optional
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export type DeepPartial<TObject> = TObject extends object ? {
|
|
76
|
+
[P in keyof TObject]?: DeepPartial<TObject[P]>;
|
|
77
|
+
} : TObject;
|
|
78
78
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.28.1",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -130,7 +130,8 @@
|
|
|
130
130
|
"rpc",
|
|
131
131
|
"observable",
|
|
132
132
|
"subscription",
|
|
133
|
-
"shared"
|
|
133
|
+
"shared",
|
|
134
|
+
"!**/*.test.*"
|
|
134
135
|
],
|
|
135
136
|
"publishConfig": {
|
|
136
137
|
"access": "public"
|
|
@@ -141,7 +142,7 @@
|
|
|
141
142
|
"@types/aws-lambda": "^8.10.97",
|
|
142
143
|
"@types/express": "^4.17.17",
|
|
143
144
|
"@types/hash-sum": "^1.0.0",
|
|
144
|
-
"@types/node": "^18.
|
|
145
|
+
"@types/node": "^18.16.16",
|
|
145
146
|
"@types/react": "^18.2.6",
|
|
146
147
|
"@types/react-dom": "^18.2.4",
|
|
147
148
|
"@types/ws": "^8.2.0",
|
|
@@ -149,7 +150,7 @@
|
|
|
149
150
|
"aws-lambda": "^1.0.7",
|
|
150
151
|
"devalue": "^4.0.0",
|
|
151
152
|
"eslint": "^8.40.0",
|
|
152
|
-
"expect-type": "^0.
|
|
153
|
+
"expect-type": "^0.16.0",
|
|
153
154
|
"express": "^4.17.1",
|
|
154
155
|
"fastify": "^4.13.0",
|
|
155
156
|
"fastify-plugin": "^4.5.0",
|
|
@@ -163,11 +164,14 @@
|
|
|
163
164
|
"superstruct": "^1.0.0",
|
|
164
165
|
"tslib": "^2.5.0",
|
|
165
166
|
"tsx": "^3.12.7",
|
|
166
|
-
"typescript": "^
|
|
167
|
+
"typescript": "^5.0.4",
|
|
167
168
|
"vitest": "^0.28.5",
|
|
168
169
|
"ws": "^8.0.0",
|
|
169
170
|
"yup": "^1.0.0",
|
|
170
171
|
"zod": "^3.0.0"
|
|
171
172
|
},
|
|
172
|
-
"
|
|
173
|
+
"funding": [
|
|
174
|
+
"https://trpc.io/sponsor"
|
|
175
|
+
],
|
|
176
|
+
"gitHead": "ea70b1c33899b66f964a7d11f5a8710148f03f8e"
|
|
173
177
|
}
|
|
@@ -184,7 +184,7 @@ export function createFileUploadHandler({
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
export class NodeOnDiskFile
|
|
187
|
+
export class NodeOnDiskFile {
|
|
188
188
|
name: string;
|
|
189
189
|
lastModified = 0;
|
|
190
190
|
webkitRelativePath = '';
|
|
@@ -208,7 +208,7 @@ export class NodeOnDiskFile implements File {
|
|
|
208
208
|
return stats.size;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
slice(start?: number, end?: number, type?: string):
|
|
211
|
+
slice(start?: number, end?: number, type?: string): NodeOnDiskFile {
|
|
212
212
|
if (typeof start === 'number' && start < 0) start = this.size + start;
|
|
213
213
|
if (typeof end === 'number' && end < 0) end = this.size + end;
|
|
214
214
|
|
|
@@ -248,7 +248,7 @@ export class NodeOnDiskFile implements File {
|
|
|
248
248
|
stream = stream.pipe(streamSlice(this.slicer.start, this.slicer.end));
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
return Readable.toWeb(stream)
|
|
251
|
+
return Readable.toWeb(stream) as ReadableStream<Uint8Array>;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
async text(): Promise<string> {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NodeOnDiskFile } from './fileUploadHandler';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @see https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
|
|
3
5
|
*/
|
|
@@ -10,7 +12,7 @@ export type UploadHandlerPart = {
|
|
|
10
12
|
|
|
11
13
|
export type UploadHandler = (
|
|
12
14
|
part: UploadHandlerPart,
|
|
13
|
-
) => Promise<File | string | null | undefined>;
|
|
15
|
+
) => Promise<NodeOnDiskFile | File | string | null | undefined>;
|
|
14
16
|
|
|
15
17
|
export function composeUploadHandlers(
|
|
16
18
|
...handlers: UploadHandler[]
|
package/src/core/router.ts
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
export type ProcedureRecord = Record<string, AnyProcedure>;
|
|
26
26
|
|
|
27
27
|
export interface ProcedureRouterRecord {
|
|
28
|
-
[key: string]: AnyProcedure | AnyRouter
|
|
28
|
+
[key: string]: AnyProcedure | AnyRouter;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -97,9 +97,7 @@ type DecorateProcedure<TProcedure extends AnyProcedure> = (
|
|
|
97
97
|
* @internal
|
|
98
98
|
*/
|
|
99
99
|
type DecoratedProcedureRecord<TProcedures extends ProcedureRouterRecord> = {
|
|
100
|
-
[TKey in keyof TProcedures]: TProcedures[TKey] extends
|
|
101
|
-
? DecoratedProcedureRecord<TProcedures[TKey]>
|
|
102
|
-
: TProcedures[TKey] extends AnyRouter
|
|
100
|
+
[TKey in keyof TProcedures]: TProcedures[TKey] extends AnyRouter
|
|
103
101
|
? DecoratedProcedureRecord<TProcedures[TKey]['_def']['record']>
|
|
104
102
|
: TProcedures[TKey] extends AnyProcedure
|
|
105
103
|
? DecorateProcedure<TProcedures[TKey]>
|
|
@@ -146,17 +144,11 @@ export interface Router<TDef extends AnyRouterDef> {
|
|
|
146
144
|
export type AnyRouter = Router<AnyRouterDef>;
|
|
147
145
|
|
|
148
146
|
function isRouter(
|
|
149
|
-
procedureOrRouter: AnyProcedure | AnyRouter
|
|
147
|
+
procedureOrRouter: AnyProcedure | AnyRouter,
|
|
150
148
|
): procedureOrRouter is AnyRouter {
|
|
151
149
|
return 'router' in procedureOrRouter._def;
|
|
152
150
|
}
|
|
153
151
|
|
|
154
|
-
function isNestedRouter(
|
|
155
|
-
procedureOrRouter: AnyProcedure | AnyRouter | ProcedureRouterRecord,
|
|
156
|
-
): procedureOrRouter is ProcedureRouterRecord {
|
|
157
|
-
return !('_def' in procedureOrRouter);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
152
|
const emptyRouter = {
|
|
161
153
|
_ctx: null as any,
|
|
162
154
|
_errorShape: null as any,
|
|
@@ -177,10 +169,6 @@ const reservedWords = [
|
|
|
177
169
|
* since JS will think that `.then` is something that exists
|
|
178
170
|
*/
|
|
179
171
|
'then',
|
|
180
|
-
/**
|
|
181
|
-
* `_def` is a reserved word because it's used internally a lot
|
|
182
|
-
*/
|
|
183
|
-
'_def',
|
|
184
172
|
];
|
|
185
173
|
|
|
186
174
|
/**
|
|
@@ -216,33 +204,11 @@ export function createRouterFactory<TConfig extends AnyRootConfig>(
|
|
|
216
204
|
);
|
|
217
205
|
}
|
|
218
206
|
|
|
219
|
-
const newProcedures: ProcedureRouterRecord = {};
|
|
220
|
-
for (const [key, procedureOrRouter] of Object.entries(procedures ?? {})) {
|
|
221
|
-
const value = procedures[key] ?? {};
|
|
222
|
-
|
|
223
|
-
if (isNestedRouter(value)) {
|
|
224
|
-
newProcedures[key] = createRouterInner(value);
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (isRouter(value)) {
|
|
229
|
-
newProcedures[key] = procedureOrRouter;
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
newProcedures[key] = procedureOrRouter;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
207
|
const routerProcedures: ProcedureRecord = omitPrototype({});
|
|
237
208
|
function recursiveGetPaths(procedures: ProcedureRouterRecord, path = '') {
|
|
238
209
|
for (const [key, procedureOrRouter] of Object.entries(procedures ?? {})) {
|
|
239
210
|
const newPath = `${path}${key}`;
|
|
240
211
|
|
|
241
|
-
if (isNestedRouter(procedureOrRouter)) {
|
|
242
|
-
recursiveGetPaths(procedureOrRouter, `${newPath}.`);
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
212
|
if (isRouter(procedureOrRouter)) {
|
|
247
213
|
recursiveGetPaths(procedureOrRouter._def.procedures, `${newPath}.`);
|
|
248
214
|
continue;
|
|
@@ -255,14 +221,14 @@ export function createRouterFactory<TConfig extends AnyRootConfig>(
|
|
|
255
221
|
routerProcedures[newPath] = procedureOrRouter;
|
|
256
222
|
}
|
|
257
223
|
}
|
|
258
|
-
recursiveGetPaths(
|
|
224
|
+
recursiveGetPaths(procedures);
|
|
259
225
|
|
|
260
226
|
const _def: AnyRouterDef<TConfig> = {
|
|
261
227
|
_config: config,
|
|
262
228
|
router: true,
|
|
263
229
|
procedures: routerProcedures,
|
|
264
230
|
...emptyRouter,
|
|
265
|
-
record:
|
|
231
|
+
record: procedures,
|
|
266
232
|
queries: Object.entries(routerProcedures)
|
|
267
233
|
.filter((pair) => (pair[1] as any)._def.query)
|
|
268
234
|
.reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {}),
|
|
@@ -275,7 +241,7 @@ export function createRouterFactory<TConfig extends AnyRootConfig>(
|
|
|
275
241
|
};
|
|
276
242
|
|
|
277
243
|
const router: AnyRouter = {
|
|
278
|
-
...
|
|
244
|
+
...procedures,
|
|
279
245
|
_def,
|
|
280
246
|
createCaller(ctx) {
|
|
281
247
|
const proxy = createRecursiveProxy(({ path, args }) => {
|
|
@@ -333,7 +299,6 @@ export function createRouterFactory<TConfig extends AnyRootConfig>(
|
|
|
333
299
|
return this._def._config.errorFormatter({ ...opts, shape });
|
|
334
300
|
},
|
|
335
301
|
};
|
|
336
|
-
|
|
337
302
|
return router as any;
|
|
338
303
|
};
|
|
339
304
|
}
|
|
@@ -19,9 +19,10 @@ function createInnerProxy(callback: ProxyCallback, path: string[]) {
|
|
|
19
19
|
return createInnerProxy(callback, [...path, key]);
|
|
20
20
|
},
|
|
21
21
|
apply(_1, _2, args) {
|
|
22
|
+
const isApply = path[path.length - 1] === 'apply';
|
|
22
23
|
return callback({
|
|
23
|
-
args,
|
|
24
|
-
path,
|
|
24
|
+
args: isApply ? (args.length >= 2 ? args[1] : []) : args,
|
|
25
|
+
path: isApply ? path.slice(0, -1) : path,
|
|
25
26
|
});
|
|
26
27
|
},
|
|
27
28
|
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
import { getPostBody } from './getPostBody';
|
|
3
|
-
|
|
4
|
-
test('has body', async () => {
|
|
5
|
-
const body = {};
|
|
6
|
-
const resolvedBody = await getPostBody({
|
|
7
|
-
req: {
|
|
8
|
-
body,
|
|
9
|
-
headers: {
|
|
10
|
-
'content-type': 'application/json',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
} as any);
|
|
14
|
-
expect(resolvedBody).toMatchInlineSnapshot(`
|
|
15
|
-
Object {
|
|
16
|
-
"data": Object {},
|
|
17
|
-
"ok": true,
|
|
18
|
-
"preprocessed": true,
|
|
19
|
-
}
|
|
20
|
-
`);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('req as eventemitter', async () => {
|
|
24
|
-
const events = new EventEmitter();
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
events.emit(
|
|
27
|
-
'data',
|
|
28
|
-
JSON.stringify({
|
|
29
|
-
hello: 'there',
|
|
30
|
-
}),
|
|
31
|
-
);
|
|
32
|
-
events.emit('end');
|
|
33
|
-
}, 5);
|
|
34
|
-
|
|
35
|
-
(events as any).headers = {};
|
|
36
|
-
const result = await getPostBody({
|
|
37
|
-
req: events,
|
|
38
|
-
} as any);
|
|
39
|
-
|
|
40
|
-
expect(result.ok).toBeTruthy();
|
|
41
|
-
expect((result as any).data).toBeTruthy();
|
|
42
|
-
expect(result).toMatchInlineSnapshot(`
|
|
43
|
-
Object {
|
|
44
|
-
"data": "{\\"hello\\":\\"there\\"}",
|
|
45
|
-
"ok": true,
|
|
46
|
-
"preprocessed": false,
|
|
47
|
-
}
|
|
48
|
-
`);
|
|
49
|
-
});
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { observable, share, tap } from '.';
|
|
2
|
-
|
|
3
|
-
test('vanilla observable - complete()', () => {
|
|
4
|
-
const obs = observable<number, Error>((observer) => {
|
|
5
|
-
observer.next(1);
|
|
6
|
-
observer.complete();
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const next = vi.fn();
|
|
10
|
-
const error = vi.fn();
|
|
11
|
-
const complete = vi.fn();
|
|
12
|
-
obs.subscribe({
|
|
13
|
-
next,
|
|
14
|
-
error,
|
|
15
|
-
complete,
|
|
16
|
-
});
|
|
17
|
-
expect(next.mock.calls).toHaveLength(1);
|
|
18
|
-
expect(complete.mock.calls).toHaveLength(1);
|
|
19
|
-
expect(error.mock.calls).toHaveLength(0);
|
|
20
|
-
expect(next.mock.calls[0]![0]!).toBe(1);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('vanilla observable - unsubscribe()', () => {
|
|
24
|
-
const obs$ = observable<number, Error>((observer) => {
|
|
25
|
-
observer.next(1);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const next = vi.fn();
|
|
29
|
-
const error = vi.fn();
|
|
30
|
-
const complete = vi.fn();
|
|
31
|
-
const sub = obs$.subscribe({
|
|
32
|
-
next,
|
|
33
|
-
error,
|
|
34
|
-
complete,
|
|
35
|
-
});
|
|
36
|
-
sub.unsubscribe();
|
|
37
|
-
expect(next.mock.calls).toHaveLength(1);
|
|
38
|
-
expect(complete.mock.calls).toHaveLength(0);
|
|
39
|
-
expect(error.mock.calls).toHaveLength(0);
|
|
40
|
-
expect(next.mock.calls[0]![0]!).toBe(1);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test('pipe - combine operators', () => {
|
|
44
|
-
const taps = {
|
|
45
|
-
next: vi.fn(),
|
|
46
|
-
complete: vi.fn(),
|
|
47
|
-
error: vi.fn(),
|
|
48
|
-
};
|
|
49
|
-
const obs = observable<number, Error>((observer) => {
|
|
50
|
-
observer.next(1);
|
|
51
|
-
}).pipe(
|
|
52
|
-
// operators:
|
|
53
|
-
share(),
|
|
54
|
-
tap(taps),
|
|
55
|
-
);
|
|
56
|
-
{
|
|
57
|
-
const next = vi.fn();
|
|
58
|
-
const error = vi.fn();
|
|
59
|
-
const complete = vi.fn();
|
|
60
|
-
obs.subscribe({
|
|
61
|
-
next,
|
|
62
|
-
error,
|
|
63
|
-
complete,
|
|
64
|
-
});
|
|
65
|
-
expect(next.mock.calls).toHaveLength(1);
|
|
66
|
-
expect(complete.mock.calls).toHaveLength(0);
|
|
67
|
-
expect(error.mock.calls).toHaveLength(0);
|
|
68
|
-
expect(next.mock.calls[0]![0]!).toBe(1);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
const next = vi.fn();
|
|
73
|
-
const error = vi.fn();
|
|
74
|
-
const complete = vi.fn();
|
|
75
|
-
obs.subscribe({
|
|
76
|
-
next,
|
|
77
|
-
error,
|
|
78
|
-
complete,
|
|
79
|
-
});
|
|
80
|
-
expect(next.mock.calls).toHaveLength(0);
|
|
81
|
-
expect(complete.mock.calls).toHaveLength(0);
|
|
82
|
-
expect(error.mock.calls).toHaveLength(0);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
expect({
|
|
86
|
-
next: taps.next.mock.calls,
|
|
87
|
-
error: taps.error.mock.calls,
|
|
88
|
-
complete: taps.complete.mock.calls,
|
|
89
|
-
}).toMatchInlineSnapshot(`
|
|
90
|
-
Object {
|
|
91
|
-
"complete": Array [],
|
|
92
|
-
"error": Array [],
|
|
93
|
-
"next": Array [
|
|
94
|
-
Array [
|
|
95
|
-
1,
|
|
96
|
-
],
|
|
97
|
-
],
|
|
98
|
-
}
|
|
99
|
-
`);
|
|
100
|
-
});
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
import { map } from '.';
|
|
3
|
-
import { observable } from '../observable';
|
|
4
|
-
|
|
5
|
-
interface SubscriptionEvents<TOutput> {
|
|
6
|
-
data: (data: TOutput) => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare interface CustomEventEmitter<TOutput> {
|
|
10
|
-
on<U extends keyof SubscriptionEvents<TOutput>>(
|
|
11
|
-
event: U,
|
|
12
|
-
listener: SubscriptionEvents<TOutput>[U],
|
|
13
|
-
): this;
|
|
14
|
-
|
|
15
|
-
once<U extends keyof SubscriptionEvents<TOutput>>(
|
|
16
|
-
event: U,
|
|
17
|
-
listener: SubscriptionEvents<TOutput>[U],
|
|
18
|
-
): this;
|
|
19
|
-
|
|
20
|
-
emit<U extends keyof SubscriptionEvents<TOutput>>(
|
|
21
|
-
event: U,
|
|
22
|
-
...args: Parameters<SubscriptionEvents<TOutput>[U]>
|
|
23
|
-
): boolean;
|
|
24
|
-
}
|
|
25
|
-
class CustomEventEmitter<TOutput>
|
|
26
|
-
extends EventEmitter
|
|
27
|
-
implements CustomEventEmitter<TOutput> {}
|
|
28
|
-
test('map', () => {
|
|
29
|
-
type EventShape = { num: number };
|
|
30
|
-
const ee = new CustomEventEmitter<EventShape>();
|
|
31
|
-
const eventObservable = observable<EventShape, unknown>((observer) => {
|
|
32
|
-
const callback = (data: EventShape) => {
|
|
33
|
-
observer.next(data);
|
|
34
|
-
};
|
|
35
|
-
ee.on('data', callback);
|
|
36
|
-
|
|
37
|
-
return () => {
|
|
38
|
-
ee.off('data', callback);
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
const pipeCalls = vi.fn();
|
|
42
|
-
const piped = eventObservable.pipe(
|
|
43
|
-
map((...args) => {
|
|
44
|
-
pipeCalls(...args);
|
|
45
|
-
const [value] = args;
|
|
46
|
-
return value.num;
|
|
47
|
-
}),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const next = vi.fn();
|
|
51
|
-
const subscription = piped.subscribe({
|
|
52
|
-
next(value) {
|
|
53
|
-
expectTypeOf<number>(value);
|
|
54
|
-
next(value);
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
expect(next).not.toHaveBeenCalled();
|
|
58
|
-
ee.emit('data', { num: 1 });
|
|
59
|
-
ee.emit('data', { num: 2 });
|
|
60
|
-
expect(next).toHaveBeenCalledTimes(2);
|
|
61
|
-
expect(next.mock.calls).toMatchInlineSnapshot(`
|
|
62
|
-
Array [
|
|
63
|
-
Array [
|
|
64
|
-
1,
|
|
65
|
-
],
|
|
66
|
-
Array [
|
|
67
|
-
2,
|
|
68
|
-
],
|
|
69
|
-
]
|
|
70
|
-
`);
|
|
71
|
-
expect(pipeCalls.mock.calls).toMatchInlineSnapshot(`
|
|
72
|
-
Array [
|
|
73
|
-
Array [
|
|
74
|
-
Object {
|
|
75
|
-
"num": 1,
|
|
76
|
-
},
|
|
77
|
-
0,
|
|
78
|
-
],
|
|
79
|
-
Array [
|
|
80
|
-
Object {
|
|
81
|
-
"num": 2,
|
|
82
|
-
},
|
|
83
|
-
1,
|
|
84
|
-
],
|
|
85
|
-
]
|
|
86
|
-
`);
|
|
87
|
-
|
|
88
|
-
expect(ee.listeners('data')).toHaveLength(1);
|
|
89
|
-
subscription.unsubscribe();
|
|
90
|
-
expect(ee.listeners('data')).toHaveLength(0);
|
|
91
|
-
});
|