ts-openapi-codegen 1.0.0-beta.8 → 2.0.0-beta.0
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 +221 -123
- package/README.rus.md +725 -0
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts +12 -0
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/checkConfig.js +66 -0
- package/dist/cli/checkAndUpdateConfig/constants.d.ts +13 -0
- package/dist/cli/checkAndUpdateConfig/constants.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/constants.js +29 -0
- package/dist/cli/checkAndUpdateConfig/types.d.ts +20 -0
- package/dist/cli/checkAndUpdateConfig/types.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/types.js +12 -0
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts +12 -0
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/updateConfig.js +56 -0
- package/dist/cli/checkAndUpdateConfig/utils/generateConfigExample.d.ts +2 -0
- package/dist/cli/checkAndUpdateConfig/utils/generateConfigExample.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/generateConfigExample.js +11 -0
- package/dist/cli/checkAndUpdateConfig/utils/prepareConfigData.d.ts +14 -0
- package/dist/cli/checkAndUpdateConfig/utils/prepareConfigData.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/prepareConfigData.js +30 -0
- package/dist/cli/checkAndUpdateConfig/utils/removeDefaultConfigValues.d.ts +17 -0
- package/dist/cli/checkAndUpdateConfig/utils/removeDefaultConfigValues.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/removeDefaultConfigValues.js +29 -0
- package/dist/cli/checkAndUpdateConfig/utils/rewriteConfigFile.d.ts +2 -0
- package/dist/cli/checkAndUpdateConfig/utils/rewriteConfigFile.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/rewriteConfigFile.js +11 -0
- package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.d.ts +29 -0
- package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.js +49 -0
- package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.d.ts +6 -0
- package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.js +22 -0
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts +17 -0
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.js +53 -0
- package/dist/cli/checkAndUpdateConfig/utils/writeConfigFile.d.ts +34 -0
- package/dist/cli/checkAndUpdateConfig/utils/writeConfigFile.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/writeConfigFile.js +41 -0
- package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.d.ts +6 -0
- package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.d.ts.map +1 -0
- package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.js +18 -0
- package/dist/cli/generate/runGenerateOpenApi.d.ts +2 -2
- package/dist/cli/generate/runGenerateOpenApi.d.ts.map +1 -1
- package/dist/cli/generate/runGenerateOpenApi.js +20 -37
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +56 -30
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.js +11 -18
- package/dist/cli/interactive/confirmDialog.d.ts +17 -0
- package/dist/cli/interactive/confirmDialog.d.ts.map +1 -0
- package/dist/cli/interactive/confirmDialog.js +36 -0
- package/dist/cli/interactive/constants.d.ts +7 -0
- package/dist/cli/interactive/constants.d.ts.map +1 -0
- package/dist/cli/interactive/constants.js +25 -0
- package/dist/cli/interactive/selectDialog.d.ts +17 -0
- package/dist/cli/interactive/selectDialog.d.ts.map +1 -0
- package/dist/cli/interactive/selectDialog.js +43 -0
- package/dist/cli/interactive/types.d.ts +40 -0
- package/dist/cli/interactive/types.d.ts.map +1 -0
- package/dist/cli/interactive/types.js +12 -0
- package/dist/common/Consts.d.ts +4 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +31 -1
- package/dist/common/Enums.d.ts +4 -0
- package/dist/common/Enums.d.ts.map +1 -1
- package/dist/common/Enums.js +6 -1
- package/dist/common/Logger.d.ts +1 -1
- package/dist/common/Logger.d.ts.map +1 -1
- package/dist/common/Logger.js +7 -39
- package/dist/common/LoggerMessages.d.ts +64 -0
- package/dist/common/LoggerMessages.d.ts.map +1 -0
- package/dist/common/LoggerMessages.js +82 -0
- package/dist/common/TRawOptions.d.ts +40 -0
- package/dist/common/TRawOptions.d.ts.map +1 -0
- package/dist/common/UpdateNotifier.d.ts +36 -2
- package/dist/common/UpdateNotifier.d.ts.map +1 -1
- package/dist/common/UpdateNotifier.js +150 -57
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts +8 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +31 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts +8 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.js +33 -0
- package/dist/common/VersionedSchema/Enums.d.ts +2 -1
- package/dist/common/VersionedSchema/Enums.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Enums.js +1 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.js +10 -19
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.js +10 -10
- package/dist/common/VersionedSchema/Types.d.ts +10 -0
- package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts +3 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts.map +1 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.js +28 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts +7 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts.map +1 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.js +42 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts +3 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts.map +1 -0
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.js +10 -0
- package/dist/common/VersionedSchema/Utils/createDefaultFieldsMigration.d.ts +11 -0
- package/dist/common/VersionedSchema/Utils/createDefaultFieldsMigration.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/createDefaultFieldsMigration.js +19 -0
- package/dist/common/VersionedSchema/Utils/createTrivialMigration.d.ts +7 -0
- package/dist/common/VersionedSchema/Utils/createTrivialMigration.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/createTrivialMigration.js +15 -0
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +1 -7
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts +3 -0
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.js +14 -0
- package/dist/common/VersionedSchema/Utils/getKeyByMapValue.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/getKeyByMapValue.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/getKeyByMapValue.js +11 -0
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +5 -2
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +31 -17
- package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts.map +1 -0
- package/dist/common/utils/__tests__/convertArrayToObject.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/convertArrayToObject.test.js +14 -14
- package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/determineBestMatchingSchemaVersion.test.js +5 -5
- package/dist/common/utils/__tests__/generateKeyMappingForInvalidKeys.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/generateKeyMappingForInvalidKeys.test.js +4 -4
- package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/getUniqueKeysFromSchemas.test.js +4 -4
- package/dist/common/utils/__tests__/getUniqueObjectKeys.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/getUniqueObjectKeys.test.js +5 -5
- package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/mergeObjectSchemas.test.js +5 -5
- package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/migrationForMultiOptions.test.js +21 -15
- package/dist/common/utils/__tests__/migrationForOptions.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/migrationForOptions.test.js +13 -9
- package/dist/common/utils/__tests__/pathHelpers.test.d.ts.map +1 -0
- package/dist/{core → common}/utils/__tests__/pathHelpers.test.js +8 -8
- package/dist/common/utils/__tests__/replaceInvalidKeysWithMappedNames.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/replaceInvalidKeysWithMappedNames.test.js +5 -5
- package/dist/common/utils/__tests__/validateAndSuggestKeyCorrections.test.d.ts.map +1 -0
- package/dist/common/{__tests__ → utils/__tests__}/validateAndSuggestKeyCorrections.test.js +5 -5
- package/dist/common/utils/convertArrayToObject.d.ts +2 -0
- package/dist/common/utils/convertArrayToObject.d.ts.map +1 -0
- package/dist/common/{Utils.js → utils/convertArrayToObject.js} +0 -20
- package/dist/{core/utils/fileSystem.d.ts → common/utils/fileSystemHelpers.d.ts} +8 -5
- package/dist/common/utils/fileSystemHelpers.d.ts.map +1 -0
- package/dist/common/utils/fileSystemHelpers.js +85 -0
- package/dist/common/utils/format.d.ts +3 -0
- package/dist/common/utils/format.d.ts.map +1 -0
- package/dist/{core → common}/utils/format.js +2 -2
- package/dist/common/utils/loadConfigIfExists.d.ts +2 -0
- package/dist/common/utils/loadConfigIfExists.d.ts.map +1 -0
- package/dist/common/utils/loadConfigIfExists.js +22 -0
- package/dist/common/utils/pathHelpers.d.ts +6 -0
- package/dist/common/utils/pathHelpers.d.ts.map +1 -0
- package/dist/{core → common}/utils/pathHelpers.js +16 -20
- package/dist/common/utils/safeHasOwn.d.ts +2 -0
- package/dist/common/utils/safeHasOwn.d.ts.map +1 -0
- package/dist/common/utils/safeHasOwn.js +9 -0
- package/dist/core/Context.d.ts.map +1 -1
- package/dist/core/Context.js +3 -3
- package/dist/core/OpenApiClient.d.ts +13 -0
- package/dist/core/OpenApiClient.d.ts.map +1 -0
- package/dist/core/OpenApiClient.js +175 -0
- package/dist/core/WriteClient.d.ts +1 -1
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +20 -20
- package/dist/core/__tests__/WriteClient.test.js +61 -60
- package/dist/core/api/v2/Parser.d.ts.map +1 -1
- package/dist/core/api/v2/Parser.js +2 -9
- package/dist/core/api/v2/parser/__tests__/getServer.test.js +2 -2
- package/dist/core/api/v2/parser/__tests__/getType.test.js +3 -3
- package/dist/core/api/v2/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModelProperties.js +2 -5
- package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModels.js +2 -1
- package/dist/core/api/v2/parser/getOperationParameter.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationParameter.js +2 -1
- package/dist/core/api/v2/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationResponse.js +2 -5
- package/dist/core/api/v2/parser/getOperationResponses.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationResponses.js +2 -5
- package/dist/core/api/v2/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getServices.js +2 -5
- package/dist/core/api/v2/parser/getType.js +4 -4
- 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 -9
- package/dist/core/api/v3/parser/__tests__/getServer.test.js +3 -3
- package/dist/core/api/v3/parser/__tests__/getType.test.js +3 -3
- package/dist/core/api/v3/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModelProperties.js +2 -5
- package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModels.js +2 -1
- package/dist/core/api/v3/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationResponse.js +2 -5
- package/dist/core/api/v3/parser/getOperationResponses.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationResponses.js +2 -5
- package/dist/core/api/v3/parser/getServer.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getServer.js +2 -5
- package/dist/core/api/v3/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getServices.js +2 -5
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +5 -13
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -161
- package/dist/core/types/Consts.d.ts +5 -1
- package/dist/core/types/Consts.d.ts.map +1 -1
- package/dist/core/types/Consts.js +6 -2
- package/dist/core/types/base/Root.model.d.ts +1 -0
- package/dist/core/types/base/Root.model.d.ts.map +1 -1
- package/dist/core/utils/__tests__/escapeDescription.test.js +3 -3
- package/dist/core/utils/__tests__/escapeName.test.js +2 -2
- package/dist/core/utils/__tests__/flatMap.test.js +2 -2
- package/dist/core/utils/__tests__/getAbsolutePath.test.js +6 -6
- package/dist/core/utils/__tests__/getClassName.test.js +2 -2
- package/dist/core/utils/__tests__/getComment.test.js +2 -2
- package/dist/core/utils/__tests__/getEnumFromDescription.test.js +2 -2
- package/dist/core/utils/__tests__/getFileName.test.js +2 -2
- package/dist/core/utils/__tests__/getGatheringRefs.test.js +2 -2
- package/dist/core/utils/__tests__/getMappedType.test.js +2 -2
- package/dist/core/utils/__tests__/getModelNames.test.js +2 -2
- package/dist/core/utils/__tests__/getOpenApiVersion.test.js +2 -2
- package/dist/core/utils/__tests__/getOperationName.test.js +2 -2
- package/dist/core/utils/__tests__/getOperationParameterName.test.js +2 -2
- package/dist/core/utils/__tests__/getOperationPath.test.js +2 -2
- package/dist/core/utils/__tests__/getOperationResponseCode.test.js +2 -2
- package/dist/core/utils/__tests__/getPattern.test.js +2 -2
- package/dist/core/utils/__tests__/getRefFromSchema.test.js +2 -2
- package/dist/core/utils/__tests__/getRefs.test.js +2 -2
- package/dist/core/utils/__tests__/getRelativeModelPath.test.js +3 -3
- package/dist/core/utils/__tests__/getServiceClassName.test.js +2 -2
- package/dist/core/utils/__tests__/getServiceNames.test.js +2 -2
- package/dist/core/utils/__tests__/getServiceVersion.test.js +2 -2
- package/dist/core/utils/__tests__/isString.test.js +2 -2
- package/dist/core/utils/__tests__/isSubdirectory.test.js +10 -10
- package/dist/core/utils/__tests__/registerHandlebarHelpers.test.js +2 -2
- package/dist/core/utils/__tests__/registerHandlebarTemplates.test.js +2 -2
- package/dist/core/utils/__tests__/replaceString.test.js +2 -2
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.js +360 -51
- package/dist/core/utils/__tests__/sort.test.js +2 -2
- package/dist/core/utils/__tests__/sortByRequiredExtended.test.js +11 -11
- package/dist/core/utils/__tests__/sortByRequiredSimple.test.js +11 -11
- package/dist/core/utils/__tests__/sortModelsByName.test.js +2 -2
- package/dist/core/utils/__tests__/sortServicesByName.test.js +2 -2
- package/dist/core/utils/__tests__/stripNamespace.test.js +2 -2
- package/dist/core/utils/__tests__/unique.test.js +2 -2
- package/dist/core/utils/__tests__/writeClientCore.test.js +52 -50
- package/dist/core/utils/__tests__/writeClientFullIndex.test.js +39 -37
- package/dist/core/utils/__tests__/writeClientModels.test.js +65 -63
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +65 -63
- package/dist/core/utils/__tests__/writeClientServices.test.js +60 -58
- package/dist/core/utils/appendUniqueLinesToFile.js +4 -4
- package/dist/core/utils/createNormalizedRef.js +2 -2
- package/dist/core/utils/getAbsolutePath.js +3 -3
- package/dist/core/utils/getModelNameWithPrefix.d.ts +3 -0
- package/dist/core/utils/getModelNameWithPrefix.d.ts.map +1 -0
- package/dist/core/utils/getModelNameWithPrefix.js +15 -0
- package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
- package/dist/core/utils/getOpenApiSpec.js +4 -4
- package/dist/core/utils/getOutputPaths.d.ts.map +1 -1
- package/dist/core/utils/getOutputPaths.js +6 -6
- package/dist/core/utils/getPattern.d.ts.map +1 -1
- package/dist/core/utils/getPattern.js +2 -1
- package/dist/core/utils/getRelativeModelPath.d.ts.map +1 -1
- package/dist/core/utils/getRelativeModelPath.js +2 -6
- package/dist/core/utils/isSubdirectory.d.ts.map +1 -1
- package/dist/core/utils/isSubdirectory.js +4 -3
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts.map +1 -1
- package/dist/core/utils/mapPathToTargetDirSafe.js +11 -12
- package/dist/core/utils/modelHelpers.d.ts.map +1 -1
- package/dist/core/utils/modelHelpers.js +18 -6
- package/dist/core/utils/normalizeString.d.ts +2 -0
- package/dist/core/utils/normalizeString.d.ts.map +1 -0
- package/dist/core/utils/normalizeString.js +14 -0
- package/dist/core/utils/normalizedAbsolutePath.js +3 -3
- package/dist/core/utils/parseRef.d.ts.map +1 -1
- package/dist/core/utils/parseRef.js +7 -10
- package/dist/core/utils/precompileTemplates.js +14 -10
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +24 -0
- package/dist/core/utils/replaceString.d.ts.map +1 -1
- package/dist/core/utils/replaceString.js +2 -1
- package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
- package/dist/core/utils/resolveRefPath.js +3 -3
- package/dist/core/utils/resolveRefToImportPath.d.ts +8 -2
- package/dist/core/utils/resolveRefToImportPath.d.ts.map +1 -1
- package/dist/core/utils/resolveRefToImportPath.js +91 -31
- package/dist/core/utils/serviceHelpers.d.ts.map +1 -1
- package/dist/core/utils/serviceHelpers.js +2 -1
- package/dist/core/utils/stripNamespace.js +5 -5
- package/dist/core/utils/writeClientCore.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.js +12 -12
- package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientCoreIndex.js +2 -2
- package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientFullIndex.js +4 -4
- package/dist/core/utils/writeClientModels.d.ts.map +1 -1
- package/dist/core/utils/writeClientModels.js +7 -7
- package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientModelsIndex.js +2 -2
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +7 -7
- package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemasIndex.js +2 -2
- package/dist/core/utils/writeClientServices.d.ts.map +1 -1
- package/dist/core/utils/writeClientServices.js +5 -5
- package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientServicesIndex.js +2 -2
- package/dist/core/utils/writeClientSimpleIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSimpleIndex.js +4 -4
- package/dist/templatesCompiled/client/exportModel.js +4 -4
- package/dist/templatesCompiled/client/exportService.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportService.js +12 -13
- package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexFull.js +35 -29
- package/dist/templatesCompiled/client/partials/parameters.d.ts +3 -2
- package/dist/templatesCompiled/client/partials/parameters.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/parameters.js +25 -20
- package/dist/templatesCompiled/client/partials/parametersDefinition.d.ts +4 -2
- package/dist/templatesCompiled/client/partials/parametersDefinition.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/parametersDefinition.js +31 -10
- package/package.json +15 -13
- package/dist/cli/chekOpenApiConfig/chekOpenApiConfig.d.ts +0 -5
- package/dist/cli/chekOpenApiConfig/chekOpenApiConfig.d.ts.map +0 -1
- package/dist/cli/chekOpenApiConfig/chekOpenApiConfig.js +0 -45
- package/dist/common/Options.d.ts +0 -26
- package/dist/common/Options.d.ts.map +0 -1
- package/dist/common/Utils.d.ts +0 -3
- package/dist/common/Utils.d.ts.map +0 -1
- package/dist/common/__tests__/__mock__/mockJoiSchema.d.ts.map +0 -1
- package/dist/common/__tests__/convertArrayToObject.test.d.ts.map +0 -1
- package/dist/common/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +0 -1
- package/dist/common/__tests__/generateKeyMappingForInvalidKeys.test.d.ts.map +0 -1
- package/dist/common/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +0 -1
- package/dist/common/__tests__/getUniqueObjectKeys.test.d.ts.map +0 -1
- package/dist/common/__tests__/mergeObjectSchemas.test.d.ts.map +0 -1
- package/dist/common/__tests__/migrationForMultiOptions.test.d.ts.map +0 -1
- package/dist/common/__tests__/migrationForOptions.test.d.ts.map +0 -1
- package/dist/common/__tests__/replaceInvalidKeysWithMappedNames.test.d.ts.map +0 -1
- package/dist/common/__tests__/validateAndSuggestKeyCorrections.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getRelativeModelImportPath.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getRelativeModelImportPath.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getRelativeModelImportPath.test.js +0 -82
- package/dist/core/utils/__tests__/pathHelpers.test.d.ts.map +0 -1
- package/dist/core/utils/fileSystem.d.ts.map +0 -1
- package/dist/core/utils/fileSystem.js +0 -26
- package/dist/core/utils/format.d.ts +0 -2
- package/dist/core/utils/format.d.ts.map +0 -1
- package/dist/core/utils/getRelativeModelImportPath.d.ts +0 -9
- package/dist/core/utils/getRelativeModelImportPath.d.ts.map +0 -1
- package/dist/core/utils/getRelativeModelImportPath.js +0 -45
- package/dist/core/utils/isDirectory.d.ts +0 -2
- package/dist/core/utils/isDirectory.d.ts.map +0 -1
- package/dist/core/utils/isDirectory.js +0 -13
- package/dist/core/utils/pathHelpers.d.ts +0 -7
- package/dist/core/utils/pathHelpers.d.ts.map +0 -1
- package/dist/core/utils/prepareOptions.d.ts +0 -8
- package/dist/core/utils/prepareOptions.d.ts.map +0 -1
- package/dist/core/utils/prepareOptions.js +0 -31
- /package/dist/common/{Options.js → TRawOptions.js} +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/__mock__/mockJoiSchema.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/__mock__/mockJoiSchema.js +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/convertArrayToObject.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/determineBestMatchingSchemaVersion.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/generateKeyMappingForInvalidKeys.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/getUniqueKeysFromSchemas.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/getUniqueObjectKeys.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/mergeObjectSchemas.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/migrationForMultiOptions.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/migrationForOptions.test.d.ts +0 -0
- /package/dist/{core → common}/utils/__tests__/pathHelpers.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/replaceInvalidKeysWithMappedNames.test.d.ts +0 -0
- /package/dist/common/{__tests__ → utils/__tests__}/validateAndSuggestKeyCorrections.test.d.ts +0 -0
|
@@ -13,7 +13,7 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
13
13
|
}
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
|
-
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useOptions"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.program(
|
|
16
|
+
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useOptions"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.program(11, data, 0), "data": data, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 35, "column": 7 } } })) != null ? stack1 : "");
|
|
17
17
|
}, "2": function (container, depth0, helpers, partials, data) {
|
|
18
18
|
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
19
19
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -22,43 +22,47 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
22
22
|
return undefined;
|
|
23
23
|
};
|
|
24
24
|
return "{\n"
|
|
25
|
-
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line":
|
|
25
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 11, "column": 9 } } })) != null ? stack1 : "")
|
|
26
26
|
+ "}: {\n"
|
|
27
|
-
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(
|
|
27
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(8, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 23, "column": 9 } } })) != null ? stack1 : "")
|
|
28
28
|
+ "}";
|
|
29
29
|
}, "3": function (container, depth0, helpers, partials, data) {
|
|
30
|
-
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
30
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
31
31
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
32
32
|
return parent[propertyName];
|
|
33
33
|
}
|
|
34
34
|
return undefined;
|
|
35
35
|
};
|
|
36
|
-
return ((stack1 =
|
|
37
|
-
+ ((stack1 =
|
|
36
|
+
return ((stack1 = lookupProperty(helpers, "containsSystemName").call(alias1, lookupProperty(depth0, "name"), { "name": "containsSystemName", "hash": {}, "fn": container.program(4, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 9, "column": 23 } } })) != null ? stack1 : "")
|
|
37
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 10, "column": 3 }, "end": { "line": 10, "column": 7 } }), depth0)) != null ? stack1 : "")
|
|
38
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "default"), { "name": "if", "hash": {}, "fn": container.program(6, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 10, "column": 10 }, "end": { "line": 10, "column": 48 } } })) != null ? stack1 : "")
|
|
38
39
|
+ ",\n";
|
|
39
40
|
}, "4": function (container, depth0, helpers, partials, data) {
|
|
41
|
+
return "/**\n* [WARN] Be careful! A reserved system word is used!\n*/\n";
|
|
42
|
+
}, "6": function (container, depth0, helpers, partials, data) {
|
|
40
43
|
var stack1;
|
|
41
44
|
return " = "
|
|
42
|
-
+ ((stack1 = container.lambda(container.strict(depth0, "default", { "start": { "line":
|
|
43
|
-
}, "
|
|
44
|
-
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
45
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "default", { "start": { "line": 10, "column": 31 }, "end": { "line": 10, "column": 38 } }), depth0)) != null ? stack1 : "");
|
|
46
|
+
}, "8": function (container, depth0, helpers, partials, data) {
|
|
47
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
45
48
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
46
49
|
return parent[propertyName];
|
|
47
50
|
}
|
|
48
51
|
return undefined;
|
|
49
52
|
};
|
|
50
|
-
return ((stack1 = lookupProperty(helpers, "if").call(
|
|
51
|
-
+ ((stack1 =
|
|
53
|
+
return ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "description"), { "name": "if", "hash": {}, "fn": container.program(9, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 7 } } })) != null ? stack1 : "")
|
|
54
|
+
+ ((stack1 = lookupProperty(helpers, "containsSystemName").call(alias1, lookupProperty(depth0, "name"), { "name": "containsSystemName", "hash": {}, "fn": container.program(4, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 21, "column": 23 } } })) != null ? stack1 : "")
|
|
55
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 22, "column": 3 }, "end": { "line": 22, "column": 7 } }), depth0)) != null ? stack1 : "")
|
|
52
56
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "isRequired"), depth0, { "name": "isRequired", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
53
57
|
+ ": "
|
|
54
58
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "type"), depth0, { "name": "type", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
55
59
|
+ ",\n";
|
|
56
|
-
}, "
|
|
60
|
+
}, "9": function (container, depth0, helpers, partials, data) {
|
|
57
61
|
var stack1;
|
|
58
62
|
return "/** "
|
|
59
|
-
+ ((stack1 = container.lambda(container.strict(depth0, "description", { "start": { "line":
|
|
63
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "description", { "start": { "line": 15, "column": 7 }, "end": { "line": 15, "column": 18 } }), depth0)) != null ? stack1 : "")
|
|
60
64
|
+ " **/\n";
|
|
61
|
-
}, "
|
|
65
|
+
}, "11": function (container, depth0, helpers, partials, data) {
|
|
62
66
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
63
67
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
64
68
|
return parent[propertyName];
|
|
@@ -66,19 +70,20 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
66
70
|
return undefined;
|
|
67
71
|
};
|
|
68
72
|
return "\n"
|
|
69
|
-
+ ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(
|
|
70
|
-
}, "
|
|
71
|
-
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
73
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(12, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 34, "column": 9 } } })) != null ? stack1 : "");
|
|
74
|
+
}, "12": function (container, depth0, helpers, partials, data) {
|
|
75
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
72
76
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
73
77
|
return parent[propertyName];
|
|
74
78
|
}
|
|
75
79
|
return undefined;
|
|
76
80
|
};
|
|
77
|
-
return ((stack1 =
|
|
81
|
+
return ((stack1 = lookupProperty(helpers, "containsSystemName").call(alias1, lookupProperty(depth0, "name"), { "name": "containsSystemName", "hash": {}, "fn": container.program(4, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 28, "column": 0 }, "end": { "line": 32, "column": 23 } } })) != null ? stack1 : "")
|
|
82
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 33, "column": 3 }, "end": { "line": 33, "column": 7 } }), depth0)) != null ? stack1 : "")
|
|
78
83
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "isRequired"), depth0, { "name": "isRequired", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
79
84
|
+ ": "
|
|
80
85
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "type"), depth0, { "name": "type", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
81
|
-
+ ((stack1 = lookupProperty(helpers, "if").call(
|
|
86
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "default"), { "name": "if", "hash": {}, "fn": container.program(6, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 33, "column": 36 }, "end": { "line": 33, "column": 74 } } })) != null ? stack1 : "")
|
|
82
87
|
+ ",\n";
|
|
83
88
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
84
89
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
@@ -87,5 +92,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
87
92
|
}
|
|
88
93
|
return undefined;
|
|
89
94
|
};
|
|
90
|
-
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line":
|
|
95
|
+
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 36, "column": 7 } } })) != null ? stack1 : "");
|
|
91
96
|
}, "usePartial": true, "useData": true };
|
|
@@ -2,8 +2,10 @@ declare const _default: {
|
|
|
2
2
|
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
3
3
|
"2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
4
|
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"4": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
6
|
+
"6": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
7
|
+
"8": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
8
|
+
"9": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
7
9
|
compiler: (string | number)[];
|
|
8
10
|
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
9
11
|
usePartial: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parametersDefinition.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/partials/parametersDefinition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parametersDefinition.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/partials/parametersDefinition.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAMA,wBAiFmC"}
|
|
@@ -13,7 +13,7 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
13
13
|
}
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
|
-
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useOptions"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.program(
|
|
16
|
+
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useOptions"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.program(8, data, 0), "data": data, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 27, "column": 7 } } })) != null ? stack1 : "");
|
|
17
17
|
}, "2": function (container, depth0, helpers, partials, data) {
|
|
18
18
|
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
19
19
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -22,27 +22,35 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
22
22
|
return undefined;
|
|
23
23
|
};
|
|
24
24
|
return "{\n"
|
|
25
|
-
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line":
|
|
25
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 11, "column": 9 } } })) != null ? stack1 : "")
|
|
26
26
|
+ "}: {\n"
|
|
27
|
-
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(
|
|
27
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(6, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 15, "column": 9 } } })) != null ? stack1 : "")
|
|
28
28
|
+ "}";
|
|
29
29
|
}, "3": function (container, depth0, helpers, partials, data) {
|
|
30
|
-
var stack1
|
|
31
|
-
|
|
30
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
32
|
+
return parent[propertyName];
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
return ((stack1 = lookupProperty(helpers, "containsSystemName").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "name"), { "name": "containsSystemName", "hash": {}, "fn": container.program(4, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 9, "column": 23 } } })) != null ? stack1 : "")
|
|
37
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 10, "column": 3 }, "end": { "line": 10, "column": 7 } }), depth0)) != null ? stack1 : "")
|
|
32
38
|
+ ",\n";
|
|
33
|
-
}, "
|
|
39
|
+
}, "4": function (container, depth0, helpers, partials, data) {
|
|
40
|
+
return "/**\n* [WARN] Be careful! A reserved system word is used!\n*/\n";
|
|
41
|
+
}, "6": function (container, depth0, helpers, partials, data) {
|
|
34
42
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
35
43
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
36
44
|
return parent[propertyName];
|
|
37
45
|
}
|
|
38
46
|
return undefined;
|
|
39
47
|
};
|
|
40
|
-
return ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line":
|
|
48
|
+
return ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 14, "column": 3 }, "end": { "line": 14, "column": 7 } }), depth0)) != null ? stack1 : "")
|
|
41
49
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "isRequiredDefinition"), depth0, { "name": "isRequiredDefinition", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
42
50
|
+ ": "
|
|
43
51
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "type"), depth0, { "name": "type", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
44
52
|
+ ",\n";
|
|
45
|
-
}, "
|
|
53
|
+
}, "8": function (container, depth0, helpers, partials, data) {
|
|
46
54
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
47
55
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
48
56
|
return parent[propertyName];
|
|
@@ -50,7 +58,20 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
50
58
|
return undefined;
|
|
51
59
|
};
|
|
52
60
|
return "\n"
|
|
53
|
-
+ ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(
|
|
61
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "each", "hash": {}, "fn": container.program(9, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 26, "column": 9 } } })) != null ? stack1 : "");
|
|
62
|
+
}, "9": function (container, depth0, helpers, partials, data) {
|
|
63
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
64
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
65
|
+
return parent[propertyName];
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
};
|
|
69
|
+
return ((stack1 = lookupProperty(helpers, "containsSystemName").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "name"), { "name": "containsSystemName", "hash": {}, "fn": container.program(4, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 24, "column": 23 } } })) != null ? stack1 : "")
|
|
70
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 25, "column": 3 }, "end": { "line": 25, "column": 7 } }), depth0)) != null ? stack1 : "")
|
|
71
|
+
+ ((stack1 = container.invokePartial(lookupProperty(partials, "isRequiredDefinition"), depth0, { "name": "isRequiredDefinition", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
72
|
+
+ ": "
|
|
73
|
+
+ ((stack1 = container.invokePartial(lookupProperty(partials, "type"), depth0, { "name": "type", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
74
|
+
+ ",\n";
|
|
54
75
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
55
76
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
56
77
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -58,5 +79,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
58
79
|
}
|
|
59
80
|
return undefined;
|
|
60
81
|
};
|
|
61
|
-
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line":
|
|
82
|
+
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "parameters"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 28, "column": 7 } } })) != null ? stack1 : "");
|
|
62
83
|
}, "usePartial": true, "useData": true };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-openapi-codegen",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"description": "Library that generates Typescript clients based on the OpenAPI specification. It bases on openapi-typescript-codegen",
|
|
5
5
|
"author": "Alexey Zverev",
|
|
6
6
|
"homepage": "https://github.com/ozonophore/openapi-codegen.git",
|
|
@@ -35,20 +35,23 @@
|
|
|
35
35
|
],
|
|
36
36
|
"main": "dist/index.js",
|
|
37
37
|
"module": "dist/index.js",
|
|
38
|
-
"types": "
|
|
38
|
+
"types": "dist/index.d.ts",
|
|
39
39
|
"bin": {
|
|
40
|
-
"
|
|
40
|
+
"openapi-codegen-cli": "dist/cli/index.js"
|
|
41
|
+
},
|
|
42
|
+
"directories": {
|
|
43
|
+
"example": "example"
|
|
41
44
|
},
|
|
42
45
|
"files": [
|
|
43
46
|
"dist"
|
|
44
47
|
],
|
|
45
48
|
"scripts": {
|
|
46
|
-
"clean": "
|
|
47
|
-
"build": "tsc -p .
|
|
49
|
+
"clean": "shx rm -rf ./dist ./generated ./test/generated ./test/e2e/generated ./samples/generated ./coverage ./node_modules/.cache",
|
|
50
|
+
"build": "tsc -p .",
|
|
48
51
|
"build:hbs": "tsx ./src/core/utils/precompileTemplates.ts",
|
|
49
52
|
"release": "npm run build:hbs && npm run build",
|
|
50
53
|
"run": "node ./test/index.js",
|
|
51
|
-
"test:unit": "node --import tsx --test-name-pattern \"@unit\" --test \"**/*.test.ts\"",
|
|
54
|
+
"test:unit": "node --experimental-test-coverage --import tsx --test-name-pattern \"@unit\" --test \"**/*.test.ts\"",
|
|
52
55
|
"test:update": "UPDATE_SNAPSHOTS=true npm run test:unit",
|
|
53
56
|
"test:coverage": "node --experimental-test-coverage --import tsx --test-name-pattern \"@unit\" --test \"**/*.test.ts\"",
|
|
54
57
|
"eslint": "eslint \"./src/**/*.ts\" \"./types/index.d.ts\"",
|
|
@@ -57,7 +60,7 @@
|
|
|
57
60
|
"prettier:fix": "prettier \"./src/**/*.ts\" \"./types/index.d.ts\" --write",
|
|
58
61
|
"prepublish": "npm run clean && npm run release",
|
|
59
62
|
"codecov": "codecov --token=89a9fe76-2714-4b5b-83e3-9d809615064d",
|
|
60
|
-
"find-deadcode": "
|
|
63
|
+
"find-deadcode": "knip"
|
|
61
64
|
},
|
|
62
65
|
"dependencies": {
|
|
63
66
|
"@apidevtools/swagger-parser": "12.0.0",
|
|
@@ -66,14 +69,13 @@
|
|
|
66
69
|
"chalk": "^4.1.2",
|
|
67
70
|
"commander": "8.0.0",
|
|
68
71
|
"configstore": "^5.0.1",
|
|
72
|
+
"enquirer": "^2.4.1",
|
|
69
73
|
"fast-deep-equal": "^3.1.3",
|
|
70
74
|
"figlet": "^1.8.0",
|
|
71
75
|
"handlebars": "4.7.6",
|
|
72
76
|
"joi": "^17.13.3",
|
|
73
77
|
"json-schema": "0.4.0",
|
|
74
78
|
"leven": "^4.0.0",
|
|
75
|
-
"mkdirp": "1.0.4",
|
|
76
|
-
"rimraf": "3.0.2",
|
|
77
79
|
"semver": "^7.7.1",
|
|
78
80
|
"winston": "^3.17.0",
|
|
79
81
|
"winston-daily-rotate-file": "^5.0.0"
|
|
@@ -92,8 +94,7 @@
|
|
|
92
94
|
"@types/figlet": "^1.5.8",
|
|
93
95
|
"@types/glob": "^8.1.0",
|
|
94
96
|
"@types/json-schema": "^7.0.15",
|
|
95
|
-
"@types/
|
|
96
|
-
"@types/node": "22.5.1",
|
|
97
|
+
"@types/node": "^22.5.1",
|
|
97
98
|
"@types/node-fetch": "2.5.12",
|
|
98
99
|
"@types/prettier": "3.0.0",
|
|
99
100
|
"@types/qs": "6.9.7",
|
|
@@ -114,14 +115,15 @@
|
|
|
114
115
|
"form-data": "4.0.0",
|
|
115
116
|
"glob": "7.1.7",
|
|
116
117
|
"globals": "^16.2.0",
|
|
117
|
-
"
|
|
118
|
+
"knip": "^5.77.1",
|
|
118
119
|
"node-fetch": "2.6.1",
|
|
119
120
|
"prettier": "^3.4.2",
|
|
120
121
|
"puppeteer": "10.1.0",
|
|
121
122
|
"qs": "6.10.1",
|
|
123
|
+
"shx": "^0.4.0",
|
|
122
124
|
"ts-prune": "^0.10.3",
|
|
123
125
|
"tsx": "^4.20.3",
|
|
124
|
-
"typescript": "5.8.3"
|
|
126
|
+
"typescript": "^5.8.3"
|
|
125
127
|
},
|
|
126
128
|
"peerDependencies": {
|
|
127
129
|
"axios": ">=1.8.2 <=1.9.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chekOpenApiConfig.d.ts","sourceRoot":"","sources":["../../../src/cli/chekOpenApiConfig/chekOpenApiConfig.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,wBAAgB,iBAAiB,CAAE,UAAU,CAAC,EAAE,MAAM,QA+BrD"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.chekOpenApiConfig = chekOpenApiConfig;
|
|
4
|
-
const getFileName_1 = require("core/utils/getFileName");
|
|
5
|
-
const Enums_1 = require("../../common/Enums");
|
|
6
|
-
const Logger_1 = require("../../common/Logger");
|
|
7
|
-
const Utils_1 = require("../../common/Utils");
|
|
8
|
-
const MultiOptionsVersionedSchemas_1 = require("../../common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas");
|
|
9
|
-
const OptionsVersionedSchemas_1 = require("../../common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas");
|
|
10
|
-
const getErrorFieldsFromValidation_1 = require("../../common/VersionedSchema/Utils/getErrorFieldsFromValidation");
|
|
11
|
-
const isInstanceOfMultiOptions_1 = require("../../core/utils/isInstanceOfMultiOptions");
|
|
12
|
-
/**
|
|
13
|
-
* The function checks whether the configuration file data is filled in correctly
|
|
14
|
-
*/
|
|
15
|
-
function chekOpenApiConfig(configPath) {
|
|
16
|
-
const logger = new Logger_1.Logger({
|
|
17
|
-
level: Enums_1.ELogLevel.INFO,
|
|
18
|
-
instanceId: 'check-openapi-config',
|
|
19
|
-
logOutput: Enums_1.ELogOutput.CONSOLE,
|
|
20
|
-
});
|
|
21
|
-
try {
|
|
22
|
-
const configData = (0, Utils_1.loadConfigIfExists)(configPath);
|
|
23
|
-
if (!configData) {
|
|
24
|
-
logger.error('The configuration file is missing');
|
|
25
|
-
}
|
|
26
|
-
const preparedOptions = (0, Utils_1.convertArrayToObject)(configData);
|
|
27
|
-
const isMultiOptions = (0, isInstanceOfMultiOptions_1.isInstanceOfMultioptions)(preparedOptions);
|
|
28
|
-
const currentMigrationPlan = isMultiOptions ? MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema : OptionsVersionedSchemas_1.optionsVersionedSchemas;
|
|
29
|
-
const currentSchema = currentMigrationPlan
|
|
30
|
-
.map((sch, idx) => ({ ...sch, index: idx + 1 }))
|
|
31
|
-
.reduce((prev, curr) => (curr.index > prev.index ? curr : prev));
|
|
32
|
-
const { error } = currentSchema.schema.validate(preparedOptions);
|
|
33
|
-
if (error) {
|
|
34
|
-
const details = (0, getErrorFieldsFromValidation_1.getErrorFieldsFromValidation)(error).map((e) => `${e.path}: ${e.type}`).join(',');
|
|
35
|
-
logger.error(`The configuration file data is specified incorrectly: ${details}`);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
const fileName = (0, getFileName_1.getFileName)(configPath);
|
|
39
|
-
logger.forceInfo(`The parameters in the file are valid: ${fileName}`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
logger.error(error.message);
|
|
44
|
-
}
|
|
45
|
-
}
|
package/dist/common/Options.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '../core';
|
|
2
|
-
export type TOptions = {
|
|
3
|
-
input: string | Record<string, any>;
|
|
4
|
-
output: string;
|
|
5
|
-
outputCore?: string;
|
|
6
|
-
outputServices?: string;
|
|
7
|
-
outputModels?: string;
|
|
8
|
-
outputSchemas?: string;
|
|
9
|
-
httpClient?: HttpClient;
|
|
10
|
-
useOptions?: boolean;
|
|
11
|
-
useUnionTypes?: boolean;
|
|
12
|
-
excludeCoreServiceFiles?: boolean;
|
|
13
|
-
includeSchemasFiles?: boolean;
|
|
14
|
-
request?: string;
|
|
15
|
-
write?: boolean;
|
|
16
|
-
interfacePrefix?: string;
|
|
17
|
-
enumPrefix?: string;
|
|
18
|
-
typePrefix?: string;
|
|
19
|
-
useCancelableRequest?: boolean;
|
|
20
|
-
sortByRequired?: boolean;
|
|
21
|
-
useSeparatedIndexes?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type TMultiOptions = {
|
|
24
|
-
items: TOptions[];
|
|
25
|
-
} & Omit<TOptions, 'input' | 'output'>;
|
|
26
|
-
//# sourceMappingURL=Options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../src/common/Options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG;IACnB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACrB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC"}
|
package/dist/common/Utils.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare function loadConfigIfExists(configPath?: string): Record<string, any> | Record<string, any>[] | null;
|
|
2
|
-
export declare function convertArrayToObject(optionsArr: Record<string, any> | Record<string, any>[] | null): Record<string, any>;
|
|
3
|
-
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/common/Utils.ts"],"names":[],"mappings":"AAMA,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,MAAM,sDAYrD;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA4DxH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mockJoiSchema.d.ts","sourceRoot":"","sources":["../../../../src/common/__tests__/__mock__/mockJoiSchema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,EAAE,SAAS,OAAO,EAAE,SAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAO,EAAE,iBAAe;sBACxG,GAAG,WAAW,GAAG;;;sBADyC,MAAM;sBAAQ,MAAM;;;;;;;;;CASlG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertArrayToObject.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/convertArrayToObject.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"determineBestMatchingSchemaVersion.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/determineBestMatchingSchemaVersion.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateKeyMappingForInvalidKeys.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/generateKeyMappingForInvalidKeys.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getUniqueKeysFromSchemas.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/getUniqueKeysFromSchemas.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getUniqueObjectKeys.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/getUniqueObjectKeys.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeObjectSchemas.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/mergeObjectSchemas.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrationForMultiOptions.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/migrationForMultiOptions.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrationForOptions.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/migrationForOptions.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replaceInvalidKeysWithMappedNames.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/replaceInvalidKeysWithMappedNames.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateAndSuggestKeyCorrections.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/validateAndSuggestKeyCorrections.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRelativeModelImportPath.test.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__tests__/getRelativeModelImportPath.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
7
|
-
const node_test_1 = require("node:test");
|
|
8
|
-
const getRelativeModelImportPath_1 = require("../getRelativeModelImportPath");
|
|
9
|
-
const rootPath = '/openapi-codegen/generated/openapi/models';
|
|
10
|
-
let sourcePath = '';
|
|
11
|
-
let targetPath = '';
|
|
12
|
-
(0, node_test_1.describe)('getRelativeModelImportPath', () => {
|
|
13
|
-
(0, node_test_1.beforeEach)(() => {
|
|
14
|
-
sourcePath = '';
|
|
15
|
-
targetPath = '';
|
|
16
|
-
});
|
|
17
|
-
(0, node_test_1.test)('@unit: The root folder is not specified', () => {
|
|
18
|
-
sourcePath = '';
|
|
19
|
-
targetPath = '../common/ModelWithString.yml';
|
|
20
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(undefined, sourcePath, targetPath), '../common/ModelWithString');
|
|
21
|
-
});
|
|
22
|
-
(0, node_test_1.test)('@unit: The path for sourcePath is not specified. Option 1', () => {
|
|
23
|
-
sourcePath = '';
|
|
24
|
-
targetPath = 'ModelWithString.yml';
|
|
25
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './ModelWithString');
|
|
26
|
-
});
|
|
27
|
-
(0, node_test_1.test)('@unit: The path for sourcePath is not specified. Option 2', () => {
|
|
28
|
-
sourcePath = '';
|
|
29
|
-
targetPath = '../ModelWithString.yml';
|
|
30
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './ModelWithString');
|
|
31
|
-
});
|
|
32
|
-
(0, node_test_1.test)('@unit: The path for sourcePath is not specified. Option 3', () => {
|
|
33
|
-
sourcePath = '';
|
|
34
|
-
targetPath = '../common/ModelWithString.yml';
|
|
35
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './common/ModelWithString');
|
|
36
|
-
});
|
|
37
|
-
(0, node_test_1.test)('@unit: The path for sourcePath is the area inside the file. Option 1', () => {
|
|
38
|
-
sourcePath = '#/components/schemas/SimpleRequestBody';
|
|
39
|
-
targetPath = 'ModelWithString.yml';
|
|
40
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './ModelWithString');
|
|
41
|
-
});
|
|
42
|
-
(0, node_test_1.test)('@unit: The path for sourcePath is the area inside the file. Option 2', () => {
|
|
43
|
-
sourcePath = '#/components/schemas/SimpleRequestBody';
|
|
44
|
-
targetPath = '../ModelWithString.yml';
|
|
45
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './ModelWithString');
|
|
46
|
-
});
|
|
47
|
-
(0, node_test_1.test)('@unit: The path for sourcePath is the area inside the file. Option 3', () => {
|
|
48
|
-
sourcePath = '#/components/schemas/SimpleRequestBody';
|
|
49
|
-
targetPath = '../common/ModelWithString.yml';
|
|
50
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './common/ModelWithString');
|
|
51
|
-
});
|
|
52
|
-
(0, node_test_1.test)('@unit: The path for sourcePath contains the folder, the path for targetPath contains the file name.', () => {
|
|
53
|
-
sourcePath = 'model/SimpleRequestBody.yml';
|
|
54
|
-
targetPath = 'ModelWithString.yml';
|
|
55
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './ModelWithString');
|
|
56
|
-
});
|
|
57
|
-
(0, node_test_1.test)('@unit: The path for source Path contains a folder, the path for targetPath contains one jump to the folder above.', () => {
|
|
58
|
-
sourcePath = 'model/SimpleRequestBody.yml';
|
|
59
|
-
targetPath = '../common/ModelWithString.yml';
|
|
60
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), '../common/ModelWithString');
|
|
61
|
-
});
|
|
62
|
-
(0, node_test_1.test)('@unit: The path for sourcePath contains a folder, the path for targetPath contains several transitions to the folder above.', () => {
|
|
63
|
-
sourcePath = 'model/SimpleRequestBody.yml';
|
|
64
|
-
targetPath = '../../common/ModelWithString.yml';
|
|
65
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), '../common/ModelWithString');
|
|
66
|
-
});
|
|
67
|
-
(0, node_test_1.test)('@unit: The path for sourcePath goes beyond the root folder, the path for targetPath is the file name.', () => {
|
|
68
|
-
sourcePath = '../common/SimpleRequestBody.yml';
|
|
69
|
-
targetPath = 'ModelWithString.yml';
|
|
70
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './ModelWithString');
|
|
71
|
-
});
|
|
72
|
-
(0, node_test_1.test)('@unit: The path for sourcePath goes beyond the root folder, the path for targetPath is a file in the same folder.', () => {
|
|
73
|
-
sourcePath = '../common/SimpleRequestBody.yml';
|
|
74
|
-
targetPath = './ModelWithString.yml';
|
|
75
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), './ModelWithString');
|
|
76
|
-
});
|
|
77
|
-
(0, node_test_1.test)('@unit: The path for sourcePath contains several nested folders, the path for targetPath has a jump to the folder above', () => {
|
|
78
|
-
sourcePath = 'model/list/SimpleRequestBody.yml';
|
|
79
|
-
targetPath = '../ModelWithString.yml';
|
|
80
|
-
node_assert_1.default.strictEqual((0, getRelativeModelImportPath_1.getRelativeModelImportPath)(rootPath, sourcePath, targetPath), '../ModelWithString');
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pathHelpers.test.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__tests__/pathHelpers.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystem.d.ts","sourceRoot":"","sources":["../../../src/core/utils/fileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,IAAI,QAAQ,EAAE,QAAQ,IAAI,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAClH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,QAAA,MAAM,UAAU;;;;;;kBAMA,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;CAOrC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fileSystem = void 0;
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const mkdirp_1 = __importDefault(require("mkdirp"));
|
|
9
|
-
const rimraf_1 = __importDefault(require("rimraf"));
|
|
10
|
-
const util_1 = require("util");
|
|
11
|
-
const fileSystem = {
|
|
12
|
-
readFile: (0, util_1.promisify)(fs_1.readFile),
|
|
13
|
-
writeFile: (0, util_1.promisify)(fs_1.writeFile),
|
|
14
|
-
copyFile: (0, util_1.promisify)(fs_1.copyFile),
|
|
15
|
-
exists: (0, util_1.promisify)(fs_1.exists),
|
|
16
|
-
mkdir: mkdirp_1.default,
|
|
17
|
-
rmdir: (path) => new Promise((resolve, reject) => {
|
|
18
|
-
(0, rimraf_1.default)(path, (error) => {
|
|
19
|
-
if (error)
|
|
20
|
-
reject(error);
|
|
21
|
-
else
|
|
22
|
-
resolve();
|
|
23
|
-
});
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
|
-
exports.fileSystem = fileSystem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/core/utils/format.ts"],"names":[],"mappings":"AAEA,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB3D"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The function calculates the relative import path for model.
|
|
3
|
-
* @param rootPath Root folder path.
|
|
4
|
-
* @param sourcePath Import relative path.
|
|
5
|
-
* @param targetPath Model relative path.
|
|
6
|
-
* @returns Current relative model import path.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getRelativeModelImportPath(rootPath: string | undefined, sourcePath: string, targetPath: string): string;
|
|
9
|
-
//# sourceMappingURL=getRelativeModelImportPath.d.ts.map
|