@language-weaver/lw-sdk-js 1.1.0 → 2.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 (426) hide show
  1. package/lib/common/constants/ApprovalStatus.d.ts +1 -1
  2. package/lib/common/constants/ApprovalStatus.js.map +1 -1
  3. package/lib/{translation/feedback/cloud/model → common/constants}/CloudFeedbackSortCriteria.d.ts +0 -0
  4. package/lib/{translation/feedback/cloud/model → common/constants}/CloudFeedbackSortCriteria.js +0 -0
  5. package/lib/common/constants/CloudFeedbackSortCriteria.js.map +1 -0
  6. package/lib/common/constants/Format.d.ts +1 -1
  7. package/lib/common/constants/Format.js +4 -1
  8. package/lib/common/constants/Format.js.map +1 -1
  9. package/lib/common/constants/FormatToMimeType.js +2 -0
  10. package/lib/common/constants/FormatToMimeType.js.map +1 -1
  11. package/lib/common/constants/PdfConverter.d.ts +15 -0
  12. package/lib/common/constants/PdfConverter.js +22 -0
  13. package/lib/common/constants/PdfConverter.js.map +1 -0
  14. package/lib/common/constants/QualityEstimation.d.ts +6 -0
  15. package/lib/common/constants/QualityEstimation.js +17 -0
  16. package/lib/common/constants/QualityEstimation.js.map +1 -0
  17. package/lib/common/constants/Statuses.d.ts +6 -0
  18. package/lib/common/constants/Statuses.js +7 -1
  19. package/lib/common/constants/Statuses.js.map +1 -1
  20. package/lib/common/constants/TranslationConstants.d.ts +20 -3
  21. package/lib/common/constants/TranslationConstants.js +25 -5
  22. package/lib/common/constants/TranslationConstants.js.map +1 -1
  23. package/lib/common/exceptions/ContentInsightsException.d.ts +4 -0
  24. package/lib/common/exceptions/ContentInsightsException.js +17 -0
  25. package/lib/common/exceptions/ContentInsightsException.js.map +1 -0
  26. package/lib/common/external/communication/RestClient.d.ts +1 -1
  27. package/lib/common/external/communication/RestClient.js +14 -16
  28. package/lib/common/external/communication/RestClient.js.map +1 -1
  29. package/lib/common/utils/HttpUtils.d.ts +1 -0
  30. package/lib/common/utils/HttpUtils.js +13 -0
  31. package/lib/common/utils/HttpUtils.js.map +1 -1
  32. package/lib/common/utils/Utils.d.ts +7 -0
  33. package/lib/common/utils/Utils.js +127 -0
  34. package/lib/common/utils/Utils.js.map +1 -1
  35. package/lib/index.d.ts +62 -19
  36. package/lib/index.js +104 -20
  37. package/lib/index.js.map +1 -1
  38. package/lib/translation/common/LanguageWeaverClient.d.ts +19 -2
  39. package/lib/translation/common/cloud/CloudLanguageWeaverClient.d.ts +45 -4
  40. package/lib/translation/common/cloud/CloudLanguageWeaverClient.js +239 -100
  41. package/lib/translation/common/cloud/CloudLanguageWeaverClient.js.map +1 -1
  42. package/lib/translation/common/edge/EdgeLanguageWeaverClient.d.ts +43 -6
  43. package/lib/translation/common/edge/EdgeLanguageWeaverClient.js +287 -150
  44. package/lib/translation/common/edge/EdgeLanguageWeaverClient.js.map +1 -1
  45. package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.d.ts +1 -1
  46. package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.js +1 -1
  47. package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.js.map +1 -1
  48. package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.d.ts +23 -0
  49. package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.js +69 -0
  50. package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.js.map +1 -0
  51. package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.d.ts +10 -0
  52. package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.js +39 -0
  53. package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.js.map +1 -0
  54. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.d.ts +12 -0
  55. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.js +32 -0
  56. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.js.map +1 -0
  57. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.d.ts +16 -0
  58. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.js +42 -0
  59. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.js.map +1 -0
  60. package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.d.ts +12 -0
  61. package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.js +39 -0
  62. package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.js.map +1 -0
  63. package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.d.ts +15 -0
  64. package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.js +57 -0
  65. package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.js.map +1 -0
  66. package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.d.ts +13 -0
  67. package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.js +46 -0
  68. package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.js.map +1 -0
  69. package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.d.ts +3 -0
  70. package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.js +30 -0
  71. package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.js.map +1 -0
  72. package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.d.ts +8 -0
  73. package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.js +29 -0
  74. package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.js.map +1 -0
  75. package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.d.ts +16 -0
  76. package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.js +49 -0
  77. package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.js.map +1 -0
  78. package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.d.ts +8 -0
  79. package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.js +29 -0
  80. package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.js.map +1 -0
  81. package/lib/translation/content-insights/cloud/result/CloudSegment.d.ts +6 -0
  82. package/lib/translation/content-insights/cloud/result/CloudSegment.js +40 -0
  83. package/lib/translation/content-insights/cloud/result/CloudSegment.js.map +1 -0
  84. package/lib/translation/content-insights/cloud/result/CloudSummarization.d.ts +6 -0
  85. package/lib/translation/content-insights/cloud/result/CloudSummarization.js +19 -0
  86. package/lib/translation/content-insights/cloud/result/CloudSummarization.js.map +1 -0
  87. package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.d.ts +20 -0
  88. package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.js +248 -0
  89. package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.js.map +1 -0
  90. package/lib/translation/content-insights/common/request/ContentInsightsRequest.d.ts +7 -0
  91. package/lib/translation/content-insights/common/request/ContentInsightsRequest.js +23 -0
  92. package/lib/translation/content-insights/common/request/ContentInsightsRequest.js.map +1 -0
  93. package/lib/translation/content-insights/common/result/ContentInsightsResult.d.ts +6 -0
  94. package/lib/translation/content-insights/common/result/ContentInsightsResult.js +19 -0
  95. package/lib/translation/content-insights/common/result/ContentInsightsResult.js.map +1 -0
  96. package/lib/translation/content-insights/common/result/Segment.d.ts +8 -0
  97. package/lib/translation/content-insights/common/result/Segment.js +29 -0
  98. package/lib/translation/content-insights/common/result/Segment.js.map +1 -0
  99. package/lib/translation/content-insights/common/result/Summarization.d.ts +8 -0
  100. package/lib/translation/content-insights/common/result/Summarization.js +25 -0
  101. package/lib/translation/content-insights/common/result/Summarization.js.map +1 -0
  102. package/lib/translation/content-insights/common/utils/ContentInsightsUtils.d.ts +4 -0
  103. package/lib/translation/content-insights/common/utils/ContentInsightsUtils.js +145 -0
  104. package/lib/translation/content-insights/common/utils/ContentInsightsUtils.js.map +1 -0
  105. package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.d.ts +13 -0
  106. package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.js +53 -0
  107. package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.js.map +1 -0
  108. package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.d.ts +12 -0
  109. package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.js +46 -0
  110. package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.js.map +1 -0
  111. package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.d.ts +5 -0
  112. package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.js +19 -0
  113. package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.js.map +1 -0
  114. package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.d.ts +9 -0
  115. package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.js +29 -0
  116. package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.js.map +1 -0
  117. package/lib/translation/content-insights/edge/result/EdgeSegment.d.ts +3 -0
  118. package/lib/translation/content-insights/edge/result/EdgeSegment.js +30 -0
  119. package/lib/translation/content-insights/edge/result/EdgeSegment.js.map +1 -0
  120. package/lib/translation/content-insights/edge/result/EdgeSummarization.d.ts +6 -0
  121. package/lib/translation/content-insights/edge/result/EdgeSummarization.js +19 -0
  122. package/lib/translation/content-insights/edge/result/EdgeSummarization.js.map +1 -0
  123. package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.d.ts +14 -0
  124. package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.js +96 -0
  125. package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.js.map +1 -0
  126. package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.d.ts +14 -0
  127. package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.js +72 -0
  128. package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.js.map +1 -0
  129. package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.d.ts +36 -0
  130. package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.js +136 -0
  131. package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.js.map +1 -0
  132. package/lib/translation/{translate → dictionaries}/cloud/result/CloudDictionariesResult.d.ts +3 -3
  133. package/lib/translation/{translate → dictionaries}/cloud/result/CloudDictionariesResult.js +0 -0
  134. package/lib/translation/dictionaries/cloud/result/CloudDictionariesResult.js.map +1 -0
  135. package/lib/translation/{translate/cloud/api/CloudDictionaryResponse.d.ts → dictionaries/cloud/result/CloudDictionary.d.ts} +1 -1
  136. package/lib/translation/{translate/cloud/api/CloudDictionaryResponse.js → dictionaries/cloud/result/CloudDictionary.js} +15 -15
  137. package/lib/translation/dictionaries/cloud/result/CloudDictionary.js.map +1 -0
  138. package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.d.ts +15 -0
  139. package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.js +51 -0
  140. package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.js.map +1 -0
  141. package/lib/translation/dictionaries/common/result/DictionariesResult.d.ts +7 -0
  142. package/lib/translation/{translate → dictionaries}/common/result/DictionariesResult.js +0 -0
  143. package/lib/translation/dictionaries/common/result/DictionariesResult.js.map +1 -0
  144. package/lib/translation/{translate/common/api/DictionaryResponse.d.ts → dictionaries/common/result/Dictionary.d.ts} +1 -1
  145. package/lib/translation/{translate/common/api/DictionaryResponse.js → dictionaries/common/result/Dictionary.js} +8 -8
  146. package/lib/translation/dictionaries/common/result/Dictionary.js.map +1 -0
  147. package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.d.ts +22 -0
  148. package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.js +84 -0
  149. package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.js.map +1 -0
  150. package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.d.ts +15 -0
  151. package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.js +58 -0
  152. package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.js.map +1 -0
  153. package/lib/translation/{translate → dictionaries}/edge/result/EdgeDictionariesResult.d.ts +3 -3
  154. package/lib/translation/{translate → dictionaries}/edge/result/EdgeDictionariesResult.js +0 -0
  155. package/lib/translation/dictionaries/edge/result/EdgeDictionariesResult.js.map +1 -0
  156. package/lib/translation/{translate/edge/api/EdgeDictionaryResponse.d.ts → dictionaries/edge/result/EdgeDictionary.d.ts} +1 -1
  157. package/lib/translation/{translate/edge/api/EdgeDictionaryResponse.js → dictionaries/edge/result/EdgeDictionary.js} +8 -8
  158. package/lib/translation/dictionaries/edge/result/EdgeDictionary.js.map +1 -0
  159. package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.d.ts +12 -0
  160. package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.js +51 -0
  161. package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.js.map +1 -0
  162. package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.d.ts +4 -3
  163. package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.js +28 -23
  164. package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.js.map +1 -1
  165. package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalListUpdateRequest.d.ts +7 -0
  166. package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalListUpdateRequest.js +24 -0
  167. package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalListUpdateRequest.js.map +1 -0
  168. package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalUpdateRequest.d.ts +9 -0
  169. package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalUpdateRequest.js +31 -0
  170. package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalUpdateRequest.js.map +1 -0
  171. package/lib/translation/feedback/cloud/api/CloudFeedbackImprovement.d.ts +1 -1
  172. package/lib/translation/feedback/cloud/api/CloudFeedbackImprovement.js.map +1 -1
  173. package/lib/translation/feedback/cloud/api/CloudFeedbackRating.js +6 -1
  174. package/lib/translation/feedback/cloud/api/CloudFeedbackRating.js.map +1 -1
  175. package/lib/translation/feedback/cloud/api/CloudFilterFeedbackApiRequest.js +4 -4
  176. package/lib/translation/feedback/cloud/api/CloudFilterFeedbackApiRequest.js.map +1 -1
  177. package/lib/translation/feedback/cloud/api/CloudTranslationFeedback.d.ts +3 -0
  178. package/lib/translation/feedback/cloud/api/CloudTranslationFeedback.js +10 -0
  179. package/lib/translation/feedback/cloud/api/CloudTranslationFeedback.js.map +1 -1
  180. package/lib/translation/feedback/cloud/request/CloudCreateFeedbackRequest.d.ts +21 -0
  181. package/lib/translation/feedback/cloud/request/CloudCreateFeedbackRequest.js +104 -0
  182. package/lib/translation/feedback/cloud/request/CloudCreateFeedbackRequest.js.map +1 -0
  183. package/lib/translation/feedback/cloud/request/CloudDeleteFeedbackRequest.d.ts +3 -0
  184. package/lib/translation/feedback/cloud/request/CloudDeleteFeedbackRequest.js +30 -0
  185. package/lib/translation/feedback/cloud/request/CloudDeleteFeedbackRequest.js.map +1 -0
  186. package/lib/translation/feedback/cloud/request/CloudFeedbackSortRequest.d.ts +1 -1
  187. package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackApprovalRequest.d.ts +3 -0
  188. package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackApprovalRequest.js +30 -0
  189. package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackApprovalRequest.js.map +1 -0
  190. package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackRequest.d.ts +15 -0
  191. package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackRequest.js +77 -0
  192. package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackRequest.js.map +1 -0
  193. package/lib/translation/feedback/cloud/{model → result}/CloudAuditData.d.ts +1 -1
  194. package/lib/translation/feedback/cloud/{model → result}/CloudAuditData.js +1 -1
  195. package/lib/translation/feedback/cloud/result/CloudAuditData.js.map +1 -0
  196. package/lib/translation/feedback/cloud/result/CloudFeedbackResult.d.ts +7 -3
  197. package/lib/translation/feedback/cloud/result/CloudFeedbackResult.js +10 -0
  198. package/lib/translation/feedback/cloud/result/CloudFeedbackResult.js.map +1 -1
  199. package/lib/translation/feedback/cloud/service/CloudFeedbackService.d.ts +21 -0
  200. package/lib/translation/feedback/cloud/service/CloudFeedbackService.js +111 -1
  201. package/lib/translation/feedback/cloud/service/CloudFeedbackService.js.map +1 -1
  202. package/lib/translation/feedback/cloud/validator/CloudFeedbackValidator.d.ts +9 -0
  203. package/lib/translation/feedback/cloud/{validators → validator}/CloudFeedbackValidator.js +20 -1
  204. package/lib/translation/feedback/cloud/validator/CloudFeedbackValidator.js.map +1 -0
  205. package/lib/translation/feedback/common/request/CreateFeedbackRequest.d.ts +29 -0
  206. package/lib/translation/feedback/common/request/CreateFeedbackRequest.js +123 -0
  207. package/lib/translation/feedback/common/request/CreateFeedbackRequest.js.map +1 -0
  208. package/lib/translation/feedback/common/request/DeleteFeedbackRequest.d.ts +5 -0
  209. package/lib/translation/feedback/common/request/DeleteFeedbackRequest.js +19 -0
  210. package/lib/translation/feedback/common/request/DeleteFeedbackRequest.js.map +1 -0
  211. package/lib/translation/feedback/common/request/FilterFeedbackRequest.d.ts +4 -4
  212. package/lib/translation/feedback/common/request/FilterFeedbackRequest.js.map +1 -1
  213. package/lib/translation/feedback/common/request/UpdateFeedbackApprovalRequest.d.ts +9 -0
  214. package/lib/translation/feedback/common/request/UpdateFeedbackApprovalRequest.js +29 -0
  215. package/lib/translation/feedback/common/request/UpdateFeedbackApprovalRequest.js.map +1 -0
  216. package/lib/translation/feedback/common/request/UpdateFeedbackRequest.d.ts +19 -0
  217. package/lib/translation/feedback/common/request/UpdateFeedbackRequest.js +80 -0
  218. package/lib/translation/feedback/common/request/UpdateFeedbackRequest.js.map +1 -0
  219. package/lib/translation/feedback/common/{model → result}/AuditData.d.ts +0 -0
  220. package/lib/translation/feedback/common/{model → result}/AuditData.js +0 -0
  221. package/lib/translation/feedback/common/result/AuditData.js.map +1 -0
  222. package/lib/translation/feedback/common/result/FeedbackResult.d.ts +3 -1
  223. package/lib/translation/feedback/common/result/FeedbackResult.js +8 -0
  224. package/lib/translation/feedback/common/result/FeedbackResult.js.map +1 -1
  225. package/lib/translation/feedback/common/validator/FeedbackValidator.d.ts +10 -0
  226. package/lib/translation/feedback/common/validator/FeedbackValidator.js +38 -0
  227. package/lib/translation/feedback/common/validator/FeedbackValidator.js.map +1 -0
  228. package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.d.ts +3 -2
  229. package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.js +43 -15
  230. package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.js.map +1 -1
  231. package/lib/translation/feedback/edge/request/EdgeCreateFeedbackRequest.d.ts +12 -0
  232. package/lib/translation/feedback/edge/request/EdgeCreateFeedbackRequest.js +63 -0
  233. package/lib/translation/feedback/edge/request/EdgeCreateFeedbackRequest.js.map +1 -0
  234. package/lib/translation/feedback/edge/request/EdgeDeleteFeedbackRequest.d.ts +3 -0
  235. package/lib/translation/feedback/edge/request/EdgeDeleteFeedbackRequest.js +30 -0
  236. package/lib/translation/feedback/edge/request/EdgeDeleteFeedbackRequest.js.map +1 -0
  237. package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackApprovalRequest.d.ts +3 -0
  238. package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackApprovalRequest.js +30 -0
  239. package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackApprovalRequest.js.map +1 -0
  240. package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackRequest.d.ts +9 -0
  241. package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackRequest.js +50 -0
  242. package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackRequest.js.map +1 -0
  243. package/lib/translation/feedback/edge/service/EdgeFeedbackService.d.ts +22 -0
  244. package/lib/translation/feedback/edge/service/EdgeFeedbackService.js +100 -3
  245. package/lib/translation/feedback/edge/service/EdgeFeedbackService.js.map +1 -1
  246. package/lib/translation/feedback/edge/validator/EdgeFeedbackValidator.d.ts +3 -0
  247. package/lib/translation/feedback/edge/{validators → validator}/EdgeFeedbackValidator.js +1 -1
  248. package/lib/translation/feedback/edge/validator/EdgeFeedbackValidator.js.map +1 -0
  249. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.d.ts +21 -0
  250. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.js +81 -0
  251. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.js.map +1 -0
  252. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.d.ts +13 -0
  253. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.js +47 -0
  254. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.js.map +1 -0
  255. package/lib/translation/{translate/cloud/api → language-pairs/cloud/result}/CloudLanguagePair.d.ts +2 -0
  256. package/lib/translation/{translate/cloud/api → language-pairs/cloud/result}/CloudLanguagePair.js +11 -0
  257. package/lib/translation/language-pairs/cloud/result/CloudLanguagePair.js.map +1 -0
  258. package/lib/translation/{translate → language-pairs}/cloud/result/CloudLanguagePairsResult.d.ts +1 -1
  259. package/lib/translation/{translate → language-pairs}/cloud/result/CloudLanguagePairsResult.js +0 -0
  260. package/lib/translation/language-pairs/cloud/result/CloudLanguagePairsResult.js.map +1 -0
  261. package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.d.ts +15 -0
  262. package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.js +45 -0
  263. package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.js.map +1 -0
  264. package/lib/translation/language-pairs/common/result/LanguagePair.d.ts +16 -0
  265. package/lib/translation/{translate/common/api → language-pairs/common/result}/LanguagePair.js +11 -0
  266. package/lib/translation/language-pairs/common/result/LanguagePair.js.map +1 -0
  267. package/lib/translation/{translate → language-pairs}/common/result/LanguagePairsResult.d.ts +1 -1
  268. package/lib/translation/{translate → language-pairs}/common/result/LanguagePairsResult.js +0 -0
  269. package/lib/translation/language-pairs/common/result/LanguagePairsResult.js.map +1 -0
  270. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.d.ts +17 -0
  271. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.js +89 -0
  272. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.js.map +1 -0
  273. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.d.ts +10 -0
  274. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.js +37 -0
  275. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.js.map +1 -0
  276. package/lib/translation/language-pairs/edge/api/MemberPairApiModel.d.ts +31 -0
  277. package/lib/translation/language-pairs/edge/api/MemberPairApiModel.js +116 -0
  278. package/lib/translation/language-pairs/edge/api/MemberPairApiModel.js.map +1 -0
  279. package/lib/translation/language-pairs/edge/result/EdgeLanguagePair.d.ts +15 -0
  280. package/lib/translation/{translate/edge/api → language-pairs/edge/result}/EdgeLanguagePair.js +20 -0
  281. package/lib/translation/language-pairs/edge/result/EdgeLanguagePair.js.map +1 -0
  282. package/lib/translation/{translate → language-pairs}/edge/result/EdgeLanguagePairsResult.d.ts +1 -1
  283. package/lib/translation/{translate → language-pairs}/edge/result/EdgeLanguagePairsResult.js +0 -0
  284. package/lib/translation/language-pairs/edge/result/EdgeLanguagePairsResult.js.map +1 -0
  285. package/lib/translation/{translate/edge/api → language-pairs/edge/result}/MemberPair.d.ts +0 -0
  286. package/lib/translation/{translate/edge/api → language-pairs/edge/result}/MemberPair.js +0 -0
  287. package/lib/translation/language-pairs/edge/result/MemberPair.js.map +1 -0
  288. package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.d.ts +14 -0
  289. package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.js +80 -0
  290. package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.js.map +1 -0
  291. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.d.ts +13 -0
  292. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.js +68 -0
  293. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.js.map +1 -0
  294. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.d.ts +6 -0
  295. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.js +19 -0
  296. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.js.map +1 -0
  297. package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.d.ts +3 -0
  298. package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.js +30 -0
  299. package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.js.map +1 -0
  300. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.d.ts +10 -0
  301. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.js +57 -0
  302. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.js.map +1 -0
  303. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.d.ts +6 -0
  304. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.js +19 -0
  305. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.js.map +1 -0
  306. package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.d.ts +19 -0
  307. package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.js +72 -0
  308. package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.js.map +1 -0
  309. package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.d.ts +3 -0
  310. package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.js +30 -0
  311. package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.js.map +1 -0
  312. package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.d.ts +11 -0
  313. package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.js +39 -0
  314. package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.js.map +1 -0
  315. package/lib/translation/{translate/common/api/LanguagePair.d.ts → linguistic-options/common/request/GetLinguisticOptionsRequest.d.ts} +1 -4
  316. package/lib/translation/linguistic-options/common/request/GetLinguisticOptionsRequest.js +39 -0
  317. package/lib/translation/linguistic-options/common/request/GetLinguisticOptionsRequest.js.map +1 -0
  318. package/lib/translation/linguistic-options/common/result/LinguisticOption.d.ts +11 -0
  319. package/lib/translation/linguistic-options/common/result/LinguisticOption.js +39 -0
  320. package/lib/translation/linguistic-options/common/result/LinguisticOption.js.map +1 -0
  321. package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.d.ts +6 -0
  322. package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.js +19 -0
  323. package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.js.map +1 -0
  324. package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.d.ts +4 -0
  325. package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.js +25 -0
  326. package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.js.map +1 -0
  327. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.d.ts +7 -0
  328. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.js +46 -0
  329. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.js.map +1 -0
  330. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.d.ts +6 -0
  331. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.js +19 -0
  332. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.js.map +1 -0
  333. package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.d.ts +9 -0
  334. package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.js +50 -0
  335. package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.js.map +1 -0
  336. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.d.ts +4 -0
  337. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.js +37 -0
  338. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.js.map +1 -0
  339. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.d.ts +6 -0
  340. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.js +19 -0
  341. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.js.map +1 -0
  342. package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.d.ts +18 -0
  343. package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.js +101 -0
  344. package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.js.map +1 -0
  345. package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.d.ts +3 -0
  346. package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.js +30 -0
  347. package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.js.map +1 -0
  348. package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.d.ts +3 -0
  349. package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.js +30 -0
  350. package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.js.map +1 -0
  351. package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.d.ts +3 -0
  352. package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.js +21 -0
  353. package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.js.map +1 -1
  354. package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.d.ts +26 -0
  355. package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.js +80 -0
  356. package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.js.map +1 -0
  357. package/lib/translation/translate/cloud/result/CloudTranslationFileResult.d.ts +0 -3
  358. package/lib/translation/translate/cloud/result/CloudTranslationFileResult.js +0 -10
  359. package/lib/translation/translate/cloud/result/CloudTranslationFileResult.js.map +1 -1
  360. package/lib/translation/translate/cloud/result/CloudTranslationTextResult.d.ts +3 -3
  361. package/lib/translation/translate/cloud/result/CloudTranslationTextResult.js +3 -3
  362. package/lib/translation/translate/cloud/result/CloudTranslationTextResult.js.map +1 -1
  363. package/lib/translation/translate/common/request/RetrieveFileRequest.d.ts +11 -0
  364. package/lib/translation/translate/common/request/RetrieveFileRequest.js +39 -0
  365. package/lib/translation/translate/common/request/RetrieveFileRequest.js.map +1 -0
  366. package/lib/translation/translate/common/request/TranslateBatchFileRequest.d.ts +7 -0
  367. package/lib/translation/translate/common/request/TranslateBatchFileRequest.js +20 -7
  368. package/lib/translation/translate/common/request/TranslateBatchFileRequest.js.map +1 -1
  369. package/lib/translation/translate/common/request/TranslateFileRequest.d.ts +4 -0
  370. package/lib/translation/translate/common/request/TranslateFileRequest.js +10 -0
  371. package/lib/translation/translate/common/request/TranslateFileRequest.js.map +1 -1
  372. package/lib/translation/translate/common/request/TranslateRequest.d.ts +3 -0
  373. package/lib/translation/translate/common/request/TranslateRequest.js +10 -0
  374. package/lib/translation/translate/common/request/TranslateRequest.js.map +1 -1
  375. package/lib/translation/translate/common/request/TranslateTextRequest.d.ts +3 -1
  376. package/lib/translation/translate/common/request/TranslateTextRequest.js +9 -1
  377. package/lib/translation/translate/common/request/TranslateTextRequest.js.map +1 -1
  378. package/lib/translation/translate/common/result/TranslationFileResult.d.ts +6 -0
  379. package/lib/translation/translate/common/result/TranslationFileResult.js +20 -0
  380. package/lib/translation/translate/common/result/TranslationFileResult.js.map +1 -1
  381. package/lib/translation/translate/common/utils/TranslateFileUtil.d.ts +3 -1
  382. package/lib/translation/translate/common/utils/TranslateFileUtil.js +26 -53
  383. package/lib/translation/translate/common/utils/TranslateFileUtil.js.map +1 -1
  384. package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.d.ts +7 -0
  385. package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.js +40 -0
  386. package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.js.map +1 -0
  387. package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.d.ts +2 -0
  388. package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.js +16 -0
  389. package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.js.map +1 -1
  390. package/lib/translation/translate/edge/request/EdgeTranslateRequest.d.ts +29 -0
  391. package/lib/translation/translate/edge/request/EdgeTranslateRequest.js +109 -0
  392. package/lib/translation/translate/edge/request/EdgeTranslateRequest.js.map +1 -0
  393. package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.d.ts +2 -0
  394. package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.js +16 -0
  395. package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.js.map +1 -1
  396. package/lib/translation/translate/edge/result/EdgeTranslationFileResult.d.ts +0 -3
  397. package/lib/translation/translate/edge/result/EdgeTranslationFileResult.js +0 -10
  398. package/lib/translation/translate/edge/result/EdgeTranslationFileResult.js.map +1 -1
  399. package/lib/version.d.ts +1 -1
  400. package/lib/version.js +1 -1
  401. package/package.json +2 -2
  402. package/lib/translation/feedback/cloud/model/CloudAuditData.js.map +0 -1
  403. package/lib/translation/feedback/cloud/model/CloudFeedbackSortCriteria.js.map +0 -1
  404. package/lib/translation/feedback/cloud/validators/CloudFeedbackValidator.d.ts +0 -5
  405. package/lib/translation/feedback/cloud/validators/CloudFeedbackValidator.js.map +0 -1
  406. package/lib/translation/feedback/common/model/AuditData.js.map +0 -1
  407. package/lib/translation/feedback/common/validators/FeedbackValidator.d.ts +0 -2
  408. package/lib/translation/feedback/common/validators/FeedbackValidator.js +0 -9
  409. package/lib/translation/feedback/common/validators/FeedbackValidator.js.map +0 -1
  410. package/lib/translation/feedback/edge/validators/EdgeFeedbackValidator.d.ts +0 -3
  411. package/lib/translation/feedback/edge/validators/EdgeFeedbackValidator.js.map +0 -1
  412. package/lib/translation/translate/cloud/api/CloudDictionaryResponse.js.map +0 -1
  413. package/lib/translation/translate/cloud/api/CloudLanguagePair.js.map +0 -1
  414. package/lib/translation/translate/cloud/result/CloudDictionariesResult.js.map +0 -1
  415. package/lib/translation/translate/cloud/result/CloudLanguagePairsResult.js.map +0 -1
  416. package/lib/translation/translate/common/api/DictionaryResponse.js.map +0 -1
  417. package/lib/translation/translate/common/api/LanguagePair.js.map +0 -1
  418. package/lib/translation/translate/common/result/DictionariesResult.d.ts +0 -7
  419. package/lib/translation/translate/common/result/DictionariesResult.js.map +0 -1
  420. package/lib/translation/translate/common/result/LanguagePairsResult.js.map +0 -1
  421. package/lib/translation/translate/edge/api/EdgeDictionaryResponse.js.map +0 -1
  422. package/lib/translation/translate/edge/api/EdgeLanguagePair.d.ts +0 -9
  423. package/lib/translation/translate/edge/api/EdgeLanguagePair.js.map +0 -1
  424. package/lib/translation/translate/edge/api/MemberPair.js.map +0 -1
  425. package/lib/translation/translate/edge/result/EdgeDictionariesResult.js.map +0 -1
  426. package/lib/translation/translate/edge/result/EdgeLanguagePairsResult.js.map +0 -1
