@orpc/openapi 0.0.0-next.b4fc1d9 → 0.0.0-next.b50e4fc

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.
Files changed (39) hide show
  1. package/README.md +149 -30
  2. package/dist/adapters/aws-lambda/index.d.mts +20 -0
  3. package/dist/adapters/aws-lambda/index.d.ts +20 -0
  4. package/dist/adapters/aws-lambda/index.mjs +18 -0
  5. package/dist/adapters/fastify/index.d.mts +23 -0
  6. package/dist/adapters/fastify/index.d.ts +23 -0
  7. package/dist/adapters/fastify/index.mjs +18 -0
  8. package/dist/adapters/fetch/index.d.mts +17 -9
  9. package/dist/adapters/fetch/index.d.ts +17 -9
  10. package/dist/adapters/fetch/index.mjs +14 -7
  11. package/dist/adapters/node/index.d.mts +17 -9
  12. package/dist/adapters/node/index.d.ts +17 -9
  13. package/dist/adapters/node/index.mjs +9 -26
  14. package/dist/adapters/standard/index.d.mts +8 -23
  15. package/dist/adapters/standard/index.d.ts +8 -23
  16. package/dist/adapters/standard/index.mjs +5 -3
  17. package/dist/index.d.mts +42 -46
  18. package/dist/index.d.ts +42 -46
  19. package/dist/index.mjs +30 -292
  20. package/dist/plugins/index.d.mts +86 -0
  21. package/dist/plugins/index.d.ts +86 -0
  22. package/dist/plugins/index.mjs +157 -0
  23. package/dist/shared/openapi.BGy4N6eR.d.mts +120 -0
  24. package/dist/shared/openapi.BGy4N6eR.d.ts +120 -0
  25. package/dist/shared/openapi.CoREqFh3.mjs +853 -0
  26. package/dist/shared/{openapi.BNHmrMe2.mjs → openapi.DIt-Z9W1.mjs} +58 -13
  27. package/dist/shared/openapi.DwaweYRb.d.mts +54 -0
  28. package/dist/shared/openapi.DwaweYRb.d.ts +54 -0
  29. package/package.json +29 -26
  30. package/dist/adapters/hono/index.d.mts +0 -8
  31. package/dist/adapters/hono/index.d.ts +0 -8
  32. package/dist/adapters/hono/index.mjs +0 -11
  33. package/dist/adapters/next/index.d.mts +0 -8
  34. package/dist/adapters/next/index.d.ts +0 -8
  35. package/dist/adapters/next/index.mjs +0 -11
  36. package/dist/shared/openapi.DZzpQAb-.mjs +0 -231
  37. package/dist/shared/openapi.Dv-KT_Bx.mjs +0 -33
  38. package/dist/shared/openapi.IfmmOyba.d.mts +0 -8
  39. package/dist/shared/openapi.IfmmOyba.d.ts +0 -8
@@ -1,25 +1,10 @@
1
- import { ORPCError } from '@orpc/client';
2
- import { StandardOpenAPISerializer } from '@orpc/openapi-client/standard';
3
- import { AnyProcedure, AnyRouter } from '@orpc/server';
4
- import { StandardCodec, StandardParams, StandardMatcher, StandardMatchResult } from '@orpc/server/standard';
5
- import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
6
- export { S as StandardOpenAPIHandlerOptions } from '../../shared/openapi.IfmmOyba.mjs';
7
- import { HTTPPath } from '@orpc/contract';
8
-
9
- declare class StandardOpenAPICodec implements StandardCodec {
10
- private readonly serializer;
11
- constructor(serializer: StandardOpenAPISerializer);
12
- decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
13
- encode(output: unknown, procedure: AnyProcedure): StandardResponse;
14
- encodeError(error: ORPCError<any, any>): StandardResponse;
15
- }
16
-
17
- declare class StandardOpenAPIMatcher implements StandardMatcher {
18
- private readonly tree;
19
- private pendingRouters;
20
- init(router: AnyRouter, path?: readonly string[]): void;
21
- match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
22
- }
1
+ export { a as StandardOpenAPICodec, S as StandardOpenAPICodecOptions, c as StandardOpenAPIHandler, b as StandardOpenAPIHandlerOptions, e as StandardOpenAPIMatcher, d as StandardOpenAPIMatcherOptions } from '../../shared/openapi.DwaweYRb.mjs';
2
+ import { HTTPPath } from '@orpc/client';
3
+ import '@orpc/openapi-client/standard';
4
+ import '@orpc/server';
5
+ import '@orpc/server/standard';
6
+ import '@orpc/standard-server';
7
+ import '@orpc/shared';
23
8
 
