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

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 (74) hide show
  1. package/README.md +2 -0
  2. package/README.rus.md +2 -2
  3. package/dist/cli/index.js +2 -0
  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.map +1 -1
  7. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +10 -0
  8. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +2 -2
  9. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +2 -2
  10. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +2 -2
  11. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts +42 -0
  12. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -0
  13. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +41 -0
  14. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +6 -4
  15. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -1
  16. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +7 -1
  17. package/dist/common/VersionedSchema/CommonSchemas.d.ts +12 -4
  18. package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
  19. package/dist/common/VersionedSchema/CommonSchemas.js +15 -7
  20. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +2 -2
  21. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +2 -2
  22. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +2 -2
  23. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +2 -2
  24. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +2 -2
  25. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -1
  26. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +6 -0
  27. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +1 -1
  28. package/dist/common/defaultOptions.d.ts.map +1 -1
  29. package/dist/common/defaultOptions.js +2 -0
  30. package/dist/common/utils/__tests__/convertArrayToObject.test.js +10 -5
  31. package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
  32. package/dist/common/utils/convertArrayToObject.js +1 -0
  33. package/dist/core/OpenApiClient.d.ts.map +1 -1
  34. package/dist/core/OpenApiClient.js +7 -1
  35. package/dist/core/WriteClient.d.ts +7 -1
  36. package/dist/core/WriteClient.d.ts.map +1 -1
  37. package/dist/core/WriteClient.js +44 -7
  38. package/dist/core/__tests__/WriteClient.test.js +2 -0
  39. package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts +6 -0
  40. package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts.map +1 -0
  41. package/dist/core/types/enums/EmptySchemaStrategy.enum.js +9 -0
  42. package/dist/core/utils/__tests__/writeClientSchemas.test.js +2 -0
  43. package/dist/core/utils/precompileTemplates.js +1 -0
  44. package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
  45. package/dist/core/utils/registerHandlebarHelpers.js +25 -0
  46. package/dist/core/utils/writeClientSchemas.d.ts +4 -1
  47. package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
  48. package/dist/core/utils/writeClientSchemas.js +11 -2
  49. package/dist/templatesCompiled/client/joi/exportSchema.js +2 -2
  50. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +5 -3
  51. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -1
  52. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +36 -9
  53. package/dist/templatesCompiled/client/jsonschema/exportSchema.js +2 -2
  54. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +3 -1
  55. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -1
  56. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +43 -13
  57. package/dist/templatesCompiled/client/yup/exportSchema.js +2 -2
  58. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +5 -3
  59. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -1
  60. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +36 -9
  61. package/dist/templatesCompiled/client/zod/exportSchema.js +2 -2
  62. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +5 -6
  63. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -1
  64. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +14 -28
  65. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +3 -0
  66. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -1
  67. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +28 -4
  68. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +3 -4
  69. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -1
  70. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +9 -23
  71. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +4 -2
  72. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -1
  73. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +15 -4
  74. 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
  })
@@ -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 +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");
@@ -34,4 +37,11 @@ exports.allMigrationPlans = [
34
37
  (0, createFieldTransformationMigration_1.createFieldTransformationMigration)('UNIFIED_v1', 'UNIFIED_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_v2', 'UNIFIED_v3', {
41
+ logLevel: Enums_1.ELogLevel.ERROR,
42
+ logTarget: Enums_1.ELogOutput.CONSOLE
43
+ }),
44
+ (0, createDefaultFieldsMigration_1.createDefaultFieldsMigration)('UNIFIED_v3', 'UNIFIED_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,7 @@ 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
  });
