@povio/openapi-codegen-cli 0.0.12 → 0.1.0
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/dist/generators/core/SchemaResolver.class.d.ts +2 -1
- package/dist/generators/core/getMetadataFromOpenAPIDoc.d.ts +7 -0
- package/dist/generators/core/zod/resolveZodSchemaName.d.ts +3 -1
- package/dist/generators/types/generate.d.ts +17 -0
- package/dist/index.d.ts +2 -5
- package/dist/index.js +37 -37
- package/dist/sh.js +42 -42
- package/package.json +1 -1
|
@@ -19,8 +19,9 @@ export declare class SchemaResolver {
|
|
|
19
19
|
getCodeByZodSchemaName(name: string): string | undefined;
|
|
20
20
|
getZodSchemaNamesByDiscriminatorCode(code: string): string[] | undefined;
|
|
21
21
|
setZodSchema(name: string, code: string, tag: string): void;
|
|
22
|
-
addZodSchemaForDiscriminatorCode(code: string, zodSchema: ZodSchema, zodSchemaName: string): void;
|
|
22
|
+
addZodSchemaForDiscriminatorCode(code: string, zodSchema: ZodSchema, zodSchemaName: string, schema?: OpenAPIV3.SchemaObject): void;
|
|
23
23
|
getDiscriminatorZodSchemaByZodSchemaName(zodSchemaName: string): ZodSchema | undefined;
|
|
24
|
+
getSchemaByDiscriminatorZodSchemaName(discriminatorZodSchemaName: string): OpenAPIV3.SchemaObject | undefined;
|
|
24
25
|
getZodSchemas(): {};
|
|
25
26
|
private intializeSchemaInfo;
|
|
26
27
|
private initializeSchemaTags;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
+
import { GenerateMetadata } from "../types/generate";
|
|
3
|
+
import { GenerateOptions } from "../types/options";
|
|
4
|
+
export declare function getMetadataFromOpenAPIDoc({ openApiDoc, options, }: {
|
|
5
|
+
openApiDoc: OpenAPIV3.Document;
|
|
6
|
+
options: GenerateOptions;
|
|
7
|
+
}): Promise<GenerateMetadata>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
1
2
|
import { GenerateOptions } from "src/generators/types/options";
|
|
2
3
|
import { SchemaResolver } from "../SchemaResolver.class";
|
|
3
4
|
import { ZodSchema } from "./ZodSchema.class";
|
|
4
|
-
export declare function resolveZodSchemaName({ zodSchema, fallbackName, resolver, tag, options, }: {
|
|
5
|
+
export declare function resolveZodSchemaName({ schema, zodSchema, fallbackName, resolver, tag, options, }: {
|
|
6
|
+
schema?: OpenAPIV3.SchemaObject;
|
|
5
7
|
zodSchema: ZodSchema;
|
|
6
8
|
fallbackName?: string;
|
|
7
9
|
resolver: SchemaResolver;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
1
2
|
import { Endpoint } from "./endpoint";
|
|
2
3
|
export type Import = {
|
|
3
4
|
bindings: string[];
|
|
@@ -12,3 +13,19 @@ export type GenerateData = Map<string, {
|
|
|
12
13
|
endpoints: Endpoint[];
|
|
13
14
|
zodSchemas: Record<string, string>;
|
|
14
15
|
}>;
|
|
16
|
+
export interface ModelMetadata {
|
|
17
|
+
name: string;
|
|
18
|
+
zodSchemaName: string;
|
|
19
|
+
filePath: string;
|
|
20
|
+
namespace?: string;
|
|
21
|
+
openApiSchema?: OpenAPIV3.SchemaObject;
|
|
22
|
+
}
|
|
23
|
+
export interface QueryMetadata {
|
|
24
|
+
name: string;
|
|
25
|
+
filePath: string;
|
|
26
|
+
namespace?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface GenerateMetadata {
|
|
29
|
+
models: ModelMetadata[];
|
|
30
|
+
queries: QueryMetadata[];
|
|
31
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { GenerateOptions } from "./generators/types/options";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function getMetadata({ input, options: genOptions, }: {
|
|
3
3
|
input: string;
|
|
4
4
|
options?: Partial<GenerateOptions>;
|
|
5
|
-
}): Promise<
|
|
6
|
-
resolver: import("./generators/core/SchemaResolver.class").SchemaResolver;
|
|
7
|
-
data: import("./generators/types/generate").GenerateData;
|
|
8
|
-
}>;
|
|
5
|
+
}): Promise<import("./generators/types/generate").GenerateMetadata>;
|