@orpc/standard-server-node 0.0.0-next.7e41bc4 → 0.0.0-next.cc4cb21
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/index.js +7 -7
- package/dist/src/event-source.d.ts +2 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// src/body.ts
|
|
2
2
|
import { Readable as Readable2 } from "node:stream";
|
|
3
|
-
import {
|
|
3
|
+
import { isAsyncIteratorObject, parseEmptyableJSON as parseEmptyableJSON2 } from "@orpc/shared";
|
|
4
|
+
import { contentDisposition, parseContentDisposition } from "@orpc/standard-server";
|
|
4
5
|
|
|
5
6
|
// src/event-source.ts
|
|
6
7
|
import { Readable } from "node:stream";
|
|
8
|
+
import { isTypescriptObject, parseEmptyableJSON } from "@orpc/shared";
|
|
7
9
|
import {
|
|
8
10
|
encodeEventMessage,
|
|
9
11
|
ErrorEvent,
|
|
10
12
|
EventDecoderStream,
|
|
11
13
|
getEventMeta,
|
|
12
|
-
isEventMetaContainer,
|
|
13
|
-
parseEmptyableJSON,
|
|
14
14
|
UnknownEvent,
|
|
15
15
|
withEventMeta
|
|
16
16
|
} from "@orpc/standard-server";
|
|
@@ -27,7 +27,7 @@ function toEventIterator(stream) {
|
|
|
27
27
|
switch (value.event) {
|
|
28
28
|
case "message": {
|
|
29
29
|
let message = parseEmptyableJSON(value.data);
|
|
30
|
-
if (
|
|
30
|
+
if (isTypescriptObject(message)) {
|
|
31
31
|
message = withEventMeta(message, value);
|
|
32
32
|
}
|
|
33
33
|
yield message;
|
|
@@ -42,7 +42,7 @@ function toEventIterator(stream) {
|
|
|
42
42
|
}
|
|
43
43
|
case "done": {
|
|
44
44
|
let done2 = parseEmptyableJSON(value.data);
|
|
45
|
-
if (
|
|
45
|
+
if (isTypescriptObject(done2)) {
|
|
46
46
|
done2 = withEventMeta(done2, value);
|
|
47
47
|
}
|
|
48
48
|
return done2;
|
|
@@ -124,7 +124,7 @@ async function toStandardBody(req) {
|
|
|
124
124
|
if (contentType.startsWith("text/event-stream")) {
|
|
125
125
|
return toEventIterator(req);
|
|
126
126
|
}
|
|
127
|
-
if (contentType.startsWith("text/")) {
|
|
127
|
+
if (contentType.startsWith("text/plain")) {
|
|
128
128
|
return _streamToString(req);
|
|
129
129
|
}
|
|
130
130
|
return _streamToFile(req, "blob", contentType);
|
|
@@ -186,7 +186,7 @@ async function _streamToFile(stream, fileName, contentType) {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
// src/request.ts
|
|
189
|
-
import { once } from "@orpc/
|
|
189
|
+
import { once } from "@orpc/shared";
|
|
190
190
|
|
|
191
191
|
// src/signal.ts
|
|
192
192
|
function toAbortSignal(res) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { JsonValue } from '@orpc/standard-server';
|
|
2
1
|
import { Readable } from 'node:stream';
|
|
3
|
-
export declare function toEventIterator(stream: Readable): AsyncGenerator<
|
|
4
|
-
export declare function toEventStream(iterator: AsyncIterator<
|
|
2
|
+
export declare function toEventIterator(stream: Readable): AsyncGenerator<unknown | void, unknown | void, void>;
|
|
3
|
+
export declare function toEventStream(iterator: AsyncIterator<unknown | void, unknown | void, void>): Readable;
|
|
5
4
|
//# sourceMappingURL=event-source.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/standard-server-node",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.cc4cb21",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@orpc/standard-server": "0.0.0-next.
|
|
31
|
+
"@orpc/standard-server": "0.0.0-next.cc4cb21",
|
|
32
|
+
"@orpc/shared": "0.0.0-next.cc4cb21"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@types/node": "^22.13.1",
|