@povio/openapi-codegen-cli 0.2.3 → 0.2.5

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/README.md CHANGED
@@ -23,14 +23,15 @@ yarn openapi-codegen generate --input http://localhost:3001/docs-json
23
23
  ### Generate command
24
24
 
25
25
  ```sh
26
- --input <path> Path/url to OpenAPI/Swagger document as json/yaml
27
- --output <path> Output path (default: 'output')
28
- --includeNamespaces Include namespaces inside generated files (default: true)
29
- --splitByTags Split output into directories based on tags in OpenAPI operations (default: true)
30
- --defaultTag Default tag name for code shared accross multiple tags (default: 'Common')
31
- --excludeTags Comma separated list of tags excluded from the output
32
- --prettier Run prettier command on output after code generation (default: true)
33
- --verbose Show log messages during execution
26
+ --input <path> Path/url to OpenAPI/Swagger document as json/yaml
27
+ --output <path> Output path (default: 'output')
28
+ --includeNamespaces Include namespaces inside generated files (default: true)
29
+ --splitByTags Split output into directories based on tags in OpenAPI operations (default: true)
30
+ --defaultTag Default tag name for code shared accross multiple tags (default: 'Common')
31
+ --excludeTags Comma separated list of tags excluded from the output
32
+ --removeOperationPrefixEndingWith Removes prefix that ends with value from operation names (default: 'Controller_')
33
+ --prettier Run prettier command on output after code generation (default: true)
34
+ --verbose Show log messages during execution
34
35
  ```
35
36
 
36
37
  ## Development
@@ -5,7 +5,8 @@ export type GenerateParams = {
5
5
  splitByTags: boolean;
6
6
  defaultTag: string;
7
7
  excludeTags: string;
8
+ removeOperationPrefixEndingWith: string;
8
9
  prettier: boolean;
9
10
  verbose: boolean;
10
11
  };
11
- export declare function generate({ input, output, includeNamespaces, splitByTags, defaultTag, excludeTags, prettier, verbose, }: GenerateParams): Promise<void>;
12
+ export declare function generate({ input, output, includeNamespaces, splitByTags, defaultTag, excludeTags, removeOperationPrefixEndingWith, prettier, verbose, }: GenerateParams): Promise<void>;
@@ -20,6 +20,8 @@ export type ModelMetadata = BaseMetadata & {
20
20
  properties: TsFieldDescriptor[];
21
21
  };
22
22
  export type QueryMetadata = BaseMetadata & {
23
+ isQuery: boolean;
24
+ isMutation: boolean;
23
25
  params: TsFieldDescriptor[];
24
26
  };
25
27
  export interface GenerateMetadata {
@@ -17,7 +17,20 @@ export declare function isParamMediaTypeAllowed(mediaType: string): mediaType is
17
17
  export declare function isMainResponseStatus(status: number): boolean;
18
18
  export declare function isErrorStatus(status: number): boolean;
19
19
  export declare function isMediaTypeAllowed(mediaType: string): boolean;
20
- export declare function getOperationName(path: string, method: string, operation: OpenAPIV3.OperationObject): string;
20
+ export declare function getOperationName({ path, method, operation, options, keepOperationPrefixWithoutEnding, }: {
21
+ path: string;
22
+ method: string;
23
+ operation: OpenAPIV3.OperationObject;
24
+ options: GenerateOptions;
25
+ keepOperationPrefixWithoutEnding?: boolean;
26
+ }): string;
27
+ export declare function getUniqueOperationName({ path, method, operation, openApiDoc, options, }: {
28
+ path: string;
29
+ method: string;
30
+ operation: OpenAPIV3.OperationObject;
31
+ openApiDoc: OpenAPIV3.Document;
32
+ options: GenerateOptions;
33
+ }): string;
21
34
  export declare function formatTag(tag: string): string;
22
35
  export declare function getOperationTag(operation: OpenAPIV3.OperationObject, options: GenerateOptions): string;
23
36
  /** @example turns `/media-objects/{id}` into `MediaObjectsId` */
@@ -0,0 +1,3 @@
1
+ import { Endpoint } from "../types/endpoint";
2
+ export declare const isQuery: (endpoint: Endpoint) => boolean;
3
+ export declare const isMutation: (endpoint: Endpoint) => boolean;