ts-openapi-codegen 2.0.0-beta.1 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +149 -103
- package/README.rus.md +149 -101
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts +2 -1
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/checkConfig.js +14 -6
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts +2 -1
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/updateConfig.js +13 -5
- package/dist/cli/{generate/runGenerateOpenApi.d.ts → generateOpenApiClient/generateOpenApiClient.d.ts} +2 -2
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -0
- package/dist/cli/{generate/runGenerateOpenApi.js → generateOpenApiClient/generateOpenApiClient.js} +31 -11
- package/dist/cli/index.js +29 -8
- package/dist/cli/initOpenApiConfig/Types.d.ts +4 -4
- package/dist/cli/initOpenApiConfig/Types.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/init.d.ts +6 -0
- package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/init.js +53 -0
- package/dist/cli/initOpenApiConfig/initConfig.d.ts +11 -0
- package/dist/cli/initOpenApiConfig/initConfig.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/initConfig.js +102 -0
- package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts +3 -0
- package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/initCustomRequest.js +23 -0
- package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts +21 -0
- package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/buildConfig.js +107 -0
- package/dist/cli/initOpenApiConfig/utils/findSpecFiles.d.ts +8 -0
- package/dist/cli/initOpenApiConfig/utils/findSpecFiles.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/findSpecFiles.js +40 -0
- package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.d.ts +3 -0
- package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.js +53 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts +7 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.js +23 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.d.ts +11 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.js +24 -0
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts +11 -0
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.js +31 -0
- package/dist/cli/previewChanges/previewChanges.d.ts +8 -0
- package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -0
- package/dist/cli/previewChanges/previewChanges.js +189 -0
- package/dist/cli/previewChanges/utils/compareFiles.d.ts +6 -0
- package/dist/cli/previewChanges/utils/compareFiles.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/compareFiles.js +50 -0
- package/dist/cli/previewChanges/utils/formatDiff.d.ts +6 -0
- package/dist/cli/previewChanges/utils/formatDiff.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/formatDiff.js +30 -0
- package/dist/cli/previewChanges/utils/isDirectoryEmpty.d.ts +5 -0
- package/dist/cli/previewChanges/utils/isDirectoryEmpty.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/isDirectoryEmpty.js +17 -0
- package/dist/cli/previewChanges/utils/readDirectoryRecursive.d.ts +5 -0
- package/dist/cli/previewChanges/utils/readDirectoryRecursive.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/readDirectoryRecursive.js +28 -0
- package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts +10 -0
- package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/updateOutputPaths.js +106 -0
- package/dist/cli/schemas/base.d.ts +22 -0
- package/dist/cli/schemas/base.d.ts.map +1 -0
- package/dist/cli/schemas/base.js +23 -0
- package/dist/cli/schemas/checkConfig.d.ts +6 -0
- package/dist/cli/schemas/checkConfig.d.ts.map +1 -0
- package/dist/cli/schemas/checkConfig.js +5 -0
- package/dist/cli/schemas/generate.d.ts +8 -0
- package/dist/cli/schemas/generate.d.ts.map +1 -0
- package/dist/cli/schemas/generate.js +45 -0
- package/dist/cli/schemas/index.d.ts +8 -0
- package/dist/cli/schemas/index.d.ts.map +1 -0
- package/dist/cli/schemas/index.js +22 -0
- package/dist/cli/schemas/init.d.ts +10 -0
- package/dist/cli/schemas/init.d.ts.map +1 -0
- package/dist/cli/schemas/init.js +11 -0
- package/dist/cli/schemas/previewChanges.d.ts +9 -0
- package/dist/cli/schemas/previewChanges.d.ts.map +1 -0
- package/dist/cli/schemas/previewChanges.js +11 -0
- package/dist/cli/schemas/updateConfig.d.ts +6 -0
- package/dist/cli/schemas/updateConfig.d.ts.map +1 -0
- package/dist/cli/schemas/updateConfig.js +5 -0
- package/dist/common/Consts.d.ts +5 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +9 -2
- package/dist/common/LoggerMessages.js +1 -1
- package/dist/common/TRawOptions.d.ts +4 -36
- package/dist/common/TRawOptions.d.ts.map +1 -1
- package/dist/common/Validation/formatZodError.d.ts +10 -0
- package/dist/common/Validation/formatZodError.d.ts.map +1 -0
- package/dist/common/Validation/formatZodError.js +114 -0
- package/dist/common/Validation/index.d.ts +3 -0
- package/dist/common/Validation/index.d.ts.map +1 -0
- package/dist/common/Validation/index.js +18 -0
- package/dist/common/Validation/validateZodOptions.d.ts +27 -0
- package/dist/common/Validation/validateZodOptions.d.ts.map +1 -0
- package/dist/common/Validation/validateZodOptions.js +35 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +10 -4
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts +6 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.js +8 -8
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts +28 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.js +25 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +37 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.js +37 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +38 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.js +34 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +40 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.js +36 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +65 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +31 -0
- package/dist/common/VersionedSchema/CommonSchemas.d.ts +53 -29
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +44 -62
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.js +9 -16
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +25 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.js +34 -17
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts +25 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.js +28 -19
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts +25 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.js +29 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +25 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.js +30 -14
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +23 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.js +33 -18
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts +3 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.js +18 -11
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.js +2 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +22 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.js +30 -12
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts +22 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.js +27 -13
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts +22 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.js +28 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +22 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.js +31 -12
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts +3 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.js +15 -9
- package/dist/common/VersionedSchema/Types.d.ts +5 -5
- package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts +16 -0
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +85 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.js +23 -0
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +75 -0
- package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts +12 -0
- package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/buildVersionedSchema.js +13 -0
- package/dist/common/VersionedSchema/Utils/compareShapes.d.ts +16 -0
- package/dist/common/VersionedSchema/Utils/compareShapes.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/compareShapes.js +30 -0
- package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.d.ts +32 -0
- package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.js +40 -0
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +2 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +5 -5
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts +2 -2
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.js +15 -7
- package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.d.ts +16 -0
- package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.js +23 -0
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts +2 -2
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.js +16 -3
- package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.js +19 -2
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +2 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +10 -9
- package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts +4 -0
- package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts.map +1 -0
- package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.js +43 -0
- package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts +4 -0
- package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts.map +1 -0
- package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.js +21 -0
- package/dist/common/defaultOptions.d.ts.map +1 -1
- package/dist/common/defaultOptions.js +2 -1
- package/dist/common/utils/__tests__/convertArrayToObject.test.js +5 -6
- package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
- package/dist/common/utils/convertArrayToObject.js +1 -2
- package/dist/common/utils/fileSystemHelpers.d.ts +3 -1
- package/dist/common/utils/fileSystemHelpers.d.ts.map +1 -1
- package/dist/common/utils/fileSystemHelpers.js +3 -0
- package/dist/core/Context.d.ts +25 -2
- package/dist/core/Context.d.ts.map +1 -1
- package/dist/core/Context.js +144 -4
- package/dist/core/OpenApiClient.d.ts.map +1 -1
- package/dist/core/OpenApiClient.js +54 -13
- package/dist/core/WriteClient.d.ts +6 -13
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +32 -22
- package/dist/core/__tests__/WriteClient.test.js +7 -2
- package/dist/core/api/v2/Parser.d.ts +1 -1
- package/dist/core/api/v2/Parser.d.ts.map +1 -1
- package/dist/core/api/v2/Parser.js +2 -2
- package/dist/core/api/v2/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModel.js +2 -5
- package/dist/core/api/v2/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModelProperties.js +1 -3
- package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModels.js +2 -4
- package/dist/core/api/v2/parser/getOperationParameter.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationParameter.js +2 -5
- package/dist/core/api/v2/parser/getOperationParameters.js +1 -1
- package/dist/core/api/v2/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationResponse.js +1 -3
- package/dist/core/api/v2/parser/getOperationResponses.js +1 -1
- package/dist/core/api/v2/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getServices.js +4 -3
- package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getType.js +16 -9
- package/dist/core/api/v3/Parser.d.ts +1 -1
- package/dist/core/api/v3/Parser.d.ts.map +1 -1
- package/dist/core/api/v3/Parser.js +2 -2
- package/dist/core/api/v3/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModel.js +2 -5
- package/dist/core/api/v3/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModelProperties.js +1 -3
- package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModels.js +2 -4
- package/dist/core/api/v3/parser/getOperation.js +1 -1
- package/dist/core/api/v3/parser/getOperationParameter.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationParameter.js +2 -5
- package/dist/core/api/v3/parser/getOperationParameters.js +1 -1
- package/dist/core/api/v3/parser/getOperationRequestBody.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationRequestBody.js +1 -3
- package/dist/core/api/v3/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationResponse.js +1 -3
- package/dist/core/api/v3/parser/getOperationResponses.js +1 -1
- package/dist/core/api/v3/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getServices.js +4 -3
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +16 -9
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/types/base/ClientArtifacts.model.d.ts +1 -1
- package/dist/core/types/base/ClientArtifacts.model.d.ts.map +1 -1
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts +1 -1
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts.map +1 -1
- package/dist/core/types/base/Templates.model.d.ts +32 -0
- package/dist/core/types/base/Templates.model.d.ts.map +1 -0
- package/dist/core/types/enums/ValidationLibrary.enum.d.ts +8 -0
- package/dist/core/types/enums/ValidationLibrary.enum.d.ts.map +1 -0
- package/dist/core/types/enums/ValidationLibrary.enum.js +11 -0
- package/dist/core/utils/__mocks__/templates.d.ts +1 -1
- package/dist/core/utils/__mocks__/templates.d.ts.map +1 -1
- package/dist/core/utils/__mocks__/templates.js +5 -1
- package/dist/core/utils/__tests__/getRelativeModelPath.test.js +9 -3
- package/dist/core/utils/__tests__/isSubdirectory.test.js +2 -2
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/modelHelpers.test.js +151 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.js +67 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.js +26 -0
- package/dist/core/utils/__tests__/registerHandlebarTemplates.test.js +2 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.js +22 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.js +121 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts +2 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.js +20 -0
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +2 -0
- package/dist/core/utils/getOpenApiSpec.d.ts +0 -6
- package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
- package/dist/core/utils/getOpenApiSpec.js +26 -23
- package/dist/core/utils/modelHelpers.d.ts.map +1 -1
- package/dist/core/utils/modelHelpers.js +37 -3
- package/dist/core/utils/postProcessModelImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessModelImports.js +14 -1
- package/dist/core/utils/postProcessServiceImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessServiceImports.js +1 -2
- package/dist/core/utils/precompileTemplates.js +7 -0
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +85 -0
- package/dist/core/utils/registerHandlebarTemplates.d.ts +3 -27
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +97 -6
- package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
- package/dist/core/utils/resolveRefPath.js +1 -4
- package/dist/core/utils/serviceHelpers.d.ts.map +1 -1
- package/dist/core/utils/serviceHelpers.js +32 -6
- package/dist/core/utils/stripNamespace.js +1 -1
- package/dist/core/utils/validateRawOptions.d.ts +3 -0
- package/dist/core/utils/validateRawOptions.d.ts.map +1 -0
- package/dist/core/utils/validateRawOptions.js +15 -0
- package/dist/core/utils/writeClientCore.d.ts +1 -1
- package/dist/core/utils/writeClientCore.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.js +7 -4
- package/dist/core/utils/writeClientCoreIndex.d.ts +1 -1
- package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientExecutor.d.ts +13 -0
- package/dist/core/utils/writeClientExecutor.d.ts.map +1 -0
- package/dist/core/utils/writeClientExecutor.js +30 -0
- package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientFullIndex.js +1 -1
- package/dist/core/utils/writeClientModels.d.ts +1 -1
- package/dist/core/utils/writeClientModels.d.ts.map +1 -1
- package/dist/core/utils/writeClientModelsIndex.d.ts +1 -1
- package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.d.ts +3 -1
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +23 -20
- package/dist/core/utils/writeClientSchemasIndex.d.ts +1 -1
- package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientServices.d.ts +1 -1
- package/dist/core/utils/writeClientServices.d.ts.map +1 -1
- package/dist/core/utils/writeClientServicesIndex.d.ts +1 -1
- package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSimpleIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSimpleIndex.js +1 -1
- package/dist/templatesCompiled/cli/customRequest.d.ts +11 -0
- package/dist/templatesCompiled/cli/customRequest.d.ts.map +1 -0
- package/dist/templatesCompiled/cli/customRequest.js +27 -0
- package/dist/templatesCompiled/cli/customRequestExecutor.d.ts +11 -0
- package/dist/templatesCompiled/cli/customRequestExecutor.d.ts.map +1 -0
- package/dist/templatesCompiled/cli/customRequestExecutor.js +27 -0
- package/dist/templatesCompiled/cli/openApiConfig.d.ts +2 -1
- package/dist/templatesCompiled/cli/openApiConfig.d.ts.map +1 -1
- package/dist/templatesCompiled/cli/openApiConfig.js +76 -4
- package/dist/templatesCompiled/client/core/ApiError.js +1 -1
- package/dist/templatesCompiled/client/core/CancelablePromise.d.ts +1 -0
- package/dist/templatesCompiled/client/core/CancelablePromise.d.ts.map +1 -1
- package/dist/templatesCompiled/client/core/CancelablePromise.js +9 -2
- package/dist/templatesCompiled/client/core/HttpStatusCode.d.ts +1 -0
- package/dist/templatesCompiled/client/core/HttpStatusCode.d.ts.map +1 -1
- package/dist/templatesCompiled/client/core/HttpStatusCode.js +9 -2
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts +12 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.js +32 -0
- package/dist/templatesCompiled/client/core/{legacy-request-adapter.d.ts → executor/requestExecutor.d.ts} +1 -1
- package/dist/templatesCompiled/client/core/executor/requestExecutor.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/executor/requestExecutor.js +18 -0
- package/dist/templatesCompiled/client/core/functions/catchErrors.js +1 -1
- package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.d.ts +8 -0
- package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.js +18 -0
- package/dist/templatesCompiled/client/core/{request-executor.d.ts → interceptors/interceptors.d.ts} +2 -1
- package/dist/templatesCompiled/client/core/interceptors/interceptors.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/interceptors/interceptors.js +18 -0
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.d.ts +8 -0
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.js +18 -0
- package/dist/templatesCompiled/client/exportClient.d.ts +10 -0
- package/dist/templatesCompiled/client/exportClient.d.ts.map +1 -0
- package/dist/templatesCompiled/client/exportClient.js +53 -0
- package/dist/templatesCompiled/client/exportService.js +1 -1
- package/dist/templatesCompiled/client/indexCore.js +2 -2
- package/dist/templatesCompiled/client/indexFull.d.ts +13 -9
- package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexFull.js +72 -46
- package/dist/templatesCompiled/client/indexSimple.d.ts +1 -0
- package/dist/templatesCompiled/client/indexSimple.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexSimple.js +5 -1
- package/dist/templatesCompiled/client/joi/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/joi/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/exportSchema.js +71 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchema.js +129 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.d.ts +16 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.js +84 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.d.ts +18 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.js +96 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.d.ts +14 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.js +72 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.d.ts +14 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.js +74 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts +35 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.js +201 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +14 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +50 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.js +25 -0
- package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/exportSchema.js +69 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.js +129 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.d.ts +16 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.js +74 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.d.ts +16 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.js +84 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.d.ts +13 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.js +56 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.d.ts +12 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.js +49 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.d.ts +29 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.js +175 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +15 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +63 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.js +25 -0
- package/dist/templatesCompiled/client/partials/exportComposition.d.ts +2 -0
- package/dist/templatesCompiled/client/partials/exportComposition.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/exportComposition.js +17 -9
- package/dist/templatesCompiled/client/partials/parameters.js +1 -1
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts +2 -4
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/serviceOption.js +32 -46
- package/dist/templatesCompiled/client/yup/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/yup/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/exportSchema.js +73 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchema.js +129 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.d.ts +16 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.js +84 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.d.ts +18 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.js +96 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.d.ts +14 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.js +72 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.d.ts +14 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.js +74 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts +34 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.js +201 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +14 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +50 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.js +25 -0
- package/dist/templatesCompiled/client/zod/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/zod/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/exportSchema.js +67 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchema.js +129 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +14 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +65 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +15 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +70 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +12 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +53 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.d.ts +15 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.js +86 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts +34 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.js +193 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +14 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +50 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.js +25 -0
- package/package.json +9 -4
- package/dist/cli/generate/runGenerateOpenApi.d.ts.map +0 -1
- package/dist/cli/initOpenApiConfig/Enums.d.ts +0 -5
- package/dist/cli/initOpenApiConfig/Enums.d.ts.map +0 -1
- package/dist/cli/initOpenApiConfig/Enums.js +0 -8
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts +0 -3
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts.map +0 -1
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.js +0 -70
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts +0 -3
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts.map +0 -1
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.js +0 -28
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts +0 -7
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts.map +0 -1
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.js +0 -42
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts +0 -3
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts.map +0 -1
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.js +0 -10
- package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts +0 -6
- package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.js +0 -7
- package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts +0 -6
- package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/joiHandlers.js +0 -59
- package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts +0 -3
- package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.js +0 -12
- package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts +0 -3
- package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/traverseObjectStructure.js +0 -31
- package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts +0 -19
- package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts.map +0 -1
- package/dist/common/utils/__tests__/__mock__/mockJoiSchema.js +0 -14
- package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts +0 -2
- package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.js +0 -38
- package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts +0 -2
- package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.js +0 -20
- package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts +0 -2
- package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/mergeObjectSchemas.test.js +0 -35
- package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts +0 -2
- package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/migrationForMultiOptions.test.js +0 -112
- package/dist/common/utils/__tests__/migrationForOptions.test.d.ts +0 -2
- package/dist/common/utils/__tests__/migrationForOptions.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/migrationForOptions.test.js +0 -56
- package/dist/core/types/base/RefWithtype.model.d.ts +0 -11
- package/dist/core/types/base/RefWithtype.model.d.ts.map +0 -1
- package/dist/core/types/enums/TypeRef.enum.d.ts +0 -8
- package/dist/core/types/enums/TypeRef.enum.d.ts.map +0 -1
- package/dist/core/types/enums/TypeRef.enum.js +0 -11
- package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getGatheringRefs.test.js +0 -26
- package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getRefFromSchema.test.js +0 -167
- package/dist/core/utils/__tests__/refResolver.test.d.ts +0 -2
- package/dist/core/utils/__tests__/refResolver.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/refResolver.test.js +0 -55
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts +0 -2
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.js +0 -376
- package/dist/core/utils/advancedDeduplicatePath.d.ts +0 -5
- package/dist/core/utils/advancedDeduplicatePath.d.ts.map +0 -1
- package/dist/core/utils/advancedDeduplicatePath.js +0 -29
- package/dist/core/utils/findCommonParent.d.ts +0 -7
- package/dist/core/utils/findCommonParent.d.ts.map +0 -1
- package/dist/core/utils/findCommonParent.js +0 -20
- package/dist/core/utils/getGatheringRefs.d.ts +0 -4
- package/dist/core/utils/getGatheringRefs.d.ts.map +0 -1
- package/dist/core/utils/getGatheringRefs.js +0 -68
- package/dist/core/utils/getRefFromSchema.d.ts +0 -3
- package/dist/core/utils/getRefFromSchema.d.ts.map +0 -1
- package/dist/core/utils/getRefFromSchema.js +0 -9
- package/dist/core/utils/isBoolean.d.ts +0 -2
- package/dist/core/utils/isBoolean.d.ts.map +0 -1
- package/dist/core/utils/isBoolean.js +0 -12
- package/dist/core/utils/isFileName.d.ts +0 -7
- package/dist/core/utils/isFileName.d.ts.map +0 -1
- package/dist/core/utils/isFileName.js +0 -30
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts +0 -10
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts.map +0 -1
- package/dist/core/utils/mapPathToTargetDirSafe.js +0 -48
- package/dist/core/utils/normalizeAllRefs.d.ts +0 -6
- package/dist/core/utils/normalizeAllRefs.d.ts.map +0 -1
- package/dist/core/utils/normalizeAllRefs.js +0 -35
- package/dist/core/utils/resolveRefToImportPath.d.ts +0 -13
- package/dist/core/utils/resolveRefToImportPath.d.ts.map +0 -1
- package/dist/core/utils/resolveRefToImportPath.js +0 -105
- package/dist/templatesCompiled/client/core/legacy-request-adapter.d.ts.map +0 -1
- package/dist/templatesCompiled/client/core/legacy-request-adapter.js +0 -18
- package/dist/templatesCompiled/client/core/request-executor.d.ts.map +0 -1
- package/dist/templatesCompiled/client/core/request-executor.js +0 -11
- /package/dist/core/types/base/{RefWithtype.model.js → Templates.model.js} +0 -0
package/README.md
CHANGED
|
@@ -64,7 +64,6 @@ openapi generate --input ./spec.json --output ./dist
|
|
|
64
64
|
| `--useOptions` | - | boolean | `false` | Use options instead of arguments |
|
|
65
65
|
| `--useUnionTypes` | - | boolean | `false` | Use union types instead of enums |
|
|
66
66
|
| `--excludeCoreServiceFiles` | - | boolean | `false` | Exclude generation of core and service files |
|
|
67
|
-
| `--includeSchemasFiles` | - | boolean | `false` | Enable generation of model validation schemas |
|
|
68
67
|
| `--request` | - | string | - | Path to custom request file |
|
|
69
68
|
| `--interfacePrefix` | - | string | `I` | Prefix for interface models |
|
|
70
69
|
| `--enumPrefix` | - | string | `E` | Prefix for enum models |
|
|
@@ -74,6 +73,7 @@ openapi generate --input ./spec.json --output ./dist
|
|
|
74
73
|
| `--useSeparatedIndexes` | - | boolean | `false` | Use separate index files for core, models, schemas, and services |
|
|
75
74
|
| `--logLevel` | `-l` | string | `error` | Logging level: `info`, `warn`, or `error` |
|
|
76
75
|
| `--logTarget` | `-t` | string | `console` | Logging target: `console` or `file` |
|
|
76
|
+
| `--validationLibrary` | - | string | `none` | Validation library for schema generation: `none`, `zod`, `joi`, `yup`, or `jsonschema` |
|
|
77
77
|
|
|
78
78
|
**Examples:**
|
|
79
79
|
```bash
|
|
@@ -93,7 +93,6 @@ openapi generate \
|
|
|
93
93
|
--httpClient fetch \
|
|
94
94
|
--useOptions \
|
|
95
95
|
--useUnionTypes \
|
|
96
|
-
--includeSchemasFiles \
|
|
97
96
|
--logLevel info
|
|
98
97
|
```
|
|
99
98
|
|
|
@@ -143,7 +142,6 @@ Instead of passing all options via CLI, you can use a configuration file. Create
|
|
|
143
142
|
"useOptions": false,
|
|
144
143
|
"useUnionTypes": false,
|
|
145
144
|
"excludeCoreServiceFiles": false,
|
|
146
|
-
"includeSchemasFiles": false,
|
|
147
145
|
"interfacePrefix": "I",
|
|
148
146
|
"enumPrefix": "E",
|
|
149
147
|
"typePrefix": "T",
|
|
@@ -160,7 +158,6 @@ Instead of passing all options via CLI, you can use a configuration file. Create
|
|
|
160
158
|
"output": "./dist",
|
|
161
159
|
"client": "fetch",
|
|
162
160
|
"excludeCoreServiceFiles": true,
|
|
163
|
-
"includeSchemasFiles": true,
|
|
164
161
|
"items": [
|
|
165
162
|
{
|
|
166
163
|
"input": "./first.yml"
|
|
@@ -201,7 +198,6 @@ Instead of passing all options via CLI, you can use a configuration file. Create
|
|
|
201
198
|
| `useOptions` | boolean | `false` | Use options instead of arguments |
|
|
202
199
|
| `useUnionTypes` | boolean | `false` | Use union types instead of enums |
|
|
203
200
|
| `excludeCoreServiceFiles` | boolean | `false` | Exclude core and service files generation |
|
|
204
|
-
| `includeSchemasFiles` | boolean | `false` | Enable model validation schemas generation |
|
|
205
201
|
| `request` | string | - | Path to custom request file |
|
|
206
202
|
| `interfacePrefix` | string | `I` | Prefix for interface models |
|
|
207
203
|
| `enumPrefix` | string | `E` | Prefix for enum models |
|
|
@@ -210,6 +206,7 @@ Instead of passing all options via CLI, you can use a configuration file. Create
|
|
|
210
206
|
| `sortByRequired` | boolean | `false` | Extended sorting strategy for arguments |
|
|
211
207
|
| `useSeparatedIndexes` | boolean | `false` | Use separate index files |
|
|
212
208
|
| `items` | array | - | Array of configurations (for multi-options format) |
|
|
209
|
+
| `validationLibrary` | string | `none` | Validation library for schema generation: `none`, `zod`, `joi`, `yup`, or `jsonschema` |
|
|
213
210
|
|
|
214
211
|
**Note:** You can use the `init-openapi-config` command to generate a template configuration file.
|
|
215
212
|
|
|
@@ -369,11 +366,19 @@ const order: Order = {
|
|
|
369
366
|
}
|
|
370
367
|
```
|
|
371
368
|
|
|
372
|
-
###
|
|
369
|
+
### Validation schemas `--validationLibrary`
|
|
373
370
|
By default, the OpenAPI generator only exports interfaces for your models. These interfaces will help you during
|
|
374
|
-
development, but will not be available in JavaScript during runtime. However,
|
|
375
|
-
that can be useful during runtime, for instance: `maxLength` of a string or a `pattern` to match, etc.
|
|
376
|
-
|
|
371
|
+
development, but will not be available in JavaScript during runtime. However, OpenAPI allows you to define properties
|
|
372
|
+
that can be useful during runtime, for instance: `maxLength` of a string or a `pattern` to match, etc.
|
|
373
|
+
|
|
374
|
+
The `--validationLibrary` parameter allows you to generate runtime validation schemas using popular validation libraries:
|
|
375
|
+
- **none** (default) - No validation schemas generated
|
|
376
|
+
- **zod** - Generate Zod validation schemas
|
|
377
|
+
- **joi** - Generate Joi validation schemas
|
|
378
|
+
- **yup** - Generate Yup validation schemas
|
|
379
|
+
- **jsonschema** - Generate JSON Schema validation schemas
|
|
380
|
+
|
|
381
|
+
Let's say we have the following model:
|
|
377
382
|
|
|
378
383
|
```json
|
|
379
384
|
{
|
|
@@ -407,77 +412,88 @@ we have the following model:
|
|
|
407
412
|
}
|
|
408
413
|
```
|
|
409
414
|
|
|
410
|
-
|
|
415
|
+
**With Zod (`--validationLibrary zod`):**
|
|
411
416
|
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
```ts
|
|
418
|
+
import { z } from 'zod';
|
|
419
|
+
|
|
420
|
+
export const MyModelSchema = z.object({
|
|
421
|
+
key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/),
|
|
422
|
+
name: z.string().max(255),
|
|
423
|
+
enabled: z.boolean().readonly().optional(),
|
|
424
|
+
modified: z.string().datetime().readonly().optional(),
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
export type MyModel = z.infer<typeof MyModelSchema>;
|
|
428
|
+
|
|
429
|
+
export function validateMyModel(data: unknown): MyModel {
|
|
430
|
+
return MyModelSchema.parse(data);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export function safeValidateMyModel(data: unknown): { success: true; data: MyModel } | { success: false; error: z.ZodError } {
|
|
434
|
+
const result = MyModelSchema.safeParse(data);
|
|
435
|
+
if (result.success) {
|
|
436
|
+
return { success: true, data: result.data };
|
|
437
|
+
}
|
|
438
|
+
return { success: false, error: result.error };
|
|
418
439
|
}
|
|
419
440
|
```
|
|
420
441
|
|
|
421
|
-
|
|
422
|
-
if we wanted to create some form where a user could create such a model. In that form you would iterate
|
|
423
|
-
over the properties to render form fields based on their type and validate the input based on the `maxLength`
|
|
424
|
-
or `pattern` property. This requires us to have this information somewhere... For this we can use the
|
|
425
|
-
flag `--includeSchemasFiles` to generate a runtime model next to the normal interface:
|
|
442
|
+
**With Joi (`--validationLibrary joi`):**
|
|
426
443
|
|
|
427
|
-
```
|
|
428
|
-
|
|
444
|
+
```ts
|
|
445
|
+
import Joi from 'joi';
|
|
446
|
+
|
|
447
|
+
export const MyModelSchema = Joi.object({
|
|
448
|
+
key: Joi.string().max(64).pattern(/^[a-zA-Z0-9_]*$/).required(),
|
|
449
|
+
name: Joi.string().max(255).required(),
|
|
450
|
+
enabled: Joi.boolean().readonly(),
|
|
451
|
+
modified: Joi.string().isoDate().readonly(),
|
|
452
|
+
});
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
**With Yup (`--validationLibrary yup`):**
|
|
456
|
+
|
|
457
|
+
```ts
|
|
458
|
+
import * as yup from 'yup';
|
|
459
|
+
|
|
460
|
+
export const MyModelSchema = yup.object({
|
|
461
|
+
key: yup.string().max(64).matches(/^[a-zA-Z0-9_]*$/).required(),
|
|
462
|
+
name: yup.string().max(255).required(),
|
|
463
|
+
enabled: yup.boolean().readonly(),
|
|
464
|
+
modified: yup.string().datetime().readonly(),
|
|
465
|
+
});
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
**With JSON Schema (`--validationLibrary jsonschema`):**
|
|
469
|
+
|
|
470
|
+
```ts
|
|
471
|
+
export const MyModelSchema = {
|
|
472
|
+
type: 'object',
|
|
473
|
+
required: ['key', 'name'],
|
|
429
474
|
properties: {
|
|
430
475
|
key: {
|
|
431
476
|
type: 'string',
|
|
432
|
-
isRequired: true,
|
|
433
477
|
maxLength: 64,
|
|
434
478
|
pattern: '^[a-zA-Z0-9_]*$',
|
|
435
479
|
},
|
|
436
480
|
name: {
|
|
437
481
|
type: 'string',
|
|
438
|
-
isRequired: true,
|
|
439
482
|
maxLength: 255,
|
|
440
483
|
},
|
|
441
484
|
enabled: {
|
|
442
485
|
type: 'boolean',
|
|
443
|
-
|
|
486
|
+
readOnly: true,
|
|
444
487
|
},
|
|
445
488
|
modified: {
|
|
446
489
|
type: 'string',
|
|
447
|
-
isReadOnly: true,
|
|
448
490
|
format: 'date-time',
|
|
491
|
+
readOnly: true,
|
|
449
492
|
},
|
|
450
493
|
},
|
|
451
494
|
};
|
|
452
495
|
```
|
|
453
|
-
|
|
454
|
-
These runtime object are prefixed with a `$` character and expose all the interesting attributes of a model
|
|
455
|
-
and its properties. We can now use this object to generate the form:
|
|
456
|
-
|
|
457
|
-
```typescript jsx
|
|
458
|
-
import { $MyModel } from './generated';
|
|
459
|
-
|
|
460
|
-
// Some pseudo code to iterate over the properties and return a form field
|
|
461
|
-
// the form field could be some abstract component that renders the correct
|
|
462
|
-
// field type and validation rules based on the given input.
|
|
463
|
-
const formFields = Object.entries($MyModel.properties).map(([key, value]) => (
|
|
464
|
-
<FormField
|
|
465
|
-
name={key}
|
|
466
|
-
type={value.type}
|
|
467
|
-
format={value.format}
|
|
468
|
-
maxLength={value.maxLength}
|
|
469
|
-
pattern={value.pattern}
|
|
470
|
-
isReadOnly={value.isReadOnly}
|
|
471
|
-
/>
|
|
472
|
-
));
|
|
473
|
-
|
|
474
|
-
const MyForm = () => (
|
|
475
|
-
<form>
|
|
476
|
-
{formFields}
|
|
477
|
-
</form>
|
|
478
|
-
);
|
|
479
|
-
|
|
480
|
-
```
|
|
496
|
+
These validation schemas can be used for form generation, input validation, and runtime type checking in your application.
|
|
481
497
|
|
|
482
498
|
### Cancelable promise `--useCancelableRequest`
|
|
483
499
|
By default, the OpenAPI generator generates services for accessing the API that use non-cancellable requests. Therefore, we have added the ability to switch the generator to generate canceled API requests. To do this, use the flag `--useCancelableRequest`.
|
|
@@ -510,80 +526,110 @@ export function request<T>(config: TOpenAPIConfig, options: ApiRequestOptions):
|
|
|
510
526
|
}
|
|
511
527
|
```
|
|
512
528
|
|
|
513
|
-
###
|
|
529
|
+
### RequestExecutor
|
|
514
530
|
|
|
515
|
-
Starting from version 2.0.0
|
|
531
|
+
Starting from version **2.0.0** the generated services use the `RequestExecutor` interface
|
|
532
|
+
instead of direct calls to the `request` core function.
|
|
516
533
|
|
|
517
|
-
|
|
534
|
+
The `RequestExecutor` is a single HTTP logic integration point responsible for executing requests
|
|
535
|
+
and extending client behavior. It allows you to:
|
|
536
|
+
- use any transport (fetch/axios/xhr/custom);
|
|
537
|
+
- Centrally handle requests, responses, and errors;
|
|
538
|
+
- expand the client's behavior without changing the generated services.
|
|
518
539
|
|
|
519
|
-
|
|
540
|
+
#### Interceptors
|
|
541
|
+
|
|
542
|
+
`RequestExecutor` supports **interceptors**, which allow you to implement additional
|
|
543
|
+
logic at different stages of the request lifecycle.:
|
|
544
|
+
|
|
545
|
+
- `onRequest` — modification of the request before sending (headers, auth, logging);
|
|
546
|
+
- `onResponse` — processing successful responses;
|
|
547
|
+
- `onError` — centralized error handling.
|
|
548
|
+
|
|
549
|
+
Interceptors are applied at the executor level and are automatically used by all
|
|
550
|
+
generated services.
|
|
551
|
+
|
|
552
|
+
```ts
|
|
553
|
+
import { createClient } from './generated';
|
|
554
|
+
|
|
555
|
+
const client = createClient({
|
|
556
|
+
interceptors: {
|
|
557
|
+
onRequest: [
|
|
558
|
+
(config) => ({
|
|
559
|
+
...config,
|
|
560
|
+
headers: {
|
|
561
|
+
...config.headers,
|
|
562
|
+
Authorization: 'Bearer token',
|
|
563
|
+
},
|
|
564
|
+
}),
|
|
565
|
+
],
|
|
566
|
+
onError: [
|
|
567
|
+
(error) => {
|
|
568
|
+
console.error(error);
|
|
569
|
+
throw error;
|
|
570
|
+
},
|
|
571
|
+
],
|
|
572
|
+
},
|
|
573
|
+
});
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
#### Custom implementation of RequestExecutor with interceptors
|
|
577
|
+
|
|
578
|
+
A custom `RequestExecutor` can be used together with interceptors.
|
|
579
|
+
In this case, the executor is responsible only for the transport and execution of the request,
|
|
580
|
+
while the interceptors are responsible for the extensible business logic (authorization, logging, error handling).
|
|
520
581
|
|
|
521
582
|
```ts
|
|
522
|
-
import type { RequestExecutor, RequestConfig } from './generated/core/
|
|
583
|
+
import type { RequestExecutor, RequestConfig } from './generated/core/executor/requestExecutor';
|
|
584
|
+
import { withInterceptors } from './generated/core/interceptors/withInterceptors';
|
|
523
585
|
import { SimpleService } from './generated/services/SimpleService';
|
|
524
586
|
|
|
525
|
-
// Define your custom options type (optional)
|
|
526
587
|
interface MyCustomOptions {
|
|
527
588
|
timeout?: number;
|
|
528
|
-
retries?: number;
|
|
529
589
|
}
|
|
530
590
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
async request<TResponse>(config: RequestConfig, options?: MyCustomOptions): Promise<TResponse> {
|
|
534
|
-
// Your custom request logic here
|
|
591
|
+
const baseExecutor: RequestExecutor<MyCustomOptions> = {
|
|
592
|
+
async request<T>(config: RequestConfig, options?: MyCustomOptions): Promise<T> {
|
|
535
593
|
const response = await fetch(config.url, {
|
|
536
594
|
method: config.method,
|
|
537
595
|
headers: config.headers,
|
|
538
596
|
body: config.body ? JSON.stringify(config.body) : undefined,
|
|
539
|
-
signal: options?.timeout
|
|
597
|
+
signal: options?.timeout
|
|
598
|
+
? AbortSignal.timeout(options.timeout)
|
|
599
|
+
: undefined,
|
|
540
600
|
});
|
|
541
|
-
|
|
601
|
+
|
|
542
602
|
if (!response.ok) {
|
|
543
|
-
throw new Error(`Request failed: ${response.
|
|
603
|
+
throw new Error(`Request failed: ${response.status}`);
|
|
544
604
|
}
|
|
545
|
-
|
|
605
|
+
|
|
546
606
|
return response.json();
|
|
547
607
|
},
|
|
548
608
|
};
|
|
549
609
|
|
|
550
|
-
//
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
// Optionally, you can map custom options to ApiRequestOptions
|
|
568
|
-
interface XHROptions {
|
|
569
|
-
timeout?: number;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
const executorWithOptions = createLegacyExecutor<XHROptions>(OpenAPI, (options) => {
|
|
573
|
-
// Map your custom options to ApiRequestOptions if needed
|
|
574
|
-
return {
|
|
575
|
-
// Add any ApiRequestOptions fields based on options
|
|
576
|
-
};
|
|
610
|
+
// Wrapping the executor interceptors
|
|
611
|
+
const executor = withInterceptors(baseExecutor, {
|
|
612
|
+
onRequest: [
|
|
613
|
+
(config) => ({
|
|
614
|
+
...config,
|
|
615
|
+
headers: {
|
|
616
|
+
...config.headers,
|
|
617
|
+
Authorization: 'Bearer token',
|
|
618
|
+
},
|
|
619
|
+
}),
|
|
620
|
+
],
|
|
621
|
+
onError: [
|
|
622
|
+
(error) => {
|
|
623
|
+
console.error(error);
|
|
624
|
+
throw error;
|
|
625
|
+
},
|
|
626
|
+
],
|
|
577
627
|
});
|
|
578
628
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
await simpleService.getCallWithoutParametersAndResponse();
|
|
629
|
+
const service = new SimpleService(executor);
|
|
630
|
+
await service.getCallWithoutParametersAndResponse({ timeout: 5000 });
|
|
582
631
|
```
|
|
583
632
|
|
|
584
|
-
**Note:** The `--request` option still works for customizing the core `request` function. The generated
|
|
585
|
-
`legacy-request-adapter` will automatically use your custom request implementation when creating the adapter.
|
|
586
|
-
|
|
587
633
|
### Sorting strategy for function arguments `--sortByRequired`
|
|
588
634
|
By default, the OpenAPI generator sorts the parameters of service functions according to a simplified scheme. If you need a more strict sorting option, then you need to use the `--sortByRequired` flag. The simplified sorting option is similar to the one used in version 0.2.3 of the OpenAPI generator. This flag allows you to upgrade to a new version of the generator if you are "stuck" on version 0.2.3.
|
|
589
635
|
|