@@ -10,18 +10,39 @@ import TranslateFileRequest from '../../translate/common/request/TranslateFileRe
10
10
  import TranslationFileResult from '../../translate/common/result/TranslationFileResult';
11
11
  import CloudTranslateFileRequest from '../../translate/cloud/request/CloudTranslateFileRequest';
12
12
  import CloudTranslationFileResult from '../../translate/cloud/result/CloudTranslationFileResult';
13
- import LanguagePairsResult from '../../translate/common/result/LanguagePairsResult';
14
- import CloudLanguagePairsResult from '../../translate/cloud/result/CloudLanguagePairsResult';
13
+ import LanguagePairsResult from '../../language-pairs/common/result/LanguagePairsResult';
14
+ import CloudLanguagePairsResult from '../../language-pairs/cloud/result/CloudLanguagePairsResult';
15
15
  import TranslationBatchFileResult from '../../translate/common/result/TranslationBatchFileResult';
16
16
  import TranslateBatchFileRequest from '../../translate/common/request/TranslateBatchFileRequest';
17
17
  import CloudTranslateBatchFileRequest from '../../translate/cloud/request/CloudTranslateBatchFileRequest';
18
18
  import CloudTranslationBatchFileResult from '../../translate/cloud/result/CloudTranslationBatchFileResult';
