@povio/openapi-codegen-cli 0.1.1 → 0.2.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.
@@ -1,7 +1,5 @@
1
- import { Import } from "../types/generate";
2
1
  export declare const DEFAULT_HEADERS: {
3
2
  "Content-Type": string;
4
3
  Accept: string;
5
4
  };
6
- export declare const REST_CLIENT_NAME = "AppRestClient";
7
- export declare const REST_CLIENT_IMPORT: Import;
5
+ export declare const BODY_PARAMETER_NAME = "data";
@@ -0,0 +1,10 @@
1
+ import { Import } from "../types/generate";
2
+ export declare const DATA_FILE_PATH = "src/data";
3
+ export declare const DATA_TS_PATH = "@/data";
4
+ export declare const REST_CLIENT_NAME = "AppRestClient";
5
+ export declare const REST_CLIENT_IMPORT: Import;
6
+ export declare const QUERY_OPTIONS_TYPES: {
7
+ query: string;
8
+ mutation: string;
9
+ };
10
+ export declare const QUERY_TYPES_IMPORT: Import;
@@ -8,6 +8,11 @@ export declare enum GenerateType {
8
8
  Endpoints = "endpoints",
9
9
  Queries = "queries"
10
10
  }
11
+ export interface FunctionParam {
12
+ name: string;
13
+ type: string;
14
+ required: boolean;
15
+ }
11
16
  export type GenerateData = Map<string, {
12
17
  endpoints: Endpoint[];
13
18
  zodSchemas: Record<string, string>;
@@ -1,4 +1,5 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
+ import { FunctionParam } from "./generate";
2
3
  import { GenerateOptions } from "./options";
3
4
  export interface GenerateMetadataParams {
4
5
  input: string;
@@ -15,8 +16,10 @@ export interface QueryMetadata {
15
16
  name: string;
16
17
  filePath: string;
17
18
  namespace?: string;
19
+ params: FunctionParam[];
18
20
  }
19
21
  export interface GenerateMetadata {
22
+ openApiDoc: OpenAPIV3.Document;
20
23
  models: ModelMetadata[];
21
24
  queries: QueryMetadata[];
22
25
  }
@@ -13,6 +13,7 @@ export declare function mapEndpointParamsToFunctionParams({ resolver, endpoint,
13
13
  }): {
14
14
  name: string;
15
15
  type: string;
16
+ paramType: "Query" | "Body" | "Header" | "Path";
16
17
  required: boolean;
17
18
  }[];
18
19
  export declare function getEndpointConfig(endpoint: Endpoint): {
@@ -14,3 +14,4 @@ export declare function getEndpointsImports({ tag, endpoints, options, }: {
14
14
  endpoints: Endpoint[];
15
15
  options: GenerateOptions;
16
16
  }): Import[];
17
+ export declare function getTsPath(options: Pick<GenerateOptions, "output">): string;