@orpc/openapi 0.0.0-next.f56d2b3 → 0.0.0-next.f81b4a2

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 (56) hide show
  1. package/README.md +104 -0
  2. package/dist/adapters/fetch/index.d.mts +17 -0
  3. package/dist/adapters/fetch/index.d.ts +17 -0
  4. package/dist/adapters/fetch/index.mjs +17 -0
  5. package/dist/adapters/node/index.d.mts +17 -0
  6. package/dist/adapters/node/index.d.ts +17 -0
  7. package/dist/adapters/node/index.mjs +17 -0
  8. package/dist/adapters/standard/index.d.mts +34 -0
  9. package/dist/adapters/standard/index.d.ts +34 -0
  10. package/dist/adapters/standard/index.mjs +8 -0
  11. package/dist/index.d.mts +131 -0
  12. package/dist/index.d.ts +131 -0
  13. package/dist/index.mjs +545 -0
  14. package/dist/shared/openapi.D3j94c9n.d.mts +12 -0
  15. package/dist/shared/openapi.D3j94c9n.d.ts +12 -0
  16. package/dist/shared/openapi.p5tsmBXx.mjs +158 -0
  17. package/package.json +25 -39
  18. package/dist/chunk-Q2LSK6YZ.js +0 -102
  19. package/dist/chunk-SOVQ5ARD.js +0 -650
  20. package/dist/chunk-VFGNQS5W.js +0 -25
  21. package/dist/fetch.js +0 -34
  22. package/dist/hono.js +0 -34
  23. package/dist/index.js +0 -546
  24. package/dist/next.js +0 -34
  25. package/dist/node.js +0 -46
  26. package/dist/src/adapters/fetch/bracket-notation.d.ts +0 -84
  27. package/dist/src/adapters/fetch/index.d.ts +0 -10
  28. package/dist/src/adapters/fetch/input-structure-compact.d.ts +0 -6
  29. package/dist/src/adapters/fetch/input-structure-detailed.d.ts +0 -11
  30. package/dist/src/adapters/fetch/openapi-handler-server.d.ts +0 -7
  31. package/dist/src/adapters/fetch/openapi-handler-serverless.d.ts +0 -7
  32. package/dist/src/adapters/fetch/openapi-handler.d.ts +0 -32
  33. package/dist/src/adapters/fetch/openapi-payload-codec.d.ts +0 -15
  34. package/dist/src/adapters/fetch/openapi-procedure-matcher.d.ts +0 -19
  35. package/dist/src/adapters/fetch/schema-coercer.d.ts +0 -10
  36. package/dist/src/adapters/hono/index.d.ts +0 -2
  37. package/dist/src/adapters/next/index.d.ts +0 -2
  38. package/dist/src/adapters/node/index.d.ts +0 -5
  39. package/dist/src/adapters/node/openapi-handler-server.d.ts +0 -7
  40. package/dist/src/adapters/node/openapi-handler-serverless.d.ts +0 -7
  41. package/dist/src/adapters/node/openapi-handler.d.ts +0 -11
  42. package/dist/src/adapters/node/types.d.ts +0 -2
  43. package/dist/src/index.d.ts +0 -12
  44. package/dist/src/json-serializer.d.ts +0 -5
  45. package/dist/src/openapi-content-builder.d.ts +0 -10
  46. package/dist/src/openapi-error.d.ts +0 -3
  47. package/dist/src/openapi-generator.d.ts +0 -67
  48. package/dist/src/openapi-input-structure-parser.d.ts +0 -22
  49. package/dist/src/openapi-output-structure-parser.d.ts +0 -18
  50. package/dist/src/openapi-parameters-builder.d.ts +0 -12
  51. package/dist/src/openapi-path-parser.d.ts +0 -8
  52. package/dist/src/openapi.d.ts +0 -3
  53. package/dist/src/schema-converter.d.ts +0 -16
  54. package/dist/src/schema-utils.d.ts +0 -11
  55. package/dist/src/schema.d.ts +0 -12
  56. package/dist/src/utils.d.ts +0 -18
