@orpc/standard-server-peer 1.4.3 → 1.4.5
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.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Promisable, AsyncIdQueueCloseOptions as AsyncIdQueueCloseOptions$1,
|
1
|
+
import { Promisable, AsyncIdQueueCloseOptions as AsyncIdQueueCloseOptions$1, AsyncIteratorClassCleanupFn, AsyncIteratorClass } from '@orpc/shared';
|
2
2
|
import { StandardRequest, StandardResponse, EventMeta, StandardHeaders } from '@orpc/standard-server';
|
3
3
|
|
4
|
-
type EncodedMessage = string | ArrayBufferLike
|
4
|
+
type EncodedMessage = string | ArrayBufferLike;
|
5
5
|
interface EncodedMessageSendFn {
|
6
6
|
(message: EncodedMessage): Promisable<void>;
|
7
7
|
}
|
@@ -78,7 +78,7 @@ declare class AsyncIdQueue<T> {
|
|
78
78
|
assertOpen(id: number): void;
|
79
79
|
}
|
80
80
|
|
81
|
-
declare function toEventIterator(queue: AsyncIdQueue<EventIteratorPayload>, id: number, cleanup:
|
81
|
+
declare function toEventIterator(queue: AsyncIdQueue<EventIteratorPayload>, id: number, cleanup: AsyncIteratorClassCleanupFn): AsyncIteratorClass<unknown>;
|
82
82
|
declare function resolveEventIterator(iterator: AsyncIterator<any>, callback: (payload: EventIteratorPayload) => Promise<'next' | 'abort'>): Promise<void>;
|
83
83
|
|
84
84
|
interface ServerPeerCloseOptions extends AsyncIdQueueCloseOptions$1 {
|
package/dist/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Promisable, AsyncIdQueueCloseOptions as AsyncIdQueueCloseOptions$1,
|
1
|
+
import { Promisable, AsyncIdQueueCloseOptions as AsyncIdQueueCloseOptions$1, AsyncIteratorClassCleanupFn, AsyncIteratorClass } from '@orpc/shared';
|
2
2
|
import { StandardRequest, StandardResponse, EventMeta, StandardHeaders } from '@orpc/standard-server';
|
3
3
|
|
4
|
-
type EncodedMessage = string | ArrayBufferLike
|
4
|
+
type EncodedMessage = string | ArrayBufferLike;
|
5
5
|
interface EncodedMessageSendFn {
|
6
6
|
(message: EncodedMessage): Promisable<void>;
|
7
7
|
}
|
@@ -78,7 +78,7 @@ declare class AsyncIdQueue<T> {
|
|
78
78
|
assertOpen(id: number): void;
|
79
79
|
}
|
80
80
|
|
81
|
-
declare function toEventIterator(queue: AsyncIdQueue<EventIteratorPayload>, id: number, cleanup:
|
81
|
+
declare function toEventIterator(queue: AsyncIdQueue<EventIteratorPayload>, id: number, cleanup: AsyncIteratorClassCleanupFn): AsyncIteratorClass<unknown>;
|
82
82
|
declare function resolveEventIterator(iterator: AsyncIterator<any>, callback: (payload: EventIteratorPayload) => Promise<'next' | 'abort'>): Promise<void>;
|
83
83
|
|
84
84
|
interface ServerPeerCloseOptions extends AsyncIdQueueCloseOptions$1 {
|
package/dist/index.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { isAsyncIteratorObject, stringifyJSON,
|
1
|
+
import { isAsyncIteratorObject, stringifyJSON, AsyncIteratorClass, isTypescriptObject, SequentialIdGenerator, AsyncIdQueue } from '@orpc/shared';
|
2
2
|
import { flattenHeader, getFilenameFromContentDisposition, generateContentDisposition, withEventMeta, ErrorEvent, getEventMeta } from '@orpc/standard-server';
|
3
3
|
|
4
4
|
var MessageType = /* @__PURE__ */ ((MessageType2) => {
|
@@ -172,7 +172,7 @@ async function encodeRawMessage(data, blobData) {
|
|
172
172
|
new TextEncoder().encode(json),
|
173
173
|
new Uint8Array([JSON_AND_BINARY_DELIMITER]),
|
174
174
|
blobData
|
175
|
-
]);
|
175
|
+
]).arrayBuffer();
|
176
176
|
}
|
177
177
|
async function decodeRawMessage(raw) {
|
178
178
|
if (typeof raw === "string") {
|
@@ -193,7 +193,7 @@ async function decodeRawMessage(raw) {
|
|
193
193
|
}
|
194
194
|
|
195
195
|
function toEventIterator(queue, id, cleanup) {
|
196
|
-
return
|
196
|
+
return new AsyncIteratorClass(async () => {
|
197
197
|
const item = await queue.pull(id);
|
198
198
|
switch (item.event) {
|
199
199
|
case "message": {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/standard-server-peer",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.4.
|
4
|
+
"version": "1.4.5",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://unnoq.com",
|
7
7
|
"repository": {
|
@@ -23,8 +23,8 @@
|
|
23
23
|
"dist"
|
24
24
|
],
|
25
25
|
"dependencies": {
|
26
|
-
"@orpc/shared": "1.4.
|
27
|
-
"@orpc/standard-server": "1.4.
|
26
|
+
"@orpc/shared": "1.4.5",
|
27
|
+
"@orpc/standard-server": "1.4.5"
|
28
28
|
},
|
29
29
|
"scripts": {
|
30
30
|
"build": "unbuild",
|