@povio/openapi-codegen-cli 0.2.1 → 0.2.3

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.
@@ -8,11 +8,6 @@ export declare enum GenerateType {
8
8
  Endpoints = "endpoints",
9
9
  Queries = "queries"
10
10
  }
11
- export interface TsFieldDescriptor {
12
- name: string;
13
- type: string;
14
- required: boolean;
15
- }
16
11
  export type GenerateData = Map<string, {
17
12
  endpoints: Endpoint[];
18
13
  zodSchemas: Record<string, string>;
@@ -1,10 +1,16 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
- import { TsFieldDescriptor } from "./generate";
3
2
  import { GenerateOptions } from "./options";
4
3
  export interface GenerateMetadataParams {
5
4
  input: string;
6
5
  options?: Partial<GenerateOptions>;
7
6
  }
7
+ export type TsFieldDescriptor = {
8
+ name: string;
9
+ type: string;
10
+ required: boolean;
11
+ namespace?: string;
12
+ filePath?: string;
13
+ };
8
14
  export interface BaseMetadata {
9
15
  name: string;
10
16
  filePath: string;
@@ -1,6 +1,5 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
2
  import { SchemaResolver } from "src/generators/core/SchemaResolver.class";
3
- import { TsFieldDescriptor } from "src/generators/types/generate";
4
3
  import { GenerateOptions } from "src/generators/types/options";
5
4
  import { Endpoint } from "../../types/endpoint";
6
5
  export declare const getEndpointName: (endpoint: Endpoint) => string;
@@ -11,7 +10,13 @@ export declare function mapEndpointParamsToFunctionParams({ resolver, endpoint,
11
10
  resolver: SchemaResolver;
12
11
  endpoint: Endpoint;
13
12
  options: GenerateOptions;
14
- }): TsFieldDescriptor[];
13
+ }): {
14
+ name: string;
15
+ type: string;
16
+ paramType: "Query" | "Body" | "Header" | "Path";
17
+ required: boolean;
18
+ tag: string | undefined;
19
+ }[];
15
20
  export declare function getEndpointConfig(endpoint: Endpoint): {
16
21
  headers?: {
17
22
  Accept?: string | undefined;
@@ -1,5 +1,11 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
- import { TsFieldDescriptor } from "../types/generate";
2
+ import { SchemaResolver } from "../core/SchemaResolver.class";
3
+ import { TsFieldDescriptor } from "../types/metadata";
3
4
  import { PrimitiveType } from "../types/openapi";
5
+ import { GenerateOptions } from "../types/options";
4
6
  export declare function primitiveTypeToTsType(type: PrimitiveType): string;
5
- export declare function getSchemaTsProperties(schema: OpenAPIV3.SchemaObject): TsFieldDescriptor[];
7
+ export declare function getSchemaTsProperties({ schema, resolver, options, }: {
8
+ schema: OpenAPIV3.SchemaObject;
9
+ resolver: SchemaResolver;
10
+ options: GenerateOptions;
11
+ }): TsFieldDescriptor[];