@orpc/openapi 2.0.0-beta.24 → 2.0.0-beta.26

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,10 +1,10 @@
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.W_GSmPls.mjs';
4
+ import { O as OpenAPIMeta } from '../shared/openapi.DJ1JNe6q.mjs';
5
5
  import '@orpc/shared';
6
6
  import '@standardserver/core';
7
- import '../shared/openapi.zfTTuQ4S.mjs';
7
+ import '../shared/openapi.CmXAr7vo.mjs';
8
8
  import '@hey-api/spec-types';
9
9
 
10
10
  declare module '@orpc/contract' {
@@ -1,10 +1,10 @@
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.DPcT6OhO.js';
4
+ import { O as OpenAPIMeta } from '../shared/openapi.BDP90WDt.js';
5
5
  import '@orpc/shared';
6
6
  import '@standardserver/core';
7
- import '../shared/openapi.zfTTuQ4S.js';
7
+ import '../shared/openapi.CmXAr7vo.js';
8
8
  import '@hey-api/spec-types';
9
9
 
10
10
  declare module '@orpc/contract' {
package/dist/index.d.mts CHANGED
@@ -3,9 +3,9 @@ export { B as BracketNotationSerializeResult, a as BracketNotationSerializer, b
3
3
  import { ClientContext, ORPCClientOptions, ClientLink } from '@orpc/client';
4
4
  export { COMMON_ERROR_STATUS_MAP } from '@orpc/client';
5
5
  import { RouterContract, RouterContractClient, AnyProcedureContract, ProcedureContract } from '@orpc/contract';
6
- import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.zfTTuQ4S.mjs';
7
- export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.zfTTuQ4S.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.W_GSmPls.mjs';
6
+ import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.CmXAr7vo.mjs';
7
+ export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.CmXAr7vo.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.DJ1JNe6q.mjs';
9
9
  import { JsonSchema, JsonSchemaConverter } from '@orpc/json-schema';
10
10
  import { AnyRouter, AnyProcedure } from '@orpc/server';
11
11
  import { Value } from '@orpc/shared';
package/dist/index.d.ts CHANGED
@@ -3,9 +3,9 @@ export { B as BracketNotationSerializeResult, a as BracketNotationSerializer, b
3
3
  import { ClientContext, ORPCClientOptions, ClientLink } from '@orpc/client';
4
4
  export { COMMON_ERROR_STATUS_MAP } from '@orpc/client';
5
5
  import { RouterContract, RouterContractClient, AnyProcedureContract, ProcedureContract } from '@orpc/contract';
6
- import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.zfTTuQ4S.js';
7
- export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.zfTTuQ4S.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.DPcT6OhO.js';
6
+ import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.CmXAr7vo.js';
7
+ export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.CmXAr7vo.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.BDP90WDt.js';
9
9
  import { JsonSchema, JsonSchemaConverter } from '@orpc/json-schema';
10
10
  import { AnyRouter, AnyProcedure } from '@orpc/server';
11
11
  import { Value } from '@orpc/shared';
@@ -4,7 +4,7 @@ import { Value, Promisable } from '@orpc/shared';
4
4
  import { ApiReferenceConfiguration } from '@scalar/api-reference';
5
5
  import { StandardUrl } from '@standardserver/core';
6
6
  import { SwaggerUIOptions } from 'swagger-ui';
7
- import { O as OpenAPIDocument } from '../shared/openapi.zfTTuQ4S.mjs';
7
+ import { O as OpenAPIDocument } from '../shared/openapi.CmXAr7vo.mjs';
8
8
  import '@hey-api/spec-types';
9
9
  import '@orpc/client';
10
10
 
@@ -4,7 +4,7 @@ import { Value, Promisable } from '@orpc/shared';
4
4
  import { ApiReferenceConfiguration } from '@scalar/api-reference';
5
5
  import { StandardUrl } from '@standardserver/core';
6
6
  import { SwaggerUIOptions } from 'swagger-ui';
7
- import { O as OpenAPIDocument } from '../shared/openapi.zfTTuQ4S.js';
7
+ import { O as OpenAPIDocument } from '../shared/openapi.CmXAr7vo.js';
8
8
  import '@hey-api/spec-types';
9
9
  import '@orpc/client';
10
10
 
@@ -2,7 +2,7 @@ import { AnySchema, ErrorMap, MetaPlugin, AnyProcedureContract } from '@orpc/con
2
2
  import { Lazy } from '@orpc/server';
3
3
  import { Value } from '@orpc/shared';
4
4
  import { StandardBodyHint } from '@standardserver/core';
5
- import { d as OpenAPIOperationObject } from './openapi.zfTTuQ4S.js';
5
+ import { d as OpenAPIOperationObject } from './openapi.CmXAr7vo.js';
6
6
 
7
7
  interface OpenAPIMeta {
8
8
  /**
@@ -314,6 +314,11 @@ interface OpenAPIFunction {
314
314
  * @see {@link https://orpc.dev/docs/openapi/specification | OpenAPI Specification}
315
315
  */
316
316
  declare const openapi: OpenAPIFunction;
317
+ /**
318
+ * Retrieves the OpenAPI metadata attached to a procedure or router, or `undefined` if not set.
319
+ *
320
+ * @see {@link https://orpc.dev/docs/rpc/handler#enabling-the-get-method | RPC Handler - Enabling the GET Method}
321
+ */
317
322
  declare function getOpenAPIMeta(procedureOrLazy: AnyProcedureContract | Lazy<any>): OpenAPIMeta | undefined;
318
323
 
319
324
  export { getOpenAPIMeta as g, openapi as o };
@@ -1,11 +1,12 @@
1
1
  import { OpenAPIV3_1 } from '@hey-api/spec-types';
2
2
  import { AnyNestedClient, Client, ORPCError } from '@orpc/client';
3
+ import { AsyncIteratorClass } from '@orpc/shared';
3
4
 
4
5
  type OpenAPIDocument = OpenAPIV3_1.Document;
5
6
  type OpenAPIOperationObject = OpenAPIV3_1.OperationObject;
6
7
  type JsonifiedValue<T> = T extends string ? T : T extends number ? T : T extends boolean ? T : T extends null ? T : T extends undefined ? T : T extends Array<unknown> ? JsonifiedArray<T> : T extends Record<string, unknown> ? {
7
8
  [K in keyof T]: JsonifiedValue<T[K]>;
8
- } : T extends Date ? string : T extends bigint ? string : T extends File ? File : T extends Blob ? Blob : T extends RegExp ? string : T extends URL ? string : T extends Map<infer K, infer V> ? JsonifiedArray<[K, V][]> : T extends Set<infer U> ? JsonifiedArray<U[]> : T extends AsyncIteratorObject<infer U, infer V> ? AsyncIteratorObject<JsonifiedValue<U>, JsonifiedValue<V>> : unknown;
9
+ } : T extends Date ? string : T extends bigint ? string : T extends File ? File : T extends Blob ? Blob : T extends RegExp ? string : T extends URL ? string : T extends Map<infer K, infer V> ? JsonifiedArray<[K, V][]> : T extends Set<infer U> ? JsonifiedArray<U[]> : T extends AsyncIteratorClass<infer U, infer V> ? AsyncIteratorClass<JsonifiedValue<U>, JsonifiedValue<V>> : T extends AsyncGenerator<infer U, infer V> ? AsyncGenerator<JsonifiedValue<U>, JsonifiedValue<V>> : T extends AsyncIteratorObject<infer U, infer V> ? AsyncIteratorObject<JsonifiedValue<U>, JsonifiedValue<V>> : unknown;
9
10
  type JsonifiedArray<T extends Array<unknown>> = T extends readonly [] ? [] : T extends readonly [infer U, ...infer V] ? [U extends undefined ? null : JsonifiedValue<U>, ...JsonifiedArray<V>] : T extends Array<infer U> ? Array<JsonifiedValue<U>> : unknown;
10
11
  type JsonifiedClientError<T> = T extends ORPCError<infer UCode, infer UData> ? ORPCError<UCode, JsonifiedValue<UData>> : T;
11
12
  /**
@@ -1,11 +1,12 @@
1
1
  import { OpenAPIV3_1 } from '@hey-api/spec-types';
2
2
  import { AnyNestedClient, Client, ORPCError } from '@orpc/client';
3
+ import { AsyncIteratorClass } from '@orpc/shared';
3
4
 
4
5
  type OpenAPIDocument = OpenAPIV3_1.Document;
5
6
  type OpenAPIOperationObject = OpenAPIV3_1.OperationObject;
6
7
  type JsonifiedValue<T> = T extends string ? T : T extends number ? T : T extends boolean ? T : T extends null ? T : T extends undefined ? T : T extends Array<unknown> ? JsonifiedArray<T> : T extends Record<string, unknown> ? {
7
8
  [K in keyof T]: JsonifiedValue<T[K]>;
8
- } : T extends Date ? string : T extends bigint ? string : T extends File ? File : T extends Blob ? Blob : T extends RegExp ? string : T extends URL ? string : T extends Map<infer K, infer V> ? JsonifiedArray<[K, V][]> : T extends Set<infer U> ? JsonifiedArray<U[]> : T extends AsyncIteratorObject<infer U, infer V> ? AsyncIteratorObject<JsonifiedValue<U>, JsonifiedValue<V>> : unknown;
9
+ } : T extends Date ? string : T extends bigint ? string : T extends File ? File : T extends Blob ? Blob : T extends RegExp ? string : T extends URL ? string : T extends Map<infer K, infer V> ? JsonifiedArray<[K, V][]> : T extends Set<infer U> ? JsonifiedArray<U[]> : T extends AsyncIteratorClass<infer U, infer V> ? AsyncIteratorClass<JsonifiedValue<U>, JsonifiedValue<V>> : T extends AsyncGenerator<infer U, infer V> ? AsyncGenerator<JsonifiedValue<U>, JsonifiedValue<V>> : T extends AsyncIteratorObject<infer U, infer V> ? AsyncIteratorObject<JsonifiedValue<U>, JsonifiedValue<V>> : unknown;
9
10
  type JsonifiedArray<T extends Array<unknown>> = T extends readonly [] ? [] : T extends readonly [infer U, ...infer V] ? [U extends undefined ? null : JsonifiedValue<U>, ...JsonifiedArray<V>] : T extends Array<infer U> ? Array<JsonifiedValue<U>> : unknown;
10
11
  type JsonifiedClientError<T> = T extends ORPCError<infer UCode, infer UData> ? ORPCError<UCode, JsonifiedValue<UData>> : T;
11
12
  /**
@@ -2,7 +2,7 @@ import { AnySchema, ErrorMap, MetaPlugin, AnyProcedureContract } from '@orpc/con
2
2
  import { Lazy } from '@orpc/server';
3
3
  import { Value } from '@orpc/shared';
4
4
  import { StandardBodyHint } from '@standardserver/core';
5
- import { d as OpenAPIOperationObject } from './openapi.zfTTuQ4S.mjs';
5
+ import { d as OpenAPIOperationObject } from './openapi.CmXAr7vo.mjs';
6
6
 
7
7
  interface OpenAPIMeta {
8
8
  /**
@@ -314,6 +314,11 @@ interface OpenAPIFunction {
314
314
  * @see {@link https://orpc.dev/docs/openapi/specification | OpenAPI Specification}
315
315
  */
316
316
  declare const openapi: OpenAPIFunction;
317
+ /**
318
+ * Retrieves the OpenAPI metadata attached to a procedure or router, or `undefined` if not set.
319
+ *
320
+ * @see {@link https://orpc.dev/docs/rpc/handler#enabling-the-get-method | RPC Handler - Enabling the GET Method}
321
+ */
317
322
  declare function getOpenAPIMeta(procedureOrLazy: AnyProcedureContract | Lazy<any>): OpenAPIMeta | undefined;
318
323
 
319
324
  export { getOpenAPIMeta as g, openapi as o };
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@orpc/openapi",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.24",
4
+ "version": "2.0.0-beta.26",
5
5
  "license": "MIT",
6
+ "funding": "https://github.com/sponsors/dinwwwh",
6
7
  "homepage": "https://orpc.dev",
7
8
  "repository": {
8
9
  "type": "git",
@@ -88,14 +89,14 @@
88
89
  "@standardserver/core": "^0.7.1",
89
90
  "@standardserver/fetch": "^0.7.1",
90
91
  "rou3": "^0.9.1",
91
- "@orpc/client": "2.0.0-beta.24",
92
- "@orpc/contract": "2.0.0-beta.24",
93
- "@orpc/json-schema": "2.0.0-beta.24",
94
- "@orpc/server": "2.0.0-beta.24",
95
- "@orpc/shared": "2.0.0-beta.24"
92
+ "@orpc/contract": "2.0.0-beta.26",
93
+ "@orpc/json-schema": "2.0.0-beta.26",
94
+ "@orpc/server": "2.0.0-beta.26",
95
+ "@orpc/shared": "2.0.0-beta.26",
96
+ "@orpc/client": "2.0.0-beta.26"
96
97
  },
97
98
  "devDependencies": {
98
- "@scalar/api-reference": "^1.63.0",
99
+ "@scalar/api-reference": "^1.64.0",
99
100
  "@standardserver/aws-lambda": "^0.7.1",
100
101
  "@types/swagger-ui": "^5.32.0",
101
102
  "fastify": "^5.11.0",