ts-openapi-codegen 2.0.0-beta.0 → 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 +175 -55
- package/README.rus.md +175 -54
- 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 +8 -1
- 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 +3 -0
- package/dist/core/utils/__mocks__/templates.d.ts.map +1 -0
- package/dist/core/utils/__mocks__/templates.js +33 -0
- 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__/writeClientCore.test.js +2 -25
- 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__/writeClientFullIndex.test.js +2 -25
- package/dist/core/utils/__tests__/writeClientModels.test.js +2 -25
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +4 -25
- package/dist/core/utils/__tests__/writeClientServices.test.js +2 -25
- 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 -25
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +97 -2
- 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 -1
- 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/executor/requestExecutor.d.ts +8 -0
- 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/interceptors/interceptors.d.ts +8 -0
- 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.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportService.js +46 -50
- 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/core/types/base/{RefWithtype.model.js → Templates.model.js} +0 -0
package/dist/core/Context.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Context = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
4
5
|
const pathHelpers_1 = require("../common/utils/pathHelpers");
|
|
5
6
|
const getFileName_1 = require("./utils/getFileName");
|
|
6
7
|
const isString_1 = require("./utils/isString");
|
|
8
|
+
const normalizeRef_1 = require("./utils/normalizeRef");
|
|
9
|
+
const parseRef_1 = require("./utils/parseRef");
|
|
7
10
|
/**
|
|
8
11
|
* A Context wich can share a data between methods
|
|
9
12
|
*/
|
|
@@ -17,6 +20,9 @@ class Context {
|
|
|
17
20
|
type: 'T',
|
|
18
21
|
};
|
|
19
22
|
_sortByRequired = false;
|
|
23
|
+
specRoot;
|
|
24
|
+
entryFile;
|
|
25
|
+
virtualFiles = new Map();
|
|
20
26
|
constructor({ input, output, prefix, sortByRequired }) {
|
|
21
27
|
this._output = output;
|
|
22
28
|
this._refs = {};
|
|
@@ -44,11 +50,12 @@ class Context {
|
|
|
44
50
|
}
|
|
45
51
|
return this._refs.values(...types);
|
|
46
52
|
}
|
|
47
|
-
get($ref) {
|
|
53
|
+
get($ref, parentSourceFile) {
|
|
48
54
|
if (!this._refs) {
|
|
49
55
|
throw new Error('Context must be initialized');
|
|
50
56
|
}
|
|
51
|
-
|
|
57
|
+
const normalizedRef = this.normalizeRefForLookup($ref, parentSourceFile);
|
|
58
|
+
return this._refs.get(normalizedRef);
|
|
52
59
|
}
|
|
53
60
|
paths(...types) {
|
|
54
61
|
if (!this._refs) {
|
|
@@ -56,11 +63,12 @@ class Context {
|
|
|
56
63
|
}
|
|
57
64
|
return this._refs.paths(...types);
|
|
58
65
|
}
|
|
59
|
-
exists($ref) {
|
|
66
|
+
exists($ref, parentSourceFile) {
|
|
60
67
|
if (!this._refs) {
|
|
61
68
|
throw new Error('Context must be initialized');
|
|
62
69
|
}
|
|
63
|
-
|
|
70
|
+
const normalizedRef = this.normalizeRefForLookup($ref, parentSourceFile);
|
|
71
|
+
return this._refs.exists(normalizedRef);
|
|
64
72
|
}
|
|
65
73
|
fileName() {
|
|
66
74
|
if (!this._root) {
|
|
@@ -80,5 +88,137 @@ class Context {
|
|
|
80
88
|
get root() {
|
|
81
89
|
return this._root;
|
|
82
90
|
}
|
|
91
|
+
canonicalizeRef(ref, parentSourceFile) {
|
|
92
|
+
const parsed = (0, parseRef_1.parseRef)(ref);
|
|
93
|
+
// LOCAL_FRAGMENT → тот же файл
|
|
94
|
+
if (parsed.type === parseRef_1.RefType.LOCAL_FRAGMENT) {
|
|
95
|
+
return {
|
|
96
|
+
sourceFile: (0, pathHelpers_1.normalizeHelper)(parentSourceFile),
|
|
97
|
+
fragment: parsed.fragment,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// Внешний ref
|
|
101
|
+
const parentDir = (0, pathHelpers_1.dirNameHelper)(parentSourceFile);
|
|
102
|
+
const absSource = (0, pathHelpers_1.resolveHelper)(parentDir, parsed.filePath);
|
|
103
|
+
return {
|
|
104
|
+
sourceFile: (0, pathHelpers_1.normalizeHelper)(absSource),
|
|
105
|
+
fragment: parsed.fragment,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
mapSourceToOutput(sourceFile) {
|
|
109
|
+
const relative = (0, pathHelpers_1.relativeHelper)(this.specRoot, sourceFile);
|
|
110
|
+
const dir = (0, pathHelpers_1.dirNameHelper)(relative);
|
|
111
|
+
const baseName = (0, path_1.basename)(relative).replace(/\.(yaml|yml|json)$/i, '.ts');
|
|
112
|
+
return (0, pathHelpers_1.resolveHelper)(this.output.outputModels, dir, baseName);
|
|
113
|
+
}
|
|
114
|
+
walkSchemaForFragments(obj, parentSourceFile) {
|
|
115
|
+
if (!obj || typeof obj !== 'object')
|
|
116
|
+
return;
|
|
117
|
+
if (typeof obj.$ref === 'string') {
|
|
118
|
+
const { sourceFile, fragment } = this.canonicalizeRef(obj.$ref, parentSourceFile);
|
|
119
|
+
let entry = this.virtualFiles.get(sourceFile);
|
|
120
|
+
if (!entry) {
|
|
121
|
+
entry = {
|
|
122
|
+
sourceFile,
|
|
123
|
+
outputFile: this.mapSourceToOutput(sourceFile),
|
|
124
|
+
fragments: new Set(),
|
|
125
|
+
};
|
|
126
|
+
this.virtualFiles.set(sourceFile, entry);
|
|
127
|
+
}
|
|
128
|
+
if (fragment) {
|
|
129
|
+
entry.fragments.add(fragment);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (Array.isArray(obj)) {
|
|
133
|
+
obj.forEach(item => this.walkSchemaForFragments(item, parentSourceFile));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
for (const value of Object.values(obj)) {
|
|
137
|
+
this.walkSchemaForFragments(value, parentSourceFile);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
initializeVirtualFileMap(rootSchema, entryFile) {
|
|
141
|
+
this.specRoot = (0, pathHelpers_1.normalizeHelper)((0, pathHelpers_1.dirNameHelper)(entryFile));
|
|
142
|
+
const normalizedEntry = (0, pathHelpers_1.normalizeHelper)(entryFile);
|
|
143
|
+
this.entryFile = normalizedEntry;
|
|
144
|
+
// Гарантируем, что entry файл тоже есть в карте
|
|
145
|
+
if (!this.virtualFiles.has(normalizedEntry)) {
|
|
146
|
+
this.virtualFiles.set(normalizedEntry, {
|
|
147
|
+
sourceFile: normalizedEntry,
|
|
148
|
+
outputFile: this.mapSourceToOutput(normalizedEntry),
|
|
149
|
+
fragments: new Set(),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
// 🔴 Вместо ручного обхода, использовать resolved.paths() от SwaggerParser
|
|
153
|
+
// это даст нам все файлы, которые парсер разрешил
|
|
154
|
+
const allPaths = this._refs?.paths() || [];
|
|
155
|
+
for (const refPath of allPaths) {
|
|
156
|
+
const normalizedPath = (0, pathHelpers_1.normalizeHelper)(refPath);
|
|
157
|
+
if (!this.virtualFiles.has(normalizedPath)) {
|
|
158
|
+
this.virtualFiles.set(normalizedPath, {
|
|
159
|
+
sourceFile: normalizedPath,
|
|
160
|
+
outputFile: this.mapSourceToOutput(normalizedPath),
|
|
161
|
+
fragments: new Set(),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Обходим каждый файл чтобы найти $ref с фрагментами (#)
|
|
166
|
+
for (const [sourceFile] of this.virtualFiles) {
|
|
167
|
+
const schema = this._refs?.get(sourceFile);
|
|
168
|
+
if (schema && typeof schema === 'object') {
|
|
169
|
+
this.walkSchemaForFragments(schema, sourceFile);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
getVirtualFiles() {
|
|
174
|
+
return this.virtualFiles;
|
|
175
|
+
}
|
|
176
|
+
getAllCanonicalRefs() {
|
|
177
|
+
const result = [];
|
|
178
|
+
for (const file of this.virtualFiles.values()) {
|
|
179
|
+
if (file.fragments.size > 0) {
|
|
180
|
+
for (const fragment of file.fragments) {
|
|
181
|
+
result.push(`${file.sourceFile}${fragment}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
result.push(file.sourceFile);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
resolveCanonicalRef(canonicalRef, parentSourceFile) {
|
|
191
|
+
const normalizedRef = this.normalizeRefForLookup(canonicalRef, parentSourceFile);
|
|
192
|
+
const parsed = (0, parseRef_1.parseRef)(normalizedRef);
|
|
193
|
+
const sourceFile = (0, pathHelpers_1.normalizeHelper)(parsed.filePath ?? '');
|
|
194
|
+
const file = this.virtualFiles.get(sourceFile);
|
|
195
|
+
if (!file)
|
|
196
|
+
return undefined;
|
|
197
|
+
return {
|
|
198
|
+
outputFile: file.outputFile,
|
|
199
|
+
fragment: parsed.fragment,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
normalizeRefForLookup(ref, parentSourceFile) {
|
|
203
|
+
if (!ref)
|
|
204
|
+
return ref;
|
|
205
|
+
// Prefer explicit parent if provided
|
|
206
|
+
if (parentSourceFile) {
|
|
207
|
+
const normalizedParent = (0, path_1.isAbsolute)(parentSourceFile)
|
|
208
|
+
? parentSourceFile
|
|
209
|
+
: (0, pathHelpers_1.resolveHelper)(this.specRoot, parentSourceFile);
|
|
210
|
+
return (0, normalizeRef_1.normalizeRef)(ref, normalizedParent);
|
|
211
|
+
}
|
|
212
|
+
// If we can fall back to entry file, normalize relative refs against it
|
|
213
|
+
if (this.entryFile) {
|
|
214
|
+
const parsed = (0, parseRef_1.parseRef)(ref);
|
|
215
|
+
if (parsed.type === parseRef_1.RefType.LOCAL_FRAGMENT ||
|
|
216
|
+
parsed.type === parseRef_1.RefType.EXTERNAL_FILE ||
|
|
217
|
+
parsed.type === parseRef_1.RefType.EXTERNAL_FILE_FRAGMENT) {
|
|
218
|
+
return (0, normalizeRef_1.normalizeRef)(ref, this.entryFile);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return ref;
|
|
222
|
+
}
|
|
83
223
|
}
|
|
84
224
|
exports.Context = Context;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenApiClient.d.ts","sourceRoot":"","sources":["../../src/core/OpenApiClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,WAAW,EAAsB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenApiClient.d.ts","sourceRoot":"","sources":["../../src/core/OpenApiClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AAetF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,qBAAa,aAAa;IACtB,OAAO,CAAC,YAAY,CAA4B;IAEhD,IAAW,WAAW,gBAKrB;IAED,OAAO,CAAC,gBAAgB;IAmDxB,OAAO,CAAC,gBAAgB;YA0BV,sBAAsB;YAUtB,oBAAoB;YAmCpB,cAAc;IAkFtB,QAAQ,CAAC,UAAU,EAAE,WAAW;CAWzC"}
|
|
@@ -9,6 +9,7 @@ const pathHelpers_1 = require("../common/utils/pathHelpers");
|
|
|
9
9
|
const Parser_1 = require("./api/v2/Parser");
|
|
10
10
|
const Parser_2 = require("./api/v3/Parser");
|
|
11
11
|
const Context_1 = require("./Context");
|
|
12
|
+
const ValidationLibrary_enum_1 = require("./types/enums/ValidationLibrary.enum");
|
|
12
13
|
const getOpenApiSpec_1 = require("./utils/getOpenApiSpec");
|
|
13
14
|
const getOpenApiVersion_1 = require("./utils/getOpenApiVersion");
|
|
14
15
|
const getOutputPaths_1 = require("./utils/getOutputPaths");
|
|
@@ -28,12 +29,50 @@ class OpenApiClient {
|
|
|
28
29
|
// Для items: Наследуем глобальный request, если не переопределён
|
|
29
30
|
return rawOptions.items.map(item => ({
|
|
30
31
|
...item,
|
|
32
|
+
httpClient: rawOptions.httpClient,
|
|
31
33
|
request: item.request ?? rawOptions.request, // ?? для fallback на глобальный
|
|
34
|
+
useOptions: rawOptions.useOptions,
|
|
35
|
+
useUnionTypes: rawOptions.useUnionTypes,
|
|
36
|
+
includeSchemasFiles: rawOptions.includeSchemasFiles,
|
|
37
|
+
excludeCoreServiceFiles: rawOptions.excludeCoreServiceFiles,
|
|
38
|
+
interfacePrefix: rawOptions.interfacePrefix,
|
|
39
|
+
enumPrefix: rawOptions.enumPrefix,
|
|
40
|
+
typePrefix: rawOptions.typePrefix,
|
|
41
|
+
useCancelableRequest: rawOptions.useCancelableRequest,
|
|
42
|
+
logLevel: rawOptions.logLevel,
|
|
43
|
+
logTarget: rawOptions.logTarget,
|
|
44
|
+
sortByRequired: rawOptions.sortByRequired,
|
|
45
|
+
useSeparatedIndexes: rawOptions.useSeparatedIndexes,
|
|
46
|
+
validationLibrary: rawOptions.validationLibrary,
|
|
32
47
|
}));
|
|
33
48
|
}
|
|
34
49
|
else {
|
|
35
50
|
// Плоский формат (из CLI или старого конфига): Один item с глобальным request
|
|
36
|
-
return [
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
input: rawOptions.input ?? '',
|
|
54
|
+
output: rawOptions.output ?? '',
|
|
55
|
+
outputCore: rawOptions.outputCore,
|
|
56
|
+
outputServices: rawOptions.outputServices,
|
|
57
|
+
outputModels: rawOptions.outputModels,
|
|
58
|
+
outputSchemas: rawOptions.outputSchemas,
|
|
59
|
+
httpClient: rawOptions.httpClient,
|
|
60
|
+
useOptions: rawOptions.useOptions,
|
|
61
|
+
useUnionTypes: rawOptions.useUnionTypes,
|
|
62
|
+
includeSchemasFiles: rawOptions.includeSchemasFiles,
|
|
63
|
+
excludeCoreServiceFiles: rawOptions.excludeCoreServiceFiles,
|
|
64
|
+
request: rawOptions.request,
|
|
65
|
+
interfacePrefix: rawOptions.interfacePrefix,
|
|
66
|
+
enumPrefix: rawOptions.enumPrefix,
|
|
67
|
+
typePrefix: rawOptions.typePrefix,
|
|
68
|
+
useCancelableRequest: rawOptions.useCancelableRequest,
|
|
69
|
+
logLevel: rawOptions.logLevel,
|
|
70
|
+
logTarget: rawOptions.logTarget,
|
|
71
|
+
sortByRequired: rawOptions.sortByRequired,
|
|
72
|
+
useSeparatedIndexes: rawOptions.useSeparatedIndexes,
|
|
73
|
+
validationLibrary: rawOptions.validationLibrary,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
37
76
|
}
|
|
38
77
|
}
|
|
39
78
|
addDefaultValues(item) {
|
|
@@ -47,8 +86,8 @@ class OpenApiClient {
|
|
|
47
86
|
httpClient: item.httpClient || Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.httpClient,
|
|
48
87
|
useOptions: item.useOptions ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.useOptions,
|
|
49
88
|
useUnionTypes: item.useUnionTypes ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.useUnionTypes,
|
|
50
|
-
excludeCoreServiceFiles: item.excludeCoreServiceFiles ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.excludeCoreServiceFiles,
|
|
51
89
|
includeSchemasFiles: item.includeSchemasFiles ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.includeSchemasFiles,
|
|
90
|
+
excludeCoreServiceFiles: item.excludeCoreServiceFiles ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.excludeCoreServiceFiles,
|
|
52
91
|
request: item.request || Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.request,
|
|
53
92
|
interfacePrefix: item.interfacePrefix || Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.interfacePrefix,
|
|
54
93
|
enumPrefix: item.enumPrefix || Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.enumPrefix,
|
|
@@ -58,6 +97,7 @@ class OpenApiClient {
|
|
|
58
97
|
logTarget: item.logTarget || Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.logTarget,
|
|
59
98
|
sortByRequired: item.sortByRequired ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.sortByRequired,
|
|
60
99
|
useSeparatedIndexes: item.useSeparatedIndexes ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.useSeparatedIndexes,
|
|
100
|
+
validationLibrary: item.validationLibrary ?? Consts_1.COMMON_DEFAULT_OPTIONS_VALUES.validationLibrary,
|
|
61
101
|
};
|
|
62
102
|
}
|
|
63
103
|
async cleanOutputDirectories(option) {
|
|
@@ -74,16 +114,16 @@ class OpenApiClient {
|
|
|
74
114
|
}
|
|
75
115
|
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.STARTED(items.length));
|
|
76
116
|
try {
|
|
77
|
-
const start = process.hrtime();
|
|
117
|
+
const start = process.hrtime.bigint();
|
|
78
118
|
for (const option of items) {
|
|
79
119
|
await this.cleanOutputDirectories(option);
|
|
80
120
|
}
|
|
81
121
|
for (const option of items) {
|
|
82
|
-
const fileStart = process.hrtime();
|
|
122
|
+
const fileStart = process.hrtime.bigint();
|
|
83
123
|
await this.generateSingle(option);
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
this.writeClient.logger.
|
|
124
|
+
const fileEnd = process.hrtime.bigint();
|
|
125
|
+
const fileDurationInSeconds = Number(fileEnd - fileStart) / 1e9;
|
|
126
|
+
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.DURATION_FOR_FILE(option.input, fileDurationInSeconds.toFixed(3)));
|
|
87
127
|
}
|
|
88
128
|
if (items[0]?.useSeparatedIndexes) {
|
|
89
129
|
await this.writeClient.combineAndWrightSimple();
|
|
@@ -92,9 +132,9 @@ class OpenApiClient {
|
|
|
92
132
|
await this.writeClient.combineAndWrite();
|
|
93
133
|
}
|
|
94
134
|
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.FINISHED);
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.FINISHED_WITH_DURATION(
|
|
135
|
+
const end = process.hrtime.bigint();
|
|
136
|
+
const durationInSeconds = Number(end - start) / 1e9;
|
|
137
|
+
this.writeClient.logger.forceInfo(LoggerMessages_1.LOGGER_MESSAGES.GENERATION.FINISHED_WITH_DURATION(durationInSeconds.toFixed(3)));
|
|
98
138
|
}
|
|
99
139
|
catch (error) {
|
|
100
140
|
this.writeClient.logger.error(LoggerMessages_1.LOGGER_MESSAGES.ERROR.GENERIC(error.message));
|
|
@@ -102,7 +142,7 @@ class OpenApiClient {
|
|
|
102
142
|
this.writeClient.logger.shutdownLogger();
|
|
103
143
|
}
|
|
104
144
|
async generateSingle(item) {
|
|
105
|
-
const { input, output, outputCore, outputServices, outputModels, outputSchemas, httpClient, useOptions, useUnionTypes, excludeCoreServiceFiles,
|
|
145
|
+
const { input, output, outputCore, outputServices, outputModels, outputSchemas, httpClient, useOptions, useUnionTypes, excludeCoreServiceFiles, request, interfacePrefix, enumPrefix, typePrefix, useCancelableRequest, sortByRequired, useSeparatedIndexes, validationLibrary = ValidationLibrary_enum_1.ValidationLibrary.NONE, } = item;
|
|
106
146
|
const outputPaths = (0, getOutputPaths_1.getOutputPaths)({
|
|
107
147
|
output,
|
|
108
148
|
outputCore,
|
|
@@ -118,6 +158,7 @@ class OpenApiClient {
|
|
|
118
158
|
httpClient,
|
|
119
159
|
useUnionTypes,
|
|
120
160
|
useOptions,
|
|
161
|
+
validationLibrary,
|
|
121
162
|
});
|
|
122
163
|
this.writeClient.logger.info(LoggerMessages_1.LOGGER_MESSAGES.OPENAPI.DEFINING_VERSION);
|
|
123
164
|
switch (openApiVersion) {
|
|
@@ -133,10 +174,10 @@ class OpenApiClient {
|
|
|
133
174
|
useOptions,
|
|
134
175
|
useUnionTypes,
|
|
135
176
|
excludeCoreServiceFiles,
|
|
136
|
-
includeSchemasFiles,
|
|
137
177
|
request,
|
|
138
178
|
useCancelableRequest,
|
|
139
179
|
useSeparatedIndexes,
|
|
180
|
+
validationLibrary,
|
|
140
181
|
});
|
|
141
182
|
break;
|
|
142
183
|
}
|
|
@@ -152,10 +193,10 @@ class OpenApiClient {
|
|
|
152
193
|
useOptions,
|
|
153
194
|
useUnionTypes,
|
|
154
195
|
excludeCoreServiceFiles,
|
|
155
|
-
includeSchemasFiles,
|
|
156
196
|
request,
|
|
157
197
|
useCancelableRequest,
|
|
158
198
|
useSeparatedIndexes,
|
|
199
|
+
validationLibrary,
|
|
159
200
|
});
|
|
160
201
|
break;
|
|
161
202
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Logger } from '../common/Logger';
|
|
2
2
|
import { OutputPaths } from './types/base/OutputPaths.model';
|
|
3
|
+
import { Templates } from './types/base/Templates.model';
|
|
3
4
|
import { HttpClient } from './types/enums/HttpClient.enum';
|
|
5
|
+
import { ValidationLibrary } from './types/enums/ValidationLibrary.enum';
|
|
4
6
|
import type { Client } from './types/shared/Client.model';
|
|
5
|
-
import { Templates } from './utils/registerHandlebarTemplates';
|
|
6
7
|
import { writeClientCore } from './utils/writeClientCore';
|
|
7
8
|
import { writeClientCoreIndex } from './utils/writeClientCoreIndex';
|
|
9
|
+
import { writeClientExecutor } from './utils/writeClientExecutor';
|
|
8
10
|
import { writeClientFullIndex } from './utils/writeClientFullIndex';
|
|
9
11
|
import { writeClientModels } from './utils/writeClientModels';
|
|
10
12
|
import { writeClientModelsIndex } from './utils/writeClientModelsIndex';
|
|
@@ -21,10 +23,10 @@ import { writeClientSimpleIndex } from './utils/writeClientSimpleIndex';
|
|
|
21
23
|
* @param useOptions Use options or arguments functions
|
|
22
24
|
* @param useUnionTypes Use union types instead of enums
|
|
23
25
|
* @param excludeCoreServiceFiles The generation of the core and services is excluded
|
|
24
|
-
* @param includeSchemasFiles The generation of model validation schemes is enabled
|
|
25
26
|
* @param request: Path to custom request file
|
|
26
27
|
* @param useCancelableRequest Use cancelable request type.
|
|
27
28
|
* @param useSeparatedIndexes Use separate index files for the core, models, schemas, and services
|
|
29
|
+
* @param validationLibrary Validation library to use for schema validation
|
|
28
30
|
*/
|
|
29
31
|
type TWriteClientProps = {
|
|
30
32
|
client: Client;
|
|
@@ -34,10 +36,10 @@ type TWriteClientProps = {
|
|
|
34
36
|
useOptions: boolean;
|
|
35
37
|
useUnionTypes: boolean;
|
|
36
38
|
excludeCoreServiceFiles: boolean;
|
|
37
|
-
includeSchemasFiles: boolean;
|
|
38
39
|
request?: string;
|
|
39
40
|
useCancelableRequest?: boolean;
|
|
40
41
|
useSeparatedIndexes?: boolean;
|
|
42
|
+
validationLibrary?: ValidationLibrary;
|
|
41
43
|
};
|
|
42
44
|
type TAPIClientGeneratorConfig = Omit<TWriteClientProps, 'httpClient' | 'useOptions' | 'request' | 'useCancelableRequest' | 'useSeparatedIndexes'>;
|
|
43
45
|
/**
|
|
@@ -49,16 +51,6 @@ export declare class WriteClient {
|
|
|
49
51
|
constructor(logger?: Logger);
|
|
50
52
|
/**
|
|
51
53
|
* 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
54
|
*/
|
|
63
55
|
writeClient(options: TWriteClientProps): Promise<void>;
|
|
64
56
|
/**
|
|
@@ -89,6 +81,7 @@ export declare class WriteClient {
|
|
|
89
81
|
writeClientServices: typeof writeClientServices;
|
|
90
82
|
writeClientServicesIndex: typeof writeClientServicesIndex;
|
|
91
83
|
writeClientSimpleIndex: typeof writeClientSimpleIndex;
|
|
84
|
+
writeClientExecutor: typeof writeClientExecutor;
|
|
92
85
|
}
|
|
93
86
|
export {};
|
|
94
87
|
//# 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,
|
|
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,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAI1D,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;CACzC,CAAC;AAEF,KAAK,yBAAyB,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,sBAAsB,GAAG,qBAAqB,CAAC,CAAC;AAEnJ;;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;IA0G5D;;;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, } = 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,8 +74,18 @@ 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
90
|
await this.writeClientSchemas({
|
|
83
91
|
models: client.models,
|
|
@@ -85,6 +93,7 @@ class WriteClient {
|
|
|
85
93
|
outputSchemasPath: outputPaths.outputSchemas,
|
|
86
94
|
httpClient,
|
|
87
95
|
useUnionTypes,
|
|
96
|
+
validationLibrary,
|
|
88
97
|
});
|
|
89
98
|
await this.writeClientSchemasIndex({
|
|
90
99
|
models: client.models,
|
|
@@ -114,7 +123,7 @@ class WriteClient {
|
|
|
114
123
|
outputPaths,
|
|
115
124
|
useUnionTypes,
|
|
116
125
|
excludeCoreServiceFiles,
|
|
117
|
-
|
|
126
|
+
validationLibrary,
|
|
118
127
|
});
|
|
119
128
|
}
|
|
120
129
|
/**
|
|
@@ -146,7 +155,7 @@ class WriteClient {
|
|
|
146
155
|
const result = new Map();
|
|
147
156
|
for (const [key, value] of this.config.entries()) {
|
|
148
157
|
for (const item of value) {
|
|
149
|
-
const { outputPaths, templates, excludeCoreServiceFiles,
|
|
158
|
+
const { outputPaths, templates, excludeCoreServiceFiles, validationLibrary } = item;
|
|
150
159
|
const outputCore = this.getOutputPath(outputPaths?.outputCore, key, 'core');
|
|
151
160
|
const outputModels = this.getOutputPath(outputPaths?.outputModels, key, 'models');
|
|
152
161
|
const outputSchemas = this.getOutputPath(outputPaths?.outputSchemas, key, 'schemas');
|
|
@@ -166,7 +175,7 @@ class WriteClient {
|
|
|
166
175
|
if (!clientIndex.models.includes(relativePathModel)) {
|
|
167
176
|
clientIndex.models.push(relativePathModel);
|
|
168
177
|
}
|
|
169
|
-
if (
|
|
178
|
+
if (validationLibrary !== ValidationLibrary_enum_1.ValidationLibrary.NONE) {
|
|
170
179
|
const relativePathSchema = (0, pathHelpers_1.relativeHelper)(key, outputSchemas);
|
|
171
180
|
if (!clientIndex.schemas.includes(relativePathSchema)) {
|
|
172
181
|
clientIndex.schemas.push(relativePathSchema);
|
|
@@ -180,7 +189,7 @@ class WriteClient {
|
|
|
180
189
|
const result = new Map();
|
|
181
190
|
for (const [key, value] of this.config.entries()) {
|
|
182
191
|
for (const item of value) {
|
|
183
|
-
const { outputPaths, client, templates, useUnionTypes, excludeCoreServiceFiles,
|
|
192
|
+
const { outputPaths, client, templates, useUnionTypes, excludeCoreServiceFiles, validationLibrary } = item;
|
|
184
193
|
const outputCore = this.getOutputPath(outputPaths?.outputCore, key, 'core');
|
|
185
194
|
const outputModels = this.getOutputPath(outputPaths?.outputModels, key, 'models');
|
|
186
195
|
const outputSchemas = this.getOutputPath(outputPaths?.outputSchemas, key, 'schemas');
|
|
@@ -216,7 +225,7 @@ class WriteClient {
|
|
|
216
225
|
if (!clientIndex.models.some(m => this.isSameModel(m, modelFinal))) {
|
|
217
226
|
clientIndex.models.push(modelFinal);
|
|
218
227
|
}
|
|
219
|
-
if (
|
|
228
|
+
if (validationLibrary !== ValidationLibrary_enum_1.ValidationLibrary.NONE) {
|
|
220
229
|
const schema = { ...modelFinal, package: relativePathSchema };
|
|
221
230
|
if (!clientIndex.schemas.some(s => this.isSameShema(s, schema))) {
|
|
222
231
|
clientIndex.schemas.push(schema);
|
|
@@ -289,5 +298,6 @@ class WriteClient {
|
|
|
289
298
|
writeClientServices = writeClientServices_1.writeClientServices;
|
|
290
299
|
writeClientServicesIndex = writeClientServicesIndex_1.writeClientServicesIndex;
|
|
291
300
|
writeClientSimpleIndex = writeClientSimpleIndex_1.writeClientSimpleIndex;
|
|
301
|
+
writeClientExecutor = writeClientExecutor_1.writeClientExecutor;
|
|
292
302
|
}
|
|
293
303
|
exports.WriteClient = WriteClient;
|
|
@@ -7,6 +7,7 @@ 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
9
|
const HttpClient_enum_1 = require("../types/enums/HttpClient.enum");
|
|
10
|
+
const ValidationLibrary_enum_1 = require("../types/enums/ValidationLibrary.enum");
|
|
10
11
|
const getOutputPaths_1 = require("../utils/getOutputPaths");
|
|
11
12
|
const WriteClient_1 = require("../WriteClient");
|
|
12
13
|
(0, node_test_1.describe)('@unit: writeClient', () => {
|
|
@@ -39,6 +40,7 @@ const WriteClient_1 = require("../WriteClient");
|
|
|
39
40
|
services: () => 'servicesIndex',
|
|
40
41
|
},
|
|
41
42
|
exports: {
|
|
43
|
+
client: () => 'client',
|
|
42
44
|
model: () => 'model',
|
|
43
45
|
schema: () => 'schema',
|
|
44
46
|
service: () => 'service',
|
|
@@ -51,6 +53,11 @@ const WriteClient_1 = require("../WriteClient");
|
|
|
51
53
|
request: () => 'request',
|
|
52
54
|
cancelablePromise: () => 'cancelablePromise',
|
|
53
55
|
httpStatusCode: () => 'httpStatusCode',
|
|
56
|
+
createExecutorAdapter: () => 'createExecutorAdapter',
|
|
57
|
+
requestExecutor: () => 'requestExecutor',
|
|
58
|
+
apiErrorInterceptor: () => 'apiErrorInterceptor',
|
|
59
|
+
interceptors: () => 'interceptors',
|
|
60
|
+
withInterceptors: () => 'withInterceptors'
|
|
54
61
|
},
|
|
55
62
|
};
|
|
56
63
|
const outputPaths = (0, getOutputPaths_1.getOutputPaths)({ output: './dist' });
|
|
@@ -62,7 +69,7 @@ const WriteClient_1 = require("../WriteClient");
|
|
|
62
69
|
useOptions: false,
|
|
63
70
|
useUnionTypes: false,
|
|
64
71
|
excludeCoreServiceFiles: false,
|
|
65
|
-
|
|
72
|
+
validationLibrary: ValidationLibrary_enum_1.ValidationLibrary.NONE,
|
|
66
73
|
});
|
|
67
74
|
strict_1.default.ok(mkdirCalls.length > 0, 'mkdir should be called at least once');
|
|
68
75
|
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"}
|