19
- import DictionariesResult from '../../translate/common/result/DictionariesResult';
20
- import CloudDictionariesResult from '../../translate/cloud/result/CloudDictionariesResult';
19
+ import DictionariesResult from '../../dictionaries/common/result/DictionariesResult';
20
+ import CloudDictionariesResult from '../../dictionaries/cloud/result/CloudDictionariesResult';
21
21
  import FilterFeedbackRequest from '../../feedback/common/request/FilterFeedbackRequest';
22
22
  import FeedbackListResult from '../../feedback/common/result/FeedbackListResult';
23
23
  import CloudFeedbackListResult from '../../feedback/cloud/result/CloudFeedbackListResult';
24
24
  import CloudFilterFeedbackRequest from '../../feedback/cloud/request/CloudFilterFeedbackRequest';
25
+ import FeedbackResult from '../../feedback/common/result/FeedbackResult';
26
+ import CreateFeedbackRequest from '../../feedback/common/request/CreateFeedbackRequest';
27
+ import CloudCreateFeedbackRequest from '../../feedback/cloud/request/CloudCreateFeedbackRequest';
28
+ import CloudFeedbackResult from '../../feedback/cloud/result/CloudFeedbackResult';
29
+ import CloudUpdateFeedbackRequest from '../../feedback/cloud/request/CloudUpdateFeedbackRequest';
30
+ import UpdateFeedbackRequest from '../../feedback/common/request/UpdateFeedbackRequest';
31
+ import UpdateFeedbackApprovalRequest from '../../feedback/common/request/UpdateFeedbackApprovalRequest';
32
+ import CloudUpdateFeedbackApprovalRequest from '../../feedback/cloud/request/CloudUpdateFeedbackApprovalRequest';
33
+ import DeleteFeedbackRequest from '../../feedback/common/request/DeleteFeedbackRequest';
34
+ import CloudDeleteFeedbackRequest from '../../feedback/cloud/request/CloudDeleteFeedbackRequest';
35
+ import RetrieveFileRequest from '../../translate/common/request/RetrieveFileRequest';
36
+ import CloudRetrieveFileRequest from '../../translate/cloud/request/CloudRetrieveFileRequest';
37
+ import GetLinguisticOptionsRequest from '../../linguistic-options/common/request/GetLinguisticOptionsRequest';
38
+ import LinguisticOptionsResult from '../../linguistic-options/common/result/LinguisticOptionsResult';
39
+ import CloudContentInsightsResult from '../../content-insights/cloud/result/CloudContentInsightsResult';
40
+ import CloudGetLinguisticOptionsRequest from '../../linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest';
41
+ import CloudLinguisticOptionsResult from '../../linguistic-options/cloud/result/CloudLinguisticOptionsResult';
42
+ import ContentInsightsResult from '../../content-insights/common/result/ContentInsightsResult';
43
+ import CloudFileContentInsightsRequest from '../../content-insights/cloud/request/CloudFileContentInsightsRequest';
44
+ import ContentInsightsRequest from '../../content-insights/common/request/ContentInsightsRequest';
45
+ import CloudContentInsightsRequest from '../../content-insights/cloud/request/CloudContentInsightsRequest';
25
46
  export default class CloudLanguageWeaverClient implements LanguageWeaverClient {
26
47
  private _clientConfiguration;
27
48
  private _region;
@@ -32,6 +53,10 @@ export default class CloudLanguageWeaverClient implements LanguageWeaverClient {
32
53
  private _languageWeaverAuthentication;
33
54
  private _client;
34
55
  private _feedbackService;
56
+ private _linguisticOptionsService;
57
+ private _contentInsightsService;
58
+ private _languagePairsService;
59
+ private _dictionariesService;
35
60
  constructor();
36
61
  withConfigurations(clientConfiguration: ClientConfiguration): CloudLanguageWeaverClient;
37
62
  withTokenConfigurations(tokenConfiguration: TokenConfiguration): CloudLanguageWeaverClient;
@@ -44,18 +69,34 @@ export default class CloudLanguageWeaverClient implements LanguageWeaverClient {
44
69
  translateText(translateTextRequest: TranslateTextRequest): Promise<TranslateTextResult>;
45
70
  translateFile(translateFileRequest: TranslateFileRequest): Promise<TranslationFileResult>;
46
71
  translateBatchFile(translateBatchFileRequest: TranslateBatchFileRequest): Promise<TranslationBatchFileResult>;
72
+ retrieveFileTranslation(retrieveFileRequest: RetrieveFileRequest): Promise<TranslationFileResult>;
73
+ retrieveCloudFileTranslation(retrieveFileRequest: CloudRetrieveFileRequest): Promise<CloudTranslationFileResult>;
47
74
  getLanguagePairs(): Promise<LanguagePairsResult>;
48
75
  getCloudLanguagePairs(): Promise<CloudLanguagePairsResult>;
76
+ getLinguisticOptions(getLinguisticOptionsRequest: GetLinguisticOptionsRequest): Promise<LinguisticOptionsResult>;
77
+ getCloudLinguisticOptions(getLinguisticOptionsRequest: CloudGetLinguisticOptionsRequest): Promise<CloudLinguisticOptionsResult>;
49
78
  getDictionaries(pageNumber: number, pageSize?: number): Promise<DictionariesResult>;
50
79
  getCloudDictionaries(pageNumber: number, pageSize?: number): Promise<CloudDictionariesResult>;
51
80
  getFeedback(pageNumber: number, pageSize?: number, filterRequest?: FilterFeedbackRequest): Promise<FeedbackListResult>;
52
81
  getCloudFeedback(pageNumber: number, pageSize?: number, filterRequest?: CloudFilterFeedbackRequest): Promise<CloudFeedbackListResult>;
82
+ createFeedback(createFeedbackRequest: CreateFeedbackRequest): Promise<FeedbackResult>;
83
+ createCloudFeedback(createCloudFeedbackRequest: CloudCreateFeedbackRequest): Promise<CloudFeedbackResult>;
84
+ updateFeedback(updateFeedbackRequest: UpdateFeedbackRequest): Promise<FeedbackResult>;
85
+ updateCloudFeedback(updateCloudFeedbackRequest: CloudUpdateFeedbackRequest): Promise<CloudFeedbackResult>;
86
+ updateFeedbackApproval(updateFeedbackApprovalRequest: UpdateFeedbackApprovalRequest): Promise<FeedbackResult>;
87
+ updateCloudFeedbackApproval(updateCloudFeedbackApprovalRequest: CloudUpdateFeedbackApprovalRequest): Promise<CloudFeedbackResult>;
88
+ deleteFeedback(deleteFeedbackRequest: DeleteFeedbackRequest): Promise<null>;
89
+ deleteCloudFeedback(deleteCloudFeedbackRequest: CloudDeleteFeedbackRequest): Promise<null>;
90
+ getCloudContentInsights(cloudContentInsightsRequest: CloudFileContentInsightsRequest): Promise<CloudContentInsightsResult>;
91
+ getContentInsightsForTranslations(contentInsightsRequest: ContentInsightsRequest): Promise<ContentInsightsResult>;
92
+ getCloudContentInsightsForTranslations(cloudContentInsightsRequest: CloudContentInsightsRequest): Promise<CloudContentInsightsResult>;
53
93
  private getSelfInfo;
54
94
  private requestTranslateText;
55
95
  private translateSyncText;
56
96
  private translateAsyncText;
57
97
  private getTranslationResponse;
58
98
  private getTranslationFileResponse;
99
+ private retrieveFileTranslationResponse;
59
100
  private requestTranslateBatchFile;
60
101
  private translateFileFromBatch;
61
102
  private requestTranslateFile;
@@ -52,21 +52,26 @@ var TranslationException_1 = __importDefault(require("../../../common/exceptions
52
52
  var ErrorResponse_1 = __importDefault(require("../../../common/api/ErrorResponse"));
53
53
  var Product_1 = require("../../../common/constants/Product");
54
54
  var Regions_1 = require("../../../common/constants/Regions");
55
+ var TranslationFileResult_1 = __importDefault(require("../../translate/common/result/TranslationFileResult"));
55
56
  var CloudTranslateFileRequest_1 = __importDefault(require("../../translate/cloud/request/CloudTranslateFileRequest"));
56
57
  var CloudTranslationFileResult_1 = __importDefault(require("../../translate/cloud/result/CloudTranslationFileResult"));
57
58
  var TranslateFileUtil_1 = require("../../translate/common/utils/TranslateFileUtil");
58
- var LanguagePairsResult_1 = __importDefault(require("../../translate/common/result/LanguagePairsResult"));
59
- var LanguagePair_1 = __importDefault(require("../../translate/common/api/LanguagePair"));
60
59
  var CloudTranslateBatchFileRequest_1 = __importDefault(require("../../translate/cloud/request/CloudTranslateBatchFileRequest"));
61
60
  var CloudTranslationBatchFileResult_1 = __importDefault(require("../../translate/cloud/result/CloudTranslationBatchFileResult"));
62
- var DictionariesResult_1 = __importDefault(require("../../translate/common/result/DictionariesResult"));
63
- var DictionaryResponse_1 = __importDefault(require("../../translate/common/api/DictionaryResponse"));
64
61
  var CredentialsConfiguration_1 = __importDefault(require("../../../common/configurations/CredentialsConfiguration"));
65
62
  var Format_1 = require("../../../common/constants/Format");
66
63
  var FormatToMimeType_1 = require("../../../common/constants/FormatToMimeType");
67
64
  var FilterFeedbackRequest_1 = __importDefault(require("../../feedback/common/request/FilterFeedbackRequest"));
68
65
  var CloudFilterFeedbackRequest_1 = __importDefault(require("../../feedback/cloud/request/CloudFilterFeedbackRequest"));
69
66
  var CloudFeedbackService_1 = __importDefault(require("../../feedback/cloud/service/CloudFeedbackService"));
67
+ var PdfConverter_1 = require("../../../common/constants/PdfConverter");
68
+ var RetrieveFileRequest_1 = __importDefault(require("../../translate/common/request/RetrieveFileRequest"));
69
+ var GetLinguisticOptionsRequest_1 = __importDefault(require("../../linguistic-options/common/request/GetLinguisticOptionsRequest"));
70
+ var CloudLinguisticOptionsService_1 = __importDefault(require("../../linguistic-options/cloud/service/CloudLinguisticOptionsService"));
71
+ var CloudContentInsightsService_1 = __importDefault(require("../../content-insights/cloud/service/CloudContentInsightsService"));
72
+ var CloudGetLinguisticOptionsRequest_1 = __importDefault(require("../../linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest"));
73
+ var CloudLanguagePairsService_1 = __importDefault(require("../../language-pairs/cloud/service/CloudLanguagePairsService"));
74
+ var CloudDictionariesService_1 = __importDefault(require("../../dictionaries/cloud/service/CloudDictionariesService"));
70
75
  var CloudLanguageWeaverClient = /** @class */ (function () {
71
76
  function CloudLanguageWeaverClient() {
72
77
  this._clientConfiguration = new ClientConfiguration_1.default();
@@ -117,6 +122,10 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
117
122
  _e.label = 6;
118
123
  case 6:
119
124
  this._feedbackService = new CloudFeedbackService_1.default(this._client, this._token, this.getSelfInfo());
125
+ this._linguisticOptionsService = new CloudLinguisticOptionsService_1.default(this._client, this._token, this.getSelfInfo());
126
+ this._contentInsightsService = new CloudContentInsightsService_1.default(this._client, this._token);
127
+ this._languagePairsService = new CloudLanguagePairsService_1.default(this._client, this._token, this.getSelfInfo());
128
+ this._dictionariesService = new CloudDictionariesService_1.default(this._client, this._token, this.getSelfInfo());
120
129
  return [2 /*return*/, this];
121
130
  }
122
131
  });
@@ -156,6 +165,7 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
156
165
  request.model = translateTextRequest.model;
157
166
  request.inputFormat = translateTextRequest.inputFormat;
158
167
  request.dictionaries = translateTextRequest.dictionaries;
168
+ request.linguisticOptions = translateTextRequest.linguisticOptions;
159
169
  return this.requestTranslateText(request)
160
170
  .then(function (response) {
161
171
  var _a;
@@ -175,6 +185,8 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
175
185
  request.outputDir = translateFileRequest.outputDir;
176
186
  request.inputFormat = translateFileRequest.inputFormat;
177
187
  request.dictionaries = translateFileRequest.dictionaries;
188
+ request.pdfConverter = translateFileRequest.pdfConverter;
189
+ request.linguisticOptions = translateFileRequest.linguisticOptions;
178
190
  return this.requestTranslateFile(request);
179
191
  };
180
192
  CloudLanguageWeaverClient.prototype.translateBatchFile = function (translateBatchFileRequest) {
@@ -185,95 +197,108 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
185
197
  request.input = translateBatchFileRequest.input;
186
198
  request.outputDir = translateBatchFileRequest.outputDir;
187
199
  request.dictionaries = translateBatchFileRequest.dictionaries;
200
+ request.pdfConverter = translateBatchFileRequest.pdfConverter;
201
+ request.linguisticOptions = translateBatchFileRequest.linguisticOptions;
188
202
  return this.requestTranslateBatchFile(request);
189
203
  };
190
- CloudLanguageWeaverClient.prototype.getLanguagePairs = function () {
191
- var _a;
204
+ CloudLanguageWeaverClient.prototype.retrieveFileTranslation = function (retrieveFileRequest) {
192
205
  return __awaiter(this, void 0, void 0, function () {
193
- var cloudResult, languagePairs_1, e_1;
194
- return __generator(this, function (_b) {
195
- switch (_b.label) {
206
+ var response, translationFileResult, e_1;
207
+ return __generator(this, function (_a) {
208
+ switch (_a.label) {
196
209
  case 0:
197
- _b.trys.push([0, 2, , 3]);
198
- return [4 /*yield*/, this.getCloudLanguagePairs()];
210
+ _a.trys.push([0, 2, , 3]);
211
+ return [4 /*yield*/, this.retrieveCloudFileTranslation(retrieveFileRequest)];
199
212
  case 1:
200
- cloudResult = _b.sent();
201
- languagePairs_1 = [];
202
- (_a = cloudResult.languagePairs) === null || _a === void 0 ? void 0 : _a.forEach(function (lp) {
203
- var languagePair = new LanguagePair_1.default();
204
- languagePair.sourceLanguageId = lp.sourceLanguageId;
205
- languagePair.targetLanguageId = lp.targetLanguageId;
206
- languagePair.model = lp.model;
207
- languagePair.name = lp.name;
208
- languagePairs_1.push(languagePair);
209
- });
210
- return [2 /*return*/, new Promise(function (resolve) {
211
- var result = new LanguagePairsResult_1.default();
212
- result.languagePairs = languagePairs_1;
213
- resolve(result);
214
- })];
213
+ response = _a.sent();
214
+ translationFileResult = new TranslationFileResult_1.default();
215
+ translationFileResult.fileContent = response.fileContent;
216
+ translationFileResult.filename = response.filename;
217
+ translationFileResult.mimeType = response.mimeType;
218
+ return [2 /*return*/, Promise.resolve(translationFileResult)];
215
219
  case 2:
216
- e_1 = _b.sent();
220
+ e_1 = _a.sent();
217
221
  return [2 /*return*/, Promise.reject(e_1)];
218
222
  case 3: return [2 /*return*/];
219
223
  }
220
224
  });
221
225
  });
222
226
  };
227
+ CloudLanguageWeaverClient.prototype.retrieveCloudFileTranslation = function (retrieveFileRequest) {
228
+ return __awaiter(this, void 0, void 0, function () {
229
+ var validationError, statusPromise;
230
+ var _this = this;
231
+ return __generator(this, function (_a) {
232
+ validationError = (0, TranslateFileUtil_1.validateInputDataForRetrieveFileTranslation)(retrieveFileRequest);
233
+ if (validationError) {
234
+ return [2 /*return*/, Promise.reject({ message: validationError })];
235
+ }
236
+ statusPromise = this.obtainFinalStatus(retrieveFileRequest.translationId);
237
+ return [2 /*return*/, this.handleStatusResponse(retrieveFileRequest.translationId, statusPromise, function () {
238
+ return _this.getTranslationFileResponse(retrieveFileRequest);
239
+ })];
240
+ });
241
+ });
242
+ };
243
+ CloudLanguageWeaverClient.prototype.getLanguagePairs = function () {
244
+ return __awaiter(this, void 0, void 0, function () {
245
+ return __generator(this, function (_a) {
246
+ if (this._languagePairsService) {
247
+ return [2 /*return*/, this._languagePairsService.getLanguagePairs()];
248
+ }
249
+ else {
250
+ return [2 /*return*/, Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the language pairs' })];
251
+ }
252
+ return [2 /*return*/];
253
+ });
254
+ });
255
+ };
223
256
  CloudLanguageWeaverClient.prototype.getCloudLanguagePairs = function () {
224
- var _a;
225
- return this._client
226
- .requestJson(this._token, 'GET', '/v4/accounts/' + ((_a = this.getSelfInfo()) === null || _a === void 0 ? void 0 : _a.accountId) + '/subscriptions/language-pairs')
227
- .then(function (response) {
228
- return Promise.resolve(response);
229
- })
230
- .catch(function (e) { return Promise.reject(e); });
257
+ if (this._languagePairsService) {
258
+ return this._languagePairsService.getCloudLanguagePairs();
259
+ }
260
+ else {
261
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the language pairs' });
262
+ }
263
+ };
264
+ CloudLanguageWeaverClient.prototype.getLinguisticOptions = function (getLinguisticOptionsRequest) {
265
+ if (this._linguisticOptionsService) {
266
+ return this._linguisticOptionsService.getLinguisticOptionsForLanguagePair(getLinguisticOptionsRequest || new GetLinguisticOptionsRequest_1.default());
267
+ }
268
+ else {
269
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the linguistic options' });
270
+ }
271
+ };
272
+ CloudLanguageWeaverClient.prototype.getCloudLinguisticOptions = function (getLinguisticOptionsRequest) {
273
+ if (this._linguisticOptionsService) {
274
+ return this._linguisticOptionsService.getCloudLinguisticOptionsForLanguagePair(getLinguisticOptionsRequest || new CloudGetLinguisticOptionsRequest_1.default());
275
+ }
276
+ else {
277
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the linguistic options' });
278
+ }
231
279
  };
232
280
  CloudLanguageWeaverClient.prototype.getDictionaries = function (pageNumber, pageSize) {
233
- var _a;
234
281
  if (pageSize === void 0) { pageSize = TranslationConstants_1.DEFAULT_DICTIONARIES_PAGE_SIZE; }
235
282
  return __awaiter(this, void 0, void 0, function () {
236
- var cloudDictionariesResult_1, dictionaries_1, e_2;
237
- return __generator(this, function (_b) {
238
- switch (_b.label) {
239
- case 0:
240
- _b.trys.push([0, 2, , 3]);
241
- return [4 /*yield*/, this.getCloudDictionaries(pageNumber, pageSize)];
242
- case 1:
243
- cloudDictionariesResult_1 = _b.sent();
244
- dictionaries_1 = [];
245
- (_a = cloudDictionariesResult_1.dictionaries) === null || _a === void 0 ? void 0 : _a.forEach(function (dictionary) {
246
- var dictionaryResponse = new DictionaryResponse_1.default();
247
- dictionaryResponse.id = dictionary.dictionaryId;
248
- dictionaryResponse.source = dictionary.source;
249
- dictionaryResponse.target = dictionary.target;
250
- dictionaries_1.push(dictionaryResponse);
251
- });
252
- return [2 /*return*/, new Promise(function (resolve) {
253
- var result = new DictionariesResult_1.default();
254
- result.dictionaries = dictionaries_1;
255
- result.pageNumber = cloudDictionariesResult_1.pageNumber;
256
- result.totalCount = cloudDictionariesResult_1.totalCount;
257
- result.pageSize = cloudDictionariesResult_1.pageSize;
258
- resolve(result);
259
- })];
260
- case 2:
261
- e_2 = _b.sent();
262
- return [2 /*return*/, Promise.reject(e_2)];
263
- case 3: return [2 /*return*/];
283
+ return __generator(this, function (_a) {
284
+ if (this._dictionariesService) {
285
+ return [2 /*return*/, this._dictionariesService.getDictionaries(pageNumber, pageSize)];
264
286
  }
287
+ else {
288
+ return [2 /*return*/, Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the dictionaries' })];
289
+ }
290
+ return [2 /*return*/];
265
291
  });
266
292
  });
267
293
  };
268
294
  CloudLanguageWeaverClient.prototype.getCloudDictionaries = function (pageNumber, pageSize) {
269
- var _a;
270
295
  if (pageSize === void 0) { pageSize = TranslationConstants_1.DEFAULT_DICTIONARIES_PAGE_SIZE; }
271
- return this._client
272
- .requestJson(this._token, 'GET', '/v4/accounts/' + ((_a = this.getSelfInfo()) === null || _a === void 0 ? void 0 : _a.accountId) + '/dictionaries', undefined, { pageNumber: pageNumber, pageSize: pageSize })
273
- .then(function (response) {
274
- return Promise.resolve(response);
275
- })
276
- .catch(function (e) { return Promise.reject(e); });
296
+ if (this._dictionariesService) {
297
+ return this._dictionariesService.getCloudDictionaries(pageNumber, pageSize);
298
+ }
299
+ else {
300
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the dictionaries' });
301
+ }
277
302
  };
278
303
  CloudLanguageWeaverClient.prototype.getFeedback = function (pageNumber, pageSize, filterRequest) {
279
304
  if (this._feedbackService) {
@@ -291,6 +316,98 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
291
316
  return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the feedback' });
292
317
  }
293
318
  };
319
+ CloudLanguageWeaverClient.prototype.createFeedback = function (createFeedbackRequest) {
320
+ if (this._feedbackService) {
321
+ createFeedbackRequest.sourceLanguageId = Utils_1.default.getLanguageCode3(createFeedbackRequest.sourceLanguageId);
322
+ createFeedbackRequest.targetLanguageId = Utils_1.default.getLanguageCode3(createFeedbackRequest.targetLanguageId);
323
+ return this._feedbackService.createFeedback(createFeedbackRequest);
324
+ }
325
+ else {
326
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'creating the feedback' });
327
+ }
328
+ };
329
+ CloudLanguageWeaverClient.prototype.createCloudFeedback = function (createCloudFeedbackRequest) {
330
+ if (this._feedbackService) {
331
+ createCloudFeedbackRequest.sourceLanguageId = Utils_1.default.getLanguageCode3(createCloudFeedbackRequest.sourceLanguageId);
332
+ createCloudFeedbackRequest.targetLanguageId = Utils_1.default.getLanguageCode3(createCloudFeedbackRequest.targetLanguageId);
333
+ return this._feedbackService.createCloudFeedback(createCloudFeedbackRequest);
334
+ }
335
+ else {
336
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'creating the feedback' });
337
+ }
338
+ };
339
+ CloudLanguageWeaverClient.prototype.updateFeedback = function (updateFeedbackRequest) {
340
+ if (this._feedbackService) {
341
+ return this._feedbackService.updateFeedback(updateFeedbackRequest);
342
+ }
343
+ else {
344
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback' });
345
+ }
346
+ };
347
+ CloudLanguageWeaverClient.prototype.updateCloudFeedback = function (updateCloudFeedbackRequest) {
348
+ if (this._feedbackService) {
349
+ return this._feedbackService.updateCloudFeedback(updateCloudFeedbackRequest);
350
+ }
351
+ else {
352
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback' });
353
+ }
354
+ };
355
+ CloudLanguageWeaverClient.prototype.updateFeedbackApproval = function (updateFeedbackApprovalRequest) {
356
+ if (this._feedbackService) {
357
+ return this._feedbackService.updateFeedbackApproval(updateFeedbackApprovalRequest);
358
+ }
359
+ else {
360
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback approval status' });
361
+ }
362
+ };
363
+ CloudLanguageWeaverClient.prototype.updateCloudFeedbackApproval = function (updateCloudFeedbackApprovalRequest) {
364
+ if (this._feedbackService) {
365
+ return this._feedbackService.updateCloudFeedbackApproval(updateCloudFeedbackApprovalRequest);
366
+ }
367
+ else {
368
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback approval status' });
369
+ }
370
+ };
371
+ CloudLanguageWeaverClient.prototype.deleteFeedback = function (deleteFeedbackRequest) {
372
+ if (this._feedbackService) {
373
+ return this._feedbackService.deleteFeedback(deleteFeedbackRequest);
374
+ }
375
+ else {
376
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'deleting the feedback' });
377
+ }
378
+ };
379
+ CloudLanguageWeaverClient.prototype.deleteCloudFeedback = function (deleteCloudFeedbackRequest) {
380
+ if (this._feedbackService) {
381
+ return this._feedbackService.deleteCloudFeedback(deleteCloudFeedbackRequest);
382
+ }
383
+ else {
384
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'deleting the feedback' });
385
+ }
386
+ };
387
+ CloudLanguageWeaverClient.prototype.getCloudContentInsights = function (cloudContentInsightsRequest) {
388
+ if (this._contentInsightsService) {
389
+ return this._contentInsightsService.getCloudContentInsightsResult(cloudContentInsightsRequest);
390
+ }
391
+ else {
392
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'requesting content insights' });
393
+ }
394
+ };
395
+ CloudLanguageWeaverClient.prototype.getContentInsightsForTranslations = function (contentInsightsRequest) {
396
+ if (this._contentInsightsService) {
397
+ return this._contentInsightsService.getContentInsightsResultForTranslations(contentInsightsRequest);
398
+ }
399
+ else {
400
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'requesting content insights for translations' });
401
+ }
402
+ };
403
+ CloudLanguageWeaverClient.prototype.getCloudContentInsightsForTranslations = function (cloudContentInsightsRequest) {
404
+ if (this._contentInsightsService) {
405
+ return this._contentInsightsService.getCloudContentInsightsResultForTranslations(cloudContentInsightsRequest);
406
+ }
407
+ else {
408
+ return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'requesting content insights for translations' });
409
+ }
410
+ };
294
411
  CloudLanguageWeaverClient.prototype.getSelfInfo = function () {
295
412
  return Utils_1.default.isCloudCredentialsToken(this._token) ? this._selfInformation : this._userSelfInformation;
296
413
  };
@@ -299,14 +416,14 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
299
416
  translateTextRequest.targetLanguageId = Utils_1.default.getLanguageCode3(translateTextRequest.targetLanguageId);
300
417
  if (translateTextRequest.input.length === 1 &&
301
418
  Utils_1.default.getInputSize(translateTextRequest.input) < TranslationConstants_1.SYNC_SIZE_LIMIT) {
302
- return this.translateSyncText(translateTextRequest);
419
+ return this.translateSyncText(translateTextRequest.toCloudTranslateTextRequestApiModel());
303
420
  }
304
421
  else {
305
422
  var inputSize = Utils_1.default.getInputBytesSize(translateTextRequest.input);
306
423
  if (inputSize > TranslationConstants_1.MAX_ASYNC_TEXT_SIZE_LIMIT) {
307
424
  return Promise.reject("Input text size exceeds maximum permitted size of ".concat(TranslationConstants_1.MAX_ASYNC_TEXT_SIZE_LIMIT, " bytes."));
308
425
  }
309
- return this.translateAsyncText(translateTextRequest);
426
+ return this.translateAsyncText(translateTextRequest.toCloudTranslateTextRequestApiModel());
310
427
  }
311
428
  };
