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
|
@@ -77,14 +77,19 @@ const sendRequest_3 = __importDefault(require("../../templatesCompiled/client/co
|
|
|
77
77
|
const OpenAPI_1 = __importDefault(require("../../templatesCompiled/client/core/OpenAPI"));
|
|
78
78
|
const CancelablePromise_1 = __importDefault(require("../../templatesCompiled/client/core/CancelablePromise"));
|
|
79
79
|
const request_4 = __importDefault(require("../../templatesCompiled/client/core/request"));
|
|
80
|
+
const requestExecutor_1 = __importDefault(require("../../templatesCompiled/client/core/executor/requestExecutor"));
|
|
81
|
+
const createExecutorAdapter_1 = __importDefault(require("../../templatesCompiled/client/core/executor/createExecutorAdapter"));
|
|
82
|
+
const interceptors_1 = __importDefault(require("../../templatesCompiled/client/core/interceptors/interceptors"));
|
|
83
|
+
const apiErrorInterceptor_1 = __importDefault(require("../../templatesCompiled/client/core/interceptors/apiErrorInterceptor"));
|
|
84
|
+
const withInterceptors_1 = __importDefault(require("../../templatesCompiled/client/core/interceptors/withInterceptors"));
|
|
80
85
|
const getHeaders_4 = __importDefault(require("../../templatesCompiled/client/core/xhr/getHeaders"));
|
|
81
86
|
const getRequestBody_4 = __importDefault(require("../../templatesCompiled/client/core/xhr/getRequestBody"));
|
|
82
87
|
const getResponseBody_4 = __importDefault(require("../../templatesCompiled/client/core/xhr/getResponseBody"));
|
|
83
88
|
const getResponseHeader_4 = __importDefault(require("../../templatesCompiled/client/core/xhr/getResponseHeader"));
|
|
84
89
|
const request_5 = __importDefault(require("../../templatesCompiled/client/core/xhr/request"));
|
|
85
90
|
const sendRequest_4 = __importDefault(require("../../templatesCompiled/client/core/xhr/sendRequest"));
|
|
91
|
+
const exportClient_1 = __importDefault(require("../../templatesCompiled/client/exportClient"));
|
|
86
92
|
const exportModel_1 = __importDefault(require("../../templatesCompiled/client/exportModel"));
|
|
87
|
-
const exportSchema_1 = __importDefault(require("../../templatesCompiled/client/exportSchema"));
|
|
88
93
|
const exportService_1 = __importDefault(require("../../templatesCompiled/client/exportService"));
|
|
89
94
|
const indexFull_1 = __importDefault(require("../../templatesCompiled/client/indexFull"));
|
|
90
95
|
const indexSimple_1 = __importDefault(require("../../templatesCompiled/client/indexSimple"));
|
|
@@ -124,6 +129,43 @@ const typeIntersection_1 = __importDefault(require("../../templatesCompiled/clie
|
|
|
124
129
|
const typeReference_1 = __importDefault(require("../../templatesCompiled/client/partials/typeReference"));
|
|
125
130
|
const typeUnion_1 = __importDefault(require("../../templatesCompiled/client/partials/typeUnion"));
|
|
126
131
|
const registerHandlebarHelpers_1 = require("./registerHandlebarHelpers");
|
|
132
|
+
const ValidationLibrary_enum_1 = require("../types/enums/ValidationLibrary.enum");
|
|
133
|
+
const exportSchema_1 = __importDefault(require("../../templatesCompiled/client/zod/exportSchema"));
|
|
134
|
+
const zodSchema_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchema"));
|
|
135
|
+
const zodSchemaInterface_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchemaInterface"));
|
|
136
|
+
const zodSchemaEnum_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchemaEnum"));
|
|
137
|
+
const zodSchemaArray_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchemaArray"));
|
|
138
|
+
const zodSchemaDictionary_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchemaDictionary"));
|
|
139
|
+
const zodSchemaGeneric_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchemaGeneric"));
|
|
140
|
+
const zodSchemaReference_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchemaReference"));
|
|
141
|
+
const zodSchemaComposition_1 = __importDefault(require("../../templatesCompiled/client/zod/partials/zodSchemaComposition"));
|
|
142
|
+
const exportSchema_2 = __importDefault(require("../../templatesCompiled/client/yup/exportSchema"));
|
|
143
|
+
const yupSchema_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchema"));
|
|
144
|
+
const yupSchemaInterface_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchemaInterface"));
|
|
145
|
+
const yupSchemaEnum_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchemaEnum"));
|
|
146
|
+
const yupSchemaArray_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchemaArray"));
|
|
147
|
+
const yupSchemaDictionary_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchemaDictionary"));
|
|
148
|
+
const yupSchemaGeneric_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchemaGeneric"));
|
|
149
|
+
const yupSchemaReference_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchemaReference"));
|
|
150
|
+
const yupSchemaComposition_1 = __importDefault(require("../../templatesCompiled/client/yup/partials/yupSchemaComposition"));
|
|
151
|
+
const exportSchema_3 = __importDefault(require("../../templatesCompiled/client/joi/exportSchema"));
|
|
152
|
+
const joiSchema_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchema"));
|
|
153
|
+
const joiSchemaInterface_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchemaInterface"));
|
|
154
|
+
const joiSchemaEnum_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchemaEnum"));
|
|
155
|
+
const joiSchemaArray_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchemaArray"));
|
|
156
|
+
const joiSchemaDictionary_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchemaDictionary"));
|
|
157
|
+
const joiSchemaGeneric_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchemaGeneric"));
|
|
158
|
+
const joiSchemaReference_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchemaReference"));
|
|
159
|
+
const joiSchemaComposition_1 = __importDefault(require("../../templatesCompiled/client/joi/partials/joiSchemaComposition"));
|
|
160
|
+
const exportSchema_4 = __importDefault(require("../../templatesCompiled/client/jsonschema/exportSchema"));
|
|
161
|
+
const jsonschemaSchema_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchema"));
|
|
162
|
+
const jsonschemaSchemaInterface_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface"));
|
|
163
|
+
const jsonschemaSchemaEnum_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum"));
|
|
164
|
+
const jsonschemaSchemaArray_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray"));
|
|
165
|
+
const jsonschemaSchemaDictionary_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary"));
|
|
166
|
+
const jsonschemaSchemaGeneric_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric"));
|
|
167
|
+
const jsonschemaSchemaReference_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference"));
|
|
168
|
+
const jsonschemaSchemaComposition_1 = __importDefault(require("../../templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition"));
|
|
127
169
|
/**
|
|
128
170
|
* Read all the Handlebar templates that we need and return on wrapper object
|
|
129
171
|
* so we can easily access the templates in out generator / write functions.
|
|
@@ -141,8 +183,9 @@ function registerHandlebarTemplates(root) {
|
|
|
141
183
|
services: Handlebars.template(indexServices_1.default),
|
|
142
184
|
},
|
|
143
185
|
exports: {
|
|
186
|
+
client: Handlebars.template(exportClient_1.default),
|
|
144
187
|
model: Handlebars.template(exportModel_1.default),
|
|
145
|
-
schema:
|
|
188
|
+
schema: undefined,
|
|
146
189
|
service: Handlebars.template(exportService_1.default),
|
|
147
190
|
},
|
|
148
191
|
core: {
|
|
@@ -153,6 +196,11 @@ function registerHandlebarTemplates(root) {
|
|
|
153
196
|
request: Handlebars.template(request_4.default),
|
|
154
197
|
cancelablePromise: Handlebars.template(CancelablePromise_1.default),
|
|
155
198
|
httpStatusCode: Handlebars.template(HttpStatusCode_1.default),
|
|
199
|
+
requestExecutor: Handlebars.template(requestExecutor_1.default),
|
|
200
|
+
createExecutorAdapter: Handlebars.template(createExecutorAdapter_1.default),
|
|
201
|
+
interceptors: Handlebars.template(interceptors_1.default),
|
|
202
|
+
apiErrorInterceptor: Handlebars.template(apiErrorInterceptor_1.default),
|
|
203
|
+
withInterceptors: Handlebars.template(withInterceptors_1.default),
|
|
156
204
|
},
|
|
157
205
|
};
|
|
158
206
|
// Partials for the generations of the models, services, etc.
|
|
@@ -227,5 +275,52 @@ function registerHandlebarTemplates(root) {
|
|
|
227
275
|
Handlebars.registerPartial('axios/getResponseHeader', Handlebars.template(getResponseHeader_1.default));
|
|
228
276
|
Handlebars.registerPartial('axios/sendRequest', Handlebars.template(sendRequest_1.default));
|
|
229
277
|
Handlebars.registerPartial('axios/request', Handlebars.template(request_1.default));
|
|
278
|
+
// Register Zod partials if validationLibrary is ZOD
|
|
279
|
+
if (root?.validationLibrary === ValidationLibrary_enum_1.ValidationLibrary.ZOD) {
|
|
280
|
+
templates.exports.schema = Handlebars.template(exportSchema_1.default);
|
|
281
|
+
Handlebars.registerPartial('zodSchema', Handlebars.template(zodSchema_1.default));
|
|
282
|
+
Handlebars.registerPartial('zodSchemaInterface', Handlebars.template(zodSchemaInterface_1.default));
|
|
283
|
+
Handlebars.registerPartial('zodSchemaEnum', Handlebars.template(zodSchemaEnum_1.default));
|
|
284
|
+
Handlebars.registerPartial('zodSchemaArray', Handlebars.template(zodSchemaArray_1.default));
|
|
285
|
+
Handlebars.registerPartial('zodSchemaDictionary', Handlebars.template(zodSchemaDictionary_1.default));
|
|
286
|
+
Handlebars.registerPartial('zodSchemaGeneric', Handlebars.template(zodSchemaGeneric_1.default));
|
|
287
|
+
Handlebars.registerPartial('zodSchemaReference', Handlebars.template(zodSchemaReference_1.default));
|
|
288
|
+
Handlebars.registerPartial('zodSchemaComposition', Handlebars.template(zodSchemaComposition_1.default));
|
|
289
|
+
}
|
|
290
|
+
// Register Yup partials if validationLibrary is YUP
|
|
291
|
+
if (root?.validationLibrary === ValidationLibrary_enum_1.ValidationLibrary.YUP) {
|
|
292
|
+
templates.exports.schema = Handlebars.template(exportSchema_2.default);
|
|
293
|
+
Handlebars.registerPartial('yupSchema', Handlebars.template(yupSchema_1.default));
|
|
294
|
+
Handlebars.registerPartial('yupSchemaInterface', Handlebars.template(yupSchemaInterface_1.default));
|
|
295
|
+
Handlebars.registerPartial('yupSchemaEnum', Handlebars.template(yupSchemaEnum_1.default));
|
|
296
|
+
Handlebars.registerPartial('yupSchemaArray', Handlebars.template(yupSchemaArray_1.default));
|
|
297
|
+
Handlebars.registerPartial('yupSchemaDictionary', Handlebars.template(yupSchemaDictionary_1.default));
|
|
298
|
+
Handlebars.registerPartial('yupSchemaGeneric', Handlebars.template(yupSchemaGeneric_1.default));
|
|
299
|
+
Handlebars.registerPartial('yupSchemaReference', Handlebars.template(yupSchemaReference_1.default));
|
|
300
|
+
Handlebars.registerPartial('yupSchemaComposition', Handlebars.template(yupSchemaComposition_1.default));
|
|
301
|
+
}
|
|
302
|
+
// Register Joi partials if validationLibrary is JOI
|
|
303
|
+
if (root?.validationLibrary === ValidationLibrary_enum_1.ValidationLibrary.JOI) {
|
|
304
|
+
templates.exports.schema = Handlebars.template(exportSchema_3.default);
|
|
305
|
+
Handlebars.registerPartial('joiSchema', Handlebars.template(joiSchema_1.default));
|
|
306
|
+
Handlebars.registerPartial('joiSchemaInterface', Handlebars.template(joiSchemaInterface_1.default));
|
|
307
|
+
Handlebars.registerPartial('joiSchemaEnum', Handlebars.template(joiSchemaEnum_1.default));
|
|
308
|
+
Handlebars.registerPartial('joiSchemaArray', Handlebars.template(joiSchemaArray_1.default));
|
|
309
|
+
Handlebars.registerPartial('joiSchemaDictionary', Handlebars.template(joiSchemaDictionary_1.default));
|
|
310
|
+
Handlebars.registerPartial('joiSchemaGeneric', Handlebars.template(joiSchemaGeneric_1.default));
|
|
311
|
+
Handlebars.registerPartial('joiSchemaReference', Handlebars.template(joiSchemaReference_1.default));
|
|
312
|
+
Handlebars.registerPartial('joiSchemaComposition', Handlebars.template(joiSchemaComposition_1.default));
|
|
313
|
+
}
|
|
314
|
+
if (root.validationLibrary === ValidationLibrary_enum_1.ValidationLibrary.JSONSCHEMA) {
|
|
315
|
+
templates.exports.schema = Handlebars.template(exportSchema_4.default);
|
|
316
|
+
Handlebars.registerPartial('jsonschemaSchema', Handlebars.template(jsonschemaSchema_1.default));
|
|
317
|
+
Handlebars.registerPartial('jsonschemaSchemaInterface', Handlebars.template(jsonschemaSchemaInterface_1.default));
|
|
318
|
+
Handlebars.registerPartial('jsonschemaSchemaEnum', Handlebars.template(jsonschemaSchemaEnum_1.default));
|
|
319
|
+
Handlebars.registerPartial('jsonschemaSchemaArray', Handlebars.template(jsonschemaSchemaArray_1.default));
|
|
320
|
+
Handlebars.registerPartial('jsonschemaSchemaDictionary', Handlebars.template(jsonschemaSchemaDictionary_1.default));
|
|
321
|
+
Handlebars.registerPartial('jsonschemaSchemaGeneric', Handlebars.template(jsonschemaSchemaGeneric_1.default));
|
|
322
|
+
Handlebars.registerPartial('jsonschemaSchemaReference', Handlebars.template(jsonschemaSchemaReference_1.default));
|
|
323
|
+
Handlebars.registerPartial('jsonschemaSchemaComposition', Handlebars.template(jsonschemaSchemaComposition_1.default));
|
|
324
|
+
}
|
|
230
325
|
return templates;
|
|
231
326
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRefPath.d.ts","sourceRoot":"","sources":["../../../src/core/utils/resolveRefPath.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveRefPath.d.ts","sourceRoot":"","sources":["../../../src/core/utils/resolveRefPath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAW,MAAM,YAAY,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CA0BnF"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveRefPath = resolveRefPath;
|
|
4
4
|
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
5
|
-
const advancedDeduplicatePath_1 = require("./advancedDeduplicatePath");
|
|
6
5
|
const parseRef_1 = require("./parseRef");
|
|
7
6
|
/**
|
|
8
7
|
* Resolve a parsed reference to an absolute path (when applicable).
|
|
@@ -19,9 +18,7 @@ function resolveRefPath(parsedRef, parentFilePath) {
|
|
|
19
18
|
case parseRef_1.RefType.EXTERNAL_FILE_FRAGMENT:
|
|
20
19
|
// Resolve relative to parent file directory
|
|
21
20
|
if (parsedRef.filePath) {
|
|
22
|
-
|
|
23
|
-
// Clean any duplicate path segments
|
|
24
|
-
return (0, advancedDeduplicatePath_1.advancedDeduplicatePath)(resolvedPath);
|
|
21
|
+
return (0, pathHelpers_1.resolveHelper)(parentDir, parsedRef.filePath);
|
|
25
22
|
}
|
|
26
23
|
return parentFilePath;
|
|
27
24
|
case parseRef_1.RefType.ABSOLUTE_PATH:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/serviceHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAK7D;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAOhH;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAWxG;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAMvF;
|
|
1
|
+
{"version":3,"file":"serviceHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/serviceHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAK7D;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAOhH;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAWxG;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAMvF;AA+CD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiChE"}
|
|
@@ -63,13 +63,39 @@ function mergeOperationImportsIntoService(service, operation) {
|
|
|
63
63
|
/**
|
|
64
64
|
* Internal helper: apply alias value to models that reference the import.
|
|
65
65
|
*/
|
|
66
|
+
function normalizeImportPath(path) {
|
|
67
|
+
return path.startsWith('./') ? path.slice(2) : path;
|
|
68
|
+
}
|
|
69
|
+
function applyAliasToModel(model, value) {
|
|
70
|
+
const modelPath = normalizeImportPath(model.path);
|
|
71
|
+
const importPath = normalizeImportPath(value.path);
|
|
72
|
+
if (modelPath === importPath && model.type === value.name && value.alias) {
|
|
73
|
+
model.alias = value.alias;
|
|
74
|
+
model.base = value.alias;
|
|
75
|
+
}
|
|
76
|
+
if (value.alias && model.imports?.some(imprt => normalizeImportPath(imprt.path) === importPath && imprt.name === value.name)) {
|
|
77
|
+
if (model.base === value.name) {
|
|
78
|
+
model.base = value.alias;
|
|
79
|
+
}
|
|
80
|
+
if (model.type === value.name) {
|
|
81
|
+
model.type = value.alias;
|
|
82
|
+
}
|
|
83
|
+
if (!model.alias) {
|
|
84
|
+
model.alias = value.alias;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (model.link) {
|
|
88
|
+
applyAliasToModel(model.link, value);
|
|
89
|
+
}
|
|
90
|
+
if (model.properties?.length) {
|
|
91
|
+
model.properties.forEach(child => applyAliasToModel(child, value));
|
|
92
|
+
}
|
|
93
|
+
if (model.enums?.length) {
|
|
94
|
+
model.enums.forEach(child => applyAliasToModel(child, value));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
66
97
|
function fillModelsByAlias(items = [], value) {
|
|
67
|
-
items
|
|
68
|
-
.filter(result => result.path === value.path && result.type === value.name && value.alias)
|
|
69
|
-
.forEach(result => {
|
|
70
|
-
result.alias = value.alias;
|
|
71
|
-
result.base = value.alias;
|
|
72
|
-
});
|
|
98
|
+
items.forEach(item => applyAliasToModel(item, value));
|
|
73
99
|
}
|
|
74
100
|
/**
|
|
75
101
|
* Finalize imports for a service:
|
|
@@ -17,7 +17,7 @@ function stripNamespace(value) {
|
|
|
17
17
|
const foundFile = value.match(/^(.*)#/);
|
|
18
18
|
const directoryName = foundFile ? (0, pathHelpers_1.dirNameHelper)(foundFile[1]) : (0, pathHelpers_1.dirNameHelper)(value);
|
|
19
19
|
const extName = (0, path_1.extname)(value);
|
|
20
|
-
const baseName = extName
|
|
20
|
+
const baseName = extName ? (0, getClassName_1.getClassName)((0, path_1.basename)(value, extName)) : (0, getClassName_1.getClassName)((0, path_1.basename)(value));
|
|
21
21
|
return directoryName ? (0, pathHelpers_1.joinHelper)(directoryName, baseName) : baseName;
|
|
22
22
|
}
|
|
23
23
|
const clearValue = value
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateRawOptions.d.ts","sourceRoot":"","sources":["../../../src/core/utils/validateRawOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAKvD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,WAAW,QASzD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateRawOptions = validateRawOptions;
|
|
4
|
+
const Consts_1 = require("../../common/Consts");
|
|
5
|
+
const validateZodOptions_1 = require("../../common/Validation/validateZodOptions");
|
|
6
|
+
const UnifiedVersionedSchemas_1 = require("../../common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas");
|
|
7
|
+
const dependentOptionsRefinement_1 = require("../../common/VersionedSchema/refinements/dependentOptionsRefinement");
|
|
8
|
+
function validateRawOptions(rawOptions) {
|
|
9
|
+
const currentSchema = UnifiedVersionedSchemas_1.rawOptionsSchema.superRefine(dependentOptionsRefinement_1.dependentOptionsRefinement);
|
|
10
|
+
const validationResult = (0, validateZodOptions_1.validateZodOptions)(currentSchema, rawOptions);
|
|
11
|
+
if (!validationResult.success) {
|
|
12
|
+
Consts_1.APP_LOGGER.error(validationResult.errors.join('\n'));
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Templates } from '../types/base/Templates.model';
|
|
1
2
|
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
2
3
|
import type { Client } from '../types/shared/Client.model';
|
|
3
4
|
import { WriteClient } from '../WriteClient';
|
|
4
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
5
5
|
/**
|
|
6
6
|
* @param client Client object, containing, models, schemas and services
|
|
7
7
|
* @param templates The loaded handlebar templates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientCore.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientCore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"writeClientCore.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientCore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,UAAU,gBAAgB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCjG"}
|
|
@@ -22,6 +22,7 @@ async function writeClientCore(options) {
|
|
|
22
22
|
useSeparatedIndexes,
|
|
23
23
|
};
|
|
24
24
|
this.logger.info("The recording of the kernel files begins");
|
|
25
|
+
const hasCustomRequest = !!request;
|
|
25
26
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'OpenAPI.ts'), templates.core.settings(context));
|
|
26
27
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'ApiError.ts'), templates.core.apiError({}));
|
|
27
28
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'ApiRequestOptions.ts'), templates.core.apiRequestOptions({}));
|
|
@@ -31,7 +32,12 @@ async function writeClientCore(options) {
|
|
|
31
32
|
}
|
|
32
33
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'HttpStatusCode.ts'), templates.core.httpStatusCode({}));
|
|
33
34
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'request.ts'), templates.core.request(context));
|
|
34
|
-
|
|
35
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'executor/requestExecutor.ts'), templates.core.requestExecutor({}));
|
|
36
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'executor/createExecutorAdapter.ts'), templates.core.createExecutorAdapter({ useCustomRequest: hasCustomRequest }));
|
|
37
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'interceptors/interceptors.ts'), templates.core.interceptors({}));
|
|
38
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'interceptors/apiErrorInterceptor.ts'), templates.core.apiErrorInterceptor({}));
|
|
39
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile((0, pathHelpers_1.resolveHelper)(outputCorePath, 'interceptors/withInterceptors.ts'), templates.core.withInterceptors({}));
|
|
40
|
+
if (hasCustomRequest) {
|
|
35
41
|
const requestFile = (0, pathHelpers_1.resolveHelper)(process.cwd(), request);
|
|
36
42
|
const requestFileExists = await fileSystemHelpers_1.fileSystemHelpers.exists(requestFile);
|
|
37
43
|
if (!requestFileExists) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientCoreIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientCoreIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"writeClientCoreIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientCoreIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,UAAU,aAAa;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,iBAcnF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Templates } from '../types/base/Templates.model';
|
|
2
|
+
import { Service } from '../types/shared/Service.model';
|
|
3
|
+
import { WriteClient } from '../WriteClient';
|
|
4
|
+
interface WriteClientExecutor {
|
|
5
|
+
outputPath: string;
|
|
6
|
+
outputCorePath: string;
|
|
7
|
+
services: Service[];
|
|
8
|
+
templates: Templates;
|
|
9
|
+
}
|
|
10
|
+
declare function deduplicateServicesByName(services: Service[]): Service[];
|
|
11
|
+
export declare function writeClientExecutor(this: WriteClient, options: WriteClientExecutor): Promise<void>;
|
|
12
|
+
export { deduplicateServicesByName };
|
|
13
|
+
//# sourceMappingURL=writeClientExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeClientExecutor.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientExecutor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,UAAU,mBAAmB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CASjE;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxG;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeClientExecutor = writeClientExecutor;
|
|
4
|
+
exports.deduplicateServicesByName = deduplicateServicesByName;
|
|
5
|
+
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
6
|
+
const format_1 = require("../../common/utils/format");
|
|
7
|
+
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
8
|
+
function deduplicateServicesByName(services) {
|
|
9
|
+
const seen = new Set();
|
|
10
|
+
return services.filter(service => {
|
|
11
|
+
if (seen.has(service.name)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
seen.add(service.name);
|
|
15
|
+
return true;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async function writeClientExecutor(options) {
|
|
19
|
+
const { outputPath, outputCorePath, templates, services } = options;
|
|
20
|
+
const file = (0, pathHelpers_1.resolveHelper)(outputPath, 'createClient.ts');
|
|
21
|
+
const uniqueServices = deduplicateServicesByName(services);
|
|
22
|
+
this.logger.info(`Началась запись файла ${file}`);
|
|
23
|
+
const templateResult = templates.exports.client({
|
|
24
|
+
outputCore: outputCorePath,
|
|
25
|
+
services: uniqueServices,
|
|
26
|
+
});
|
|
27
|
+
const formattedValue = await (0, format_1.format)(templateResult);
|
|
28
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
29
|
+
this.logger.info(`File recording completed: ${file}`);
|
|
30
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientFullIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientFullIndex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeClientFullIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientFullIndex.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBrG"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeClientFullIndex = writeClientFullIndex;
|
|
4
|
-
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
5
4
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
5
|
+
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
6
6
|
/**
|
|
7
7
|
* Generate the OpenAPI client index file using the Handlebar template and write it to disk.
|
|
8
8
|
* The index file just contains all the exports you need to use the client as a standalone
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Templates } from '../types/base/Templates.model';
|
|
1
2
|
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
2
3
|
import type { Model } from '../types/shared/Model.model';
|
|
3
4
|
import { WriteClient } from '../WriteClient';
|
|
4
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
5
5
|
/**
|
|
6
6
|
* @param models Array of Models to write
|
|
7
7
|
* @param templates The loaded handlebar templates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientModels.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModels.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"writeClientModels.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModels.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;GAMG;AACH,UAAU,kBAAkB;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCrG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Templates } from '../types/base/Templates.model';
|
|
1
2
|
import { Model } from '../types/shared/Model.model';
|
|
2
3
|
import { WriteClient } from '../WriteClient';
|
|
3
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
4
4
|
interface IOptionsProps {
|
|
5
5
|
models: Model[];
|
|
6
6
|
templates: Templates;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientModelsIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModelsIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"writeClientModelsIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModelsIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,UAAU,aAAa;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,iBAcrF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Templates } from '../types/base/Templates.model';
|
|
1
2
|
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
3
|
+
import { ValidationLibrary } from '../types/enums/ValidationLibrary.enum';
|
|
2
4
|
import type { Model } from '../types/shared/Model.model';
|
|
3
5
|
import { WriteClient } from '../WriteClient';
|
|
4
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
5
6
|
/**
|
|
6
7
|
* @param models Array of Models to write
|
|
7
8
|
* @param templates The loaded handlebar templates
|
|
@@ -15,6 +16,7 @@ interface IWriteClientSchemas {
|
|
|
15
16
|
outputSchemasPath: string;
|
|
16
17
|
httpClient: HttpClient;
|
|
17
18
|
useUnionTypes: boolean;
|
|
19
|
+
validationLibrary?: ValidationLibrary;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Generate Schemas using the Handlebar template and write to disk.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientSchemas.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSchemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"writeClientSchemas.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSchemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;GAMG;AACH,UAAU,mBAAmB;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCvG"}
|
|
@@ -14,26 +14,29 @@ const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
|
14
14
|
* @param useUnionTypes Use union types instead of enums
|
|
15
15
|
*/
|
|
16
16
|
async function writeClientSchemas(options) {
|
|
17
|
-
const { models, templates, outputSchemasPath, httpClient, useUnionTypes } = options;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
const { models, templates, outputSchemasPath, httpClient, useUnionTypes, validationLibrary } = options;
|
|
18
|
+
if (templates.exports.schema) {
|
|
19
|
+
this.logger.info('The recording of model validation schema files begins.');
|
|
20
|
+
for (const model of models) {
|
|
21
|
+
const modelFolderPath = model?.path;
|
|
22
|
+
const dir = (0, pathHelpers_1.dirNameHelper)(modelFolderPath);
|
|
23
|
+
if (dir) {
|
|
24
|
+
const directory = (0, pathHelpers_1.resolveHelper)(outputSchemasPath, dir);
|
|
25
|
+
this.logger.info(`A directory is being created: ${directory}`);
|
|
26
|
+
(0, fs_1.mkdirSync)(directory, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
const file = (0, pathHelpers_1.resolveHelper)(outputSchemasPath, `${modelFolderPath}Schema.ts`);
|
|
29
|
+
this.logger.info(`The recording of the file data begins: ${file}`);
|
|
30
|
+
const templateResult = templates.exports.schema({
|
|
31
|
+
...model,
|
|
32
|
+
httpClient,
|
|
33
|
+
useUnionTypes,
|
|
34
|
+
validationLibrary,
|
|
35
|
+
});
|
|
36
|
+
const formattedValue = await (0, format_1.format)(templateResult);
|
|
37
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
38
|
+
this.logger.info(`File recording completed: ${file}`);
|
|
26
39
|
}
|
|
27
|
-
|
|
28
|
-
this.logger.info(`The recording of the file data begins: ${file}`);
|
|
29
|
-
const templateResult = templates.exports.schema({
|
|
30
|
-
...model,
|
|
31
|
-
httpClient,
|
|
32
|
-
useUnionTypes,
|
|
33
|
-
});
|
|
34
|
-
const formattedValue = await (0, format_1.format)(templateResult);
|
|
35
|
-
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
36
|
-
this.logger.info(`File recording completed: ${file}`);
|
|
40
|
+
this.logger.info('The recording of model validation schema files has been completed successfully');
|
|
37
41
|
}
|
|
38
|
-
this.logger.info('The recording of model validation schema files has been completed successfully');
|
|
39
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Templates } from '../types/base/Templates.model';
|
|
1
2
|
import { Model } from '../types/shared/Model.model';
|
|
2
3
|
import { WriteClient } from '../WriteClient';
|
|
3
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
4
4
|
interface IOptionsProps {
|
|
5
5
|
models: Model[];
|
|
6
6
|
templates: Templates;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientSchemasIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSchemasIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"writeClientSchemasIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSchemasIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,UAAU,aAAa;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,iBActF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OutputPaths } from '../types/base/OutputPaths.model';
|
|
2
|
+
import { Templates } from '../types/base/Templates.model';
|
|
2
3
|
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
3
4
|
import type { Service } from '../types/shared/Service.model';
|
|
4
5
|
import { WriteClient } from '../WriteClient';
|
|
5
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
6
6
|
type TServeceOutputsPath = Omit<OutputPaths, 'output' | 'outputSchemas'>;
|
|
7
7
|
/**
|
|
8
8
|
* @param services Array of Services to write
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientServices.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServices.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"writeClientServices.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServices.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BzG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Templates } from '../types/base/Templates.model';
|
|
1
2
|
import { Service } from '../types/shared/Service.model';
|
|
2
3
|
import { WriteClient } from '../WriteClient';
|
|
3
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
4
4
|
interface IOptionsProps {
|
|
5
5
|
services: Service[];
|
|
6
6
|
templates: Templates;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientServicesIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServicesIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"writeClientServicesIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServicesIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,UAAU,aAAa;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,iBAcvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientSimpleIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSimpleIndex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeClientSimpleIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSimpleIndex.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB7G"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeClientSimpleIndex = writeClientSimpleIndex;
|
|
4
|
-
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
5
4
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
5
|
+
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
6
6
|
/**
|
|
7
7
|
* Generate the OpenAPI client index file using the Handlebar template and write it to disk.
|
|
8
8
|
* The index file just contains all the exports you need to use the client as a standalone
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
3
|
+
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
"5": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
|
+
compiler: (string | number)[];
|
|
6
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
7
|
+
usePartial: boolean;
|
|
8
|
+
useData: boolean;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=customRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customRequest.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/cli/customRequest.ts"],"names":[],"mappings":";;;;;;;;;AAMA,wBAmBmC"}
|