ts-openapi-codegen 1.0.0 → 2.0.0-beta.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.
Files changed (60) hide show
  1. package/dist/cli/generate/runGenerateOpenApi.d.ts.map +1 -1
  2. package/dist/cli/generate/runGenerateOpenApi.js +10 -25
  3. package/dist/common/Consts.d.ts +2 -21
  4. package/dist/common/Consts.d.ts.map +1 -1
  5. package/dist/common/Consts.js +5 -2
  6. package/dist/common/Logger.d.ts.map +1 -1
  7. package/dist/common/Logger.js +3 -2
  8. package/dist/common/LoggerMessages.d.ts +64 -0
  9. package/dist/common/LoggerMessages.d.ts.map +1 -0
  10. package/dist/common/LoggerMessages.js +82 -0
  11. package/dist/common/TRawOptions.d.ts +40 -0
  12. package/dist/common/TRawOptions.d.ts.map +1 -0
  13. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts +8 -0
  14. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -0
  15. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +31 -0
  16. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts +8 -0
  17. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts.map +1 -0
  18. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.js +33 -0
  19. package/dist/common/VersionedSchema/Enums.d.ts +2 -1
  20. package/dist/common/VersionedSchema/Enums.d.ts.map +1 -1
  21. package/dist/common/VersionedSchema/Enums.js +1 -0
  22. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.d.ts.map +1 -1
  23. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.js +10 -19
  24. package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.d.ts.map +1 -1
  25. package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.js +10 -10
  26. package/dist/common/VersionedSchema/Types.d.ts +5 -0
  27. package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
  28. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts +3 -0
  29. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts.map +1 -0
  30. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.js +28 -0
  31. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts +7 -0
  32. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts.map +1 -0
  33. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.js +42 -0
  34. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts +3 -0
  35. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts.map +1 -0
  36. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.js +10 -0
  37. package/dist/common/VersionedSchema/Utils/createDefaultFieldsMigration.d.ts +11 -0
  38. package/dist/common/VersionedSchema/Utils/createDefaultFieldsMigration.d.ts.map +1 -0
  39. package/dist/common/VersionedSchema/Utils/createDefaultFieldsMigration.js +19 -0
  40. package/dist/common/VersionedSchema/Utils/createTrivialMigration.d.ts +7 -0
  41. package/dist/common/VersionedSchema/Utils/createTrivialMigration.d.ts.map +1 -0
  42. package/dist/common/VersionedSchema/Utils/createTrivialMigration.js +15 -0
  43. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
  44. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +11 -4
  45. package/dist/core/OpenApiClient.d.ts +13 -0
  46. package/dist/core/OpenApiClient.d.ts.map +1 -0
  47. package/dist/core/OpenApiClient.js +175 -0
  48. package/dist/core/WriteClient.d.ts +1 -1
  49. package/dist/core/WriteClient.d.ts.map +1 -1
  50. package/dist/core/WriteClient.js +2 -2
  51. package/dist/core/index.d.ts +2 -6
  52. package/dist/core/index.d.ts.map +1 -1
  53. package/dist/core/index.js +6 -168
  54. package/package.json +1 -1
  55. package/dist/common/Options.d.ts +0 -26
  56. package/dist/common/Options.d.ts.map +0 -1
  57. package/dist/core/utils/prepareOptions.d.ts +0 -8
  58. package/dist/core/utils/prepareOptions.d.ts.map +0 -1
  59. package/dist/core/utils/prepareOptions.js +0 -31
  60. /package/dist/common/{Options.js → TRawOptions.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"runGenerateOpenApi.d.ts","sourceRoot":"","sources":["../../../src/cli/generate/runGenerateOpenApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAgBzC;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoD7E"}
1
+ {"version":3,"file":"runGenerateOpenApi.d.ts","sourceRoot":"","sources":["../../../src/cli/generate/runGenerateOpenApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAYzC;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC7E"}
@@ -39,13 +39,10 @@ const defaultOptions_1 = require("../../common/defaultOptions");
39
39
  const Enums_1 = require("../../common/Enums");
40
40
  const convertArrayToObject_1 = require("../../common/utils/convertArrayToObject");
41
41
  const loadConfigIfExists_1 = require("../../common/utils/loadConfigIfExists");
42
- const MultiOptionsMigrationPlan_1 = require("../../common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan");
43
- const MultiOptionsVersionedSchemas_1 = require("../../common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas");
44
- const OptionsMigrationPlans_1 = require("../../common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans");
45
- const OptionsVersionedSchemas_1 = require("../../common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas");
42
+ const AllMigrationPlans_1 = require("../../common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans");
43
+ const AllVersionedSchemas_1 = require("../../common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas");
46
44
  const migrateDataToLatestSchemaVersion_1 = require("../../common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion");
47
45
  const OpenAPI = __importStar(require("../../core"));
48
- const isInstanceOfMultiOptions_1 = require("../../core/utils/isInstanceOfMultiOptions");
49
46
  /**
50
47
  * Запускает генерацию OpenAPI клиента
51
48
  * Поддерживает как конфиг-файл, так и параметры из CLI
@@ -66,31 +63,19 @@ async function runGenerateOpenApi(options) {
66
63
  Consts_1.APP_LOGGER.error('The configuration file is missing');
67
64
  }
68
65
  const preparedOptions = (0, convertArrayToObject_1.convertArrayToObject)(configData);
69
- const isMultiOptions = (0, isInstanceOfMultiOptions_1.isInstanceOfMultioptions)(preparedOptions);
70
- const migratedOptions = isMultiOptions
71
- ? (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
72
- rawInput: preparedOptions,
73
- migrationPlans: MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan,
74
- versionedSchemas: MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema,
75
- migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
76
- })
77
- : (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
78
- rawInput: preparedOptions,
79
- migrationPlans: OptionsMigrationPlans_1.optionsMigrationPlans,
80
- versionedSchemas: OptionsVersionedSchemas_1.optionsVersionedSchemas,
81
- migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
82
- });
66
+ // Use unified migration system for all schema types
67
+ const migratedOptions = (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
68
+ rawInput: preparedOptions,
69
+ migrationPlans: AllMigrationPlans_1.allMigrationPlans,
70
+ versionedSchemas: AllVersionedSchemas_1.allVersionedSchemas,
71
+ migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
72
+ });
83
73
  if (!migratedOptions) {
84
74
  Consts_1.APP_LOGGER.error("Couldn't convert the set of options to the current version");
85
75
  }
86
76
  else {
87
77
  const { value } = migratedOptions;
88
- if (isMultiOptions) {
89
- await OpenAPI.generate(value);
90
- }
91
- else {
92
- await OpenAPI.generate(value);
93
- }
78
+ await OpenAPI.generate(value);
94
79
  }
95
80
  process.exit(0);
96
81
  }
@@ -1,25 +1,6 @@
1
- import { HttpClient } from '../core';
2
- import { ELogLevel, ELogOutput } from './Enums';
3
1
  import { Logger } from './Logger';
2
+ import { TStrictFlatOptions } from './TRawOptions';
4
3
  export declare const DEFAULT_OPENAPI_CONFIG_FILENAME = "openapi.config.json";
5
- export declare const COMMON_DEFAULT_OPTIONS_VALUES: {
6
- outputCore: string;
7
- outputServices: string;
8
- outputModels: string;
9
- outputSchemas: string;
10
- httpClient: HttpClient;
11
- useOptions: boolean;
12
- useUnionTypes: boolean;
13
- excludeCoreServiceFiles: boolean;
14
- includeSchemasFiles: boolean;
15
- interfacePrefix: string;
16
- enumPrefix: string;
17
- typePrefix: string;
18
- useCancelableRequest: boolean;
19
- logLevel: ELogLevel;
20
- logTarget: ELogOutput;
21
- sortByRequired: boolean;
22
- useSeparatedIndexes: boolean;
23
- };
4
+ export declare const COMMON_DEFAULT_OPTIONS_VALUES: TStrictFlatOptions;
24
5
  export declare const APP_LOGGER: Logger;
25
6
  //# sourceMappingURL=Consts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Consts.d.ts","sourceRoot":"","sources":["../../src/common/Consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAErE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;CAkBzC,CAAC;AAEF,eAAO,MAAM,UAAU,QAIrB,CAAC"}
1
+ {"version":3,"file":"Consts.d.ts","sourceRoot":"","sources":["../../src/common/Consts.ts"],"names":[],"mappings":"AAEA,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,kBAqB3C,CAAC;AAEF,eAAO,MAAM,UAAU,QAIrB,CAAC"}
@@ -1,20 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.APP_LOGGER = exports.COMMON_DEFAULT_OPTIONS_VALUES = exports.DEFAULT_OPENAPI_CONFIG_FILENAME = void 0;
4
- const core_1 = require("../core");
4
+ const HttpClient_enum_1 = require("../core/types/enums/HttpClient.enum");
5
5
  const Enums_1 = require("./Enums");
6
6
  const Logger_1 = require("./Logger");
7
7
  exports.DEFAULT_OPENAPI_CONFIG_FILENAME = 'openapi.config.json';
8
8
  exports.COMMON_DEFAULT_OPTIONS_VALUES = {
9
+ input: '',
10
+ output: '',
9
11
  outputCore: '',
10
12
  outputServices: '',
11
13
  outputModels: '',
12
14
  outputSchemas: '',
13
- httpClient: core_1.HttpClient.FETCH,
15
+ httpClient: HttpClient_enum_1.HttpClient.FETCH,
14
16
  useOptions: false,
15
17
  useUnionTypes: false,
16
18
  excludeCoreServiceFiles: false,
17
19
  includeSchemasFiles: false,
20
+ request: '',
18
21
  interfacePrefix: 'I',
19
22
  enumPrefix: 'E',
20
23
  typePrefix: 'T',
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/common/Logger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGhD,UAAU,aAAa;IACnB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,KAAK,EAAE,SAAS,CAAC;IACjB,0CAA0C;IAC1C,SAAS,EAAE,UAAU,CAAC;IACtB,mDAAmD;IACnD,sDAAsD;IACtD,MAAM,CAAC,EAAE;QACL,6CAA6C;QAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,+CAA+C;QAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,uDAAuD;QACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACL;AAED,qBAAa,MAAM;IACf,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,WAAW,CAAS;gBAEhB,OAAO,EAAE,aAAa;IA6C3B,QAAQ,CAAC,KAAK,EAAE,SAAS;IAKzB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAKlC,IAAI,CAAC,OAAO,EAAE,MAAM;IAIpB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO;IAO5C,SAAS,CAAC,OAAO,EAAE,MAAM;IAOzB,cAAc,IAAI,IAAI;CAahC"}
1
+ {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/common/Logger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIhD,UAAU,aAAa;IACnB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,KAAK,EAAE,SAAS,CAAC;IACjB,0CAA0C;IAC1C,SAAS,EAAE,UAAU,CAAC;IACtB,mDAAmD;IACnD,sDAAsD;IACtD,MAAM,CAAC,EAAE;QACL,6CAA6C;QAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,+CAA+C;QAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,uDAAuD;QACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACL;AAED,qBAAa,MAAM;IACf,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,WAAW,CAAS;gBAEhB,OAAO,EAAE,aAAa;IA6C3B,QAAQ,CAAC,KAAK,EAAE,SAAS;IAKzB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAKlC,IAAI,CAAC,OAAO,EAAE,MAAM;IAIpB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO;IAO5C,SAAS,CAAC,OAAO,EAAE,MAAM;IAOzB,cAAc,IAAI,IAAI;CAahC"}
@@ -7,6 +7,7 @@ exports.Logger = void 0;
7
7
  const winston_1 = require("winston");
8
8
  const winston_daily_rotate_file_1 = __importDefault(require("winston-daily-rotate-file"));
9
9
  const Enums_1 = require("./Enums");
10
+ const LoggerMessages_1 = require("./LoggerMessages");
10
11
  const pathHelpers_1 = require("./utils/pathHelpers");
11
12
  class Logger {
12
13
  _logger;
@@ -49,7 +50,7 @@ class Logger {
49
50
  this._logger.level = level;
50
51
  }
51
52
  error(message, error) {
52
- this._logger.error(`Error: ${message}`, error);
53
+ this._logger.error(`${LoggerMessages_1.LOGGER_MESSAGES.ERROR.PREFIX} ${message}`, error);
53
54
  process.exit(1);
54
55
  }
55
56
  warn(message) {
@@ -58,7 +59,7 @@ class Logger {
58
59
  info(message, hasSeparator) {
59
60
  this._logger.info(message);
60
61
  if (hasSeparator) {
61
- this._logger.info('==========================================');
62
+ this._logger.info(LoggerMessages_1.LOGGER_MESSAGES.SEPARATOR);
62
63
  }
63
64
  }
64
65
  forceInfo(message) {
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Константы с текстовыми сообщениями для Logger
3
+ * Все тексты для логирования должны быть вынесены сюда для централизованного управления
4
+ */
5
+ export declare const LOGGER_MESSAGES: {
6
+ readonly GENERATION: {
7
+ readonly STARTED: (count: number) => string;
8
+ readonly FINISHED: "Generation has been finished";
9
+ readonly FINISHED_WITH_DURATION: (duration: string) => string;
10
+ readonly DURATION_FOR_FILE: (file: string, duration: string) => string;
11
+ readonly NO_OPTIONS: "No options provided for generation";
12
+ };
13
+ readonly OPENAPI: {
14
+ readonly DEFINING_VERSION: "Defining the version of the openapi specification (2 or 3)";
15
+ readonly WRITING_V2: "Write our OpenAPI client version 2 to disk.";
16
+ readonly WRITING_V3: "Write our OpenAPI client version 3 to disk.";
17
+ };
18
+ readonly FILES: {
19
+ readonly CORE_RECORDING_STARTED: "The recording of the kernel files begins";
20
+ readonly CORE_RECORDING_COMPLETED: "The writing of the kernel files has been completed successfully";
21
+ readonly SERVICES_RECORDING_STARTED: "Recording of service files begins";
22
+ readonly SERVICES_RECORDING_COMPLETED: "Service file recording completed successfully";
23
+ readonly SERVICE_FILE_STARTED: (file: string) => string;
24
+ readonly SERVICE_FILE_COMPLETED: (file: string) => string;
25
+ readonly MODELS_RECORDING_STARTED: "Recording of model files begins";
26
+ readonly MODELS_RECORDING_COMPLETED: "Model file recording completed successfully";
27
+ readonly MODEL_FILE_STARTED: (file: string) => string;
28
+ readonly MODEL_FILE_COMPLETED: (file: string) => string;
29
+ readonly MODEL_DIRECTORY_CREATING: (directory: string) => string;
30
+ readonly SCHEMAS_RECORDING_STARTED: "The recording of model validation schema files begins.";
31
+ readonly SCHEMAS_RECORDING_COMPLETED: "The recording of model validation schema files has been completed successfully";
32
+ readonly SCHEMA_FILE_STARTED: (file: string) => string;
33
+ readonly SCHEMA_FILE_COMPLETED: (file: string) => string;
34
+ readonly SCHEMA_DIRECTORY_CREATING: (directory: string) => string;
35
+ readonly INDEX_DATA_WRITTEN: (filePath: string) => string;
36
+ readonly INDEX_WRITING_COMPLETED: (filePath: string) => string;
37
+ readonly SIMPLE_INDEX_STARTED: (filePath: string) => string;
38
+ readonly SIMPLE_INDEX_COMPLETED: (filePath: string) => string;
39
+ };
40
+ readonly UPDATE_NOTIFIER: {
41
+ readonly MISSING_PARAMS: (packageName: string, packageVersion: string) => string;
42
+ readonly STORE_NOT_CREATED: "The settings store has not been created. The package update will be checked more often than once every 1 week!";
43
+ readonly CANT_GET_VERSION: "Couldn't get information about the latest current version";
44
+ };
45
+ readonly TEMPLATES: {
46
+ readonly PRECOMPILATION_SUCCESS: "The templates have been successfully precompiled and saved!";
47
+ readonly PRECOMPILATION_ERROR: (error: string) => string;
48
+ };
49
+ readonly CONFIG: {
50
+ readonly FILE_RECORDING_COMPLETED: (file: string) => string;
51
+ readonly FILE_ALREADY_EXISTS: (fileName: string) => string;
52
+ readonly FILE_MISSING: "The configuration file is missing";
53
+ readonly CONVERSION_FAILED: "Couldn't convert the set of options to the current version";
54
+ readonly FILE_UPDATED: (configPath: string) => string;
55
+ readonly ACTION_SKIPPED: "Action skipped.";
56
+ readonly UNKNOWN_ACTION: (action: string) => string;
57
+ };
58
+ readonly ERROR: {
59
+ readonly PREFIX: "Error:";
60
+ readonly GENERIC: (message: string) => string;
61
+ };
62
+ readonly SEPARATOR: "==========================================";
63
+ };
64
+ //# sourceMappingURL=LoggerMessages.d.ts.map
@@ -0,0 +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;;;;oCAMZ,MAAM;;;CAKvB,CAAC"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOGGER_MESSAGES = void 0;
4
+ /**
5
+ * Константы с текстовыми сообщениями для Logger
6
+ * Все тексты для логирования должны быть вынесены сюда для централизованного управления
7
+ */
8
+ exports.LOGGER_MESSAGES = {
9
+ // ========== Generation Messages (OpenApiClient) ==========
10
+ GENERATION: {
11
+ STARTED: (count) => `Generation has begun. Total number of specification files: ${count}`,
12
+ FINISHED: 'Generation has been finished',
13
+ FINISHED_WITH_DURATION: (duration) => `Generation completed in ${duration} ms`,
14
+ DURATION_FOR_FILE: (file, duration) => `Duration for "${file}": ${duration} sec`,
15
+ NO_OPTIONS: 'No options provided for generation',
16
+ },
17
+ // ========== OpenAPI Specification Messages ==========
18
+ OPENAPI: {
19
+ DEFINING_VERSION: 'Defining the version of the openapi specification (2 or 3)',
20
+ WRITING_V2: 'Write our OpenAPI client version 2 to disk.',
21
+ WRITING_V3: 'Write our OpenAPI client version 3 to disk.',
22
+ },
23
+ // ========== File Writing Messages (WriteClient) ==========
24
+ FILES: {
25
+ // Core files
26
+ CORE_RECORDING_STARTED: 'The recording of the kernel files begins',
27
+ CORE_RECORDING_COMPLETED: 'The writing of the kernel files has been completed successfully',
28
+ // Service files
29
+ SERVICES_RECORDING_STARTED: 'Recording of service files begins',
30
+ SERVICES_RECORDING_COMPLETED: 'Service file recording completed successfully',
31
+ SERVICE_FILE_STARTED: (file) => `The recording of the file data begins: ${file}`,
32
+ SERVICE_FILE_COMPLETED: (file) => `File recording completed: ${file}`,
33
+ // Model files
34
+ MODELS_RECORDING_STARTED: 'Recording of model files begins',
35
+ MODELS_RECORDING_COMPLETED: 'Model file recording completed successfully',
36
+ MODEL_FILE_STARTED: (file) => `The recording of the file data begins: ${file}`,
37
+ MODEL_FILE_COMPLETED: (file) => `File recording completed: ${file}`,
38
+ MODEL_DIRECTORY_CREATING: (directory) => `A directory is being created: ${directory}`,
39
+ // Schema files
40
+ SCHEMAS_RECORDING_STARTED: 'The recording of model validation schema files begins.',
41
+ SCHEMAS_RECORDING_COMPLETED: 'The recording of model validation schema files has been completed successfully',
42
+ SCHEMA_FILE_STARTED: (file) => `The recording of the file data begins: ${file}`,
43
+ SCHEMA_FILE_COMPLETED: (file) => `File recording completed: ${file}`,
44
+ SCHEMA_DIRECTORY_CREATING: (directory) => `A directory is being created: ${directory}`,
45
+ // Index files
46
+ INDEX_DATA_WRITTEN: (filePath) => `Data has been written to a file: ${filePath}`,
47
+ INDEX_WRITING_COMPLETED: (filePath) => `Writing to the file is completed: ${filePath}`,
48
+ SIMPLE_INDEX_STARTED: (filePath) => `The recording of the file data begins: ${filePath}`,
49
+ SIMPLE_INDEX_COMPLETED: (filePath) => `File recording completed: ${filePath}`,
50
+ },
51
+ // ========== Update Notifier Messages ==========
52
+ UPDATE_NOTIFIER: {
53
+ MISSING_PARAMS: (packageName, packageVersion) => `
54
+ The necessary parameters for checking the version are not specified.
55
+ Current values packageName: ${packageName}, packageVersion: ${packageVersion}
56
+ `,
57
+ STORE_NOT_CREATED: 'The settings store has not been created. The package update will be checked more often than once every 1 week!',
58
+ CANT_GET_VERSION: "Couldn't get information about the latest current version",
59
+ },
60
+ // ========== Template Precompilation Messages ==========
61
+ TEMPLATES: {
62
+ PRECOMPILATION_SUCCESS: 'The templates have been successfully precompiled and saved!',
63
+ PRECOMPILATION_ERROR: (error) => `Error during pre-compilation of templates: ${error}`,
64
+ },
65
+ // ========== Config Messages (CLI) ==========
66
+ CONFIG: {
67
+ FILE_RECORDING_COMPLETED: (file) => `File recording completed: ${file}`,
68
+ FILE_ALREADY_EXISTS: (fileName) => `The configuration file already exists: ${fileName}`,
69
+ FILE_MISSING: 'The configuration file is missing',
70
+ CONVERSION_FAILED: "Couldn't convert the set of options to the current version",
71
+ FILE_UPDATED: (configPath) => `Configuration file "${configPath}" has been updated`,
72
+ ACTION_SKIPPED: 'Action skipped.',
73
+ UNKNOWN_ACTION: (action) => `Unknown action: ${action}`,
74
+ },
75
+ // ========== Error Messages ==========
76
+ ERROR: {
77
+ PREFIX: 'Error:',
78
+ GENERIC: (message) => message,
79
+ },
80
+ // ========== Separator ==========
81
+ SEPARATOR: '==========================================',
82
+ };
@@ -0,0 +1,40 @@
1
+ import { HttpClient } from '../core/types/enums/HttpClient.enum';
2
+ import { ELogLevel, ELogOutput } from './Enums';
3
+ type TItemConfig = {
4
+ input: string;
5
+ output: string;
6
+ outputCore?: string;
7
+ outputServices?: string;
8
+ outputModels?: string;
9
+ outputSchemas?: string;
10
+ request?: string;
11
+ };
12
+ export type TRawOptions = {
13
+ items?: TItemConfig[];
14
+ input?: string;
15
+ output?: string;
16
+ outputCore?: string;
17
+ outputServices?: string;
18
+ outputModels?: string;
19
+ outputSchemas?: string;
20
+ httpClient?: HttpClient;
21
+ useOptions?: boolean;
22
+ useUnionTypes?: boolean;
23
+ excludeCoreServiceFiles?: boolean;
24
+ includeSchemasFiles?: boolean;
25
+ request?: string;
26
+ interfacePrefix?: string;
27
+ enumPrefix?: string;
28
+ typePrefix?: string;
29
+ useCancelableRequest?: boolean;
30
+ logLevel?: ELogLevel;
31
+ logTarget?: ELogOutput;
32
+ sortByRequired?: boolean;
33
+ useSeparatedIndexes?: boolean;
34
+ };
35
+ export type TFlatOptions = Omit<TRawOptions, 'items'>;
36
+ export type TStrictFlatOptions = {
37
+ [P in keyof TFlatOptions]-?: NonNullable<TFlatOptions[P]>;
38
+ };
39
+ export {};
40
+ //# sourceMappingURL=TRawOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TRawOptions.d.ts","sourceRoot":"","sources":["../../src/common/TRawOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhD,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG;KAC9B,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAC1D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { SchemaMigrationPlan } from '../Types';
2
+ /**
3
+ * Unified migration plan that includes all migrations from all schema types.
4
+ * Migrates from any old version to the latest UNIFIED_v1 schema.
5
+ * Reuses existing migration plans to avoid code duplication.
6
+ */
7
+ export declare const allMigrationPlans: SchemaMigrationPlan<Record<string, any>, Record<string, any>>[];
8
+ //# sourceMappingURL=AllMigrationPlans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllMigrationPlans.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAc/C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAY5F,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allMigrationPlans = void 0;
4
+ const MultiOptionsMigrationPlan_1 = require("../MultiOptionsVersioned/MultiOptionsMigrationPlan");
5
+ const OptionsMigrationPlans_1 = require("../OptionsVersioned/OptionsMigrationPlans");
6
+ const createTrivialMigration_1 = require("../Utils/createTrivialMigration");
7
+ /**
8
+ * Adds a prefix to all version strings in a migration plan array.
9
+ */
10
+ function addVersionPrefixToMigrationPlans(plans, prefix) {
11
+ return plans.map(plan => ({
12
+ ...plan,
13
+ fromVersion: `${prefix}_${plan.fromVersion}`,
14
+ toVersion: `${prefix}_${plan.toVersion}`,
15
+ }));
16
+ }
17
+ /**
18
+ * Unified migration plan that includes all migrations from all schema types.
19
+ * Migrates from any old version to the latest UNIFIED_v1 schema.
20
+ * Reuses existing migration plans to avoid code duplication.
21
+ */
22
+ exports.allMigrationPlans = [
23
+ // ===== OPTIONS migrations (with prefix) =====
24
+ ...addVersionPrefixToMigrationPlans(OptionsMigrationPlans_1.optionsMigrationPlans, 'OPTIONS'),
25
+ // Migration from OPTIONS v4 to UNIFIED v1
26
+ (0, createTrivialMigration_1.createTrivialMigration)('OPTIONS_v4', 'UNIFIED_v1', 'Migrate from OPTIONS to UNIFIED schema'),
27
+ // ===== MULTI_OPTIONS migrations (with prefix) =====
28
+ ...addVersionPrefixToMigrationPlans(MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan, 'MULTI_OPTIONS'),
29
+ // Migration from MULTI_OPTIONS v5 to UNIFIED v1
30
+ (0, createTrivialMigration_1.createTrivialMigration)('MULTI_OPTIONS_v5', 'UNIFIED_v1', 'Migrate from MULTI_OPTIONS to UNIFIED schema'),
31
+ ];
@@ -0,0 +1,8 @@
1
+ import { VersionedSchema } from '../Types';
2
+ /**
3
+ * Unified array of all versioned schemas with prefixed versions.
4
+ * This allows migration from any old schema version to the latest unified schema.
5
+ * Reuses existing schema arrays to avoid code duplication.
6
+ */
7
+ export declare const allVersionedSchemas: VersionedSchema<Record<string, any>>[];
8
+ //# sourceMappingURL=AllVersionedSchemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllVersionedSchemas.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAgB3C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAarE,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allVersionedSchemas = void 0;
4
+ const Enums_1 = require("../Enums");
5
+ const MultiOptionsVersionedSchemas_1 = require("../MultiOptionsVersioned/MultiOptionsVersionedSchemas");
6
+ const OptionsVersionedSchemas_1 = require("../OptionsVersioned/OptionsVersionedSchemas");
7
+ const UnifiedOptionsSchemaV1_1 = require("../UnifiedOptionsVersioned/UnifiedOptionsSchemaV1");
8
+ /**
9
+ * Adds a prefix to all version strings in a versioned schema array.
10
+ */
11
+ function addVersionPrefix(schemas, prefix) {
12
+ return schemas.map(schema => ({
13
+ ...schema,
14
+ version: `${prefix}_${schema.version}`,
15
+ }));
16
+ }
17
+ /**
18
+ * Unified array of all versioned schemas with prefixed versions.
19
+ * This allows migration from any old schema version to the latest unified schema.
20
+ * Reuses existing schema arrays to avoid code duplication.
21
+ */
22
+ exports.allVersionedSchemas = [
23
+ // OPTIONS schemas with prefix
24
+ ...addVersionPrefix(OptionsVersionedSchemas_1.optionsVersionedSchemas, 'OPTIONS'),
25
+ // MULTI_OPTIONS schemas with prefix
26
+ ...addVersionPrefix(MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema, 'MULTI_OPTIONS'),
27
+ // UNIFIED_OPTIONS schemas (latest)
28
+ {
29
+ version: 'UNIFIED_v1',
30
+ schema: UnifiedOptionsSchemaV1_1.unifiedOptionsSchemaV1,
31
+ type: Enums_1.EVersionedSchemaType.UNIFIED_OPTIONS,
32
+ },
33
+ ];
@@ -1,5 +1,6 @@
1
1
  export declare enum EVersionedSchemaType {
2
2
  OPTIONS = "OPTIONS",
3
- MULTI_OPTIONS = "MULTI_OPTIONS"
3
+ MULTI_OPTIONS = "MULTI_OPTIONS",
4
+ UNIFIED_OPTIONS = "UNIFIED_OPTIONS"
4
5
  }
5
6
  //# sourceMappingURL=Enums.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Enums.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/Enums.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC5B,OAAO,YAAY;IACnB,aAAa,kBAAkB;CAClC"}
1
+ {"version":3,"file":"Enums.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/Enums.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC5B,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;CACtC"}
@@ -5,4 +5,5 @@ var EVersionedSchemaType;
5
5
  (function (EVersionedSchemaType) {
6
6
  EVersionedSchemaType["OPTIONS"] = "OPTIONS";
7
7
  EVersionedSchemaType["MULTI_OPTIONS"] = "MULTI_OPTIONS";
8
+ EVersionedSchemaType["UNIFIED_OPTIONS"] = "UNIFIED_OPTIONS";
8
9
  })(EVersionedSchemaType || (exports.EVersionedSchemaType = EVersionedSchemaType = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"MultiOptionsMigrationPlan.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAoCpG,CAAC"}
1
+ {"version":3,"file":"MultiOptionsMigrationPlan.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EA0BpG,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.multiOptionsMigrationPlan = void 0;
4
+ const createDefaultFieldsMigration_1 = require("../Utils/createDefaultFieldsMigration");
4
5
  /**
5
6
  * Migration plan for multi options models.
6
7
  */
@@ -13,14 +14,9 @@ exports.multiOptionsMigrationPlan = [
13
14
  httpClient: client,
14
15
  }),
15
16
  },
16
- {
17
- fromVersion: 'v2',
18
- toVersion: 'v3',
19
- migrate: oldVersion => ({
20
- ...oldVersion,
21
- useCancelableRequest: false,
22
- }),
23
- },
17
+ (0, createDefaultFieldsMigration_1.createDefaultFieldsMigration)('v2', 'v3', {
18
+ useCancelableRequest: false,
19
+ }),
24
20
  {
25
21
  fromVersion: 'v3',
26
22
  toVersion: 'v4',
@@ -29,15 +25,10 @@ exports.multiOptionsMigrationPlan = [
29
25
  items: items.map((el) => ({ ...el, input, output, outputCore, outputServices, outputModels, outputSchemas })),
30
26
  }),
31
27
  },
32
- {
33
- fromVersion: 'v4',
34
- toVersion: 'v5',
35
- migrate: oldVersion => ({
36
- ...oldVersion,
37
- excludeCoreServiceFiles: false,
38
- includeSchemasFiles: false,
39
- sortByRequired: false,
40
- useSeparatedIndexes: false,
41
- }),
42
- },
28
+ (0, createDefaultFieldsMigration_1.createDefaultFieldsMigration)('v4', 'v5', {
29
+ excludeCoreServiceFiles: false,
30
+ includeSchemasFiles: false,
31
+ sortByRequired: false,
32
+ useSeparatedIndexes: false,
33
+ }),
43
34
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsMigrationPlans.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAgBhG,CAAC"}
1
+ {"version":3,"file":"OptionsMigrationPlans.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAehG,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.optionsMigrationPlans = void 0;
4
+ const createDefaultFieldsMigration_1 = require("../Utils/createDefaultFieldsMigration");
4
5
  /**
5
6
  * Migration plan for option models.
6
7
  */
@@ -10,14 +11,13 @@ exports.optionsMigrationPlans = [
10
11
  toVersion: 'v2',
11
12
  migrate: ({ client, ...otherProps }) => ({ ...otherProps, httpClient: client }),
12
13
  },
13
- {
14
- fromVersion: 'v2',
15
- toVersion: 'v3',
16
- migrate: oldVersion => ({ ...oldVersion, useCancelableRequest: false }),
17
- },
18
- {
19
- fromVersion: 'v3',
20
- toVersion: 'v4',
21
- migrate: oldVersion => ({ ...oldVersion, excludeCoreServiceFiles: false, includeSchemasFiles: false, sortByRequired: false, useSeparatedIndexes: false }),
22
- },
14
+ (0, createDefaultFieldsMigration_1.createDefaultFieldsMigration)('v2', 'v3', {
15
+ useCancelableRequest: false,
16
+ }),
17
+ (0, createDefaultFieldsMigration_1.createDefaultFieldsMigration)('v3', 'v4', {
18
+ excludeCoreServiceFiles: false,
19
+ includeSchemasFiles: false,
20
+ sortByRequired: false,
21
+ useSeparatedIndexes: false,
22
+ }),
23
23
  ];
@@ -9,6 +9,11 @@ export type SchemaMigrationPlan<From, To> = {
9
9
  fromVersion: string;
10
10
  toVersion: string;
11
11
  migrate: (input: From) => To;
12
+ /**
13
+ * Optional description of what this migration does.
14
+ * Helps with debugging and documentation.
15
+ */
16
+ description?: string;
12
17
  };
13
18
  export type TraverseHandler<T> = (value: any, recurse: (v: any) => void, result: T) => boolean;
14
19
  export type VersionMatchResult = {
@@ -1 +1 @@
1
- {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/Types.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACtB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,IAAI,EAAE,EAAE,IAAI;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC;CAChC,CAAA;AAGD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;AAG/F,MAAM,MAAM,kBAAkB,GAAG;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/Types.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACtB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,IAAI,EAAE,EAAE,IAAI;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;AAE/F,MAAM,MAAM,kBAAkB,GAAG;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { SchemaMigrationPlan } from "../Types";
2
+ export declare const unifiedOptionsMigrationPlan: SchemaMigrationPlan<Record<string, any>, Record<string, any>>[];
3
+ //# sourceMappingURL=UnifiedOptionsMigrationPlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnifiedOptionsMigrationPlan.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAwBtG,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unifiedOptionsMigrationPlan = void 0;
4
+ exports.unifiedOptionsMigrationPlan = [
5
+ // Migration from OPTIONS v4 to UNIFIED_OPTIONS v1
6
+ // OPTIONS v4 already has input/output structure, so we just pass it through
7
+ // Unified schema supports this format directly
8
+ {
9
+ fromVersion: 'OPTIONS_v4',
10
+ toVersion: 'UNIFIED_v1',
11
+ migrate: (oldVersion) => {
12
+ // OPTIONS v4 structure is already compatible with unified schema
13
+ // Just return as-is, unified schema will handle input/output
14
+ return { ...oldVersion };
15
+ },
16
+ },
17
+ // Migration from MULTI_OPTIONS v5 to UNIFIED_OPTIONS v1
18
+ // MULTI_OPTIONS v5 has items array, which unified schema also supports
19
+ {
20
+ fromVersion: 'MULTI_OPTIONS_v5',
21
+ toVersion: 'UNIFIED_v1',
22
+ migrate: (oldVersion) => {
23
+ // MULTI_OPTIONS v5 structure with items is already compatible
24
+ // Just return as-is, unified schema will handle items
25
+ return { ...oldVersion };
26
+ },
27
+ },
28
+ ];
@@ -0,0 +1,7 @@
1
+ import Joi from 'joi';
2
+ /**
3
+ * Unified options schema that supports both single and multi-item configurations.
4
+ * Use either 'items' array for multiple specs OR 'input'/'output' for single spec.
5
+ */
6
+ export declare const unifiedOptionsSchemaV1: Joi.ObjectSchema<any>;
7
+ //# sourceMappingURL=UnifiedOptionsSchemaV1.d.ts.map