ts-openapi-codegen 2.0.0-beta.10 → 2.0.0-beta.12

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 (81) hide show
  1. package/README.md +2 -0
  2. package/README.rus.md +2 -2
  3. package/dist/cli/index.js +3 -1
  4. package/dist/common/Consts.d.ts.map +1 -1
  5. package/dist/common/Consts.js +3 -1
  6. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts +1 -1
  7. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
  8. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +14 -4
  9. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +2 -2
  10. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +2 -2
  11. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +2 -2
  12. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts +42 -0
  13. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -0
  14. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +41 -0
  15. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +6 -4
  16. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -1
  17. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +7 -1
  18. package/dist/common/VersionedSchema/CommonSchemas.d.ts +12 -4
  19. package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
  20. package/dist/common/VersionedSchema/CommonSchemas.js +15 -7
  21. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +2 -2
  22. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +2 -2
  23. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +2 -2
  24. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +2 -2
  25. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +2 -2
  26. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -1
  27. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +6 -0
  28. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +19 -1
  29. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +4 -0
  30. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
  31. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +68 -23
  32. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +10 -0
  33. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
  34. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +31 -14
  35. package/dist/common/defaultOptions.d.ts.map +1 -1
  36. package/dist/common/defaultOptions.js +2 -0
  37. package/dist/common/utils/__tests__/convertArrayToObject.test.js +10 -5
  38. package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
  39. package/dist/common/utils/convertArrayToObject.js +1 -0
  40. package/dist/core/OpenApiClient.d.ts.map +1 -1
  41. package/dist/core/OpenApiClient.js +7 -1
  42. package/dist/core/WriteClient.d.ts +7 -1
  43. package/dist/core/WriteClient.d.ts.map +1 -1
  44. package/dist/core/WriteClient.js +44 -7
  45. package/dist/core/__tests__/WriteClient.test.js +2 -0
  46. package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts +6 -0
  47. package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts.map +1 -0
  48. package/dist/core/types/enums/EmptySchemaStrategy.enum.js +9 -0
  49. package/dist/core/utils/__tests__/writeClientSchemas.test.js +2 -0
  50. package/dist/core/utils/precompileTemplates.js +1 -0
  51. package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
  52. package/dist/core/utils/registerHandlebarHelpers.js +25 -0
  53. package/dist/core/utils/writeClientSchemas.d.ts +4 -1
  54. package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
  55. package/dist/core/utils/writeClientSchemas.js +11 -2
  56. package/dist/templatesCompiled/client/joi/exportSchema.js +2 -2
  57. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +5 -3
  58. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -1
  59. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +36 -9
  60. package/dist/templatesCompiled/client/jsonschema/exportSchema.js +2 -2
  61. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +3 -1
  62. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -1
  63. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +43 -13
  64. package/dist/templatesCompiled/client/yup/exportSchema.js +2 -2
  65. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +5 -3
  66. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -1
  67. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +36 -9
  68. package/dist/templatesCompiled/client/zod/exportSchema.js +2 -2
  69. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +5 -6
  70. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -1
  71. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +14 -28
  72. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +3 -0
  73. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -1
  74. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +28 -4
  75. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +3 -4
  76. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -1
  77. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +9 -23
  78. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +4 -2
  79. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -1
  80. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +15 -4
  81. package/package.json +1 -1
package/README.md CHANGED
@@ -74,6 +74,7 @@ openapi generate --input ./spec.json --output ./dist
74
74
  | `--logLevel` | `-l` | string | `error` | Logging level: `info`, `warn`, or `error` |
75
75
  | `--logTarget` | `-t` | string | `console` | Logging target: `console` or `file` |
76
76
  | `--validationLibrary` | - | string | `none` | Validation library for schema generation: `none`, `zod`, `joi`, `yup`, or `jsonschema` |
77
+ | `--emptySchemaStrategy` | - | string | `keep` | Strategy for empty schemas: `keep`, `semantic`, or `skip` |
77
78
 
78
79
  **Examples:**
