ts-openapi-codegen 2.1.0-beta.5 → 2.1.0-beta.7
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 +3 -0
- package/README.rus.md +3 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiff.cli.test.js +9 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffRenameAndInvalidRegex.test.js +9 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffTypeCoercion.test.js +9 -0
- package/dist/cli/analyzeUsage/analyzeUsage.d.ts +4 -0
- package/dist/cli/analyzeUsage/analyzeUsage.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/analyzeUsage.js +62 -0
- package/dist/cli/analyzeUsage/core/Analyzer.d.ts +9 -0
- package/dist/cli/analyzeUsage/core/Analyzer.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/core/Analyzer.js +29 -0
- package/dist/cli/analyzeUsage/core/ProjectContext.d.ts +10 -0
- package/dist/cli/analyzeUsage/core/ProjectContext.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/core/ProjectContext.js +63 -0
- package/dist/cli/analyzeUsage/core/Scanner.d.ts +15 -0
- package/dist/cli/analyzeUsage/core/Scanner.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/core/Scanner.js +115 -0
- package/dist/cli/analyzeUsage/rules/ClientRule.d.ts +6 -0
- package/dist/cli/analyzeUsage/rules/ClientRule.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/rules/ClientRule.js +78 -0
- package/dist/cli/analyzeUsage/rules/CoverageRule.d.ts +7 -0
- package/dist/cli/analyzeUsage/rules/CoverageRule.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/rules/CoverageRule.js +63 -0
- package/dist/cli/analyzeUsage/rules/DiagnosticsRule.d.ts +6 -0
- package/dist/cli/analyzeUsage/rules/DiagnosticsRule.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/rules/DiagnosticsRule.js +60 -0
- package/dist/cli/analyzeUsage/rules/ImportRule.d.ts +6 -0
- package/dist/cli/analyzeUsage/rules/ImportRule.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/rules/ImportRule.js +52 -0
- package/dist/cli/analyzeUsage/rules/ModelRule.d.ts +6 -0
- package/dist/cli/analyzeUsage/rules/ModelRule.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/rules/ModelRule.js +38 -0
- package/dist/cli/analyzeUsage/rules/SchemaRule.d.ts +6 -0
- package/dist/cli/analyzeUsage/rules/SchemaRule.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/rules/SchemaRule.js +48 -0
- package/dist/cli/analyzeUsage/rules/ServiceRule.d.ts +7 -0
- package/dist/cli/analyzeUsage/rules/ServiceRule.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/rules/ServiceRule.js +92 -0
- package/dist/cli/analyzeUsage/types.d.ts +52 -0
- package/dist/cli/analyzeUsage/types.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/types.js +2 -0
- package/dist/cli/analyzeUsage/utils/fuzzy.d.ts +5 -0
- package/dist/cli/analyzeUsage/utils/fuzzy.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/utils/fuzzy.js +38 -0
- package/dist/cli/analyzeUsage/utils/report.d.ts +16 -0
- package/dist/cli/analyzeUsage/utils/report.d.ts.map +1 -0
- package/dist/cli/analyzeUsage/utils/report.js +85 -0
- package/dist/cli/checkAndUpdateConfig/__tests__/checkConfig.test.d.ts +2 -0
- package/dist/cli/checkAndUpdateConfig/__tests__/checkConfig.test.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/__tests__/checkConfig.test.js +53 -0
- package/dist/cli/checkAndUpdateConfig/__tests__/updateConfig.test.d.ts +2 -0
- package/dist/cli/checkAndUpdateConfig/__tests__/updateConfig.test.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/__tests__/updateConfig.test.js +52 -0
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts +2 -1
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/checkConfig.js +8 -4
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts +2 -1
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/updateConfig.js +6 -3
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/prepareConfigData.test.d.ts +2 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/prepareConfigData.test.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/prepareConfigData.test.js +20 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/removeDefaultConfigValues.test.d.ts +2 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/removeDefaultConfigValues.test.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/removeDefaultConfigValues.test.js +35 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/validateAndMigrateConfigData.test.d.ts +2 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/validateAndMigrateConfigData.test.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/__tests__/validateAndMigrateConfigData.test.js +59 -0
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.js +19 -1
- package/dist/cli/generateOpenApiClient/__tests__/generateOpenApiClient.strict.test.js +18 -9
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts +2 -5
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -1
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.js +12 -16
- package/dist/cli/index.js +41 -7
- package/dist/cli/initOpenApiConfig/__tests__/init.test.d.ts +2 -0
- package/dist/cli/initOpenApiConfig/__tests__/init.test.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/__tests__/init.test.js +20 -0
- package/dist/cli/initOpenApiConfig/__tests__/initConfig.test.d.ts +2 -0
- package/dist/cli/initOpenApiConfig/__tests__/initConfig.test.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/__tests__/initConfig.test.js +49 -0
- package/dist/cli/initOpenApiConfig/init.d.ts +2 -1
- package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/init.js +3 -1
- package/dist/cli/initOpenApiConfig/utils/__tests__/buildConfig.test.d.ts +2 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/buildConfig.test.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/buildConfig.test.js +99 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/findSpecFiles.test.d.ts +2 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/findSpecFiles.test.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/findSpecFiles.test.js +45 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/validateSpecFiles.test.d.ts +2 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/validateSpecFiles.test.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/__tests__/validateSpecFiles.test.js +61 -0
- package/dist/cli/previewChanges/previewChanges.d.ts +2 -1
- package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -1
- package/dist/cli/previewChanges/previewChanges.js +6 -6
- package/dist/cli/previewChanges/utils/__tests__/compareFiles.test.d.ts +2 -0
- package/dist/cli/previewChanges/utils/__tests__/compareFiles.test.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/__tests__/compareFiles.test.js +52 -0
- package/dist/cli/previewChanges/utils/__tests__/isDirectoryEmpty.test.d.ts +2 -0
- package/dist/cli/previewChanges/utils/__tests__/isDirectoryEmpty.test.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/__tests__/isDirectoryEmpty.test.js +43 -0
- package/dist/cli/previewChanges/utils/__tests__/readDirectoryRecursive.test.d.ts +2 -0
- package/dist/cli/previewChanges/utils/__tests__/readDirectoryRecursive.test.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/__tests__/readDirectoryRecursive.test.js +32 -0
- package/dist/cli/previewChanges/utils/__tests__/updateOutputPaths.test.d.ts +2 -0
- package/dist/cli/previewChanges/utils/__tests__/updateOutputPaths.test.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/__tests__/updateOutputPaths.test.js +68 -0
- package/dist/cli/schemas/__tests__/checkConfigAndUpdate.test.d.ts +2 -0
- package/dist/cli/schemas/__tests__/checkConfigAndUpdate.test.d.ts.map +1 -0
- package/dist/cli/schemas/__tests__/checkConfigAndUpdate.test.js +36 -0
- package/dist/cli/schemas/__tests__/generateOptionsSchema.test.d.ts +2 -0
- package/dist/cli/schemas/__tests__/generateOptionsSchema.test.d.ts.map +1 -0
- package/dist/cli/schemas/__tests__/generateOptionsSchema.test.js +59 -0
- package/dist/cli/schemas/__tests__/initOptionsSchema.test.d.ts +2 -0
- package/dist/cli/schemas/__tests__/initOptionsSchema.test.d.ts.map +1 -0
- package/dist/cli/schemas/__tests__/initOptionsSchema.test.js +43 -0
- package/dist/cli/schemas/__tests__/previewChangesSchema.test.d.ts +2 -0
- package/dist/cli/schemas/__tests__/previewChangesSchema.test.d.ts.map +1 -0
- package/dist/cli/schemas/__tests__/previewChangesSchema.test.js +31 -0
- package/dist/cli/schemas/analyzeUsage.d.ts +13 -0
- package/dist/cli/schemas/analyzeUsage.d.ts.map +1 -0
- package/dist/cli/schemas/analyzeUsage.js +38 -0
- package/dist/cli/schemas/generate.d.ts +7 -0
- package/dist/cli/schemas/generate.d.ts.map +1 -1
- package/dist/cli/schemas/generate.js +4 -0
- package/dist/cli/schemas/index.d.ts +2 -2
- package/dist/cli/schemas/index.d.ts.map +1 -1
- package/dist/cli/schemas/index.js +1 -1
- package/dist/cli/types.d.ts +6 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/common/Consts.d.ts +1 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +6 -1
- package/dist/common/Logger.js +2 -2
- package/dist/common/LoggerMessages.d.ts +59 -12
- package/dist/common/LoggerMessages.d.ts.map +1 -1
- package/dist/common/LoggerMessages.js +62 -15
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.d.ts +7 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.js +5 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +14 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +6 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +1 -1
- package/dist/core/OpenApiClient.d.ts +12 -1
- package/dist/core/OpenApiClient.d.ts.map +1 -1
- package/dist/core/OpenApiClient.js +192 -10
- package/dist/core/WriteClient.d.ts +11 -0
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +23 -2
- package/dist/core/plugins/getBuiltinPlugins.d.ts.map +1 -1
- package/dist/core/plugins/loadGeneratorPlugins.d.ts.map +1 -1
- package/dist/core/plugins/loadGeneratorPlugins.js +1 -1
- package/dist/core/types/shared/Client.model.d.ts +1 -1
- package/dist/core/types/shared/Client.model.d.ts.map +1 -1
- package/dist/core/types/shared/Model.model.d.ts +1 -1
- package/dist/core/types/shared/Model.model.d.ts.map +1 -1
- package/dist/core/utils/GenerationCache.d.ts +18 -0
- package/dist/core/utils/GenerationCache.d.ts.map +1 -0
- package/dist/core/utils/GenerationCache.js +41 -0
- package/dist/core/utils/__tests__/GenerationCache.test.d.ts +2 -0
- package/dist/core/utils/__tests__/GenerationCache.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/GenerationCache.test.js +37 -0
- package/dist/core/utils/__tests__/loadDiffReport.test.d.ts +2 -0
- package/dist/core/utils/__tests__/loadDiffReport.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/loadDiffReport.test.js +97 -0
- package/dist/core/utils/__tests__/prepareDtoModels.test.js +95 -0
- package/dist/core/utils/__tests__/templateRendering.test.d.ts +2 -0
- package/dist/core/utils/__tests__/templateRendering.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/templateRendering.test.js +119 -0
- package/dist/core/utils/__tests__/writeFileIfChanged.test.d.ts +2 -0
- package/dist/core/utils/__tests__/writeFileIfChanged.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/writeFileIfChanged.test.js +30 -0
- package/dist/core/utils/loadDiffReport.d.ts.map +1 -1
- package/dist/core/utils/loadDiffReport.js +5 -4
- package/dist/core/utils/precompileTemplates.js +3 -2
- package/dist/core/utils/prepareDtoModels.d.ts.map +1 -1
- package/dist/core/utils/prepareDtoModels.js +1 -7
- package/dist/core/utils/writeClientCore.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.js +18 -16
- package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientCoreIndex.js +14 -4
- package/dist/core/utils/writeClientExecutor.d.ts.map +1 -1
- package/dist/core/utils/writeClientExecutor.js +4 -4
- package/dist/core/utils/writeClientFullIndex.js +4 -4
- package/dist/core/utils/writeClientModels.d.ts.map +1 -1
- package/dist/core/utils/writeClientModels.js +10 -10
- package/dist/core/utils/writeClientModelsIndex.d.ts +1 -1
- package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientModelsIndex.js +14 -4
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +7 -7
- package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemasIndex.js +14 -4
- package/dist/core/utils/writeClientServices.d.ts.map +1 -1
- package/dist/core/utils/writeClientServices.js +6 -6
- package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientServicesIndex.js +14 -4
- package/dist/core/utils/writeClientSimpleIndex.js +4 -4
- package/dist/core/utils/writeFileIfChanged.d.ts +3 -0
- package/dist/core/utils/writeFileIfChanged.d.ts.map +1 -0
- package/dist/core/utils/writeFileIfChanged.js +22 -0
- package/dist/test/helpers/silenceLoggers.d.ts +11 -0
- package/dist/test/helpers/silenceLoggers.d.ts.map +1 -0
- package/dist/test/helpers/silenceLoggers.js +88 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerMessages.d.ts","sourceRoot":"","sources":["../../src/common/LoggerMessages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAWrB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAqBzE,CAAC;AAEF,eAAO,MAAM,eAAe;;kCAGH,MAAM;;oDAEY,MAAM;2CACf,MAAM,YAAY,MAAM
|
|
1
|
+
{"version":3,"file":"LoggerMessages.d.ts","sourceRoot":"","sources":["../../src/common/LoggerMessages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAWrB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAqBzE,CAAC;AAEF,eAAO,MAAM,eAAe;;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MAAM;0CAGG;YAAE,cAAc,EAAE;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAC;gBAAC,UAAU,EAAE,MAAM,CAAC;gBAAC,OAAO,EAAE,MAAM,EAAE,CAAA;aAAE,CAAA;SAAE;sCAEjG;YAAE,UAAU,EAAE;gBAAE,OAAO,EAAE;oBAAE,MAAM,EAAE,MAAM,CAAC;oBAAC,QAAQ,EAAE,MAAM,CAAC;oBAAC,IAAI,EAAE,MAAM,CAAA;iBAAE,CAAA;aAAE,CAAA;SAAE;iDAEpE,MAAM;;0CAEb,MAAM;4CACJ,MAAM;qCACb,MAAM;yCACF,MAAM;iDACE,MAAM;yCACd;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE;0CAExE,MAAM;0CACN,MAAM;yCACP,MAAM;;;yCAIN,MAAM;qCACV,MAAM;qCACN,MAAM;2CACA,MAAM,WAAW,MAAM;;;;6CAKrB,MAAM;;;8CAIL,MAAM;2CACT,MAAM;gDACD,MAAM;mDACH,MAAM;;;;;;;;;iDASR,MAAM;4CACX,MAAM;;;8CAIJ,MAAM;;;;;;8DAUU,MAAM;;gDAEpB,MAAM,SAAS,MAAM;;2CAE1B,MAAM,SAAS,MAAM;4CACpB,MAAM;;CAE/B,CAAC"}
|
|
@@ -40,6 +40,12 @@ exports.LOGGER_MESSAGES = {
|
|
|
40
40
|
FINISHED_WITH_DURATION: (duration) => `Generation completed in ${duration} sec`,
|
|
41
41
|
DURATION_FOR_FILE: (file, duration) => `Duration for "${file}": ${duration} sec`,
|
|
42
42
|
NO_OPTIONS: 'No options provided for generation',
|
|
43
|
+
WRITE_STATS: (written, unchanged) => `[openapi-codegen] Write stats: written=${written}, unchanged=${unchanged}`,
|
|
44
|
+
CACHE_SHARED_OUTPUT_WARNING: (outputs) => `[openapi-codegen] Cache is disabled and multiple items write to the same output directories:\n${outputs}\n` +
|
|
45
|
+
'This can overwrite previously generated files in the final output. Consider enabling cache via "cache: true" or "--cache".',
|
|
46
|
+
CACHE_HIT: (input) => `[openapi-codegen] Cache hit: ${input}`,
|
|
47
|
+
CACHE_MISS: (input) => `[openapi-codegen] Cache miss: ${input}`,
|
|
48
|
+
STRICT_REPORT_CREATED: (reportPath) => `Strict OpenAPI report created: ${reportPath}`,
|
|
43
49
|
},
|
|
44
50
|
// ========== OpenAPI Specification Messages ==========
|
|
45
51
|
OPENAPI: {
|
|
@@ -81,6 +87,7 @@ exports.LOGGER_MESSAGES = {
|
|
|
81
87
|
PREFIX: 'Error:',
|
|
82
88
|
GENERIC: (message) => message,
|
|
83
89
|
WITH_DETAILS: (message, details) => `${message}: ${details}`,
|
|
90
|
+
TECHNICAL_DETAILS: (error) => `Technical details: ${error}`,
|
|
84
91
|
},
|
|
85
92
|
// ========== Separator ==========
|
|
86
93
|
SEPARATOR: '==========================================',
|
|
@@ -113,21 +120,20 @@ exports.LOGGER_MESSAGES = {
|
|
|
113
120
|
CLEANUP_PREVIEW_DIR: (dir) => `Cleaning up preview directory: ${dir}`,
|
|
114
121
|
CLEANUP_PREVIEW_FAILED: (error) => `Failed to cleanup preview directory: ${error}`,
|
|
115
122
|
},
|
|
116
|
-
// ========== Migration Messages ==========
|
|
117
|
-
MIGRATION: {
|
|
118
|
-
OPENAPI_SCHEMA_MIGRATED: 'To perform OpenAPI generation, it was necessary to migrate the schema of your data to the current one. To update the configuration in the file, use the command `npm openapi-codegen-cli update-config`',
|
|
119
|
-
},
|
|
120
|
-
// ========== Formatting Messages ==========
|
|
121
|
-
FORMATTING: {
|
|
122
|
-
PRETTIER_PROJECT_CONFIG_RESOLVED: (filePath) => `Prettier config resolved from: ${filePath}`,
|
|
123
|
-
PRETTIER_PROJECT_CONFIG_NOT_FOUND: 'No project Prettier config found, falling back to built-in options',
|
|
124
|
-
PRETTIER_FORMAT_FAILED: (file, error) => `Prettier formatting failed for "${file}": ${error}`,
|
|
125
|
-
ESLINT_NOT_INSTALLED: 'ESLint is not installed in this project. Skipping --useEslintFix.',
|
|
126
|
-
ESLINT_FIX_FAILED: (file, error) => `ESLint fix failed for "${file}": ${error}`,
|
|
127
|
-
ESLINT_FIX_APPLIED: (file) => `ESLint fix applied: ${file}`,
|
|
128
|
-
},
|
|
129
|
-
// ========== Analyze Diff Messages ==========
|
|
130
123
|
ANALYZE_DIFF: {
|
|
124
|
+
INPUT_REQUIRED: '"--input" option is required for analyze-diff command',
|
|
125
|
+
HISTORY_SKIPPED: 'History analysis skipped: no base spec provided (use --compare-with or --git)',
|
|
126
|
+
ANALYZING: '\n[openapi-codegen] Analyzing OpenAPI changes...',
|
|
127
|
+
SUMMARY_TITLE: '[openapi-codegen] Analyze-diff summary',
|
|
128
|
+
BASE: (base) => `Base: ${base}`,
|
|
129
|
+
TARGET: (target) => `Target: ${target}`,
|
|
130
|
+
STABILITY_SCORE: (score) => `Stability score: ${score}%`,
|
|
131
|
+
CHANGES: (total, added, removed, changed) => `Changes: total=${total}, added=${added}, removed=${removed}, changed=${changed}`,
|
|
132
|
+
BREAKING_COUNT: (count) => `[openapi-codegen] BREAKING: ${count} item(s)`,
|
|
133
|
+
WARNING_COUNT: (count) => `[openapi-codegen] WARNINGS: ${count} item(s)`,
|
|
134
|
+
IGNORED_COUNT: (count) => `[openapi-codegen] IGNORED: ${count} item(s) by config rules`,
|
|
135
|
+
REPORT_WRITTEN: (reportPath) => `[openapi-codegen] Report written to: ${reportPath}`,
|
|
136
|
+
INVALID_IGNORE_PATTERN: (pattern, error) => `[openapi-codegen] Invalid ignore pattern: ${pattern} — ${error}`,
|
|
131
137
|
STARTED: (newSpec, baseSource) => `Starting analyze-diff: input=${newSpec}, base=${baseSource}`,
|
|
132
138
|
SKIPPED_NO_BASE: 'History analysis skipped: no base spec provided (use --compare-with or --git).',
|
|
133
139
|
VALIDATION_ERROR: (message) => `Analyze-diff options validation failed: ${message}`,
|
|
@@ -144,7 +150,6 @@ exports.LOGGER_MESSAGES = {
|
|
|
144
150
|
CI_FAILURE: 'CI mode failed because governance errors were found.',
|
|
145
151
|
IGNORED_CHANGES: (count) => `[openapi-codegen] IGNORED: ${count} semantic change(s) filtered by analyze.ignore`,
|
|
146
152
|
EXECUTION_ERROR: (message) => `Analyze-diff execution failed: ${message}`,
|
|
147
|
-
INVALID_IGNORE_PATTERN: (pattern, error) => `[openapi-codegen] Invalid ignore pattern: ${pattern} — ${error}`,
|
|
148
153
|
LEGACY_BASE: (base) => `Base: ${base}`,
|
|
149
154
|
LEGACY_TARGET: (target) => `Target: ${target}`,
|
|
150
155
|
LEGACY_STABILITY_SCORE: (score) => `Stability score: ${score}%`,
|
|
@@ -153,4 +158,46 @@ exports.LOGGER_MESSAGES = {
|
|
|
153
158
|
LEGACY_WARNINGS: (count) => `[openapi-codegen] WARNINGS: ${count} item(s)`,
|
|
154
159
|
LEGACY_IGNORED: (count) => `[openapi-codegen] IGNORED: ${count} item(s) by config rules`,
|
|
155
160
|
},
|
|
161
|
+
DIFF_REPORT: {
|
|
162
|
+
NOT_FOUND: (reportPath) => `[openapi-codegen] Diff report not found at "${reportPath}". Skipping history annotations.`,
|
|
163
|
+
STALE: (reportPath) => `[openapi-codegen] Diff report "${reportPath}" is older than the input spec. Skipping history annotations.`,
|
|
164
|
+
EMPTY: (reportPath) => `[openapi-codegen] Diff report "${reportPath}" has no entries. Skipping history annotations.`,
|
|
165
|
+
READ_FAILED: (reportPath, message) => `[openapi-codegen] Failed to read diff report "${reportPath}": ${message}`,
|
|
166
|
+
},
|
|
167
|
+
TEMPLATES: {
|
|
168
|
+
PRECOMPILE_SUCCESS: 'The templates have been successfully precompiled and saved!',
|
|
169
|
+
PRECOMPILE_ERROR: (message) => `Error during pre-compilation of templates: ${message}`,
|
|
170
|
+
},
|
|
171
|
+
WRITE_CLIENT: {
|
|
172
|
+
DATA_WRITE_START: (filePath) => `The recording of the file data begins: ${filePath}`,
|
|
173
|
+
FILE_RECORDED: (filePath) => `File recording completed: ${filePath}`,
|
|
174
|
+
INDEX_DATA_WRITTEN: (filePath) => `Data has been written to a file: ${filePath}`,
|
|
175
|
+
INDEX_WRITE_COMPLETED: (filePath) => `Writing to the file is completed: ${filePath}`,
|
|
176
|
+
CORE_START: 'The recording of the kernel files begins',
|
|
177
|
+
CORE_FINISH: 'The writing of the kernel files has been completed successfully',
|
|
178
|
+
MODELS_START: 'Recording of model files begins',
|
|
179
|
+
MODELS_FINISH: 'Model file recording completed successfully',
|
|
180
|
+
SERVICES_START: 'Recording of service files begins',
|
|
181
|
+
SERVICES_FINISH: 'Service file recording completed successfully',
|
|
182
|
+
SCHEMAS_START: 'The recording of model validation schema files begins.',
|
|
183
|
+
SCHEMAS_FINISH: 'The recording of model validation schema files has been completed successfully',
|
|
184
|
+
DIRECTORY_CREATING: (directory) => `A directory is being created: ${directory}`,
|
|
185
|
+
EXECUTOR_START: (filePath) => `The recording of the file data begins: ${filePath}`,
|
|
186
|
+
},
|
|
187
|
+
LOGGER: {
|
|
188
|
+
NEXT_STEPS: (recommendation) => `What you can do next: ${recommendation}`,
|
|
189
|
+
},
|
|
190
|
+
// ========== Migration Messages ==========
|
|
191
|
+
MIGRATION: {
|
|
192
|
+
OPENAPI_SCHEMA_MIGRATED: 'To perform OpenAPI generation, it was necessary to migrate the schema of your data to the current one. To update the configuration in the file, use the command `npm openapi-codegen-cli update-config`',
|
|
193
|
+
},
|
|
194
|
+
// ========== Formatting Messages ==========
|
|
195
|
+
FORMATTING: {
|
|
196
|
+
PRETTIER_PROJECT_CONFIG_RESOLVED: (filePath) => `Prettier config resolved from: ${filePath}`,
|
|
197
|
+
PRETTIER_PROJECT_CONFIG_NOT_FOUND: 'No project Prettier config found, falling back to built-in options',
|
|
198
|
+
PRETTIER_FORMAT_FAILED: (file, error) => `Prettier formatting failed for "${file}": ${error}`,
|
|
199
|
+
ESLINT_NOT_INSTALLED: 'ESLint is not installed in this project. Skipping --useEslintFix.',
|
|
200
|
+
ESLINT_FIX_FAILED: (file, error) => `ESLint fix failed for "${file}": ${error}`,
|
|
201
|
+
ESLINT_FIX_APPLIED: (file) => `ESLint fix applied: ${file}`,
|
|
202
|
+
},
|
|
156
203
|
};
|
|
@@ -73,6 +73,13 @@ export declare const unifiedOptionsSchemaV5: z.ZodObject<{
|
|
|
73
73
|
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
74
74
|
useProjectPrettier: z.ZodOptional<z.ZodBoolean>;
|
|
75
75
|
useEslintFix: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
cachePath: z.ZodOptional<z.ZodString>;
|
|
78
|
+
cacheStrategy: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
content: "content";
|
|
80
|
+
entity: "entity";
|
|
81
|
+
}>>;
|
|
82
|
+
cacheDebug: z.ZodOptional<z.ZodBoolean>;
|
|
76
83
|
strictOpenapi: z.ZodOptional<z.ZodBoolean>;
|
|
77
84
|
reportFile: z.ZodOptional<z.ZodString>;
|
|
78
85
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnifiedOptionsSchemaV5.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"UnifiedOptionsSchemaV5.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQjC,CAAC"}
|
|
@@ -8,6 +8,10 @@ exports.unifiedOptionsSchemaV5 = UnifiedOptionsSchemaV4_1.unifiedOptionsSchemaV4
|
|
|
8
8
|
...CommonSchemas_1.strictModeParametersSchema.shape,
|
|
9
9
|
useProjectPrettier: zod_1.z.boolean().optional(),
|
|
10
10
|
useEslintFix: zod_1.z.boolean().optional(),
|
|
11
|
+
cache: zod_1.z.boolean().optional(),
|
|
12
|
+
cachePath: zod_1.z.string().optional(),
|
|
13
|
+
cacheStrategy: zod_1.z.enum(['content', 'entity']).optional(),
|
|
14
|
+
cacheDebug: zod_1.z.boolean().optional(),
|
|
11
15
|
});
|
|
12
16
|
/*
|
|
13
17
|
type TUnifiedV5 = TUnifiedV4 & {
|
|
@@ -16,4 +20,4 @@ type TUnifiedV5 = TUnifiedV4 & {
|
|
|
16
20
|
useProjectPrettier: boolean | undefined;
|
|
17
21
|
useEslintFix: boolean | undefined;
|
|
18
22
|
}
|
|
19
|
-
*/
|
|
23
|
+
*/
|
|
@@ -293,6 +293,13 @@ declare const unifiedSchemaDefinitions: readonly [{
|
|
|
293
293
|
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
294
294
|
useProjectPrettier: z.ZodOptional<z.ZodBoolean>;
|
|
295
295
|
useEslintFix: z.ZodOptional<z.ZodBoolean>;
|
|
296
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
297
|
+
cachePath: z.ZodOptional<z.ZodString>;
|
|
298
|
+
cacheStrategy: z.ZodOptional<z.ZodEnum<{
|
|
299
|
+
content: "content";
|
|
300
|
+
entity: "entity";
|
|
301
|
+
}>>;
|
|
302
|
+
cacheDebug: z.ZodOptional<z.ZodBoolean>;
|
|
296
303
|
strictOpenapi: z.ZodOptional<z.ZodBoolean>;
|
|
297
304
|
reportFile: z.ZodOptional<z.ZodString>;
|
|
298
305
|
}, z.core.$strip>;
|
|
@@ -356,6 +363,13 @@ export declare const flatOptionsSchema: z.ZodObject<{
|
|
|
356
363
|
}, z.core.$strip>>;
|
|
357
364
|
useProjectPrettier: z.ZodOptional<z.ZodBoolean>;
|
|
358
365
|
useEslintFix: z.ZodOptional<z.ZodBoolean>;
|
|
366
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
367
|
+
cachePath: z.ZodOptional<z.ZodString>;
|
|
368
|
+
cacheStrategy: z.ZodOptional<z.ZodEnum<{
|
|
369
|
+
content: "content";
|
|
370
|
+
entity: "entity";
|
|
371
|
+
}>>;
|
|
372
|
+
cacheDebug: z.ZodOptional<z.ZodBoolean>;
|
|
359
373
|
input: z.ZodString;
|
|
360
374
|
output: z.ZodString;
|
|
361
375
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnifiedVersionedSchemas.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAS3C,KAAK,IAAI,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS,SAAS,CAAC,GAAG,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE/F,QAAA,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"UnifiedVersionedSchemas.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAS3C,KAAK,IAAI,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS,SAAS,CAAC,GAAG,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC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AAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"compatibilityCases.d.ts","sourceRoot":"","sources":["../../../../../src/common/VersionedSchema/Utils/__mocks__/compatibilityCases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,EAuHjD,CAAC"}
|
|
@@ -118,7 +118,12 @@ exports.compatibilityCases = [
|
|
|
118
118
|
from: 'v4',
|
|
119
119
|
to: 'v5',
|
|
120
120
|
expect: [
|
|
121
|
-
{ type: 'added', key: 'useProjectPrettier' },
|
|
121
|
+
{ type: 'added', key: 'useProjectPrettier' },
|
|
122
|
+
{ type: 'added', key: 'useEslintFix' },
|
|
123
|
+
{ type: 'added', key: 'cache' },
|
|
124
|
+
{ type: 'added', key: 'cachePath' },
|
|
125
|
+
{ type: 'added', key: 'cacheStrategy' },
|
|
126
|
+
{ type: 'added', key: 'cacheDebug' },
|
|
122
127
|
],
|
|
123
128
|
},
|
|
124
129
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateDataToLatestSchemaVersion.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"migrateDataToLatestSchemaVersion.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AASpF;;GAEG;AACH,KAAK,oBAAoB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,cAAc,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;IAChF,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC;IAClD,aAAa,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,KAAK,qBAAqB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,cAAc,EAAE,kBAAkB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,oBAAoB,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,EAAE,oBAAoB,GAAG,qBAAqB,GAAG,IAAI,CAkFlK"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateDataToLatestSchemaVersion = migrateDataToLatestSchemaVersion;
|
|
4
4
|
const Consts_1 = require("../../Consts");
|
|
5
|
-
const LoggerMessages_1 = require("../../LoggerMessages");
|
|
6
5
|
const Enums_1 = require("../../Enums");
|
|
6
|
+
const LoggerMessages_1 = require("../../LoggerMessages");
|
|
7
7
|
const validateZodOptions_1 = require("../../Validation/validateZodOptions");
|
|
8
8
|
const determineBestMatchingSchemaVersion_1 = require("./determineBestMatchingSchemaVersion");
|
|
9
9
|
const generateKeyMappingForInvalidKeys_1 = require("./generateKeyMappingForInvalidKeys");
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { TRawOptions } from '../common/TRawOptions';
|
|
2
2
|
import { WriteClient } from './WriteClient';
|
|
3
3
|
export declare class OpenApiClient {
|
|
4
|
+
private static readonly CACHE_FINGERPRINT_VERSION;
|
|
5
|
+
private static readonly DEFAULT_CACHE_FILENAME;
|
|
4
6
|
private _writeClient;
|
|
5
7
|
get writeClient(): WriteClient;
|
|
6
8
|
private normalizeOptions;
|
|
7
9
|
private addDefaultValues;
|
|
8
|
-
private
|
|
10
|
+
private getOutputRoots;
|
|
11
|
+
private cleanupStaleOutputs;
|
|
12
|
+
private removeStaleFilesInDirectory;
|
|
9
13
|
private generateCodeForItems;
|
|
14
|
+
private getUniqueResolvedOutputs;
|
|
15
|
+
private resolveOutputRoot;
|
|
16
|
+
private resolveCachePathForOutput;
|
|
17
|
+
private warnOnSharedOutputsWithoutCache;
|
|
10
18
|
private generateSingle;
|
|
19
|
+
private getCacheKey;
|
|
20
|
+
private getCacheFingerprint;
|
|
21
|
+
private filesExist;
|
|
11
22
|
private loadDiffReportIfNeeded;
|
|
12
23
|
private applyDiffReportIfNeeded;
|
|
13
24
|
generate(rawOptions: TRawOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenApiClient.d.ts","sourceRoot":"","sources":["../../src/core/OpenApiClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenApiClient.d.ts","sourceRoot":"","sources":["../../src/core/OpenApiClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AAyBtF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,qBAAa,aAAa;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAAK;IACtD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAAiC;IAC/E,OAAO,CAAC,YAAY,CAA4B;IAEhD,IAAW,WAAW,gBAKrB;IAED,OAAO,CAAC,gBAAgB;IAgFxB,OAAO,CAAC,gBAAgB;IA4CxB,OAAO,CAAC,cAAc;YAaR,mBAAmB;YASnB,2BAA2B;YA+B3B,oBAAoB;IA2DlC,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,+BAA+B;YAiBzB,cAAc;IA0L5B,OAAO,CAAC,WAAW;YAaL,mBAAmB;YAiCnB,UAAU;YAUV,sBAAsB;IASpC,OAAO,CAAC,uBAAuB;IAczB,QAAQ,CAAC,UAAU,EAAE,WAAW;CAWzC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpenApiClient = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
4
5
|
const Consts_1 = require("../common/Consts");
|
|
5
6
|
const Logger_1 = require("../common/Logger");
|
|
6
7
|
const LoggerMessages_1 = require("../common/LoggerMessages");
|
|
@@ -16,6 +17,7 @@ const EmptySchemaStrategy_enum_1 = require("./types/enums/EmptySchemaStrategy.en
|
|
|
16
17
|
const ModelsMode_enum_1 = require("./types/enums/ModelsMode.enum");
|
|
17
18
|
const ValidationLibrary_enum_1 = require("./types/enums/ValidationLibrary.enum");
|
|
18
19
|
const applyDiffReportToClient_1 = require("./utils/applyDiffReportToClient");
|
|
20
|
+
const GenerationCache_1 = require("./utils/GenerationCache");
|
|
19
21
|
const getOpenApiSpec_1 = require("./utils/getOpenApiSpec");
|
|
20
22
|
const getOpenApiVersion_1 = require("./utils/getOpenApiVersion");
|
|
21
23
|
const getOutputPaths_1 = require("./utils/getOutputPaths");
|
|
@@ -25,6 +27,8 @@ const prepareDtoModels_1 = require("./utils/prepareDtoModels");
|
|
|
25
27
|
const registerHandlebarTemplates_1 = require("./utils/registerHandlebarTemplates");
|
|
26
28
|
const WriteClient_1 = require("./WriteClient");
|
|
27
29
|
class OpenApiClient {
|
|
30
|
+
static CACHE_FINGERPRINT_VERSION = 1;
|
|
31
|
+
static DEFAULT_CACHE_FILENAME = '.openapi-codegen-cache.json';
|
|
28
32
|
_writeClient = null;
|
|
29
33
|
get writeClient() {
|
|
30
34
|
if (!this._writeClient) {
|
|
@@ -64,6 +68,10 @@ class OpenApiClient {
|
|
|
64
68
|
strictOpenapi: rawOptions.strictOpenapi,
|
|
65
69
|
reportFile: rawOptions.reportFile,
|
|
66
70
|
governanceConfig: rawOptions.governanceConfig,
|
|
71
|
+
cache: rawOptions.cache,
|
|
72
|
+
cachePath: rawOptions.cachePath,
|
|
73
|
+
cacheStrategy: rawOptions.cacheStrategy,
|
|
74
|
+
cacheDebug: rawOptions.cacheDebug,
|
|
67
75
|
}));
|
|
68
76
|
}
|
|
69
77
|
else {
|
|
@@ -100,6 +108,10 @@ class OpenApiClient {
|
|
|
100
108
|
strictOpenapi: rawOptions.strictOpenapi,
|
|
101
109
|
reportFile: rawOptions.reportFile,
|
|
102
110
|
governanceConfig: rawOptions.governanceConfig,
|
|
111
|
+
cache: rawOptions.cache,
|
|
112
|
+
cachePath: rawOptions.cachePath,
|
|
113
|
+
cacheStrategy: rawOptions.cacheStrategy,
|
|
114
|
+
cacheDebug: rawOptions.cacheDebug,
|
|
103
115
|
},
|
|
104
116
|
];
|
|
105
117
|
}
|
|
@@ -141,15 +153,55 @@ class OpenApiClient {
|
|
|
141
153
|
useProjectPrettier: item.useProjectPrettier ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.useProjectPrettier,
|
|
142
154
|
useEslintFix: item.useEslintFix ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.useEslintFix,
|
|
143
155
|
governanceConfig: item.governanceConfig || Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.governanceConfig,
|
|
156
|
+
cache: item.cache ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.cache,
|
|
157
|
+
cachePath: item.cachePath || Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.cachePath,
|
|
158
|
+
cacheStrategy: item.cacheStrategy ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.cacheStrategy,
|
|
159
|
+
cacheDebug: item.cacheDebug ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.cacheDebug,
|
|
144
160
|
};
|
|
145
161
|
}
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
for (const
|
|
149
|
-
|
|
150
|
-
|
|
162
|
+
getOutputRoots(items) {
|
|
163
|
+
const roots = new Set();
|
|
164
|
+
for (const item of items) {
|
|
165
|
+
const outputDirs = [item.output, item.outputCore, item.outputSchemas, item.outputModels, item.outputServices];
|
|
166
|
+
for (const dir of outputDirs) {
|
|
167
|
+
if (dir) {
|
|
168
|
+
roots.add((0, pathHelpers_1.resolveHelper)(process.cwd(), dir));
|
|
169
|
+
}
|
|
151
170
|
}
|
|
152
171
|
}
|
|
172
|
+
return Array.from(roots);
|
|
173
|
+
}
|
|
174
|
+
async cleanupStaleOutputs(items) {
|
|
175
|
+
const outputRoots = this.getOutputRoots(items);
|
|
176
|
+
const expectedFiles = this.writeClient.getExpectedOutputFiles();
|
|
177
|
+
for (const root of outputRoots) {
|
|
178
|
+
await this.removeStaleFilesInDirectory(root, expectedFiles);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async removeStaleFilesInDirectory(path, expectedFiles) {
|
|
182
|
+
const stats = await fs_1.promises.stat(path).catch(() => null);
|
|
183
|
+
if (!stats) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
if (stats.isFile()) {
|
|
187
|
+
if (!expectedFiles.has(path)) {
|
|
188
|
+
await fileSystemHelpers_1.fileSystemHelpers.rmdir(path);
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
const entries = await fs_1.promises.readdir(path);
|
|
194
|
+
let hasAnyFile = false;
|
|
195
|
+
for (const entry of entries) {
|
|
196
|
+
const childPath = (0, pathHelpers_1.resolveHelper)(path, entry);
|
|
197
|
+
const childHasFiles = await this.removeStaleFilesInDirectory(childPath, expectedFiles);
|
|
198
|
+
hasAnyFile = hasAnyFile || childHasFiles;
|
|
199
|
+
}
|
|
200
|
+
if (!hasAnyFile) {
|
|
201
|
+
await fileSystemHelpers_1.fileSystemHelpers.rmdir(path);
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
return true;
|
|
153
205
|
}
|
|
154
206
|
async generateCodeForItems(items) {
|
|
155
207
|
if (items.length === 0) {
|
|
@@ -158,12 +210,27 @@ class OpenApiClient {
|
|
|
158
210
|
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.STARTED(items.length));
|
|
159
211
|
try {
|
|
160
212
|
const start = process.hrtime.bigint();
|
|
161
|
-
|
|
162
|
-
|
|
213
|
+
const cacheEnabled = items[0]?.cache === true;
|
|
214
|
+
const generationCaches = new Map();
|
|
215
|
+
if (!cacheEnabled) {
|
|
216
|
+
this.warnOnSharedOutputsWithoutCache(items);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
for (const outputRoot of this.getUniqueResolvedOutputs(items)) {
|
|
220
|
+
const sampleItem = items.find(item => this.resolveOutputRoot(item.output) === outputRoot);
|
|
221
|
+
if (!sampleItem) {
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const cachePath = this.resolveCachePathForOutput(sampleItem.output, sampleItem.cachePath);
|
|
225
|
+
const generationCache = new GenerationCache_1.GenerationCache(cachePath);
|
|
226
|
+
await generationCache.load();
|
|
227
|
+
generationCaches.set(outputRoot, generationCache);
|
|
228
|
+
}
|
|
163
229
|
}
|
|
164
230
|
for (const option of items) {
|
|
165
231
|
const fileStart = process.hrtime.bigint();
|
|
166
|
-
|
|
232
|
+
const generationCache = cacheEnabled ? generationCaches.get(this.resolveOutputRoot(option.output)) ?? null : null;
|
|
233
|
+
await this.generateSingle(option, generationCache);
|
|
167
234
|
const fileEnd = process.hrtime.bigint();
|
|
168
235
|
const fileDurationInSeconds = Number(fileEnd - fileStart) / 1e9;
|
|
169
236
|
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.DURATION_FOR_FILE(option.input, fileDurationInSeconds.toFixed(3)));
|
|
@@ -174,6 +241,14 @@ class OpenApiClient {
|
|
|
174
241
|
else {
|
|
175
242
|
await this.writeClient.combineAndWrite();
|
|
176
243
|
}
|
|
244
|
+
await this.cleanupStaleOutputs(items);
|
|
245
|
+
if (cacheEnabled) {
|
|
246
|
+
for (const generationCache of generationCaches.values()) {
|
|
247
|
+
await generationCache.save();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const writeStats = this.writeClient.getWriteStats();
|
|
251
|
+
this.writeClient.logger.info(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.WRITE_STATS(writeStats.written, writeStats.unchanged));
|
|
177
252
|
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.FINISHED);
|
|
178
253
|
const end = process.hrtime.bigint();
|
|
179
254
|
const durationInSeconds = Number(end - start) / 1e9;
|
|
@@ -185,7 +260,33 @@ class OpenApiClient {
|
|
|
185
260
|
}
|
|
186
261
|
this.writeClient.logger.shutdownLogger();
|
|
187
262
|
}
|
|
188
|
-
|
|
263
|
+
getUniqueResolvedOutputs(items) {
|
|
264
|
+
return Array.from(new Set(items.map(item => this.resolveOutputRoot(item.output))));
|
|
265
|
+
}
|
|
266
|
+
resolveOutputRoot(output) {
|
|
267
|
+
return (0, pathHelpers_1.resolveHelper)(process.cwd(), output);
|
|
268
|
+
}
|
|
269
|
+
resolveCachePathForOutput(output, cachePath) {
|
|
270
|
+
if (cachePath.startsWith('/') || /^[A-Za-z]:[\\/]/.test(cachePath)) {
|
|
271
|
+
return cachePath;
|
|
272
|
+
}
|
|
273
|
+
return (0, pathHelpers_1.resolveHelper)(this.resolveOutputRoot(output), cachePath || OpenApiClient.DEFAULT_CACHE_FILENAME);
|
|
274
|
+
}
|
|
275
|
+
warnOnSharedOutputsWithoutCache(items) {
|
|
276
|
+
const countByOutput = new Map();
|
|
277
|
+
for (const item of items) {
|
|
278
|
+
const output = this.resolveOutputRoot(item.output);
|
|
279
|
+
countByOutput.set(output, (countByOutput.get(output) ?? 0) + 1);
|
|
280
|
+
}
|
|
281
|
+
const duplicatedOutputs = Array.from(countByOutput.entries())
|
|
282
|
+
.filter(([, count]) => count > 1)
|
|
283
|
+
.map(([output]) => output);
|
|
284
|
+
if (duplicatedOutputs.length === 0) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this.writeClient.logger.warn(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.CACHE_SHARED_OUTPUT_WARNING(duplicatedOutputs.map(output => `- ${output}`).join('\n')));
|
|
288
|
+
}
|
|
289
|
+
async generateSingle(item, generationCache) {
|
|
189
290
|
const { input, output, outputCore, outputServices, outputModels, outputSchemas, httpClient, useOptions, useUnionTypes, excludeCoreServiceFiles, request, plugins, customExecutorPath, interfacePrefix, enumPrefix, typePrefix, useCancelableRequest, sortByRequired, useSeparatedIndexes, validationLibrary = ValidationLibrary_enum_1.ValidationLibrary.NONE, emptySchemaStrategy = EmptySchemaStrategy_enum_1.EmptySchemaStrategy.KEEP, useHistory, diffReport, modelsMode = ModelsMode_enum_1.ModelsMode.INTERFACES, strictOpenapi, reportFile, useProjectPrettier = false, useEslintFix = false, governanceConfig, } = item;
|
|
190
291
|
const outputPaths = (0, getOutputPaths_1.getOutputPaths)({
|
|
191
292
|
output,
|
|
@@ -195,6 +296,28 @@ class OpenApiClient {
|
|
|
195
296
|
outputSchemas,
|
|
196
297
|
});
|
|
197
298
|
const absoluteInput = (0, pathHelpers_1.resolveHelper)(process.cwd(), input);
|
|
299
|
+
const cacheKey = this.getCacheKey(item, absoluteInput);
|
|
300
|
+
const cacheFingerprint = await this.getCacheFingerprint(item, absoluteInput);
|
|
301
|
+
const useEntityCache = item.cache && item.cacheStrategy === 'entity' && generationCache !== null;
|
|
302
|
+
if (useEntityCache) {
|
|
303
|
+
const cachedEntry = generationCache.get(cacheKey);
|
|
304
|
+
if (cachedEntry && cachedEntry.fingerprint === cacheFingerprint) {
|
|
305
|
+
const allFilesExist = await this.filesExist(cachedEntry.files);
|
|
306
|
+
if (allFilesExist) {
|
|
307
|
+
for (const filePath of cachedEntry.files) {
|
|
308
|
+
this.writeClient.registerOutputFile(filePath);
|
|
309
|
+
}
|
|
310
|
+
if (item.cacheDebug) {
|
|
311
|
+
this.writeClient.logger.info(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.CACHE_HIT(input));
|
|
312
|
+
}
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (item.cacheDebug) {
|
|
317
|
+
this.writeClient.logger.info(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.CACHE_MISS(input));
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
const knownFilesBefore = new Set(this.writeClient.getExpectedOutputFilesArray());
|
|
198
321
|
const generatorPlugins = await (0, loadGeneratorPlugins_1.loadGeneratorPlugins)(plugins);
|
|
199
322
|
const context = new Context_1.Context({
|
|
200
323
|
input: absoluteInput,
|
|
@@ -214,7 +337,7 @@ class OpenApiClient {
|
|
|
214
337
|
governanceConfig: governancePolicy,
|
|
215
338
|
});
|
|
216
339
|
const reportPath = await (0, validateOpenApiStrict_1.writeOpenApiStrictReport)(strictReport, reportFile);
|
|
217
|
-
this.writeClient.logger.forceInfo(
|
|
340
|
+
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.STRICT_REPORT_CREATED(reportPath));
|
|
218
341
|
if (strictReport.summary.errors > 0) {
|
|
219
342
|
throw new Error(`Strict OpenAPI validation failed with ${strictReport.summary.errors} error(s). Report: ${reportPath}`);
|
|
220
343
|
}
|
|
@@ -302,6 +425,65 @@ class OpenApiClient {
|
|
|
302
425
|
break;
|
|
303
426
|
}
|
|
304
427
|
}
|
|
428
|
+
const generatedFiles = this.writeClient.getExpectedOutputFilesArray().filter(filePath => !knownFilesBefore.has(filePath));
|
|
429
|
+
if (item.cache && generationCache) {
|
|
430
|
+
generationCache.set({
|
|
431
|
+
key: cacheKey,
|
|
432
|
+
fingerprint: cacheFingerprint,
|
|
433
|
+
files: generatedFiles,
|
|
434
|
+
updatedAt: Date.now(),
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
getCacheKey(item, absoluteInput) {
|
|
439
|
+
return GenerationCache_1.GenerationCache.hash(JSON.stringify({
|
|
440
|
+
input: absoluteInput,
|
|
441
|
+
output: item.output,
|
|
442
|
+
outputCore: item.outputCore,
|
|
443
|
+
outputServices: item.outputServices,
|
|
444
|
+
outputModels: item.outputModels,
|
|
445
|
+
outputSchemas: item.outputSchemas,
|
|
446
|
+
}));
|
|
447
|
+
}
|
|
448
|
+
async getCacheFingerprint(item, absoluteInput) {
|
|
449
|
+
const specContent = await fileSystemHelpers_1.fileSystemHelpers.readFile(absoluteInput, 'utf8');
|
|
450
|
+
const fingerprint = {
|
|
451
|
+
cacheFingerprintVersion: OpenApiClient.CACHE_FINGERPRINT_VERSION,
|
|
452
|
+
generatorVersion: process.env.npm_package_version || 'dev',
|
|
453
|
+
specHash: GenerationCache_1.GenerationCache.hash(specContent),
|
|
454
|
+
options: {
|
|
455
|
+
httpClient: item.httpClient,
|
|
456
|
+
useOptions: item.useOptions,
|
|
457
|
+
useUnionTypes: item.useUnionTypes,
|
|
458
|
+
includeSchemasFiles: item.includeSchemasFiles,
|
|
459
|
+
excludeCoreServiceFiles: item.excludeCoreServiceFiles,
|
|
460
|
+
request: item.request,
|
|
461
|
+
plugins: item.plugins,
|
|
462
|
+
customExecutorPath: item.customExecutorPath,
|
|
463
|
+
interfacePrefix: item.interfacePrefix,
|
|
464
|
+
enumPrefix: item.enumPrefix,
|
|
465
|
+
typePrefix: item.typePrefix,
|
|
466
|
+
useCancelableRequest: item.useCancelableRequest,
|
|
467
|
+
sortByRequired: item.sortByRequired,
|
|
468
|
+
useSeparatedIndexes: item.useSeparatedIndexes,
|
|
469
|
+
validationLibrary: item.validationLibrary,
|
|
470
|
+
emptySchemaStrategy: item.emptySchemaStrategy,
|
|
471
|
+
useHistory: item.useHistory,
|
|
472
|
+
diffReport: item.diffReport,
|
|
473
|
+
modelsMode: item.modelsMode,
|
|
474
|
+
strictOpenapi: item.strictOpenapi,
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
return GenerationCache_1.GenerationCache.hash(JSON.stringify(fingerprint));
|
|
478
|
+
}
|
|
479
|
+
async filesExist(paths) {
|
|
480
|
+
for (const filePath of paths) {
|
|
481
|
+
const exists = await fileSystemHelpers_1.fileSystemHelpers.exists(filePath);
|
|
482
|
+
if (!exists) {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return true;
|
|
305
487
|
}
|
|
306
488
|
async loadDiffReportIfNeeded(params) {
|
|
307
489
|
return (0, loadDiffReport_1.loadDiffReport)({
|
|
@@ -18,6 +18,7 @@ import { writeClientSchemasIndex } from './utils/writeClientSchemasIndex';
|
|
|
18
18
|
import { writeClientServices } from './utils/writeClientServices';
|
|
19
19
|
import { writeClientServicesIndex } from './utils/writeClientServicesIndex';
|
|
20
20
|
import { writeClientSimpleIndex } from './utils/writeClientSimpleIndex';
|
|
21
|
+
import { WriteFileIfChangedResult } from './utils/writeFileIfChanged';
|
|
21
22
|
/**
|
|
22
23
|
* @param client Client object with all the models, services, etc.
|
|
23
24
|
* @param templates Templates wrapper with all loaded Handlebars templates
|
|
@@ -57,6 +58,8 @@ type TAPIClientGeneratorConfig = Omit<TWriteClientProps, 'httpClient' | 'useOpti
|
|
|
57
58
|
*/
|
|
58
59
|
export declare class WriteClient {
|
|
59
60
|
private config;
|
|
61
|
+
private expectedOutputFiles;
|
|
62
|
+
private writeStats;
|
|
60
63
|
private _logger;
|
|
61
64
|
constructor(logger?: Logger);
|
|
62
65
|
/**
|
|
@@ -72,6 +75,14 @@ export declare class WriteClient {
|
|
|
72
75
|
combineAndWrite(): Promise<void>;
|
|
73
76
|
combineAndWrightSimple(): Promise<void>;
|
|
74
77
|
get logger(): Logger;
|
|
78
|
+
writeOutputFile(filePath: string, content: string): Promise<WriteFileIfChangedResult>;
|
|
79
|
+
registerOutputFile(filePath: string): void;
|
|
80
|
+
getExpectedOutputFiles(): Set<string>;
|
|
81
|
+
getExpectedOutputFilesArray(): string[];
|
|
82
|
+
getWriteStats(): {
|
|
83
|
+
written: number;
|
|
84
|
+
unchanged: number;
|
|
85
|
+
};
|
|
75
86
|
private buildSimpleClientIndexMap;
|
|
76
87
|
private buildClientIndexMap;
|
|
77
88
|
private finalizeAndWrite;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriteClient.d.ts","sourceRoot":"","sources":["../../src/core/WriteClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM1C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAIxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB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