24
9
  /**
25
10
  * {@link https://github.com/unjs/rou3}
@@ -32,4 +17,4 @@ declare function toRou3Pattern(path: HTTPPath): string;
32
17
  */
33
18
  declare function decodeParams(params: Record<string, string>): Record<string, string>;
34
19
 
35
- export { StandardOpenAPICodec, StandardOpenAPIMatcher, decodeParams, toRou3Pattern };
20
+ export { decodeParams, toRou3Pattern };
@@ -1,25 +1,10 @@
1
- import { ORPCError } from '@orpc/client';
2
- import { StandardOpenAPISerializer } from '@orpc/openapi-client/standard';
3
- import { AnyProcedure, AnyRouter } from '@orpc/server';
4
- import { StandardCodec, StandardParams, StandardMatcher, StandardMatchResult } from '@orpc/server/standard';
5
- import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
6
- export { S as StandardOpenAPIHandlerOptions } from '../../shared/openapi.IfmmOyba.js';
7
- import { HTTPPath } from '@orpc/contract';
8
-
9
- declare class StandardOpenAPICodec implements StandardCodec {
10
- private readonly serializer;
11
- constructor(serializer: StandardOpenAPISerializer);
12
- decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
13
- encode(output: unknown, procedure: AnyProcedure): StandardResponse;
14
- encodeError(error: ORPCError<any, any>): StandardResponse;
15
- }
16
-
17
- declare class StandardOpenAPIMatcher implements StandardMatcher {
18
- private readonly tree;
19
- private pendingRouters;
20
- init(router: AnyRouter, path?: readonly string[]): void;
21
- match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
22
- }
1
+ export { a as StandardOpenAPICodec, S as StandardOpenAPICodecOptions, c as StandardOpenAPIHandler, b as StandardOpenAPIHandlerOptions, e as StandardOpenAPIMatcher, d as StandardOpenAPIMatcherOptions } from '../../shared/openapi.DwaweYRb.js';
2
+ import { HTTPPath } from '@orpc/client';
3
+ import '@orpc/openapi-client/standard';
4
+ import '@orpc/server';
5
+ import '@orpc/server/standard';
6
+ import '@orpc/standard-server';
7
+ import '@orpc/shared';
23
8
 
24
9
  /**
25
10
  * {@link https://github.com/unjs/rou3}
@@ -32,4 +17,4 @@ declare function toRou3Pattern(path: HTTPPath): string;
32
17
  */
33
18
  declare function decodeParams(params: Record<string, string>): Record<string, string>;
34
19
 
35
- export { StandardOpenAPICodec, StandardOpenAPIMatcher, decodeParams, toRou3Pattern };
20
+ export { decodeParams, toRou3Pattern };
@@ -1,7 +1,9 @@
1
- export { S as StandardOpenAPICodec, a as StandardOpenAPIMatcher, d as decodeParams, t as toRou3Pattern } from '../../shared/openapi.BNHmrMe2.mjs';
1
+ export { S as StandardOpenAPICodec, a as StandardOpenAPIHandler, b as StandardOpenAPIMatcher, d as decodeParams, t as toRou3Pattern } from '../../shared/openapi.DIt-Z9W1.mjs';
2
+ import '@orpc/openapi-client/standard';
3
+ import '@orpc/server/standard';
4
+ import '@orpc/client';
2
5
  import '@orpc/contract';