@@ -1,84 +0,0 @@
1
- /**
2
- * Serialize an object or array into a list of [key, value] pairs.
3
- * The key will express by using bracket-notation.
4
- *
5
- * Notice: This way cannot express the empty object or array.
6
- *
7
- * @example
8
- * ```ts
9
- * const payload = {
10
- * name: 'John Doe',
11
- * pets: ['dog', 'cat'],
12
- * }
13
- *
14
- * const entities = serialize(payload)
15
- *
16
- * expect(entities).toEqual([
17
- * ['name', 'John Doe'],
18
- * ['name[pets][0]', 'dog'],
19
- * ['name[pets][1]', 'cat'],
20
- * ])
21
- * ```
22
- */
23
- export declare function serialize(payload: unknown, parentKey?: string): [string, unknown][];
24
- /**
25
- * Deserialize a list of [key, value] pairs into an object or array.
26
- * The key is expressed by using bracket-notation.
27
- *
28
- * @example
29
- * ```ts
30
- * const entities = [
31
- * ['name', 'John Doe'],
32
- * ['name[pets][0]', 'dog'],
33
- * ['name[pets][1]', 'cat'],
34
- * ['name[dogs][]', 'hello'],
35
- * ['name[dogs][]', 'kitty'],
36
- * ]
37
- *
38
- * const payload = deserialize(entities)
39
- *
40
- * expect(payload).toEqual({
41
- * name: 'John Doe',
42
- * pets: { 0: 'dog', 1: 'cat' },
43
- * dogs: ['hello', 'kitty'],
44
- * })
45
- * ```
46
- */
47
- export declare function deserialize(entities: readonly (readonly [string, unknown])[]): Record<string, unknown> | unknown[] | undefined;
48
- /**
49
- * Escape the `[`, `]`, and `\` chars in a path segment.
50
- *
51
- * @example
52
- * ```ts
53
- * expect(escapeSegment('name[pets')).toEqual('name\\[pets')
54
- * ```
55
- */
56
- export declare function escapeSegment(segment: string): string;
57
- /**
58
- * Convert an array of path segments into a path string using bracket-notation.
59
- *
60
- * For the special char `[`, `]`, and `\` will be escaped by adding `\` at start.
61
- *
62
- * @example
63
- * ```ts
64
- * expect(stringifyPath(['name', 'pets', '0'])).toEqual('name[pets][0]')
65
- * ```
66
- */
67
- export declare function stringifyPath(path: readonly [string, ...string[]]): string;
68
- /**
69
- * Convert a path string using bracket-notation into an array of path segments.
70
- *
71
- * For the special char `[`, `]`, and `\` you should escape by adding `\` at start.
72
- * It only treats a pair `[${string}]` as a path segment.
73
- * If missing or escape it will bypass and treat as normal string.
74
- *
75
- * @example
76
- * ```ts
77
- * expect(parsePath('name[pets][0]')).toEqual(['name', 'pets', '0'])
78
- * expect(parsePath('name[pets][0')).toEqual(['name', 'pets', '[0'])
79
- * expect(parsePath('name[pets[0]')).toEqual(['name', 'pets[0')
80
- * expect(parsePath('name\\[pets][0]')).toEqual(['name[pets]', '0'])
81
- * ```
82
- */
83
- export declare function parsePath(path: string): [string, ...string[]];
84
- //# sourceMappingURL=bracket-notation.d.ts.map
@@ -1,10 +0,0 @@
1
- export * from './bracket-notation';
2
- export * from './input-structure-compact';
3
- export * from './input-structure-detailed';
4
- export * from './openapi-handler';
5
- export * from './openapi-handler-server';
6
- export * from './openapi-handler-serverless';
7
- export * from './openapi-payload-codec';
8
- export * from './openapi-procedure-matcher';
9
- export * from './schema-coercer';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +0,0 @@
1
- import type { Params } from 'hono/router';
2
- export declare class InputStructureCompact {
3
- build(params: Params, payload: unknown): unknown;
4
- }
5
- export type PublicInputStructureCompact = Pick<InputStructureCompact, keyof InputStructureCompact>;
6
- //# sourceMappingURL=input-structure-compact.d.ts.map
@@ -1,11 +0,0 @@
1
- import type { Params } from 'hono/router';
2
- export declare class InputStructureDetailed {
3
- build(params: Params, query: unknown, headers: unknown, body: unknown): {
4
- params: Params;
5
- query: unknown;
6
- headers: unknown;
7
- body: unknown;
8
- };
9
- }
10
- export type PublicInputStructureDetailed = Pick<InputStructureDetailed, keyof InputStructureDetailed>;
11
- //# sourceMappingURL=input-structure-detailed.d.ts.map
@@ -1,7 +0,0 @@
1
- import type { Context, Router } from '@orpc/server';
2
- import type { OpenAPIHandlerOptions } from './openapi-handler';
3
- import { OpenAPIHandler } from './openapi-handler';
4
- export declare class OpenAPIServerHandler<T extends Context> extends OpenAPIHandler<T> {
5
- constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
6
- }
7
- //# sourceMappingURL=openapi-handler-server.d.ts.map
@@ -1,7 +0,0 @@
1
- import type { Context, Router } from '@orpc/server';
2
- import type { OpenAPIHandlerOptions } from './openapi-handler';
3
- import { OpenAPIHandler } from './openapi-handler';
4
- export declare class OpenAPIServerlessHandler<T extends Context> extends OpenAPIHandler<T> {
5
- constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
6
- }
7
- //# sourceMappingURL=openapi-handler-serverless.d.ts.map
@@ -1,32 +0,0 @@
1
- import type { Context, Router } from '@orpc/server';
2
- import type { FetchHandler, FetchHandleRest, FetchHandleResult } from '@orpc/server/fetch';
3
- import type { PublicInputStructureCompact } from './input-structure-compact';
4
- import { type Hooks } from '@orpc/shared';
5
- import { type PublicJSONSerializer } from '../../json-serializer';
6
- import { type PublicInputStructureDetailed } from './input-structure-detailed';
7
- import { type PublicOpenAPIPayloadCodec } from './openapi-payload-codec';
8
- import { type Hono, type PublicOpenAPIProcedureMatcher } from './openapi-procedure-matcher';
9
- import { type SchemaCoercer } from './schema-coercer';
10
- export type OpenAPIHandlerOptions<T extends Context> = Hooks<Request, FetchHandleResult, T, any> & {
11
- jsonSerializer?: PublicJSONSerializer;
12
- procedureMatcher?: PublicOpenAPIProcedureMatcher;
13
- payloadCodec?: PublicOpenAPIPayloadCodec;
14
- inputBuilderSimple?: PublicInputStructureCompact;
15
- inputBuilderFull?: PublicInputStructureDetailed;
16
- schemaCoercers?: SchemaCoercer[];
17
- };
18
- export declare class OpenAPIHandler<T extends Context> implements FetchHandler<T> {
19
- private readonly options?;
20
- private readonly procedureMatcher;
21
- private readonly payloadCodec;
22
- private readonly inputStructureCompact;
23
- private readonly inputStructureDetailed;
24
- private readonly compositeSchemaCoercer;
25
- constructor(hono: Hono, router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>> | undefined);
26
- handle(request: Request, ...[options]: FetchHandleRest<T>): Promise<FetchHandleResult>;
27
- private decodeInput;
28
- private encodeOutput;
29
- private assertDetailedOutput;
30
- private convertToORPCError;
31
- }
32
- //# sourceMappingURL=openapi-handler.d.ts.map
@@ -1,15 +0,0 @@
1
- import type { PublicJSONSerializer } from '../../json-serializer';
2
- export declare class OpenAPIPayloadCodec {
3
- private readonly jsonSerializer;
4
- constructor(jsonSerializer: PublicJSONSerializer);
5
- encode(payload: unknown, accept: string | undefined): {
6
- body: FormData | Blob | string | undefined;
7
- headers?: Headers;
8
- };
9
- private encodeAsJSON;
10
- private encodeAsFormData;
11
- private encodeAsURLSearchParams;
12
- decode(re: Request | Response | Headers | URLSearchParams | FormData): Promise<unknown>;
13
- }
14
- export type PublicOpenAPIPayloadCodec = Pick<OpenAPIPayloadCodec, keyof OpenAPIPayloadCodec>;
15
- //# sourceMappingURL=openapi-payload-codec.d.ts.map
@@ -1,19 +0,0 @@
1
- import type { AnyProcedure, AnyRouter } from '@orpc/server';
2
- import type { Router as BaseHono, Params } from 'hono/router';
3
- export type Hono = BaseHono<[string, string[]]>;
4
- export declare class OpenAPIProcedureMatcher {
5
- private readonly hono;
6
- private readonly router;
7
- private pendingRouters;
8
- constructor(hono: Hono, router: AnyRouter);
9
- match(method: string, pathname: string): Promise<{
10
- path: string[];
11
- procedure: AnyProcedure;
12
- params: Params;
13
- } | undefined>;
14
- private add;
15
- private handlePendingRouters;
16
- private convertOpenAPIPathToRouterPath;
17
- }
18
- export type PublicOpenAPIProcedureMatcher = Pick<OpenAPIProcedureMatcher, keyof OpenAPIProcedureMatcher>;
19
- //# sourceMappingURL=openapi-procedure-matcher.d.ts.map
@@ -1,10 +0,0 @@
1
- import type { Schema } from '@orpc/contract';
2
- export interface SchemaCoercer {
3
- coerce(schema: Schema, value: unknown): unknown;
4
- }
5
- export declare class CompositeSchemaCoercer implements SchemaCoercer {
6
- private readonly coercers;
7
- constructor(coercers: SchemaCoercer[]);
8
- coerce(schema: Schema, value: unknown): unknown;
9
- }
10
- //# sourceMappingURL=schema-coercer.d.ts.map
@@ -1,2 +0,0 @@
1
- export * from '../fetch';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export * from '../fetch';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
1
- export * from './openapi-handler';
2
- export * from './openapi-handler-server';
3
- export * from './openapi-handler-serverless';
4
- export * from './types';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,7 +0,0 @@
1
- import type { Context, Router } from '@orpc/server';
2
- import type { OpenAPIHandlerOptions } from '../fetch/openapi-handler';
3
- import { OpenAPIHandler } from './openapi-handler';
4
- export declare class OpenAPIServerHandler<T extends Context> extends OpenAPIHandler<T> {
5
- constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
6
- }
7
- //# sourceMappingURL=openapi-handler-server.d.ts.map
@@ -1,7 +0,0 @@
1
- import type { Context, Router } from '@orpc/server';
2
- import type { OpenAPIHandlerOptions } from '../fetch/openapi-handler';
3
- import { OpenAPIHandler } from './openapi-handler';
4
- export declare class OpenAPIServerlessHandler<T extends Context> extends OpenAPIHandler<T> {
5
- constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
6
- }
7
- //# sourceMappingURL=openapi-handler-serverless.d.ts.map
@@ -1,11 +0,0 @@
1
- import type { Context, Router } from '@orpc/server';
2
- import type { IncomingMessage, ServerResponse } from 'node:http';
3
- import type { OpenAPIHandlerOptions } from '../fetch/openapi-handler';
4
- import type { Hono } from '../fetch/openapi-procedure-matcher';
5
- import { type RequestHandler, type RequestHandleRest, type RequestHandleResult } from '@orpc/server/node';
6
- export declare class OpenAPIHandler<T extends Context> implements RequestHandler<T> {
7
- private readonly openapiFetchHandler;
8
- constructor(hono: Hono, router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
9
- handle(req: IncomingMessage, res: ServerResponse, ...[options]: RequestHandleRest<T>): Promise<RequestHandleResult>;
10
- }
11
- //# sourceMappingURL=openapi-handler.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.d.ts.map
@@ -1,12 +0,0 @@
1
- /** unnoq */
2
- export * from './json-serializer';
3
- export * from './openapi';
4
- export * from './openapi-content-builder';
5
- export * from './openapi-generator';
6
- export * from './openapi-parameters-builder';
7
- export * from './openapi-path-parser';
8
- export * from './schema';
9
- export * from './schema-converter';
10
- export * from './schema-utils';
11
- export * from './utils';
12
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
1
- export declare class JSONSerializer {
2
- serialize(payload: unknown): unknown;
3
- }
4
- export type PublicJSONSerializer = Pick<JSONSerializer, keyof JSONSerializer>;
5
- //# sourceMappingURL=json-serializer.d.ts.map
@@ -1,10 +0,0 @@
1
- import type { OpenAPI } from './openapi';
2
- import type { JSONSchema } from './schema';
3
- import type { PublicSchemaUtils } from './schema-utils';
4
- export declare class OpenAPIContentBuilder {
5
- private readonly schemaUtils;
6
- constructor(schemaUtils: PublicSchemaUtils);
7
- build(jsonSchema: JSONSchema.JSONSchema, options?: Partial<OpenAPI.MediaTypeObject>): OpenAPI.ContentObject;
8
- }
9
- export type PublicOpenAPIContentBuilder = Pick<OpenAPIContentBuilder, keyof OpenAPIContentBuilder>;
10
- //# sourceMappingURL=openapi-content-builder.d.ts.map
@@ -1,3 +0,0 @@
1
- export declare class OpenAPIError extends Error {
2
- }
3
- //# sourceMappingURL=openapi-error.d.ts.map
@@ -1,67 +0,0 @@
1
- import type { AnyRouter } from '@orpc/server';
2
- import type { PublicOpenAPIInputStructureParser } from './openapi-input-structure-parser';
3
- import type { PublicOpenAPIOutputStructureParser } from './openapi-output-structure-parser';
4
- import type { PublicOpenAPIPathParser } from './openapi-path-parser';
5
- import type { SchemaConverter } from './schema-converter';
6
- import { type ContractRouter } from '@orpc/contract';
7
- import { type PublicJSONSerializer } from './json-serializer';
8
- import { type OpenAPI } from './openapi';
9
- import { type PublicOpenAPIContentBuilder } from './openapi-content-builder';
10
- import { type PublicOpenAPIParametersBuilder } from './openapi-parameters-builder';
11
- import { type PublicSchemaUtils } from './schema-utils';
12
- type ErrorHandlerStrategy = 'throw' | 'log' | 'ignore';
13
- export interface OpenAPIGeneratorOptions {
14
- contentBuilder?: PublicOpenAPIContentBuilder;
15
- parametersBuilder?: PublicOpenAPIParametersBuilder;
16
- schemaConverters?: SchemaConverter[];
17
- schemaUtils?: PublicSchemaUtils;
18
- jsonSerializer?: PublicJSONSerializer;
19
- pathParser?: PublicOpenAPIPathParser;
20
- inputStructureParser?: PublicOpenAPIInputStructureParser;
21
- outputStructureParser?: PublicOpenAPIOutputStructureParser;
22
- /**
23
- * Throw error when you missing define tag definition on OpenAPI root tags
24
- *
25
- * Example: if procedure has tags ['foo', 'bar'], and OpenAPI root tags is ['foo'], then error will be thrown
26
- * Because OpenAPI root tags is missing 'bar' tag
27
- *
28
- * @default false
29
- */
30
- considerMissingTagDefinitionAsError?: boolean;
31
- /**
32
- * Weather ignore procedures that has no path defined.
33
- *
34
- * @default false
35
- */
36
- ignoreUndefinedPathProcedures?: boolean;
37
- /**
38
- * What to do when we found an error with our router
39
- *
40
- * @default 'throw'
41
- */
42
- errorHandlerStrategy?: ErrorHandlerStrategy;
43
- /**
44
- * Strict error response
45
- *
46
- * @default true
47
- */
48
- strictErrorResponses?: boolean;
49
- }
50
- export declare class OpenAPIGenerator {
51
- private readonly contentBuilder;
52
- private readonly parametersBuilder;
53
- private readonly schemaConverter;
54
- private readonly schemaUtils;
55
- private readonly jsonSerializer;
56
- private readonly pathParser;
57
- private readonly inputStructureParser;
58
- private readonly outputStructureParser;
59
- private readonly errorHandlerStrategy;
60
- private readonly ignoreUndefinedPathProcedures;
61
- private readonly considerMissingTagDefinitionAsError;
62
- private readonly strictErrorResponses;
63
- constructor(options?: OpenAPIGeneratorOptions);
64
- generate(router: ContractRouter<any> | AnyRouter, doc: Omit<OpenAPI.OpenAPIObject, 'openapi'>): Promise<OpenAPI.OpenAPIObject>;
65
- }
66
- export {};
67
- //# sourceMappingURL=openapi-generator.d.ts.map
@@ -1,22 +0,0 @@
1
- import type { AnyContractProcedure } from '@orpc/contract';
2
- import type { PublicOpenAPIPathParser } from './openapi-path-parser';
3
- import type { JSONSchema, ObjectSchema } from './schema';
4
- import type { SchemaConverter } from './schema-converter';
5
- import type { PublicSchemaUtils } from './schema-utils';
6
- export interface OpenAPIInputStructureParseResult {
7
- paramsSchema: ObjectSchema | undefined;
8
- querySchema: ObjectSchema | undefined;
9
- headersSchema: ObjectSchema | undefined;
10
- bodySchema: JSONSchema.JSONSchema | undefined;
11
- }
12
- export declare class OpenAPIInputStructureParser {
13
- private readonly schemaConverter;
14
- private readonly schemaUtils;
15
- private readonly pathParser;
16
- constructor(schemaConverter: SchemaConverter, schemaUtils: PublicSchemaUtils, pathParser: PublicOpenAPIPathParser);
17
- parse(contract: AnyContractProcedure, structure: 'compact' | 'detailed'): OpenAPIInputStructureParseResult;
18
- private parseDetailedSchema;
19
- private parseCompactSchema;
20
- }
21
- export type PublicOpenAPIInputStructureParser = Pick<OpenAPIInputStructureParser, keyof OpenAPIInputStructureParser>;
22
- //# sourceMappingURL=openapi-input-structure-parser.d.ts.map
@@ -1,18 +0,0 @@
1
- import type { AnyContractProcedure } from '@orpc/contract';
2
- import type { JSONSchema, ObjectSchema } from './schema';
3
- import type { SchemaConverter } from './schema-converter';
4
- import type { PublicSchemaUtils } from './schema-utils';
5
- export interface OpenAPIOutputStructureParseResult {
6
- headersSchema: ObjectSchema | undefined;
7
- bodySchema: JSONSchema.JSONSchema | undefined;
8
- }
9
- export declare class OpenAPIOutputStructureParser {
10
- private readonly schemaConverter;
11
- private readonly schemaUtils;
12
- constructor(schemaConverter: SchemaConverter, schemaUtils: PublicSchemaUtils);
13
- parse(contract: AnyContractProcedure, structure: 'compact' | 'detailed'): OpenAPIOutputStructureParseResult;
14
- private parseDetailedSchema;
15
- private parseCompactSchema;
16
- }
17
- export type PublicOpenAPIOutputStructureParser = Pick<OpenAPIOutputStructureParser, keyof OpenAPIOutputStructureParser>;
18
- //# sourceMappingURL=openapi-output-structure-parser.d.ts.map
@@ -1,12 +0,0 @@
1
- import type { OpenAPI } from './openapi';
2
- import type { JSONSchema } from './schema';
3
- export declare class OpenAPIParametersBuilder {
4
- build(paramIn: OpenAPI.ParameterObject['in'], jsonSchema: JSONSchema.JSONSchema & {
5
- type: 'object';
6
- } & object, options?: Pick<OpenAPI.ParameterObject, 'example' | 'style' | 'required'>): OpenAPI.ParameterObject[];
7
- buildHeadersObject(jsonSchema: JSONSchema.JSONSchema & {
8
- type: 'object';
9
- } & object, options?: Pick<OpenAPI.ParameterObject, 'example' | 'style' | 'required'>): OpenAPI.HeadersObject;
10
- }
11
- export type PublicOpenAPIParametersBuilder = Pick<OpenAPIParametersBuilder, keyof OpenAPIParametersBuilder>;
12
- //# sourceMappingURL=openapi-parameters-builder.d.ts.map
@@ -1,8 +0,0 @@
1
- export declare class OpenAPIPathParser {
2
- parseDynamicParams(path: string): {
3
- name: string;
4
- raw: string;
5
- }[];
6
- }
7
- export type PublicOpenAPIPathParser = Pick<OpenAPIPathParser, keyof OpenAPIPathParser>;
8
- //# sourceMappingURL=openapi-path-parser.d.ts.map
@@ -1,3 +0,0 @@
1
- export { OpenApiBuilder } from 'openapi3-ts/oas31';
2
- export type * as OpenAPI from 'openapi3-ts/oas31';
3
- //# sourceMappingURL=openapi.d.ts.map
@@ -1,16 +0,0 @@
1
- import type { Schema } from '@orpc/contract';
2
- import type { JSONSchema } from './schema';
3
- export interface SchemaConvertOptions {
4
- strategy: 'input' | 'output';
5
- }
6
- export interface SchemaConverter {
7
- condition(schema: Schema, options: SchemaConvertOptions): boolean;
8
- convert(schema: Schema, options: SchemaConvertOptions): JSONSchema.JSONSchema;
9
- }
10
- export declare class CompositeSchemaConverter implements SchemaConverter {
11
- private readonly converters;
12
- constructor(converters: SchemaConverter[]);
13
- condition(): boolean;
14
- convert(schema: Schema, options: SchemaConvertOptions): JSONSchema.JSONSchema;
15
- }
16
- //# sourceMappingURL=schema-converter.d.ts.map
@@ -1,11 +0,0 @@
1
- import { type FileSchema, type JSONSchema, type ObjectSchema } from './schema';
2
- export declare class SchemaUtils {
3
- isFileSchema(schema: JSONSchema.JSONSchema): schema is FileSchema;
4
- isObjectSchema(schema: JSONSchema.JSONSchema): schema is ObjectSchema;
5
- isAnySchema(schema: JSONSchema.JSONSchema): boolean;
6
- isUndefinableSchema(schema: JSONSchema.JSONSchema): boolean;
7
- separateObjectSchema(schema: ObjectSchema, separatedProperties: string[]): [matched: ObjectSchema, rest: ObjectSchema];
8
- filterSchemaBranches(schema: JSONSchema.JSONSchema, check: (schema: JSONSchema.JSONSchema) => boolean, matches?: JSONSchema.JSONSchema[]): [matches: JSONSchema.JSONSchema[], rest: JSONSchema.JSONSchema | undefined];
9
- }
10
- export type PublicSchemaUtils = Pick<SchemaUtils, keyof SchemaUtils>;
11
- //# sourceMappingURL=schema-utils.d.ts.map
@@ -1,12 +0,0 @@
1
- import * as JSONSchema from 'json-schema-typed/draft-2020-12';
2
- export { Format as JSONSchemaFormat } from 'json-schema-typed/draft-2020-12';
3
- export { JSONSchema };
4
- export type ObjectSchema = JSONSchema.JSONSchema & {
5
- type: 'object';
6
- } & object;
7
- export type FileSchema = JSONSchema.JSONSchema & {
8
- type: 'string';
9
- contentMediaType: string;
10
- } & object;
11
- export declare const NON_LOGIC_KEYWORDS: string[];
12
- //# sourceMappingURL=schema.d.ts.map
@@ -1,18 +0,0 @@
1
- import type { AnyContractProcedure, AnyContractRouter, HTTPPath } from '@orpc/contract';
2
- import type { AnyProcedure, AnyRouter, Lazy } from '@orpc/server';
3
- export interface EachLeafOptions {
4
- router: AnyContractRouter | AnyRouter;
5
- path: string[];
6
- }
7
- export interface EachLeafCallbackOptions {
8
- contract: AnyContractProcedure;
9
- path: string[];
10
- }
11
- export interface EachContractLeafResultItem {
12
- router: Lazy<AnyProcedure> | Lazy<Record<string, AnyRouter> | AnyProcedure>;
13
- path: string[];
14
- }
15
- export declare function forEachContractProcedure(options: EachLeafOptions, callback: (options: EachLeafCallbackOptions) => void, result?: EachContractLeafResultItem[], isCurrentRouterContract?: boolean): EachContractLeafResultItem[];
16
- export declare function forEachAllContractProcedure(router: AnyContractRouter | AnyRouter, callback: (options: EachLeafCallbackOptions) => void): Promise<void>;
17
- export declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
18
- //# sourceMappingURL=utils.d.ts.map