@orpc/openapi 2.0.0-beta.19 → 2.0.0-beta.20
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 +1 -0
- package/dist/adapters/fetch/index.d.mts +1 -1
- package/dist/adapters/fetch/index.d.ts +1 -1
- package/dist/adapters/fetch/index.mjs +3 -3
- package/dist/adapters/node/index.d.mts +1 -1
- package/dist/adapters/node/index.d.ts +1 -1
- package/dist/adapters/node/index.mjs +2 -2
- package/dist/adapters/standard/index.d.mts +1 -1
- package/dist/adapters/standard/index.d.ts +1 -1
- package/dist/adapters/standard/index.mjs +3 -3
- package/dist/extensions/route.d.mts +1 -1
- package/dist/extensions/route.d.ts +1 -1
- package/dist/index.d.mts +28 -24
- package/dist/index.d.ts +28 -24
- package/dist/index.mjs +648 -656
- package/dist/shared/{openapi.rpuBsDwE.d.ts → openapi.B6hEbRyF.d.ts} +1 -1
- package/dist/shared/{openapi.BST152ah.d.mts → openapi.BafbB3uM.d.mts} +1 -1
- package/dist/shared/{openapi.BGFa20if.mjs → openapi.C-p_Q2lb.mjs} +3 -3
- package/dist/shared/{openapi.BNWqBLvv.mjs → openapi.CVgUshDP.mjs} +2 -2
- package/dist/shared/{openapi.ztgj01W5.d.ts → openapi.DNNo0V-l.d.ts} +17 -5
- package/dist/shared/{openapi.gqZ1aCD4.d.mts → openapi.hg_rhZ4x.d.mts} +17 -5
- package/dist/shared/{openapi.Be9y-FmY.mjs → openapi.zZH_UksW.mjs} +4 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@ You can read the documentation [here](https://orpc.dev).
|
|
|
52
52
|
- [@orpc/ai-sdk](https://www.npmjs.com/package/@orpc/ai-sdk): Turn contracts and procedures into [AI SDK](https://ai-sdk.dev/) tools.
|
|
53
53
|
- [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): Integrate with [TanStack Query](https://tanstack.com/query/latest).
|
|
54
54
|
- [@orpc/pinia-colada](https://www.npmjs.com/package/@orpc/pinia-colada): Integrate with [Pinia Colada](https://pinia-colada.esm.dev/).
|
|
55
|
+
- [@orpc/swr](https://www.npmjs.com/package/@orpc/swr): Integrate with [SWR](https://swr.vercel.app/).
|
|
55
56
|
- [@orpc/experimental-effect](https://www.npmjs.com/package/@orpc/experimental-effect): Integrate with [Effect](https://effect.website/).
|
|
56
57
|
- [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Implement your contract with [NestJS](https://nestjs.com/).
|
|
57
58
|
- [@orpc/bun](https://www.npmjs.com/package/@orpc/bun): Adapters for [Bun's Redis](https://bun.sh/).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { FetchHandler, FetchHandlerOptions } from '@orpc/server/fetch';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.BafbB3uM.mjs';
|
|
5
5
|
import { ClientContext } from '@orpc/client';
|
|
6
6
|
import { FetchLinkTransportOptions } from '@orpc/client/fetch';
|
|
7
7
|
import { StandardLink, StandardLinkOptions } from '@orpc/client/standard';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { FetchHandler, FetchHandlerOptions } from '@orpc/server/fetch';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.B6hEbRyF.js';
|
|
5
5
|
import { ClientContext } from '@orpc/client';
|
|
6
6
|
import { FetchLinkTransportOptions } from '@orpc/client/fetch';
|
|
7
7
|
import { StandardLink, StandardLinkOptions } from '@orpc/client/standard';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { FetchHandler } from '@orpc/server/fetch';
|
|
2
2
|
import { StandardHandler } from '@orpc/server/standard';
|
|
3
|
-
import { O as OpenAPIHandlerCodec } from '../../shared/openapi.
|
|
3
|
+
import { O as OpenAPIHandlerCodec } from '../../shared/openapi.CVgUshDP.mjs';
|
|
4
4
|
import { FetchLinkTransport } from '@orpc/client/fetch';
|
|
5
5
|
import { StandardLink } from '@orpc/client/standard';
|
|
6
|
-
import { O as OpenAPILinkCodec } from '../../shared/openapi.
|
|
6
|
+
import { O as OpenAPILinkCodec } from '../../shared/openapi.C-p_Q2lb.mjs';
|
|
7
7
|
import '@orpc/client';
|
|
8
8
|
import '@orpc/server';
|
|
9
9
|
import '@orpc/shared';
|
|
10
10
|
import '@standardserver/core';
|
|
11
|
-
import '../../shared/openapi.
|
|
11
|
+
import '../../shared/openapi.zZH_UksW.mjs';
|
|
12
12
|
import '../../shared/openapi.Bt87OzTt.mjs';
|
|
13
13
|
import '../../shared/openapi.B9PQzqBn.mjs';
|
|
14
14
|
import 'rou3';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { NodeHttpHandler, NodeHttpHandlerOptions } from '@orpc/server/node';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.BafbB3uM.mjs';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/shared';
|
|
7
7
|
import '@standardserver/core';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { NodeHttpHandler, NodeHttpHandlerOptions } from '@orpc/server/node';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.B6hEbRyF.js';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/shared';
|
|
7
7
|
import '@standardserver/core';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NodeHttpHandler } from '@orpc/server/node';
|
|
2
2
|
import { StandardHandler } from '@orpc/server/standard';
|
|
3
|
-
import { O as OpenAPIHandlerCodec } from '../../shared/openapi.
|
|
3
|
+
import { O as OpenAPIHandlerCodec } from '../../shared/openapi.CVgUshDP.mjs';
|
|
4
4
|
import '@orpc/client';
|
|
5
5
|
import '@orpc/server';
|
|
6
6
|
import '@orpc/shared';
|
|
7
7
|
import '@standardserver/core';
|
|
8
|
-
import '../../shared/openapi.
|
|
8
|
+
import '../../shared/openapi.zZH_UksW.mjs';
|
|
9
9
|
import '../../shared/openapi.Bt87OzTt.mjs';
|
|
10
10
|
import '../../shared/openapi.B9PQzqBn.mjs';
|
|
11
11
|
import 'rou3';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.
|
|
1
|
+
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.BafbB3uM.mjs';
|
|
2
2
|
import { ClientContext, ClientOptions, AnyORPCError } from '@orpc/client';
|
|
3
3
|
import { StandardLinkCodec, StandardLinkCodecDecodedResponse } from '@orpc/client/standard';
|
|
4
4
|
import { RouterContract } from '@orpc/contract';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.
|
|
1
|
+
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.B6hEbRyF.js';
|
|
2
2
|
import { ClientContext, ClientOptions, AnyORPCError } from '@orpc/client';
|
|
3
3
|
import { StandardLinkCodec, StandardLinkCodecDecodedResponse } from '@orpc/client/standard';
|
|
4
4
|
import { RouterContract } from '@orpc/contract';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { O as OpenAPIHandlerCodec, a as OpenAPIHandlerCodecCore, b as OpenAPIMatcher } from '../../shared/openapi.
|
|
2
|
-
export { O as OpenAPILinkCodec, a as OpenAPILinkCodecError } from '../../shared/openapi.
|
|
1
|
+
export { O as OpenAPIHandlerCodec, a as OpenAPIHandlerCodecCore, b as OpenAPIMatcher } from '../../shared/openapi.CVgUshDP.mjs';
|
|
2
|
+
export { O as OpenAPILinkCodec, a as OpenAPILinkCodecError } from '../../shared/openapi.C-p_Q2lb.mjs';
|
|
3
3
|
import '@orpc/client';
|
|
4
4
|
import '@orpc/server';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
import '@standardserver/core';
|
|
7
|
-
import '../../shared/openapi.
|
|
7
|
+
import '../../shared/openapi.zZH_UksW.mjs';
|
|
8
8
|
import '../../shared/openapi.Bt87OzTt.mjs';
|
|
9
9
|
import '../../shared/openapi.B9PQzqBn.mjs';
|
|
10
10
|
import 'rou3';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyORPCError } from '@orpc/client';
|
|
2
2
|
import { ErrorMap, AnySchema } from '@orpc/contract';
|
|
3
3
|
import { Context } from '@orpc/server';
|
|
4
|
-
import { O as OpenAPIMeta } from '../shared/openapi.
|
|
4
|
+
import { O as OpenAPIMeta } from '../shared/openapi.hg_rhZ4x.mjs';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
import '@standardserver/core';
|
|
7
7
|
import '../shared/openapi.ByT4oUeY.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyORPCError } from '@orpc/client';
|
|
2
2
|
import { ErrorMap, AnySchema } from '@orpc/contract';
|
|
3
3
|
import { Context } from '@orpc/server';
|
|
4
|
-
import { O as OpenAPIMeta } from '../shared/openapi.
|
|
4
|
+
import { O as OpenAPIMeta } from '../shared/openapi.DNNo0V-l.js';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
import '@standardserver/core';
|
|
7
7
|
import '../shared/openapi.ByT4oUeY.js';
|
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ export { COMMON_ERROR_STATUS_MAP } from '@orpc/client';
|
|
|
5
5
|
import { RouterContract, RouterContractClient, AnyProcedureContract, ProcedureContract } from '@orpc/contract';
|
|
6
6
|
import { J as JsonifiedClient, a as OpenAPIDocument } from './shared/openapi.ByT4oUeY.mjs';
|
|
7
7
|
export { b as JsonifiedArray, c as JsonifiedClientError, d as JsonifiedValue, O as OpenAPIOperationObject } from './shared/openapi.ByT4oUeY.mjs';
|
|
8
|
-
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.
|
|
9
|
-
import {
|
|
8
|
+
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.hg_rhZ4x.mjs';
|
|
9
|
+
import { JsonSchema, JsonSchemaConverter } from '@orpc/json-schema';
|
|
10
10
|
import { AnyRouter, AnyProcedure } from '@orpc/server';
|
|
11
11
|
import { Value } from '@orpc/shared';
|
|
12
12
|
export { StandardBodyHint } from '@standardserver/core';
|
|
@@ -30,8 +30,30 @@ declare const DEFAULT_OPENAPI_SUCCESS_DESCRIPTION = "OK";
|
|
|
30
30
|
declare const DEFAULT_OPENAPI_INPUT_STRUCTURE = "compact";
|
|
31
31
|
declare const DEFAULT_OPENAPI_OUTPUT_STRUCTURE = "compact";
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* GET and HEAD requests cannot carry a request body,
|
|
35
|
+
* so their compact input maps to query parameters instead.
|
|
36
|
+
*/
|
|
37
|
+
declare function isBodylessMethod(method: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Dynamic parameters are always returned in path order.
|
|
40
|
+
*/
|
|
41
|
+
declare function getDynamicPathParams(path: `/${string}`): {
|
|
42
|
+
segment: string;
|
|
43
|
+
startIndex: number;
|
|
44
|
+
parameterName: string;
|
|
45
|
+
allowsSlash: boolean;
|
|
46
|
+
}[] | undefined;
|
|
47
|
+
|
|
33
48
|
declare class OpenAPIGeneratorError extends TypeError {
|
|
34
49
|
}
|
|
50
|
+
interface OpenAPIErrorBodyDefinition {
|
|
51
|
+
code: string;
|
|
52
|
+
defaultMessage: string | undefined;
|
|
53
|
+
dataOptional: boolean;
|
|
54
|
+
dataJsonSchema: JsonSchema;
|
|
55
|
+
}
|
|
56
|
+
|
|
35
57
|
interface OpenAPIGeneratorOptions {
|
|
36
58
|
converters?: JsonSchemaConverter[] | undefined;
|
|
37
59
|
/**
|
|
@@ -62,18 +84,13 @@ interface OpenAPIGeneratorGenerateOptions {
|
|
|
62
84
|
* - Return `null | undefined` to use the default error response body shaper.
|
|
63
85
|
*/
|
|
64
86
|
customErrorResponseBodySchema?: Value<JsonSchema | undefined | null, [
|
|
65
|
-
definedErrors:
|
|
66
|
-
code: string;
|
|
67
|
-
defaultMessage: string | undefined;
|
|
68
|
-
dataOptional: boolean;
|
|
69
|
-
dataJsonSchema: JsonSchema;
|
|
70
|
-
}[],
|
|
87
|
+
definedErrors: OpenAPIErrorBodyDefinition[],
|
|
71
88
|
status: number
|
|
72
89
|
]>;
|
|
73
90
|
/**
|
|
74
91
|
* Mapping ORPCError Code -> HTTP Status Code
|
|
75
92
|
*
|
|
76
|
-
* @default COMMON_ERROR_STATUS_MAP
|
|
93
|
+
* @default COMMON_ERROR_STATUS_MAP
|
|
77
94
|
*/
|
|
78
95
|
errorStatusMap?: Record<string, number> | undefined;
|
|
79
96
|
}
|
|
@@ -84,9 +101,6 @@ declare class OpenAPIGenerator {
|
|
|
84
101
|
generate(router: RouterContract | AnyRouter, options?: OpenAPIGeneratorGenerateOptions): Promise<OpenAPIDocument>;
|
|
85
102
|
private convertSchema;
|
|
86
103
|
private convertSchemas;
|
|
87
|
-
private request;
|
|
88
|
-
private successResponse;
|
|
89
|
-
private errorResponse;
|
|
90
104
|
}
|
|
91
105
|
|
|
92
106
|
type PopulatedContractRouterOpenAPIPaths<T extends RouterContract> = T extends ProcedureContract<infer UInputSchema, infer UOutputSchema, infer UErrors> ? ProcedureContract<UInputSchema, UOutputSchema, UErrors> : {
|
|
@@ -106,15 +120,5 @@ interface PopulateRouterContractOpenAPIPathsOptions {
|
|
|
106
120
|
*/
|
|
107
121
|
declare function populateRouterContractOpenAPIPaths<T extends RouterContract>(router: T, options?: PopulateRouterContractOpenAPIPathsOptions): PopulatedContractRouterOpenAPIPaths<T>;
|
|
108
122
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*/
|
|
112
|
-
declare function getDynamicPathParams(path: `/${string}`): {
|
|
113
|
-
segment: string;
|
|
114
|
-
startIndex: number;
|
|
115
|
-
parameterName: string;
|
|
116
|
-
allowsSlash: boolean;
|
|
117
|
-
}[] | undefined;
|
|
118
|
-
|
|
119
|
-
export { DEFAULT_OPENAPI_INPUT_STRUCTURE, DEFAULT_OPENAPI_METHOD, DEFAULT_OPENAPI_OUTPUT_STRUCTURE, DEFAULT_OPENAPI_SUCCESS_DESCRIPTION, JsonifiedClient, OpenAPIDocument, OpenAPIGenerator, OpenAPIGeneratorError, OpenAPISerializer, createContractJsonifiedClientFactory, getDynamicPathParams, populateRouterContractOpenAPIPaths };
|
|
120
|
-
export type { ContractJsonifiedClientFactory, ContractJsonifiedClientFactoryOptions, OpenAPIGeneratorGenerateOptions, OpenAPIGeneratorOptions, PopulateRouterContractOpenAPIPathsOptions, PopulatedContractRouterOpenAPIPaths };
|
|
123
|
+
export { DEFAULT_OPENAPI_INPUT_STRUCTURE, DEFAULT_OPENAPI_METHOD, DEFAULT_OPENAPI_OUTPUT_STRUCTURE, DEFAULT_OPENAPI_SUCCESS_DESCRIPTION, JsonifiedClient, OpenAPIDocument, OpenAPIGenerator, OpenAPIGeneratorError, OpenAPISerializer, createContractJsonifiedClientFactory, getDynamicPathParams, isBodylessMethod, populateRouterContractOpenAPIPaths };
|
|
124
|
+
export type { ContractJsonifiedClientFactory, ContractJsonifiedClientFactoryOptions, OpenAPIErrorBodyDefinition, OpenAPIGeneratorGenerateOptions, OpenAPIGeneratorOptions, PopulateRouterContractOpenAPIPathsOptions, PopulatedContractRouterOpenAPIPaths };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { COMMON_ERROR_STATUS_MAP } from '@orpc/client';
|
|
|
5
5
|
import { RouterContract, RouterContractClient, AnyProcedureContract, ProcedureContract } from '@orpc/contract';
|
|
6
6
|
import { J as JsonifiedClient, a as OpenAPIDocument } from './shared/openapi.ByT4oUeY.js';
|
|
7
7
|
export { b as JsonifiedArray, c as JsonifiedClientError, d as JsonifiedValue, O as OpenAPIOperationObject } from './shared/openapi.ByT4oUeY.js';
|
|
8
|
-
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.
|
|
9
|
-
import {
|
|
8
|
+
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.DNNo0V-l.js';
|
|
9
|
+
import { JsonSchema, JsonSchemaConverter } from '@orpc/json-schema';
|
|
10
10
|
import { AnyRouter, AnyProcedure } from '@orpc/server';
|
|
11
11
|
import { Value } from '@orpc/shared';
|
|
12
12
|
export { StandardBodyHint } from '@standardserver/core';
|
|
@@ -30,8 +30,30 @@ declare const DEFAULT_OPENAPI_SUCCESS_DESCRIPTION = "OK";
|
|
|
30
30
|
declare const DEFAULT_OPENAPI_INPUT_STRUCTURE = "compact";
|
|
31
31
|
declare const DEFAULT_OPENAPI_OUTPUT_STRUCTURE = "compact";
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* GET and HEAD requests cannot carry a request body,
|
|
35
|
+
* so their compact input maps to query parameters instead.
|
|
36
|
+
*/
|
|
37
|
+
declare function isBodylessMethod(method: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Dynamic parameters are always returned in path order.
|
|
40
|
+
*/
|
|
41
|
+
declare function getDynamicPathParams(path: `/${string}`): {
|
|
42
|
+
segment: string;
|
|
43
|
+
startIndex: number;
|
|
44
|
+
parameterName: string;
|
|
45
|
+
allowsSlash: boolean;
|
|
46
|
+
}[] | undefined;
|
|
47
|
+
|
|
33
48
|
declare class OpenAPIGeneratorError extends TypeError {
|
|
34
49
|
}
|
|
50
|
+
interface OpenAPIErrorBodyDefinition {
|
|
51
|
+
code: string;
|
|
52
|
+
defaultMessage: string | undefined;
|
|
53
|
+
dataOptional: boolean;
|
|
54
|
+
dataJsonSchema: JsonSchema;
|
|
55
|
+
}
|
|
56
|
+
|
|
35
57
|
interface OpenAPIGeneratorOptions {
|
|
36
58
|
converters?: JsonSchemaConverter[] | undefined;
|
|
37
59
|
/**
|
|
@@ -62,18 +84,13 @@ interface OpenAPIGeneratorGenerateOptions {
|
|
|
62
84
|
* - Return `null | undefined` to use the default error response body shaper.
|
|
63
85
|
*/
|
|
64
86
|
customErrorResponseBodySchema?: Value<JsonSchema | undefined | null, [
|
|
65
|
-
definedErrors:
|
|
66
|
-
code: string;
|
|
67
|
-
defaultMessage: string | undefined;
|
|
68
|
-
dataOptional: boolean;
|
|
69
|
-
dataJsonSchema: JsonSchema;
|
|
70
|
-
}[],
|
|
87
|
+
definedErrors: OpenAPIErrorBodyDefinition[],
|
|
71
88
|
status: number
|
|
72
89
|
]>;
|
|
73
90
|
/**
|
|
74
91
|
* Mapping ORPCError Code -> HTTP Status Code
|
|
75
92
|
*
|
|
76
|
-
* @default COMMON_ERROR_STATUS_MAP
|
|
93
|
+
* @default COMMON_ERROR_STATUS_MAP
|
|
77
94
|
*/
|
|
78
95
|
errorStatusMap?: Record<string, number> | undefined;
|
|
79
96
|
}
|
|
@@ -84,9 +101,6 @@ declare class OpenAPIGenerator {
|
|
|
84
101
|
generate(router: RouterContract | AnyRouter, options?: OpenAPIGeneratorGenerateOptions): Promise<OpenAPIDocument>;
|
|
85
102
|
private convertSchema;
|
|
86
103
|
private convertSchemas;
|
|
87
|
-
private request;
|
|
88
|
-
private successResponse;
|
|
89
|
-
private errorResponse;
|
|
90
104
|
}
|
|
91
105
|
|
|
92
106
|
type PopulatedContractRouterOpenAPIPaths<T extends RouterContract> = T extends ProcedureContract<infer UInputSchema, infer UOutputSchema, infer UErrors> ? ProcedureContract<UInputSchema, UOutputSchema, UErrors> : {
|
|
@@ -106,15 +120,5 @@ interface PopulateRouterContractOpenAPIPathsOptions {
|
|
|
106
120
|
*/
|
|
107
121
|
declare function populateRouterContractOpenAPIPaths<T extends RouterContract>(router: T, options?: PopulateRouterContractOpenAPIPathsOptions): PopulatedContractRouterOpenAPIPaths<T>;
|
|
108
122
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*/
|
|
112
|
-
declare function getDynamicPathParams(path: `/${string}`): {
|
|
113
|
-
segment: string;
|
|
114
|
-
startIndex: number;
|
|
115
|
-
parameterName: string;
|
|
116
|
-
allowsSlash: boolean;
|
|
117
|
-
}[] | undefined;
|
|
118
|
-
|
|
119
|
-
export { DEFAULT_OPENAPI_INPUT_STRUCTURE, DEFAULT_OPENAPI_METHOD, DEFAULT_OPENAPI_OUTPUT_STRUCTURE, DEFAULT_OPENAPI_SUCCESS_DESCRIPTION, JsonifiedClient, OpenAPIDocument, OpenAPIGenerator, OpenAPIGeneratorError, OpenAPISerializer, createContractJsonifiedClientFactory, getDynamicPathParams, populateRouterContractOpenAPIPaths };
|
|
120
|
-
export type { ContractJsonifiedClientFactory, ContractJsonifiedClientFactoryOptions, OpenAPIGeneratorGenerateOptions, OpenAPIGeneratorOptions, PopulateRouterContractOpenAPIPathsOptions, PopulatedContractRouterOpenAPIPaths };
|
|
123
|
+
export { DEFAULT_OPENAPI_INPUT_STRUCTURE, DEFAULT_OPENAPI_METHOD, DEFAULT_OPENAPI_OUTPUT_STRUCTURE, DEFAULT_OPENAPI_SUCCESS_DESCRIPTION, JsonifiedClient, OpenAPIDocument, OpenAPIGenerator, OpenAPIGeneratorError, OpenAPISerializer, createContractJsonifiedClientFactory, getDynamicPathParams, isBodylessMethod, populateRouterContractOpenAPIPaths };
|
|
124
|
+
export type { ContractJsonifiedClientFactory, ContractJsonifiedClientFactoryOptions, OpenAPIErrorBodyDefinition, OpenAPIGeneratorGenerateOptions, OpenAPIGeneratorOptions, PopulateRouterContractOpenAPIPathsOptions, PopulatedContractRouterOpenAPIPaths };
|