3
6
  import '@orpc/shared';
7
+ import '@orpc/client/standard';
4
8
  import '@orpc/server';
5
9
  import 'rou3';
6
- import '../../shared/openapi.DZzpQAb-.mjs';
7
- import 'json-schema-typed/draft-2020-12';
package/dist/index.d.mts CHANGED
@@ -1,15 +1,23 @@
1
- import { AnyContractProcedure, AnySchema, AnyContractRouter, HTTPPath, HTTPMethod } from '@orpc/contract';
2
- import { OpenAPIV3_1 } from 'openapi-types';
3
- export { OpenAPIV3_1 as OpenAPI } from 'openapi-types';
4
- import { StandardOpenAPIJsonSerializerOptions } from '@orpc/openapi-client/standard';
5
- import { AnyRouter } from '@orpc/server';
1
+ import { OpenAPI, AnyContractProcedure } from '@orpc/contract';
2
+ export { OpenAPI } from '@orpc/contract';
3
+ export { e as CompositeSchemaConverter, C as ConditionalSchemaConverter, b as OpenAPIGenerator, a as OpenAPIGeneratorGenerateOptions, O as OpenAPIGeneratorOptions, c as SchemaConvertOptions, d as SchemaConverter, S as SchemaConverterComponent } from './shared/openapi.BGy4N6eR.mjs';
4
+ import { HTTPPath, HTTPMethod } from '@orpc/client';
6
5
  import { JSONSchema } from 'json-schema-typed/draft-2020-12';
