@orpc/standard-server 0.0.0-next.cd121e3 → 0.0.0-next.d16a1b6

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 CHANGED
@@ -56,24 +56,44 @@ interface StandardHeaders {
56
56
  }
57
57
  type StandardBody = undefined | unknown | Blob | URLSearchParams | FormData | AsyncIterator<unknown | void, unknown | void, undefined>;
58
58
  interface StandardRequest {
59
+ method: string;
60
+ url: URL;
61
+ headers: StandardHeaders;
62
+ /**
63
+ * The body has been parsed based on the content-type header.
64
+ */
65
+ body: StandardBody;
66
+ signal: AbortSignal | undefined;
67
+ }
68
+ interface StandardLazyRequest extends Omit<StandardRequest, 'body'> {
59
69
  /**
60
70
  * Can be { request: Request } or { request: IncomingMessage, response: ServerResponse } based on the adapter.
61
71
  */
62
72
  raw: Record<string, unknown>;
63
- method: string;
64
- url: URL;
65
- headers: StandardHeaders;
66
73
  /**
67
- * The body has been parsed base on the content-type header.
74
+ * The body has been parsed based on the content-type header.
68
75
  * This method can safely call multiple times (cached).
69
76
  */
70
77
  body: () => Promise<StandardBody>;
71
- signal: AbortSignal | undefined;
72
78
  }
73
79
  interface StandardResponse {
74
80
  status: number;
75
81
  headers: StandardHeaders;
82
+ /**
83
+ * The body has been parsed based on the content-type header.
84
+ */
76
85
  body: StandardBody;
77
86
  }
87
+ interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
88
+ /**
89
+ * Can be { request: Request } or { request: IncomingMessage, response: ServerResponse } based on the adapter.
90
+ */
91
+ raw: Record<string, unknown>;
92
+ /**
93
+ * The body has been parsed based on the content-type header.
94
+ * This method can safely call multiple times (cached).
95
+ */
96
+ body: () => Promise<StandardBody>;
97
+ }
78
98
 
79
- export { ErrorEvent, type ErrorEventOptions, EventDecoder, EventDecoderError, type EventDecoderOptions, EventDecoderStream, EventEncoderError, type EventMessage, type EventMeta, type StandardBody, type StandardHeaders, type StandardRequest, type StandardResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, getEventMeta, withEventMeta };
99
+ 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, withEventMeta };
package/dist/index.d.ts CHANGED
@@ -56,24 +56,44 @@ interface StandardHeaders {
56
56
  }
57
57
  type StandardBody = undefined | unknown | Blob | URLSearchParams | FormData | AsyncIterator<unknown | void, unknown | void, undefined>;
58
58
  interface StandardRequest {
59
+ method: string;
60
+ url: URL;
61
+ headers: StandardHeaders;
62
+ /**
63
+ * The body has been parsed based on the content-type header.
64
+ */
65
+ body: StandardBody;
66
+ signal: AbortSignal | undefined;
67
+ }
68
+ interface StandardLazyRequest extends Omit<StandardRequest, 'body'> {
59
69
  /**
60
70
  * Can be { request: Request } or { request: IncomingMessage, response: ServerResponse } based on the adapter.
61
71
  */
62
72
  raw: Record<string, unknown>;
63
- method: string;
64
- url: URL;
65
- headers: StandardHeaders;
66
73
  /**
67
- * The body has been parsed base on the content-type header.
74
+ * The body has been parsed based on the content-type header.
68
75
  * This method can safely call multiple times (cached).
69
76
  */
70
77
  body: () => Promise<StandardBody>;
71
- signal: AbortSignal | undefined;
72
78
  }
73
79
  interface StandardResponse {
74
80
  status: number;
75
81
  headers: StandardHeaders;
82
+ /**
83
+ * The body has been parsed based on the content-type header.
84
+ */
76
85
  body: StandardBody;
77
86
  }
87
+ interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
88
+ /**
89
+ * Can be { request: Request } or { request: IncomingMessage, response: ServerResponse } based on the adapter.
90
+ */
91
+ raw: Record<string, unknown>;
92
+ /**
93
+ * The body has been parsed based on the content-type header.
94
+ * This method can safely call multiple times (cached).
95
+ */
96
+ body: () => Promise<StandardBody>;
97
+ }
78
98
 
79
- export { ErrorEvent, type ErrorEventOptions, EventDecoder, EventDecoderError, type EventDecoderOptions, EventDecoderStream, EventEncoderError, type EventMessage, type EventMeta, type StandardBody, type StandardHeaders, type StandardRequest, type StandardResponse, assertEventComment, assertEventId, assertEventName, assertEventRetry, decodeEventMessage, encodeEventComments, encodeEventData, encodeEventMessage, getEventMeta, withEventMeta };
99
+ 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, 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.cd121e3",
4
+ "version": "0.0.0-next.d16a1b6",
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": "0.0.0-next.cd121e3"
27
+ "@orpc/shared": "0.0.0-next.d16a1b6"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "unbuild",