ts-openapi-codegen 1.0.0-beta.8 → 1.0.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.
Files changed (332) hide show
  1. package/README.md +221 -123
  2. package/README.rus.md +725 -0
  3. package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts +12 -0
  4. package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -0
  5. package/dist/cli/checkAndUpdateConfig/checkConfig.js +66 -0
  6. package/dist/cli/checkAndUpdateConfig/constants.d.ts +13 -0
  7. package/dist/cli/checkAndUpdateConfig/constants.d.ts.map +1 -0
  8. package/dist/cli/checkAndUpdateConfig/constants.js +29 -0
  9. package/dist/cli/checkAndUpdateConfig/types.d.ts +20 -0
  10. package/dist/cli/checkAndUpdateConfig/types.d.ts.map +1 -0
  11. package/dist/cli/checkAndUpdateConfig/types.js +12 -0
  12. package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts +12 -0
  13. package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -0
  14. package/dist/cli/checkAndUpdateConfig/updateConfig.js +56 -0
  15. package/dist/cli/checkAndUpdateConfig/utils/generateConfigExample.d.ts +2 -0
  16. package/dist/cli/checkAndUpdateConfig/utils/generateConfigExample.d.ts.map +1 -0
  17. package/dist/cli/checkAndUpdateConfig/utils/generateConfigExample.js +11 -0
  18. package/dist/cli/checkAndUpdateConfig/utils/prepareConfigData.d.ts +14 -0
  19. package/dist/cli/checkAndUpdateConfig/utils/prepareConfigData.d.ts.map +1 -0
  20. package/dist/cli/checkAndUpdateConfig/utils/prepareConfigData.js +30 -0
  21. package/dist/cli/checkAndUpdateConfig/utils/removeDefaultConfigValues.d.ts +17 -0
  22. package/dist/cli/checkAndUpdateConfig/utils/removeDefaultConfigValues.d.ts.map +1 -0
  23. package/dist/cli/checkAndUpdateConfig/utils/removeDefaultConfigValues.js +29 -0
  24. package/dist/cli/checkAndUpdateConfig/utils/rewriteConfigFile.d.ts +2 -0
  25. package/dist/cli/checkAndUpdateConfig/utils/rewriteConfigFile.d.ts.map +1 -0
  26. package/dist/cli/checkAndUpdateConfig/utils/rewriteConfigFile.js +11 -0
  27. package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.d.ts +29 -0
  28. package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.d.ts.map +1 -0
  29. package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.js +49 -0
  30. package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.d.ts +6 -0
  31. package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.d.ts.map +1 -0
  32. package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.js +22 -0
  33. package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts +17 -0
  34. package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts.map +1 -0
  35. package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.js +53 -0
  36. package/dist/cli/checkAndUpdateConfig/utils/writeConfigFile.d.ts +34 -0
  37. package/dist/cli/checkAndUpdateConfig/utils/writeConfigFile.d.ts.map +1 -0
  38. package/dist/cli/checkAndUpdateConfig/utils/writeConfigFile.js +41 -0
  39. package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.d.ts +6 -0
  40. package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.d.ts.map +1 -0
  41. package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.js +18 -0
  42. package/dist/cli/generate/runGenerateOpenApi.d.ts +2 -2
  43. package/dist/cli/generate/runGenerateOpenApi.d.ts.map +1 -1
  44. package/dist/cli/generate/runGenerateOpenApi.js +12 -14
  45. package/dist/cli/index.d.ts +1 -0
  46. package/dist/cli/index.js +56 -30
  47. package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts.map +1 -1
  48. package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.js +11 -18
  49. package/dist/cli/interactive/confirmDialog.d.ts +17 -0
  50. package/dist/cli/interactive/confirmDialog.d.ts.map +1 -0
  51. package/dist/cli/interactive/confirmDialog.js +36 -0
  52. package/dist/cli/interactive/constants.d.ts +7 -0
  53. package/dist/cli/interactive/constants.d.ts.map +1 -0
  54. package/dist/cli/interactive/constants.js +25 -0
  55. package/dist/cli/interactive/selectDialog.d.ts +17 -0
  56. package/dist/cli/interactive/selectDialog.d.ts.map +1 -0
  57. package/dist/cli/interactive/selectDialog.js +43 -0
  58. package/dist/cli/interactive/types.d.ts +40 -0
  59. package/dist/cli/interactive/types.d.ts.map +1 -0
  60. package/dist/cli/interactive/types.js +12 -0
  61. package/dist/common/Consts.d.ts +23 -0
  62. package/dist/common/Consts.d.ts.map +1 -1
  63. package/dist/common/Consts.js +28 -1
  64. package/dist/common/Enums.d.ts +4 -0
  65. package/dist/common/Enums.d.ts.map +1 -1
  66. package/dist/common/Enums.js +6 -1
  67. package/dist/common/Logger.d.ts +1 -1
  68. package/dist/common/Logger.d.ts.map +1 -1
  69. package/dist/common/Logger.js +5 -38
  70. package/dist/common/UpdateNotifier.d.ts +36 -2
  71. package/dist/common/UpdateNotifier.d.ts.map +1 -1
  72. package/dist/common/UpdateNotifier.js +150 -57
  73. package/dist/common/VersionedSchema/Types.d.ts +5 -0
  74. package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
  75. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +1 -7
  76. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
  77. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts +3 -0
  78. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts.map +1 -0
  79. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.js +14 -0
  80. package/dist/common/VersionedSchema/Utils/getKeyByMapValue.d.ts +2 -0
  81. package/dist/common/VersionedSchema/Utils/getKeyByMapValue.d.ts.map +1 -0
  82. package/dist/common/VersionedSchema/Utils/getKeyByMapValue.js +11 -0
  83. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +5 -2
  84. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
  85. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +22 -15
  86. package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts.map +1 -0
  87. package/dist/common/utils/__tests__/convertArrayToObject.test.d.ts.map +1 -0
  88. package/dist/common/{__tests__ → utils/__tests__}/convertArrayToObject.test.js +14 -14
  89. package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +1 -0
  90. package/dist/common/{__tests__ → utils/__tests__}/determineBestMatchingSchemaVersion.test.js +5 -5
  91. package/dist/common/utils/__tests__/generateKeyMappingForInvalidKeys.test.d.ts.map +1 -0
  92. package/dist/common/{__tests__ → utils/__tests__}/generateKeyMappingForInvalidKeys.test.js +4 -4
  93. package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +1 -0
  94. package/dist/common/{__tests__ → utils/__tests__}/getUniqueKeysFromSchemas.test.js +4 -4
  95. package/dist/common/utils/__tests__/getUniqueObjectKeys.test.d.ts.map +1 -0
  96. package/dist/common/{__tests__ → utils/__tests__}/getUniqueObjectKeys.test.js +5 -5
  97. package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts.map +1 -0
  98. package/dist/common/{__tests__ → utils/__tests__}/mergeObjectSchemas.test.js +5 -5
  99. package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts.map +1 -0
  100. package/dist/common/{__tests__ → utils/__tests__}/migrationForMultiOptions.test.js +21 -15
  101. package/dist/common/utils/__tests__/migrationForOptions.test.d.ts.map +1 -0
  102. package/dist/common/{__tests__ → utils/__tests__}/migrationForOptions.test.js +13 -9
  103. package/dist/common/utils/__tests__/pathHelpers.test.d.ts.map +1 -0
  104. package/dist/{core → common}/utils/__tests__/pathHelpers.test.js +8 -8
  105. package/dist/common/utils/__tests__/replaceInvalidKeysWithMappedNames.test.d.ts.map +1 -0
  106. package/dist/common/{__tests__ → utils/__tests__}/replaceInvalidKeysWithMappedNames.test.js +5 -5
  107. package/dist/common/utils/__tests__/validateAndSuggestKeyCorrections.test.d.ts.map +1 -0
  108. package/dist/common/{__tests__ → utils/__tests__}/validateAndSuggestKeyCorrections.test.js +5 -5
  109. package/dist/common/utils/convertArrayToObject.d.ts +2 -0
  110. package/dist/common/utils/convertArrayToObject.d.ts.map +1 -0
  111. package/dist/common/{Utils.js → utils/convertArrayToObject.js} +0 -20
  112. package/dist/{core/utils/fileSystem.d.ts → common/utils/fileSystemHelpers.d.ts} +8 -5
  113. package/dist/common/utils/fileSystemHelpers.d.ts.map +1 -0
  114. package/dist/common/utils/fileSystemHelpers.js +85 -0
  115. package/dist/common/utils/format.d.ts +3 -0
  116. package/dist/common/utils/format.d.ts.map +1 -0
  117. package/dist/{core → common}/utils/format.js +2 -2
  118. package/dist/common/utils/loadConfigIfExists.d.ts +2 -0
  119. package/dist/common/utils/loadConfigIfExists.d.ts.map +1 -0
  120. package/dist/common/utils/loadConfigIfExists.js +22 -0
  121. package/dist/common/utils/pathHelpers.d.ts +6 -0
  122. package/dist/common/utils/pathHelpers.d.ts.map +1 -0
  123. package/dist/{core → common}/utils/pathHelpers.js +16 -20
  124. package/dist/common/utils/safeHasOwn.d.ts +2 -0
  125. package/dist/common/utils/safeHasOwn.d.ts.map +1 -0
  126. package/dist/common/utils/safeHasOwn.js +9 -0
  127. package/dist/core/Context.d.ts.map +1 -1
  128. package/dist/core/Context.js +3 -3
  129. package/dist/core/WriteClient.d.ts.map +1 -1
  130. package/dist/core/WriteClient.js +18 -18
  131. package/dist/core/__tests__/WriteClient.test.js +61 -60
  132. package/dist/core/api/v2/Parser.d.ts.map +1 -1
  133. package/dist/core/api/v2/Parser.js +2 -9
  134. package/dist/core/api/v2/parser/__tests__/getServer.test.js +2 -2
  135. package/dist/core/api/v2/parser/__tests__/getType.test.js +3 -3
  136. package/dist/core/api/v2/parser/getModelProperties.d.ts.map +1 -1
  137. package/dist/core/api/v2/parser/getModelProperties.js +2 -5
  138. package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
  139. package/dist/core/api/v2/parser/getModels.js +2 -1
  140. package/dist/core/api/v2/parser/getOperationParameter.d.ts.map +1 -1
  141. package/dist/core/api/v2/parser/getOperationParameter.js +2 -1
  142. package/dist/core/api/v2/parser/getOperationResponse.d.ts.map +1 -1
  143. package/dist/core/api/v2/parser/getOperationResponse.js +2 -5
  144. package/dist/core/api/v2/parser/getOperationResponses.d.ts.map +1 -1
  145. package/dist/core/api/v2/parser/getOperationResponses.js +2 -5
  146. package/dist/core/api/v2/parser/getServices.d.ts.map +1 -1
  147. package/dist/core/api/v2/parser/getServices.js +2 -5
  148. package/dist/core/api/v2/parser/getType.js +4 -4
  149. package/dist/core/api/v3/Parser.d.ts +1 -1
  150. package/dist/core/api/v3/Parser.d.ts.map +1 -1
  151. package/dist/core/api/v3/Parser.js +2 -9
  152. package/dist/core/api/v3/parser/__tests__/getServer.test.js +3 -3
  153. package/dist/core/api/v3/parser/__tests__/getType.test.js +3 -3
  154. package/dist/core/api/v3/parser/getModelProperties.d.ts.map +1 -1
  155. package/dist/core/api/v3/parser/getModelProperties.js +2 -5
  156. package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
  157. package/dist/core/api/v3/parser/getModels.js +2 -1
  158. package/dist/core/api/v3/parser/getOperationResponse.d.ts.map +1 -1
  159. package/dist/core/api/v3/parser/getOperationResponse.js +2 -5
  160. package/dist/core/api/v3/parser/getOperationResponses.d.ts.map +1 -1
  161. package/dist/core/api/v3/parser/getOperationResponses.js +2 -5
  162. package/dist/core/api/v3/parser/getServer.d.ts.map +1 -1
  163. package/dist/core/api/v3/parser/getServer.js +2 -5
  164. package/dist/core/api/v3/parser/getServices.d.ts.map +1 -1
  165. package/dist/core/api/v3/parser/getServices.js +2 -5
  166. package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
  167. package/dist/core/api/v3/parser/getType.js +5 -13
  168. package/dist/core/index.d.ts +4 -0
  169. package/dist/core/index.d.ts.map +1 -1
  170. package/dist/core/index.js +34 -27
  171. package/dist/core/types/Consts.d.ts +5 -1
  172. package/dist/core/types/Consts.d.ts.map +1 -1
  173. package/dist/core/types/Consts.js +6 -2
  174. package/dist/core/types/base/Root.model.d.ts +1 -0
  175. package/dist/core/types/base/Root.model.d.ts.map +1 -1
  176. package/dist/core/utils/__tests__/escapeDescription.test.js +3 -3
  177. package/dist/core/utils/__tests__/escapeName.test.js +2 -2
  178. package/dist/core/utils/__tests__/flatMap.test.js +2 -2
  179. package/dist/core/utils/__tests__/getAbsolutePath.test.js +6 -6
  180. package/dist/core/utils/__tests__/getClassName.test.js +2 -2
  181. package/dist/core/utils/__tests__/getComment.test.js +2 -2
  182. package/dist/core/utils/__tests__/getEnumFromDescription.test.js +2 -2
  183. package/dist/core/utils/__tests__/getFileName.test.js +2 -2
  184. package/dist/core/utils/__tests__/getGatheringRefs.test.js +2 -2
  185. package/dist/core/utils/__tests__/getMappedType.test.js +2 -2
  186. package/dist/core/utils/__tests__/getModelNames.test.js +2 -2
  187. package/dist/core/utils/__tests__/getOpenApiVersion.test.js +2 -2
  188. package/dist/core/utils/__tests__/getOperationName.test.js +2 -2
  189. package/dist/core/utils/__tests__/getOperationParameterName.test.js +2 -2
  190. package/dist/core/utils/__tests__/getOperationPath.test.js +2 -2
  191. package/dist/core/utils/__tests__/getOperationResponseCode.test.js +2 -2
  192. package/dist/core/utils/__tests__/getPattern.test.js +2 -2
  193. package/dist/core/utils/__tests__/getRefFromSchema.test.js +2 -2
  194. package/dist/core/utils/__tests__/getRefs.test.js +2 -2
  195. package/dist/core/utils/__tests__/getRelativeModelPath.test.js +3 -3
  196. package/dist/core/utils/__tests__/getServiceClassName.test.js +2 -2
  197. package/dist/core/utils/__tests__/getServiceNames.test.js +2 -2
  198. package/dist/core/utils/__tests__/getServiceVersion.test.js +2 -2
  199. package/dist/core/utils/__tests__/isString.test.js +2 -2
  200. package/dist/core/utils/__tests__/isSubdirectory.test.js +10 -10
  201. package/dist/core/utils/__tests__/registerHandlebarHelpers.test.js +2 -2
  202. package/dist/core/utils/__tests__/registerHandlebarTemplates.test.js +2 -2
  203. package/dist/core/utils/__tests__/replaceString.test.js +2 -2
  204. package/dist/core/utils/__tests__/resolveRefToImportPath.test.js +360 -51
  205. package/dist/core/utils/__tests__/sort.test.js +2 -2
  206. package/dist/core/utils/__tests__/sortByRequiredExtended.test.js +11 -11
  207. package/dist/core/utils/__tests__/sortByRequiredSimple.test.js +11 -11
  208. package/dist/core/utils/__tests__/sortModelsByName.test.js +2 -2
  209. package/dist/core/utils/__tests__/sortServicesByName.test.js +2 -2
  210. package/dist/core/utils/__tests__/stripNamespace.test.js +2 -2
  211. package/dist/core/utils/__tests__/unique.test.js +2 -2
  212. package/dist/core/utils/__tests__/writeClientCore.test.js +52 -50
  213. package/dist/core/utils/__tests__/writeClientFullIndex.test.js +39 -37
  214. package/dist/core/utils/__tests__/writeClientModels.test.js +65 -63
  215. package/dist/core/utils/__tests__/writeClientSchemas.test.js +65 -63
  216. package/dist/core/utils/__tests__/writeClientServices.test.js +60 -58
  217. package/dist/core/utils/appendUniqueLinesToFile.js +4 -4
  218. package/dist/core/utils/createNormalizedRef.js +2 -2
  219. package/dist/core/utils/getAbsolutePath.js +3 -3
  220. package/dist/core/utils/getModelNameWithPrefix.d.ts +3 -0
  221. package/dist/core/utils/getModelNameWithPrefix.d.ts.map +1 -0
  222. package/dist/core/utils/getModelNameWithPrefix.js +15 -0
  223. package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
  224. package/dist/core/utils/getOpenApiSpec.js +4 -4
  225. package/dist/core/utils/getOutputPaths.d.ts.map +1 -1
  226. package/dist/core/utils/getOutputPaths.js +6 -6
  227. package/dist/core/utils/getPattern.d.ts.map +1 -1
  228. package/dist/core/utils/getPattern.js +2 -1
  229. package/dist/core/utils/getRelativeModelPath.d.ts.map +1 -1
  230. package/dist/core/utils/getRelativeModelPath.js +2 -6
  231. package/dist/core/utils/isSubdirectory.d.ts.map +1 -1
  232. package/dist/core/utils/isSubdirectory.js +4 -3
  233. package/dist/core/utils/mapPathToTargetDirSafe.d.ts.map +1 -1
  234. package/dist/core/utils/mapPathToTargetDirSafe.js +11 -12
  235. package/dist/core/utils/modelHelpers.d.ts.map +1 -1
  236. package/dist/core/utils/modelHelpers.js +18 -6
  237. package/dist/core/utils/normalizeString.d.ts +2 -0
  238. package/dist/core/utils/normalizeString.d.ts.map +1 -0
  239. package/dist/core/utils/normalizeString.js +14 -0
  240. package/dist/core/utils/normalizedAbsolutePath.js +3 -3
  241. package/dist/core/utils/parseRef.d.ts.map +1 -1
  242. package/dist/core/utils/parseRef.js +7 -10
  243. package/dist/core/utils/precompileTemplates.js +14 -10
  244. package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
  245. package/dist/core/utils/registerHandlebarHelpers.js +24 -0
  246. package/dist/core/utils/replaceString.d.ts.map +1 -1
  247. package/dist/core/utils/replaceString.js +2 -1
  248. package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
  249. package/dist/core/utils/resolveRefPath.js +3 -3
  250. package/dist/core/utils/resolveRefToImportPath.d.ts +8 -2
  251. package/dist/core/utils/resolveRefToImportPath.d.ts.map +1 -1
  252. package/dist/core/utils/resolveRefToImportPath.js +91 -31
  253. package/dist/core/utils/serviceHelpers.d.ts.map +1 -1
  254. package/dist/core/utils/serviceHelpers.js +2 -1
  255. package/dist/core/utils/stripNamespace.js +5 -5
  256. package/dist/core/utils/writeClientCore.d.ts.map +1 -1
  257. package/dist/core/utils/writeClientCore.js +12 -12
  258. package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
  259. package/dist/core/utils/writeClientCoreIndex.js +2 -2
  260. package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
  261. package/dist/core/utils/writeClientFullIndex.js +4 -4
  262. package/dist/core/utils/writeClientModels.d.ts.map +1 -1
  263. package/dist/core/utils/writeClientModels.js +7 -7
  264. package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
  265. package/dist/core/utils/writeClientModelsIndex.js +2 -2
  266. package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
  267. package/dist/core/utils/writeClientSchemas.js +7 -7
  268. package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -1
  269. package/dist/core/utils/writeClientSchemasIndex.js +2 -2
  270. package/dist/core/utils/writeClientServices.d.ts.map +1 -1
  271. package/dist/core/utils/writeClientServices.js +5 -5
  272. package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -1
  273. package/dist/core/utils/writeClientServicesIndex.js +2 -2
  274. package/dist/core/utils/writeClientSimpleIndex.d.ts.map +1 -1
  275. package/dist/core/utils/writeClientSimpleIndex.js +4 -4
  276. package/dist/templatesCompiled/client/exportModel.js +4 -4
  277. package/dist/templatesCompiled/client/exportService.d.ts.map +1 -1
  278. package/dist/templatesCompiled/client/exportService.js +12 -13
  279. package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
  280. package/dist/templatesCompiled/client/indexFull.js +35 -29
  281. package/dist/templatesCompiled/client/partials/parameters.d.ts +3 -2
  282. package/dist/templatesCompiled/client/partials/parameters.d.ts.map +1 -1
  283. package/dist/templatesCompiled/client/partials/parameters.js +25 -20
  284. package/dist/templatesCompiled/client/partials/parametersDefinition.d.ts +4 -2
  285. package/dist/templatesCompiled/client/partials/parametersDefinition.d.ts.map +1 -1
  286. package/dist/templatesCompiled/client/partials/parametersDefinition.js +31 -10
  287. package/package.json +15 -13
  288. package/dist/cli/chekOpenApiConfig/chekOpenApiConfig.d.ts +0 -5
  289. package/dist/cli/chekOpenApiConfig/chekOpenApiConfig.d.ts.map +0 -1
  290. package/dist/cli/chekOpenApiConfig/chekOpenApiConfig.js +0 -45
  291. package/dist/common/Utils.d.ts +0 -3
  292. package/dist/common/Utils.d.ts.map +0 -1
  293. package/dist/common/__tests__/__mock__/mockJoiSchema.d.ts.map +0 -1
  294. package/dist/common/__tests__/convertArrayToObject.test.d.ts.map +0 -1
  295. package/dist/common/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +0 -1
  296. package/dist/common/__tests__/generateKeyMappingForInvalidKeys.test.d.ts.map +0 -1
  297. package/dist/common/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +0 -1
  298. package/dist/common/__tests__/getUniqueObjectKeys.test.d.ts.map +0 -1
  299. package/dist/common/__tests__/mergeObjectSchemas.test.d.ts.map +0 -1
  300. package/dist/common/__tests__/migrationForMultiOptions.test.d.ts.map +0 -1
  301. package/dist/common/__tests__/migrationForOptions.test.d.ts.map +0 -1
  302. package/dist/common/__tests__/replaceInvalidKeysWithMappedNames.test.d.ts.map +0 -1
  303. package/dist/common/__tests__/validateAndSuggestKeyCorrections.test.d.ts.map +0 -1
  304. package/dist/core/utils/__tests__/getRelativeModelImportPath.test.d.ts +0 -2
  305. package/dist/core/utils/__tests__/getRelativeModelImportPath.test.d.ts.map +0 -1
  306. package/dist/core/utils/__tests__/getRelativeModelImportPath.test.js +0 -82
  307. package/dist/core/utils/__tests__/pathHelpers.test.d.ts.map +0 -1
  308. package/dist/core/utils/fileSystem.d.ts.map +0 -1
  309. package/dist/core/utils/fileSystem.js +0 -26
  310. package/dist/core/utils/format.d.ts +0 -2
  311. package/dist/core/utils/format.d.ts.map +0 -1
  312. package/dist/core/utils/getRelativeModelImportPath.d.ts +0 -9
  313. package/dist/core/utils/getRelativeModelImportPath.d.ts.map +0 -1
  314. package/dist/core/utils/getRelativeModelImportPath.js +0 -45
  315. package/dist/core/utils/isDirectory.d.ts +0 -2
  316. package/dist/core/utils/isDirectory.d.ts.map +0 -1
  317. package/dist/core/utils/isDirectory.js +0 -13
  318. package/dist/core/utils/pathHelpers.d.ts +0 -7
  319. package/dist/core/utils/pathHelpers.d.ts.map +0 -1
  320. /package/dist/common/{__tests__ → utils/__tests__}/__mock__/mockJoiSchema.d.ts +0 -0
  321. /package/dist/common/{__tests__ → utils/__tests__}/__mock__/mockJoiSchema.js +0 -0
  322. /package/dist/common/{__tests__ → utils/__tests__}/convertArrayToObject.test.d.ts +0 -0
  323. /package/dist/common/{__tests__ → utils/__tests__}/determineBestMatchingSchemaVersion.test.d.ts +0 -0
  324. /package/dist/common/{__tests__ → utils/__tests__}/generateKeyMappingForInvalidKeys.test.d.ts +0 -0
  325. /package/dist/common/{__tests__ → utils/__tests__}/getUniqueKeysFromSchemas.test.d.ts +0 -0
  326. /package/dist/common/{__tests__ → utils/__tests__}/getUniqueObjectKeys.test.d.ts +0 -0
  327. /package/dist/common/{__tests__ → utils/__tests__}/mergeObjectSchemas.test.d.ts +0 -0
  328. /package/dist/common/{__tests__ → utils/__tests__}/migrationForMultiOptions.test.d.ts +0 -0
  329. /package/dist/common/{__tests__ → utils/__tests__}/migrationForOptions.test.d.ts +0 -0
  330. /package/dist/{core → common}/utils/__tests__/pathHelpers.test.d.ts +0 -0
  331. /package/dist/common/{__tests__ → utils/__tests__}/replaceInvalidKeysWithMappedNames.test.d.ts +0 -0
  332. /package/dist/common/{__tests__ → utils/__tests__}/validateAndSuggestKeyCorrections.test.d.ts +0 -0
