@orpc/standard-server 1.0.0-beta.4 → 1.0.0-beta.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/README.md +1 -0
- package/dist/index.d.mts +3 -13
- package/dist/index.d.ts +3 -13
- package/dist/index.mjs +20 -2
- package/package.json +2 -2
package/README.md
CHANGED
@@ -53,6 +53,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
|
|
53
53
|
- [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
|
54
54
|
- [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
|
55
55
|
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
|
56
|
+
- [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
|
56
57
|
- [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
|
57
58
|
- [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
|
58
59
|
- [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
|
package/dist/index.d.mts
CHANGED
@@ -66,12 +66,6 @@ interface StandardRequest {
|
|
66
66
|
signal: AbortSignal | undefined;
|
67
67
|
}
|
68
68
|
interface StandardLazyRequest extends Omit<StandardRequest, 'body'> {
|
69
|
-
/**
|
70
|
-
* Can be { adapter: 'fetch', request: Request } | { adapter: 'node', request: IncomingMessage, response: ServerResponse }
|
71
|
-
*/
|
72
|
-
raw: Record<string, unknown> & {
|
73
|
-
adapter: string;
|
74
|
-
};
|
75
69
|
/**
|
76
70
|
* The body has been parsed based on the content-type header.
|
77
71
|
* This method can safely call multiple times (cached).
|
@@ -87,12 +81,6 @@ interface StandardResponse {
|
|
87
81
|
body: StandardBody;
|
88
82
|
}
|
89
83
|
interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
|
90
|
-
/**
|
91
|
-
* Can be { adapter: 'fetch', response: Response }
|
92
|
-
*/
|
93
|
-
raw: Record<string, unknown> & {
|
94
|
-
adapter: string;
|
95
|
-
};
|
96
84
|
/**
|
97
85
|
* The body has been parsed based on the content-type header.
|
98
86
|
* This method can safely call multiple times (cached).
|
@@ -100,4 +88,6 @@ interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
|
|
100
88
|
body: () => Promise<StandardBody>;
|
101
89
|
}
|
102
90
|
|
103
|
-
|
91
|
+
declare function mergeStandardHeaders(a: StandardHeaders, b: StandardHeaders): StandardHeaders;
|
92
|
+
|
93
|
+
export { ErrorEvent, type ErrorEventOptions, EventDecoder, EventDecoderError, type EventDecoderOptions, EventDecoderStream, EventEncoderError, type EventMessage, type EventMeta, type StandardBody, type StandardHeaders, type StandardLazyRequest, type StandardLazyResponse, type StandardRequest, type StandardResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, getEventMeta, mergeStandardHeaders, withEventMeta };
|
package/dist/index.d.ts
CHANGED
@@ -66,12 +66,6 @@ interface StandardRequest {
|
|
66
66
|
signal: AbortSignal | undefined;
|
67
67
|
}
|
68
68
|
interface StandardLazyRequest extends Omit<StandardRequest, 'body'> {
|
69
|
-
/**
|
70
|
-
* Can be { adapter: 'fetch', request: Request } | { adapter: 'node', request: IncomingMessage, response: ServerResponse }
|
71
|
-
*/
|
72
|
-
raw: Record<string, unknown> & {
|
73
|
-
adapter: string;
|
74
|
-
};
|
75
69
|
/**
|
76
70
|
* The body has been parsed based on the content-type header.
|
77
71
|
* This method can safely call multiple times (cached).
|
@@ -87,12 +81,6 @@ interface StandardResponse {
|
|
87
81
|
body: StandardBody;
|
88
82
|
}
|
89
83
|
interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
|
90
|
-
/**
|
91
|
-
* Can be { adapter: 'fetch', response: Response }
|
92
|
-
*/
|
93
|
-
raw: Record<string, unknown> & {
|
94
|
-
adapter: string;
|
95
|
-
};
|
96
84
|
/**
|
97
85
|
* The body has been parsed based on the content-type header.
|
98
86
|
* This method can safely call multiple times (cached).
|
@@ -100,4 +88,6 @@ interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
|
|
100
88
|
body: () => Promise<StandardBody>;
|
101
89
|
}
|
102
90
|
|
103
|
-
|
91
|
+
declare function mergeStandardHeaders(a: StandardHeaders, b: StandardHeaders): StandardHeaders;
|
92
|
+
|
93
|
+
export { ErrorEvent, type ErrorEventOptions, EventDecoder, EventDecoderError, type EventDecoderOptions, EventDecoderStream, EventEncoderError, type EventMessage, type EventMeta, type StandardBody, type StandardHeaders, type StandardLazyRequest, type StandardLazyResponse, type StandardRequest, type StandardResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, getEventMeta, mergeStandardHeaders, withEventMeta };
|
package/dist/index.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { isTypescriptObject } from '@orpc/shared';
|
1
|
+
import { isTypescriptObject, toArray } from '@orpc/shared';
|
2
2
|
export { contentDisposition, parse as parseContentDisposition } from '@tinyhttp/content-disposition';
|
3
3
|
|
4
4
|
class EventEncoderError extends TypeError {
|
@@ -183,4 +183,22 @@ function getEventMeta(container) {
|
|
183
183
|
return isTypescriptObject(container) ? Reflect.get(container, EVENT_SOURCE_META_SYMBOL) : void 0;
|
184
184
|
}
|
185
185
|
|
186
|
-
|
186
|
+
function mergeStandardHeaders(a, b) {
|
187
|
+
const merged = { ...a };
|
188
|
+
for (const key in b) {
|
189
|
+
if (Array.isArray(b[key])) {
|
190
|
+
merged[key] = [...toArray(merged[key]), ...b[key]];
|
191
|
+
} else if (b[key] !== void 0) {
|
192
|
+
if (Array.isArray(merged[key])) {
|
193
|
+
merged[key] = [...merged[key], b[key]];
|
194
|
+
} else if (merged[key] !== void 0) {
|
195
|
+
merged[key] = [merged[key], b[key]];
|
196
|
+
} else {
|
197
|
+
merged[key] = b[key];
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
return merged;
|
202
|
+
}
|
203
|
+
|
204
|
+
export { ErrorEvent, EventDecoder, EventDecoderError, EventDecoderStream, EventEncoderError, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, getEventMeta, mergeStandardHeaders, withEventMeta };
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/standard-server",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.0.0-beta.
|
4
|
+
"version": "1.0.0-beta.5",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://unnoq.com",
|
7
7
|
"repository": {
|
@@ -24,7 +24,7 @@
|
|
24
24
|
],
|
25
25
|
"dependencies": {
|
26
26
|
"@tinyhttp/content-disposition": "^2.2.2",
|
27
|
-
"@orpc/shared": "1.0.0-beta.
|
27
|
+
"@orpc/shared": "1.0.0-beta.5"
|
28
28
|
},
|
29
29
|
"scripts": {
|
30
30
|
"build": "unbuild",
|