312
429
  CloudLanguageWeaverClient.prototype.translateSyncText = function (translateTextRequest) {
@@ -331,32 +448,38 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
331
448
  .requestJson(_this._token, 'GET', TranslationConstants_1.ASYNC_TRANSLATION_PATH + '/' + requestId + '/content')
332
449
  .then(function (contentResponse) {
333
450
  contentResponse.requestId = requestId;
334
- contentResponse.inputFormat = (0, Format_1.getFormatByKey)(statusResponse.inputFormat || '');
335
- contentResponse.outputFormat = (0, Format_1.getFormatByKey)(statusResponse.outputFormat || '');
451
+ contentResponse.inputFormat = (0, Format_1.getFormatByKey)(statusResponse.inputFormat);
452
+ contentResponse.outputFormat = (0, Format_1.getFormatByKey)(statusResponse.outputFormat);
336
453
  contentResponse.translationStats = statusResponse.translationStats;
337
454
  resolve(contentResponse);
338
455
  })
339
456
  .catch(function (error) { return reject(error); });
340
457
  });
341
458
  };
342
- CloudLanguageWeaverClient.prototype.getTranslationFileResponse = function (translationResponse, translateFileRequest) {
459
+ CloudLanguageWeaverClient.prototype.getTranslationFileResponse = function (request, translationResponse) {
343
460
  var _this = this;
344
461
  return new Promise(function (resolve, reject) {
345
- _this._client
346
- .requestJson(_this._token, 'GET', TranslationConstants_1.ASYNC_TRANSLATION_PATH + '/' + translationResponse.requestId + '/content', undefined, undefined, { hasStreamResponse: true, headersNeeded: true })
462
+ var requestId = request instanceof RetrieveFileRequest_1.default ? request.translationId : translationResponse === null || translationResponse === void 0 ? void 0 : translationResponse.requestId;
463
+ _this.retrieveFileTranslationResponse(requestId)
347
464
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
348
- var translationFileResult, fs;
465
+ var translationFileResult, fs, once, stream;
349
466
  return __generator(this, function (_a) {
350
- translationFileResult = constructFileTranslationResponse(response);
351
- if (translateFileRequest.outputDir && !Utils_1.default.isBrowser()) {
352
- if (response.data && typeof response.data.pipe === 'function') {
467
+ switch (_a.label) {
468
+ case 0:
469
+ translationFileResult = constructFileTranslationResponse(response);
470
+ if (!(request.outputDir && !Utils_1.default.isBrowser())) return [3 /*break*/, 2];
471
+ if (!(response.data && typeof response.data.pipe === 'function')) return [3 /*break*/, 2];
353
472
  fs = require('fs');
354
- response.data.pipe(fs.createWriteStream(Utils_1.default.getFullPath(translateFileRequest.outputDir, translateFileRequest.outputFile ||
355
- (0, TranslateFileUtil_1.getFileNameFromHeaders)(response, translateFileRequest))));
356
- }
473
+ once = require('events').once;
474
+ stream = response.data.pipe(fs.createWriteStream(Utils_1.default.getFullPath(request.outputDir, request.outputFile || (0, TranslateFileUtil_1.getFileNameFromHeaders)(response, request))));
475
+ return [4 /*yield*/, once(stream, 'finish')];
476
+ case 1:
477
+ _a.sent();
478
+ _a.label = 2;
479
+ case 2:
480
+ resolve(translationFileResult);
481
+ return [2 /*return*/];
357
482
  }
358
- resolve(translationFileResult);
359
- return [2 /*return*/];
360
483
  });
361
484
  }); })
362
485
  .catch(function (error) { return reject(error); });
@@ -364,21 +487,26 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
364
487
  function constructFileTranslationResponse(response) {
365
488
  var translationFileResult = new CloudTranslationFileResult_1.default();
366
489
  translationFileResult.fileContent = response.data;
367
- translationFileResult.sourceLanguageId = translationResponse.sourceLanguageId;
368
- translationFileResult.targetLanguageId = translationResponse.targetLanguageId;
369
- translationFileResult.inputFormat = translationResponse.inputFormat
370
- ? (0, Format_1.getFormatByKey)(translationResponse.inputFormat.toUpperCase())
371
- : Format_1.Format.UNK;
372
- translationFileResult.model = translationResponse.model;
373
- translationFileResult.requestId = translationResponse.requestId;
374
- if (Utils_1.default.isBrowser() && translateFileRequest.input instanceof File) {
375
- translationFileResult.filename = (0, TranslateFileUtil_1.getFileNameFromHeaders)(response, translateFileRequest);
490
+ if (translationResponse) {
491
+ translationFileResult.sourceLanguageId = translationResponse.sourceLanguageId;
492
+ translationFileResult.targetLanguageId = translationResponse.targetLanguageId;
493
+ translationFileResult.inputFormat = translationResponse.inputFormat
494
+ ? (0, Format_1.getFormatByKey)(translationResponse.inputFormat.toUpperCase())
495
+ : Format_1.Format.UNK;
496
+ translationFileResult.model = translationResponse.model;
497
+ translationFileResult.translationId = translationResponse.requestId;
498
+ }
499
+ if (Utils_1.default.isBrowser()) {
500
+ translationFileResult.filename = request.outputFile || (0, TranslateFileUtil_1.getFileNameFromHeaders)(response, request);
376
501
  translationFileResult.mimeType =
377
502
  FormatToMimeType_1.formatToMimeType[Utils_1.default.getFormatForFile(translationFileResult.filename)];
378
503
  }
379
504
  return translationFileResult;
380
505
  }
381
506
  };
507
+ CloudLanguageWeaverClient.prototype.retrieveFileTranslationResponse = function (requestId) {
508
+ return this._client.requestJson(this._token, 'GET', TranslationConstants_1.ASYNC_TRANSLATION_PATH + '/' + requestId + '/content', undefined, undefined, { hasStreamResponse: true, headersNeeded: true });
509
+ };
382
510
  CloudLanguageWeaverClient.prototype.requestTranslateBatchFile = function (translateBatchFileRequest) {
383
511
  return __awaiter(this, void 0, void 0, function () {
384
512
  var validationError, files, promises;
@@ -424,6 +552,8 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
424
552
  request.outputDir = translateBatchFileRequest.outputDir;
425
553
  }
426
554
  request.dictionaries = translateBatchFileRequest.dictionaries;
555
+ request.pdfConverter = translateBatchFileRequest.pdfConverter;
556
+ request.linguisticOptions = translateBatchFileRequest.linguisticOptions;
427
557
  return this.requestTranslateFile(request);
428
558
  };
429
559
  CloudLanguageWeaverClient.prototype.requestTranslateFile = function (translateFileRequest) {
@@ -438,7 +568,7 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
438
568
  .then(function (response) {
439
569
  var statusPromise = _this.obtainFinalStatus(response.requestId, fileSize);
440
570
  return _this.handleStatusResponse(response.requestId, statusPromise, function () {
441
- return _this.getTranslationFileResponse(response, translateFileRequest);
571
+ return _this.getTranslationFileResponse(translateFileRequest, response);
442
572
  });
443
573
  })
444
574
  .catch(function (error) { return Promise.reject(error); });
@@ -455,7 +585,7 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
455
585
  return Promise.reject(TranslationException_1.default.getTranslationException(statusResponse.translationStatus, requestId));
456
586
  case Statuses_1.INIT_TRANSLATION_STATUS:
457
587
  case Statuses_1.TRANSLATING_TRANSLATION_STATUS:
458
- var errorResponse = new ErrorResponse_1.default(-1, TranslationConstants_1.TRANSLATION_TIMEOUT);
588
+ var errorResponse = new ErrorResponse_1.default(-1, TranslationConstants_1.TRANSLATION_TIMEOUT_ERROR_MESSAGE);
459
589
  return Promise.reject(TranslationException_1.default.getTranslationException(statusResponse.translationStatus, requestId, [
460
590
  errorResponse,
461
591
  ]));
@@ -492,12 +622,20 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
492
622
  if (translateFileRequest.dictionaries && translateFileRequest.dictionaries.length) {
493
623
  translateFileRequest.dictionaries.forEach(function (dictionary) { return formData.append(TranslationConstants_1.DICTIONARIES, dictionary); });
494
624
  }
625
+ if (translateFileRequest.pdfConverter) {
626
+ formData.append(TranslationConstants_1.PDF_CONVERTER, PdfConverter_1.PdfConverterCloud[translateFileRequest.pdfConverter]);
627
+ }
628
+ if (translateFileRequest.linguisticOptions) {
629
+ formData.append(TranslationConstants_1.LINGUISTIC_OPTIONS, JSON.stringify(Object.fromEntries(translateFileRequest.linguisticOptions)));
630
+ }
495
631
  return this._client.requestMultipart(this._token, 'POST', TranslationConstants_1.ASYNC_TRANSLATION_PATH, formData);
496
632
  };
497
633
  CloudLanguageWeaverClient.prototype.obtainFinalStatus = function (requestId, fileSize) {
498
634
  var self = this;
499
- return new Promise(function (resolve) {
500
- var delay = fileSize < 500 ? TranslationConstants_1.SMALL_INPUT_GET_TRANSLATION_STATUS_DELAY : TranslationConstants_1.LARGE_INPUT_GET_TRANSLATION_STATUS_DELAY;
635
+ return new Promise(function (resolve, reject) {
636
+ var delay = fileSize !== undefined && fileSize < 500
637
+ ? TranslationConstants_1.SMALL_INPUT_GET_TRANSLATION_STATUS_DELAY
638
+ : TranslationConstants_1.LARGE_INPUT_GET_TRANSLATION_STATUS_DELAY;
501
639
  var startTime = new Date().getTime();
502
640
  getStatus();
503
641
  function getStatus() {
@@ -513,7 +651,8 @@ var CloudLanguageWeaverClient = /** @class */ (function () {
513
651
  else {
514
652
  resolve(statusResponse);
515
653
  }
516
- });
654
+ })
655
+ .catch(function (e) { return reject(e); });
517
656
  }
518
657
  });
519
658
  };