7
- export { JSONSchema, Format as JSONSchemaFormat } from 'json-schema-typed/draft-2020-12';
6
+ export { JSONSchema, ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from 'json-schema-typed/draft-2020-12';
7
+ import { JsonifiedClient } from '@orpc/openapi-client';
8
+ import { AnyRouter, ClientContext, Lazyable, CreateProcedureClientOptions, InferRouterInitialContext, Schema, ErrorMap, Meta, RouterClient } from '@orpc/server';
9
+ import { MaybeOptionalOptions } from '@orpc/shared';
10
+ import '@orpc/openapi-client/standard';
8
11
 
9
- type OverrideOperationValue = Partial<OpenAPIV3_1.OperationObject> | ((current: OpenAPIV3_1.OperationObject, procedure: AnyContractProcedure) => OpenAPIV3_1.OperationObject);
12
+ type OverrideOperationValue = Partial<OpenAPI.OperationObject> | ((current: OpenAPI.OperationObject, procedure: AnyContractProcedure) => OpenAPI.OperationObject);
13
+ /**
14
+ * Customize The Operation Object by proxy an error map item or a middleware.
15
+ *
16
+ * @see {@link https://orpc.dev/docs/openapi/openapi-specification#customizing-operation-objects Customizing Operation Objects Docs}
17
+ */
10
18
  declare function customOpenAPIOperation<T extends object>(o: T, extend: OverrideOperationValue): T;
11
19
  declare function getCustomOpenAPIOperation(o: object): OverrideOperationValue | undefined;
12
- declare function applyCustomOpenAPIOperation(operation: OpenAPIV3_1.OperationObject, contract: AnyContractProcedure): OpenAPIV3_1.OperationObject;
20
+ declare function applyCustomOpenAPIOperation(operation: OpenAPI.OperationObject, contract: AnyContractProcedure): OpenAPI.OperationObject;
13
21
 
14
22
  /**
15
23
  * @internal
@@ -29,36 +37,6 @@ type FileSchema = JSONSchema & {
29
37
  */
30
38
  declare const LOGIC_KEYWORDS: string[];
31
39
 
32
- interface SchemaConvertOptions {
33
- strategy: 'input' | 'output';
34
- }
35
- interface SchemaConverter {
36
- convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
37
- }
38
- interface ConditionalSchemaConverter extends SchemaConverter {
39
- condition(schema: AnySchema | undefined, options: SchemaConvertOptions): boolean;
40
- }
41
- declare class CompositeSchemaConverter implements SchemaConverter {
42
- private readonly converters;
43
- constructor(converters: ConditionalSchemaConverter[]);
44
- convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
45
- }
46
-
47
- interface OpenAPIGeneratorOptions extends StandardOpenAPIJsonSerializerOptions {
48
- schemaConverters?: ConditionalSchemaConverter[];
49
- }
50
- declare class OpenAPIGenerator {
51
- #private;
52
- private readonly serializer;
53
- private readonly converter;
54
- constructor(options?: OpenAPIGeneratorOptions);
55
- generate(router: AnyContractRouter | AnyRouter, base: Omit<OpenAPIV3_1.Document, 'openapi'>): Promise<OpenAPIV3_1.Document>;
56
- }
57
-
58
- /**
59
- * @internal
60
- */
61
- declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
62
40
  /**
63
41
  * @internal
64
42
  */
@@ -70,27 +48,32 @@ declare function toOpenAPIMethod(method: HTTPMethod): Lowercase<HTTPMethod>;
70
48
  /**
71
49
  * @internal
72
50
  */
73
- declare function getDynamicParams(path: HTTPPath | undefined): string[] | undefined;
51
+ declare function toOpenAPIContent(schema: JSONSchema): Record<string, OpenAPI.MediaTypeObject>;
74
52
  /**
75
53
  * @internal
76
54
  */
77
- declare function toOpenAPIContent(schema: JSONSchema): Record<string, OpenAPIV3_1.MediaTypeObject>;
55
+ declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string, OpenAPI.MediaTypeObject>;
78
56
  /**
79
57
  * @internal
80
58
  */
81
- declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string, OpenAPIV3_1.MediaTypeObject>;
59
+ declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'): OpenAPI.ParameterObject[];
82
60
  /**
83
61
  * @internal
84
62
  */
85
- declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'): OpenAPIV3_1.ParameterObject[];
63
+ declare function checkParamsSchema(schema: ObjectSchema, params: string[]): boolean;
86
64
  /**
87
65
  * @internal
88
66
  */
89
- declare function checkParamsSchema(schema: ObjectSchema, params: string[]): boolean;
67
+ declare function toOpenAPISchema(schema: JSONSchema): OpenAPI.SchemaObject & object;
68
+ declare function resolveOpenAPIJsonSchemaRef(doc: OpenAPI.Document, schema: JSONSchema): JSONSchema;
90
69
  /**
91
- * @internal
70
+ * Simplifies composed object JSON Schemas (using anyOf, oneOf, allOf) by flattening nested compositions
71
+ *
72
+ * @warning The result is looser than the original schema and may not fully validate the same data.
92
73
  */
93
- declare function toOpenAPISchema(schema: JSONSchema): OpenAPIV3_1.SchemaObject & object;
74
+ declare function simplifyComposedObjectJsonSchemasAndRefs(schema: JSONSchema, doc?: OpenAPI.Document): JSONSchema;
75
+
76
+ declare function createJsonifiedRouterClient<T extends AnyRouter, TClientContext extends ClientContext>(router: Lazyable<T | undefined>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<InferRouterInitialContext<T>, Schema<unknown, unknown>, ErrorMap, Meta, TClientContext>>): JsonifiedClient<RouterClient<T, TClientContext>>;
94
77
 
95
78
  /**
96
79
  *@internal
@@ -112,9 +95,22 @@ declare function separateObjectSchema(schema: ObjectSchema, separatedProperties:
112
95
  * @internal
113
96
  */
114
97
  declare function filterSchemaBranches(schema: JSONSchema, check: (schema: JSONSchema) => boolean, matches?: JSONSchema[]): [matches: JSONSchema[], rest: JSONSchema | undefined];
98
+ declare function applySchemaOptionality(required: boolean, schema: JSONSchema): JSONSchema;
99
+ /**
100
+ * Takes a JSON schema and, if it's primarily a union type (anyOf, oneOf),
101
+ * recursively expands it into an array of its constituent, non-union base schemas.
102
+ * If the schema is not a simple union or is a base type, it's returned as a single-element array.
103
+ */
104
+ declare function expandUnionSchema(schema: JSONSchema): JSONSchema[];
105
+ declare function expandArrayableSchema(schema: JSONSchema): undefined | [items: JSONSchema, array: JSONSchema & {
106
+ type: 'array';
107
+ items?: JSONSchema;
108
+ }];
109
+ declare function isPrimitiveSchema(schema: JSONSchema): boolean;
115
110
 
116
111
  declare const oo: {
117
112
  spec: typeof customOpenAPIOperation;
118
113
  };
119
114
 
120
- export { CompositeSchemaConverter, type ConditionalSchemaConverter, type FileSchema, LOGIC_KEYWORDS, type ObjectSchema, OpenAPIGenerator, type OpenAPIGeneratorOptions, type OverrideOperationValue, type SchemaConvertOptions, type SchemaConverter, applyCustomOpenAPIOperation, checkParamsSchema, customOpenAPIOperation, filterSchemaBranches, getCustomOpenAPIOperation, getDynamicParams, isAnySchema, isFileSchema, isObjectSchema, oo, separateObjectSchema, standardizeHTTPPath, toOpenAPIContent, toOpenAPIEventIteratorContent, toOpenAPIMethod, toOpenAPIParameters, toOpenAPIPath, toOpenAPISchema };
115
+ export { LOGIC_KEYWORDS, applyCustomOpenAPIOperation, applySchemaOptionality, checkParamsSchema, createJsonifiedRouterClient, customOpenAPIOperation, expandArrayableSchema, expandUnionSchema, filterSchemaBranches, getCustomOpenAPIOperation, isAnySchema, isFileSchema, isObjectSchema, isPrimitiveSchema, oo, resolveOpenAPIJsonSchemaRef, separateObjectSchema, simplifyComposedObjectJsonSchemasAndRefs, toOpenAPIContent, toOpenAPIEventIteratorContent, toOpenAPIMethod, toOpenAPIParameters, toOpenAPIPath, toOpenAPISchema };
116
+ export type { FileSchema, ObjectSchema, OverrideOperationValue };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,23 @@
1
- import { AnyContractProcedure, AnySchema, AnyContractRouter, HTTPPath, HTTPMethod } from '@orpc/contract';
2
- import { OpenAPIV3_1 } from 'openapi-types';
3
- export { OpenAPIV3_1 as OpenAPI } from 'openapi-types';
4
- import { StandardOpenAPIJsonSerializerOptions } from '@orpc/openapi-client/standard';
5
- import { AnyRouter } from '@orpc/server';
1
+ import { OpenAPI, AnyContractProcedure } from '@orpc/contract';
2
+ export { OpenAPI } from '@orpc/contract';
3
+ export { e as CompositeSchemaConverter, C as ConditionalSchemaConverter, b as OpenAPIGenerator, a as OpenAPIGeneratorGenerateOptions, O as OpenAPIGeneratorOptions, c as SchemaConvertOptions, d as SchemaConverter, S as SchemaConverterComponent } from './shared/openapi.BGy4N6eR.js';
4
+ import { HTTPPath, HTTPMethod } from '@orpc/client';
6
5
  import { JSONSchema } from 'json-schema-typed/draft-2020-12';
7
- export { JSONSchema, Format as JSONSchemaFormat } from 'json-schema-typed/draft-2020-12';
6
+ export { JSONSchema, ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from 'json-schema-typed/draft-2020-12';
7
+ import { JsonifiedClient } from '@orpc/openapi-client';
8
+ import { AnyRouter, ClientContext, Lazyable, CreateProcedureClientOptions, InferRouterInitialContext, Schema, ErrorMap, Meta, RouterClient } from '@orpc/server';
9
+ import { MaybeOptionalOptions } from '@orpc/shared';
10
+ import '@orpc/openapi-client/standard';
8
11
 
9
- type OverrideOperationValue = Partial<OpenAPIV3_1.OperationObject> | ((current: OpenAPIV3_1.OperationObject, procedure: AnyContractProcedure) => OpenAPIV3_1.OperationObject);
12
+ type OverrideOperationValue = Partial<OpenAPI.OperationObject> | ((current: OpenAPI.OperationObject, procedure: AnyContractProcedure) => OpenAPI.OperationObject);
13
+ /**
14
+ * Customize The Operation Object by proxy an error map item or a middleware.
15
+ *
16
+ * @see {@link https://orpc.dev/docs/openapi/openapi-specification#customizing-operation-objects Customizing Operation Objects Docs}
17
+ */
10
18
  declare function customOpenAPIOperation<T extends object>(o: T, extend: OverrideOperationValue): T;
11
19
  declare function getCustomOpenAPIOperation(o: object): OverrideOperationValue | undefined;
12
- declare function applyCustomOpenAPIOperation(operation: OpenAPIV3_1.OperationObject, contract: AnyContractProcedure): OpenAPIV3_1.OperationObject;
20
+ declare function applyCustomOpenAPIOperation(operation: OpenAPI.OperationObject, contract: AnyContractProcedure): OpenAPI.OperationObject;
13
21
 
14
22
  /**
15
23
  * @internal
@@ -29,36 +37,6 @@ type FileSchema = JSONSchema & {
29
37
  */
30
38
  declare const LOGIC_KEYWORDS: string[];
31
39
 
32
- interface SchemaConvertOptions {
33
- strategy: 'input' | 'output';
34
- }
35
- interface SchemaConverter {
36
- convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
37
- }
38
- interface ConditionalSchemaConverter extends SchemaConverter {
39
- condition(schema: AnySchema | undefined, options: SchemaConvertOptions): boolean;
40
- }
41
- declare class CompositeSchemaConverter implements SchemaConverter {
42
- private readonly converters;
43
- constructor(converters: ConditionalSchemaConverter[]);
44
- convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
45
- }
46
-
47
- interface OpenAPIGeneratorOptions extends StandardOpenAPIJsonSerializerOptions {
48
- schemaConverters?: ConditionalSchemaConverter[];
49
- }
50
- declare class OpenAPIGenerator {
51
- #private;
52
- private readonly serializer;
53
- private readonly converter;
54
- constructor(options?: OpenAPIGeneratorOptions);
55
- generate(router: AnyContractRouter | AnyRouter, base: Omit<OpenAPIV3_1.Document, 'openapi'>): Promise<OpenAPIV3_1.Document>;
56
- }
57
-
58
- /**
59
- * @internal
60
- */
61
- declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
62
40
  /**
63
41
  * @internal
64
42
  */
@@ -70,27 +48,32 @@ declare function toOpenAPIMethod(method: HTTPMethod): Lowercase<HTTPMethod>;
70
48
  /**
71
49
  * @internal
72
50
  */
73
- declare function getDynamicParams(path: HTTPPath | undefined): string[] | undefined;
51
+ declare function toOpenAPIContent(schema: JSONSchema): Record<string, OpenAPI.MediaTypeObject>;
74
52
  /**
75
53
  * @internal
76
54
  */
77
- declare function toOpenAPIContent(schema: JSONSchema): Record<string, OpenAPIV3_1.MediaTypeObject>;
55
+ declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string, OpenAPI.MediaTypeObject>;
78
56
  /**
79
57
  * @internal
80
58
  */
81
- declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string, OpenAPIV3_1.MediaTypeObject>;
59
+ declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'): OpenAPI.ParameterObject[];
82
60
  /**
83
61
  * @internal
84
62
  */
85
- declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'): OpenAPIV3_1.ParameterObject[];
63
+ declare function checkParamsSchema(schema: ObjectSchema, params: string[]): boolean;
86
64
  /**
87
65
  * @internal
88
66
  */
89
- declare function checkParamsSchema(schema: ObjectSchema, params: string[]): boolean;
67
+ declare function toOpenAPISchema(schema: JSONSchema): OpenAPI.SchemaObject & object;
68
+ declare function resolveOpenAPIJsonSchemaRef(doc: OpenAPI.Document, schema: JSONSchema): JSONSchema;
90
69
  /**
91
- * @internal
70
+ * Simplifies composed object JSON Schemas (using anyOf, oneOf, allOf) by flattening nested compositions
71
+ *
72
+ * @warning The result is looser than the original schema and may not fully validate the same data.
92
73
  */
93
- declare function toOpenAPISchema(schema: JSONSchema): OpenAPIV3_1.SchemaObject & object;
74
+ declare function simplifyComposedObjectJsonSchemasAndRefs(schema: JSONSchema, doc?: OpenAPI.Document): JSONSchema;
75
+
76
+ declare function createJsonifiedRouterClient<T extends AnyRouter, TClientContext extends ClientContext>(router: Lazyable<T | undefined>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<InferRouterInitialContext<T>, Schema<unknown, unknown>, ErrorMap, Meta, TClientContext>>): JsonifiedClient<RouterClient<T, TClientContext>>;
94
77
 
95
78
  /**
96
79
  *@internal
@@ -112,9 +95,22 @@ declare function separateObjectSchema(schema: ObjectSchema, separatedProperties:
112
95
  * @internal
113
96
  */
114
97
  declare function filterSchemaBranches(schema: JSONSchema, check: (schema: JSONSchema) => boolean, matches?: JSONSchema[]): [matches: JSONSchema[], rest: JSONSchema | undefined];
98
+ declare function applySchemaOptionality(required: boolean, schema: JSONSchema): JSONSchema;
99
+ /**
100
+ * Takes a JSON schema and, if it's primarily a union type (anyOf, oneOf),
101
+ * recursively expands it into an array of its constituent, non-union base schemas.
102
+ * If the schema is not a simple union or is a base type, it's returned as a single-element array.
103
+ */
104
+ declare function expandUnionSchema(schema: JSONSchema): JSONSchema[];
105
+ declare function expandArrayableSchema(schema: JSONSchema): undefined | [items: JSONSchema, array: JSONSchema & {
106
+ type: 'array';
107
+ items?: JSONSchema;
108
+ }];
109
+ declare function isPrimitiveSchema(schema: JSONSchema): boolean;
115
110
 
116
111
  declare const oo: {
117
112
  spec: typeof customOpenAPIOperation;
118
113
  };
119
114
 
120
- export { CompositeSchemaConverter, type ConditionalSchemaConverter, type FileSchema, LOGIC_KEYWORDS, type ObjectSchema, OpenAPIGenerator, type OpenAPIGeneratorOptions, type OverrideOperationValue, type SchemaConvertOptions, type SchemaConverter, applyCustomOpenAPIOperation, checkParamsSchema, customOpenAPIOperation, filterSchemaBranches, getCustomOpenAPIOperation, getDynamicParams, isAnySchema, isFileSchema, isObjectSchema, oo, separateObjectSchema, standardizeHTTPPath, toOpenAPIContent, toOpenAPIEventIteratorContent, toOpenAPIMethod, toOpenAPIParameters, toOpenAPIPath, toOpenAPISchema };
115
+ export { LOGIC_KEYWORDS, applyCustomOpenAPIOperation, applySchemaOptionality, checkParamsSchema, createJsonifiedRouterClient, customOpenAPIOperation, expandArrayableSchema, expandUnionSchema, filterSchemaBranches, getCustomOpenAPIOperation, isAnySchema, isFileSchema, isObjectSchema, isPrimitiveSchema, oo, resolveOpenAPIJsonSchemaRef, separateObjectSchema, simplifyComposedObjectJsonSchemasAndRefs, toOpenAPIContent, toOpenAPIEventIteratorContent, toOpenAPIMethod, toOpenAPIParameters, toOpenAPIPath, toOpenAPISchema };
116
+ export type { FileSchema, ObjectSchema, OverrideOperationValue };