ts-openapi-codegen 2.0.0-beta.1 → 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.
- package/README.md +151 -103
- package/README.rus.md +151 -103
- 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 +31 -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 +11 -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 +20 -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/UnifiedOptionsSchemaV4.d.ts +42 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +41 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +67 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +37 -0
- package/dist/common/VersionedSchema/CommonSchemas.d.ts +61 -29
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +51 -61
- 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 +91 -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 +4 -1
- package/dist/common/utils/__tests__/convertArrayToObject.test.js +10 -6
- package/dist/common/utils/convertArrayToObject.js +2 -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 +60 -13
- package/dist/core/WriteClient.d.ts +13 -14
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +71 -24
- package/dist/core/__tests__/WriteClient.test.js +9 -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/EmptySchemaStrategy.enum.d.ts +6 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts.map +1 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.js +9 -0
- package/dist/core/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 +4 -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 +8 -0
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +110 -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 +7 -2
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +32 -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 +16 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +77 -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 +17 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +93 -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 +16 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +77 -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 +13 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +51 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +18 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +94 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +11 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +39 -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 +16 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +61 -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
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Logger } from '../common/Logger';
|
|
2
2
|
import { OutputPaths } from './types/base/OutputPaths.model';
|
|
3
|
+
import { Templates } from './types/base/Templates.model';
|
|
4
|
+
import { EmptySchemaStrategy } from './types/enums/EmptySchemaStrategy.enum';
|
|
3
5
|
import { HttpClient } from './types/enums/HttpClient.enum';
|
|
6
|
+
import { ValidationLibrary } from './types/enums/ValidationLibrary.enum';
|
|
4
7
|
import type { Client } from './types/shared/Client.model';
|
|
5
|
-
import {
|
|
8
|
+
import type { Model } from './types/shared/Model.model';
|
|
6
9
|
import { writeClientCore } from './utils/writeClientCore';
|
|
7
10
|
import { writeClientCoreIndex } from './utils/writeClientCoreIndex';
|
|
11
|
+
import { writeClientExecutor } from './utils/writeClientExecutor';
|
|
8
12
|
import { writeClientFullIndex } from './utils/writeClientFullIndex';
|
|
9
13
|
import { writeClientModels } from './utils/writeClientModels';
|
|
10
14
|
import { writeClientModelsIndex } from './utils/writeClientModelsIndex';
|
|
@@ -21,10 +25,10 @@ import { writeClientSimpleIndex } from './utils/writeClientSimpleIndex';
|
|
|
21
25
|
* @param useOptions Use options or arguments functions
|
|
22
26
|
* @param useUnionTypes Use union types instead of enums
|
|
23
27
|
* @param excludeCoreServiceFiles The generation of the core and services is excluded
|
|
24
|
-
* @param includeSchemasFiles The generation of model validation schemes is enabled
|
|
25
28
|
* @param request: Path to custom request file
|
|
26
29
|
* @param useCancelableRequest Use cancelable request type.
|
|
27
30
|
* @param useSeparatedIndexes Use separate index files for the core, models, schemas, and services
|
|
31
|
+
* @param validationLibrary Validation library to use for schema validation
|
|
28
32
|
*/
|
|
29
33
|
type TWriteClientProps = {
|
|
30
34
|
client: Client;
|
|
@@ -34,12 +38,15 @@ type TWriteClientProps = {
|
|
|
34
38
|
useOptions: boolean;
|
|
35
39
|
useUnionTypes: boolean;
|
|
36
40
|
excludeCoreServiceFiles: boolean;
|
|
37
|
-
includeSchemasFiles: boolean;
|
|
38
41
|
request?: string;
|
|
39
42
|
useCancelableRequest?: boolean;
|
|
40
43
|
useSeparatedIndexes?: boolean;
|
|
44
|
+
validationLibrary?: ValidationLibrary;
|
|
45
|
+
emptySchemaStrategy: EmptySchemaStrategy;
|
|
46
|
+
};
|
|
47
|
+
type TAPIClientGeneratorConfig = Omit<TWriteClientProps, 'httpClient' | 'useOptions' | 'request' | 'useCancelableRequest' | 'useSeparatedIndexes'> & {
|
|
48
|
+
schemaModels: Model[];
|
|
41
49
|
};
|
|
42
|
-
type TAPIClientGeneratorConfig = Omit<TWriteClientProps, 'httpClient' | 'useOptions' | 'request' | 'useCancelableRequest' | 'useSeparatedIndexes'>;
|
|
43
50
|
/**
|
|
44
51
|
* The client which is writing all items and keep the parameters to write index file
|
|
45
52
|
*/
|
|
@@ -49,18 +56,9 @@ export declare class WriteClient {
|
|
|
49
56
|
constructor(logger?: Logger);
|
|
50
57
|
/**
|
|
51
58
|
* Write our OpenAPI client, using the given templates at the given output
|
|
52
|
-
* @param client Client object with all the models, services, etc.
|
|
53
|
-
* @param templates Templates wrapper with all loaded Handlebars templates
|
|
54
|
-
* @param outputPaths A set of parameters with paths for generating main sections (folders)
|
|
55
|
-
* @param httpClient The selected httpClient (fetch, xhr or node)
|
|
56
|
-
* @param useOptions Use options or arguments functions
|
|
57
|
-
* @param useUnionTypes Use union types instead of enums
|
|
58
|
-
* @param excludeCoreServiceFiles:
|
|
59
|
-
* @param includeSchemasFiles:
|
|
60
|
-
* @param request: Path to custom request file
|
|
61
|
-
* @param useCancelableRequest Use cancelable request type.
|
|
62
59
|
*/
|
|
63
60
|
writeClient(options: TWriteClientProps): Promise<void>;
|
|
61
|
+
private writeModelsAndFinalize;
|
|
64
62
|
/**
|
|
65
63
|
* Method keeps all options that is need to create index file
|
|
66
64
|
* @param config
|
|
@@ -89,6 +87,7 @@ export declare class WriteClient {
|
|
|
89
87
|
writeClientServices: typeof writeClientServices;
|
|
90
88
|
writeClientServicesIndex: typeof writeClientServicesIndex;
|
|
91
89
|
writeClientSimpleIndex: typeof writeClientSimpleIndex;
|
|
90
|
+
writeClientExecutor: typeof writeClientExecutor;
|
|
92
91
|
}
|
|
93
92
|
export {};
|
|
94
93
|
//# sourceMappingURL=WriteClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriteClient.d.ts","sourceRoot":"","sources":["../../src/core/WriteClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM1C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"WriteClient.d.ts","sourceRoot":"","sources":["../../src/core/WriteClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM1C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAIxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,KAAK,iBAAiB,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,OAAO,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,EAAE,mBAAmB,CAAC;CAC5C,CAAC;AAEF,KAAK,yBAAyB,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,sBAAsB,GAAG,qBAAqB,CAAC,GAAG;IACjJ,YAAY,EAAE,KAAK,EAAE,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,MAAM,CAAuD;IACrE,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,CAAC,EAAE,MAAM;IAU3B;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;YAkH9C,sBAAsB;IA+BpC;;;OAGG;IACH,6BAA6B,CAAC,MAAM,EAAE,yBAAyB;IAUzD,eAAe;IAKf,sBAAsB;IAK5B,IAAW,MAAM,WAEhB;IAED,OAAO,CAAC,yBAAyB;IAyCjC,OAAO,CAAC,mBAAmB;YA4Db,gBAAgB;YAUhB,uBAAuB;IAMrC,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;IAId,eAAe,yBAAmB;IAClC,oBAAoB,8BAAwB;IAC5C,oBAAoB,8BAAwB;IAC5C,iBAAiB,2BAAqB;IACtC,sBAAsB,gCAA0B;IAChD,kBAAkB,4BAAsB;IACxC,uBAAuB,iCAA2B;IAClD,mBAAmB,6BAAuB;IAC1C,wBAAwB,kCAA4B;IACpD,sBAAsB,gCAA0B;IAChD,mBAAmB,6BAAuB;CACpD"}
|
package/dist/core/WriteClient.js
CHANGED
|
@@ -5,11 +5,13 @@ const Enums_1 = require("../common/Enums");
|
|
|
5
5
|
const Logger_1 = require("../common/Logger");
|
|
6
6
|
const fileSystemHelpers_1 = require("../common/utils/fileSystemHelpers");
|
|
7
7
|
const pathHelpers_1 = require("../common/utils/pathHelpers");
|
|
8
|
+
const ValidationLibrary_enum_1 = require("./types/enums/ValidationLibrary.enum");
|
|
8
9
|
const prepareAlias_1 = require("./utils/prepareAlias");
|
|
9
10
|
const sortModelByName_1 = require("./utils/sortModelByName");
|
|
10
11
|
const unique_1 = require("./utils/unique");
|
|
11
12
|
const writeClientCore_1 = require("./utils/writeClientCore");
|
|
12
13
|
const writeClientCoreIndex_1 = require("./utils/writeClientCoreIndex");
|
|
14
|
+
const writeClientExecutor_1 = require("./utils/writeClientExecutor");
|
|
13
15
|
const writeClientFullIndex_1 = require("./utils/writeClientFullIndex");
|
|
14
16
|
const writeClientModels_1 = require("./utils/writeClientModels");
|
|
15
17
|
const writeClientModelsIndex_1 = require("./utils/writeClientModelsIndex");
|
|
@@ -25,29 +27,25 @@ class WriteClient {
|
|
|
25
27
|
config = new Map();
|
|
26
28
|
_logger;
|
|
27
29
|
constructor(logger) {
|
|
28
|
-
this._logger =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
this._logger =
|
|
31
|
+
logger ||
|
|
32
|
+
new Logger_1.Logger({
|
|
33
|
+
level: Enums_1.ELogLevel.ERROR,
|
|
34
|
+
instanceId: 'client',
|
|
35
|
+
logOutput: Enums_1.ELogOutput.CONSOLE,
|
|
36
|
+
});
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
39
|
* Write our OpenAPI client, using the given templates at the given output
|
|
36
|
-
* @param client Client object with all the models, services, etc.
|
|
37
|
-
* @param templates Templates wrapper with all loaded Handlebars templates
|
|
38
|
-
* @param outputPaths A set of parameters with paths for generating main sections (folders)
|
|
39
|
-
* @param httpClient The selected httpClient (fetch, xhr or node)
|
|
40
|
-
* @param useOptions Use options or arguments functions
|
|
41
|
-
* @param useUnionTypes Use union types instead of enums
|
|
42
|
-
* @param excludeCoreServiceFiles:
|
|
43
|
-
* @param includeSchemasFiles:
|
|
44
|
-
* @param request: Path to custom request file
|
|
45
|
-
* @param useCancelableRequest Use cancelable request type.
|
|
46
40
|
*/
|
|
47
41
|
async writeClient(options) {
|
|
48
|
-
const { client, templates, outputPaths, httpClient, useOptions, useUnionTypes, excludeCoreServiceFiles = false,
|
|
42
|
+
const { client, templates, outputPaths, httpClient, useOptions, useUnionTypes, excludeCoreServiceFiles = false, request, useCancelableRequest = false, useSeparatedIndexes = false, validationLibrary = ValidationLibrary_enum_1.ValidationLibrary.NONE, emptySchemaStrategy, } = options;
|
|
49
43
|
if (!excludeCoreServiceFiles) {
|
|
44
|
+
const executorPath = (0, pathHelpers_1.resolveHelper)(outputPaths.outputCore, 'executor');
|
|
45
|
+
const interceptorsPath = (0, pathHelpers_1.resolveHelper)(outputPaths.outputCore, 'interceptors');
|
|
50
46
|
await fileSystemHelpers_1.fileSystemHelpers.mkdir(outputPaths.outputCore);
|
|
47
|
+
await fileSystemHelpers_1.fileSystemHelpers.mkdir(executorPath);
|
|
48
|
+
await fileSystemHelpers_1.fileSystemHelpers.mkdir(interceptorsPath);
|
|
51
49
|
await this.writeClientCore({ client, templates, outputCorePath: outputPaths.outputCore, httpClient, request, useCancelableRequest });
|
|
52
50
|
await this.writeClientCoreIndex({
|
|
53
51
|
templates,
|
|
@@ -76,23 +74,69 @@ class WriteClient {
|
|
|
76
74
|
outputServices,
|
|
77
75
|
useSeparatedIndexes,
|
|
78
76
|
});
|
|
77
|
+
await this.writeClientExecutor({
|
|
78
|
+
outputPath: outputPaths.output,
|
|
79
|
+
outputCorePath: (0, pathHelpers_1.relativeHelper)(outputPaths.output, outputCore),
|
|
80
|
+
services: client.services,
|
|
81
|
+
templates,
|
|
82
|
+
});
|
|
79
83
|
}
|
|
80
|
-
|
|
84
|
+
/**
|
|
85
|
+
* TODO: Нужно собирать импорты из всех вложенных моделей (link, properties в composition и т.д.) и передавать их в шаблон.
|
|
86
|
+
* Это делается в writeClientSchemas или в парсере моделей.
|
|
87
|
+
*/
|
|
88
|
+
if (validationLibrary !== ValidationLibrary_enum_1.ValidationLibrary.NONE) {
|
|
81
89
|
await fileSystemHelpers_1.fileSystemHelpers.mkdir(outputPaths.outputSchemas);
|
|
82
|
-
await this.writeClientSchemas({
|
|
90
|
+
const schemaModels = await this.writeClientSchemas({
|
|
83
91
|
models: client.models,
|
|
84
92
|
templates,
|
|
85
93
|
outputSchemasPath: outputPaths.outputSchemas,
|
|
86
94
|
httpClient,
|
|
87
95
|
useUnionTypes,
|
|
96
|
+
validationLibrary,
|
|
97
|
+
emptySchemaStrategy,
|
|
88
98
|
});
|
|
89
99
|
await this.writeClientSchemasIndex({
|
|
90
|
-
models:
|
|
100
|
+
models: schemaModels,
|
|
91
101
|
templates,
|
|
92
102
|
outputSchemasPath: outputPaths.outputSchemas,
|
|
93
103
|
useSeparatedIndexes,
|
|
94
104
|
});
|
|
105
|
+
await this.writeModelsAndFinalize({
|
|
106
|
+
client,
|
|
107
|
+
templates,
|
|
108
|
+
outputPaths,
|
|
109
|
+
httpClient,
|
|
110
|
+
useOptions,
|
|
111
|
+
useUnionTypes,
|
|
112
|
+
excludeCoreServiceFiles,
|
|
113
|
+
request,
|
|
114
|
+
useCancelableRequest,
|
|
115
|
+
useSeparatedIndexes,
|
|
116
|
+
validationLibrary,
|
|
117
|
+
emptySchemaStrategy,
|
|
118
|
+
schemaModels,
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
95
121
|
}
|
|
122
|
+
await this.writeModelsAndFinalize({
|
|
123
|
+
client,
|
|
124
|
+
templates,
|
|
125
|
+
outputPaths,
|
|
126
|
+
httpClient,
|
|
127
|
+
useOptions,
|
|
128
|
+
useUnionTypes,
|
|
129
|
+
excludeCoreServiceFiles,
|
|
130
|
+
request,
|
|
131
|
+
useCancelableRequest,
|
|
132
|
+
useSeparatedIndexes,
|
|
133
|
+
validationLibrary,
|
|
134
|
+
emptySchemaStrategy,
|
|
135
|
+
schemaModels: [],
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
async writeModelsAndFinalize(config) {
|
|
139
|
+
const { client, templates, outputPaths, httpClient, useUnionTypes, useSeparatedIndexes, excludeCoreServiceFiles, validationLibrary, emptySchemaStrategy, schemaModels } = config;
|
|
96
140
|
await fileSystemHelpers_1.fileSystemHelpers.mkdir(outputPaths.outputModels);
|
|
97
141
|
await this.writeClientModels({
|
|
98
142
|
models: client.models,
|
|
@@ -114,7 +158,9 @@ class WriteClient {
|
|
|
114
158
|
outputPaths,
|
|
115
159
|
useUnionTypes,
|
|
116
160
|
excludeCoreServiceFiles,
|
|
117
|
-
|
|
161
|
+
validationLibrary,
|
|
162
|
+
emptySchemaStrategy,
|
|
163
|
+
schemaModels,
|
|
118
164
|
});
|
|
119
165
|
}
|
|
120
166
|
/**
|
|
@@ -146,7 +192,7 @@ class WriteClient {
|
|
|
146
192
|
const result = new Map();
|
|
147
193
|
for (const [key, value] of this.config.entries()) {
|
|
148
194
|
for (const item of value) {
|
|
149
|
-
const { outputPaths, templates, excludeCoreServiceFiles,
|
|
195
|
+
const { outputPaths, templates, excludeCoreServiceFiles, validationLibrary, schemaModels } = item;
|
|
150
196
|
const outputCore = this.getOutputPath(outputPaths?.outputCore, key, 'core');
|
|
151
197
|
const outputModels = this.getOutputPath(outputPaths?.outputModels, key, 'models');
|
|
152
198
|
const outputSchemas = this.getOutputPath(outputPaths?.outputSchemas, key, 'schemas');
|
|
@@ -166,7 +212,7 @@ class WriteClient {
|
|
|
166
212
|
if (!clientIndex.models.includes(relativePathModel)) {
|
|
167
213
|
clientIndex.models.push(relativePathModel);
|
|
168
214
|
}
|
|
169
|
-
if (
|
|
215
|
+
if (validationLibrary !== ValidationLibrary_enum_1.ValidationLibrary.NONE && schemaModels.length > 0) {
|
|
170
216
|
const relativePathSchema = (0, pathHelpers_1.relativeHelper)(key, outputSchemas);
|
|
171
217
|
if (!clientIndex.schemas.includes(relativePathSchema)) {
|
|
172
218
|
clientIndex.schemas.push(relativePathSchema);
|
|
@@ -180,7 +226,7 @@ class WriteClient {
|
|
|
180
226
|
const result = new Map();
|
|
181
227
|
for (const [key, value] of this.config.entries()) {
|
|
182
228
|
for (const item of value) {
|
|
183
|
-
const { outputPaths, client, templates, useUnionTypes, excludeCoreServiceFiles,
|
|
229
|
+
const { outputPaths, client, templates, useUnionTypes, excludeCoreServiceFiles, validationLibrary, schemaModels } = item;
|
|
184
230
|
const outputCore = this.getOutputPath(outputPaths?.outputCore, key, 'core');
|
|
185
231
|
const outputModels = this.getOutputPath(outputPaths?.outputModels, key, 'models');
|
|
186
232
|
const outputSchemas = this.getOutputPath(outputPaths?.outputSchemas, key, 'schemas');
|
|
@@ -216,7 +262,7 @@ class WriteClient {
|
|
|
216
262
|
if (!clientIndex.models.some(m => this.isSameModel(m, modelFinal))) {
|
|
217
263
|
clientIndex.models.push(modelFinal);
|
|
218
264
|
}
|
|
219
|
-
if (
|
|
265
|
+
if (validationLibrary !== ValidationLibrary_enum_1.ValidationLibrary.NONE && schemaModels.some(schemaModel => schemaModel.name === model.name && schemaModel.path === model.path)) {
|
|
220
266
|
const schema = { ...modelFinal, package: relativePathSchema };
|
|
221
267
|
if (!clientIndex.schemas.some(s => this.isSameShema(s, schema))) {
|
|
222
268
|
clientIndex.schemas.push(schema);
|
|
@@ -289,5 +335,6 @@ class WriteClient {
|
|
|
289
335
|
writeClientServices = writeClientServices_1.writeClientServices;
|
|
290
336
|
writeClientServicesIndex = writeClientServicesIndex_1.writeClientServicesIndex;
|
|
291
337
|
writeClientSimpleIndex = writeClientSimpleIndex_1.writeClientSimpleIndex;
|
|
338
|
+
writeClientExecutor = writeClientExecutor_1.writeClientExecutor;
|
|
292
339
|
}
|
|
293
340
|
exports.WriteClient = WriteClient;
|
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
7
|
const node_test_1 = require("node:test");
|
|
8
8
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
9
|
+
const EmptySchemaStrategy_enum_1 = require("../types/enums/EmptySchemaStrategy.enum");
|
|
9
10
|
const HttpClient_enum_1 = require("../types/enums/HttpClient.enum");
|
|
11
|
+
const ValidationLibrary_enum_1 = require("../types/enums/ValidationLibrary.enum");
|
|
10
12
|
const getOutputPaths_1 = require("../utils/getOutputPaths");
|
|
11
13
|
const WriteClient_1 = require("../WriteClient");
|
|
12
14
|
(0, node_test_1.describe)('@unit: writeClient', () => {
|
|
@@ -39,6 +41,7 @@ const WriteClient_1 = require("../WriteClient");
|
|
|
39
41
|
services: () => 'servicesIndex',
|
|
40
42
|
},
|
|
41
43
|
exports: {
|
|
44
|
+
client: () => 'client',
|
|
42
45
|
model: () => 'model',
|
|
43
46
|
schema: () => 'schema',
|
|
44
47
|
service: () => 'service',
|
|
@@ -51,8 +54,11 @@ const WriteClient_1 = require("../WriteClient");
|
|
|
51
54
|
request: () => 'request',
|
|
52
55
|
cancelablePromise: () => 'cancelablePromise',
|
|
53
56
|
httpStatusCode: () => 'httpStatusCode',
|
|
54
|
-
|
|
57
|
+
createExecutorAdapter: () => 'createExecutorAdapter',
|
|
55
58
|
requestExecutor: () => 'requestExecutor',
|
|
59
|
+
apiErrorInterceptor: () => 'apiErrorInterceptor',
|
|
60
|
+
interceptors: () => 'interceptors',
|
|
61
|
+
withInterceptors: () => 'withInterceptors'
|
|
56
62
|
},
|
|
57
63
|
};
|
|
58
64
|
const outputPaths = (0, getOutputPaths_1.getOutputPaths)({ output: './dist' });
|
|
@@ -64,7 +70,8 @@ const WriteClient_1 = require("../WriteClient");
|
|
|
64
70
|
useOptions: false,
|
|
65
71
|
useUnionTypes: false,
|
|
66
72
|
excludeCoreServiceFiles: false,
|
|
67
|
-
|
|
73
|
+
validationLibrary: ValidationLibrary_enum_1.ValidationLibrary.NONE,
|
|
74
|
+
emptySchemaStrategy: EmptySchemaStrategy_enum_1.EmptySchemaStrategy.KEEP,
|
|
68
75
|
});
|
|
69
76
|
strict_1.default.ok(mkdirCalls.length > 0, 'mkdir should be called at least once');
|
|
70
77
|
strict_1.default.ok(writeFileCalls.length > 0, 'writeFile should be called at least once');
|
|
@@ -15,7 +15,7 @@ export declare class Parser {
|
|
|
15
15
|
_context: Context;
|
|
16
16
|
constructor(context: Context);
|
|
17
17
|
get context(): Context;
|
|
18
|
-
getTypeNameByRef(value: string, ref?: string): string;
|
|
18
|
+
getTypeNameByRef(value: string, ref: string, parentSourceFile?: string): string;
|
|
19
19
|
parse: typeof parse;
|
|
20
20
|
getModels: typeof getModels;
|
|
21
21
|
getType: typeof getType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../../../src/core/api/v2/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,MAAM;IACR,QAAQ,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,OAAO;IAI5B,IAAI,OAAO,IAAI,OAAO,CAErB;IAEM,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../../../src/core/api/v2/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,MAAM;IACR,QAAQ,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,OAAO;IAI5B,IAAI,OAAO,IAAI,OAAO,CAErB;IAEM,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAS/E,KAAK,eAAS;IACd,SAAS,mBAAa;IACtB,OAAO,iBAAW;IAClB,QAAQ,kBAAY;IACpB,mBAAmB,6BAAuB;IAC1C,kBAAkB,4BAAsB;IACxC,WAAW,qBAAe;IAC1B,sBAAsB,gCAA0B;IAChD,qBAAqB,+BAAyB;IAC9C,YAAY,sBAAgB;IAC5B,qBAAqB,+BAAyB;IAC9C,oBAAoB,8BAAwB;CACtD"}
|
|
@@ -22,9 +22,9 @@ class Parser {
|
|
|
22
22
|
get context() {
|
|
23
23
|
return this._context;
|
|
24
24
|
}
|
|
25
|
-
getTypeNameByRef(value, ref) {
|
|
25
|
+
getTypeNameByRef(value, ref, parentSourceFile) {
|
|
26
26
|
if (ref) {
|
|
27
|
-
const definition = this.context.get(ref);
|
|
27
|
+
const definition = this.context.get(ref, parentSourceFile);
|
|
28
28
|
return (0, getModelNameWithPrefix_1.getModelNameWithPrefix)(value, definition, this._context.prefix);
|
|
29
29
|
}
|
|
30
30
|
return value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getModel.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"getModel.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAM/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,KAAK,CAyJjE"}
|
|
@@ -6,7 +6,6 @@ const getComment_1 = require("../../../utils/getComment");
|
|
|
6
6
|
const getEnum_1 = require("../../../utils/getEnum");
|
|
7
7
|
const getEnumFromDescription_1 = require("../../../utils/getEnumFromDescription");
|
|
8
8
|
const getPattern_1 = require("../../../utils/getPattern");
|
|
9
|
-
const normalizeRef_1 = require("../../../utils/normalizeRef");
|
|
10
9
|
function getModel(config) {
|
|
11
10
|
const { openApi, definition, isDefinition = false, name = '', path = '', parentRef } = config;
|
|
12
11
|
const model = {
|
|
@@ -45,8 +44,7 @@ function getModel(config) {
|
|
|
45
44
|
properties: [],
|
|
46
45
|
};
|
|
47
46
|
if (definition.$ref) {
|
|
48
|
-
const
|
|
49
|
-
const definitionRef = this.getType(definition.$ref, normalizedRef);
|
|
47
|
+
const definitionRef = this.getType(definition.$ref, parentRef);
|
|
50
48
|
model.export = 'reference';
|
|
51
49
|
model.type = definitionRef.type;
|
|
52
50
|
model.base = definitionRef.base;
|
|
@@ -77,8 +75,7 @@ function getModel(config) {
|
|
|
77
75
|
}
|
|
78
76
|
if (definition.type === 'array' && definition.items) {
|
|
79
77
|
if (definition.items.$ref) {
|
|
80
|
-
const
|
|
81
|
-
const arrayItems = this.getType(definition.items.$ref, normalizedRef);
|
|
78
|
+
const arrayItems = this.getType(definition.items.$ref, parentRef);
|
|
82
79
|
model.export = 'array';
|
|
83
80
|
model.type = arrayItems.type;
|
|
84
81
|
model.base = arrayItems.base;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getModelProperties.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getModelProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"getModelProperties.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getModelProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAI/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,EAAE,CAgFxH"}
|
|
@@ -5,7 +5,6 @@ const safeHasOwn_1 = require("../../../../common/utils/safeHasOwn");
|
|
|
5
5
|
const escapeName_1 = require("../../../utils/escapeName");
|
|
6
6
|
const getComment_1 = require("../../../utils/getComment");
|
|
7
7
|
const getPattern_1 = require("../../../utils/getPattern");
|
|
8
|
-
const normalizeRef_1 = require("../../../utils/normalizeRef");
|
|
9
8
|
function getModelProperties(openApi, definition, parentRef) {
|
|
10
9
|
const models = [];
|
|
11
10
|
for (const propertyName in definition.properties) {
|
|
@@ -13,8 +12,7 @@ function getModelProperties(openApi, definition, parentRef) {
|
|
|
13
12
|
const property = definition.properties[propertyName];
|
|
14
13
|
const propertyRequired = definition.required?.includes(propertyName) || property.default !== undefined;
|
|
15
14
|
if (property.$ref) {
|
|
16
|
-
const
|
|
17
|
-
const model = this.getType(property.$ref, normalizedRef);
|
|
15
|
+
const model = this.getType(property.$ref, parentRef);
|
|
18
16
|
models.push({
|
|
19
17
|
name: (0, escapeName_1.escapeName)(propertyName),
|
|
20
18
|
alias: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAI/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,CAsBjE"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getModels = getModels;
|
|
4
|
-
const getModelNameWithPrefix_1 = require("../../../utils/getModelNameWithPrefix");
|
|
5
|
-
const getRefFromSchema_1 = require("../../../utils/getRefFromSchema");
|
|
6
4
|
const modelHelpers_1 = require("../../../utils/modelHelpers");
|
|
7
5
|
const sortModelsByName_1 = require("../../../utils/sortModelsByName");
|
|
8
6
|
const unique_1 = require("../../../utils/unique");
|
|
9
7
|
function getModels(openApi) {
|
|
10
8
|
let models = [];
|
|
11
|
-
const listOfModelsRef =
|
|
9
|
+
const listOfModelsRef = this.context.getAllCanonicalRefs();
|
|
12
10
|
if (listOfModelsRef) {
|
|
13
11
|
for (const modelRef of listOfModelsRef) {
|
|
14
12
|
const definition = this.context.get(modelRef);
|
|
@@ -17,7 +15,7 @@ function getModels(openApi) {
|
|
|
17
15
|
openApi: openApi,
|
|
18
16
|
definition: definition,
|
|
19
17
|
isDefinition: true,
|
|
20
|
-
name:
|
|
18
|
+
name: definitionType.base,
|
|
21
19
|
path: definitionType.path,
|
|
22
20
|
parentRef: modelRef,
|
|
23
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOperationParameter.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getOperationParameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"getOperationParameter.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getOperationParameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAOzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAsIxI"}
|
|
@@ -7,7 +7,6 @@ const getEnum_1 = require("../../../utils/getEnum");
|
|
|
7
7
|
const getEnumFromDescription_1 = require("../../../utils/getEnumFromDescription");
|
|
8
8
|
const getOperationParameterName_1 = require("../../../utils/getOperationParameterName");
|
|
9
9
|
const getPattern_1 = require("../../../utils/getPattern");
|
|
10
|
-
const normalizeRef_1 = require("../../../utils/normalizeRef");
|
|
11
10
|
const getOperationParameterDefault_1 = require("./getOperationParameterDefault");
|
|
12
11
|
function getOperationParameter(openApi, parameter, parentRef) {
|
|
13
12
|
const operationParameter = {
|
|
@@ -45,8 +44,7 @@ function getOperationParameter(openApi, parameter, parentRef) {
|
|
|
45
44
|
mediaType: null,
|
|
46
45
|
};
|
|
47
46
|
if (parameter.$ref) {
|
|
48
|
-
const
|
|
49
|
-
const definitionRef = this.getType(parameter.$ref, normalizedRef);
|
|
47
|
+
const definitionRef = this.getType(parameter.$ref, parentRef);
|
|
50
48
|
operationParameter.export = 'reference';
|
|
51
49
|
operationParameter.type = definitionRef.type;
|
|
52
50
|
operationParameter.base = definitionRef.base;
|
|
@@ -101,8 +99,7 @@ function getOperationParameter(openApi, parameter, parentRef) {
|
|
|
101
99
|
}
|
|
102
100
|
if (parameter.schema) {
|
|
103
101
|
if (parameter.schema.$ref) {
|
|
104
|
-
const
|
|
105
|
-
const model = this.getType(parameter.schema.$ref, normalizedRef);
|
|
102
|
+
const model = this.getType(parameter.schema.$ref, parentRef);
|
|
106
103
|
operationParameter.export = 'reference';
|
|
107
104
|
operationParameter.type = model.type;
|
|
108
105
|
operationParameter.base = model.base;
|
|
@@ -16,7 +16,7 @@ function getOperationParameters(openApi, parameters, parentRef) {
|
|
|
16
16
|
};
|
|
17
17
|
// Iterate over the parameters
|
|
18
18
|
parameters.forEach(parameterOrReference => {
|
|
19
|
-
const parameterDef = (parameterOrReference.$ref ? this.context.get(parameterOrReference.$ref) : parameterOrReference);
|
|
19
|
+
const parameterDef = (parameterOrReference.$ref ? this.context.get(parameterOrReference.$ref, parentRef) : parameterOrReference);
|
|
20
20
|
const parameter = this.getOperationParameter(openApi, parameterDef, parentRef);
|
|
21
21
|
// We ignore the "api-version" param, since we do not want to add this
|
|
22
22
|
// as the first / default parameter for each of the service calls.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOperationResponse.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getOperationResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"getOperationResponse.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getOperationResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAmF1J"}
|
|
@@ -4,7 +4,6 @@ exports.getOperationResponse = getOperationResponse;
|
|
|
4
4
|
const safeHasOwn_1 = require("../../../../common/utils/safeHasOwn");
|
|
5
5
|
const getComment_1 = require("../../../utils/getComment");
|
|
6
6
|
const getPattern_1 = require("../../../utils/getPattern");
|
|
7
|
-
const normalizeRef_1 = require("../../../utils/normalizeRef");
|
|
8
7
|
function getOperationResponse(openApi, response, responseCode, parentRef) {
|
|
9
8
|
const operationResponse = {
|
|
10
9
|
in: 'response',
|
|
@@ -33,8 +32,7 @@ function getOperationResponse(openApi, response, responseCode, parentRef) {
|
|
|
33
32
|
// then we need to parse the schema!
|
|
34
33
|
if (response.schema) {
|
|
35
34
|
if (response.schema.$ref) {
|
|
36
|
-
const
|
|
37
|
-
const model = this.getType(response.schema.$ref, normalizedRef);
|
|
35
|
+
const model = this.getType(response.schema.$ref, parentRef);
|
|
38
36
|
operationResponse.export = 'reference';
|
|
39
37
|
operationResponse.type = model.type;
|
|
40
38
|
operationResponse.base = model.base;
|
|
@@ -10,7 +10,7 @@ function getOperationResponses(openApi, responses, parentRef) {
|
|
|
10
10
|
for (const code in responses) {
|
|
11
11
|
if ((0, safeHasOwn_1.safeHasOwn)(responses, code)) {
|
|
12
12
|
const responseOrReference = responses[code];
|
|
13
|
-
const response = (responseOrReference.$ref ? this.context.get(responseOrReference.$ref) : responseOrReference);
|
|
13
|
+
const response = (responseOrReference.$ref ? this.context.get(responseOrReference.$ref, parentRef) : responseOrReference);
|
|
14
14
|
const responseCode = (0, getOperationResponseCode_1.getOperationResponseCode)(code);
|
|
15
15
|
if (responseCode) {
|
|
16
16
|
const operationResponse = this.getOperationResponse(openApi, response, responseCode, parentRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getServices.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getServices.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"getServices.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getServices.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAiCrE"}
|
|
@@ -14,9 +14,10 @@ function getServices(openApi) {
|
|
|
14
14
|
if ((0, safeHasOwn_1.safeHasOwn)(openApi.paths, url)) {
|
|
15
15
|
// Grab path and parse any global path parameters
|
|
16
16
|
const pathByUrl = openApi.paths[url];
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const parentFileRef = pathByUrl.$ref ||
|
|
17
|
+
const rootPath = this.context.root?.path || '';
|
|
18
|
+
const path = (pathByUrl.$ref ? this.context.get(pathByUrl.$ref, rootPath) : pathByUrl);
|
|
19
|
+
const parentFileRef = pathByUrl.$ref || rootPath;
|
|
20
|
+
const pathParams = this.getOperationParameters(openApi, path.parameters || [], parentFileRef);
|
|
20
21
|
// Parse all the methods for this path
|
|
21
22
|
(0, serviceHelpers_1.forEachOperationInPath)(path, (method, op) => {
|
|
22
23
|
// Each method contains an OpenAPI operation, we parse the operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getType.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getType.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getType.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v2/parser/getType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAM7D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CA8C5E"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getType = getType;
|
|
4
|
+
const pathHelpers_1 = require("../../../../common/utils/pathHelpers");
|
|
4
5
|
const getMappedType_1 = require("../../../utils/getMappedType");
|
|
6
|
+
const getRelativeModelPath_1 = require("../../../utils/getRelativeModelPath");
|
|
5
7
|
const getTypeName_1 = require("../../../utils/getTypeName");
|
|
6
8
|
const normalizeString_1 = require("../../../utils/normalizeString");
|
|
7
|
-
const resolveRefToImportPath_1 = require("../../../utils/resolveRefToImportPath");
|
|
8
9
|
const stripNamespace_1 = require("../../../utils/stripNamespace");
|
|
9
10
|
/**
|
|
10
11
|
* Parse any string value into a type object.
|
|
@@ -30,14 +31,20 @@ function getType(value, parentRef) {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
else if (valueClean) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
/**
|
|
35
|
+
* canonicalValue может быть пустой строкой.
|
|
36
|
+
* В этом случае надо брать непосредственно normalizedValue - это относительный путь или фрагмент.
|
|
37
|
+
* Предполагаем, что в таком случае расчитывать нет нужды. Это путь от папки outputModels
|
|
38
|
+
*/
|
|
39
|
+
const canonicalValue = this.context.resolveCanonicalRef(normalizedValue, parentRef);
|
|
40
|
+
let valuePath = valueClean;
|
|
41
|
+
if (canonicalValue) {
|
|
42
|
+
const refValuePath = canonicalValue?.fragment ? `${canonicalValue.outputFile}${canonicalValue.fragment}` : canonicalValue?.outputFile || '';
|
|
43
|
+
const cleanedRefValuePath = (0, stripNamespace_1.stripNamespace)(refValuePath);
|
|
44
|
+
valuePath = (0, pathHelpers_1.relativeHelper)(this.context.output?.outputModels, cleanedRefValuePath);
|
|
45
|
+
}
|
|
46
|
+
valuePath = (0, getRelativeModelPath_1.getRelativeModelPath)(this.context.output?.outputModels, valuePath);
|
|
47
|
+
const type = this.getTypeNameByRef((0, getTypeName_1.getTypeName)(valueClean), normalizedValue, parentRef);
|
|
41
48
|
const valueImportPath = !valuePath.startsWith('./') ? `./${valuePath}` : valuePath;
|
|
42
49
|
result.path = valuePath;
|
|
43
50
|
result.type = type;
|
|
@@ -16,7 +16,7 @@ export declare class Parser {
|
|
|
16
16
|
private _context;
|
|
17
17
|
constructor(context: Context);
|
|
18
18
|
get context(): Context;
|
|
19
|
-
getTypeNameByRef(value: string, ref?: string): string;
|
|
19
|
+
getTypeNameByRef(value: string, ref: string, parentSourceFile?: string): string;
|
|
20
20
|
parse: typeof parse;
|
|
21
21
|
getModels: typeof getModels;
|
|
22
22
|
getType: typeof getType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../../../src/core/api/v3/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,MAAM;IACf,OAAO,CAAC,QAAQ,CAAU;gBAEd,OAAO,EAAE,OAAO;IAI5B,IAAI,OAAO,IAAI,OAAO,CAErB;IAEM,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../../../src/core/api/v3/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,MAAM;IACf,OAAO,CAAC,QAAQ,CAAU;gBAEd,OAAO,EAAE,OAAO;IAI5B,IAAI,OAAO,IAAI,OAAO,CAErB;IAEM,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAS/E,KAAK,eAAS;IACd,SAAS,mBAAa;IACtB,OAAO,iBAAW;IAClB,QAAQ,kBAAY;IACpB,mBAAmB,6BAAuB;IAC1C,kBAAkB,4BAAsB;IACxC,WAAW,qBAAe;IAC1B,sBAAsB,gCAA0B;IAChD,qBAAqB,+BAAyB;IAC9C,YAAY,sBAAgB;IAC5B,qBAAqB,+BAAyB;IAC9C,oBAAoB,8BAAwB;IAC5C,uBAAuB,iCAA2B;CAC5D"}
|
|
@@ -23,9 +23,9 @@ class Parser {
|
|
|
23
23
|
get context() {
|
|
24
24
|
return this._context;
|
|
25
25
|
}
|
|
26
|
-
getTypeNameByRef(value, ref) {
|
|
26
|
+
getTypeNameByRef(value, ref, parentSourceFile) {
|
|
27
27
|
if (ref) {
|
|
28
|
-
const definition = this.context.get(ref);
|
|
28
|
+
const definition = this.context.get(ref, parentSourceFile);
|
|
29
29
|
return (0, getModelNameWithPrefix_1.getModelNameWithPrefix)(value, definition, this._context.prefix);
|
|
30
30
|
}
|
|
31
31
|
return value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getModel.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"getModel.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAM/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,KAAK,CAgLjE"}
|