@orpc/openapi 0.0.0-next.ef3ba82 → 0.0.0-next.f01f7b1
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 +104 -0
- 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 +23 -0
- package/dist/adapters/fetch/index.d.ts +23 -0
- package/dist/adapters/fetch/index.mjs +18 -0
- package/dist/adapters/node/index.d.mts +23 -0
- package/dist/adapters/node/index.d.ts +23 -0
- package/dist/adapters/node/index.mjs +18 -0
- package/dist/adapters/standard/index.d.mts +20 -0
- package/dist/adapters/standard/index.d.ts +20 -0
- package/dist/adapters/standard/index.mjs +9 -0
- package/dist/index.d.mts +116 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.mjs +41 -0
- package/dist/plugins/index.d.mts +84 -0
- package/dist/plugins/index.d.ts +84 -0
- package/dist/plugins/index.mjs +148 -0
- package/dist/shared/openapi.BGy4N6eR.d.mts +120 -0
- package/dist/shared/openapi.BGy4N6eR.d.ts +120 -0
- package/dist/shared/openapi.CoREqFh3.mjs +853 -0
- package/dist/shared/openapi.DIt-Z9W1.mjs +190 -0
- package/dist/shared/openapi.DwaweYRb.d.mts +54 -0
- package/dist/shared/openapi.DwaweYRb.d.ts +54 -0
- package/package.json +44 -23
- package/dist/fetch.js +0 -668
- package/dist/index.js +0 -4421
- package/dist/src/fetch/base-handler.d.ts +0 -14
- package/dist/src/fetch/index.d.ts +0 -3
- package/dist/src/fetch/server-handler.d.ts +0 -2
- package/dist/src/fetch/serverless-handler.d.ts +0 -2
- package/dist/src/generator.d.ts +0 -23
- package/dist/src/index.d.ts +0 -2
- package/dist/src/zod-to-json-schema.d.ts +0 -42
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { HTTPPath } from '@orpc/contract';
|
|
2
|
-
import type { FetchHandler } from '@orpc/server/fetch';
|
|
3
|
-
import type { Router as HonoRouter } from 'hono/router';
|
|
4
|
-
import { type Procedure, type Router } from '@orpc/server';
|
|
5
|
-
export type ResolveRouter = (router: Router<any>, method: string, pathname: string) => {
|
|
6
|
-
path: string[];
|
|
7
|
-
procedure: Procedure<any, any, any, any, any>;
|
|
8
|
-
params: Record<string, string>;
|
|
9
|
-
} | undefined;
|
|
10
|
-
type Routing = HonoRouter<[string[], Procedure<any, any, any, any, any>]>;
|
|
11
|
-
export declare function createOpenAPIHandler(createHonoRouter: () => Routing): FetchHandler;
|
|
12
|
-
export declare function createResolveRouter(createHonoRouter: () => Routing): ResolveRouter;
|
|
13
|
-
export declare function openAPIPathToRouterPath(path: HTTPPath): string;
|
|
14
|
-
export {};
|
package/dist/src/generator.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type ContractRouter } from '@orpc/contract';
|
|
2
|
-
import { type Router } from '@orpc/server';
|
|
3
|
-
import { type OpenAPIObject } from 'openapi3-ts/oas31';
|
|
4
|
-
export interface GenerateOpenAPIOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Throw error when you missing define tag definition on OpenAPI root tags
|
|
7
|
-
*
|
|
8
|
-
* Example: if procedure has tags ['foo', 'bar'], and OpenAPI root tags is ['foo'], then error will be thrown
|
|
9
|
-
* Because OpenAPI root tags is missing 'bar' tag
|
|
10
|
-
*
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
throwOnMissingTagDefinition?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Weather ignore procedures that has no path defined.
|
|
16
|
-
*
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
ignoreUndefinedPathProcedures?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare function generateOpenAPI(opts: {
|
|
22
|
-
router: ContractRouter | Router<any>;
|
|
23
|
-
} & Omit<OpenAPIObject, 'openapi'>, options?: GenerateOpenAPIOptions): OpenAPIObject;
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { type JSONSchema } from 'json-schema-typed/draft-2020-12';
|
|
2
|
-
import { type ZodTypeAny } from 'zod';
|
|
3
|
-
export declare const NON_LOGIC_KEYWORDS: ("$anchor" | "$comment" | "$defs" | "$dynamicAnchor" | "$dynamicRef" | "$id" | "$schema" | "$vocabulary" | "contentEncoding" | "contentMediaType" | "default" | "definitions" | "deprecated" | "description" | "examples" | "format" | "readOnly" | "title" | "writeOnly")[];
|
|
4
|
-
export declare const UNSUPPORTED_JSON_SCHEMA: {
|
|
5
|
-
not: {};
|
|
6
|
-
};
|
|
7
|
-
export declare const UNDEFINED_JSON_SCHEMA: {
|
|
8
|
-
const: string;
|
|
9
|
-
};
|
|
10
|
-
export interface ZodToJsonSchemaOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Max depth of lazy type, if it exceeds.
|
|
13
|
-
*
|
|
14
|
-
* Used `{}` when reach max depth
|
|
15
|
-
*
|
|
16
|
-
* @default 5
|
|
17
|
-
*/
|
|
18
|
-
maxLazyDepth?: number;
|
|
19
|
-
/**
|
|
20
|
-
* The length used to track the depth of lazy type
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
lazyDepth?: number;
|
|
25
|
-
/**
|
|
26
|
-
* The expected json schema for input or output zod schema
|
|
27
|
-
*
|
|
28
|
-
* @default input
|
|
29
|
-
*/
|
|
30
|
-
mode?: 'input' | 'output';
|
|
31
|
-
/**
|
|
32
|
-
* Track if current level schema is handled custom json schema to prevent recursive
|
|
33
|
-
*
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
isHandledCustomJSONSchema?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare function zodToJsonSchema(schema: ZodTypeAny, options?: ZodToJsonSchemaOptions): Exclude<JSONSchema, boolean>;
|
|
39
|
-
export declare function extractJSONSchema(schema: JSONSchema, check: (schema: JSONSchema) => boolean, matches?: JSONSchema[]): {
|
|
40
|
-
schema: JSONSchema | undefined;
|
|
41
|
-
matches: JSONSchema[];
|
|
42
|
-
};
|