79
80
  ```bash
@@ -207,6 +208,7 @@ Instead of passing all options via CLI, you can use a configuration file. Create
207
208
  | `useSeparatedIndexes` | boolean | `false` | Use separate index files |
208
209
  | `items` | array | - | Array of configurations (for multi-options format) |
209
210
  | `validationLibrary` | string | `none` | Validation library for schema generation: `none`, `zod`, `joi`, `yup`, or `jsonschema` |
211
+ | `emptySchemaStrategy` | string | `keep` | Strategy for empty schemas: `keep`, `semantic`, or `skip` |
210
212
 
211
213
  **Note:** You can use the `init-openapi-config` command to generate a template configuration file.
212
214
 
package/README.rus.md CHANGED
@@ -73,6 +73,7 @@ openapi generate --input ./spec.json --output ./dist
73
73
  | `--logLevel` | `-l` | string | `error` | Уровень логирования: `info`, `warn`, или `error` |
74
74
  | `--logTarget` | `-t` | string | `console` | Цель логирования: `console` или `file` |
75
75
  | `--validationLibrary` | - | string | `none` | Библиотека валидации для генерации схем: `none`, `zod`, `joi`, `yup`, или `jsonschema` |
76
+ | `--emptySchemaStrategy` | - | string | `keep` | Стратегия для пустых схем: `keep`, `semantic`, или `skip` |
76
77
 
77
78
  **Примеры:**
78
79
  ```bash
@@ -206,6 +207,7 @@ openapi init-openapi-config --openapi-config ./my-config.json
206
207
  | `useSeparatedIndexes` | boolean | `false` | Использовать отдельные index файлы |
207
208
  | `items` | array | - | Массив конфигураций (для формата multi-options) |
208
209
  | `validationLibrary` | string | `none` | Библиотека валидации для генерации схем: `none`, `zod`, `joi`, `yup`, или `jsonschema` |
210
+ | `emptySchemaStrategy` | string | `keep` | Стратегия для пустых схем: `keep`, `semantic`, или `skip` |
209
211
 
210
212
  **Примечание:** Вы можете использовать команду `init-openapi-config` для генерации шаблона файла конфигурации.
211
213
 
@@ -842,5 +844,3 @@ npm install form-data --save-dev
842
844
  [librariesio-image]: https://img.shields.io/librariesio/github/ozonophore/openapi-codegen
843
845
  [lines-image]: https://img.shields.io/tokei/lines/github/ozonophore/openapi-codegen
844
846
 
845
-
846
-
package/dist/cli/index.js CHANGED
@@ -10,6 +10,7 @@ const Consts_1 = require("../common/Consts");
10
10
  const Enums_1 = require("../common/Enums");
11
11
  const UpdateNotifier_1 = require("../common/UpdateNotifier");
12
12
  const pathHelpers_1 = require("../common/utils/pathHelpers");
13
+ const EmptySchemaStrategy_enum_1 = require("../core/types/enums/EmptySchemaStrategy.enum");
13
14
  const HttpClient_enum_1 = require("../core/types/enums/HttpClient.enum");
14
15
  const ValidationLibrary_enum_1 = require("../core/types/enums/ValidationLibrary.enum");
15
16
  const checkConfig_1 = require("./checkAndUpdateConfig/checkConfig");
@@ -57,6 +58,7 @@ program
57
58
  .option('-s, --sortByRequired', 'Property sorting strategy: simplified or extended')
58
59
  .option('--useSeparatedIndexes', 'Use separate index files for the core, models, schemas, and services.')
59
60
  .addOption(new commander_1.Option('--validationLibrary <value>', 'Validation library to use for schema validation').choices([...Object.values(ValidationLibrary_enum_1.ValidationLibrary)]).default(ValidationLibrary_enum_1.ValidationLibrary.NONE))
61
+ .addOption(new commander_1.Option('--emptySchemaStrategy <value>', 'How to handle empty generated schemas').choices([...Object.values(EmptySchemaStrategy_enum_1.EmptySchemaStrategy)]).default(EmptySchemaStrategy_enum_1.EmptySchemaStrategy.KEEP))
60
62
  .hook('preAction', async () => {
61
63
  await updateNotifier.checkAndNotify();
62
64
  })
@@ -75,7 +77,7 @@ program
75
77
  await updateNotifier.checkAndNotify();
76
78
  })
