@ahoo-wang/fetcher-generator 2.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/LICENSE +201 -0
- package/README.md +289 -0
- package/dist/aggregate/aggregate.d.ts +73 -0
- package/dist/aggregate/aggregate.d.ts.map +1 -0
- package/dist/aggregate/aggregateResolver.d.ts +48 -0
- package/dist/aggregate/aggregateResolver.d.ts.map +1 -0
- package/dist/aggregate/index.d.ts +5 -0
- package/dist/aggregate/index.d.ts.map +1 -0
- package/dist/aggregate/types.d.ts +33 -0
- package/dist/aggregate/types.d.ts.map +1 -0
- package/dist/aggregate/utils.d.ts +45 -0
- package/dist/aggregate/utils.d.ts.map +1 -0
- package/dist/baseCodeGenerator.d.ts +22 -0
- package/dist/baseCodeGenerator.d.ts.map +1 -0
- package/dist/cli.cjs +2 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +56 -0
- package/dist/client/clientGenerator.d.ts +25 -0
- package/dist/client/clientGenerator.d.ts.map +1 -0
- package/dist/client/commandClientGenerator.d.ts +38 -0
- package/dist/client/commandClientGenerator.d.ts.map +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/queryClientGenerator.d.ts +32 -0
- package/dist/client/queryClientGenerator.d.ts.map +1 -0
- package/dist/client/utils.d.ts +12 -0
- package/dist/client/utils.d.ts.map +1 -0
- package/dist/index.cjs +11 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +968 -0
- package/dist/model/index.d.ts +4 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/modelGenerator.d.ts +130 -0
- package/dist/model/modelGenerator.d.ts.map +1 -0
- package/dist/model/modelInfo.d.ts +27 -0
- package/dist/model/modelInfo.d.ts.map +1 -0
- package/dist/model/wowTypeMapping.d.ts +33 -0
- package/dist/model/wowTypeMapping.d.ts.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/clis.d.ts +18 -0
- package/dist/utils/clis.d.ts.map +1 -0
- package/dist/utils/components.d.ts +64 -0
- package/dist/utils/components.d.ts.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +21 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/naming.d.ts +21 -0
- package/dist/utils/naming.d.ts.map +1 -0
- package/dist/utils/openAPIParser.d.ts +14 -0
- package/dist/utils/openAPIParser.d.ts.map +1 -0
- package/dist/utils/operations.d.ts +29 -0
- package/dist/utils/operations.d.ts.map +1 -0
- package/dist/utils/references.d.ts +3 -0
- package/dist/utils/references.d.ts.map +1 -0
- package/dist/utils/resources.d.ts +4 -0
- package/dist/utils/resources.d.ts.map +1 -0
- package/dist/utils/responses.d.ts +8 -0
- package/dist/utils/responses.d.ts.map +1 -0
- package/dist/utils/schemas.d.ts +22 -0
- package/dist/utils/schemas.d.ts.map +1 -0
- package/dist/utils/sourceFiles.d.ts +54 -0
- package/dist/utils/sourceFiles.d.ts.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Schema } from '@ahoo-wang/fetcher-openapi';
|
|
2
|
+
import { EnumDeclaration, InterfaceDeclaration, SourceFile, TypeAliasDeclaration } from 'ts-morph';
|
|
3
|
+
import { GenerateContext } from '../types';
|
|
4
|
+
import { ModelInfo } from './modelInfo';
|
|
5
|
+
import { BaseCodeGenerator } from '../baseCodeGenerator';
|
|
6
|
+
/**
|
|
7
|
+
* Generates TypeScript models from OpenAPI schemas.
|
|
8
|
+
* Handles enum, object, union, and type alias generation.
|
|
9
|
+
*
|
|
10
|
+
* @property project - The ts-morph project instance
|
|
11
|
+
* @property openAPI - The OpenAPI specification
|
|
12
|
+
* @property outputDir - The output directory for generated files
|
|
13
|
+
* @property contextAggregates - Map of aggregate definitions
|
|
14
|
+
*/
|
|
15
|
+
export declare class ModelGenerator extends BaseCodeGenerator {
|
|
16
|
+
constructor(context: GenerateContext);
|
|
17
|
+
private getOrCreateSourceFile;
|
|
18
|
+
/**
|
|
19
|
+
* Generates models for all schemas in the OpenAPI specification.
|
|
20
|
+
* Skips schemas with keys starting with 'wow.'.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* This method iterates through all schemas in the OpenAPI specification
|
|
24
|
+
* and generates corresponding TypeScript models for each one.
|
|
25
|
+
*/
|
|
26
|
+
generate(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Generates a model for a specific schema key.
|
|
29
|
+
* Processes enums, objects, unions, and type aliases in order.
|
|
30
|
+
*
|
|
31
|
+
* @param schemaKey - The key of the schema to generate
|
|
32
|
+
* @param schema - The schema definition
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* The generation process follows this order:
|
|
36
|
+
* 1. Enum processing
|
|
37
|
+
* 2. Object processing
|
|
38
|
+
* 3. Union processing
|
|
39
|
+
* 4. Type alias processing
|
|
40
|
+
*/
|
|
41
|
+
generateKeyedSchema(schemaKey: string, schema: Schema): SourceFile;
|
|
42
|
+
private process;
|
|
43
|
+
/**
|
|
44
|
+
* Processes enum schemas and generates TypeScript enums.
|
|
45
|
+
*
|
|
46
|
+
* @param modelInfo - The model information
|
|
47
|
+
* @param sourceFile - The source file to add the enum to
|
|
48
|
+
* @param schema - The enum schema
|
|
49
|
+
* @returns true if the schema was processed as an enum, false otherwise
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* This method filters out non-string enum values and generates
|
|
53
|
+
* a TypeScript enum with string literal initializers.
|
|
54
|
+
*/
|
|
55
|
+
processEnum(modelInfo: ModelInfo, sourceFile: SourceFile, schema: Schema): EnumDeclaration | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Processes object schemas and generates TypeScript interfaces.
|
|
58
|
+
*
|
|
59
|
+
* @param modelInfo - The model information
|
|
60
|
+
* @param sourceFile - The source file to add the interface to
|
|
61
|
+
* @param schema - The object schema
|
|
62
|
+
* @returns true if the schema was processed as an object, false otherwise
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* This method handles optional properties by checking the required array
|
|
66
|
+
* and adds undefined union types for optional properties.
|
|
67
|
+
*/
|
|
68
|
+
processObject(modelInfo: ModelInfo, sourceFile: SourceFile, schema: Schema): InterfaceDeclaration | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Processes union schemas (allOf, anyOf, oneOf) and generates TypeScript type aliases.
|
|
71
|
+
*
|
|
72
|
+
* @param modelInfo - The model information
|
|
73
|
+
* @param sourceFile - The source file to add the type alias to
|
|
74
|
+
* @param schema - The union schema
|
|
75
|
+
* @returns true if the schema was processed as a union, false otherwise
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* This method handles three types of unions:
|
|
79
|
+
* - allOf: Generates intersection types (&)
|
|
80
|
+
* - anyOf: Generates union types (|)
|
|
81
|
+
* - oneOf: Generates union types (|)
|
|
82
|
+
*/
|
|
83
|
+
processUnion(modelInfo: ModelInfo, sourceFile: SourceFile, schema: Schema): TypeAliasDeclaration | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Processes type alias schemas and generates TypeScript type aliases.
|
|
86
|
+
*
|
|
87
|
+
* @param modelInfo - The model information
|
|
88
|
+
* @param sourceFile - The source file to add the type alias to
|
|
89
|
+
* @param schema - The schema to process
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* This method is used as a fallback for schemas that don't match
|
|
93
|
+
* enum, object, or union patterns. It resolves the type and creates
|
|
94
|
+
* a simple type alias.
|
|
95
|
+
*/
|
|
96
|
+
processTypeAlias(modelInfo: ModelInfo, sourceFile: SourceFile, schema: Schema): TypeAliasDeclaration;
|
|
97
|
+
/**
|
|
98
|
+
* Resolves the TypeScript type for a given schema or reference.
|
|
99
|
+
* Handles arrays, objects, primitives, and references.
|
|
100
|
+
*
|
|
101
|
+
* @param modelInfo - The model information
|
|
102
|
+
* @param sourceFile - The source file for import management
|
|
103
|
+
* @param schema - The schema or reference to resolve
|
|
104
|
+
* @returns The resolved TypeScript type as a string
|
|
105
|
+
*
|
|
106
|
+
* @remarks
|
|
107
|
+
* This method handles various schema types:
|
|
108
|
+
* - References: Resolves to imported types
|
|
109
|
+
* - Arrays: Resolves item types and adds array notation
|
|
110
|
+
* - Objects: Resolves to Record<string, any> for generic objects
|
|
111
|
+
* - Primitives: Maps to TypeScript primitives
|
|
112
|
+
* - Nullable: Adds null union type
|
|
113
|
+
*/
|
|
114
|
+
private resolveType;
|
|
115
|
+
/**
|
|
116
|
+
* Resolves a reference to another schema.
|
|
117
|
+
* Handles mapped types and imports.
|
|
118
|
+
*
|
|
119
|
+
* @param modelInfo - The current model information
|
|
120
|
+
* @param sourceFile - The source file for import management
|
|
121
|
+
* @param ref - The reference to resolve
|
|
122
|
+
* @returns The resolved type name
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* This method checks for mapped types first (WOW_TYPE_MAPPING).
|
|
126
|
+
* If not found, it adds an import for the referenced model.
|
|
127
|
+
*/
|
|
128
|
+
private resolveReference;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=modelGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelGenerator.d.ts","sourceRoot":"","sources":["../../src/model/modelGenerator.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAa,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,oBAAoB,EAEpB,UAAU,EACV,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAY1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,iBAAiB;gBACvC,OAAO,EAAE,eAAe;IAIpC,OAAO,CAAC,qBAAqB;IAK7B;;;;;;;OAOG;IACH,QAAQ;IAmBR;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU;IAQlE,OAAO,CAAC,OAAO;IAwBf;;;;;;;;;;;OAWG;IACH,WAAW,CACT,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,SAAS;IAgB9B;;;;;;;;;;;OAWG;IACH,aAAa,CACX,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,oBAAoB,GAAG,SAAS;IAuBnC;;;;;;;;;;;;;OAaG;IACH,YAAY,CACV,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,oBAAoB,GAAG,SAAS;IA6BnC;;;;;;;;;;;OAWG;IACH,gBAAgB,CACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,oBAAoB;IAUvB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,WAAW;IAmCnB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,gBAAgB;CAUzB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Named } from '@ahoo-wang/fetcher-wow';
|
|
2
|
+
/**
|
|
3
|
+
* Data Model Info
|
|
4
|
+
*/
|
|
5
|
+
export interface ModelInfo extends Named {
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Resolves model information from a schema key.
|
|
11
|
+
*
|
|
12
|
+
* This function parses a dot-separated schema key and extracts the model name and path.
|
|
13
|
+
* It assumes that the model name is the first part that starts with an uppercase letter.
|
|
14
|
+
* All parts before the model name are treated as the path.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* - "wow.api.BindingError" -> {path:'/wow/api',name:'BindingError'}
|
|
19
|
+
* - "compensation.ApiVersion" -> {path:'/compensation',name:'ApiVersion'}
|
|
20
|
+
* - "ai.AiMessage.Assistant" -> {path:'/ai',name:'AiMessageAssistant'}
|
|
21
|
+
* - "Result" -> {path:'/',name:'Result'}
|
|
22
|
+
*
|
|
23
|
+
* @param schemaKey - The dot-separated schema key (e.g., "com.example.User")
|
|
24
|
+
* @returns ModelInfo object containing the parsed name and path
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveModelInfo(schemaKey: string): ModelInfo;
|
|
27
|
+
//# sourceMappingURL=modelInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelInfo.d.ts","sourceRoot":"","sources":["../../src/model/modelInfo.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAI/C;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,KAAK;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAmC7D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Import path for the WOW framework types */
|
|
2
|
+
export declare const IMPORT_WOW_PATH = "@ahoo-wang/fetcher-wow";
|
|
3
|
+
/** Mapping of OpenAPI schema keys to WOW framework types */
|
|
4
|
+
export declare const WOW_TYPE_MAPPING: {
|
|
5
|
+
'wow.command.CommandResult': string;
|
|
6
|
+
'wow.MessageHeaderSqlType': string;
|
|
7
|
+
'wow.api.BindingError': string;
|
|
8
|
+
'wow.api.DefaultErrorInfo': string;
|
|
9
|
+
'wow.api.RecoverableType': string;
|
|
10
|
+
'wow.api.command.DefaultDeleteAggregate': string;
|
|
11
|
+
'wow.api.command.DefaultRecoverAggregate': string;
|
|
12
|
+
'wow.api.messaging.FunctionInfoData': string;
|
|
13
|
+
'wow.api.messaging.FunctionKind': string;
|
|
14
|
+
'wow.api.modeling.AggregateId': string;
|
|
15
|
+
'wow.api.query.Condition': string;
|
|
16
|
+
'wow.api.query.ConditionOptions': string;
|
|
17
|
+
'wow.api.query.ListQuery': string;
|
|
18
|
+
'wow.api.query.Operator': string;
|
|
19
|
+
'wow.api.query.PagedQuery': string;
|
|
20
|
+
'wow.api.query.Pagination': string;
|
|
21
|
+
'wow.api.query.Projection': string;
|
|
22
|
+
'wow.api.query.Sort': string;
|
|
23
|
+
'wow.api.query.Sort.Direction': string;
|
|
24
|
+
'wow.command.CommandStage': string;
|
|
25
|
+
'wow.command.SimpleWaitSignal': string;
|
|
26
|
+
'wow.configuration.Aggregate': string;
|
|
27
|
+
'wow.configuration.BoundedContext': string;
|
|
28
|
+
'wow.configuration.WowMetadata': string;
|
|
29
|
+
'wow.modeling.DomainEvent': string;
|
|
30
|
+
'wow.openapi.BatchResult': string;
|
|
31
|
+
'wow.messaging.CompensationTarget': string;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=wowTypeMapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wowTypeMapping.d.ts","sourceRoot":"","sources":["../../src/model/wowTypeMapping.ts"],"names":[],"mappings":"AAaA,8CAA8C;AAC9C,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B5B,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OpenAPI } from '@ahoo-wang/fetcher-openapi';
|
|
2
|
+
import { Project } from 'ts-morph';
|
|
3
|
+
import { BoundedContextAggregates } from './aggregate';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the code generator.
|
|
6
|
+
*/
|
|
7
|
+
export interface GeneratorOptions {
|
|
8
|
+
/** The ts-morph project instance to use for code generation */
|
|
9
|
+
readonly project: Project;
|
|
10
|
+
/** Path to the input OpenAPI specification file */
|
|
11
|
+
readonly inputPath: string;
|
|
12
|
+
/** Output directory for generated files */
|
|
13
|
+
readonly outputDir: string;
|
|
14
|
+
/** Optional logger for friendly output */
|
|
15
|
+
readonly logger?: Logger;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Logger interface for friendly logging during code generation.
|
|
19
|
+
*/
|
|
20
|
+
export interface Logger {
|
|
21
|
+
/** Log informational messages */
|
|
22
|
+
info(message: string): void;
|
|
23
|
+
/** Log success messages */
|
|
24
|
+
success(message: string): void;
|
|
25
|
+
/** Log error messages */
|
|
26
|
+
error(message: string): void;
|
|
27
|
+
/** Log progress messages */
|
|
28
|
+
progress(message: string): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Context object containing all necessary data for code generation.
|
|
32
|
+
*/
|
|
33
|
+
export interface GenerateContext {
|
|
34
|
+
/** The parsed OpenAPI specification */
|
|
35
|
+
openAPI: OpenAPI;
|
|
36
|
+
/** The ts-morph project instance */
|
|
37
|
+
project: Project;
|
|
38
|
+
/** Output directory for generated files */
|
|
39
|
+
outputDir: string;
|
|
40
|
+
contextAggregates: BoundedContextAggregates;
|
|
41
|
+
/** Optional logger for friendly output */
|
|
42
|
+
logger?: Logger;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,iCAAiC;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,2BAA2B;IAC3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,yBAAyB;IACzB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,4BAA4B;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates the input path or URL.
|
|
3
|
+
* @param input - Input path or URL
|
|
4
|
+
* @returns true if valid
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateInput(input: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Action handler for the generate command.
|
|
9
|
+
* @param options - Command options
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateAction(options: {
|
|
12
|
+
input: string;
|
|
13
|
+
output: string;
|
|
14
|
+
config?: string;
|
|
15
|
+
verbose?: boolean;
|
|
16
|
+
dryRun?: boolean;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=clis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clis.d.ts","sourceRoot":"","sources":["../../src/utils/clis.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAYpD;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,iBAiCA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Components, Parameter, Reference, RequestBody, Response, Schema } from '@ahoo-wang/fetcher-openapi';
|
|
2
|
+
/** Prefix for OpenAPI components references */
|
|
3
|
+
export declare const COMPONENTS_PREFIX = "#/components/";
|
|
4
|
+
/** Reference prefix for headers components */
|
|
5
|
+
export declare const COMPONENTS_HEADERS_REF = "#/components/headers/";
|
|
6
|
+
/** Reference prefix for parameters components */
|
|
7
|
+
export declare const COMPONENTS_PARAMETERS_REF = "#/components/parameters/";
|
|
8
|
+
/** Reference prefix for request bodies components */
|
|
9
|
+
export declare const COMPONENTS_REQUEST_BODIES_REF = "#/components/requestBodies/";
|
|
10
|
+
/** Reference prefix for responses components */
|
|
11
|
+
export declare const COMPONENTS_RESPONSES_REF = "#/components/responses/";
|
|
12
|
+
/** Reference prefix for schemas components */
|
|
13
|
+
export declare const COMPONENTS_SCHEMAS_REF = "#/components/schemas/";
|
|
14
|
+
/**
|
|
15
|
+
* Represents a schema with its key identifier.
|
|
16
|
+
*/
|
|
17
|
+
export interface KeySchema {
|
|
18
|
+
/** The schema key */
|
|
19
|
+
key: string;
|
|
20
|
+
/** The schema definition */
|
|
21
|
+
schema: Schema;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Extracts the component key from an OpenAPI reference.
|
|
25
|
+
* @param reference - The OpenAPI reference object
|
|
26
|
+
* @returns The component key (last part of the reference path)
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractComponentKey(reference: Reference): string;
|
|
29
|
+
/**
|
|
30
|
+
* Extracts a schema from OpenAPI components using a reference.
|
|
31
|
+
* @param reference - The reference to the schema
|
|
32
|
+
* @param components - The OpenAPI components object
|
|
33
|
+
* @returns The schema if found, undefined otherwise
|
|
34
|
+
*/
|
|
35
|
+
export declare function extractSchema(reference: Reference, components: Components): Schema | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Extracts a response from OpenAPI components using a reference.
|
|
38
|
+
* @param reference - The reference to the response
|
|
39
|
+
* @param components - The OpenAPI components object
|
|
40
|
+
* @returns The response if found, undefined otherwise
|
|
41
|
+
*/
|
|
42
|
+
export declare function extractResponse(reference: Reference, components: Components): Response | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Extracts a request body from OpenAPI components using a reference.
|
|
45
|
+
* @param reference - The reference to the request body
|
|
46
|
+
* @param components - The OpenAPI components object
|
|
47
|
+
* @returns The request body if found, undefined otherwise
|
|
48
|
+
*/
|
|
49
|
+
export declare function extractRequestBody(reference: Reference, components: Components): RequestBody | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Extracts a parameter from OpenAPI components using a reference.
|
|
52
|
+
* @param reference - The reference to the parameter
|
|
53
|
+
* @param components - The OpenAPI components object
|
|
54
|
+
* @returns The parameter if found, undefined otherwise
|
|
55
|
+
*/
|
|
56
|
+
export declare function extractParameter(reference: Reference, components: Components): Parameter | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a KeySchema object from a reference and components.
|
|
59
|
+
* @param reference - The reference to the schema
|
|
60
|
+
* @param components - The OpenAPI components object
|
|
61
|
+
* @returns A KeySchema containing the key and resolved schema
|
|
62
|
+
*/
|
|
63
|
+
export declare function keySchema(reference: Reference, components: Components): KeySchema;
|
|
64
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/utils/components.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,MAAM,EACP,MAAM,4BAA4B,CAAC;AAEpC,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB,0BAAiC,CAAC;AACrE,iDAAiD;AACjD,eAAO,MAAM,yBAAyB,6BAAoC,CAAC;AAC3E,qDAAqD;AACrD,eAAO,MAAM,6BAA6B,gCAAuC,CAAC;AAClF,gDAAgD;AAChD,eAAO,MAAM,wBAAwB,4BAAmC,CAAC;AACzE,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB,0BAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,GACrB,MAAM,GAAG,SAAS,CAGpB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,GACrB,QAAQ,GAAG,SAAS,CAGtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,GACrB,WAAW,GAAG,SAAS,CAGzB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,GACrB,SAAS,GAAG,SAAS,CAGvB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,GACrB,SAAS,CAMX"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './clis';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './naming';
|
|
4
|
+
export * from './openAPIParser';
|
|
5
|
+
export * from './operations';
|
|
6
|
+
export * from './references';
|
|
7
|
+
export * from './resources';
|
|
8
|
+
export * from './responses';
|
|
9
|
+
export * from './schemas';
|
|
10
|
+
export * from './sourceFiles';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Logger } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Default console-based logger implementation.
|
|
4
|
+
* Provides friendly colored output for different log levels.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ConsoleLogger implements Logger {
|
|
7
|
+
info(message: string): void;
|
|
8
|
+
success(message: string): void;
|
|
9
|
+
error(message: string): void;
|
|
10
|
+
progress(message: string): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Silent logger that suppresses all output.
|
|
14
|
+
*/
|
|
15
|
+
export declare class SilentLogger implements Logger {
|
|
16
|
+
info(_message: string): void;
|
|
17
|
+
success(_message: string): void;
|
|
18
|
+
error(_message: string): void;
|
|
19
|
+
progress(_message: string): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;GAGG;AACH,qBAAa,aAAc,YAAW,MAAM;IAC1C,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI9B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAGhC;AAED;;GAEG;AACH,qBAAa,YAAa,YAAW,MAAM;IAEzC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI5B,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI/B,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAEjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string or array of strings to PascalCase format.
|
|
3
|
+
*
|
|
4
|
+
* This function takes a string or array of strings and converts them to PascalCase format
|
|
5
|
+
* by splitting the input based on common naming separators and capitalizing the first
|
|
6
|
+
* letter of each part.
|
|
7
|
+
*
|
|
8
|
+
* @param name - A string or array of strings to convert to PascalCase
|
|
9
|
+
* @returns The PascalCase formatted string
|
|
10
|
+
*/
|
|
11
|
+
export declare function pascalCase(name: string | string[]): string;
|
|
12
|
+
/**
|
|
13
|
+
* Converts a string or array of strings to camelCase format.
|
|
14
|
+
*
|
|
15
|
+
* This function first converts the input to PascalCase and then converts the first character to lowercase.
|
|
16
|
+
*
|
|
17
|
+
* @param name - A string or array of strings to convert to camelCase
|
|
18
|
+
* @returns The camelCase formatted string
|
|
19
|
+
*/
|
|
20
|
+
export declare function camelCase(name: string | string[]): string;
|
|
21
|
+
//# sourceMappingURL=naming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../src/utils/naming.ts"],"names":[],"mappings":"AAeA;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAwB1D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAGzD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OpenAPI } from '@ahoo-wang/fetcher-openapi';
|
|
2
|
+
/**
|
|
3
|
+
* Parses an OpenAPI specification from a file path.
|
|
4
|
+
*
|
|
5
|
+
* @param inputPath - The path to the OpenAPI specification file
|
|
6
|
+
* @returns A promise that resolves to the parsed OpenAPI object
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseOpenAPI(inputPath: string): Promise<OpenAPI>;
|
|
9
|
+
export declare enum FileFormat {
|
|
10
|
+
JSON = "json",
|
|
11
|
+
YAML = "yaml"
|
|
12
|
+
}
|
|
13
|
+
export declare function inferFileFormat(content: string): FileFormat;
|
|
14
|
+
//# sourceMappingURL=openAPIParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openAPIParser.d.ts","sourceRoot":"","sources":["../../src/utils/openAPIParser.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAIrD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAWtE;AAED,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CA0B3D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTTPMethod, Operation, PathItem, Reference, Response, Schema } from '@ahoo-wang/fetcher-openapi';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an HTTP method and its associated operation.
|
|
4
|
+
*/
|
|
5
|
+
export interface MethodOperation {
|
|
6
|
+
/** The HTTP method */
|
|
7
|
+
method: HTTPMethod;
|
|
8
|
+
/** The OpenAPI operation */
|
|
9
|
+
operation: Operation;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Extracts all operations from a path item.
|
|
13
|
+
* @param pathItem - The OpenAPI path item
|
|
14
|
+
* @returns Array of method-operation pairs
|
|
15
|
+
*/
|
|
16
|
+
export declare function extractOperations(pathItem: PathItem): MethodOperation[];
|
|
17
|
+
/**
|
|
18
|
+
* Extracts the OK (200) response from an operation.
|
|
19
|
+
* @param operation - The OpenAPI operation
|
|
20
|
+
* @returns The 200 response or undefined if not found
|
|
21
|
+
*/
|
|
22
|
+
export declare function extractOkResponse(operation: Operation): Response | Reference | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Extracts the JSON schema from the OK response of an operation.
|
|
25
|
+
* @param operation - The OpenAPI operation
|
|
26
|
+
* @returns The JSON schema from the OK response or undefined if not found
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractOperationOkResponseJsonSchema(operation: Operation): Schema | Reference | undefined;
|
|
29
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/utils/operations.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACP,MAAM,4BAA4B,CAAC;AAGpC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sBAAsB;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,4BAA4B;IAC5B,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,EAAE,CAcvE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,GACnB,QAAQ,GAAG,SAAS,GAAG,SAAS,CAElC;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,SAAS,GACnB,MAAM,GAAG,SAAS,GAAG,SAAS,CAGhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../src/utils/references.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,SAAS,CAE5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/utils/resources.ts"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAK1D;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAUtD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Reference, Schema, Response } from '@ahoo-wang/fetcher-openapi';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts the JSON schema from an OK response.
|
|
4
|
+
* @param okResponse - The response object or reference
|
|
5
|
+
* @returns The JSON schema from the response content or undefined if not found
|
|
6
|
+
*/
|
|
7
|
+
export declare function extractOkResponseJsonSchema(okResponse?: Response | Reference): Schema | Reference | undefined;
|
|
8
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/utils/responses.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAIzE;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,GAAG,SAAS,CAahC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Schema, SchemaType } from '@ahoo-wang/fetcher-openapi';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a schema type is primitive.
|
|
4
|
+
* @param type - The schema type to check
|
|
5
|
+
* @returns True if the type is primitive, false otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPrimitive(type: SchemaType | SchemaType[]): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Checks if a schema represents an enum.
|
|
10
|
+
* @param schema - The schema to check
|
|
11
|
+
* @returns True if the schema has an enum property, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export declare function isEnum(schema: Schema): schema is Schema & {
|
|
14
|
+
enum: any[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Resolves a schema type to its TypeScript equivalent.
|
|
18
|
+
* @param type - The schema type(s) to resolve
|
|
19
|
+
* @returns The TypeScript type string
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolvePrimitiveType(type: SchemaType | SchemaType[]): string;
|
|
22
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/utils/schemas.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAWhE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,OAAO,CAKpE;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,MAAM,CAiB5E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { JSDocableNode, Project, SourceFile } from 'ts-morph';
|
|
2
|
+
import { ModelInfo } from '../model';
|
|
3
|
+
/**
|
|
4
|
+
* Generates the file path for a model file.
|
|
5
|
+
* @param modelInfo - The model information
|
|
6
|
+
* @returns The full file path for the model
|
|
7
|
+
*/
|
|
8
|
+
export declare function getModelFileName(modelInfo: ModelInfo): string;
|
|
9
|
+
/**
|
|
10
|
+
* Gets or creates a source file in the project.
|
|
11
|
+
* @param project - The ts-morph project
|
|
12
|
+
* @param outputDir - The output directory
|
|
13
|
+
* @param filePath - The relative file path
|
|
14
|
+
* @returns The source file
|
|
15
|
+
*/
|
|
16
|
+
export declare function getOrCreateSourceFile(project: Project, outputDir: string, filePath: string): SourceFile;
|
|
17
|
+
/**
|
|
18
|
+
* Adds named imports to a source file.
|
|
19
|
+
* @param sourceFile - The source file to modify
|
|
20
|
+
* @param moduleSpecifier - The module to import from
|
|
21
|
+
* @param namedImports - Array of named imports to add
|
|
22
|
+
*/
|
|
23
|
+
export declare function addImport(sourceFile: SourceFile, moduleSpecifier: string, namedImports: string[]): void;
|
|
24
|
+
/**
|
|
25
|
+
* Adds an import for a referenced model.
|
|
26
|
+
* @param sourceFile - The source file to modify
|
|
27
|
+
* @param outputDir - The output directory
|
|
28
|
+
* @param refModelInfo - The referenced model information
|
|
29
|
+
*/
|
|
30
|
+
export declare function addImportRefModel(sourceFile: SourceFile, outputDir: string, refModelInfo: ModelInfo): void;
|
|
31
|
+
/**
|
|
32
|
+
* Adds an import for a model if it's in a different path.
|
|
33
|
+
* @param modelInfo - The current model information
|
|
34
|
+
* @param sourceFile - The source file to modify
|
|
35
|
+
* @param outputDir - The output directory
|
|
36
|
+
* @param refModelInfo - The referenced model information
|
|
37
|
+
*/
|
|
38
|
+
export declare function addImportModelInfo(modelInfo: ModelInfo, sourceFile: SourceFile, outputDir: string, refModelInfo: ModelInfo): void;
|
|
39
|
+
/**
|
|
40
|
+
* Generates a JSDoc comment string from a title and description.
|
|
41
|
+
* @param title - The title for the JSDoc comment
|
|
42
|
+
* @param description - The description for the JSDoc comment
|
|
43
|
+
* @returns The formatted JSDoc string or undefined if both title and description are empty
|
|
44
|
+
*/
|
|
45
|
+
export declare function jsDoc(title?: string, description?: string): string | undefined;
|
|
46
|
+
export declare function jsDocs(title?: string, description?: string): string[];
|
|
47
|
+
/**
|
|
48
|
+
* Adds a JSDoc comment to a node with the provided title and description.
|
|
49
|
+
* @param node - The node to add the JSDoc comment to
|
|
50
|
+
* @param title - The title for the JSDoc comment
|
|
51
|
+
* @param description - The description for the JSDoc comment
|
|
52
|
+
*/
|
|
53
|
+
export declare function addJSDoc(node: JSDocableNode, title?: string, description?: string): void;
|
|
54
|
+
//# sourceMappingURL=sourceFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceFiles.d.ts","sourceRoot":"","sources":["../../src/utils/sourceFiles.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,UAAU,CASZ;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EAAE,QAsBvB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,SAAS,QAYxB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,SAAS,QAMxB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CACnB,KAAK,CAAC,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,GAAG,SAAS,CAKpB;AAED,wBAAgB,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,EACnB,KAAK,CAAC,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,QASrB"}
|