@orpc/openapi-client 0.0.0-next.3d25567 → 0.0.0-next.3d8a81d

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,7 +1,7 @@
1
1
  import { ClientContext } from '@orpc/client';
2
2
  import { LinkFetchClientOptions } from '@orpc/client/fetch';
3
3
  import { AnyContractRouter } from '@orpc/contract';
4
- import { g as StandardOpenAPILinkOptions, h as StandardOpenAPILink } from '../../shared/openapi-client.f2unmElJ.mjs';
4
+ import { f as StandardOpenAPILinkOptions, g as StandardOpenAPILink } from '../../shared/openapi-client.Bc2pHPqD.mjs';
5
5
  import '@orpc/client/standard';
6
6
  import '@orpc/shared';
7
7
  import '@orpc/standard-server';
@@ -1,7 +1,7 @@
1
1
  import { ClientContext } from '@orpc/client';
2
2
  import { LinkFetchClientOptions } from '@orpc/client/fetch';
3
3
  import { AnyContractRouter } from '@orpc/contract';
4
- import { g as StandardOpenAPILinkOptions, h as StandardOpenAPILink } from '../../shared/openapi-client.f2unmElJ.js';
4
+ import { f as StandardOpenAPILinkOptions, g as StandardOpenAPILink } from '../../shared/openapi-client.Bc2pHPqD.js';
5
5
  import '@orpc/client/standard';
6
6
  import '@orpc/shared';
7
7
  import '@orpc/standard-server';
@@ -1,7 +1,7 @@
1
1
  import { LinkFetchClient } from '@orpc/client/fetch';
2
2
  import '@orpc/shared';
3
3
  import '@orpc/contract';
4
- import { b as StandardOpenAPILink } from '../../shared/openapi-client.D3eD5ojB.mjs';
4
+ import { b as StandardOpenAPILink } from '../../shared/openapi-client.Bix5hHnT.mjs';
5
5
  import '@orpc/client';
6
6
  import '@orpc/client/standard';
7
7
  import '@orpc/standard-server';