77
79
  .action(async (options) => {
78
- await (0, checkConfig_1.checkConfig)(options.openapiConfig);
80
+ await (0, checkConfig_1.checkConfig)(options);
79
81
  });
80
82
  /**
81
83
  * update - Команда для обновления конфигурационного файла
@@ -1 +1 @@
1
- {"version":3,"file":"Consts.d.ts","sourceRoot":"","sources":["../../src/common/Consts.ts"],"names":[],"mappings":"AAGA,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,kBAsB3C,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"}
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,kBAuB3C,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"}
@@ -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");
@@ -27,7 +28,8 @@ exports.COMMON_DEFAULT_OPTIONS_VALUES = {
27
28
  logTarget: Enums_1.ELogOutput.CONSOLE,
28
29
  sortByRequired: false,
29
30
  useSeparatedIndexes: false,
30
- validationLibrary: ValidationLibrary_enum_1.ValidationLibrary.NONE
31
+ validationLibrary: ValidationLibrary_enum_1.ValidationLibrary.NONE,
32
+ emptySchemaStrategy: EmptySchemaStrategy_enum_1.EmptySchemaStrategy.KEEP,
31
33
  };
32
34
  exports.APP_LOGGER = new Logger_1.Logger({
33
35
  level: Enums_1.ELogLevel.INFO,
@@ -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 UNIFIED_v1 schema.
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":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAgB/C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EA4B5F,CAAC"}
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 UNIFIED_v1 schema.
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)}`, 'UNIFIED_v1', 'Migrate from OPTIONS to UNIFIED schema'),
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)}`, 'UNIFIED_v1', 'Migrate from MULTI_OPTIONS to UNIFIED schema'),
34
- (0, createFieldTransformationMigration_1.createFieldTransformationMigration)('UNIFIED_v1', 'UNIFIED_v2', ({ includeSchemasFiles, ...otherProps }) => {
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
+ import { EmptySchemaStrategy } from '../../../core/types/enums/EmptySchemaStrategy.enum';
3
+ export declare const unifiedOptionsSchemaV4: z.ZodObject<{
4
+ emptySchemaStrategy: z.ZodOptional<z.ZodEnum<typeof EmptySchemaStrategy>>;
5
+ logLevel: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogLevel>>;
6
+ logTarget: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogOutput>>;
7
+ sortByRequired: z.ZodOptional<z.ZodBoolean>;
8
+ useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
9
+ useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
10
+ request: z.ZodOptional<z.ZodString>;
11
+ interfacePrefix: z.ZodOptional<z.ZodString>;
12
+ enumPrefix: z.ZodOptional<z.ZodString>;
13
+ typePrefix: z.ZodOptional<z.ZodString>;
14
+ includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
15
+ outputCore: z.ZodOptional<z.ZodString>;
16
+ outputServices: z.ZodOptional<z.ZodString>;
17
+ outputModels: z.ZodOptional<z.ZodString>;
18
+ outputSchemas: z.ZodOptional<z.ZodString>;
19
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
+ input: z.ZodString;
21
+ request: z.ZodOptional<z.ZodString>;
22
+ sortByRequired: z.ZodOptional<z.ZodBoolean>;
23
+ useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
24
+ useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
25
+ interfacePrefix: z.ZodOptional<z.ZodString>;
26
+ enumPrefix: z.ZodOptional<z.ZodString>;
27
+ typePrefix: z.ZodOptional<z.ZodString>;
28
+ output: z.ZodString;
29
+ outputCore: z.ZodOptional<z.ZodString>;
30
+ outputServices: z.ZodOptional<z.ZodString>;
31
+ outputModels: z.ZodOptional<z.ZodString>;
32
+ outputSchemas: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>>;
34
+ input: z.ZodOptional<z.ZodString>;
35
+ output: z.ZodOptional<z.ZodString>;
36
+ httpClient: z.ZodEnum<typeof import("../../..").HttpClient>;
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,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAQxF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjC,CAAA"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unifiedOptionsSchemaV4 = void 0;
4
+ const zod_1 = require("zod");
5
+ const EmptySchemaStrategy_enum_1 = require("../../../core/types/enums/EmptySchemaStrategy.enum");
6
+ const CommonSchemas_1 = require("../CommonSchemas");
7
+ const UnifiedOptionsSchemaV3_1 = require("./UnifiedOptionsSchemaV3");
8
+ const unifiedOptionsSchemaV3Extended = UnifiedOptionsSchemaV3_1.unifiedOptionsSchemaV3.extend({
9
+ ...CommonSchemas_1.specialParametersSchemasV4.shape,
10
+ });
11
+ exports.unifiedOptionsSchemaV4 = zod_1.z.object({
12
+ ...unifiedOptionsSchemaV3Extended.shape,
13
+ emptySchemaStrategy: zod_1.z.enum(EmptySchemaStrategy_enum_1.EmptySchemaStrategy).optional()
14
+ });
15
+ /*
16
+ type TUnified = {
17
+ httpClient: HttpClient.FETCH | HttpClient.XHR | HttpClient.NODE | HttpClient.AXIOS;
18
+ emptySchemaStrategy: EmptySchemaStrategy.SEMANTIC | EmptySchemaStrategy.SKIP | EmptySchemaStrategy.KEEP | undefined;
19
+ logLevel: ELogLevel.INFO | ELogLevel.WARN | ELogLevel.ERROR | undefined;
20
+ logTarget: ELogOutput.CONSOLE | ELogOutput.FILE | undefined;
21
+ sortByRequired: boolean | undefined;
22
+ useSeparatedIndexes: boolean | undefined;
23
+ useCancelableRequest: boolean | undefined;
24
+ request: string | undefined;
25
+ interfacePrefix: string | undefined;
26
+ enumPrefix: string | undefined;
27
+ typePrefix: string | undefined;
28
+ includeSchemasFiles: boolean | undefined;
29
+ outputCore: string | undefined;
30
+ outputServices: string | undefined;
31
+ outputModels: string | undefined;
32
+ outputSchemas: string | undefined;
33
+ items: { ... 13 more }[] | undefined;
34
+ input: string | undefined;
35
+ output: string | undefined;
36
+ excludeCoreServiceFiles: boolean | undefined;
37
+ validationLibrary: ValidationLibrary.NONE | ValidationLibrary.ZOD | ValidationLibrary.JOI | ValidationLibrary.YUP | ValidationLibrary.JSONSCHEMA | undefined;
38
+ useOptions: boolean | undefined;
39
+ useUnionTypes: boolean | undefined;
40
+ }
41
+ */
@@ -2,12 +2,9 @@ import { z } from 'zod';
2
2
  import { VersionedSchema } from '../Types';
