@orpc/openapi 1.12.0 → 1.12.1
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 +3 -3
- package/dist/adapters/aws-lambda/index.d.mts +2 -2
- package/dist/adapters/aws-lambda/index.d.ts +2 -2
- package/dist/adapters/fastify/index.d.mts +2 -2
- package/dist/adapters/fastify/index.d.ts +2 -2
- package/dist/adapters/fetch/index.d.mts +2 -2
- package/dist/adapters/fetch/index.d.ts +2 -2
- package/dist/adapters/node/index.d.mts +2 -2
- package/dist/adapters/node/index.d.ts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/plugins/index.d.mts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/shared/{openapi.dbQeFCUJ.d.mts → openapi.BGy4N6eR.d.mts} +2 -2
- package/dist/shared/{openapi.dbQeFCUJ.d.ts → openapi.BGy4N6eR.d.ts} +2 -2
- package/dist/shared/{openapi.DNv9yFfn.mjs → openapi.CoREqFh3.mjs} +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<image align="center" src="https://orpc.
|
|
2
|
+
<image align="center" src="https://orpc.dev/logo.webp" width=280 alt="oRPC logo" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<h1></h1>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
## Documentation
|
|
47
47
|
|
|
48
|
-
You can find the full documentation [here](https://orpc.
|
|
48
|
+
You can find the full documentation [here](https://orpc.dev).
|
|
49
49
|
|
|
50
50
|
## Packages
|
|
51
51
|
|
|
@@ -66,7 +66,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
|
|
|
66
66
|
|
|
67
67
|
## `@orpc/openapi`
|
|
68
68
|
|
|
69
|
-
Generate OpenAPI specs and handle OpenAPI requests. Read the [documentation](https://orpc.
|
|
69
|
+
Generate OpenAPI specs and handle OpenAPI requests. Read the [documentation](https://orpc.dev/docs/openapi/getting-started) for more information.
|
|
70
70
|
|
|
71
71
|
```ts
|
|
72
72
|
import { createServer } from 'node:http'
|
|
@@ -10,8 +10,8 @@ import '@orpc/shared';
|
|
|
10
10
|
/**
|
|
11
11
|
* OpenAPI Handler for AWS Lambda.
|
|
12
12
|
*
|
|
13
|
-
* @see {@link https://orpc.
|
|
14
|
-
* @see {@link https://orpc.
|
|
13
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
14
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
15
15
|
*/
|
|
16
16
|
declare class OpenAPIHandler<T extends Context> extends AwsLambdaHandler<T> {
|
|
17
17
|
constructor(router: Router<any, T>, options?: NoInfer<StandardOpenAPIHandlerOptions<T> & AwsLambdaHandlerOptions>);
|
|
@@ -10,8 +10,8 @@ import '@orpc/shared';
|
|
|
10
10
|
/**
|
|
11
11
|
* OpenAPI Handler for AWS Lambda.
|
|
12
12
|
*
|
|
13
|
-
* @see {@link https://orpc.
|
|
14
|
-
* @see {@link https://orpc.
|
|
13
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
14
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
15
15
|
*/
|
|
16
16
|
declare class OpenAPIHandler<T extends Context> extends AwsLambdaHandler<T> {
|
|
17
17
|
constructor(router: Router<any, T>, options?: NoInfer<StandardOpenAPIHandlerOptions<T> & AwsLambdaHandlerOptions>);
|
|
@@ -12,8 +12,8 @@ interface OpenAPIHandlerOptions<T extends Context> extends FastifyHandlerOptions
|
|
|
12
12
|
/**
|
|
13
13
|
* OpenAPI Handler for Fastify Server
|
|
14
14
|
*
|
|
15
|
-
* @see {@link https://orpc.
|
|
16
|
-
* @see {@link https://orpc.
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare class OpenAPIHandler<T extends Context> extends FastifyHandler<T> {
|
|
19
19
|
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
@@ -12,8 +12,8 @@ interface OpenAPIHandlerOptions<T extends Context> extends FastifyHandlerOptions
|
|
|
12
12
|
/**
|
|
13
13
|
* OpenAPI Handler for Fastify Server
|
|
14
14
|
*
|
|
15
|
-
* @see {@link https://orpc.
|
|
16
|
-
* @see {@link https://orpc.
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare class OpenAPIHandler<T extends Context> extends FastifyHandler<T> {
|
|
19
19
|
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
@@ -12,8 +12,8 @@ interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T
|
|
|
12
12
|
/**
|
|
13
13
|
* OpenAPI Handler for Fetch Server
|
|
14
14
|
*
|
|
15
|
-
* @see {@link https://orpc.
|
|
16
|
-
* @see {@link https://orpc.
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare class OpenAPIHandler<T extends Context> extends FetchHandler<T> {
|
|
19
19
|
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
@@ -12,8 +12,8 @@ interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T
|
|
|
12
12
|
/**
|
|
13
13
|
* OpenAPI Handler for Fetch Server
|
|
14
14
|
*
|
|
15
|
-
* @see {@link https://orpc.
|
|
16
|
-
* @see {@link https://orpc.
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare class OpenAPIHandler<T extends Context> extends FetchHandler<T> {
|
|
19
19
|
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
@@ -12,8 +12,8 @@ interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOption
|
|
|
12
12
|
/**
|
|
13
13
|
* OpenAPI Handler for Node Server
|
|
14
14
|
*
|
|
15
|
-
* @see {@link https://orpc.
|
|
16
|
-
* @see {@link https://orpc.
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare class OpenAPIHandler<T extends Context> extends NodeHttpHandler<T> {
|
|
19
19
|
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
@@ -12,8 +12,8 @@ interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOption
|
|
|
12
12
|
/**
|
|
13
13
|
* OpenAPI Handler for Node Server
|
|
14
14
|
*
|
|
15
|
-
* @see {@link https://orpc.
|
|
16
|
-
* @see {@link https://orpc.
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare class OpenAPIHandler<T extends Context> extends NodeHttpHandler<T> {
|
|
19
19
|
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OpenAPI, AnyContractProcedure } from '@orpc/contract';
|
|
2
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.
|
|
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
4
|
import { HTTPPath, HTTPMethod } from '@orpc/client';
|
|
5
5
|
import { JSONSchema } from 'json-schema-typed/draft-2020-12';
|
|
6
6
|
export { JSONSchema, ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from 'json-schema-typed/draft-2020-12';
|
|
@@ -13,7 +13,7 @@ type OverrideOperationValue = Partial<OpenAPI.OperationObject> | ((current: Open
|
|
|
13
13
|
/**
|
|
14
14
|
* Customize The Operation Object by proxy an error map item or a middleware.
|
|
15
15
|
*
|
|
16
|
-
* @see {@link https://orpc.
|
|
16
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#customizing-operation-objects Customizing Operation Objects Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare function customOpenAPIOperation<T extends object>(o: T, extend: OverrideOperationValue): T;
|
|
19
19
|
declare function getCustomOpenAPIOperation(o: object): OverrideOperationValue | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OpenAPI, AnyContractProcedure } from '@orpc/contract';
|
|
2
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.
|
|
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
4
|
import { HTTPPath, HTTPMethod } from '@orpc/client';
|
|
5
5
|
import { JSONSchema } from 'json-schema-typed/draft-2020-12';
|
|
6
6
|
export { JSONSchema, ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from 'json-schema-typed/draft-2020-12';
|
|
@@ -13,7 +13,7 @@ type OverrideOperationValue = Partial<OpenAPI.OperationObject> | ((current: Open
|
|
|
13
13
|
/**
|
|
14
14
|
* Customize The Operation Object by proxy an error map item or a middleware.
|
|
15
15
|
*
|
|
16
|
-
* @see {@link https://orpc.
|
|
16
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#customizing-operation-objects Customizing Operation Objects Docs}
|
|
17
17
|
*/
|
|
18
18
|
declare function customOpenAPIOperation<T extends object>(o: T, extend: OverrideOperationValue): T;
|
|
19
19
|
declare function getCustomOpenAPIOperation(o: object): OverrideOperationValue | undefined;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as customOpenAPIOperation } from './shared/openapi.
|
|
2
|
-
export { C as CompositeSchemaConverter, L as LOGIC_KEYWORDS, O as OpenAPIGenerator, a as applyCustomOpenAPIOperation, o as applySchemaOptionality, h as checkParamsSchema, q as expandArrayableSchema, p as expandUnionSchema, n as filterSchemaBranches, g as getCustomOpenAPIOperation, l as isAnySchema, j as isFileSchema, k as isObjectSchema, u as isPrimitiveSchema, r as resolveOpenAPIJsonSchemaRef, m as separateObjectSchema, s as simplifyComposedObjectJsonSchemasAndRefs, d as toOpenAPIContent, e as toOpenAPIEventIteratorContent, b as toOpenAPIMethod, f as toOpenAPIParameters, t as toOpenAPIPath, i as toOpenAPISchema } from './shared/openapi.
|
|
1
|
+
import { c as customOpenAPIOperation } from './shared/openapi.CoREqFh3.mjs';
|
|
2
|
+
export { C as CompositeSchemaConverter, L as LOGIC_KEYWORDS, O as OpenAPIGenerator, a as applyCustomOpenAPIOperation, o as applySchemaOptionality, h as checkParamsSchema, q as expandArrayableSchema, p as expandUnionSchema, n as filterSchemaBranches, g as getCustomOpenAPIOperation, l as isAnySchema, j as isFileSchema, k as isObjectSchema, u as isPrimitiveSchema, r as resolveOpenAPIJsonSchemaRef, m as separateObjectSchema, s as simplifyComposedObjectJsonSchemasAndRefs, d as toOpenAPIContent, e as toOpenAPIEventIteratorContent, b as toOpenAPIMethod, f as toOpenAPIParameters, t as toOpenAPIPath, i as toOpenAPISchema } from './shared/openapi.CoREqFh3.mjs';
|
|
3
3
|
import { createORPCErrorFromJson } from '@orpc/client';
|
|
4
4
|
import { StandardOpenAPISerializer, StandardOpenAPIJsonSerializer, StandardBracketNotationSerializer } from '@orpc/openapi-client/standard';
|
|
5
5
|
import { ORPCError, createRouterClient } from '@orpc/server';
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { OpenAPI } from '@orpc/contract';
|
|
|
2
2
|
import { Context, HTTPPath, Router } from '@orpc/server';
|
|
3
3
|
import { StandardHandlerInterceptorOptions, StandardHandlerPlugin, StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
4
|
import { Value, Promisable } from '@orpc/shared';
|
|
5
|
-
import { O as OpenAPIGeneratorOptions, a as OpenAPIGeneratorGenerateOptions } from '../shared/openapi.
|
|
5
|
+
import { O as OpenAPIGeneratorOptions, a as OpenAPIGeneratorGenerateOptions } from '../shared/openapi.BGy4N6eR.mjs';
|
|
6
6
|
import '@orpc/openapi-client/standard';
|
|
7
7
|
import 'json-schema-typed/draft-2020-12';
|
|
8
8
|
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { OpenAPI } from '@orpc/contract';
|
|
|
2
2
|
import { Context, HTTPPath, Router } from '@orpc/server';
|
|
3
3
|
import { StandardHandlerInterceptorOptions, StandardHandlerPlugin, StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
4
|
import { Value, Promisable } from '@orpc/shared';
|
|
5
|
-
import { O as OpenAPIGeneratorOptions, a as OpenAPIGeneratorGenerateOptions } from '../shared/openapi.
|
|
5
|
+
import { O as OpenAPIGeneratorOptions, a as OpenAPIGeneratorGenerateOptions } from '../shared/openapi.BGy4N6eR.js';
|
|
6
6
|
import '@orpc/openapi-client/standard';
|
|
7
7
|
import 'json-schema-typed/draft-2020-12';
|
|
8
8
|
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stringifyJSON, once, value } from '@orpc/shared';
|
|
2
|
-
import { O as OpenAPIGenerator } from '../shared/openapi.
|
|
2
|
+
import { O as OpenAPIGenerator } from '../shared/openapi.CoREqFh3.mjs';
|
|
3
3
|
import '@orpc/client';
|
|
4
4
|
import '@orpc/client/standard';
|
|
5
5
|
import '@orpc/contract';
|
|
@@ -101,7 +101,7 @@ interface OpenAPIGeneratorGenerateOptions extends Partial<Omit<OpenAPI.Document,
|
|
|
101
101
|
/**
|
|
102
102
|
* The generator that converts oRPC routers/contracts to OpenAPI specifications.
|
|
103
103
|
*
|
|
104
|
-
* @see {@link https://orpc.
|
|
104
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification OpenAPI Specification Docs}
|
|
105
105
|
*/
|
|
106
106
|
declare class OpenAPIGenerator {
|
|
107
107
|
#private;
|
|
@@ -111,7 +111,7 @@ declare class OpenAPIGenerator {
|
|
|
111
111
|
/**
|
|
112
112
|
* Generates OpenAPI specifications from oRPC routers/contracts.
|
|
113
113
|
*
|
|
114
|
-
* @see {@link https://orpc.
|
|
114
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification OpenAPI Specification Docs}
|
|
115
115
|
*/
|
|
116
116
|
generate(router: AnyContractRouter | AnyRouter, { customErrorResponseBodySchema, commonSchemas, filter: baseFilter, exclude, ...baseDoc }?: OpenAPIGeneratorGenerateOptions): Promise<OpenAPI.Document>;
|
|
117
117
|
}
|
|
@@ -101,7 +101,7 @@ interface OpenAPIGeneratorGenerateOptions extends Partial<Omit<OpenAPI.Document,
|
|
|
101
101
|
/**
|
|
102
102
|
* The generator that converts oRPC routers/contracts to OpenAPI specifications.
|
|
103
103
|
*
|
|
104
|
-
* @see {@link https://orpc.
|
|
104
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification OpenAPI Specification Docs}
|
|
105
105
|
*/
|
|
106
106
|
declare class OpenAPIGenerator {
|
|
107
107
|
#private;
|
|
@@ -111,7 +111,7 @@ declare class OpenAPIGenerator {
|
|
|
111
111
|
/**
|
|
112
112
|
* Generates OpenAPI specifications from oRPC routers/contracts.
|
|
113
113
|
*
|
|
114
|
-
* @see {@link https://orpc.
|
|
114
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification OpenAPI Specification Docs}
|
|
115
115
|
*/
|
|
116
116
|
generate(router: AnyContractRouter | AnyRouter, { customErrorResponseBodySchema, commonSchemas, filter: baseFilter, exclude, ...baseDoc }?: OpenAPIGeneratorGenerateOptions): Promise<OpenAPI.Document>;
|
|
117
117
|
}
|
|
@@ -488,7 +488,7 @@ class OpenAPIGenerator {
|
|
|
488
488
|
/**
|
|
489
489
|
* Generates OpenAPI specifications from oRPC routers/contracts.
|
|
490
490
|
*
|
|
491
|
-
* @see {@link https://orpc.
|
|
491
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification OpenAPI Specification Docs}
|
|
492
492
|
*/
|
|
493
493
|
async generate(router, { customErrorResponseBodySchema, commonSchemas, filter: baseFilter, exclude, ...baseDoc } = {}) {
|
|
494
494
|
const filter = baseFilter ?? (({ contract, path }) => {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/openapi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.1",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "https://orpc.
|
|
6
|
+
"homepage": "https://orpc.dev",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/unnoq/orpc.git",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"json-schema-typed": "^8.0.2",
|
|
58
58
|
"rou3": "^0.7.10",
|
|
59
|
-
"@orpc/client": "1.12.
|
|
60
|
-
"@orpc/contract": "1.12.
|
|
61
|
-
"@orpc/
|
|
62
|
-
"@orpc/
|
|
63
|
-
"@orpc/shared": "1.12.
|
|
64
|
-
"@orpc/
|
|
65
|
-
"@orpc/server": "1.12.
|
|
59
|
+
"@orpc/client": "1.12.1",
|
|
60
|
+
"@orpc/contract": "1.12.1",
|
|
61
|
+
"@orpc/server": "1.12.1",
|
|
62
|
+
"@orpc/interop": "1.12.1",
|
|
63
|
+
"@orpc/shared": "1.12.1",
|
|
64
|
+
"@orpc/openapi-client": "1.12.1",
|
|
65
|
+
"@orpc/standard-server": "1.12.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"fastify": "^5.6.2",
|