@orpc/openapi 0.0.0-next.ef3ba82 → 0.0.0-next.f99e554

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.
Files changed (41) hide show
  1. package/dist/chunk-KNYXLM77.js +107 -0
  2. package/dist/chunk-YXHH6XHB.js +642 -0
  3. package/dist/fetch.js +39 -661
  4. package/dist/index.js +398 -4329
  5. package/dist/node.js +46 -0
  6. package/dist/src/adapters/fetch/bracket-notation.d.ts +84 -0
  7. package/dist/src/adapters/fetch/index.d.ts +10 -0
  8. package/dist/src/adapters/fetch/input-structure-compact.d.ts +6 -0
  9. package/dist/src/adapters/fetch/input-structure-detailed.d.ts +11 -0
  10. package/dist/src/adapters/fetch/openapi-handler-server.d.ts +7 -0
  11. package/dist/src/adapters/fetch/openapi-handler-serverless.d.ts +7 -0
  12. package/dist/src/adapters/fetch/openapi-handler.d.ts +33 -0
  13. package/dist/src/adapters/fetch/openapi-payload-codec.d.ts +15 -0
  14. package/dist/src/adapters/fetch/openapi-procedure-matcher.d.ts +19 -0
  15. package/dist/src/adapters/fetch/schema-coercer.d.ts +10 -0
  16. package/dist/src/adapters/node/index.d.ts +5 -0
  17. package/dist/src/adapters/node/openapi-handler-server.d.ts +7 -0
  18. package/dist/src/adapters/node/openapi-handler-serverless.d.ts +7 -0
  19. package/dist/src/adapters/node/openapi-handler.d.ts +12 -0
  20. package/dist/src/adapters/node/types.d.ts +2 -0
  21. package/dist/src/index.d.ts +11 -1
  22. package/dist/src/json-serializer.d.ts +5 -0
  23. package/dist/src/openapi-content-builder.d.ts +10 -0
  24. package/dist/src/openapi-error.d.ts +3 -0
  25. package/dist/src/openapi-generator.d.ts +60 -0
  26. package/dist/src/openapi-input-structure-parser.d.ts +22 -0
  27. package/dist/src/openapi-output-structure-parser.d.ts +18 -0
  28. package/dist/src/openapi-parameters-builder.d.ts +12 -0
  29. package/dist/src/openapi-path-parser.d.ts +8 -0
  30. package/dist/src/openapi.d.ts +3 -0
  31. package/dist/src/schema-converter.d.ts +16 -0
  32. package/dist/src/schema-utils.d.ts +11 -0
  33. package/dist/src/schema.d.ts +12 -0
  34. package/dist/src/utils.d.ts +18 -0
  35. package/package.json +21 -11
  36. package/dist/src/fetch/base-handler.d.ts +0 -14
  37. package/dist/src/fetch/index.d.ts +0 -3
  38. package/dist/src/fetch/server-handler.d.ts +0 -2
  39. package/dist/src/fetch/serverless-handler.d.ts +0 -2
  40. package/dist/src/generator.d.ts +0 -23
  41. package/dist/src/zod-to-json-schema.d.ts +0 -42
@@ -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;
@@ -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
- };