@@ -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
- }
@@ -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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=getRelativeModelImportPath.test.d.ts.map
@@ -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,2 +0,0 @@
1
- export declare function format(input: string): Promise<string>;
2
- //# sourceMappingURL=format.d.ts.map
@@ -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
@@ -1 +0,0 @@
1
- {"version":3,"file":"getRelativeModelImportPath.d.ts","sourceRoot":"","sources":["../../../src/core/utils/getRelativeModelImportPath.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UA+B9G"}
@@ -1,45 +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.getRelativeModelImportPath = getRelativeModelImportPath;
7
- const path_1 = __importDefault(require("path"));
8
- const getRelativeModelPath_1 = require("./getRelativeModelPath");
9
- const isInsideDirectory_1 = require("./isInsideDirectory");
10
- const normalizedAbsolutePath_1 = require("./normalizedAbsolutePath");
11
- const replaceString_1 = require("./replaceString");
12
- const stripNamespace_1 = require("./stripNamespace");
13
- /**
14
- * The function calculates the relative import path for model.
15
- * @param rootPath Root folder path.
16
- * @param sourcePath Import relative path.
17
- * @param targetPath Model relative path.
18
- * @returns Current relative model import path.
19
- */
20
- function getRelativeModelImportPath(rootPath, sourcePath, targetPath) {
21
- if (!rootPath) {
22
- const normalizedValue = (0, replaceString_1.replaceString)(targetPath);
23
- return (0, stripNamespace_1.stripNamespace)(normalizedValue || '');
24
- }
25
- const absoluteRoot = (0, normalizedAbsolutePath_1.normalizedAbsolutePath)(rootPath);
26
- const normalizedSourcePath = (0, stripNamespace_1.stripNamespace)(sourcePath);
27
- let absSourcePath = (0, normalizedAbsolutePath_1.normalizedAbsolutePath)(path_1.default.resolve(absoluteRoot, normalizedSourcePath));
28
- if (!(0, isInsideDirectory_1.isInsideDirectory)(absSourcePath, absoluteRoot)) {
29
- const sourceRelativePath = (0, getRelativeModelPath_1.getRelativeModelPath)(absoluteRoot, sourcePath);
30
- absSourcePath = path_1.default.resolve(absoluteRoot, sourceRelativePath);
31
- }
32
- const absSourceDir = normalizedSourcePath ? path_1.default.dirname(absSourcePath) : absoluteRoot;
33
- let absTargetPath = path_1.default.isAbsolute(targetPath) ? targetPath : path_1.default.resolve(absSourceDir, targetPath);
34
- if (!(0, isInsideDirectory_1.isInsideDirectory)(absTargetPath, rootPath)) {
35
- const targetRelativePath = (0, getRelativeModelPath_1.getRelativeModelPath)(absoluteRoot, targetPath);
36
- absTargetPath = path_1.default.resolve(absoluteRoot, targetRelativePath);
37
- }
38
- let relativePath = path_1.default.relative(absSourceDir, absTargetPath);
39
- relativePath = (0, replaceString_1.replaceString)(relativePath) || '';
40
- let normalizedValue = (0, stripNamespace_1.stripNamespace)(relativePath);
41
- if (!normalizedValue.startsWith('.') && !normalizedValue.startsWith('/')) {
42
- normalizedValue = `./${normalizedValue}`;
43
- }
44
- return normalizedValue;
45
- }
@@ -1,2 +0,0 @@
1
- export declare function isDirectory(path: string): boolean;
2
- //# sourceMappingURL=isDirectory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isDirectory.d.ts","sourceRoot":"","sources":["../../../src/core/utils/isDirectory.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMjD"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDirectory = isDirectory;
4
- const fs_1 = require("fs");
5
- const pathHelpers_1 = require("./pathHelpers");
6
- function isDirectory(path) {
7
- try {
8
- return (0, fs_1.statSync)((0, pathHelpers_1.normalize)(path)).isDirectory();
9
- }
10
- catch {
11
- return false;
12
- }
13
- }
@@ -1,7 +0,0 @@
1
- export declare function dirName(p: string): string;
2
- export declare function join(...paths: string[]): string;
3
- export declare function relative(from: string, to: string): string;
4
- export declare function resolve(...pathSegments: string[]): string;
5
- export declare function normalize(p: string): string;
6
- export declare function joinToDir(parentFilePath: string, fileName: string): string;
7
- //# sourceMappingURL=pathHelpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/pathHelpers.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAyBzD;AAED,wBAAgB,OAAO,CAAC,GAAG,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1E"}