ts-openapi-codegen 2.0.0-beta.9 → 2.0.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/README.md +88 -18
- package/README.rus.md +88 -21
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.js +5 -0
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -1
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.js +20 -8
- package/dist/cli/index.js +5 -3
- package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -1
- package/dist/cli/previewChanges/previewChanges.js +116 -32
- package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts.map +1 -1
- package/dist/cli/previewChanges/utils/updateOutputPaths.js +6 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +4 -1
- package/dist/common/LoggerMessages.d.ts +1 -0
- package/dist/common/LoggerMessages.d.ts.map +1 -1
- package/dist/common/LoggerMessages.js +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +14 -4
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +2 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +2 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +2 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts +42 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +38 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +155 -28
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +13 -17
- package/dist/common/VersionedSchema/CommonSchemas.d.ts +12 -4
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +15 -7
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +2 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +2 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +2 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +2 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +2 -2
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +19 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.js +185 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.js +20 -3
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +19 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +4 -0
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +68 -23
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts +1 -1
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.js +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +10 -0
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +33 -15
- package/dist/common/utils/__tests__/convertArrayToObject.test.js +64 -169
- package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
- package/dist/common/utils/convertArrayToObject.js +51 -14
- package/dist/core/OpenApiClient.d.ts.map +1 -1
- package/dist/core/OpenApiClient.js +12 -1
- package/dist/core/WriteClient.d.ts +8 -1
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +48 -7
- package/dist/core/__tests__/WriteClient.test.js +2 -0
- package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getType.js +2 -1
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +2 -1
- package/dist/core/types/base/Templates.model.d.ts +1 -1
- package/dist/core/types/base/Templates.model.d.ts.map +1 -1
- package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts +6 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts.map +1 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.js +9 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.js +27 -0
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/modelHelpers.test.js +151 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.js +67 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.js +26 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.js +22 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.js +121 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts +2 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.js +20 -0
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +2 -0
- package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
- package/dist/core/utils/getOpenApiSpec.js +14 -1
- package/dist/core/utils/getRelativeModelPath.d.ts +9 -0
- package/dist/core/utils/getRelativeModelPath.d.ts.map +1 -0
- package/dist/core/utils/getRelativeModelPath.js +37 -0
- package/dist/core/utils/modelHelpers.d.ts.map +1 -1
- package/dist/core/utils/modelHelpers.js +37 -3
- package/dist/core/utils/postProcessModelImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessModelImports.js +14 -1
- package/dist/core/utils/postProcessServiceImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessServiceImports.js +1 -2
- package/dist/core/utils/precompileTemplates.js +1 -0
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +25 -0
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +42 -41
- package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
- package/dist/core/utils/resolveRefPath.js +1 -4
- package/dist/core/utils/writeClientExecutor.d.ts +4 -1
- package/dist/core/utils/writeClientExecutor.d.ts.map +1 -1
- package/dist/core/utils/writeClientExecutor.js +17 -2
- package/dist/core/utils/writeClientSchemas.d.ts +4 -1
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +11 -2
- package/dist/templatesCompiled/client/core/ApiError.js +1 -1
- package/dist/templatesCompiled/client/core/ApiResult.js +1 -1
- package/dist/templatesCompiled/client/core/axios/request.js +3 -3
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts +2 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts.map +1 -1
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.js +13 -8
- package/dist/templatesCompiled/client/core/executor/requestExecutor.js +1 -1
- package/dist/templatesCompiled/client/core/fetch/request.js +3 -3
- package/dist/templatesCompiled/client/core/functions/catchErrors.js +1 -1
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.js +1 -1
- package/dist/templatesCompiled/client/core/node/request.js +3 -3
- package/dist/templatesCompiled/client/core/xhr/request.js +3 -3
- package/dist/templatesCompiled/client/exportClient.d.ts +4 -0
- package/dist/templatesCompiled/client/exportClient.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportClient.js +51 -13
- package/dist/templatesCompiled/client/exportSchema.d.ts +5 -1
- package/dist/templatesCompiled/client/exportSchema.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportSchema.js +37 -7
- package/dist/templatesCompiled/client/exportService.d.ts +2 -0
- package/dist/templatesCompiled/client/exportService.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportService.js +70 -30
- package/dist/templatesCompiled/client/indexFull.d.ts +1 -0
- package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexFull.js +4 -1
- package/dist/templatesCompiled/client/indexSimple.d.ts +1 -0
- package/dist/templatesCompiled/client/indexSimple.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexSimple.js +4 -1
- package/dist/templatesCompiled/client/joi/exportSchema.js +5 -5
- package/dist/templatesCompiled/client/joi/partials/joiSchema.js +7 -7
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.js +4 -4
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +5 -3
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +39 -12
- package/dist/templatesCompiled/client/jsonschema/exportSchema.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.js +7 -7
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.js +2 -2
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +3 -1
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +45 -15
- package/dist/templatesCompiled/client/yup/exportSchema.js +3 -3
- package/dist/templatesCompiled/client/yup/partials/yupSchema.js +7 -7
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.js +4 -4
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +5 -3
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +39 -12
- package/dist/templatesCompiled/client/zod/exportSchema.js +3 -3
- package/dist/templatesCompiled/client/zod/partials/zodSchema.js +7 -7
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +5 -6
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +14 -28
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +3 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +32 -8
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +3 -4
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +9 -23
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +4 -2
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +18 -7
- package/package.json +2 -2
- package/dist/common/defaultOptions.d.ts +0 -3
- package/dist/common/defaultOptions.d.ts.map +0 -1
- package/dist/common/defaultOptions.js +0 -28
- package/dist/core/utils/advancedDeduplicatePath.d.ts +0 -5
- package/dist/core/utils/advancedDeduplicatePath.d.ts.map +0 -1
- package/dist/core/utils/advancedDeduplicatePath.js +0 -29
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.previewChanges = previewChanges;
|
|
37
37
|
const Consts_1 = require("../../common/Consts");
|
|
38
38
|
const Enums_1 = require("../../common/Enums");
|
|
39
|
+
const LoggerMessages_1 = require("../../common/LoggerMessages");
|
|
39
40
|
const convertArrayToObject_1 = require("../../common/utils/convertArrayToObject");
|
|
40
41
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
41
42
|
const loadConfigIfExists_1 = require("../../common/utils/loadConfigIfExists");
|
|
@@ -51,36 +52,103 @@ const formatDiff_1 = require("./utils/formatDiff");
|
|
|
51
52
|
const isDirectoryEmpty_1 = require("./utils/isDirectoryEmpty");
|
|
52
53
|
const readDirectoryRecursive_1 = require("./utils/readDirectoryRecursive");
|
|
53
54
|
const updateOutputPaths_1 = require("./utils/updateOutputPaths");
|
|
55
|
+
function buildSummary(changes) {
|
|
56
|
+
const added = [];
|
|
57
|
+
const removed = [];
|
|
58
|
+
const modified = [];
|
|
59
|
+
for (const change of changes) {
|
|
60
|
+
if (change.status === 'added') {
|
|
61
|
+
added.push(change.file);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (change.status === 'removed') {
|
|
65
|
+
removed.push(change.file);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
modified.push(change.file);
|
|
69
|
+
}
|
|
70
|
+
added.sort();
|
|
71
|
+
removed.sort();
|
|
72
|
+
modified.sort();
|
|
73
|
+
return {
|
|
74
|
+
added,
|
|
75
|
+
removed,
|
|
76
|
+
modified,
|
|
77
|
+
total: changes.length,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function toFileLink(filePath) {
|
|
81
|
+
return `./${filePath}.md`;
|
|
82
|
+
}
|
|
83
|
+
function toCategoryMarkdown(title, files) {
|
|
84
|
+
const lines = [`# ${title}`, ''];
|
|
85
|
+
if (files.length === 0) {
|
|
86
|
+
lines.push('_No files_', '');
|
|
87
|
+
return lines.join('\n');
|
|
88
|
+
}
|
|
89
|
+
for (const file of files) {
|
|
90
|
+
lines.push(`- [${file}](${toFileLink(file)})`);
|
|
91
|
+
}
|
|
92
|
+
lines.push('');
|
|
93
|
+
return lines.join('\n');
|
|
94
|
+
}
|
|
95
|
+
function toSummaryMarkdown(summary) {
|
|
96
|
+
return [
|
|
97
|
+
'# Preview Changes Summary',
|
|
98
|
+
'',
|
|
99
|
+
`Total changes: ${summary.total}`,
|
|
100
|
+
`Added files: ${summary.added.length}`,
|
|
101
|
+
`Removed files: ${summary.removed.length}`,
|
|
102
|
+
`Modified files: ${summary.modified.length}`,
|
|
103
|
+
'',
|
|
104
|
+
'## Reports',
|
|
105
|
+
'- [Added files](./added-files.md)',
|
|
106
|
+
'- [Removed files](./removed-files.md)',
|
|
107
|
+
'- [Modified files](./modified-files.md)',
|
|
108
|
+
'',
|
|
109
|
+
'## Added',
|
|
110
|
+
...summary.added.map(file => `- [${file}](${toFileLink(file)})`),
|
|
111
|
+
'',
|
|
112
|
+
'## Removed',
|
|
113
|
+
...summary.removed.map(file => `- [${file}](${toFileLink(file)})`),
|
|
114
|
+
'',
|
|
115
|
+
'## Modified',
|
|
116
|
+
...summary.modified.map(file => `- [${file}](${toFileLink(file)})`),
|
|
117
|
+
'',
|
|
118
|
+
].join('\n');
|
|
119
|
+
}
|
|
54
120
|
/**
|
|
55
121
|
* Основная функция для предпросмотра изменений
|
|
56
122
|
*
|
|
57
123
|
* TODO: Добавить проверку опций команды перед выполнением
|
|
58
124
|
*/
|
|
59
125
|
async function previewChanges(options) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Consts_1.APP_LOGGER.error(validationResult.errors.join('\n'));
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
const { openapiConfig, generatedDir, previewDir, diffDir } = validationResult.data;
|
|
66
|
-
const resolvedGeneratedDir = (0, pathHelpers_1.resolveHelper)(process.cwd(), generatedDir || '');
|
|
67
|
-
const resolvedPreviewDir = (0, pathHelpers_1.resolveHelper)(process.cwd(), previewDir || '');
|
|
68
|
-
const resolvedDiffDir = (0, pathHelpers_1.resolveHelper)(process.cwd(), diffDir || '');
|
|
126
|
+
let exitCode = 0;
|
|
127
|
+
let resolvedPreviewDir = '';
|
|
69
128
|
let previewDirCreated = false;
|
|
70
129
|
try {
|
|
130
|
+
const validationResult = (0, validateZodOptions_1.validateZodOptions)(schemas_1.previewChangesSchema, options);
|
|
131
|
+
if (!validationResult.success) {
|
|
132
|
+
Consts_1.APP_LOGGER.error(validationResult.errors.join('\n'));
|
|
133
|
+
exitCode = 1;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const { openapiConfig, generatedDir, previewDir, diffDir } = validationResult.data;
|
|
137
|
+
const resolvedGeneratedDir = (0, pathHelpers_1.resolveHelper)(process.cwd(), generatedDir || '');
|
|
138
|
+
resolvedPreviewDir = (0, pathHelpers_1.resolveHelper)(process.cwd(), previewDir || '');
|
|
139
|
+
const resolvedDiffDir = (0, pathHelpers_1.resolveHelper)(process.cwd(), diffDir || '');
|
|
71
140
|
// 1. Проверка директории со сгенерированным кодом
|
|
72
141
|
if (await (0, isDirectoryEmpty_1.isDirectoryEmpty)(resolvedGeneratedDir)) {
|
|
73
142
|
Consts_1.APP_LOGGER.info(`Directory "${generatedDir}" is empty or does not exist. Nothing to compare.`);
|
|
74
|
-
|
|
143
|
+
return;
|
|
75
144
|
}
|
|
76
|
-
// 2.
|
|
77
|
-
await fileSystemHelpers_1.fileSystemHelpers.mkdir(resolvedPreviewDir);
|
|
78
|
-
previewDirCreated = true;
|
|
79
|
-
// 3. Загрузка конфигурации
|
|
145
|
+
// 2. Загрузка конфигурации
|
|
80
146
|
const configData = (0, loadConfigIfExists_1.loadConfigIfExists)(openapiConfig);
|
|
81
147
|
if (!configData) {
|
|
82
|
-
|
|
83
|
-
|
|
148
|
+
throw new Error('The configuration file is missing');
|
|
149
|
+
}
|
|
150
|
+
if (Array.isArray(configData)) {
|
|
151
|
+
Consts_1.APP_LOGGER.warn(LoggerMessages_1.LOGGER_MESSAGES.CONFIG.ARRAY_DEPRECATED);
|
|
84
152
|
}
|
|
85
153
|
const preparedOptions = (0, convertArrayToObject_1.convertArrayToObject)(configData);
|
|
86
154
|
// Миграция опций
|
|
@@ -91,9 +159,12 @@ async function previewChanges(options) {
|
|
|
91
159
|
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
92
160
|
});
|
|
93
161
|
if (!migratedOptions) {
|
|
94
|
-
|
|
95
|
-
process.exit(1);
|
|
162
|
+
throw new Error("Couldn't convert the set of options to the current version");
|
|
96
163
|
}
|
|
164
|
+
// 3. Подготовка и создание временной директории preview
|
|
165
|
+
await fileSystemHelpers_1.fileSystemHelpers.rmdir(resolvedPreviewDir);
|
|
166
|
+
await fileSystemHelpers_1.fileSystemHelpers.mkdir(resolvedPreviewDir);
|
|
167
|
+
previewDirCreated = true;
|
|
97
168
|
// 4. Обновление путей output для генерации в preview директорию
|
|
98
169
|
const migratedValue = migratedOptions.value;
|
|
99
170
|
const previewOptions = (0, updateOutputPaths_1.updateOutputPaths)(migratedValue, previewDir || '', generatedDir || '');
|
|
@@ -104,13 +175,15 @@ async function previewChanges(options) {
|
|
|
104
175
|
Consts_1.APP_LOGGER.info('Comparing files...');
|
|
105
176
|
const oldFiles = await (0, readDirectoryRecursive_1.readDirectoryRecursive)(resolvedGeneratedDir);
|
|
106
177
|
const newFiles = await (0, readDirectoryRecursive_1.readDirectoryRecursive)(resolvedPreviewDir);
|
|
107
|
-
const
|
|
178
|
+
const oldFileSet = new Set(oldFiles);
|
|
179
|
+
const newFileSet = new Set(newFiles);
|
|
180
|
+
const allFiles = new Set([...oldFileSet, ...newFileSet]);
|
|
108
181
|
const changes = [];
|
|
109
|
-
for (const file of allFiles) {
|
|
182
|
+
for (const file of [...allFiles].sort()) {
|
|
110
183
|
const oldPath = (0, pathHelpers_1.joinHelper)(resolvedGeneratedDir, file);
|
|
111
184
|
const newPath = (0, pathHelpers_1.joinHelper)(resolvedPreviewDir, file);
|
|
112
|
-
const oldExists =
|
|
113
|
-
const newExists =
|
|
185
|
+
const oldExists = oldFileSet.has(file);
|
|
186
|
+
const newExists = newFileSet.has(file);
|
|
114
187
|
if (oldExists && newExists) {
|
|
115
188
|
// Файл существует в обеих директориях - сравниваем
|
|
116
189
|
const fileDiff = await (0, compareFiles_1.compareFiles)(oldPath, newPath);
|
|
@@ -142,6 +215,7 @@ async function previewChanges(options) {
|
|
|
142
215
|
}
|
|
143
216
|
// 7. Сохранение результатов в diff директорию
|
|
144
217
|
if (changes.length > 0) {
|
|
218
|
+
await fileSystemHelpers_1.fileSystemHelpers.rmdir(resolvedDiffDir);
|
|
145
219
|
await fileSystemHelpers_1.fileSystemHelpers.mkdir(resolvedDiffDir);
|
|
146
220
|
for (const change of changes) {
|
|
147
221
|
const diffFilePath = (0, pathHelpers_1.joinHelper)(resolvedDiffDir, `${change.file}.md`);
|
|
@@ -160,30 +234,40 @@ async function previewChanges(options) {
|
|
|
160
234
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile(diffFilePath, diffContent, 'utf-8');
|
|
161
235
|
Consts_1.APP_LOGGER.info(`Diff saved: ${diffFilePath}`);
|
|
162
236
|
}
|
|
237
|
+
const summary = buildSummary(changes);
|
|
238
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.joinHelper)(resolvedDiffDir, 'added-files.md'), toCategoryMarkdown('Added Files', summary.added), 'utf-8');
|
|
239
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.joinHelper)(resolvedDiffDir, 'removed-files.md'), toCategoryMarkdown('Removed Files', summary.removed), 'utf-8');
|
|
240
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.joinHelper)(resolvedDiffDir, 'modified-files.md'), toCategoryMarkdown('Modified Files', summary.modified), 'utf-8');
|
|
241
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.joinHelper)(resolvedDiffDir, 'summary.json'), JSON.stringify(summary, null, 2), 'utf-8');
|
|
242
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.joinHelper)(resolvedDiffDir, 'summary.md'), toSummaryMarkdown(summary), 'utf-8');
|
|
163
243
|
Consts_1.APP_LOGGER.info(`\nTotal changes: ${changes.length}`);
|
|
164
244
|
Consts_1.APP_LOGGER.info(`Diff files saved to: ${diffDir}`);
|
|
165
245
|
}
|
|
166
246
|
else {
|
|
247
|
+
await fileSystemHelpers_1.fileSystemHelpers.rmdir(resolvedDiffDir);
|
|
167
248
|
Consts_1.APP_LOGGER.info('No changes detected. All files are identical.');
|
|
168
249
|
}
|
|
169
|
-
// 8. Удаление временной директории preview
|
|
170
|
-
Consts_1.APP_LOGGER.info(`Cleaning up preview directory: ${previewDir}`);
|
|
171
|
-
await fileSystemHelpers_1.fileSystemHelpers.rmdir(resolvedPreviewDir);
|
|
172
|
-
previewDirCreated = false;
|
|
173
|
-
process.exit(0);
|
|
174
250
|
}
|
|
175
251
|
catch (error) {
|
|
176
|
-
|
|
177
|
-
|
|
252
|
+
exitCode = 1;
|
|
253
|
+
Consts_1.APP_LOGGER.error(error.message);
|
|
254
|
+
}
|
|
255
|
+
finally {
|
|
256
|
+
if (previewDirCreated || resolvedPreviewDir) {
|
|
178
257
|
try {
|
|
179
|
-
|
|
180
|
-
|
|
258
|
+
if (resolvedPreviewDir) {
|
|
259
|
+
Consts_1.APP_LOGGER.info(`Cleaning up preview directory: ${resolvedPreviewDir}`);
|
|
260
|
+
await fileSystemHelpers_1.fileSystemHelpers.rmdir(resolvedPreviewDir);
|
|
261
|
+
}
|
|
181
262
|
}
|
|
182
263
|
catch (cleanupError) {
|
|
183
264
|
Consts_1.APP_LOGGER.error(`Failed to cleanup preview directory: ${cleanupError.message}`);
|
|
265
|
+
exitCode = 1;
|
|
184
266
|
}
|
|
185
267
|
}
|
|
186
|
-
|
|
268
|
+
}
|
|
269
|
+
if (exitCode !== 0) {
|
|
187
270
|
process.exit(1);
|
|
188
271
|
}
|
|
272
|
+
process.exit(0);
|
|
189
273
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateOutputPaths.d.ts","sourceRoot":"","sources":["../../../../src/cli/previewChanges/utils/updateOutputPaths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateOutputPaths.d.ts","sourceRoot":"","sources":["../../../../src/cli/previewChanges/utils/updateOutputPaths.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACrB,WAAW,CA6Ib"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateOutputPaths = updateOutputPaths;
|
|
4
|
+
const path_1 = require("path");
|
|
4
5
|
const pathHelpers_1 = require("../../../common/utils/pathHelpers");
|
|
5
6
|
/**
|
|
6
7
|
* Обновляет пути output в опциях для генерации в preview директорию
|
|
@@ -23,6 +24,11 @@ function updateOutputPaths(options, previewDir, generatedDir) {
|
|
|
23
24
|
if (relativePath.startsWith('./')) {
|
|
24
25
|
relativePath = relativePath.substring(2);
|
|
25
26
|
}
|
|
27
|
+
// Если путь выходит за пределы generatedDir, используем basename для безопасного переноса
|
|
28
|
+
if (relativePath.startsWith('../')) {
|
|
29
|
+
const outputBaseName = (0, path_1.basename)(resolvedOldPath);
|
|
30
|
+
return (0, pathHelpers_1.joinHelper)(previewDir, outputBaseName);
|
|
31
|
+
}
|
|
26
32
|
// Если путь пустой или равен текущей директории, возвращаем previewDir
|
|
27
33
|
if (!relativePath || relativePath === '' || relativePath === './') {
|
|
28
34
|
return previewDir;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Consts.d.ts","sourceRoot":"","sources":["../../src/common/Consts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Consts.d.ts","sourceRoot":"","sources":["../../src/common/Consts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAErE,eAAO,MAAM,6BAA6B,EAAE,kBAwB3C,CAAC;AAEF,eAAO,MAAM,UAAU,QAIrB,CAAC;AAEH,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C,eAAO,MAAM,2BAA2B,4BAA4B,CAAA;AAEpE,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD,eAAO,MAAM,2BAA2B,0CAA0C,CAAC;AAEnF,eAAO,MAAM,wBAAwB,uCAAuC,CAAC"}
|
package/dist/common/Consts.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_DIFF_CHANGES_DIR = exports.DEFAULT_PREVIEW_CHANGES_DIR = exports.DEFAULT_OUTPUT_API_DIR = exports.DEFAULT_CUSTOM_REQUEST_PATH = exports.DEFAULT_SPECS_DIR = exports.APP_LOGGER = exports.COMMON_DEFAULT_OPTIONS_VALUES = exports.DEFAULT_OPENAPI_CONFIG_FILENAME = void 0;
|
|
4
|
+
const EmptySchemaStrategy_enum_1 = require("../core/types/enums/EmptySchemaStrategy.enum");
|
|
4
5
|
const HttpClient_enum_1 = require("../core/types/enums/HttpClient.enum");
|
|
5
6
|
const ValidationLibrary_enum_1 = require("../core/types/enums/ValidationLibrary.enum");
|
|
6
7
|
const Enums_1 = require("./Enums");
|
|
@@ -19,6 +20,7 @@ exports.COMMON_DEFAULT_OPTIONS_VALUES = {
|
|
|
19
20
|
includeSchemasFiles: false,
|
|
20
21
|
excludeCoreServiceFiles: false,
|
|
21
22
|
request: '',
|
|
23
|
+
customExecutorPath: '',
|
|
22
24
|
interfacePrefix: 'I',
|
|
23
25
|
enumPrefix: 'E',
|
|
24
26
|
typePrefix: 'T',
|
|
@@ -27,7 +29,8 @@ exports.COMMON_DEFAULT_OPTIONS_VALUES = {
|
|
|
27
29
|
logTarget: Enums_1.ELogOutput.CONSOLE,
|
|
28
30
|
sortByRequired: false,
|
|
29
31
|
useSeparatedIndexes: false,
|
|
30
|
-
validationLibrary: ValidationLibrary_enum_1.ValidationLibrary.NONE
|
|
32
|
+
validationLibrary: ValidationLibrary_enum_1.ValidationLibrary.NONE,
|
|
33
|
+
emptySchemaStrategy: EmptySchemaStrategy_enum_1.EmptySchemaStrategy.KEEP,
|
|
31
34
|
};
|
|
32
35
|
exports.APP_LOGGER = new Logger_1.Logger({
|
|
33
36
|
level: Enums_1.ELogLevel.INFO,
|
|
@@ -54,6 +54,7 @@ export declare const LOGGER_MESSAGES: {
|
|
|
54
54
|
readonly FILE_UPDATED: (configPath: string) => string;
|
|
55
55
|
readonly ACTION_SKIPPED: "Action skipped.";
|
|
56
56
|
readonly UNKNOWN_ACTION: (action: string) => string;
|
|
57
|
+
readonly ARRAY_DEPRECATED: "Using an array of configurations is deprecated and support will be removed in future versions. Please switch to using an object with named configurations.";
|
|
57
58
|
};
|
|
58
59
|
readonly ERROR: {
|
|
59
60
|
readonly PREFIX: "Error:";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerMessages.d.ts","sourceRoot":"","sources":["../../src/common/LoggerMessages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;;kCAGH,MAAM;;oDAEY,MAAM;2CACf,MAAM,YAAY,MAAM;;;;;;;;;;;;;8CAoBrB,MAAM;gDACJ,MAAM;;;4CAKV,MAAM;8CACJ,MAAM;uDACG,MAAM;;;6CAKhB,MAAM;+CACJ,MAAM;wDACG,MAAM;gDAGd,MAAM;qDACD,MAAM;kDACT,MAAM;oDACJ,MAAM;;;+CAKX,MAAM,kBAAkB,MAAM;;;;;;+CAW9B,MAAM;;;kDAKH,MAAM;iDACP,MAAM;;;4CAGX,MAAM;;0CAER,MAAM
|
|
1
|
+
{"version":3,"file":"LoggerMessages.d.ts","sourceRoot":"","sources":["../../src/common/LoggerMessages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;;kCAGH,MAAM;;oDAEY,MAAM;2CACf,MAAM,YAAY,MAAM;;;;;;;;;;;;;8CAoBrB,MAAM;gDACJ,MAAM;;;4CAKV,MAAM;8CACJ,MAAM;uDACG,MAAM;;;6CAKhB,MAAM;+CACJ,MAAM;wDACG,MAAM;gDAGd,MAAM;qDACD,MAAM;kDACT,MAAM;oDACJ,MAAM;;;+CAKX,MAAM,kBAAkB,MAAM;;;;;;+CAW9B,MAAM;;;kDAKH,MAAM;iDACP,MAAM;;;4CAGX,MAAM;;0CAER,MAAM;;;;;oCAOZ,MAAM;;;CAKvB,CAAC"}
|
|
@@ -71,6 +71,7 @@ exports.LOGGER_MESSAGES = {
|
|
|
71
71
|
FILE_UPDATED: (configPath) => `Configuration file "${configPath}" has been updated`,
|
|
72
72
|
ACTION_SKIPPED: 'Action skipped.',
|
|
73
73
|
UNKNOWN_ACTION: (action) => `Unknown action: ${action}`,
|
|
74
|
+
ARRAY_DEPRECATED: 'Using an array of configurations is deprecated and support will be removed in future versions. Please switch to using an object with named configurations.',
|
|
74
75
|
},
|
|
75
76
|
// ========== Error Messages ==========
|
|
76
77
|
ERROR: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaMigrationPlan } from '../Types';
|
|
2
2
|
/**
|
|
3
3
|
* Unified migration plan that includes all migrations from all schema types.
|
|
4
|
-
* Migrates from any old version to the latest
|
|
4
|
+
* Migrates from any old version to the latest UNIFIED_OPTIONS_v1 schema.
|
|
5
5
|
* Reuses existing migration plans to avoid code duplication.
|
|
6
6
|
*/
|
|
7
7
|
export declare const allMigrationPlans: SchemaMigrationPlan<Record<string, any>, Record<string, any>>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllMigrationPlans.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AllMigrationPlans.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAiB/C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EA2C5F,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allMigrationPlans = void 0;
|
|
4
|
+
const EmptySchemaStrategy_enum_1 = require("../../../core/types/enums/EmptySchemaStrategy.enum");
|
|
4
5
|
const ValidationLibrary_enum_1 = require("../../../core/types/enums/ValidationLibrary.enum");
|
|
6
|
+
const Enums_1 = require("../../Enums");
|
|
5
7
|
const MultiOptionsMigrationPlan_1 = require("../MultiOptionsVersioned/MultiOptionsMigrationPlan");
|
|
6
8
|
const OptionsMigrationPlans_1 = require("../OptionsVersioned/OptionsMigrationPlans");
|
|
9
|
+
const createDefaultFieldsMigration_1 = require("../Utils/createDefaultFieldsMigration");
|
|
7
10
|
const createFieldTransformationMigration_1 = require("../Utils/createFieldTransformationMigration");
|
|
8
11
|
const createTrivialMigration_1 = require("../Utils/createTrivialMigration");
|
|
9
12
|
const getLatestVersionFromMigrationPlans_1 = require("../Utils/getLatestVersionFromMigrationPlans");
|
|
@@ -19,19 +22,26 @@ function addVersionPrefixToMigrationPlans(plans, prefix) {
|
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* Unified migration plan that includes all migrations from all schema types.
|
|
22
|
-
* Migrates from any old version to the latest
|
|
25
|
+
* Migrates from any old version to the latest UNIFIED_OPTIONS_v1 schema.
|
|
23
26
|
* Reuses existing migration plans to avoid code duplication.
|
|
24
27
|
*/
|
|
25
28
|
exports.allMigrationPlans = [
|
|
26
29
|
// ===== OPTIONS migrations (with prefix) =====
|
|
27
30
|
...addVersionPrefixToMigrationPlans(OptionsMigrationPlans_1.optionsMigrationPlans, 'OPTIONS'),
|
|
28
31
|
// Migration from OPTIONS latest version to UNIFIED v1
|
|
29
|
-
(0, createTrivialMigration_1.createTrivialMigration)(`OPTIONS_${(0, getLatestVersionFromMigrationPlans_1.getLatestVersionFromMigrationPlans)(OptionsMigrationPlans_1.optionsMigrationPlans)}`, '
|
|
32
|
+
(0, createTrivialMigration_1.createTrivialMigration)(`OPTIONS_${(0, getLatestVersionFromMigrationPlans_1.getLatestVersionFromMigrationPlans)(OptionsMigrationPlans_1.optionsMigrationPlans)}`, 'UNIFIED_OPTIONS_v1', 'Migrate from OPTIONS to UNIFIED schema'),
|
|
30
33
|
// ===== MULTI_OPTIONS migrations (with prefix) =====
|
|
31
34
|
...addVersionPrefixToMigrationPlans(MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan, 'MULTI_OPTIONS'),
|
|
32
35
|
// Migration from MULTI_OPTIONS latest version to UNIFIED v1
|
|
33
|
-
(0, createTrivialMigration_1.createTrivialMigration)(`MULTI_OPTIONS_${(0, getLatestVersionFromMigrationPlans_1.getLatestVersionFromMigrationPlans)(MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan)}`, '
|
|
34
|
-
(0, createFieldTransformationMigration_1.createFieldTransformationMigration)('
|
|
36
|
+
(0, createTrivialMigration_1.createTrivialMigration)(`MULTI_OPTIONS_${(0, getLatestVersionFromMigrationPlans_1.getLatestVersionFromMigrationPlans)(MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan)}`, 'UNIFIED_OPTIONS_v1', 'Migrate from MULTI_OPTIONS to UNIFIED schema'),
|
|
37
|
+
(0, createFieldTransformationMigration_1.createFieldTransformationMigration)('UNIFIED_OPTIONS_v1', 'UNIFIED_OPTIONS_v2', ({ includeSchemasFiles, ...otherProps }) => {
|
|
35
38
|
return { ...otherProps, validationLibrary: !includeSchemasFiles ? ValidationLibrary_enum_1.ValidationLibrary.NONE : undefined };
|
|
36
39
|
}, 'Transforms includeSchemasFiles to validationLibrary: if includeSchemasFiles is false, sets validationLibrary to NONE'),
|
|
40
|
+
(0, createDefaultFieldsMigration_1.createDefaultFieldsMigration)('UNIFIED_OPTIONS_v2', 'UNIFIED_OPTIONS_v3', {
|
|
41
|
+
logLevel: Enums_1.ELogLevel.ERROR,
|
|
42
|
+
logTarget: Enums_1.ELogOutput.CONSOLE
|
|
43
|
+
}),
|
|
44
|
+
(0, createDefaultFieldsMigration_1.createDefaultFieldsMigration)('UNIFIED_OPTIONS_v3', 'UNIFIED_OPTIONS_v4', {
|
|
45
|
+
emptySchemaStrategy: EmptySchemaStrategy_enum_1.EmptySchemaStrategy.KEEP
|
|
46
|
+
})
|
|
37
47
|
];
|
|
@@ -7,10 +7,10 @@ export declare const unifiedOptionsSchemaV1: z.ZodObject<{
|
|
|
7
7
|
interfacePrefix: z.ZodOptional<z.ZodString>;
|
|
8
8
|
enumPrefix: z.ZodOptional<z.ZodString>;
|
|
9
9
|
typePrefix: z.ZodOptional<z.ZodString>;
|
|
10
|
-
useOptions: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
-
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
12
10
|
excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
13
11
|
includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
useOptions: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
outputCore: z.ZodOptional<z.ZodString>;
|
|
15
15
|
outputServices: z.ZodOptional<z.ZodString>;
|
|
16
16
|
outputModels: z.ZodOptional<z.ZodString>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const unifiedOptionsSchemaV2: z.ZodObject<{
|
|
3
|
-
useOptions: z.ZodOptional<z.ZodBoolean>;
|
|
4
|
-
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
5
3
|
excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
6
4
|
validationLibrary: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/ValidationLibrary.enum").ValidationLibrary>>;
|
|
5
|
+
useOptions: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
sortByRequired: z.ZodOptional<z.ZodBoolean>;
|
|
8
8
|
useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
|
|
9
9
|
useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2,10 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const unifiedOptionsSchemaV3: z.ZodObject<{
|
|
3
3
|
logLevel: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogLevel>>;
|
|
4
4
|
logTarget: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogOutput>>;
|
|
5
|
-
useOptions: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
-
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
7
5
|
excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
8
6
|
validationLibrary: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/ValidationLibrary.enum").ValidationLibrary>>;
|
|
7
|
+
useOptions: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
9
9
|
sortByRequired: z.ZodOptional<z.ZodBoolean>;
|
|
10
10
|
useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
|
|
11
11
|
useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const unifiedOptionsSchemaV4: z.ZodObject<{
|
|
3
|
+
logLevel: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogLevel>>;
|
|
4
|
+
logTarget: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogOutput>>;
|
|
5
|
+
sortByRequired: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
request: z.ZodOptional<z.ZodString>;
|
|
9
|
+
interfacePrefix: z.ZodOptional<z.ZodString>;
|
|
10
|
+
enumPrefix: z.ZodOptional<z.ZodString>;
|
|
11
|
+
typePrefix: z.ZodOptional<z.ZodString>;
|
|
12
|
+
includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
outputCore: z.ZodOptional<z.ZodString>;
|
|
14
|
+
outputServices: z.ZodOptional<z.ZodString>;
|
|
15
|
+
outputModels: z.ZodOptional<z.ZodString>;
|
|
16
|
+
outputSchemas: z.ZodOptional<z.ZodString>;
|
|
17
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
18
|
+
input: z.ZodString;
|
|
19
|
+
request: z.ZodOptional<z.ZodString>;
|
|
20
|
+
sortByRequired: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
interfacePrefix: z.ZodOptional<z.ZodString>;
|
|
24
|
+
enumPrefix: z.ZodOptional<z.ZodString>;
|
|
25
|
+
typePrefix: z.ZodOptional<z.ZodString>;
|
|
26
|
+
output: z.ZodString;
|
|
27
|
+
outputCore: z.ZodOptional<z.ZodString>;
|
|
28
|
+
outputServices: z.ZodOptional<z.ZodString>;
|
|
29
|
+
outputModels: z.ZodOptional<z.ZodString>;
|
|
30
|
+
outputSchemas: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
32
|
+
input: z.ZodOptional<z.ZodString>;
|
|
33
|
+
output: z.ZodOptional<z.ZodString>;
|
|
34
|
+
httpClient: z.ZodEnum<typeof import("../../..").HttpClient>;
|
|
35
|
+
customExecutorPath: z.ZodOptional<z.ZodString>;
|
|
36
|
+
emptySchemaStrategy: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/EmptySchemaStrategy.enum").EmptySchemaStrategy>>;
|
|
37
|
+
excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
validationLibrary: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/ValidationLibrary.enum").ValidationLibrary>>;
|
|
39
|
+
useOptions: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
useUnionTypes: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
//# sourceMappingURL=UnifiedOptionsSchemaV4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnifiedOptionsSchemaV4.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unifiedOptionsSchemaV4 = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const CommonSchemas_1 = require("../CommonSchemas");
|
|
6
|
+
const UnifiedOptionsSchemaV3_1 = require("./UnifiedOptionsSchemaV3");
|
|
7
|
+
exports.unifiedOptionsSchemaV4 = UnifiedOptionsSchemaV3_1.unifiedOptionsSchemaV3.extend({
|
|
8
|
+
...CommonSchemas_1.specialParametersSchemasV4.shape,
|
|
9
|
+
customExecutorPath: zod_1.z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
/*
|
|
12
|
+
type TUnified = {
|
|
13
|
+
httpClient: HttpClient.FETCH | HttpClient.XHR | HttpClient.NODE | HttpClient.AXIOS;
|
|
14
|
+
logLevel: ELogLevel.INFO | ELogLevel.WARN | ELogLevel.ERROR | undefined;
|
|
15
|
+
logTarget: ELogOutput.CONSOLE | ELogOutput.FILE | undefined;
|
|
16
|
+
sortByRequired: boolean | undefined;
|
|
17
|
+
useSeparatedIndexes: boolean | undefined;
|
|
18
|
+
useCancelableRequest: boolean | undefined;
|
|
19
|
+
request: string | undefined;
|
|
20
|
+
interfacePrefix: string | undefined;
|
|
21
|
+
enumPrefix: string | undefined;
|
|
22
|
+
typePrefix: string | undefined;
|
|
23
|
+
includeSchemasFiles: boolean | undefined;
|
|
24
|
+
outputCore: string | undefined;
|
|
25
|
+
outputServices: string | undefined;
|
|
26
|
+
outputModels: string | undefined;
|
|
27
|
+
outputSchemas: string | undefined;
|
|
28
|
+
items: { ... 13 more }[] | undefined;
|
|
29
|
+
input: string | undefined;
|
|
30
|
+
output: string | undefined;
|
|
31
|
+
customExecutorPath: string | undefined;
|
|
32
|
+
emptySchemaStrategy: EmptySchemaStrategy.SEMANTIC | EmptySchemaStrategy.SKIP | EmptySchemaStrategy.KEEP | undefined;
|
|
33
|
+
excludeCoreServiceFiles: boolean | undefined;
|
|
34
|
+
validationLibrary: ValidationLibrary.NONE | ValidationLibrary.ZOD | ValidationLibrary.JOI | ValidationLibrary.YUP | ValidationLibrary.JSONSCHEMA | undefined;
|
|
35
|
+
useOptions: boolean | undefined;
|
|
36
|
+
useUnionTypes: boolean | undefined;
|
|
37
|
+
}
|
|
38
|
+
*/
|