@@ -1 +1 @@
1
- {"version":3,"file":"defaultOptions.d.ts","sourceRoot":"","sources":["../../src/common/defaultOptions.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAKtB,eAAO,MAAM,cAAc,uBAuBV,CAAC"}
1
+ {"version":3,"file":"defaultOptions.d.ts","sourceRoot":"","sources":["../../src/common/defaultOptions.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB,eAAO,MAAM,cAAc,uBAwBV,CAAC"}
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.defaultOptions = void 0;
7
7
  const joi_1 = __importDefault(require("joi"));
8
+ const EmptySchemaStrategy_enum_1 = require("../core/types/enums/EmptySchemaStrategy.enum");
8
9
  const HttpClient_enum_1 = require("../core/types/enums/HttpClient.enum");
9
10
  const ValidationLibrary_enum_1 = require("../core/types/enums/ValidationLibrary.enum");
10
11
  exports.defaultOptions = joi_1.default.object({
@@ -25,4 +26,5 @@ exports.defaultOptions = joi_1.default.object({
25
26
  useCancelableRequest: joi_1.default.boolean().optional(),
26
27
  useSeparatedIndexes: joi_1.default.boolean().optional(),
27
28
  validationLibrary: joi_1.default.string().valid(...Object.values(ValidationLibrary_enum_1.ValidationLibrary)).optional(),
29
+ emptySchemaStrategy: joi_1.default.string().valid(...Object.values(EmptySchemaStrategy_enum_1.EmptySchemaStrategy)).optional(),
28
30
  }).unknown(false);
@@ -53,7 +53,8 @@ const convertArrayToObject_1 = require("../convertArrayToObject");
53
53
  useOptions: true,
54
54
  useSeparatedIndexes: undefined,
55
55
  useUnionTypes: undefined,
56
- validationLibrary: undefined
56
+ validationLibrary: undefined,
57
+ emptySchemaStrategy: undefined,
57
58
  };
58
59
  const result = (0, convertArrayToObject_1.convertArrayToObject)(input);
59
60
  node_assert_1.default.deepStrictEqual(result, expected);
@@ -95,7 +96,8 @@ const convertArrayToObject_1 = require("../convertArrayToObject");
95
96
  useOptions: true,
96
97
  useSeparatedIndexes: undefined,
97
98
  useUnionTypes: undefined,
98
- validationLibrary: undefined
99
+ validationLibrary: undefined,
100
+ emptySchemaStrategy: undefined,
99
101
  };
100
102
  const result = (0, convertArrayToObject_1.convertArrayToObject)(input);
101
103
  node_assert_1.default.deepStrictEqual(result, expected);
@@ -137,7 +139,8 @@ const convertArrayToObject_1 = require("../convertArrayToObject");
137
139
  useOptions: true,
138
140
  useSeparatedIndexes: undefined,
139
141
  useUnionTypes: undefined,
140
- validationLibrary: undefined
142
+ validationLibrary: undefined,
143
+ emptySchemaStrategy: undefined,
141
144
  };
142
145
  const result = (0, convertArrayToObject_1.convertArrayToObject)(input);
143
146
  node_assert_1.default.deepStrictEqual(result, expected);
@@ -179,7 +182,8 @@ const convertArrayToObject_1 = require("../convertArrayToObject");
179
182
  useOptions: undefined,
180
183
  useSeparatedIndexes: undefined,
181
184
  useUnionTypes: undefined,
182
- validationLibrary: undefined
185
+ validationLibrary: undefined,
186
+ emptySchemaStrategy: undefined,
183
187
  };
184
188
  const result = (0, convertArrayToObject_1.convertArrayToObject)(input);
185
189
  node_assert_1.default.deepStrictEqual(result, expected);
@@ -221,7 +225,8 @@ const convertArrayToObject_1 = require("../convertArrayToObject");
221
225
  useOptions: undefined,
222
226
  useSeparatedIndexes: undefined,
223
227
  useUnionTypes: undefined,
224
- validationLibrary: undefined
228
+ validationLibrary: undefined,
229
+ emptySchemaStrategy: undefined,
225
230
  };
226
231
  const result = (0, convertArrayToObject_1.convertArrayToObject)(input);
227
232
  node_assert_1.default.deepStrictEqual(result, expected);
@@ -1 +1 @@
1
- {"version":3,"file":"convertArrayToObject.d.ts","sourceRoot":"","sources":["../../../src/common/utils/convertArrayToObject.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA2DxH"}
1
+ {"version":3,"file":"convertArrayToObject.d.ts","sourceRoot":"","sources":["../../../src/common/utils/convertArrayToObject.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA4DxH"}
@@ -40,6 +40,7 @@ function convertArrayToObject(optionsArr) {
40
40
  'sortByRequired',
41
41
  'useSeparatedIndexes',
42
42
  'validationLibrary',
43
+ 'emptySchemaStrategy',
43
44
  ];
44
45
  const extractedFields = fieldsToExtract.reduce((acc, field) => ({
45
46
  ...acc,
@@ -1 +1 @@
1
- {"version":3,"file":"OpenApiClient.d.ts","sourceRoot":"","sources":["../../src/core/OpenApiClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AAetF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,qBAAa,aAAa;IACtB,OAAO,CAAC,YAAY,CAA4B;IAEhD,IAAW,WAAW,gBAKrB;IAED,OAAO,CAAC,gBAAgB;IAmDxB,OAAO,CAAC,gBAAgB;YA0BV,sBAAsB;YAUtB,oBAAoB;YAmCpB,cAAc;IAkFtB,QAAQ,CAAC,UAAU,EAAE,WAAW;CAWzC"}
1
+ {"version":3,"file":"OpenApiClient.d.ts","sourceRoot":"","sources":["../../src/core/OpenApiClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AAgBtF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,qBAAa,aAAa;IACtB,OAAO,CAAC,YAAY,CAA4B;IAEhD,IAAW,WAAW,gBAKrB;IAED,OAAO,CAAC,gBAAgB;IAqDxB,OAAO,CAAC,gBAAgB;YA2BV,sBAAsB;YAUtB,oBAAoB;YAmCpB,cAAc;IAqFtB,QAAQ,CAAC,UAAU,EAAE,WAAW;CAWzC"}