3
3
  export declare const unifiedVersionedSchemas: VersionedSchema<z.ZodTypeAny>[];
4
4
  export declare const rawOptionsSchema: z.ZodObject<{
5
+ emptySchemaStrategy: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/EmptySchemaStrategy.enum").EmptySchemaStrategy>>;
5
6
  logLevel: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogLevel>>;
6
7
  logTarget: z.ZodOptional<z.ZodEnum<typeof import("../../Enums").ELogOutput>>;
7
- useOptions: z.ZodOptional<z.ZodBoolean>;
8
- useUnionTypes: z.ZodOptional<z.ZodBoolean>;
9
- excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
10
- validationLibrary: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/ValidationLibrary.enum").ValidationLibrary>>;
11
8
  sortByRequired: z.ZodOptional<z.ZodBoolean>;
12
9
  useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
13
10
  useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
@@ -38,6 +35,10 @@ export declare const rawOptionsSchema: z.ZodObject<{
38
35
  input: z.ZodOptional<z.ZodString>;
39
36
  output: z.ZodOptional<z.ZodString>;
40
37
  httpClient: z.ZodEnum<typeof import("../../..").HttpClient>;
38
+ excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
39
+ validationLibrary: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/ValidationLibrary.enum").ValidationLibrary>>;
40
+ useOptions: z.ZodOptional<z.ZodBoolean>;
41
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
41
42
  }, z.core.$strip>;
42
43
  export declare const flatOptionsSchema: z.ZodObject<{
43
44
  outputCore: z.ZodOptional<z.ZodString>;
@@ -49,6 +50,7 @@ export declare const flatOptionsSchema: z.ZodObject<{
49
50
  excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
50
51
  includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
51
52
  validationLibrary: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/ValidationLibrary.enum").ValidationLibrary>>;
53
+ emptySchemaStrategy: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/EmptySchemaStrategy.enum").EmptySchemaStrategy>>;
52
54
  request: z.ZodOptional<z.ZodString>;
53
55
  interfacePrefix: z.ZodOptional<z.ZodString>;
54
56
  enumPrefix: z.ZodOptional<z.ZodString>;
@@ -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;AAM3C,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,EAgBlE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyB,CAAC;AAEvD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;iBAG5B,CAAC"}
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;AAO3C,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,EAqBlE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyB,CAAC;AAEvD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;iBAG5B,CAAC"}
@@ -7,6 +7,7 @@ const buildVersionedSchema_1 = require("../Utils/buildVersionedSchema");
7
7
  const UnifiedOptionsSchemaV1_1 = require("./UnifiedOptionsSchemaV1");
8
8
  const UnifiedOptionsSchemaV2_1 = require("./UnifiedOptionsSchemaV2");
9
9
  const UnifiedOptionsSchemaV3_1 = require("./UnifiedOptionsSchemaV3");
10
+ const UnifiedOptionsSchemaV4_1 = require("./UnifiedOptionsSchemaV4");
10
11
  exports.unifiedVersionedSchemas = [
11
12
  (0, buildVersionedSchema_1.buildVersionedSchema)({
12
13
  version: 'v1',
@@ -23,8 +24,13 @@ exports.unifiedVersionedSchemas = [
23
24
  base: UnifiedOptionsSchemaV3_1.unifiedOptionsSchemaV3,
24
25
  type: Enums_1.EVersionedSchemaType.UNIFIED_OPTIONS,
25
26
  }),
27
+ (0, buildVersionedSchema_1.buildVersionedSchema)({
28
+ version: 'v4',
29
+ base: UnifiedOptionsSchemaV4_1.unifiedOptionsSchemaV4,
30
+ type: Enums_1.EVersionedSchemaType.UNIFIED_OPTIONS,
31
+ })
26
32
  ];
27
- exports.rawOptionsSchema = UnifiedOptionsSchemaV3_1.unifiedOptionsSchemaV3;
33
+ exports.rawOptionsSchema = UnifiedOptionsSchemaV4_1.unifiedOptionsSchemaV4;
28
34
  exports.flatOptionsSchema = exports.rawOptionsSchema.omit({ items: true }).extend({
29
35
  input: zod_1.z.string().min(1, 'Input is required'),
30
36
  output: zod_1.z.string().min(1, 'Output is required'),
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { EmptySchemaStrategy } from '../../core/types/enums/EmptySchemaStrategy.enum';
2
3
  import { ValidationLibrary } from '../../core/types/enums/ValidationLibrary.enum';
3
4
  /** Output paths */
4
5
  export declare const outputPathsSchema: z.ZodObject<{
@@ -9,24 +10,31 @@ export declare const outputPathsSchema: z.ZodObject<{
9
10
  outputSchemas: z.ZodOptional<z.ZodString>;
10
11
  }, z.core.$strip>;
11
12
  export declare const specialParametersSchemas: z.ZodObject<{
12
- useOptions: z.ZodOptional<z.ZodBoolean>;
13
- useUnionTypes: z.ZodOptional<z.ZodBoolean>;
14
13
  exportCore: z.ZodOptional<z.ZodBoolean>;
15
14
  exportServices: z.ZodOptional<z.ZodBoolean>;
16
15
  exportModels: z.ZodOptional<z.ZodBoolean>;
17
16
  exportSchemas: z.ZodOptional<z.ZodBoolean>;
18
- }, z.core.$strip>;
19
- export declare const specialParametersSchemasV2: z.ZodObject<{
20
17
  useOptions: z.ZodOptional<z.ZodBoolean>;
21
18
  useUnionTypes: z.ZodOptional<z.ZodBoolean>;
19
+ }, z.core.$strip>;
20
+ export declare const specialParametersSchemasV2: z.ZodObject<{
22
21
  excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
23
22
  includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
23
+ useOptions: z.ZodOptional<z.ZodBoolean>;
24
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
24
25
  }, z.core.$strip>;
25
26
  export declare const specialParametersSchemasV3: z.ZodObject<{
27
+ excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
28
+ validationLibrary: z.ZodOptional<z.ZodEnum<typeof ValidationLibrary>>;
26
29
  useOptions: z.ZodOptional<z.ZodBoolean>;
27
30
  useUnionTypes: z.ZodOptional<z.ZodBoolean>;
31
+ }, z.core.$strip>;
32
+ export declare const specialParametersSchemasV4: z.ZodObject<{
33
+ emptySchemaStrategy: z.ZodOptional<z.ZodEnum<typeof EmptySchemaStrategy>>;
28
34
  excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
29
35
  validationLibrary: z.ZodOptional<z.ZodEnum<typeof ValidationLibrary>>;
36
+ useOptions: z.ZodOptional<z.ZodBoolean>;
37
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
30
38
  }, z.core.$strip>;
31
39
  /** Additional parameters */
32
40
  export declare const additionalParametersSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"CommonSchemas.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/CommonSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,mBAAmB;AAEnB,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AASH,eAAO,MAAM,wBAAwB;;;;;;;iBAOpC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;iBAKtC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;iBAKtC,CAAC;AAEF,4BAA4B;AAE5B,eAAO,MAAM,0BAA0B;;;;;;iBAMrC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;iBAEvC,CAAC;AAEH,8BAA8B;AAE9B,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;iBAIzC,CAAC"}
1
+ {"version":3,"file":"CommonSchemas.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/CommonSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,mBAAmB;AAEnB,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AASH,eAAO,MAAM,wBAAwB;;;;;;;iBAMnC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;iBAGrC,CAAC;AAEH,4BAA4B;AAE5B,eAAO,MAAM,0BAA0B;;;;;;iBAMrC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;iBAEvC,CAAC;AAEH,8BAA8B;AAE9B,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;iBAIzC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.experimentalParametersSchemaV2 = exports.experimentalParametersSchema = exports.additionalParametersSchemaV2 = exports.additionalParametersSchema = exports.specialParametersSchemasV3 = exports.specialParametersSchemasV2 = exports.specialParametersSchemas = exports.outputPathsSchema = void 0;
3
+ exports.experimentalParametersSchemaV2 = exports.experimentalParametersSchema = exports.additionalParametersSchemaV2 = exports.additionalParametersSchema = exports.specialParametersSchemasV4 = exports.specialParametersSchemasV3 = exports.specialParametersSchemasV2 = exports.specialParametersSchemas = exports.outputPathsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const EmptySchemaStrategy_enum_1 = require("../../core/types/enums/EmptySchemaStrategy.enum");
5
6
  const ValidationLibrary_enum_1 = require("../../core/types/enums/ValidationLibrary.enum");
6
7
  /** Output paths */
7
8
  exports.outputPathsSchema = zod_1.z.object({
@@ -16,20 +17,27 @@ const baseSpecialParametersSchema = zod_1.z.object({
16
17
  useOptions: zod_1.z.boolean().optional(),
17
18
  useUnionTypes: zod_1.z.boolean().optional(),
18
19
  });
19
- exports.specialParametersSchemas = baseSpecialParametersSchema.merge(zod_1.z.object({
20
+ exports.specialParametersSchemas = zod_1.z.object({
21
+ ...baseSpecialParametersSchema.shape,
20
22
  exportCore: zod_1.z.boolean().optional(),
21
23
  exportServices: zod_1.z.boolean().optional(),
22
24
  exportModels: zod_1.z.boolean().optional(),
23
25
  exportSchemas: zod_1.z.boolean().optional(),
24
- }));
25
- exports.specialParametersSchemasV2 = baseSpecialParametersSchema.merge(zod_1.z.object({
26
+ });
27
+ exports.specialParametersSchemasV2 = zod_1.z.object({
28
+ ...baseSpecialParametersSchema.shape,
26
29
  excludeCoreServiceFiles: zod_1.z.boolean().optional(),
27
30
  includeSchemasFiles: zod_1.z.boolean().optional(),
28
- }));
29
- exports.specialParametersSchemasV3 = baseSpecialParametersSchema.merge(zod_1.z.object({
31
+ });
32
+ exports.specialParametersSchemasV3 = zod_1.z.object({
33
+ ...baseSpecialParametersSchema.shape,
30
34
  excludeCoreServiceFiles: zod_1.z.boolean().optional(),
31
35
  validationLibrary: zod_1.z.enum(ValidationLibrary_enum_1.ValidationLibrary).optional(),
32
- }));
36
+ });
37
+ exports.specialParametersSchemasV4 = zod_1.z.object({
38
+ ...exports.specialParametersSchemasV3.shape,
39
+ emptySchemaStrategy: zod_1.z.enum(EmptySchemaStrategy_enum_1.EmptySchemaStrategy).optional(),
40
+ });
33
41
  /** Additional parameters */
34
42
  exports.additionalParametersSchema = zod_1.z.object({
35
43
  clean: zod_1.z.boolean().optional(),
@@ -11,12 +11,12 @@ export declare const multiOptionsSchemaV1: z.ZodObject<{
11
11
  interfacePrefix: z.ZodOptional<z.ZodString>;
12
12
  enumPrefix: z.ZodOptional<z.ZodString>;
13
13
  typePrefix: z.ZodOptional<z.ZodString>;
14
- useOptions: z.ZodOptional<z.ZodBoolean>;
15
- useUnionTypes: z.ZodOptional<z.ZodBoolean>;
16
14
  exportCore: z.ZodOptional<z.ZodBoolean>;
17
15
  exportServices: z.ZodOptional<z.ZodBoolean>;
18
16
  exportModels: z.ZodOptional<z.ZodBoolean>;
19
17
  exportSchemas: z.ZodOptional<z.ZodBoolean>;
18
+ useOptions: z.ZodOptional<z.ZodBoolean>;
19
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
20
20
  output: z.ZodString;
21
21
  outputCore: z.ZodOptional<z.ZodString>;
22
22
  outputServices: z.ZodOptional<z.ZodString>;
@@ -16,11 +16,11 @@ export declare const multiOptionsSchemaV4: z.ZodObject<{
16
16
  interfacePrefix: z.ZodOptional<z.ZodString>;
17
17
  enumPrefix: z.ZodOptional<z.ZodString>;
18
18
  typePrefix: z.ZodOptional<z.ZodString>;
19
- useOptions: z.ZodOptional<z.ZodBoolean>;
20
- useUnionTypes: z.ZodOptional<z.ZodBoolean>;
21
19
  exportCore: z.ZodOptional<z.ZodBoolean>;
22
20
  exportServices: z.ZodOptional<z.ZodBoolean>;
23
21
  exportModels: z.ZodOptional<z.ZodBoolean>;
24
22
  exportSchemas: z.ZodOptional<z.ZodBoolean>;
23
+ useOptions: z.ZodOptional<z.ZodBoolean>;
24
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
25
25
  }, z.core.$strip>;
26
26
  //# sourceMappingURL=MultiOptionsSchemaV4.d.ts.map
@@ -7,10 +7,10 @@ export declare const multiOptionsSchemaV5: 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
  items: z.ZodArray<z.ZodObject<{
15
15
  input: z.ZodString;
16
16
  output: z.ZodString;
@@ -8,12 +8,12 @@ export declare const optionsSchemaV1: z.ZodObject<{
8
8
  interfacePrefix: z.ZodOptional<z.ZodString>;
9
9
  enumPrefix: z.ZodOptional<z.ZodString>;
10
10
  typePrefix: z.ZodOptional<z.ZodString>;
11
- useOptions: z.ZodOptional<z.ZodBoolean>;
12
- useUnionTypes: z.ZodOptional<z.ZodBoolean>;
13
11
  exportCore: z.ZodOptional<z.ZodBoolean>;
14
12
  exportServices: z.ZodOptional<z.ZodBoolean>;
15
13
  exportModels: z.ZodOptional<z.ZodBoolean>;
16
14
  exportSchemas: z.ZodOptional<z.ZodBoolean>;
15
+ useOptions: z.ZodOptional<z.ZodBoolean>;
16
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
17
17
  output: z.ZodString;
18
18
  outputCore: z.ZodOptional<z.ZodString>;
19
19
  outputServices: z.ZodOptional<z.ZodString>;
@@ -10,10 +10,10 @@ export declare const optionsSchemaV4: z.ZodObject<{
10
10
  interfacePrefix: z.ZodOptional<z.ZodString>;
11
11
  enumPrefix: z.ZodOptional<z.ZodString>;
12
12
  typePrefix: z.ZodOptional<z.ZodString>;
13
- useOptions: z.ZodOptional<z.ZodBoolean>;
14
- useUnionTypes: z.ZodOptional<z.ZodBoolean>;
15
13
  excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
16
14
  includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
15
+ useOptions: z.ZodOptional<z.ZodBoolean>;
16
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
17
17
  output: z.ZodString;
18
18
  outputCore: z.ZodOptional<z.ZodString>;
19
19
  outputServices: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
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,EA2EjD,CAAC"}
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,EAiFjD,CAAC"}
@@ -82,4 +82,10 @@ exports.compatibilityCases = [
82
82
  to: 'v3',
83
83
  expect: [{ type: 'added', key: 'logLevel' }, { type: 'added', key: 'logTarget' }],
84
84
  },
85
+ {
86
+ type: Enums_1.EVersionedSchemaType.UNIFIED_OPTIONS,
87
+ from: 'v3',
88
+ to: 'v4',
89
+ expect: [{ type: 'added', key: 'emptySchemaStrategy' }]
90
+ }
85
91
  ];
@@ -69,7 +69,25 @@ const migrateDataToLatestSchemaVersion_1 = require("../migrateDataToLatestSchema
69
69
  });
70
70
  node_assert_1.default.ok(result);
71
71
  node_assert_1.default.strictEqual(result?.schemaType, Enums_2.EVersionedSchemaType.UNIFIED_OPTIONS);
72
- node_assert_1.default.strictEqual(result?.schemaVersion, 'UNIFIED_OPTIONS_v3');
72
+ node_assert_1.default.strictEqual(result?.schemaVersion, 'UNIFIED_OPTIONS_v4');
73
73
  node_assert_1.default.strictEqual(result?.value.httpClient, 'fetch');
74
74
  node_assert_1.default.strictEqual(result?.value.validationLibrary, ValidationLibrary_enum_1.ValidationLibrary.NONE);
75
75
  });
76
+ (0, node_test_1.default)('@unit: migrateDataToLatestSchemaVersion (all schemas: chooses old options branch before unified)', () => {
77
+ const rawInput = {
78
+ input: './spec.json',
79
+ output: './dist',
80
+ httpClient: 'fetch',
81
+ exportCore: true,
82
+ };
83
+ const result = (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
84
+ rawInput,
85
+ migrationPlans: AllMigrationPlans_1.allMigrationPlans,
86
+ versionedSchemas: AllVersionedSchemas_1.allVersionedSchemas,
87
+ migrationMode: Enums_1.EMigrationMode.VALIDATE_CONFIG,
88
+ });
89
+ node_assert_1.default.ok(result);
90
+ node_assert_1.default.strictEqual(result?.schemaType, Enums_2.EVersionedSchemaType.UNIFIED_OPTIONS);
91
+ node_assert_1.default.strictEqual(result?.schemaVersion, 'UNIFIED_OPTIONS_v4');
92
+ node_assert_1.default.ok(result?.guessedVersion.latestVersion.startsWith('OPTIONS_'));
93
+ });
@@ -1,4 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { VersionedSchema, VersionMatchResult } from '../Types';
3
+ /**
4
+ * Determines the best matching schema version for input data.
5
+ * `invalid_value` issues are intentionally ignored to allow migration from older enum/value variants.
6
+ */
3
7
  export declare function determineBestMatchingSchemaVersion(inputData: Record<string, any>, versionedSchemas: VersionedSchema<z.ZodTypeAny>[]): VersionMatchResult;
4
8
  //# sourceMappingURL=determineBestMatchingSchemaVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"determineBestMatchingSchemaVersion.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAK/D,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,kBAAkB,CA4CxJ"}
1
+ {"version":3,"file":"determineBestMatchingSchemaVersion.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAiE/D;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,kBAAkB,CAgDxJ"}