@orpc/standard-server 0.0.0-next.eea495c → 0.0.0-next.f16d90e
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 +1 -0
- package/dist/batch/index.d.mts +1 -1
- package/dist/batch/index.d.ts +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +33 -2
- package/dist/shared/{standard-server.R_NaHlxw.d.mts → standard-server.BD8Sg1A5.d.mts} +1 -1
- package/dist/shared/{standard-server.R_NaHlxw.d.ts → standard-server.BD8Sg1A5.d.ts} +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
@@ -49,6 +49,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
|
|
49
49
|
- [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
|
50
50
|
- [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
|
51
51
|
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
|
52
|
+
- [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with NestJS.
|
52
53
|
- [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
|
53
54
|
- [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
|
54
55
|
- [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
|
package/dist/batch/index.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { S as StandardHeaders,
|
1
|
+
import { S as StandardHeaders, c as StandardRequest, e as StandardResponse } from '../shared/standard-server.BD8Sg1A5.mjs';
|
2
2
|
|
3
3
|
interface ToBatchRequestOptions {
|
4
4
|
url: URL;
|
package/dist/batch/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { S as StandardHeaders,
|
1
|
+
import { S as StandardHeaders, c as StandardRequest, e as StandardResponse } from '../shared/standard-server.BD8Sg1A5.js';
|
2
2
|
|
3
3
|
interface ToBatchRequestOptions {
|
4
4
|
url: URL;
|
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { S as StandardHeaders } from './shared/standard-server.
|
2
|
-
export {
|
1
|
+
import { S as StandardHeaders, a as StandardLazyResponse } from './shared/standard-server.BD8Sg1A5.mjs';
|
2
|
+
export { b as StandardBody, d as StandardLazyRequest, c as StandardRequest, e as StandardResponse } from './shared/standard-server.BD8Sg1A5.mjs';
|
3
3
|
|
4
4
|
interface EventMessage {
|
5
5
|
event: string | undefined;
|
@@ -55,6 +55,8 @@ declare function getEventMeta(container: unknown): EventMeta | undefined;
|
|
55
55
|
declare function generateContentDisposition(filename: string): string;
|
56
56
|
declare function getFilenameFromContentDisposition(contentDisposition: string): string | undefined;
|
57
57
|
declare function mergeStandardHeaders(a: StandardHeaders, b: StandardHeaders): StandardHeaders;
|
58
|
+
declare function flattenHeader(header: string | readonly string[] | undefined): string | undefined;
|
59
|
+
declare function replicateStandardLazyResponse(response: StandardLazyResponse, count: number): StandardLazyResponse[];
|
58
60
|
|
59
|
-
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, withEventMeta };
|
61
|
+
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, StandardLazyResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
60
62
|
export type { ErrorEventOptions, EventDecoderOptions, EventMessage, EventMeta };
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { S as StandardHeaders } from './shared/standard-server.
|
2
|
-
export {
|
1
|
+
import { S as StandardHeaders, a as StandardLazyResponse } from './shared/standard-server.BD8Sg1A5.js';
|
2
|
+
export { b as StandardBody, d as StandardLazyRequest, c as StandardRequest, e as StandardResponse } from './shared/standard-server.BD8Sg1A5.js';
|
3
3
|
|
4
4
|
interface EventMessage {
|
5
5
|
event: string | undefined;
|
@@ -55,6 +55,8 @@ declare function getEventMeta(container: unknown): EventMeta | undefined;
|
|
55
55
|
declare function generateContentDisposition(filename: string): string;
|
56
56
|
declare function getFilenameFromContentDisposition(contentDisposition: string): string | undefined;
|
57
57
|
declare function mergeStandardHeaders(a: StandardHeaders, b: StandardHeaders): StandardHeaders;
|
58
|
+
declare function flattenHeader(header: string | readonly string[] | undefined): string | undefined;
|
59
|
+
declare function replicateStandardLazyResponse(response: StandardLazyResponse, count: number): StandardLazyResponse[];
|
58
60
|
|
59
|
-
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, withEventMeta };
|
61
|
+
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, StandardLazyResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
60
62
|
export type { ErrorEventOptions, EventDecoderOptions, EventMessage, EventMeta };
|
package/dist/index.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { isTypescriptObject, toArray } from '@orpc/shared';
|
1
|
+
import { isTypescriptObject, toArray, once, isAsyncIteratorObject, replicateAsyncIterator } from '@orpc/shared';
|
2
2
|
|
3
3
|
class EventEncoderError extends TypeError {
|
4
4
|
}
|
@@ -214,5 +214,36 @@ function mergeStandardHeaders(a, b) {
|
|
214
214
|
}
|
215
215
|
return merged;
|
216
216
|
}
|
217
|
+
function flattenHeader(header) {
|
218
|
+
if (typeof header === "string" || header === void 0) {
|
219
|
+
return header;
|
220
|
+
}
|
221
|
+
if (header.length === 0) {
|
222
|
+
return void 0;
|
223
|
+
}
|
224
|
+
return header.join(", ");
|
225
|
+
}
|
226
|
+
function replicateStandardLazyResponse(response, count) {
|
227
|
+
const replicated = [];
|
228
|
+
let bodyPromise;
|
229
|
+
let replicatedAsyncIteratorObjects;
|
230
|
+
for (let i = 0; i < count; i++) {
|
231
|
+
replicated.push({
|
232
|
+
...response,
|
233
|
+
body: once(async () => {
|
234
|
+
if (replicatedAsyncIteratorObjects) {
|
235
|
+
return replicatedAsyncIteratorObjects.shift();
|
236
|
+
}
|
237
|
+
const body = await (bodyPromise ??= response.body());
|
238
|
+
if (!isAsyncIteratorObject(body)) {
|
239
|
+
return body;
|
240
|
+
}
|
241
|
+
replicatedAsyncIteratorObjects = replicateAsyncIterator(body, count);
|
242
|
+
return replicatedAsyncIteratorObjects.shift();
|
243
|
+
})
|
244
|
+
});
|
245
|
+
}
|
246
|
+
return replicated;
|
247
|
+
}
|
217
248
|
|
218
|
-
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, withEventMeta };
|
249
|
+
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
@@ -35,4 +35,4 @@ interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
|
|
35
35
|
body: () => Promise<StandardBody>;
|
36
36
|
}
|
37
37
|
|
38
|
-
export type { StandardHeaders as S,
|
38
|
+
export type { StandardHeaders as S, StandardLazyResponse as a, StandardBody as b, StandardRequest as c, StandardLazyRequest as d, StandardResponse as e };
|
@@ -35,4 +35,4 @@ interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
|
|
35
35
|
body: () => Promise<StandardBody>;
|
36
36
|
}
|
37
37
|
|
38
|
-
export type { StandardHeaders as S,
|
38
|
+
export type { StandardHeaders as S, StandardLazyResponse as a, StandardBody as b, StandardRequest as c, StandardLazyRequest as d, StandardResponse as e };
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/standard-server",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.0-next.
|
4
|
+
"version": "0.0.0-next.f16d90e",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://unnoq.com",
|
7
7
|
"repository": {
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"dist"
|
29
29
|
],
|
30
30
|
"dependencies": {
|
31
|
-
"@orpc/shared": "0.0.0-next.
|
31
|
+
"@orpc/shared": "0.0.0-next.f16d90e"
|
32
32
|
},
|
33
33
|
"scripts": {
|
34
34
|
"build": "unbuild",
|