@orpc/node 2.0.0-beta.49 → 2.0.0-beta.51
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/README.md +10 -8
- package/dist/batch-response-compression-handler-plugin.d.ts +30 -29
- package/dist/batch-response-compression-handler-plugin.js +104 -125
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -3
- package/dist/multipart.js +160 -211
- package/dist/static-file-handler-plugin.d.ts +74 -74
- package/dist/static-file-handler-plugin.js +175 -200
- package/dist/tmp-file-upload-handler-plugin.d.ts +92 -101
- package/dist/tmp-file-upload-handler-plugin.js +379 -451
- package/package.json +7 -7
- package/dist/multipart.d.ts +0 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/node",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.51",
|
|
4
4
|
"description": "Node.js plugins for oRPC: static file serving, temporary file uploads, and batch response compression",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compression",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@orpc/server": "2.0.0-beta.
|
|
40
|
-
"@orpc/shared": "2.0.0-beta.
|
|
41
|
-
"@standard-server/core": "~0.
|
|
42
|
-
"@standard-server/fetch": "~0.
|
|
43
|
-
"@standard-server/node": "~0.
|
|
39
|
+
"@orpc/server": "2.0.0-beta.51",
|
|
40
|
+
"@orpc/shared": "2.0.0-beta.51",
|
|
41
|
+
"@standard-server/core": "~0.16.0",
|
|
42
|
+
"@standard-server/fetch": "~0.16.0",
|
|
43
|
+
"@standard-server/node": "~0.16.0",
|
|
44
44
|
"mime": "^4.1.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@orpc/client": "2.0.0-beta.
|
|
47
|
+
"@orpc/client": "2.0.0-beta.51",
|
|
48
48
|
"supertest": "^7.3.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {}
|
package/dist/multipart.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Buffer } from 'node:buffer';
|
|
2
|
-
export interface MultipartPart {
|
|
3
|
-
/**
|
|
4
|
-
* The `name` parameter of the part's `Content-Disposition` header, with the
|
|
5
|
-
* serialization escapes of `"`, `\r`, and `\n` decoded.
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* The `filename` parameter of the part's `Content-Disposition` header,
|
|
10
|
-
* decoded like `name`, or `undefined` when the part is a plain field. An
|
|
11
|
-
* empty string is a file part, matching how browsers submit an empty file
|
|
12
|
-
* input.
|
|
13
|
-
*/
|
|
14
|
-
filename: string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* The part's `Content-Type` header value, if present.
|
|
17
|
-
*/
|
|
18
|
-
type: string | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* The size in bytes of the part's header block, including the blank line.
|
|
21
|
-
*/
|
|
22
|
-
headerSize: number;
|
|
23
|
-
}
|
|
24
|
-
export interface MultipartPartWriter {
|
|
25
|
-
/**
|
|
26
|
-
* Receives one chunk of the part's body. The chunk is only valid until the
|
|
27
|
-
* returned promise resolves, so it must be consumed or copied synchronously.
|
|
28
|
-
*/
|
|
29
|
-
write(chunk: Buffer): void | Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Called once after the part's final chunk.
|
|
32
|
-
*/
|
|
33
|
-
end(): void | Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Parses a `multipart/form-data` byte stream part by part, so a part's body can be
|
|
37
|
-
* consumed as it arrives instead of being buffered whole. Bodies are delivered to the
|
|
38
|
-
* writer `onPart` returns, with writer promises awaited for backpressure, so parts are
|
|
39
|
-
* processed strictly one at a time.
|
|
40
|
-
*
|
|
41
|
-
* Line endings are strictly CRLF, every part must carry a `form-data` content
|
|
42
|
-
* disposition with a `name` parameter, and a malformed or truncated body throws a
|
|
43
|
-
* `TypeError`, matching the standard parser's strictness.
|
|
44
|
-
*
|
|
45
|
-
* @see https://www.rfc-editor.org/rfc/rfc7578
|
|
46
|
-
* @see https://www.rfc-editor.org/rfc/rfc2046#section-5.1.1
|
|
47
|
-
*/
|
|
48
|
-
export declare function parseMultipart(source: ReadableStream<Uint8Array>, boundary: string, onPart: (part: MultipartPart) => MultipartPartWriter | Promise<MultipartPartWriter>): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Extracts the `key=value` parameters that follow a header's leading token.
|
|
51
|
-
* The first occurrence of a parameter wins.
|
|
52
|
-
*
|
|
53
|
-
* A backslash inside a quoted value is a literal character rather than an
|
|
54
|
-
* escape, matching the standard parser: the multipart serialization escapes
|
|
55
|
-
* `"` as `%22`, so a quote can never occur inside a value, while filenames
|
|
56
|
-
* with literal backslashes are common and must survive verbatim.
|
|
57
|
-
*
|
|
58
|
-
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart/form-data-encoding-algorithm
|
|
59
|
-
*/
|
|
60
|
-
export declare function parseHeaderParameters(header: string): Map<string, string>;
|