@orpc/openapi 0.0.0-next.75edb88 → 0.0.0-next.7605f6c
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 +141 -34
- package/dist/adapters/aws-lambda/index.d.mts +20 -0
- package/dist/adapters/aws-lambda/index.d.ts +20 -0
- package/dist/adapters/aws-lambda/index.mjs +18 -0
- package/dist/adapters/fastify/index.d.mts +23 -0
- package/dist/adapters/fastify/index.d.ts +23 -0
- package/dist/adapters/fastify/index.mjs +18 -0
- package/dist/adapters/fetch/index.d.mts +15 -3
- package/dist/adapters/fetch/index.d.ts +15 -3
- package/dist/adapters/fetch/index.mjs +4 -3
- package/dist/adapters/node/index.d.mts +15 -3
- package/dist/adapters/node/index.d.ts +15 -3
- package/dist/adapters/node/index.mjs +4 -3
- package/dist/adapters/standard/index.d.mts +8 -22
- package/dist/adapters/standard/index.d.ts +8 -22
- package/dist/adapters/standard/index.mjs +2 -1
- package/dist/index.d.mts +43 -40
- package/dist/index.d.ts +43 -40
- package/dist/index.mjs +31 -526
- package/dist/plugins/index.d.mts +86 -0
- package/dist/plugins/index.d.ts +86 -0
- package/dist/plugins/index.mjs +157 -0
- package/dist/shared/{openapi.p5tsmBXx.mjs → openapi.BB-W-NKv.mjs} +59 -13
- package/dist/shared/openapi.BGy4N6eR.d.mts +120 -0
- package/dist/shared/openapi.BGy4N6eR.d.ts +120 -0
- package/dist/shared/openapi.BwdtJjDu.mjs +878 -0
- package/dist/shared/openapi.DwaweYRb.d.mts +54 -0
- package/dist/shared/openapi.DwaweYRb.d.ts +54 -0
- package/package.json +30 -14
- package/dist/shared/openapi.D1oMd-e4.d.mts +0 -11
- package/dist/shared/openapi.D1oMd-e4.d.ts +0 -11
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare class StandardOpenAPICodec implements StandardCodec {
|
|
9
|
-
private readonly serializer;
|
|
10
|
-
constructor(serializer: StandardOpenAPISerializer);
|
|
11
|
-
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
|
12
|
-
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
13
|
-
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare class StandardOpenAPIMatcher implements StandardMatcher {
|
|
17
|
-
private readonly tree;
|
|
18
|
-
private pendingRouters;
|
|
19
|
-
init(router: AnyRouter, path?: readonly string[]): void;
|
|
20
|
-
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
|
21
|
-
}
|
|
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';
|
|
22
8
|
|
|
23
9
|
/**
|
|
24
10
|
* {@link https://github.com/unjs/rou3}
|
|
@@ -31,4 +17,4 @@ declare function toRou3Pattern(path: HTTPPath): string;
|
|
|
31
17
|
*/
|
|
32
18
|
declare function decodeParams(params: Record<string, string>): Record<string, string>;
|
|
33
19
|
|
|
34
|
-
export {
|
|
20
|
+
export { decodeParams, toRou3Pattern };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { S as StandardOpenAPICodec, a as StandardOpenAPIHandler, b as StandardOpenAPIMatcher, d as decodeParams, t as toRou3Pattern } from '../../shared/openapi.
|
|
1
|
+
export { S as StandardOpenAPICodec, a as StandardOpenAPIHandler, b as StandardOpenAPIMatcher, d as decodeParams, t as toRou3Pattern } from '../../shared/openapi.BB-W-NKv.mjs';
|
|
2
2
|
import '@orpc/openapi-client/standard';
|
|
3
3
|
import '@orpc/server/standard';
|
|
4
|
+
import '@orpc/client';
|
|
4
5
|
import '@orpc/contract';
|
|
5
6
|
import '@orpc/shared';
|
|
6
7
|
import '@orpc/client/standard';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
import { StandardOpenAPIJsonSerializerOptions } from '@orpc/openapi-client/standard';
|
|
5
|
-
import { AnyRouter } from '@orpc/server';
|
|
6
|
-
import { JSONSchema } from 'json-schema-typed/draft-2020-12';
|
|
7
|
-
export { JSONSchema, Format as JSONSchemaFormat } from 'json-schema-typed/draft-2020-12';
|
|
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';
|
|
8
4
|
import { HTTPPath, HTTPMethod } from '@orpc/client';
|
|
5
|
+
import { JSONSchema } 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';
|
|
9
11
|
|
|
10
|
-
type OverrideOperationValue = Partial<
|
|
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
|
+
*/
|
|
11
18
|
declare function customOpenAPIOperation<T extends object>(o: T, extend: OverrideOperationValue): T;
|
|
12
19
|
declare function getCustomOpenAPIOperation(o: object): OverrideOperationValue | undefined;
|
|
13
|
-
declare function applyCustomOpenAPIOperation(operation:
|
|
20
|
+
declare function applyCustomOpenAPIOperation(operation: OpenAPI.OperationObject, contract: AnyContractProcedure): OpenAPI.OperationObject;
|
|
14
21
|
|
|
15
22
|
/**
|
|
16
23
|
* @internal
|
|
@@ -30,32 +37,6 @@ type FileSchema = JSONSchema & {
|
|
|
30
37
|
*/
|
|
31
38
|
declare const LOGIC_KEYWORDS: string[];
|
|
32
39
|
|
|
33
|
-
interface SchemaConvertOptions {
|
|
34
|
-
strategy: 'input' | 'output';
|
|
35
|
-
}
|
|
36
|
-
interface SchemaConverter {
|
|
37
|
-
convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
|
|
38
|
-
}
|
|
39
|
-
interface ConditionalSchemaConverter extends SchemaConverter {
|
|
40
|
-
condition(schema: AnySchema | undefined, options: SchemaConvertOptions): boolean;
|
|
41
|
-
}
|
|
42
|
-
declare class CompositeSchemaConverter implements SchemaConverter {
|
|
43
|
-
private readonly converters;
|
|
44
|
-
constructor(converters: ConditionalSchemaConverter[]);
|
|
45
|
-
convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface OpenAPIGeneratorOptions extends StandardOpenAPIJsonSerializerOptions {
|
|
49
|
-
schemaConverters?: ConditionalSchemaConverter[];
|
|
50
|
-
}
|
|
51
|
-
declare class OpenAPIGenerator {
|
|
52
|
-
#private;
|
|
53
|
-
private readonly serializer;
|
|
54
|
-
private readonly converter;
|
|
55
|
-
constructor(options?: OpenAPIGeneratorOptions);
|
|
56
|
-
generate(router: AnyContractRouter | AnyRouter, base: Omit<OpenAPIV3_1.Document, 'openapi'>): Promise<OpenAPIV3_1.Document>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
40
|
/**
|
|
60
41
|
* @internal
|
|
61
42
|
*/
|
|
@@ -67,15 +48,15 @@ declare function toOpenAPIMethod(method: HTTPMethod): Lowercase<HTTPMethod>;
|
|
|
67
48
|
/**
|
|
68
49
|
* @internal
|
|
69
50
|
*/
|
|
70
|
-
declare function toOpenAPIContent(schema: JSONSchema): Record<string,
|
|
51
|
+
declare function toOpenAPIContent(schema: JSONSchema): Record<string, OpenAPI.MediaTypeObject>;
|
|
71
52
|
/**
|
|
72
53
|
* @internal
|
|
73
54
|
*/
|
|
74
|
-
declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string,
|
|
55
|
+
declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string, OpenAPI.MediaTypeObject>;
|
|
75
56
|
/**
|
|
76
57
|
* @internal
|
|
77
58
|
*/
|
|
78
|
-
declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'):
|
|
59
|
+
declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'): OpenAPI.ParameterObject[];
|
|
79
60
|
/**
|
|
80
61
|
* @internal
|
|
81
62
|
*/
|
|
@@ -83,7 +64,16 @@ declare function checkParamsSchema(schema: ObjectSchema, params: string[]): bool
|
|
|
83
64
|
/**
|
|
84
65
|
* @internal
|
|
85
66
|
*/
|
|
86
|
-
declare function toOpenAPISchema(schema: JSONSchema):
|
|
67
|
+
declare function toOpenAPISchema(schema: JSONSchema): OpenAPI.SchemaObject & object;
|
|
68
|
+
declare function resolveOpenAPIJsonSchemaRef(doc: OpenAPI.Document, schema: JSONSchema): JSONSchema;
|
|
69
|
+
/**
|
|
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.
|
|
73
|
+
*/
|
|
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>>;
|
|
87
77
|
|
|
88
78
|
/**
|
|
89
79
|
*@internal
|
|
@@ -97,6 +87,7 @@ declare function isObjectSchema(schema: JSONSchema): schema is ObjectSchema;
|
|
|
97
87
|
* @internal
|
|
98
88
|
*/
|
|
99
89
|
declare function isAnySchema(schema: JSONSchema): boolean;
|
|
90
|
+
declare function isNeverSchema(schema: JSONSchema): boolean;
|
|
100
91
|
/**
|
|
101
92
|
* @internal
|
|
102
93
|
*/
|
|
@@ -106,9 +97,21 @@ declare function separateObjectSchema(schema: ObjectSchema, separatedProperties:
|
|
|
106
97
|
*/
|
|
107
98
|
declare function filterSchemaBranches(schema: JSONSchema, check: (schema: JSONSchema) => boolean, matches?: JSONSchema[]): [matches: JSONSchema[], rest: JSONSchema | undefined];
|
|
108
99
|
declare function applySchemaOptionality(required: boolean, schema: JSONSchema): JSONSchema;
|
|
100
|
+
/**
|
|
101
|
+
* Takes a JSON schema and, if it's primarily a union type (anyOf, oneOf),
|
|
102
|
+
* recursively expands it into an array of its constituent, non-union base schemas.
|
|
103
|
+
* If the schema is not a simple union or is a base type, it's returned as a single-element array.
|
|
104
|
+
*/
|
|
105
|
+
declare function expandUnionSchema(schema: JSONSchema): JSONSchema[];
|
|
106
|
+
declare function expandArrayableSchema(schema: JSONSchema): undefined | [items: JSONSchema, array: JSONSchema & {
|
|
107
|
+
type: 'array';
|
|
108
|
+
items?: JSONSchema;
|
|
109
|
+
}];
|
|
110
|
+
declare function isPrimitiveSchema(schema: JSONSchema): boolean;
|
|
109
111
|
|
|
110
112
|
declare const oo: {
|
|
111
113
|
spec: typeof customOpenAPIOperation;
|
|
112
114
|
};
|
|
113
115
|
|
|
114
|
-
export {
|
|
116
|
+
export { LOGIC_KEYWORDS, applyCustomOpenAPIOperation, applySchemaOptionality, checkParamsSchema, createJsonifiedRouterClient, customOpenAPIOperation, expandArrayableSchema, expandUnionSchema, filterSchemaBranches, getCustomOpenAPIOperation, isAnySchema, isFileSchema, isNeverSchema, isObjectSchema, isPrimitiveSchema, oo, resolveOpenAPIJsonSchemaRef, separateObjectSchema, simplifyComposedObjectJsonSchemasAndRefs, toOpenAPIContent, toOpenAPIEventIteratorContent, toOpenAPIMethod, toOpenAPIParameters, toOpenAPIPath, toOpenAPISchema };
|
|
117
|
+
export type { FileSchema, ObjectSchema, OverrideOperationValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
import { StandardOpenAPIJsonSerializerOptions } from '@orpc/openapi-client/standard';
|
|
5
|
-
import { AnyRouter } from '@orpc/server';
|
|
6
|
-
import { JSONSchema } from 'json-schema-typed/draft-2020-12';
|
|
7
|
-
export { JSONSchema, Format as JSONSchemaFormat } from 'json-schema-typed/draft-2020-12';
|
|
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';
|
|
8
4
|
import { HTTPPath, HTTPMethod } from '@orpc/client';
|
|
5
|
+
import { JSONSchema } 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';
|
|
9
11
|
|
|
10
|
-
type OverrideOperationValue = Partial<
|
|
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
|
+
*/
|
|
11
18
|
declare function customOpenAPIOperation<T extends object>(o: T, extend: OverrideOperationValue): T;
|
|
12
19
|
declare function getCustomOpenAPIOperation(o: object): OverrideOperationValue | undefined;
|
|
13
|
-
declare function applyCustomOpenAPIOperation(operation:
|
|
20
|
+
declare function applyCustomOpenAPIOperation(operation: OpenAPI.OperationObject, contract: AnyContractProcedure): OpenAPI.OperationObject;
|
|
14
21
|
|
|
15
22
|
/**
|
|
16
23
|
* @internal
|
|
@@ -30,32 +37,6 @@ type FileSchema = JSONSchema & {
|
|
|
30
37
|
*/
|
|
31
38
|
declare const LOGIC_KEYWORDS: string[];
|
|
32
39
|
|
|
33
|
-
interface SchemaConvertOptions {
|
|
34
|
-
strategy: 'input' | 'output';
|
|
35
|
-
}
|
|
36
|
-
interface SchemaConverter {
|
|
37
|
-
convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
|
|
38
|
-
}
|
|
39
|
-
interface ConditionalSchemaConverter extends SchemaConverter {
|
|
40
|
-
condition(schema: AnySchema | undefined, options: SchemaConvertOptions): boolean;
|
|
41
|
-
}
|
|
42
|
-
declare class CompositeSchemaConverter implements SchemaConverter {
|
|
43
|
-
private readonly converters;
|
|
44
|
-
constructor(converters: ConditionalSchemaConverter[]);
|
|
45
|
-
convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: JSONSchema];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface OpenAPIGeneratorOptions extends StandardOpenAPIJsonSerializerOptions {
|
|
49
|
-
schemaConverters?: ConditionalSchemaConverter[];
|
|
50
|
-
}
|
|
51
|
-
declare class OpenAPIGenerator {
|
|
52
|
-
#private;
|
|
53
|
-
private readonly serializer;
|
|
54
|
-
private readonly converter;
|
|
55
|
-
constructor(options?: OpenAPIGeneratorOptions);
|
|
56
|
-
generate(router: AnyContractRouter | AnyRouter, base: Omit<OpenAPIV3_1.Document, 'openapi'>): Promise<OpenAPIV3_1.Document>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
40
|
/**
|
|
60
41
|
* @internal
|
|
61
42
|
*/
|
|
@@ -67,15 +48,15 @@ declare function toOpenAPIMethod(method: HTTPMethod): Lowercase<HTTPMethod>;
|
|
|
67
48
|
/**
|
|
68
49
|
* @internal
|
|
69
50
|
*/
|
|
70
|
-
declare function toOpenAPIContent(schema: JSONSchema): Record<string,
|
|
51
|
+
declare function toOpenAPIContent(schema: JSONSchema): Record<string, OpenAPI.MediaTypeObject>;
|
|
71
52
|
/**
|
|
72
53
|
* @internal
|
|
73
54
|
*/
|
|
74
|
-
declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string,
|
|
55
|
+
declare function toOpenAPIEventIteratorContent([yieldsRequired, yieldsSchema]: [boolean, JSONSchema], [returnsRequired, returnsSchema]: [boolean, JSONSchema]): Record<string, OpenAPI.MediaTypeObject>;
|
|
75
56
|
/**
|
|
76
57
|
* @internal
|
|
77
58
|
*/
|
|
78
|
-
declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'):
|
|
59
|
+
declare function toOpenAPIParameters(schema: ObjectSchema, parameterIn: 'path' | 'query' | 'header' | 'cookie'): OpenAPI.ParameterObject[];
|
|
79
60
|
/**
|
|
80
61
|
* @internal
|
|
81
62
|
*/
|
|
@@ -83,7 +64,16 @@ declare function checkParamsSchema(schema: ObjectSchema, params: string[]): bool
|
|
|
83
64
|
/**
|
|
84
65
|
* @internal
|
|
85
66
|
*/
|
|
86
|
-
declare function toOpenAPISchema(schema: JSONSchema):
|
|
67
|
+
declare function toOpenAPISchema(schema: JSONSchema): OpenAPI.SchemaObject & object;
|
|
68
|
+
declare function resolveOpenAPIJsonSchemaRef(doc: OpenAPI.Document, schema: JSONSchema): JSONSchema;
|
|
69
|
+
/**
|
|
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.
|
|
73
|
+
*/
|
|
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>>;
|
|
87
77
|
|
|
88
78
|
/**
|
|
89
79
|
*@internal
|
|
@@ -97,6 +87,7 @@ declare function isObjectSchema(schema: JSONSchema): schema is ObjectSchema;
|
|
|
97
87
|
* @internal
|
|
98
88
|
*/
|
|
99
89
|
declare function isAnySchema(schema: JSONSchema): boolean;
|
|
90
|
+
declare function isNeverSchema(schema: JSONSchema): boolean;
|
|
100
91
|
/**
|
|
101
92
|
* @internal
|
|
102
93
|
*/
|
|
@@ -106,9 +97,21 @@ declare function separateObjectSchema(schema: ObjectSchema, separatedProperties:
|
|
|
106
97
|
*/
|
|
107
98
|
declare function filterSchemaBranches(schema: JSONSchema, check: (schema: JSONSchema) => boolean, matches?: JSONSchema[]): [matches: JSONSchema[], rest: JSONSchema | undefined];
|
|
108
99
|
declare function applySchemaOptionality(required: boolean, schema: JSONSchema): JSONSchema;
|
|
100
|
+
/**
|
|
101
|
+
* Takes a JSON schema and, if it's primarily a union type (anyOf, oneOf),
|
|
102
|
+
* recursively expands it into an array of its constituent, non-union base schemas.
|
|
103
|
+
* If the schema is not a simple union or is a base type, it's returned as a single-element array.
|
|
104
|
+
*/
|
|
105
|
+
declare function expandUnionSchema(schema: JSONSchema): JSONSchema[];
|
|
106
|
+
declare function expandArrayableSchema(schema: JSONSchema): undefined | [items: JSONSchema, array: JSONSchema & {
|
|
107
|
+
type: 'array';
|
|
108
|
+
items?: JSONSchema;
|
|
109
|
+
}];
|
|
110
|
+
declare function isPrimitiveSchema(schema: JSONSchema): boolean;
|
|
109
111
|
|
|
110
112
|
declare const oo: {
|
|
111
113
|
spec: typeof customOpenAPIOperation;
|
|
112
114
|
};
|
|
113
115
|
|
|
114
|
-
export {
|
|
116
|
+
export { LOGIC_KEYWORDS, applyCustomOpenAPIOperation, applySchemaOptionality, checkParamsSchema, createJsonifiedRouterClient, customOpenAPIOperation, expandArrayableSchema, expandUnionSchema, filterSchemaBranches, getCustomOpenAPIOperation, isAnySchema, isFileSchema, isNeverSchema, isObjectSchema, isPrimitiveSchema, oo, resolveOpenAPIJsonSchemaRef, separateObjectSchema, simplifyComposedObjectJsonSchemasAndRefs, toOpenAPIContent, toOpenAPIEventIteratorContent, toOpenAPIMethod, toOpenAPIParameters, toOpenAPIPath, toOpenAPISchema };
|
|
117
|
+
export type { FileSchema, ObjectSchema, OverrideOperationValue };
|