@orpc/standard-server 0.0.0-next.ec7d801 → 0.0.0-next.ed8babc
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 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +6 -3
- package/package.json +2 -2
package/README.md
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
- **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
|
31
31
|
- **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
|
32
32
|
- **📝 Contract-First Development**: Optionally define your API contract before implementation.
|
33
|
-
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
|
33
|
+
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
|
34
34
|
- **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
|
35
35
|
- **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
|
36
36
|
- **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
|
package/dist/index.d.mts
CHANGED
@@ -54,7 +54,7 @@ declare function withEventMeta<T extends object>(container: T, meta: EventMeta):
|
|
54
54
|
declare function getEventMeta(container: unknown): EventMeta | undefined;
|
55
55
|
|
56
56
|
interface experimental_HibernationEventIteratorCallback {
|
57
|
-
(id:
|
57
|
+
(id: string): void;
|
58
58
|
}
|
59
59
|
declare class experimental_HibernationEventIterator<T, TReturn = unknown, TNext = unknown> extends AsyncIteratorClass<T, TReturn, TNext> {
|
60
60
|
/**
|
@@ -69,6 +69,7 @@ declare function getFilenameFromContentDisposition(contentDisposition: string):
|
|
69
69
|
declare function mergeStandardHeaders(a: StandardHeaders, b: StandardHeaders): StandardHeaders;
|
70
70
|
declare function flattenHeader(header: string | readonly string[] | undefined): string | undefined;
|
71
71
|
declare function replicateStandardLazyResponse(response: StandardLazyResponse, count: number): StandardLazyResponse[];
|
72
|
+
declare function isEventIteratorHeaders(headers: StandardHeaders): boolean;
|
72
73
|
|
73
|
-
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, StandardLazyResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, experimental_HibernationEventIterator, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
74
|
+
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, StandardLazyResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, experimental_HibernationEventIterator, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, isEventIteratorHeaders, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
74
75
|
export type { ErrorEventOptions, EventDecoderOptions, EventMessage, EventMeta, experimental_HibernationEventIteratorCallback };
|
package/dist/index.d.ts
CHANGED
@@ -54,7 +54,7 @@ declare function withEventMeta<T extends object>(container: T, meta: EventMeta):
|
|
54
54
|
declare function getEventMeta(container: unknown): EventMeta | undefined;
|
55
55
|
|
56
56
|
interface experimental_HibernationEventIteratorCallback {
|
57
|
-
(id:
|
57
|
+
(id: string): void;
|
58
58
|
}
|
59
59
|
declare class experimental_HibernationEventIterator<T, TReturn = unknown, TNext = unknown> extends AsyncIteratorClass<T, TReturn, TNext> {
|
60
60
|
/**
|
@@ -69,6 +69,7 @@ declare function getFilenameFromContentDisposition(contentDisposition: string):
|
|
69
69
|
declare function mergeStandardHeaders(a: StandardHeaders, b: StandardHeaders): StandardHeaders;
|
70
70
|
declare function flattenHeader(header: string | readonly string[] | undefined): string | undefined;
|
71
71
|
declare function replicateStandardLazyResponse(response: StandardLazyResponse, count: number): StandardLazyResponse[];
|
72
|
+
declare function isEventIteratorHeaders(headers: StandardHeaders): boolean;
|
72
73
|
|
73
|
-
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, StandardLazyResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, experimental_HibernationEventIterator, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
74
|
+
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, StandardHeaders, StandardLazyResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, experimental_HibernationEventIterator, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, isEventIteratorHeaders, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
74
75
|
export type { ErrorEventOptions, EventDecoderOptions, EventMessage, EventMeta, experimental_HibernationEventIteratorCallback };
|
package/dist/index.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { isTypescriptObject, AsyncIteratorClass, toArray, once, isAsyncIteratorObject, replicateAsyncIterator } from '@orpc/shared';
|
1
|
+
import { isTypescriptObject, AsyncIteratorClass, tryDecodeURIComponent, toArray, once, isAsyncIteratorObject, replicateAsyncIterator } from '@orpc/shared';
|
2
2
|
|
3
3
|
class EventEncoderError extends TypeError {
|
4
4
|
}
|
@@ -207,7 +207,7 @@ function generateContentDisposition(filename) {
|
|
207
207
|
function getFilenameFromContentDisposition(contentDisposition) {
|
208
208
|
const encodedFilenameStarMatch = contentDisposition.match(/filename\*=(UTF-8'')?([^;]*)/i);
|
209
209
|
if (encodedFilenameStarMatch && typeof encodedFilenameStarMatch[2] === "string") {
|
210
|
-
return
|
210
|
+
return tryDecodeURIComponent(encodedFilenameStarMatch[2]);
|
211
211
|
}
|
212
212
|
const encodedFilenameMatch = contentDisposition.match(/filename="((?:\\"|[^"])*)"/i);
|
213
213
|
if (encodedFilenameMatch && typeof encodedFilenameMatch[1] === "string") {
|
@@ -262,5 +262,8 @@ function replicateStandardLazyResponse(response, count) {
|
|
262
262
|
}
|
263
263
|
return replicated;
|
264
264
|
}
|
265
|
+
function isEventIteratorHeaders(headers) {
|
266
|
+
return Boolean(flattenHeader(headers["content-type"])?.startsWith("text/event-stream") && flattenHeader(headers["content-disposition"]) === void 0);
|
267
|
+
}
|
265
268
|
|
266
|
-
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, experimental_HibernationEventIterator, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
269
|
+
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, experimental_HibernationEventIterator, flattenHeader, generateContentDisposition, getEventMeta, getFilenameFromContentDisposition, isEventIteratorHeaders, mergeStandardHeaders, replicateStandardLazyResponse, withEventMeta };
|
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.ed8babc",
|
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.ed8babc"
|
32
32
|
},
|
33
33
|
"scripts": {
|
34
34
|
"build": "unbuild",
|