@@ -1,4 +1,4 @@
1
- export { S as StandardBracketNotationSerialized, b as StandardBracketNotationSerializer, a as StandardBracketNotationSerializerOptions, d as StandardOpenAPICustomJsonSerializer, c as StandardOpenAPIJsonSerialized, f as StandardOpenAPIJsonSerializer, e as StandardOpenAPIJsonSerializerOptions, h as StandardOpenAPILink, g as StandardOpenAPILinkOptions, k as StandardOpenAPISerializeOptions, l as StandardOpenAPISerializer, j as StandardOpenapiLinkCodec, i as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.f2unmElJ.mjs';
1
+ export { S as StandardBracketNotationSerialized, a as StandardBracketNotationSerializer, c as StandardOpenAPICustomJsonSerializer, b as StandardOpenAPIJsonSerialized, e as StandardOpenAPIJsonSerializer, d as StandardOpenAPIJsonSerializerOptions, g as StandardOpenAPILink, f as StandardOpenAPILinkOptions, j as StandardOpenAPISerializeOptions, k as StandardOpenAPISerializer, i as StandardOpenapiLinkCodec, h as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.Bc2pHPqD.mjs';
2
2
  import { HTTPPath } from '@orpc/client';
3
3
  import '@orpc/client/standard';
4
4
  import '@orpc/contract';
@@ -1,4 +1,4 @@
1
- export { S as StandardBracketNotationSerialized, b as StandardBracketNotationSerializer, a as StandardBracketNotationSerializerOptions, d as StandardOpenAPICustomJsonSerializer, c as StandardOpenAPIJsonSerialized, f as StandardOpenAPIJsonSerializer, e as StandardOpenAPIJsonSerializerOptions, h as StandardOpenAPILink, g as StandardOpenAPILinkOptions, k as StandardOpenAPISerializeOptions, l as StandardOpenAPISerializer, j as StandardOpenapiLinkCodec, i as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.f2unmElJ.js';
1
+ export { S as StandardBracketNotationSerialized, a as StandardBracketNotationSerializer, c as StandardOpenAPICustomJsonSerializer, b as StandardOpenAPIJsonSerialized, e as StandardOpenAPIJsonSerializer, d as StandardOpenAPIJsonSerializerOptions, g as StandardOpenAPILink, f as StandardOpenAPILinkOptions, j as StandardOpenAPISerializeOptions, k as StandardOpenAPISerializer, i as StandardOpenapiLinkCodec, h as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.Bc2pHPqD.js';
2
2
  import { HTTPPath } from '@orpc/client';
3
3
  import '@orpc/client/standard';
4
4
  import '@orpc/contract';
@@ -1,5 +1,5 @@
1
- import { S as StandardBracketNotationSerializer } from '../../shared/openapi-client.D3eD5ojB.mjs';
2
- export { a as StandardOpenAPIJsonSerializer, b as StandardOpenAPILink, d as StandardOpenAPISerializer, c as StandardOpenapiLinkCodec, g as getDynamicParams, s as standardizeHTTPPath } from '../../shared/openapi-client.D3eD5ojB.mjs';
1
+ import { S as StandardBracketNotationSerializer } from '../../shared/openapi-client.Bix5hHnT.mjs';
2
+ export { a as StandardOpenAPIJsonSerializer, b as StandardOpenAPILink, d as StandardOpenAPISerializer, c as StandardOpenapiLinkCodec, g as getDynamicParams, s as standardizeHTTPPath } from '../../shared/openapi-client.Bix5hHnT.mjs';
3
3
  import { isSchemaIssue } from '@orpc/contract';
4
4
  import { isTypescriptObject } from '@orpc/shared';
5
5
  import '@orpc/client/standard';
@@ -5,25 +5,7 @@ import { Segment, Value, Promisable } from '@orpc/shared';
5
5
  import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
6
6
 
7
7
  type StandardBracketNotationSerialized = [string, unknown][];
8
- interface StandardBracketNotationSerializerOptions {
9
- /**
10
- * Maximum allowed array index for bracket notation deserialization.
11
- *
12
- * This helps protect against memory exhaustion attacks where malicious input
13
- * uses extremely large array indices (e.g., `?arr[4294967296]=value`).
14
- *
15
- * While bracket notation creates sparse arrays that handle large indices efficiently,
16
- * downstream code might inadvertently convert these sparse arrays to dense arrays,
17
- * potentially creating millions of undefined elements and causing memory issues.
18
- *
19
- * @note Only applies to deserialization.
20
- * @default 9_999 (array with 10,000 elements)
21
- */
22
- maxBracketNotationArrayIndex?: number;
23
- }
24
8
  declare class StandardBracketNotationSerializer {
25
- private readonly maxArrayIndex;
26
- constructor(options?: StandardBracketNotationSerializerOptions);
27
9
  serialize(data: unknown, segments?: Segment[], result?: StandardBracketNotationSerialized): StandardBracketNotationSerialized;
28
10
  deserialize(serialized: StandardBracketNotationSerialized): Record<string, unknown> | unknown[];
29
11
  stringifyPath(segments: readonly Segment[]): string;
@@ -93,5 +75,5 @@ declare class StandardOpenAPILink<T extends ClientContext> extends StandardLink<
93
75
  constructor(contract: AnyContractRouter, linkClient: StandardLinkClient<T>, options: StandardOpenAPILinkOptions<T>);
94
76
  }
95
77
 
96
- export { StandardBracketNotationSerializer as b, StandardOpenAPIJsonSerializer as f, StandardOpenAPILink as h, StandardOpenapiLinkCodec as j, StandardOpenAPISerializer as l };
97
- export type { StandardBracketNotationSerialized as S, StandardBracketNotationSerializerOptions as a, StandardOpenAPIJsonSerialized as c, StandardOpenAPICustomJsonSerializer as d, StandardOpenAPIJsonSerializerOptions as e, StandardOpenAPILinkOptions as g, StandardOpenapiLinkCodecOptions as i, StandardOpenAPISerializeOptions as k };
78
+ export { StandardBracketNotationSerializer as a, StandardOpenAPIJsonSerializer as e, StandardOpenAPILink as g, StandardOpenapiLinkCodec as i, StandardOpenAPISerializer as k };
79
+ export type { StandardBracketNotationSerialized as S, StandardOpenAPIJsonSerialized as b, StandardOpenAPICustomJsonSerializer as c, StandardOpenAPIJsonSerializerOptions as d, StandardOpenAPILinkOptions as f, StandardOpenapiLinkCodecOptions as h, StandardOpenAPISerializeOptions as j };
@@ -5,25 +5,7 @@ import { Segment, Value, Promisable } from '@orpc/shared';
5
5
  import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
6
6
 
7
7
  type StandardBracketNotationSerialized = [string, unknown][];
8
- interface StandardBracketNotationSerializerOptions {
9
- /**
10
- * Maximum allowed array index for bracket notation deserialization.
11
- *
12
- * This helps protect against memory exhaustion attacks where malicious input
13
- * uses extremely large array indices (e.g., `?arr[4294967296]=value`).
14
- *
15
- * While bracket notation creates sparse arrays that handle large indices efficiently,
16
- * downstream code might inadvertently convert these sparse arrays to dense arrays,
17
- * potentially creating millions of undefined elements and causing memory issues.
18
- *
19
- * @note Only applies to deserialization.
20
- * @default 9_999 (array with 10,000 elements)
21
- */
22
- maxBracketNotationArrayIndex?: number;
23
- }
24
8
  declare class StandardBracketNotationSerializer {
25
- private readonly maxArrayIndex;
26
- constructor(options?: StandardBracketNotationSerializerOptions);
27
9
  serialize(data: unknown, segments?: Segment[], result?: StandardBracketNotationSerialized): StandardBracketNotationSerialized;
28
10
  deserialize(serialized: StandardBracketNotationSerialized): Record<string, unknown> | unknown[];
29
11
  stringifyPath(segments: readonly Segment[]): string;
@@ -93,5 +75,5 @@ declare class StandardOpenAPILink<T extends ClientContext> extends StandardLink<
93
75
  constructor(contract: AnyContractRouter, linkClient: StandardLinkClient<T>, options: StandardOpenAPILinkOptions<T>);
94
76
  }
95
77
 
96
- export { StandardBracketNotationSerializer as b, StandardOpenAPIJsonSerializer as f, StandardOpenAPILink as h, StandardOpenapiLinkCodec as j, StandardOpenAPISerializer as l };
97
- export type { StandardBracketNotationSerialized as S, StandardBracketNotationSerializerOptions as a, StandardOpenAPIJsonSerialized as c, StandardOpenAPICustomJsonSerializer as d, StandardOpenAPIJsonSerializerOptions as e, StandardOpenAPILinkOptions as g, StandardOpenapiLinkCodecOptions as i, StandardOpenAPISerializeOptions as k };
78
+ export { StandardBracketNotationSerializer as a, StandardOpenAPIJsonSerializer as e, StandardOpenAPILink as g, StandardOpenapiLinkCodec as i, StandardOpenAPISerializer as k };
79
+ export type { StandardBracketNotationSerialized as S, StandardOpenAPIJsonSerialized as b, StandardOpenAPICustomJsonSerializer as c, StandardOpenAPIJsonSerializerOptions as d, StandardOpenAPILinkOptions as f, StandardOpenapiLinkCodecOptions as h, StandardOpenAPISerializeOptions as j };
@@ -5,10 +5,6 @@ import { isContractProcedure, fallbackContractConfig, ORPCError } from '@orpc/co
5
5
  import { mergeStandardHeaders, ErrorEvent } from '@orpc/standard-server';
6
6
 
7
7
  class StandardBracketNotationSerializer {
8
- maxArrayIndex;
9
- constructor(options = {}) {
10
- this.maxArrayIndex = options.maxBracketNotationArrayIndex ?? 9999;
11
- }
12
8
  serialize(data, segments = [], result = []) {
13
9
  if (Array.isArray(data)) {
14
10
  data.forEach((item, i) => {
@@ -38,7 +34,7 @@ class StandardBracketNotationSerializer {
38
34
  currentRef[nextSegment] = [];
39
35
  }
40
36
  if (i !== segments.length - 1) {
41
- if (Array.isArray(currentRef[nextSegment]) && !isValidArrayIndex(segment, this.maxArrayIndex)) {
37
+ if (Array.isArray(currentRef[nextSegment]) && !isValidArrayIndex(segment)) {
42
38
  if (arrayPushStyles.has(currentRef[nextSegment])) {
43
39
  arrayPushStyles.delete(currentRef[nextSegment]);
44
40
  currentRef[nextSegment] = pushStyleArrayToObject(currentRef[nextSegment]);
@@ -56,7 +52,7 @@ class StandardBracketNotationSerializer {
56
52
  if (arrayPushStyles.has(currentRef[nextSegment])) {
57
53
  arrayPushStyles.delete(currentRef[nextSegment]);
58
54
  currentRef[nextSegment] = pushStyleArrayToObject(currentRef[nextSegment]);
59
- } else if (!isValidArrayIndex(segment, this.maxArrayIndex)) {
55
+ } else if (!isValidArrayIndex(segment)) {
60
56
  currentRef[nextSegment] = arrayToObject(currentRef[nextSegment]);
61
57
  }
62
58
  }
@@ -131,8 +127,8 @@ class StandardBracketNotationSerializer {
131
127
  return inBrackets || segments.length === 0 ? [path] : segments;
132
128
  }
133
129
  }
134
- function isValidArrayIndex(value, maxIndex) {
135
- return /^0$|^[1-9]\d*$/.test(value) && Number(value) <= maxIndex;
130
+ function isValidArrayIndex(value) {
131
+ return /^0$|^[1-9]\d*$/.test(value);
136
132
  }
137
133
  function arrayToObject(array) {
138
134
  const obj = new NullProtoObj();
@@ -428,7 +424,7 @@ class StandardOpenAPISerializer {
428
424
  class StandardOpenAPILink extends StandardLink {
429
425
  constructor(contract, linkClient, options) {
430
426
  const jsonSerializer = new StandardOpenAPIJsonSerializer(options);
431
- const bracketNotationSerializer = new StandardBracketNotationSerializer({ maxBracketNotationArrayIndex: 4294967294 });
427
+ const bracketNotationSerializer = new StandardBracketNotationSerializer();
432
428
  const serializer = new StandardOpenAPISerializer(jsonSerializer, bracketNotationSerializer);
433
429
  const linkCodec = new StandardOpenapiLinkCodec(contract, serializer, options);
434
430
  super(linkCodec, linkClient, options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/openapi-client",
3
3
  "type": "module",
4
- "version": "0.0.0-next.3d25567",
4
+ "version": "0.0.0-next.3d8a81d",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -34,13 +34,13 @@
34
34
  "dist"
35
35
  ],
36
36
  "dependencies": {
37
- "@orpc/client": "0.0.0-next.3d25567",
38
- "@orpc/contract": "0.0.0-next.3d25567",
39
- "@orpc/standard-server": "0.0.0-next.3d25567",
40
- "@orpc/shared": "0.0.0-next.3d25567"
37
+ "@orpc/client": "0.0.0-next.3d8a81d",
38
+ "@orpc/contract": "0.0.0-next.3d8a81d",
39
+ "@orpc/shared": "0.0.0-next.3d8a81d",
40
+ "@orpc/standard-server": "0.0.0-next.3d8a81d"
41
41
  },
42
42
  "devDependencies": {
43
- "@orpc/server": "0.0.0-next.3d25567"
43
+ "@orpc/server": "0.0.0-next.3d8a81d"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "unbuild",