@orpc/openapi 0.0.0-next.e9dc36e → 0.0.0-next.ee0aeaf

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.
@@ -0,0 +1,13 @@
1
+ import type { ANY_LAZY_PROCEDURE, ANY_PROCEDURE, Router } from '@orpc/server';
2
+ import type { FetchHandler } from '@orpc/server/fetch';
3
+ import type { Router as HonoRouter } from 'hono/router';
4
+ export type ResolveRouter = (router: Router<any>, method: string, pathname: string) => Promise<{
5
+ path: string[];
6
+ procedure: ANY_PROCEDURE | ANY_LAZY_PROCEDURE;
7
+ params: Record<string, string>;
8
+ } | undefined>;
9
+ type Routing = HonoRouter<string[]>;
10
+ export declare function createOpenAPIHandler(createHonoRouter: () => Routing): FetchHandler;
11
+ export declare function createResolveRouter(createHonoRouter: () => Routing): ResolveRouter;
12
+ export {};
13
+ //# sourceMappingURL=base-handler.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from './base-handler';
2
+ export * from './server-handler';
3
+ export * from './serverless-handler';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { FetchHandler } from '@orpc/server/fetch';
2
+ export declare function createOpenAPIServerHandler(): FetchHandler;
3
+ //# sourceMappingURL=server-handler.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { FetchHandler } from '@orpc/server/fetch';
2
+ export declare function createOpenAPIServerlessHandler(): FetchHandler;
3
+ //# sourceMappingURL=serverless-handler.d.ts.map
@@ -20,5 +20,5 @@ export interface GenerateOpenAPIOptions {
20
20
  }
21
21
  export declare function generateOpenAPI(opts: {
22
22
  router: ContractRouter | Router<any>;
23
- } & Omit<OpenAPIObject, 'openapi'>, options?: GenerateOpenAPIOptions): OpenAPIObject;
23
+ } & Omit<OpenAPIObject, 'openapi'>, options?: GenerateOpenAPIOptions): Promise<OpenAPIObject>;
24
24
  //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { ANY_CONTRACT_PROCEDURE, ContractRouter, HTTPPath, WELL_CONTRACT_PROCEDURE } from '@orpc/contract';
2
+ import type { ANY_LAZY_PROCEDURE, ANY_PROCEDURE, Lazy, Router } from '@orpc/server';
3
+ export interface EachLeafOptions {
4
+ router: ANY_PROCEDURE | Router<any> | ContractRouter | ANY_CONTRACT_PROCEDURE;
5
+ path: string[];
6
+ }
7
+ export interface EachLeafCallbackOptions {
8
+ contract: WELL_CONTRACT_PROCEDURE;
9
+ path: string[];
10
+ }
11
+ export interface EachContractLeafResultItem {
12
+ lazy: ANY_LAZY_PROCEDURE | Lazy<Router<any>>;
13
+ path: string[];
14
+ }
15
+ export declare function eachContractProcedureLeaf(options: EachLeafOptions, callback: (options: EachLeafCallbackOptions) => void, result?: EachContractLeafResultItem[], isCurrentRouterContract?: boolean): EachContractLeafResultItem[];
16
+ export declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
17
+ //# sourceMappingURL=utils.d.ts.map
@@ -1,5 +1,5 @@
1
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
1
2
  import { type JSONSchema } from 'json-schema-typed/draft-2020-12';
2
- import { type ZodTypeAny } from 'zod';
3
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
4
  export declare const UNSUPPORTED_JSON_SCHEMA: {
5
5
  not: {};
@@ -35,7 +35,7 @@ export interface ZodToJsonSchemaOptions {
35
35
  */
36
36
  isHandledCustomJSONSchema?: boolean;
37
37
  }
38
- export declare function zodToJsonSchema(schema: ZodTypeAny, options?: ZodToJsonSchemaOptions): Exclude<JSONSchema, boolean>;
38
+ export declare function zodToJsonSchema(schema: StandardSchemaV1, options?: ZodToJsonSchemaOptions): Exclude<JSONSchema, boolean>;
39
39
  export declare function extractJSONSchema(schema: JSONSchema, check: (schema: JSONSchema) => boolean, matches?: JSONSchema[]): {
40
40
  schema: JSONSchema | undefined;
41
41
  matches: JSONSchema[];
package/package.json CHANGED
@@ -1,21 +1,17 @@
1
1
  {
2
2
  "name": "@orpc/openapi",
3
3
  "type": "module",
4
- "version": "0.0.0-next.e9dc36e",
5
- "author": {
6
- "name": "unnoq",
7
- "email": "contact@unnoq.com",
8
- "url": "https://unnoq.com"
9
- },
4
+ "version": "0.0.0-next.ee0aeaf",
10
5
  "license": "MIT",
11
- "homepage": "https://github.com/unnoq/orpc",
6
+ "homepage": "https://orpc.unnoq.com",
12
7
  "repository": {
13
8
  "type": "git",
14
- "url": "https://github.com/unnoq/orpc.git",
9
+ "url": "git+https://github.com/unnoq/orpc.git",
15
10
  "directory": "packages/openapi"
16
11
  },
17
12
  "keywords": [
18
- "unnoq"
13
+ "unnoq",
14
+ "orpc"
19
15
  ],
20
16
  "exports": {
21
17
  ".": {
@@ -23,30 +19,38 @@
23
19
  "import": "./dist/index.js",
24
20
  "default": "./dist/index.js"
25
21
  },
22
+ "./fetch": {
23
+ "types": "./dist/src/fetch/index.d.ts",
24
+ "import": "./dist/fetch.js",
25
+ "default": "./dist/fetch.js"
26
+ },
26
27
  "./🔒/*": {
27
28
  "types": "./dist/src/*.d.ts"
28
29
  }
29
30
  },
30
31
  "files": [
31
- "dist",
32
- "src"
32
+ "!**/*.map",
33
+ "!**/*.tsbuildinfo",
34
+ "dist"
33
35
  ],
34
36
  "dependencies": {
37
+ "@standard-schema/spec": "1.0.0-beta.4",
35
38
  "escape-string-regexp": "^5.0.0",
36
39
  "json-schema-typed": "^8.0.1",
37
40
  "openapi3-ts": "^4.4.0",
38
- "@orpc/server": "0.0.0-next.e9dc36e",
39
- "@orpc/contract": "0.0.0-next.e9dc36e",
40
- "@orpc/transformer": "0.0.0-next.e9dc36e",
41
- "@orpc/zod": "0.0.0-next.e9dc36e",
42
- "@orpc/shared": "0.0.0-next.e9dc36e"
41
+ "@orpc/contract": "0.0.0-next.ee0aeaf",
42
+ "@orpc/server": "0.0.0-next.ee0aeaf",
43
+ "@orpc/transformer": "0.0.0-next.ee0aeaf",
44
+ "@orpc/zod": "0.0.0-next.ee0aeaf",
45
+ "@orpc/shared": "0.0.0-next.ee0aeaf"
43
46
  },
44
47
  "devDependencies": {
45
48
  "@readme/openapi-parser": "^2.6.0",
46
- "zod": "^3.23.8"
49
+ "hono": "^4.6.12",
50
+ "zod": "^3.24.1"
47
51
  },
48
52
  "scripts": {
49
- "build": "tsup --clean --sourcemap --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
53
+ "build": "tsup --clean --sourcemap --entry.index=src/index.ts --entry.fetch=src/fetch/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
50
54
  "build:watch": "pnpm run build --watch",
51
55
  "type:check": "tsc -b"
52
56
  }