@language-weaver/lw-sdk-js 1.2.0 → 2.0.1

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 (347) hide show
  1. package/lib/common/configurations/ClientConfiguration.d.ts +2 -2
  2. package/lib/common/configurations/ClientConfiguration.js +0 -2
  3. package/lib/common/configurations/ClientConfiguration.js.map +1 -1
  4. package/lib/common/configurations/CredentialsConfiguration.js +2 -6
  5. package/lib/common/configurations/CredentialsConfiguration.js.map +1 -1
  6. package/lib/{translation/feedback/cloud/model → common/constants}/CloudFeedbackSortCriteria.d.ts +0 -0
  7. package/lib/{translation/feedback/cloud/model → common/constants}/CloudFeedbackSortCriteria.js +0 -0
  8. package/lib/common/constants/CloudFeedbackSortCriteria.js.map +1 -0
  9. package/lib/common/constants/Statuses.d.ts +6 -0
  10. package/lib/common/constants/Statuses.js +7 -1
  11. package/lib/common/constants/Statuses.js.map +1 -1
  12. package/lib/common/constants/TranslationConstants.d.ts +17 -8
  13. package/lib/common/constants/TranslationConstants.js +22 -11
  14. package/lib/common/constants/TranslationConstants.js.map +1 -1
  15. package/lib/common/exceptions/ContentInsightsException.d.ts +4 -0
  16. package/lib/common/exceptions/ContentInsightsException.js +17 -0
  17. package/lib/common/exceptions/ContentInsightsException.js.map +1 -0
  18. package/lib/common/external/communication/RestClient.js +9 -7
  19. package/lib/common/external/communication/RestClient.js.map +1 -1
  20. package/lib/common/utils/Utils.d.ts +8 -1
  21. package/lib/common/utils/Utils.js +133 -31
  22. package/lib/common/utils/Utils.js.map +1 -1
  23. package/lib/index.d.ts +45 -17
  24. package/lib/index.js +74 -20
  25. package/lib/index.js.map +1 -1
  26. package/lib/translation/common/LanguageWeaverClient.d.ts +10 -2
  27. package/lib/translation/common/cloud/CloudLanguageWeaverClient.d.ts +28 -4
  28. package/lib/translation/common/cloud/CloudLanguageWeaverClient.js +209 -112
  29. package/lib/translation/common/cloud/CloudLanguageWeaverClient.js.map +1 -1
  30. package/lib/translation/common/edge/EdgeLanguageWeaverClient.d.ts +26 -6
  31. package/lib/translation/common/edge/EdgeLanguageWeaverClient.js +204 -132
  32. package/lib/translation/common/edge/EdgeLanguageWeaverClient.js.map +1 -1
  33. package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.d.ts +1 -1
  34. package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.js +1 -1
  35. package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.js.map +1 -1
  36. package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.d.ts +23 -0
  37. package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.js +69 -0
  38. package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.js.map +1 -0
  39. package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.d.ts +10 -0
  40. package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.js +39 -0
  41. package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.js.map +1 -0
  42. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.d.ts +12 -0
  43. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.js +32 -0
  44. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.js.map +1 -0
  45. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.d.ts +16 -0
  46. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.js +42 -0
  47. package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.js.map +1 -0
  48. package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.d.ts +12 -0
  49. package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.js +39 -0
  50. package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.js.map +1 -0
  51. package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.d.ts +15 -0
  52. package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.js +57 -0
  53. package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.js.map +1 -0
  54. package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.d.ts +13 -0
  55. package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.js +46 -0
  56. package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.js.map +1 -0
  57. package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.d.ts +3 -0
  58. package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.js +30 -0
  59. package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.js.map +1 -0
  60. package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.d.ts +8 -0
  61. package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.js +29 -0
  62. package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.js.map +1 -0
  63. package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.d.ts +16 -0
  64. package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.js +49 -0
  65. package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.js.map +1 -0
  66. package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.d.ts +8 -0
  67. package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.js +29 -0
  68. package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.js.map +1 -0
  69. package/lib/translation/content-insights/cloud/result/CloudSegment.d.ts +6 -0
  70. package/lib/translation/content-insights/cloud/result/CloudSegment.js +40 -0
  71. package/lib/translation/content-insights/cloud/result/CloudSegment.js.map +1 -0
  72. package/lib/translation/content-insights/cloud/result/CloudSummarization.d.ts +6 -0
  73. package/lib/translation/content-insights/cloud/result/CloudSummarization.js +19 -0
  74. package/lib/translation/content-insights/cloud/result/CloudSummarization.js.map +1 -0
  75. package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.d.ts +20 -0
  76. package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.js +248 -0
  77. package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.js.map +1 -0
  78. package/lib/translation/content-insights/common/request/ContentInsightsRequest.d.ts +7 -0
  79. package/lib/translation/content-insights/common/request/ContentInsightsRequest.js +23 -0
  80. package/lib/translation/content-insights/common/request/ContentInsightsRequest.js.map +1 -0
  81. package/lib/translation/content-insights/common/result/ContentInsightsResult.d.ts +6 -0
  82. package/lib/translation/content-insights/common/result/ContentInsightsResult.js +19 -0
  83. package/lib/translation/content-insights/common/result/ContentInsightsResult.js.map +1 -0
  84. package/lib/translation/content-insights/common/result/Segment.d.ts +8 -0
  85. package/lib/translation/content-insights/common/result/Segment.js +29 -0
  86. package/lib/translation/content-insights/common/result/Segment.js.map +1 -0
  87. package/lib/translation/content-insights/common/result/Summarization.d.ts +8 -0
  88. package/lib/translation/content-insights/common/result/Summarization.js +25 -0
  89. package/lib/translation/content-insights/common/result/Summarization.js.map +1 -0
  90. package/lib/translation/content-insights/common/utils/ContentInsightsUtils.d.ts +4 -0
  91. package/lib/translation/content-insights/common/utils/ContentInsightsUtils.js +145 -0
  92. package/lib/translation/content-insights/common/utils/ContentInsightsUtils.js.map +1 -0
  93. package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.d.ts +13 -0
  94. package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.js +53 -0
  95. package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.js.map +1 -0
  96. package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.d.ts +12 -0
  97. package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.js +46 -0
  98. package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.js.map +1 -0
  99. package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.d.ts +5 -0
  100. package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.js +19 -0
  101. package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.js.map +1 -0
  102. package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.d.ts +9 -0
  103. package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.js +29 -0
  104. package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.js.map +1 -0
  105. package/lib/translation/content-insights/edge/result/EdgeSegment.d.ts +3 -0
  106. package/lib/translation/content-insights/edge/result/EdgeSegment.js +30 -0
  107. package/lib/translation/content-insights/edge/result/EdgeSegment.js.map +1 -0
  108. package/lib/translation/content-insights/edge/result/EdgeSummarization.d.ts +6 -0
  109. package/lib/translation/content-insights/edge/result/EdgeSummarization.js +19 -0
  110. package/lib/translation/content-insights/edge/result/EdgeSummarization.js.map +1 -0
  111. package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.d.ts +14 -0
  112. package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.js +96 -0
  113. package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.js.map +1 -0
  114. package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.d.ts +14 -0
  115. package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.js +72 -0
  116. package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.js.map +1 -0
  117. package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.d.ts +36 -0
  118. package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.js +136 -0
  119. package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.js.map +1 -0
  120. package/lib/translation/{translate → dictionaries}/cloud/result/CloudDictionariesResult.d.ts +3 -3
  121. package/lib/translation/{translate → dictionaries}/cloud/result/CloudDictionariesResult.js +0 -0
  122. package/lib/translation/dictionaries/cloud/result/CloudDictionariesResult.js.map +1 -0
  123. package/lib/translation/{translate/cloud/api/CloudDictionaryResponse.d.ts → dictionaries/cloud/result/CloudDictionary.d.ts} +1 -1
  124. package/lib/translation/{translate/cloud/api/CloudDictionaryResponse.js → dictionaries/cloud/result/CloudDictionary.js} +15 -15
  125. package/lib/translation/dictionaries/cloud/result/CloudDictionary.js.map +1 -0
  126. package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.d.ts +15 -0
  127. package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.js +51 -0
  128. package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.js.map +1 -0
  129. package/lib/translation/dictionaries/common/result/DictionariesResult.d.ts +7 -0
  130. package/lib/translation/{translate → dictionaries}/common/result/DictionariesResult.js +0 -0
  131. package/lib/translation/dictionaries/common/result/DictionariesResult.js.map +1 -0
  132. package/lib/translation/{translate/common/api/DictionaryResponse.d.ts → dictionaries/common/result/Dictionary.d.ts} +1 -1
  133. package/lib/translation/{translate/common/api/DictionaryResponse.js → dictionaries/common/result/Dictionary.js} +8 -8
  134. package/lib/translation/dictionaries/common/result/Dictionary.js.map +1 -0
  135. package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.d.ts +22 -0
  136. package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.js +84 -0
  137. package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.js.map +1 -0
  138. package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.d.ts +15 -0
  139. package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.js +58 -0
  140. package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.js.map +1 -0
  141. package/lib/translation/{translate → dictionaries}/edge/result/EdgeDictionariesResult.d.ts +3 -3
  142. package/lib/translation/{translate → dictionaries}/edge/result/EdgeDictionariesResult.js +0 -0
  143. package/lib/translation/dictionaries/edge/result/EdgeDictionariesResult.js.map +1 -0
  144. package/lib/translation/{translate/edge/api/EdgeDictionaryResponse.d.ts → dictionaries/edge/result/EdgeDictionary.d.ts} +1 -1
  145. package/lib/translation/{translate/edge/api/EdgeDictionaryResponse.js → dictionaries/edge/result/EdgeDictionary.js} +8 -8
  146. package/lib/translation/dictionaries/edge/result/EdgeDictionary.js.map +1 -0
  147. package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.d.ts +12 -0
  148. package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.js +51 -0
  149. package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.js.map +1 -0
  150. package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.js +2 -2
  151. package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.js.map +1 -1
  152. package/lib/translation/feedback/cloud/request/CloudFeedbackSortRequest.d.ts +1 -1
  153. package/lib/translation/feedback/cloud/{model → result}/CloudAuditData.d.ts +1 -1
  154. package/lib/translation/feedback/cloud/{model → result}/CloudAuditData.js +1 -1
  155. package/lib/translation/feedback/cloud/result/CloudAuditData.js.map +1 -0
  156. package/lib/translation/feedback/cloud/result/CloudFeedbackResult.d.ts +1 -1
  157. package/lib/translation/feedback/cloud/service/CloudFeedbackService.js +1 -1
  158. package/lib/translation/feedback/cloud/service/CloudFeedbackService.js.map +1 -1
  159. package/lib/translation/feedback/cloud/{validators → validator}/CloudFeedbackValidator.d.ts +1 -1
  160. package/lib/translation/feedback/cloud/{validators → validator}/CloudFeedbackValidator.js +1 -1
  161. package/lib/translation/feedback/cloud/validator/CloudFeedbackValidator.js.map +1 -0
  162. package/lib/translation/feedback/common/{model → result}/AuditData.d.ts +0 -0
  163. package/lib/translation/feedback/common/{model → result}/AuditData.js +0 -0
  164. package/lib/translation/feedback/common/result/AuditData.js.map +1 -0
  165. package/lib/translation/feedback/common/result/FeedbackResult.d.ts +1 -1
  166. package/lib/translation/feedback/common/{validators → validator}/FeedbackValidator.d.ts +0 -0
  167. package/lib/translation/feedback/common/{validators → validator}/FeedbackValidator.js +0 -0
  168. package/lib/translation/feedback/common/validator/FeedbackValidator.js.map +1 -0
  169. package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.d.ts +1 -1
  170. package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.js +1 -1
  171. package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.js.map +1 -1
  172. package/lib/translation/feedback/edge/service/EdgeFeedbackService.d.ts +1 -1
  173. package/lib/translation/feedback/edge/service/EdgeFeedbackService.js +1 -1
  174. package/lib/translation/feedback/edge/service/EdgeFeedbackService.js.map +1 -1
  175. package/lib/translation/feedback/edge/validator/EdgeFeedbackValidator.d.ts +3 -0
  176. package/lib/translation/feedback/edge/{validators → validator}/EdgeFeedbackValidator.js +1 -1
  177. package/lib/translation/feedback/edge/validator/EdgeFeedbackValidator.js.map +1 -0
  178. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.d.ts +21 -0
  179. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.js +81 -0
  180. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.js.map +1 -0
  181. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.d.ts +13 -0
  182. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.js +47 -0
  183. package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.js.map +1 -0
  184. package/lib/translation/{translate/cloud/api → language-pairs/cloud/result}/CloudLanguagePair.d.ts +2 -0
  185. package/lib/translation/{translate/cloud/api → language-pairs/cloud/result}/CloudLanguagePair.js +11 -0
  186. package/lib/translation/language-pairs/cloud/result/CloudLanguagePair.js.map +1 -0
  187. package/lib/translation/{translate → language-pairs}/cloud/result/CloudLanguagePairsResult.d.ts +1 -1
  188. package/lib/translation/{translate → language-pairs}/cloud/result/CloudLanguagePairsResult.js +0 -0
  189. package/lib/translation/language-pairs/cloud/result/CloudLanguagePairsResult.js.map +1 -0
  190. package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.d.ts +15 -0
  191. package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.js +45 -0
  192. package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.js.map +1 -0
  193. package/lib/translation/language-pairs/common/result/LanguagePair.d.ts +16 -0
  194. package/lib/translation/{translate/common/api → language-pairs/common/result}/LanguagePair.js +11 -0
  195. package/lib/translation/language-pairs/common/result/LanguagePair.js.map +1 -0
  196. package/lib/translation/{translate → language-pairs}/common/result/LanguagePairsResult.d.ts +1 -1
  197. package/lib/translation/{translate → language-pairs}/common/result/LanguagePairsResult.js +0 -0
  198. package/lib/translation/language-pairs/common/result/LanguagePairsResult.js.map +1 -0
  199. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.d.ts +17 -0
  200. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.js +89 -0
  201. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.js.map +1 -0
  202. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.d.ts +10 -0
  203. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.js +37 -0
  204. package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.js.map +1 -0
  205. package/lib/translation/language-pairs/edge/api/MemberPairApiModel.d.ts +31 -0
  206. package/lib/translation/language-pairs/edge/api/MemberPairApiModel.js +116 -0
  207. package/lib/translation/language-pairs/edge/api/MemberPairApiModel.js.map +1 -0
  208. package/lib/translation/language-pairs/edge/result/EdgeLanguagePair.d.ts +15 -0
  209. package/lib/translation/{translate/edge/api → language-pairs/edge/result}/EdgeLanguagePair.js +20 -0
  210. package/lib/translation/language-pairs/edge/result/EdgeLanguagePair.js.map +1 -0
  211. package/lib/translation/{translate → language-pairs}/edge/result/EdgeLanguagePairsResult.d.ts +1 -1
  212. package/lib/translation/{translate → language-pairs}/edge/result/EdgeLanguagePairsResult.js +0 -0
  213. package/lib/translation/language-pairs/edge/result/EdgeLanguagePairsResult.js.map +1 -0
  214. package/lib/translation/{translate/edge/api → language-pairs/edge/result}/MemberPair.d.ts +0 -0
  215. package/lib/translation/{translate/edge/api → language-pairs/edge/result}/MemberPair.js +0 -0
  216. package/lib/translation/language-pairs/edge/result/MemberPair.js.map +1 -0
  217. package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.d.ts +14 -0
  218. package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.js +80 -0
  219. package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.js.map +1 -0
  220. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.d.ts +13 -0
  221. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.js +68 -0
  222. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.js.map +1 -0
  223. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.d.ts +6 -0
  224. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.js +19 -0
  225. package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.js.map +1 -0
  226. package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.d.ts +3 -0
  227. package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.js +30 -0
  228. package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.js.map +1 -0
  229. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.d.ts +10 -0
  230. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.js +57 -0
  231. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.js.map +1 -0
  232. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.d.ts +6 -0
  233. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.js +19 -0
  234. package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.js.map +1 -0
  235. package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.d.ts +19 -0
  236. package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.js +72 -0
  237. package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.js.map +1 -0
  238. package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.d.ts +3 -0
  239. package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.js +30 -0
  240. package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.js.map +1 -0
  241. package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.d.ts +11 -0
  242. package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.js +39 -0
  243. package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.js.map +1 -0
  244. package/lib/translation/{translate/common/api/LanguagePair.d.ts → linguistic-options/common/request/GetLinguisticOptionsRequest.d.ts} +1 -4
  245. package/lib/translation/linguistic-options/common/request/GetLinguisticOptionsRequest.js +39 -0
  246. package/lib/translation/linguistic-options/common/request/GetLinguisticOptionsRequest.js.map +1 -0
  247. package/lib/translation/linguistic-options/common/result/LinguisticOption.d.ts +11 -0
  248. package/lib/translation/linguistic-options/common/result/LinguisticOption.js +39 -0
  249. package/lib/translation/linguistic-options/common/result/LinguisticOption.js.map +1 -0
  250. package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.d.ts +6 -0
  251. package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.js +19 -0
  252. package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.js.map +1 -0
  253. package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.d.ts +4 -0
  254. package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.js +25 -0
  255. package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.js.map +1 -0
  256. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.d.ts +7 -0
  257. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.js +46 -0
  258. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.js.map +1 -0
  259. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.d.ts +6 -0
  260. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.js +19 -0
  261. package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.js.map +1 -0
  262. package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.d.ts +9 -0
  263. package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.js +50 -0
  264. package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.js.map +1 -0
  265. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.d.ts +4 -0
  266. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.js +37 -0
  267. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.js.map +1 -0
  268. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.d.ts +6 -0
  269. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.js +19 -0
  270. package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.js.map +1 -0
  271. package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.d.ts +18 -0
  272. package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.js +101 -0
  273. package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.js.map +1 -0
  274. package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.d.ts +3 -0
  275. package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.js +30 -0
  276. package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.js.map +1 -0
  277. package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.d.ts +3 -0
  278. package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.js +30 -0
  279. package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.js.map +1 -0
  280. package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.d.ts +3 -0
  281. package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.js +21 -0
  282. package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.js.map +1 -1
  283. package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.d.ts +26 -0
  284. package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.js +80 -0
  285. package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.js.map +1 -0
  286. package/lib/translation/translate/cloud/result/CloudTranslationFileResult.d.ts +0 -3
  287. package/lib/translation/translate/cloud/result/CloudTranslationFileResult.js +0 -10
  288. package/lib/translation/translate/cloud/result/CloudTranslationFileResult.js.map +1 -1
  289. package/lib/translation/translate/cloud/result/CloudTranslationTextResult.d.ts +3 -3
  290. package/lib/translation/translate/cloud/result/CloudTranslationTextResult.js +3 -3
  291. package/lib/translation/translate/cloud/result/CloudTranslationTextResult.js.map +1 -1
  292. package/lib/translation/translate/common/request/RetrieveFileRequest.d.ts +11 -0
  293. package/lib/translation/translate/common/request/RetrieveFileRequest.js +39 -0
  294. package/lib/translation/translate/common/request/RetrieveFileRequest.js.map +1 -0
  295. package/lib/translation/translate/common/request/TranslateBatchFileRequest.d.ts +3 -0
  296. package/lib/translation/translate/common/request/TranslateBatchFileRequest.js +10 -0
  297. package/lib/translation/translate/common/request/TranslateBatchFileRequest.js.map +1 -1
  298. package/lib/translation/translate/common/request/TranslateRequest.d.ts +3 -0
  299. package/lib/translation/translate/common/request/TranslateRequest.js +10 -0
  300. package/lib/translation/translate/common/request/TranslateRequest.js.map +1 -1
  301. package/lib/translation/translate/common/result/TranslationFileResult.d.ts +6 -0
  302. package/lib/translation/translate/common/result/TranslationFileResult.js +20 -0
  303. package/lib/translation/translate/common/result/TranslationFileResult.js.map +1 -1
  304. package/lib/translation/translate/common/utils/TranslateFileUtil.d.ts +3 -1
  305. package/lib/translation/translate/common/utils/TranslateFileUtil.js +26 -53
  306. package/lib/translation/translate/common/utils/TranslateFileUtil.js.map +1 -1
  307. package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.d.ts +7 -0
  308. package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.js +40 -0
  309. package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.js.map +1 -0
  310. package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.d.ts +2 -2
  311. package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.js +15 -14
  312. package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.js.map +1 -1
  313. package/lib/translation/translate/edge/request/{EdgeTranslateApiModel.d.ts → EdgeTranslateRequest.d.ts} +1 -1
  314. package/lib/translation/translate/edge/request/{EdgeTranslateApiModel.js → EdgeTranslateRequest.js} +14 -14
  315. package/lib/translation/translate/edge/request/EdgeTranslateRequest.js.map +1 -0
  316. package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.d.ts +2 -2
  317. package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.js +15 -14
  318. package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.js.map +1 -1
  319. package/lib/translation/translate/edge/result/EdgeTranslationFileResult.d.ts +0 -3
  320. package/lib/translation/translate/edge/result/EdgeTranslationFileResult.js +0 -10
  321. package/lib/translation/translate/edge/result/EdgeTranslationFileResult.js.map +1 -1
  322. package/lib/version.d.ts +1 -1
  323. package/lib/version.js +1 -1
  324. package/package.json +2 -2
  325. package/lib/translation/feedback/cloud/model/CloudAuditData.js.map +0 -1
  326. package/lib/translation/feedback/cloud/model/CloudFeedbackSortCriteria.js.map +0 -1
  327. package/lib/translation/feedback/cloud/validators/CloudFeedbackValidator.js.map +0 -1
  328. package/lib/translation/feedback/common/model/AuditData.js.map +0 -1
  329. package/lib/translation/feedback/common/validators/FeedbackValidator.js.map +0 -1
  330. package/lib/translation/feedback/edge/validators/EdgeFeedbackValidator.d.ts +0 -3
  331. package/lib/translation/feedback/edge/validators/EdgeFeedbackValidator.js.map +0 -1
  332. package/lib/translation/translate/cloud/api/CloudDictionaryResponse.js.map +0 -1
  333. package/lib/translation/translate/cloud/api/CloudLanguagePair.js.map +0 -1
  334. package/lib/translation/translate/cloud/result/CloudDictionariesResult.js.map +0 -1
  335. package/lib/translation/translate/cloud/result/CloudLanguagePairsResult.js.map +0 -1
  336. package/lib/translation/translate/common/api/DictionaryResponse.js.map +0 -1
  337. package/lib/translation/translate/common/api/LanguagePair.js.map +0 -1
  338. package/lib/translation/translate/common/result/DictionariesResult.d.ts +0 -7
  339. package/lib/translation/translate/common/result/DictionariesResult.js.map +0 -1
  340. package/lib/translation/translate/common/result/LanguagePairsResult.js.map +0 -1
  341. package/lib/translation/translate/edge/api/EdgeDictionaryResponse.js.map +0 -1
  342. package/lib/translation/translate/edge/api/EdgeLanguagePair.d.ts +0 -9
  343. package/lib/translation/translate/edge/api/EdgeLanguagePair.js.map +0 -1
  344. package/lib/translation/translate/edge/api/MemberPair.js.map +0 -1
  345. package/lib/translation/translate/edge/request/EdgeTranslateApiModel.js.map +0 -1
  346. package/lib/translation/translate/edge/result/EdgeDictionariesResult.js.map +0 -1
  347. package/lib/translation/translate/edge/result/EdgeLanguagePairsResult.js.map +0 -1
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Segment = /** @class */ (function () {
4
+ function Segment() {
5
+ }
6
+ Object.defineProperty(Segment.prototype, "text", {
7
+ get: function () {
8
+ return this._text;
9
+ },
10
+ set: function (value) {
11
+ this._text = value;
12
+ },
13
+ enumerable: false,
14
+ configurable: true
15
+ });
16
+ Object.defineProperty(Segment.prototype, "score", {
17
+ get: function () {
18
+ return this._score;
19
+ },
20
+ set: function (value) {
21
+ this._score = value;
22
+ },
23
+ enumerable: false,
24
+ configurable: true
25
+ });
26
+ return Segment;
27
+ }());
28
+ exports.default = Segment;
29
+ //# sourceMappingURL=Segment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Segment.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/common/result/Segment.ts"],"names":[],"mappings":";;AAAA;IAAA;IAmBA,CAAC;IAfG,sBAAI,yBAAI;aAAR;YACI,OAAO,IAAI,CAAC,KAAK,CAAC;QACtB,CAAC;aAED,UAAS,KAAyB;YAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACvB,CAAC;;;OAJA;IAMD,sBAAI,0BAAK;aAAT;YACI,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;aAED,UAAU,KAAyB;YAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;;;OAJA;IAKL,cAAC;AAAD,CAAC,AAnBD,IAmBC"}
@@ -0,0 +1,8 @@
1
+ import Segment from './Segment';
2
+ export default class Summarization {
3
+ private _segments;
4
+ constructor();
5
+ get segments(): Segment[] | undefined;
6
+ set segments(value: Segment[] | undefined);
7
+ addSegment(segment: Segment): Summarization;
8
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Summarization = /** @class */ (function () {
4
+ function Summarization() {
5
+ this.segments = [];
6
+ }
7
+ Object.defineProperty(Summarization.prototype, "segments", {
8
+ get: function () {
9
+ return this._segments;
10
+ },
11
+ set: function (value) {
12
+ this._segments = value;
13
+ },
14
+ enumerable: false,
15
+ configurable: true
16
+ });
17
+ Summarization.prototype.addSegment = function (segment) {
18
+ var _a;
19
+ (_a = this.segments) === null || _a === void 0 ? void 0 : _a.push(segment);
20
+ return this;
21
+ };
22
+ return Summarization;
23
+ }());
24
+ exports.default = Summarization;
25
+ //# sourceMappingURL=Summarization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Summarization.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/common/result/Summarization.ts"],"names":[],"mappings":";;AAEA;IAGI;QACI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACvB,CAAC;IAED,sBAAI,mCAAQ;aAAZ;YACI,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAED,UAAa,KAA4B;YACrC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;;;OAJA;IAMM,kCAAU,GAAjB,UAAkB,OAAgB;;QAC9B,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,oBAAC;AAAD,CAAC,AAnBD,IAmBC"}
@@ -0,0 +1,4 @@
1
+ import CloudFileContentInsightsRequest from '../../cloud/request/CloudFileContentInsightsRequest';
2
+ export declare const validateInputData: (contentInsightsRequest: CloudFileContentInsightsRequest) => Promise<string | null | undefined>;
3
+ export declare const validateEdgeContentInsightsTranslationIds: (translationIds: string[]) => string | undefined;
4
+ export declare const getToManyTranslationIdsEdgeError: () => string;
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.getToManyTranslationIdsEdgeError = exports.validateEdgeContentInsightsTranslationIds = exports.validateInputData = void 0;
43
+ var TranslationConstants_1 = require("../../../../common/constants/TranslationConstants");
44
+ var Utils_1 = __importDefault(require("../../../../common/utils/Utils"));
45
+ var validateInputData = function (contentInsightsRequest) { return __awaiter(void 0, void 0, void 0, function () {
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0:
49
+ if (!contentInsightsRequest.files) {
50
+ return [2 /*return*/, TranslationConstants_1.MISSING_REQUIRED_INPUT_FILE_ERROR];
51
+ }
52
+ if (!Utils_1.default.isBrowser()) return [3 /*break*/, 1];
53
+ return [2 /*return*/, validateInputFileInBrowser(contentInsightsRequest.files)];
54
+ case 1: return [4 /*yield*/, validateInputInNode(contentInsightsRequest)];
55
+ case 2: return [2 /*return*/, _a.sent()];
56
+ }
57
+ });
58
+ }); };
59
+ exports.validateInputData = validateInputData;
60
+ var validateInputFileInBrowser = function (inputFile) {
61
+ if (inputFile && typeof inputFile !== 'string' && Utils_1.default.isArrayOfFiles(inputFile) && !(inputFile instanceof File)) {
62
+ var largeFile = inputFile.find(function (file) { return Utils_1.default.getFileSize(file) > TranslationConstants_1.MAX_FILE_SIZE_LIMIT; });
63
+ return largeFile ? Utils_1.default.getFileSizeExceededError(largeFile) : null;
64
+ }
65
+ else if (inputFile instanceof File) {
66
+ var fileSize = Utils_1.default.getFileSize(inputFile);
67
+ return fileSize > TranslationConstants_1.MAX_FILE_SIZE_LIMIT ? Utils_1.default.getFileSizeExceededError(inputFile) : null;
68
+ }
69
+ else {
70
+ return TranslationConstants_1.REQUIRED_INPUT_FILE_OF_TYPE_OBJECT_ERROR;
71
+ }
72
+ };
73
+ var validateInputInNode = function (contentInsightsRequest) { return __awaiter(void 0, void 0, void 0, function () {
74
+ var error;
75
+ return __generator(this, function (_a) {
76
+ switch (_a.label) {
77
+ case 0:
78
+ if (!(typeof contentInsightsRequest.files === 'string')) return [3 /*break*/, 4];
79
+ error = void 0;
80
+ if (!Utils_1.default.isDirectoryPath(contentInsightsRequest.files)) return [3 /*break*/, 2];
81
+ return [4 /*yield*/, validateInputDirectoryForNode(contentInsightsRequest.files)];
82
+ case 1:
83
+ error = _a.sent();
84
+ return [3 /*break*/, 3];
85
+ case 2:
86
+ if (Utils_1.default.isFilePath(contentInsightsRequest.files)) {
87
+ error = validateInputFileInNode(contentInsightsRequest.files);
88
+ }
89
+ else {
90
+ return [2 /*return*/, TranslationConstants_1.INVALID_FILE_OR_DIRECTORY_PATH_ERROR + contentInsightsRequest.files];
91
+ }
92
+ _a.label = 3;
93
+ case 3:
94
+ if (error) {
95
+ return [2 /*return*/, error];
96
+ }
97
+ return [3 /*break*/, 5];
98
+ case 4: return [2 /*return*/, TranslationConstants_1.REQUIRED_INPUT_OF_TYPE_STRING_ERROR];
99
+ case 5: return [2 /*return*/];
100
+ }
101
+ });
102
+ }); };
103
+ var validateInputDirectoryForNode = function (input) { return __awaiter(void 0, void 0, void 0, function () {
104
+ var fs, path, absolutePath, files, largeFile, e_1;
105
+ return __generator(this, function (_a) {
106
+ switch (_a.label) {
107
+ case 0:
108
+ fs = require('fs');
109
+ path = require('path');
110
+ absolutePath = Utils_1.default.getAbsolutePath(input);
111
+ _a.label = 1;
112
+ case 1:
113
+ _a.trys.push([1, 3, , 4]);
114
+ return [4 /*yield*/, fs.promises.readdir(absolutePath)];
115
+ case 2:
116
+ files = _a.sent();
117
+ if (!files || !files.length) {
118
+ return [2 /*return*/, TranslationConstants_1.MISSING_REQUIRED_INPUT_FILES_ERROR];
119
+ }
120
+ largeFile = files.find(function (file) { return Utils_1.default.getFileSize(path.join(absolutePath, file)) > TranslationConstants_1.MAX_FILE_SIZE_LIMIT; });
121
+ return [2 /*return*/, largeFile ? Utils_1.default.getFileSizeExceededError(largeFile) : null];
122
+ case 3:
123
+ e_1 = _a.sent();
124
+ return [2 /*return*/, TranslationConstants_1.READ_FILES_FROM_DIRECTORY_FAILED_ERROR];
125
+ case 4: return [2 /*return*/];
126
+ }
127
+ });
128
+ }); };
129
+ var validateInputFileInNode = function (inputFile) {
130
+ var fileSize = Utils_1.default.getFileSize(inputFile);
131
+ if (fileSize > TranslationConstants_1.MAX_FILE_SIZE_LIMIT) {
132
+ return Utils_1.default.getFileSizeExceededError(inputFile);
133
+ }
134
+ };
135
+ var validateEdgeContentInsightsTranslationIds = function (translationIds) {
136
+ if (translationIds && translationIds.length > 1) {
137
+ return (0, exports.getToManyTranslationIdsEdgeError)();
138
+ }
139
+ };
140
+ exports.validateEdgeContentInsightsTranslationIds = validateEdgeContentInsightsTranslationIds;
141
+ var getToManyTranslationIdsEdgeError = function () {
142
+ return 'Too many translationIds. Please insert only one translationId or use CloudLanguageWeaverClient';
143
+ };
144
+ exports.getToManyTranslationIdsEdgeError = getToManyTranslationIdsEdgeError;
145
+ //# sourceMappingURL=ContentInsightsUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentInsightsUtils.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/common/utils/ContentInsightsUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC;;;gBAEpE,sBAAO,6DAAsC,EAAC;;;;KAErD,CAAC;AAEF,IAAM,uBAAuB,GAAG,UAAC,SAAiB;IAC9C,IAAM,QAAQ,GAAG,eAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAE9C,IAAI,QAAQ,GAAG,0CAAmB,EAAE;QAChC,OAAO,eAAK,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;KACpD;AACL,CAAC,CAAC;AAEK,IAAM,yCAAyC,GAAG,UAAC,cAAwB;IAC9E,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7C,OAAO,IAAA,wCAAgC,GAAE,CAAC;KAC7C;AACL,CAAC,CAAC;AAJW,QAAA,yCAAyC,6CAIpD;AAEK,IAAM,gCAAgC,GAAG;IAC5C,OAAO,gGAAgG,CAAC;AAC5G,CAAC,CAAC;AAFW,QAAA,gCAAgC,oCAE3C"}
@@ -0,0 +1,13 @@
1
+ import EdgeSegmentApiModel from './EdgeSegmentApiModel';
2
+ import EdgeContentInsightsResult from '../result/EdgeContentInsightsResult';
3
+ import ContentInsightsResult from '../../common/result/ContentInsightsResult';
4
+ export default class EdgeContentInsightsResponse {
5
+ private _title;
6
+ private _summary;
7
+ get title(): string | undefined;
8
+ set title(value: string | undefined);
9
+ get summary(): EdgeSegmentApiModel[] | undefined;
10
+ set summary(value: EdgeSegmentApiModel[] | undefined);
11
+ toEdgeContentInsightsResult(): EdgeContentInsightsResult;
12
+ toContentInsightsResult(): ContentInsightsResult;
13
+ }
@@ -0,0 +1,53 @@
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
+ var EdgeContentInsightsResult_1 = __importDefault(require("../result/EdgeContentInsightsResult"));
7
+ var EdgeSummarization_1 = __importDefault(require("../result/EdgeSummarization"));
8
+ var ContentInsightsResult_1 = __importDefault(require("../../common/result/ContentInsightsResult"));
9
+ var Summarization_1 = __importDefault(require("../../common/result/Summarization"));
10
+ var EdgeContentInsightsResponse = /** @class */ (function () {
11
+ function EdgeContentInsightsResponse() {
12
+ }
13
+ Object.defineProperty(EdgeContentInsightsResponse.prototype, "title", {
14
+ get: function () {
15
+ return this._title;
16
+ },
17
+ set: function (value) {
18
+ this._title = value;
19
+ },
20
+ enumerable: false,
21
+ configurable: true
22
+ });
23
+ Object.defineProperty(EdgeContentInsightsResponse.prototype, "summary", {
24
+ get: function () {
25
+ return this._summary;
26
+ },
27
+ set: function (value) {
28
+ this._summary = value;
29
+ },
30
+ enumerable: false,
31
+ configurable: true
32
+ });
33
+ EdgeContentInsightsResponse.prototype.toEdgeContentInsightsResult = function () {
34
+ var _a;
35
+ var summarization = new EdgeSummarization_1.default();
36
+ summarization.segments = (_a = this.summary) === null || _a === void 0 ? void 0 : _a.map(function (segment) { return segment.toEdgeSegment(); });
37
+ var result = new EdgeContentInsightsResult_1.default();
38
+ result.title = this.title;
39
+ result.summarization = summarization;
40
+ return result;
41
+ };
42
+ EdgeContentInsightsResponse.prototype.toContentInsightsResult = function () {
43
+ var _a;
44
+ var summarization = new Summarization_1.default();
45
+ summarization.segments = (_a = this.summary) === null || _a === void 0 ? void 0 : _a.map(function (segment) { return segment.toSegment(); });
46
+ var result = new ContentInsightsResult_1.default();
47
+ result.summarization = summarization;
48
+ return result;
49
+ };
50
+ return EdgeContentInsightsResponse;
51
+ }());
52
+ exports.default = EdgeContentInsightsResponse;
53
+ //# sourceMappingURL=EdgeContentInsightsResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeContentInsightsResponse.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/edge/api/EdgeContentInsightsResponse.ts"],"names":[],"mappings":";;;;;AACA,kGAA4E;AAC5E,kFAA4D;AAC5D,oGAA8E;AAC9E,oFAA8D;AAE9D;IAAA;IAsCA,CAAC;IAlCG,sBAAI,8CAAK;aAAT;YACI,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;aAED,UAAU,KAAyB;YAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;;;OAJA;IAMD,sBAAI,gDAAO;aAAX;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAAY,KAAwC;YAChD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAJA;IAMD,iEAA2B,GAA3B;;QACI,IAAM,aAAa,GAAG,IAAI,2BAAiB,EAAE,CAAC;QAC9C,aAAa,CAAC,QAAQ,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,GAAG,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,aAAa,EAAE,EAAvB,CAAuB,CAAC,CAAC;QACjF,IAAM,MAAM,GAAG,IAAI,mCAAyB,EAAE,CAAC;QAC/C,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;QAErC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,6DAAuB,GAAvB;;QACI,IAAM,aAAa,GAAG,IAAI,uBAAa,EAAE,CAAC;QAC1C,aAAa,CAAC,QAAQ,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,GAAG,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,SAAS,EAAE,EAAnB,CAAmB,CAAC,CAAC;QAC7E,IAAM,MAAM,GAAG,IAAI,+BAAqB,EAAE,CAAC;QAC3C,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;QAErC,OAAO,MAAM,CAAC;IAClB,CAAC;IACL,kCAAC;AAAD,CAAC,AAtCD,IAsCC"}
@@ -0,0 +1,12 @@
1
+ import EdgeSegment from '../result/EdgeSegment';
2
+ import Segment from '../../common/result/Segment';
3
+ export default class EdgeSegmentApiModel {
4
+ private _segment;
5
+ private _score;
6
+ get segment(): string | undefined;
7
+ set segment(value: string | undefined);
8
+ get score(): number | undefined;
9
+ set score(value: number | undefined);
10
+ toEdgeSegment(): EdgeSegment;
11
+ toSegment(): Segment;
12
+ }
@@ -0,0 +1,46 @@
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
+ var EdgeSegment_1 = __importDefault(require("../result/EdgeSegment"));
7
+ var Segment_1 = __importDefault(require("../../common/result/Segment"));
8
+ var EdgeSegmentApiModel = /** @class */ (function () {
9
+ function EdgeSegmentApiModel() {
10
+ }
11
+ Object.defineProperty(EdgeSegmentApiModel.prototype, "segment", {
12
+ get: function () {
13
+ return this._segment;
14
+ },
15
+ set: function (value) {
16
+ this._segment = value;
17
+ },
18
+ enumerable: false,
19
+ configurable: true
20
+ });
21
+ Object.defineProperty(EdgeSegmentApiModel.prototype, "score", {
22
+ get: function () {
23
+ return this._score;
24
+ },
25
+ set: function (value) {
26
+ this._score = value;
27
+ },
28
+ enumerable: false,
29
+ configurable: true
30
+ });
31
+ EdgeSegmentApiModel.prototype.toEdgeSegment = function () {
32
+ var edgeSegment = new EdgeSegment_1.default();
33
+ edgeSegment.text = this.segment;
34
+ edgeSegment.score = this.score;
35
+ return edgeSegment;
36
+ };
37
+ EdgeSegmentApiModel.prototype.toSegment = function () {
38
+ var segment = new Segment_1.default();
39
+ segment.text = this.segment;
40
+ segment.score = this.score;
41
+ return segment;
42
+ };
43
+ return EdgeSegmentApiModel;
44
+ }());
45
+ exports.default = EdgeSegmentApiModel;
46
+ //# sourceMappingURL=EdgeSegmentApiModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeSegmentApiModel.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/edge/api/EdgeSegmentApiModel.ts"],"names":[],"mappings":";;;;;AAAA,sEAAgD;AAChD,wEAAkD;AAElD;IAAA;IAmCA,CAAC;IA/BG,sBAAI,wCAAO;aAAX;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAAY,KAAyB;YACjC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAJA;IAMD,sBAAI,sCAAK;aAAT;YACI,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;aAED,UAAU,KAAyB;YAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;;;OAJA;IAMD,2CAAa,GAAb;QACI,IAAM,WAAW,GAAG,IAAI,qBAAW,EAAE,CAAC;QACtC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;QAChC,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE/B,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,uCAAS,GAAT;QACI,IAAM,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE3B,OAAO,OAAO,CAAC;IACnB,CAAC;IACL,0BAAC;AAAD,CAAC,AAnCD,IAmCC"}
@@ -0,0 +1,5 @@
1
+ export default class EdgeContentInsightsRequest {
2
+ private _translationId;
3
+ get translationId(): string | undefined;
4
+ set translationId(value: string | undefined);
5
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var EdgeContentInsightsRequest = /** @class */ (function () {
4
+ function EdgeContentInsightsRequest() {
5
+ }
6
+ Object.defineProperty(EdgeContentInsightsRequest.prototype, "translationId", {
7
+ get: function () {
8
+ return this._translationId;
9
+ },
10
+ set: function (value) {
11
+ this._translationId = value;
12
+ },
13
+ enumerable: false,
14
+ configurable: true
15
+ });
16
+ return EdgeContentInsightsRequest;
17
+ }());
18
+ exports.default = EdgeContentInsightsRequest;
19
+ //# sourceMappingURL=EdgeContentInsightsRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeContentInsightsRequest.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/edge/request/EdgeContentInsightsRequest.ts"],"names":[],"mappings":";;AAAA;IAAA;IAUA,CAAC;IAPG,sBAAI,qDAAa;aAAjB;YACI,OAAO,IAAI,CAAC,cAAc,CAAC;QAC/B,CAAC;aAED,UAAkB,KAAyB;YACvC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAChC,CAAC;;;OAJA;IAKL,iCAAC;AAAD,CAAC,AAVD,IAUC"}
@@ -0,0 +1,9 @@
1
+ import EdgeSummarization from './EdgeSummarization';
2
+ export default class EdgeContentInsightsResult {
3
+ private _title;
4
+ private _summarization;
5
+ get title(): string | undefined;
6
+ set title(value: string | undefined);
7
+ get summarization(): EdgeSummarization | undefined;
8
+ set summarization(value: EdgeSummarization | undefined);
9
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var EdgeContentInsightsResult = /** @class */ (function () {
4
+ function EdgeContentInsightsResult() {
5
+ }
6
+ Object.defineProperty(EdgeContentInsightsResult.prototype, "title", {
7
+ get: function () {
8
+ return this._title;
9
+ },
10
+ set: function (value) {
11
+ this._title = value;
12
+ },
13
+ enumerable: false,
14
+ configurable: true
15
+ });
16
+ Object.defineProperty(EdgeContentInsightsResult.prototype, "summarization", {
17
+ get: function () {
18
+ return this._summarization;
19
+ },
20
+ set: function (value) {
21
+ this._summarization = value;
22
+ },
23
+ enumerable: false,
24
+ configurable: true
25
+ });
26
+ return EdgeContentInsightsResult;
27
+ }());
28
+ exports.default = EdgeContentInsightsResult;
29
+ //# sourceMappingURL=EdgeContentInsightsResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeContentInsightsResult.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/edge/result/EdgeContentInsightsResult.ts"],"names":[],"mappings":";;AAEA;IAAA;IAmBA,CAAC;IAfG,sBAAI,4CAAK;aAAT;YACI,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;aAED,UAAU,KAAyB;YAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;;;OAJA;IAMD,sBAAI,oDAAa;aAAjB;YACI,OAAO,IAAI,CAAC,cAAc,CAAC;QAC/B,CAAC;aAED,UAAkB,KAAoC;YAClD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAChC,CAAC;;;OAJA;IAKL,gCAAC;AAAD,CAAC,AAnBD,IAmBC"}
@@ -0,0 +1,3 @@
1
+ import Segment from '../../common/result/Segment';
2
+ export default class EdgeSegment extends Segment {
3
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var Segment_1 = __importDefault(require("../../common/result/Segment"));
22
+ var EdgeSegment = /** @class */ (function (_super) {
23
+ __extends(EdgeSegment, _super);
24
+ function EdgeSegment() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ return EdgeSegment;
28
+ }(Segment_1.default));
29
+ exports.default = EdgeSegment;
30
+ //# sourceMappingURL=EdgeSegment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeSegment.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/edge/result/EdgeSegment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,wEAAkD;AAElD;IAAyC,+BAAO;IAAhD;;IAAkD,CAAC;IAAD,kBAAC;AAAD,CAAC,AAAnD,CAAyC,iBAAO,GAAG"}
@@ -0,0 +1,6 @@
1
+ import EdgeSegment from './EdgeSegment';
2
+ export default class EdgeSummarization {
3
+ private _segments;
4
+ get segments(): EdgeSegment[] | undefined;
5
+ set segments(value: EdgeSegment[] | undefined);
6
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var EdgeSummarization = /** @class */ (function () {
4
+ function EdgeSummarization() {
5
+ }
6
+ Object.defineProperty(EdgeSummarization.prototype, "segments", {
7
+ get: function () {
8
+ return this._segments;
9
+ },
10
+ set: function (value) {
11
+ this._segments = value;
12
+ },
13
+ enumerable: false,
14
+ configurable: true
15
+ });
16
+ return EdgeSummarization;
17
+ }());
18
+ exports.default = EdgeSummarization;
19
+ //# sourceMappingURL=EdgeSummarization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeSummarization.js","sourceRoot":"","sources":["../../../../../src/translation/content-insights/edge/result/EdgeSummarization.ts"],"names":[],"mappings":";;AAEA;IAAA;IAUA,CAAC;IAPG,sBAAI,uCAAQ;aAAZ;YACI,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAED,UAAa,KAAgC;YACzC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;;;OAJA;IAKL,wBAAC;AAAD,CAAC,AAVD,IAUC"}
@@ -0,0 +1,14 @@
1
+ import RestClient from '../../../../common/external/communication/RestClient';
2
+ import Token from '../../../../common/auth/domain/Token';
3
+ import EdgeContentInsightsResult from '../result/EdgeContentInsightsResult';
4
+ import ContentInsightsResult from '../../common/result/ContentInsightsResult';
5
+ import EdgeContentInsightsRequest from '../request/EdgeContentInsightsRequest';
6
+ import ContentInsightsRequest from '../../common/request/ContentInsightsRequest';
7
+ export default class EdgeContentInsightsService {
8
+ private _client;
9
+ private _token;
10
+ constructor(client: RestClient, token: Token | undefined);
11
+ getContentInsightsResultForTranslation(contentInsightsRequest: ContentInsightsRequest): Promise<ContentInsightsResult>;
12
+ getEdgeContentInsightsResultForTranslation(contentInsightsRequest: EdgeContentInsightsRequest): Promise<EdgeContentInsightsResult>;
13
+ private getEdgeContentInsightsForExistingTranslationResponse;
14
+ }
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var TranslationConstants_1 = require("../../../../common/constants/TranslationConstants");
43
+ var ContentInsightsUtils_1 = require("../../common/utils/ContentInsightsUtils");
44
+ var EdgeContentInsightsRequest_1 = __importDefault(require("../request/EdgeContentInsightsRequest"));
45
+ var EdgeContentInsightsResponse_1 = __importDefault(require("../api/EdgeContentInsightsResponse"));
46
+ var EdgeSegmentApiModel_1 = __importDefault(require("../api/EdgeSegmentApiModel"));
47
+ var EdgeContentInsightsService = /** @class */ (function () {
48
+ function EdgeContentInsightsService(client, token) {
49
+ this._client = client;
50
+ this._token = token;
51
+ }
52
+ EdgeContentInsightsService.prototype.getContentInsightsResultForTranslation = function (contentInsightsRequest) {
53
+ var validationError = (0, ContentInsightsUtils_1.validateEdgeContentInsightsTranslationIds)(contentInsightsRequest.translationIds);
54
+ if (validationError) {
55
+ return Promise.reject({ message: validationError });
56
+ }
57
+ var createContentInsightsRequest = new EdgeContentInsightsRequest_1.default();
58
+ createContentInsightsRequest.translationId = contentInsightsRequest.translationIds[0];
59
+ return this.getEdgeContentInsightsForExistingTranslationResponse(createContentInsightsRequest)
60
+ .then(function (response) { return Promise.resolve(response.toContentInsightsResult()); })
61
+ .catch(function (e) { return Promise.reject(e); });
62
+ };
63
+ EdgeContentInsightsService.prototype.getEdgeContentInsightsResultForTranslation = function (contentInsightsRequest) {
64
+ var createContentInsightsRequest = new EdgeContentInsightsRequest_1.default();
65
+ createContentInsightsRequest.translationId = contentInsightsRequest.translationId;
66
+ return this.getEdgeContentInsightsForExistingTranslationResponse(createContentInsightsRequest)
67
+ .then(function (response) { return Promise.resolve(response.toEdgeContentInsightsResult()); })
68
+ .catch(function (e) { return Promise.reject(e); });
69
+ };
70
+ EdgeContentInsightsService.prototype.getEdgeContentInsightsForExistingTranslationResponse = function (createContentInsightsRequest) {
71
+ var _this = this;
72
+ return new Promise(function (resolve, reject) {
73
+ _this._client
74
+ .requestJson(_this._token, 'GET', (0, TranslationConstants_1.getEdgeCreateContentInsightsPath)(createContentInsightsRequest.translationId))
75
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
76
+ var contentInsightsResponse;
77
+ var _a;
78
+ return __generator(this, function (_b) {
79
+ contentInsightsResponse = new EdgeContentInsightsResponse_1.default();
80
+ Object.assign(contentInsightsResponse, response);
81
+ contentInsightsResponse.summary = (_a = response.summary) === null || _a === void 0 ? void 0 : _a.map(function (segment) {
82
+ var edgeSegment = new EdgeSegmentApiModel_1.default();
83
+ Object.assign(edgeSegment, segment);
84
+ return edgeSegment;
85
+ });
86
+ resolve(contentInsightsResponse);
87
+ return [2 /*return*/];
88
+ });
89
+ }); })
90
+ .catch(function (error) { return reject(error); });
91
+ });
92
+ };
93
+ return EdgeContentInsightsService;
94
+ }());
95
+ exports.default = EdgeContentInsightsService;
96
+ //# sourceMappingURL=EdgeContentInsightsService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeContentInsightsService.js","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