@orpc/server 0.0.0-next.d9485b0 → 0.0.0-next.d9acc8f

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.
@@ -1,12 +1,12 @@
1
1
  import { resolveMaybeOptionalOptions } from '@orpc/shared';
2
2
  import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-server-aws-lambda';
3
3
  import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.BVwwTHyO.mjs';
4
- import '@orpc/standard-server/batch';
5
4
  import '@orpc/standard-server';
5
+ import '@orpc/standard-server/batch';
6
6
  import '@orpc/client';
7
7
  import { S as StrictGetMethodPlugin } from '../../shared/server.BW-nUGgA.mjs';
8
8
  import '@orpc/contract';
9
- import { b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
9
+ import { b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
10
10
  import '@orpc/client/standard';
11
11
  import '../../shared/server.DG7Tamti.mjs';
12
12
 
@@ -4,7 +4,7 @@ import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.B
4
4
  import '@orpc/client';
5
5
  import '@orpc/standard-server';
6
6
  import '@orpc/contract';
7
- import { b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
7
+ import { b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
8
8
  import '@orpc/client/standard';
9
9
  import '../../shared/server.DG7Tamti.mjs';
10
10
 
@@ -4,7 +4,7 @@ import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.B
4
4
  import '@orpc/client';
5
5
  import '@orpc/standard-server';
6
6
  import '@orpc/contract';
7
- import { b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
7
+ import { b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
8
8
  import '@orpc/client/standard';
9
9
  import '../../shared/server.DG7Tamti.mjs';
10
10
 
@@ -4,7 +4,7 @@ import { toStandardLazyRequest, toFetchResponse } from '@orpc/standard-server-fe
4
4
  import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.BVwwTHyO.mjs';
5
5
  import '@orpc/standard-server';
6
6
  import '@orpc/contract';
7
- import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
7
+ import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
8
8
  import '@orpc/client/standard';
9
9
  import '@orpc/standard-server/batch';
10
10
  import { S as StrictGetMethodPlugin } from '../../shared/server.BW-nUGgA.mjs';
@@ -5,7 +5,7 @@ import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.B
5
5
  import '@orpc/client';
6
6
  import '@orpc/standard-server';
7
7
  import '@orpc/contract';
8
- import { b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
8
+ import { b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
9
9
  import '@orpc/client/standard';
10
10
  import '../../shared/server.DG7Tamti.mjs';
11
11
 
@@ -4,7 +4,7 @@ import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-serv
4
4
  import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.BVwwTHyO.mjs';
5
5
  import '@orpc/standard-server';
6
6
  import '@orpc/contract';
7
- import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
7
+ import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
8
8
  import '@orpc/client/standard';
9
9
  import '@orpc/standard-server/batch';
10
10
  import { S as StrictGetMethodPlugin } from '../../shared/server.BW-nUGgA.mjs';
@@ -1,4 +1,4 @@
1
- export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardRPCCodec, b as StandardRPCHandler, c as StandardRPCMatcher } from '../../shared/server.4FnxLwwr.mjs';
1
+ export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardRPCCodec, b as StandardRPCHandler, c as StandardRPCMatcher } from '../../shared/server.CHvOkcM3.mjs';
2
2
  import '@orpc/client/standard';
3
3
  import '@orpc/client';
4
4
  import '@orpc/shared';
@@ -4,7 +4,7 @@ import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.B
4
4
  import '@orpc/client';
5
5
  import '@orpc/standard-server';
6
6
  import '@orpc/contract';
7
- import { b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
7
+ import { b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
8
8
  import '@orpc/client/standard';
9
9
  import '../../shared/server.DG7Tamti.mjs';
10
10
 
@@ -4,7 +4,7 @@ import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.B
4
4
  import '@orpc/client';
5
5
  import '@orpc/standard-server';
6
6
  import '@orpc/contract';
7
- import { b as StandardRPCHandler } from '../../shared/server.4FnxLwwr.mjs';
7
+ import { b as StandardRPCHandler } from '../../shared/server.CHvOkcM3.mjs';
8
8
  import '@orpc/client/standard';
9
9
  import '../../shared/server.DG7Tamti.mjs';
10
10
 
@@ -33,10 +33,10 @@ interface BatchHandlerOptions<T extends Context> {
33
33
  headers?: Value<Promisable<StandardHeaders>, [responses: Promise<BatchResponseBodyItem>[], batchOptions: StandardHandlerInterceptorOptions<T>]>;
34
34
  }
35
35
  /**
36
- * The Batch Request/Response Plugin allows you to combine multiple requests and responses into a single batch,
36
+ * The Batch Requests Plugin allows you to combine multiple requests and responses into a single batch,
37
37
  * reducing the overhead of sending each one separately.
38
38
  *
39
- * @see {@link https://orpc.unnoq.com/docs/plugins/batch-request-response Batch Request/Response Plugin Docs}
39
+ * @see {@link https://orpc.unnoq.com/docs/plugins/batch-requests Batch Requests Plugin Docs}
40
40
  */
41
41
  declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
42
42
  private readonly maxSize;
@@ -33,10 +33,10 @@ interface BatchHandlerOptions<T extends Context> {
33
33
  headers?: Value<Promisable<StandardHeaders>, [responses: Promise<BatchResponseBodyItem>[], batchOptions: StandardHandlerInterceptorOptions<T>]>;
34
34
  }
35
35
  /**
36
- * The Batch Request/Response Plugin allows you to combine multiple requests and responses into a single batch,
36
+ * The Batch Requests Plugin allows you to combine multiple requests and responses into a single batch,
37
37
  * reducing the overhead of sending each one separately.
38
38
  *
39
- * @see {@link https://orpc.unnoq.com/docs/plugins/batch-request-response Batch Request/Response Plugin Docs}
39
+ * @see {@link https://orpc.unnoq.com/docs/plugins/batch-requests Batch Requests Plugin Docs}
40
40
  */
41
41
  declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
42
42
  private readonly maxSize;
@@ -1,6 +1,6 @@
1
1
  import { value, isAsyncIteratorObject } from '@orpc/shared';
2
- import { parseBatchRequest, toBatchResponse } from '@orpc/standard-server/batch';
3
2
  import { flattenHeader } from '@orpc/standard-server';
3
+ import { parseBatchRequest, toBatchResponse } from '@orpc/standard-server/batch';
4
4
  import { ORPCError } from '@orpc/client';
5
5
  export { S as StrictGetMethodPlugin } from '../shared/server.BW-nUGgA.mjs';
6
6
  import '@orpc/contract';
@@ -26,7 +26,8 @@ class BatchHandlerPlugin {
26
26
  init(options) {
27
27
  options.rootInterceptors ??= [];
28
28
  options.rootInterceptors.unshift(async (options2) => {
29
- if (options2.request.headers["x-orpc-batch"] !== "1") {
29
+ const xHeader = flattenHeader(options2.request.headers["x-orpc-batch"]);
30
+ if (xHeader === void 0) {
30
31
  return options2.next();
31
32
  }
32
33
  let isParsing = false;
@@ -69,9 +70,10 @@ class BatchHandlerPlugin {
69
70
  await Promise.race(responses);
70
71
  const status = await value(this.successStatus, responses, options2);
71
72
  const headers = await value(this.headers, responses, options2);
72
- const response = toBatchResponse({
73
+ const response = await toBatchResponse({
73
74
  status,
74
75
  headers,
76
+ mode: xHeader === "buffered" ? "buffered" : "streaming",
75
77
  body: async function* () {
76
78
  const promises = [...responses];
77
79
  while (true) {
@@ -1,6 +1,6 @@
1
1
  import { toHttpPath, StandardRPCJsonSerializer, StandardRPCSerializer } from '@orpc/client/standard';
2
2
  import { ORPCError, toORPCError } from '@orpc/client';
3
- import { toArray, intercept, parseEmptyableJSON } from '@orpc/shared';
3
+ import { toArray, intercept, parseEmptyableJSON, NullProtoObj } from '@orpc/shared';
4
4
  import { flattenHeader } from '@orpc/standard-server';
5
5
  import { c as createProcedureClient, t as traverseContractProcedures, i as isProcedure, u as unlazy, g as getRouter, a as createContractedProcedure } from './server.DG7Tamti.mjs';
6
6
 
@@ -112,7 +112,7 @@ class StandardRPCCodec {
112
112
  }
113
113
 
114
114
  class StandardRPCMatcher {
115
- tree = {};
115
+ tree = new NullProtoObj();
116
116
  pendingRouters = [];
117
117
  init(router, path = []) {
118
118
  const laziedOptions = traverseContractProcedures({ router, path }, ({ path: path2, contract }) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/server",
3
3
  "type": "module",
4
- "version": "0.0.0-next.d9485b0",
4
+ "version": "0.0.0-next.d9acc8f",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -86,18 +86,18 @@
86
86
  }
87
87
  },
88
88
  "dependencies": {
89
- "@orpc/client": "0.0.0-next.d9485b0",
90
- "@orpc/contract": "0.0.0-next.d9485b0",
91
- "@orpc/standard-server": "0.0.0-next.d9485b0",
92
- "@orpc/standard-server-fetch": "0.0.0-next.d9485b0",
93
- "@orpc/shared": "0.0.0-next.d9485b0",
94
- "@orpc/standard-server-aws-lambda": "0.0.0-next.d9485b0",
95
- "@orpc/standard-server-node": "0.0.0-next.d9485b0",
96
- "@orpc/standard-server-peer": "0.0.0-next.d9485b0"
89
+ "@orpc/contract": "0.0.0-next.d9acc8f",
90
+ "@orpc/shared": "0.0.0-next.d9acc8f",
91
+ "@orpc/standard-server-aws-lambda": "0.0.0-next.d9acc8f",
92
+ "@orpc/standard-server": "0.0.0-next.d9acc8f",
93
+ "@orpc/standard-server-fetch": "0.0.0-next.d9acc8f",
94
+ "@orpc/standard-server-node": "0.0.0-next.d9acc8f",
95
+ "@orpc/client": "0.0.0-next.d9acc8f",
96
+ "@orpc/standard-server-peer": "0.0.0-next.d9acc8f"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@types/ws": "^8.18.1",
100
- "crossws": "^0.3.4",
100
+ "crossws": "^0.4.1",
101
101
  "next": "^15.3.0",
102
102
  "supertest": "^7.1.0",
103
103
  "ws": "^8.18.1"