@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.
- package/lib/common/constants/ApprovalStatus.d.ts +1 -1
- package/lib/common/constants/ApprovalStatus.js.map +1 -1
- package/lib/{translation/feedback/cloud/model → common/constants}/CloudFeedbackSortCriteria.d.ts +0 -0
- package/lib/{translation/feedback/cloud/model → common/constants}/CloudFeedbackSortCriteria.js +0 -0
- package/lib/common/constants/CloudFeedbackSortCriteria.js.map +1 -0
- package/lib/common/constants/Format.d.ts +1 -1
- package/lib/common/constants/Format.js +4 -1
- package/lib/common/constants/Format.js.map +1 -1
- package/lib/common/constants/FormatToMimeType.js +2 -0
- package/lib/common/constants/FormatToMimeType.js.map +1 -1
- package/lib/common/constants/PdfConverter.d.ts +15 -0
- package/lib/common/constants/PdfConverter.js +22 -0
- package/lib/common/constants/PdfConverter.js.map +1 -0
- package/lib/common/constants/QualityEstimation.d.ts +6 -0
- package/lib/common/constants/QualityEstimation.js +17 -0
- package/lib/common/constants/QualityEstimation.js.map +1 -0
- package/lib/common/constants/Statuses.d.ts +6 -0
- package/lib/common/constants/Statuses.js +7 -1
- package/lib/common/constants/Statuses.js.map +1 -1
- package/lib/common/constants/TranslationConstants.d.ts +20 -3
- package/lib/common/constants/TranslationConstants.js +25 -5
- package/lib/common/constants/TranslationConstants.js.map +1 -1
- package/lib/common/exceptions/ContentInsightsException.d.ts +4 -0
- package/lib/common/exceptions/ContentInsightsException.js +17 -0
- package/lib/common/exceptions/ContentInsightsException.js.map +1 -0
- package/lib/common/external/communication/RestClient.d.ts +1 -1
- package/lib/common/external/communication/RestClient.js +14 -16
- package/lib/common/external/communication/RestClient.js.map +1 -1
- package/lib/common/utils/HttpUtils.d.ts +1 -0
- package/lib/common/utils/HttpUtils.js +13 -0
- package/lib/common/utils/HttpUtils.js.map +1 -1
- package/lib/common/utils/Utils.d.ts +7 -0
- package/lib/common/utils/Utils.js +127 -0
- package/lib/common/utils/Utils.js.map +1 -1
- package/lib/index.d.ts +62 -19
- package/lib/index.js +104 -20
- package/lib/index.js.map +1 -1
- package/lib/translation/common/LanguageWeaverClient.d.ts +19 -2
- package/lib/translation/common/cloud/CloudLanguageWeaverClient.d.ts +45 -4
- package/lib/translation/common/cloud/CloudLanguageWeaverClient.js +239 -100
- package/lib/translation/common/cloud/CloudLanguageWeaverClient.js.map +1 -1
- package/lib/translation/common/edge/EdgeLanguageWeaverClient.d.ts +43 -6
- package/lib/translation/common/edge/EdgeLanguageWeaverClient.js +287 -150
- package/lib/translation/common/edge/EdgeLanguageWeaverClient.js.map +1 -1
- package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.d.ts +1 -1
- package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.js +1 -1
- package/lib/translation/common/edge/utils/EdgeLanguagePairUtil.js.map +1 -1
- package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.d.ts +23 -0
- package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.js +69 -0
- package/lib/translation/content-insights/cloud/api/CloudContentInsightsResponse.js.map +1 -0
- package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.d.ts +10 -0
- package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.js +39 -0
- package/lib/translation/content-insights/cloud/api/CloudContentInsightsStatisticsApiModel.js.map +1 -0
- package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.d.ts +12 -0
- package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.js +32 -0
- package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsResponse.js.map +1 -0
- package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.d.ts +16 -0
- package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.js +42 -0
- package/lib/translation/content-insights/cloud/api/CloudCreateContentInsightsStatusResponse.js.map +1 -0
- package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.d.ts +12 -0
- package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.js +39 -0
- package/lib/translation/content-insights/cloud/api/CloudDocumentApiModel.js.map +1 -0
- package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.d.ts +15 -0
- package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.js +57 -0
- package/lib/translation/content-insights/cloud/api/CloudSegmentApiModel.js.map +1 -0
- package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.d.ts +13 -0
- package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.js +46 -0
- package/lib/translation/content-insights/cloud/api/CloudSummarizationApiModel.js.map +1 -0
- package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.d.ts +3 -0
- package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.js +30 -0
- package/lib/translation/content-insights/cloud/request/CloudContentInsightsRequest.js.map +1 -0
- package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.d.ts +8 -0
- package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.js +29 -0
- package/lib/translation/content-insights/cloud/request/CloudFileContentInsightsRequest.js.map +1 -0
- package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.d.ts +16 -0
- package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.js +49 -0
- package/lib/translation/content-insights/cloud/result/CloudContentInsightsResult.js.map +1 -0
- package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.d.ts +8 -0
- package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.js +29 -0
- package/lib/translation/content-insights/cloud/result/CloudContentInsightsStatistics.js.map +1 -0
- package/lib/translation/content-insights/cloud/result/CloudSegment.d.ts +6 -0
- package/lib/translation/content-insights/cloud/result/CloudSegment.js +40 -0
- package/lib/translation/content-insights/cloud/result/CloudSegment.js.map +1 -0
- package/lib/translation/content-insights/cloud/result/CloudSummarization.d.ts +6 -0
- package/lib/translation/content-insights/cloud/result/CloudSummarization.js +19 -0
- package/lib/translation/content-insights/cloud/result/CloudSummarization.js.map +1 -0
- package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.d.ts +20 -0
- package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.js +248 -0
- package/lib/translation/content-insights/cloud/service/CloudContentInsightsService.js.map +1 -0
- package/lib/translation/content-insights/common/request/ContentInsightsRequest.d.ts +7 -0
- package/lib/translation/content-insights/common/request/ContentInsightsRequest.js +23 -0
- package/lib/translation/content-insights/common/request/ContentInsightsRequest.js.map +1 -0
- package/lib/translation/content-insights/common/result/ContentInsightsResult.d.ts +6 -0
- package/lib/translation/content-insights/common/result/ContentInsightsResult.js +19 -0
- package/lib/translation/content-insights/common/result/ContentInsightsResult.js.map +1 -0
- package/lib/translation/content-insights/common/result/Segment.d.ts +8 -0
- package/lib/translation/content-insights/common/result/Segment.js +29 -0
- package/lib/translation/content-insights/common/result/Segment.js.map +1 -0
- package/lib/translation/content-insights/common/result/Summarization.d.ts +8 -0
- package/lib/translation/content-insights/common/result/Summarization.js +25 -0
- package/lib/translation/content-insights/common/result/Summarization.js.map +1 -0
- package/lib/translation/content-insights/common/utils/ContentInsightsUtils.d.ts +4 -0
- package/lib/translation/content-insights/common/utils/ContentInsightsUtils.js +145 -0
- package/lib/translation/content-insights/common/utils/ContentInsightsUtils.js.map +1 -0
- package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.d.ts +13 -0
- package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.js +53 -0
- package/lib/translation/content-insights/edge/api/EdgeContentInsightsResponse.js.map +1 -0
- package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.d.ts +12 -0
- package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.js +46 -0
- package/lib/translation/content-insights/edge/api/EdgeSegmentApiModel.js.map +1 -0
- package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.d.ts +5 -0
- package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.js +19 -0
- package/lib/translation/content-insights/edge/request/EdgeContentInsightsRequest.js.map +1 -0
- package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.d.ts +9 -0
- package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.js +29 -0
- package/lib/translation/content-insights/edge/result/EdgeContentInsightsResult.js.map +1 -0
- package/lib/translation/content-insights/edge/result/EdgeSegment.d.ts +3 -0
- package/lib/translation/content-insights/edge/result/EdgeSegment.js +30 -0
- package/lib/translation/content-insights/edge/result/EdgeSegment.js.map +1 -0
- package/lib/translation/content-insights/edge/result/EdgeSummarization.d.ts +6 -0
- package/lib/translation/content-insights/edge/result/EdgeSummarization.js +19 -0
- package/lib/translation/content-insights/edge/result/EdgeSummarization.js.map +1 -0
- package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.d.ts +14 -0
- package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.js +96 -0
- package/lib/translation/content-insights/edge/service/EdgeContentInsightsService.js.map +1 -0
- package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.d.ts +14 -0
- package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.js +72 -0
- package/lib/translation/dictionaries/cloud/api/CloudDictionariesResponse.js.map +1 -0
- package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.d.ts +36 -0
- package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.js +136 -0
- package/lib/translation/dictionaries/cloud/api/CloudDictionaryApiModel.js.map +1 -0
- package/lib/translation/{translate → dictionaries}/cloud/result/CloudDictionariesResult.d.ts +3 -3
- package/lib/translation/{translate → dictionaries}/cloud/result/CloudDictionariesResult.js +0 -0
- package/lib/translation/dictionaries/cloud/result/CloudDictionariesResult.js.map +1 -0
- package/lib/translation/{translate/cloud/api/CloudDictionaryResponse.d.ts → dictionaries/cloud/result/CloudDictionary.d.ts} +1 -1
- package/lib/translation/{translate/cloud/api/CloudDictionaryResponse.js → dictionaries/cloud/result/CloudDictionary.js} +15 -15
- package/lib/translation/dictionaries/cloud/result/CloudDictionary.js.map +1 -0
- package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.d.ts +15 -0
- package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.js +51 -0
- package/lib/translation/dictionaries/cloud/service/CloudDictionariesService.js.map +1 -0
- package/lib/translation/dictionaries/common/result/DictionariesResult.d.ts +7 -0
- package/lib/translation/{translate → dictionaries}/common/result/DictionariesResult.js +0 -0
- package/lib/translation/dictionaries/common/result/DictionariesResult.js.map +1 -0
- package/lib/translation/{translate/common/api/DictionaryResponse.d.ts → dictionaries/common/result/Dictionary.d.ts} +1 -1
- package/lib/translation/{translate/common/api/DictionaryResponse.js → dictionaries/common/result/Dictionary.js} +8 -8
- package/lib/translation/dictionaries/common/result/Dictionary.js.map +1 -0
- package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.d.ts +22 -0
- package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.js +84 -0
- package/lib/translation/dictionaries/edge/api/EdgeDictionariesResponse.js.map +1 -0
- package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.d.ts +15 -0
- package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.js +58 -0
- package/lib/translation/dictionaries/edge/api/EdgeDictionaryApiModel.js.map +1 -0
- package/lib/translation/{translate → dictionaries}/edge/result/EdgeDictionariesResult.d.ts +3 -3
- package/lib/translation/{translate → dictionaries}/edge/result/EdgeDictionariesResult.js +0 -0
- package/lib/translation/dictionaries/edge/result/EdgeDictionariesResult.js.map +1 -0
- package/lib/translation/{translate/edge/api/EdgeDictionaryResponse.d.ts → dictionaries/edge/result/EdgeDictionary.d.ts} +1 -1
- package/lib/translation/{translate/edge/api/EdgeDictionaryResponse.js → dictionaries/edge/result/EdgeDictionary.js} +8 -8
- package/lib/translation/dictionaries/edge/result/EdgeDictionary.js.map +1 -0
- package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.d.ts +12 -0
- package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.js +51 -0
- package/lib/translation/dictionaries/edge/service/EdgeDictionariesService.js.map +1 -0
- package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.d.ts +4 -3
- package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.js +28 -23
- package/lib/translation/feedback/cloud/api/CloudFeedbackApiModel.js.map +1 -1
- package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalListUpdateRequest.d.ts +7 -0
- package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalListUpdateRequest.js +24 -0
- package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalListUpdateRequest.js.map +1 -0
- package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalUpdateRequest.d.ts +9 -0
- package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalUpdateRequest.js +31 -0
- package/lib/translation/feedback/cloud/api/CloudFeedbackApprovalUpdateRequest.js.map +1 -0
- package/lib/translation/feedback/cloud/api/CloudFeedbackImprovement.d.ts +1 -1
- package/lib/translation/feedback/cloud/api/CloudFeedbackImprovement.js.map +1 -1
- package/lib/translation/feedback/cloud/api/CloudFeedbackRating.js +6 -1
- package/lib/translation/feedback/cloud/api/CloudFeedbackRating.js.map +1 -1
- package/lib/translation/feedback/cloud/api/CloudFilterFeedbackApiRequest.js +4 -4
- package/lib/translation/feedback/cloud/api/CloudFilterFeedbackApiRequest.js.map +1 -1
- package/lib/translation/feedback/cloud/api/CloudTranslationFeedback.d.ts +3 -0
- package/lib/translation/feedback/cloud/api/CloudTranslationFeedback.js +10 -0
- package/lib/translation/feedback/cloud/api/CloudTranslationFeedback.js.map +1 -1
- package/lib/translation/feedback/cloud/request/CloudCreateFeedbackRequest.d.ts +21 -0
- package/lib/translation/feedback/cloud/request/CloudCreateFeedbackRequest.js +104 -0
- package/lib/translation/feedback/cloud/request/CloudCreateFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/cloud/request/CloudDeleteFeedbackRequest.d.ts +3 -0
- package/lib/translation/feedback/cloud/request/CloudDeleteFeedbackRequest.js +30 -0
- package/lib/translation/feedback/cloud/request/CloudDeleteFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/cloud/request/CloudFeedbackSortRequest.d.ts +1 -1
- package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackApprovalRequest.d.ts +3 -0
- package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackApprovalRequest.js +30 -0
- package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackApprovalRequest.js.map +1 -0
- package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackRequest.d.ts +15 -0
- package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackRequest.js +77 -0
- package/lib/translation/feedback/cloud/request/CloudUpdateFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/cloud/{model → result}/CloudAuditData.d.ts +1 -1
- package/lib/translation/feedback/cloud/{model → result}/CloudAuditData.js +1 -1
- package/lib/translation/feedback/cloud/result/CloudAuditData.js.map +1 -0
- package/lib/translation/feedback/cloud/result/CloudFeedbackResult.d.ts +7 -3
- package/lib/translation/feedback/cloud/result/CloudFeedbackResult.js +10 -0
- package/lib/translation/feedback/cloud/result/CloudFeedbackResult.js.map +1 -1
- package/lib/translation/feedback/cloud/service/CloudFeedbackService.d.ts +21 -0
- package/lib/translation/feedback/cloud/service/CloudFeedbackService.js +111 -1
- package/lib/translation/feedback/cloud/service/CloudFeedbackService.js.map +1 -1
- package/lib/translation/feedback/cloud/validator/CloudFeedbackValidator.d.ts +9 -0
- package/lib/translation/feedback/cloud/{validators → validator}/CloudFeedbackValidator.js +20 -1
- package/lib/translation/feedback/cloud/validator/CloudFeedbackValidator.js.map +1 -0
- package/lib/translation/feedback/common/request/CreateFeedbackRequest.d.ts +29 -0
- package/lib/translation/feedback/common/request/CreateFeedbackRequest.js +123 -0
- package/lib/translation/feedback/common/request/CreateFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/common/request/DeleteFeedbackRequest.d.ts +5 -0
- package/lib/translation/feedback/common/request/DeleteFeedbackRequest.js +19 -0
- package/lib/translation/feedback/common/request/DeleteFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/common/request/FilterFeedbackRequest.d.ts +4 -4
- package/lib/translation/feedback/common/request/FilterFeedbackRequest.js.map +1 -1
- package/lib/translation/feedback/common/request/UpdateFeedbackApprovalRequest.d.ts +9 -0
- package/lib/translation/feedback/common/request/UpdateFeedbackApprovalRequest.js +29 -0
- package/lib/translation/feedback/common/request/UpdateFeedbackApprovalRequest.js.map +1 -0
- package/lib/translation/feedback/common/request/UpdateFeedbackRequest.d.ts +19 -0
- package/lib/translation/feedback/common/request/UpdateFeedbackRequest.js +80 -0
- package/lib/translation/feedback/common/request/UpdateFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/common/{model → result}/AuditData.d.ts +0 -0
- package/lib/translation/feedback/common/{model → result}/AuditData.js +0 -0
- package/lib/translation/feedback/common/result/AuditData.js.map +1 -0
- package/lib/translation/feedback/common/result/FeedbackResult.d.ts +3 -1
- package/lib/translation/feedback/common/result/FeedbackResult.js +8 -0
- package/lib/translation/feedback/common/result/FeedbackResult.js.map +1 -1
- package/lib/translation/feedback/common/validator/FeedbackValidator.d.ts +10 -0
- package/lib/translation/feedback/common/validator/FeedbackValidator.js +38 -0
- package/lib/translation/feedback/common/validator/FeedbackValidator.js.map +1 -0
- package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.d.ts +3 -2
- package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.js +43 -15
- package/lib/translation/feedback/edge/api/EdgeFeedbackApiModel.js.map +1 -1
- package/lib/translation/feedback/edge/request/EdgeCreateFeedbackRequest.d.ts +12 -0
- package/lib/translation/feedback/edge/request/EdgeCreateFeedbackRequest.js +63 -0
- package/lib/translation/feedback/edge/request/EdgeCreateFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/edge/request/EdgeDeleteFeedbackRequest.d.ts +3 -0
- package/lib/translation/feedback/edge/request/EdgeDeleteFeedbackRequest.js +30 -0
- package/lib/translation/feedback/edge/request/EdgeDeleteFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackApprovalRequest.d.ts +3 -0
- package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackApprovalRequest.js +30 -0
- package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackApprovalRequest.js.map +1 -0
- package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackRequest.d.ts +9 -0
- package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackRequest.js +50 -0
- package/lib/translation/feedback/edge/request/EdgeUpdateFeedbackRequest.js.map +1 -0
- package/lib/translation/feedback/edge/service/EdgeFeedbackService.d.ts +22 -0
- package/lib/translation/feedback/edge/service/EdgeFeedbackService.js +100 -3
- package/lib/translation/feedback/edge/service/EdgeFeedbackService.js.map +1 -1
- package/lib/translation/feedback/edge/validator/EdgeFeedbackValidator.d.ts +3 -0
- package/lib/translation/feedback/edge/{validators → validator}/EdgeFeedbackValidator.js +1 -1
- package/lib/translation/feedback/edge/validator/EdgeFeedbackValidator.js.map +1 -0
- package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.d.ts +21 -0
- package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.js +81 -0
- package/lib/translation/language-pairs/cloud/api/CloudLanguagePairApiModel.js.map +1 -0
- package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.d.ts +13 -0
- package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.js +47 -0
- package/lib/translation/language-pairs/cloud/api/CloudLanguagePairsResponse.js.map +1 -0
- package/lib/translation/{translate/cloud/api → language-pairs/cloud/result}/CloudLanguagePair.d.ts +2 -0
- package/lib/translation/{translate/cloud/api → language-pairs/cloud/result}/CloudLanguagePair.js +11 -0
- package/lib/translation/language-pairs/cloud/result/CloudLanguagePair.js.map +1 -0
- package/lib/translation/{translate → language-pairs}/cloud/result/CloudLanguagePairsResult.d.ts +1 -1
- package/lib/translation/{translate → language-pairs}/cloud/result/CloudLanguagePairsResult.js +0 -0
- package/lib/translation/language-pairs/cloud/result/CloudLanguagePairsResult.js.map +1 -0
- package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.d.ts +15 -0
- package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.js +45 -0
- package/lib/translation/language-pairs/cloud/service/CloudLanguagePairsService.js.map +1 -0
- package/lib/translation/language-pairs/common/result/LanguagePair.d.ts +16 -0
- package/lib/translation/{translate/common/api → language-pairs/common/result}/LanguagePair.js +11 -0
- package/lib/translation/language-pairs/common/result/LanguagePair.js.map +1 -0
- package/lib/translation/{translate → language-pairs}/common/result/LanguagePairsResult.d.ts +1 -1
- package/lib/translation/{translate → language-pairs}/common/result/LanguagePairsResult.js +0 -0
- package/lib/translation/language-pairs/common/result/LanguagePairsResult.js.map +1 -0
- package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.d.ts +17 -0
- package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.js +89 -0
- package/lib/translation/language-pairs/edge/api/EdgeLanguagePairApiModel.js.map +1 -0
- package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.d.ts +10 -0
- package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.js +37 -0
- package/lib/translation/language-pairs/edge/api/EdgeLanguagePairsApiModel.js.map +1 -0
- package/lib/translation/language-pairs/edge/api/MemberPairApiModel.d.ts +31 -0
- package/lib/translation/language-pairs/edge/api/MemberPairApiModel.js +116 -0
- package/lib/translation/language-pairs/edge/api/MemberPairApiModel.js.map +1 -0
- package/lib/translation/language-pairs/edge/result/EdgeLanguagePair.d.ts +15 -0
- package/lib/translation/{translate/edge/api → language-pairs/edge/result}/EdgeLanguagePair.js +20 -0
- package/lib/translation/language-pairs/edge/result/EdgeLanguagePair.js.map +1 -0
- package/lib/translation/{translate → language-pairs}/edge/result/EdgeLanguagePairsResult.d.ts +1 -1
- package/lib/translation/{translate → language-pairs}/edge/result/EdgeLanguagePairsResult.js +0 -0
- package/lib/translation/language-pairs/edge/result/EdgeLanguagePairsResult.js.map +1 -0
- package/lib/translation/{translate/edge/api → language-pairs/edge/result}/MemberPair.d.ts +0 -0
- package/lib/translation/{translate/edge/api → language-pairs/edge/result}/MemberPair.js +0 -0
- package/lib/translation/language-pairs/edge/result/MemberPair.js.map +1 -0
- package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.d.ts +14 -0
- package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.js +80 -0
- package/lib/translation/language-pairs/edge/service/EdgeLanguagePairsService.js.map +1 -0
- package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.d.ts +13 -0
- package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.js +68 -0
- package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionApiModel.js.map +1 -0
- package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.d.ts +6 -0
- package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.js +19 -0
- package/lib/translation/linguistic-options/cloud/api/CloudLinguisticOptionsResponse.js.map +1 -0
- package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.d.ts +3 -0
- package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.js +30 -0
- package/lib/translation/linguistic-options/cloud/request/CloudGetLinguisticOptionsRequest.js.map +1 -0
- package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.d.ts +10 -0
- package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.js +57 -0
- package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOption.js.map +1 -0
- package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.d.ts +6 -0
- package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.js +19 -0
- package/lib/translation/linguistic-options/cloud/result/CloudLinguisticOptionsResult.js.map +1 -0
- package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.d.ts +19 -0
- package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.js +72 -0
- package/lib/translation/linguistic-options/cloud/service/CloudLinguisticOptionsService.js.map +1 -0
- package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.d.ts +3 -0
- package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.js +30 -0
- package/lib/translation/linguistic-options/cloud/validator/CloudLinguisticOptionsValidator.js.map +1 -0
- package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.d.ts +11 -0
- package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.js +39 -0
- package/lib/translation/linguistic-options/common/api/LinguisticOptionApiModel.js.map +1 -0
- package/lib/translation/{translate/common/api/LanguagePair.d.ts → linguistic-options/common/request/GetLinguisticOptionsRequest.d.ts} +1 -4
- package/lib/translation/linguistic-options/common/request/GetLinguisticOptionsRequest.js +39 -0
- package/lib/translation/linguistic-options/common/request/GetLinguisticOptionsRequest.js.map +1 -0
- package/lib/translation/linguistic-options/common/result/LinguisticOption.d.ts +11 -0
- package/lib/translation/linguistic-options/common/result/LinguisticOption.js +39 -0
- package/lib/translation/linguistic-options/common/result/LinguisticOption.js.map +1 -0
- package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.d.ts +6 -0
- package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.js +19 -0
- package/lib/translation/linguistic-options/common/result/LinguisticOptionsResult.js.map +1 -0
- package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.d.ts +4 -0
- package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.js +25 -0
- package/lib/translation/linguistic-options/common/validator/LinguisticOptionsValidator.js.map +1 -0
- package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.d.ts +7 -0
- package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.js +46 -0
- package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionApiModel.js.map +1 -0
- package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.d.ts +6 -0
- package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.js +19 -0
- package/lib/translation/linguistic-options/edge/api/EdgeLinguisticOptionsResponse.js.map +1 -0
- package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.d.ts +9 -0
- package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.js +50 -0
- package/lib/translation/linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest.js.map +1 -0
- package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.d.ts +4 -0
- package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.js +37 -0
- package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOption.js.map +1 -0
- package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.d.ts +6 -0
- package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.js +19 -0
- package/lib/translation/linguistic-options/edge/result/EdgeLinguisticOptionsResult.js.map +1 -0
- package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.d.ts +18 -0
- package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.js +101 -0
- package/lib/translation/linguistic-options/edge/service/EdgeLinguisticOptionsService.js.map +1 -0
- package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.d.ts +3 -0
- package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.js +30 -0
- package/lib/translation/linguistic-options/edge/validator/EdgeLinguisticOptionsValidator.js.map +1 -0
- package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.d.ts +3 -0
- package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.js +30 -0
- package/lib/translation/translate/cloud/request/CloudRetrieveFileRequest.js.map +1 -0
- package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.d.ts +3 -0
- package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.js +21 -0
- package/lib/translation/translate/cloud/request/CloudTranslateTextRequest.js.map +1 -1
- package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.d.ts +26 -0
- package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.js +80 -0
- package/lib/translation/translate/cloud/request/CloudTranslateTextRequestApiModel.js.map +1 -0
- package/lib/translation/translate/cloud/result/CloudTranslationFileResult.d.ts +0 -3
- package/lib/translation/translate/cloud/result/CloudTranslationFileResult.js +0 -10
- package/lib/translation/translate/cloud/result/CloudTranslationFileResult.js.map +1 -1
- package/lib/translation/translate/cloud/result/CloudTranslationTextResult.d.ts +3 -3
- package/lib/translation/translate/cloud/result/CloudTranslationTextResult.js +3 -3
- package/lib/translation/translate/cloud/result/CloudTranslationTextResult.js.map +1 -1
- package/lib/translation/translate/common/request/RetrieveFileRequest.d.ts +11 -0
- package/lib/translation/translate/common/request/RetrieveFileRequest.js +39 -0
- package/lib/translation/translate/common/request/RetrieveFileRequest.js.map +1 -0
- package/lib/translation/translate/common/request/TranslateBatchFileRequest.d.ts +7 -0
- package/lib/translation/translate/common/request/TranslateBatchFileRequest.js +20 -7
- package/lib/translation/translate/common/request/TranslateBatchFileRequest.js.map +1 -1
- package/lib/translation/translate/common/request/TranslateFileRequest.d.ts +4 -0
- package/lib/translation/translate/common/request/TranslateFileRequest.js +10 -0
- package/lib/translation/translate/common/request/TranslateFileRequest.js.map +1 -1
- package/lib/translation/translate/common/request/TranslateRequest.d.ts +3 -0
- package/lib/translation/translate/common/request/TranslateRequest.js +10 -0
- package/lib/translation/translate/common/request/TranslateRequest.js.map +1 -1
- package/lib/translation/translate/common/request/TranslateTextRequest.d.ts +3 -1
- package/lib/translation/translate/common/request/TranslateTextRequest.js +9 -1
- package/lib/translation/translate/common/request/TranslateTextRequest.js.map +1 -1
- package/lib/translation/translate/common/result/TranslationFileResult.d.ts +6 -0
- package/lib/translation/translate/common/result/TranslationFileResult.js +20 -0
- package/lib/translation/translate/common/result/TranslationFileResult.js.map +1 -1
- package/lib/translation/translate/common/utils/TranslateFileUtil.d.ts +3 -1
- package/lib/translation/translate/common/utils/TranslateFileUtil.js +26 -53
- package/lib/translation/translate/common/utils/TranslateFileUtil.js.map +1 -1
- package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.d.ts +7 -0
- package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.js +40 -0
- package/lib/translation/translate/edge/request/EdgeRetrieveFileRequest.js.map +1 -0
- package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.d.ts +2 -0
- package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.js +16 -0
- package/lib/translation/translate/edge/request/EdgeTranslateFileRequest.js.map +1 -1
- package/lib/translation/translate/edge/request/EdgeTranslateRequest.d.ts +29 -0
- package/lib/translation/translate/edge/request/EdgeTranslateRequest.js +109 -0
- package/lib/translation/translate/edge/request/EdgeTranslateRequest.js.map +1 -0
- package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.d.ts +2 -0
- package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.js +16 -0
- package/lib/translation/translate/edge/request/EdgeTranslateTextRequest.js.map +1 -1
- package/lib/translation/translate/edge/result/EdgeTranslationFileResult.d.ts +0 -3
- package/lib/translation/translate/edge/result/EdgeTranslationFileResult.js +0 -10
- package/lib/translation/translate/edge/result/EdgeTranslationFileResult.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/lib/translation/feedback/cloud/model/CloudAuditData.js.map +0 -1
- package/lib/translation/feedback/cloud/model/CloudFeedbackSortCriteria.js.map +0 -1
- package/lib/translation/feedback/cloud/validators/CloudFeedbackValidator.d.ts +0 -5
- package/lib/translation/feedback/cloud/validators/CloudFeedbackValidator.js.map +0 -1
- package/lib/translation/feedback/common/model/AuditData.js.map +0 -1
- package/lib/translation/feedback/common/validators/FeedbackValidator.d.ts +0 -2
- package/lib/translation/feedback/common/validators/FeedbackValidator.js +0 -9
- package/lib/translation/feedback/common/validators/FeedbackValidator.js.map +0 -1
- package/lib/translation/feedback/edge/validators/EdgeFeedbackValidator.d.ts +0 -3
- package/lib/translation/feedback/edge/validators/EdgeFeedbackValidator.js.map +0 -1
- package/lib/translation/translate/cloud/api/CloudDictionaryResponse.js.map +0 -1
- package/lib/translation/translate/cloud/api/CloudLanguagePair.js.map +0 -1
- package/lib/translation/translate/cloud/result/CloudDictionariesResult.js.map +0 -1
- package/lib/translation/translate/cloud/result/CloudLanguagePairsResult.js.map +0 -1
- package/lib/translation/translate/common/api/DictionaryResponse.js.map +0 -1
- package/lib/translation/translate/common/api/LanguagePair.js.map +0 -1
- package/lib/translation/translate/common/result/DictionariesResult.d.ts +0 -7
- package/lib/translation/translate/common/result/DictionariesResult.js.map +0 -1
- package/lib/translation/translate/common/result/LanguagePairsResult.js.map +0 -1
- package/lib/translation/translate/edge/api/EdgeDictionaryResponse.js.map +0 -1
- package/lib/translation/translate/edge/api/EdgeLanguagePair.d.ts +0 -9
- package/lib/translation/translate/edge/api/EdgeLanguagePair.js.map +0 -1
- package/lib/translation/translate/edge/api/MemberPair.js.map +0 -1
- package/lib/translation/translate/edge/result/EdgeDictionariesResult.js.map +0 -1
- package/lib/translation/translate/edge/result/EdgeLanguagePairsResult.js.map +0 -1
|
@@ -51,20 +51,24 @@ var EdgeFinalSubStatuses_1 = require("../../../common/constants/EdgeFinalSubStat
|
|
|
51
51
|
var EdgeTranslationException_1 = __importDefault(require("../../../common/exceptions/EdgeTranslationException"));
|
|
52
52
|
var Statuses_1 = require("../../../common/constants/Statuses");
|
|
53
53
|
var Utils_1 = __importDefault(require("../../../common/utils/Utils"));
|
|
54
|
+
var TranslationFileResult_1 = __importDefault(require("../../translate/common/result/TranslationFileResult"));
|
|
54
55
|
var EdgeTranslateFileRequest_1 = __importDefault(require("../../translate/edge/request/EdgeTranslateFileRequest"));
|
|
55
56
|
var EdgeTranslationFileResult_1 = __importDefault(require("../../translate/edge/result/EdgeTranslationFileResult"));
|
|
56
57
|
var TranslateFileUtil_1 = require("../../translate/common/utils/TranslateFileUtil");
|
|
57
|
-
var LanguagePairsResult_1 = __importDefault(require("../../translate/common/result/LanguagePairsResult"));
|
|
58
|
-
var LanguagePair_1 = __importDefault(require("../../translate/common/api/LanguagePair"));
|
|
59
58
|
var EdgeTranslateBatchFileRequest_1 = __importDefault(require("../../translate/edge/request/EdgeTranslateBatchFileRequest"));
|
|
60
59
|
var EdgeTranslationBatchFileResult_1 = __importDefault(require("../../translate/edge/result/EdgeTranslationBatchFileResult"));
|
|
61
|
-
var DictionariesResult_1 = __importDefault(require("../../translate/common/result/DictionariesResult"));
|
|
62
|
-
var EdgeDictionariesResult_1 = __importDefault(require("../../translate/edge/result/EdgeDictionariesResult"));
|
|
63
|
-
var DictionaryResponse_1 = __importDefault(require("../../translate/common/api/DictionaryResponse"));
|
|
64
60
|
var FormatToMimeType_1 = require("../../../common/constants/FormatToMimeType");
|
|
65
61
|
var EdgeFeedbackService_1 = __importDefault(require("../../feedback/edge/service/EdgeFeedbackService"));
|
|
66
62
|
var FilterFeedbackRequest_1 = __importDefault(require("../../feedback/common/request/FilterFeedbackRequest"));
|
|
67
63
|
var EdgeFilterFeedbackRequest_1 = __importDefault(require("../../feedback/edge/request/EdgeFilterFeedbackRequest"));
|
|
64
|
+
var PdfConverter_1 = require("../../../common/constants/PdfConverter");
|
|
65
|
+
var EdgeRetrieveFileRequest_1 = __importDefault(require("../../translate/edge/request/EdgeRetrieveFileRequest"));
|
|
66
|
+
var GetLinguisticOptionsRequest_1 = __importDefault(require("../../linguistic-options/common/request/GetLinguisticOptionsRequest"));
|
|
67
|
+
var EdgeGetLinguisticOptionsRequest_1 = __importDefault(require("../../linguistic-options/edge/request/EdgeGetLinguisticOptionsRequest"));
|
|
68
|
+
var EdgeLinguisticOptionsService_1 = __importDefault(require("../../linguistic-options/edge/service/EdgeLinguisticOptionsService"));
|
|
69
|
+
var EdgeLanguagePairsService_1 = __importDefault(require("../../language-pairs/edge/service/EdgeLanguagePairsService"));
|
|
70
|
+
var EdgeContentInsightsService_1 = __importDefault(require("../../content-insights/edge/service/EdgeContentInsightsService"));
|
|
71
|
+
var EdgeDictionariesService_1 = __importDefault(require("../../dictionaries/edge/service/EdgeDictionariesService"));
|
|
68
72
|
var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
69
73
|
function EdgeLanguageWeaverClient() {
|
|
70
74
|
this._clientConfiguration = new ClientConfiguration_1.default();
|
|
@@ -91,6 +95,10 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
91
95
|
this._token = new Token_1.default(encoding, undefined, 'Basic');
|
|
92
96
|
}
|
|
93
97
|
this._feedbackService = new EdgeFeedbackService_1.default(this._client, this._token);
|
|
98
|
+
this._languagePairsService = new EdgeLanguagePairsService_1.default(this._client, this._token);
|
|
99
|
+
this._linguisticOptionsService = new EdgeLinguisticOptionsService_1.default(this._client, this._token, this._languagePairsService);
|
|
100
|
+
this._contentInsightsService = new EdgeContentInsightsService_1.default(this._client, this._token);
|
|
101
|
+
this._dictionariesService = new EdgeDictionariesService_1.default(this._client, this._token);
|
|
94
102
|
return [2 /*return*/, this];
|
|
95
103
|
});
|
|
96
104
|
});
|
|
@@ -101,6 +109,7 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
101
109
|
},
|
|
102
110
|
set: function (value) {
|
|
103
111
|
this._overwriteUrl = value;
|
|
112
|
+
this.setUrl();
|
|
104
113
|
},
|
|
105
114
|
enumerable: false,
|
|
106
115
|
configurable: true
|
|
@@ -117,52 +126,46 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
117
126
|
EdgeLanguageWeaverClient.prototype.translateText = function (translateTextRequest) {
|
|
118
127
|
var _this = this;
|
|
119
128
|
var sourceLanguageId = translateTextRequest.sourceLanguageId, targetLanguageId = translateTextRequest.targetLanguageId, model = translateTextRequest.model;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return _this.translate(request);
|
|
132
|
-
})
|
|
133
|
-
.catch(function (error) { return Promise.reject(error); });
|
|
134
|
-
}
|
|
129
|
+
return this.getLanguagePairForGivenData(sourceLanguageId, targetLanguageId, model)
|
|
130
|
+
.then(function (lp) {
|
|
131
|
+
var request = new EdgeTranslateTextRequest_1.default();
|
|
132
|
+
request.input = translateTextRequest.input;
|
|
133
|
+
request.languagePairId = lp.languagePairId;
|
|
134
|
+
request.inputFormat = translateTextRequest.inputFormat;
|
|
135
|
+
request.dictionaries = translateTextRequest.dictionaries;
|
|
136
|
+
request.linguisticOptions = translateTextRequest.linguisticOptions;
|
|
137
|
+
return _this.translate(request);
|
|
138
|
+
})
|
|
139
|
+
.catch(function (error) { return Promise.reject(error); });
|
|
135
140
|
};
|
|
136
141
|
EdgeLanguageWeaverClient.prototype.translateFile = function (translateFileRequest) {
|
|
137
142
|
var _this = this;
|
|
138
143
|
var sourceLanguageId = translateFileRequest.sourceLanguageId, targetLanguageId = translateFileRequest.targetLanguageId, model = translateFileRequest.model;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
})
|
|
153
|
-
.catch(function (error) { return Promise.reject(error); });
|
|
154
|
-
}
|
|
144
|
+
return this.getLanguagePairForGivenData(sourceLanguageId, targetLanguageId, model)
|
|
145
|
+
.then(function (lp) {
|
|
146
|
+
var request = new EdgeTranslateFileRequest_1.default();
|
|
147
|
+
request.input = translateFileRequest.input;
|
|
148
|
+
request.outputDir = translateFileRequest.outputDir;
|
|
149
|
+
request.outputFile = translateFileRequest.outputFile;
|
|
150
|
+
request.languagePairId = lp.languagePairId;
|
|
151
|
+
request.dictionaries = translateFileRequest.dictionaries;
|
|
152
|
+
request.pdfConverter = translateFileRequest.pdfConverter;
|
|
153
|
+
request.linguisticOptions = translateFileRequest.linguisticOptions;
|
|
154
|
+
return _this.requestTranslateFile(request);
|
|
155
|
+
})
|
|
156
|
+
.catch(function (error) { return Promise.reject(error); });
|
|
155
157
|
};
|
|
156
158
|
EdgeLanguageWeaverClient.prototype.translateBatchFile = function (translateBatchFileRequest) {
|
|
157
159
|
return __awaiter(this, void 0, void 0, function () {
|
|
158
|
-
var sourceLanguageId, targetLanguageId, model, edgeLanguagePair, request;
|
|
160
|
+
var sourceLanguageId, targetLanguageId, model, edgeLanguagePair, request, e_1;
|
|
159
161
|
return __generator(this, function (_a) {
|
|
160
162
|
switch (_a.label) {
|
|
161
163
|
case 0:
|
|
162
164
|
sourceLanguageId = translateBatchFileRequest.sourceLanguageId, targetLanguageId = translateBatchFileRequest.targetLanguageId, model = translateBatchFileRequest.model;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
_a.label = 1;
|
|
166
|
+
case 1:
|
|
167
|
+
_a.trys.push([1, 3, , 4]);
|
|
168
|
+
return [4 /*yield*/, this.getLanguagePairForGivenData(sourceLanguageId, targetLanguageId, model)];
|
|
166
169
|
case 2:
|
|
167
170
|
edgeLanguagePair = _a.sent();
|
|
168
171
|
request = new EdgeTranslateBatchFileRequest_1.default();
|
|
@@ -170,105 +173,117 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
170
173
|
request.outputDir = translateBatchFileRequest.outputDir;
|
|
171
174
|
request.dictionaries = translateBatchFileRequest.dictionaries;
|
|
172
175
|
request.languagePairId = edgeLanguagePair.languagePairId;
|
|
176
|
+
request.pdfConverter = translateBatchFileRequest.pdfConverter;
|
|
177
|
+
request.linguisticOptions = translateBatchFileRequest.linguisticOptions;
|
|
173
178
|
return [2 /*return*/, this.requestTranslateBatchFile(request)];
|
|
179
|
+
case 3:
|
|
180
|
+
e_1 = _a.sent();
|
|
181
|
+
return [2 /*return*/, Promise.reject(e_1)];
|
|
182
|
+
case 4: return [2 /*return*/];
|
|
174
183
|
}
|
|
175
184
|
});
|
|
176
185
|
});
|
|
177
186
|
};
|
|
178
|
-
EdgeLanguageWeaverClient.prototype.
|
|
179
|
-
var _a;
|
|
187
|
+
EdgeLanguageWeaverClient.prototype.retrieveFileTranslation = function (retrieveFileRequest) {
|
|
180
188
|
return __awaiter(this, void 0, void 0, function () {
|
|
181
|
-
var
|
|
182
|
-
return __generator(this, function (
|
|
183
|
-
switch (
|
|
189
|
+
var edgeRetrieveFileRequest, response, translationFileResult, e_2;
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
184
192
|
case 0:
|
|
185
|
-
|
|
186
|
-
|
|
193
|
+
_a.trys.push([0, 2, , 3]);
|
|
194
|
+
edgeRetrieveFileRequest = new EdgeRetrieveFileRequest_1.default();
|
|
195
|
+
edgeRetrieveFileRequest.translationId = retrieveFileRequest.translationId;
|
|
196
|
+
edgeRetrieveFileRequest.outputDir = retrieveFileRequest.outputDir;
|
|
197
|
+
edgeRetrieveFileRequest.outputFile = retrieveFileRequest.outputFile;
|
|
198
|
+
return [4 /*yield*/, this.retrieveEdgeFileTranslation(edgeRetrieveFileRequest)];
|
|
187
199
|
case 1:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
languagePair.model = lp.domain;
|
|
195
|
-
languagePair.name = lp.languagePairId;
|
|
196
|
-
languagePairs_1.push(languagePair);
|
|
197
|
-
});
|
|
198
|
-
return [2 /*return*/, new Promise(function (resolve) {
|
|
199
|
-
var result = new LanguagePairsResult_1.default();
|
|
200
|
-
result.languagePairs = languagePairs_1;
|
|
201
|
-
resolve(result);
|
|
202
|
-
})];
|
|
200
|
+
response = _a.sent();
|
|
201
|
+
translationFileResult = new TranslationFileResult_1.default();
|
|
202
|
+
translationFileResult.fileContent = response.fileContent;
|
|
203
|
+
translationFileResult.mimeType = response.mimeType;
|
|
204
|
+
translationFileResult.filename = response.filename;
|
|
205
|
+
return [2 /*return*/, Promise.resolve(translationFileResult)];
|
|
203
206
|
case 2:
|
|
204
|
-
|
|
205
|
-
return [2 /*return*/, Promise.reject(
|
|
207
|
+
e_2 = _a.sent();
|
|
208
|
+
return [2 /*return*/, Promise.reject(e_2)];
|
|
206
209
|
case 3: return [2 /*return*/];
|
|
207
210
|
}
|
|
208
211
|
});
|
|
209
212
|
});
|
|
210
213
|
};
|
|
211
|
-
EdgeLanguageWeaverClient.prototype.
|
|
212
|
-
return this
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
EdgeLanguageWeaverClient.prototype.retrieveEdgeFileTranslation = function (retrieveFileRequest) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
216
|
+
var validationError, statusPromise;
|
|
217
|
+
var _this = this;
|
|
218
|
+
return __generator(this, function (_a) {
|
|
219
|
+
validationError = (0, TranslateFileUtil_1.validateInputDataForRetrieveFileTranslation)(retrieveFileRequest);
|
|
220
|
+
if (validationError) {
|
|
221
|
+
return [2 /*return*/, Promise.reject({ message: validationError })];
|
|
222
|
+
}
|
|
223
|
+
statusPromise = this.obtainFinalStatus(retrieveFileRequest.translationId);
|
|
224
|
+
return [2 /*return*/, this.handleStatusResponse(retrieveFileRequest.translationId, statusPromise, function (statusResponse) { var _a; return _this.getFileTranslationResponse(retrieveFileRequest, undefined, (_a = statusResponse.profile) === null || _a === void 0 ? void 0 : _a.languagePairId); })];
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
EdgeLanguageWeaverClient.prototype.getLanguagePairs = function () {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
230
|
+
return __generator(this, function (_a) {
|
|
231
|
+
if (this._languagePairsService) {
|
|
232
|
+
return [2 /*return*/, this._languagePairsService.getLanguagePairs()];
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
return [2 /*return*/, Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the language pairs' })];
|
|
236
|
+
}
|
|
237
|
+
return [2 /*return*/];
|
|
238
|
+
});
|
|
218
239
|
});
|
|
219
240
|
};
|
|
241
|
+
EdgeLanguageWeaverClient.prototype.getEdgeLanguagePairs = function () {
|
|
242
|
+
if (this._languagePairsService) {
|
|
243
|
+
return this._languagePairsService.getEdgeLanguagePairs();
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the language pairs' });
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
EdgeLanguageWeaverClient.prototype.getLinguisticOptions = function (getLinguisticOptionsRequest) {
|
|
250
|
+
if (this._linguisticOptionsService) {
|
|
251
|
+
return this._linguisticOptionsService.getLinguisticOptionsForLanguagePair(getLinguisticOptionsRequest || new GetLinguisticOptionsRequest_1.default());
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the linguistic options' });
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
EdgeLanguageWeaverClient.prototype.getEdgeLinguisticOptions = function (getLinguisticOptionsRequest) {
|
|
258
|
+
if (this._linguisticOptionsService) {
|
|
259
|
+
return this._linguisticOptionsService.getEdgeLinguisticOptionsForLanguagePair(getLinguisticOptionsRequest || new EdgeGetLinguisticOptionsRequest_1.default());
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the linguistic options' });
|
|
263
|
+
}
|
|
264
|
+
};
|
|
220
265
|
EdgeLanguageWeaverClient.prototype.getDictionaries = function (page, perPage) {
|
|
221
|
-
var _a;
|
|
222
266
|
if (perPage === void 0) { perPage = TranslationConstants_1.DEFAULT_DICTIONARIES_PAGE_SIZE; }
|
|
223
267
|
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
case 1:
|
|
231
|
-
edgeDictionariesResult_1 = _b.sent();
|
|
232
|
-
dictionaries_1 = [];
|
|
233
|
-
(_a = edgeDictionariesResult_1.dictionaries) === null || _a === void 0 ? void 0 : _a.forEach(function (dictionary) {
|
|
234
|
-
var dictionaryResponse = new DictionaryResponse_1.default();
|
|
235
|
-
dictionaryResponse.id = dictionary.dictionaryId;
|
|
236
|
-
dictionaryResponse.source = dictionary.sourceLanguageId;
|
|
237
|
-
dictionaryResponse.target = dictionary.targetLanguageId;
|
|
238
|
-
dictionaries_1.push(dictionaryResponse);
|
|
239
|
-
});
|
|
240
|
-
return [2 /*return*/, new Promise(function (resolve) {
|
|
241
|
-
var result = new DictionariesResult_1.default();
|
|
242
|
-
result.dictionaries = dictionaries_1;
|
|
243
|
-
result.pageSize = edgeDictionariesResult_1.pageSize;
|
|
244
|
-
result.totalCount = edgeDictionariesResult_1.totalCount;
|
|
245
|
-
result.pageNumber = edgeDictionariesResult_1.pageNumber;
|
|
246
|
-
resolve(result);
|
|
247
|
-
})];
|
|
248
|
-
case 2:
|
|
249
|
-
e_2 = _b.sent();
|
|
250
|
-
return [2 /*return*/, Promise.reject(e_2)];
|
|
251
|
-
case 3: return [2 /*return*/];
|
|
268
|
+
return __generator(this, function (_a) {
|
|
269
|
+
if (this._dictionariesService) {
|
|
270
|
+
return [2 /*return*/, this._dictionariesService.getDictionaries(page, perPage)];
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
return [2 /*return*/, Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the dictionaries' })];
|
|
252
274
|
}
|
|
275
|
+
return [2 /*return*/];
|
|
253
276
|
});
|
|
254
277
|
});
|
|
255
278
|
};
|
|
256
279
|
EdgeLanguageWeaverClient.prototype.getEdgeDictionaries = function (page, perPage) {
|
|
257
280
|
if (perPage === void 0) { perPage = TranslationConstants_1.DEFAULT_DICTIONARIES_PAGE_SIZE; }
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
result.pageSize = response.perPage;
|
|
265
|
-
result.pageNumber = response.page;
|
|
266
|
-
result.totalCount = response.totalItems;
|
|
267
|
-
return Promise.resolve(result);
|
|
268
|
-
})
|
|
269
|
-
.catch(function (e) {
|
|
270
|
-
return Promise.reject(e);
|
|
271
|
-
});
|
|
281
|
+
if (this._dictionariesService) {
|
|
282
|
+
return this._dictionariesService.getEdgeDictionaries(page, perPage);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the dictionaries' });
|
|
286
|
+
}
|
|
272
287
|
};
|
|
273
288
|
EdgeLanguageWeaverClient.prototype.getFeedback = function (pageNumber, pageSize, filterRequest) {
|
|
274
289
|
if (this._feedbackService) {
|
|
@@ -286,8 +301,124 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
286
301
|
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the feedback' });
|
|
287
302
|
}
|
|
288
303
|
};
|
|
289
|
-
EdgeLanguageWeaverClient.prototype.
|
|
290
|
-
return
|
|
304
|
+
EdgeLanguageWeaverClient.prototype.createFeedback = function (createFeedbackRequest) {
|
|
305
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
306
|
+
var edgeLanguagePair, e_3;
|
|
307
|
+
return __generator(this, function (_a) {
|
|
308
|
+
switch (_a.label) {
|
|
309
|
+
case 0:
|
|
310
|
+
if (!this._feedbackService) return [3 /*break*/, 5];
|
|
311
|
+
_a.label = 1;
|
|
312
|
+
case 1:
|
|
313
|
+
_a.trys.push([1, 3, , 4]);
|
|
314
|
+
return [4 /*yield*/, this.getLanguagePairForGivenData(createFeedbackRequest.sourceLanguageId, createFeedbackRequest.targetLanguageId, createFeedbackRequest.model)];
|
|
315
|
+
case 2:
|
|
316
|
+
edgeLanguagePair = _a.sent();
|
|
317
|
+
return [2 /*return*/, this._feedbackService.createFeedback(createFeedbackRequest, edgeLanguagePair)];
|
|
318
|
+
case 3:
|
|
319
|
+
e_3 = _a.sent();
|
|
320
|
+
return [2 /*return*/, Promise.reject(e_3)];
|
|
321
|
+
case 4: return [3 /*break*/, 6];
|
|
322
|
+
case 5: return [2 /*return*/, Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'creating the feedback' })];
|
|
323
|
+
case 6: return [2 /*return*/];
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
EdgeLanguageWeaverClient.prototype.createEdgeFeedback = function (createEdgeFeedbackRequest) {
|
|
329
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
330
|
+
var edgeLanguagePair, result, e_4;
|
|
331
|
+
return __generator(this, function (_a) {
|
|
332
|
+
switch (_a.label) {
|
|
333
|
+
case 0:
|
|
334
|
+
if (!this._feedbackService) return [3 /*break*/, 6];
|
|
335
|
+
if (!createEdgeFeedbackRequest.languagePairId) return [3 /*break*/, 1];
|
|
336
|
+
return [2 /*return*/, this._feedbackService.createEdgeFeedback(createEdgeFeedbackRequest)];
|
|
337
|
+
case 1:
|
|
338
|
+
_a.trys.push([1, 4, , 5]);
|
|
339
|
+
return [4 /*yield*/, this.getLanguagePairForGivenData(createEdgeFeedbackRequest.sourceLanguageId, createEdgeFeedbackRequest.targetLanguageId, createEdgeFeedbackRequest.model)];
|
|
340
|
+
case 2:
|
|
341
|
+
edgeLanguagePair = _a.sent();
|
|
342
|
+
createEdgeFeedbackRequest.languagePairId = edgeLanguagePair.languagePairId;
|
|
343
|
+
return [4 /*yield*/, this._feedbackService.createEdgeFeedback(createEdgeFeedbackRequest)];
|
|
344
|
+
case 3:
|
|
345
|
+
result = _a.sent();
|
|
346
|
+
return [2 /*return*/, Promise.resolve(result)];
|
|
347
|
+
case 4:
|
|
348
|
+
e_4 = _a.sent();
|
|
349
|
+
return [2 /*return*/, Promise.reject(e_4)];
|
|
350
|
+
case 5: return [3 /*break*/, 7];
|
|
351
|
+
case 6: return [2 /*return*/, Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'creating the feedback' })];
|
|
352
|
+
case 7: return [2 /*return*/];
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
EdgeLanguageWeaverClient.prototype.updateFeedback = function (updateFeedbackRequest) {
|
|
358
|
+
if (this._feedbackService) {
|
|
359
|
+
return this._feedbackService.updateFeedback(updateFeedbackRequest);
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback' });
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
EdgeLanguageWeaverClient.prototype.updateEdgeFeedback = function (updateEdgeFeedbackRequest) {
|
|
366
|
+
if (this._feedbackService) {
|
|
367
|
+
return this._feedbackService.updateEdgeFeedback(updateEdgeFeedbackRequest);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback' });
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
EdgeLanguageWeaverClient.prototype.updateFeedbackApproval = function (updateFeedbackApprovalRequest) {
|
|
374
|
+
if (this._feedbackService) {
|
|
375
|
+
return this._feedbackService.updateFeedbackApproval(updateFeedbackApprovalRequest);
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback approval status' });
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
EdgeLanguageWeaverClient.prototype.updateEdgeFeedbackApproval = function (updateEdgeFeedbackApprovalRequest) {
|
|
382
|
+
if (this._feedbackService) {
|
|
383
|
+
return this._feedbackService.updateEdgeFeedbackApproval(updateEdgeFeedbackApprovalRequest);
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'updating the feedback approval status' });
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
EdgeLanguageWeaverClient.prototype.deleteFeedback = function (deleteFeedbackRequest) {
|
|
390
|
+
if (this._feedbackService) {
|
|
391
|
+
return this._feedbackService.deleteFeedback(deleteFeedbackRequest);
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'deleting the feedback' });
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
EdgeLanguageWeaverClient.prototype.deleteEdgeFeedback = function (deleteEdgeFeedbackRequest) {
|
|
398
|
+
if (this._feedbackService) {
|
|
399
|
+
return this._feedbackService.deleteEdgeFeedback(deleteEdgeFeedbackRequest);
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'deleting the feedback' });
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
EdgeLanguageWeaverClient.prototype.getContentInsightsForTranslations = function (contentInsightsRequest) {
|
|
406
|
+
var _a;
|
|
407
|
+
if (this._contentInsightsService) {
|
|
408
|
+
return (_a = this._contentInsightsService) === null || _a === void 0 ? void 0 : _a.getContentInsightsResultForTranslation(contentInsightsRequest);
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'requesting content insights for translation' });
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
EdgeLanguageWeaverClient.prototype.getEdgeContentInsightsResultForTranslation = function (contentInsightsRequest) {
|
|
415
|
+
var _a;
|
|
416
|
+
if (this._contentInsightsService) {
|
|
417
|
+
return (_a = this._contentInsightsService) === null || _a === void 0 ? void 0 : _a.getEdgeContentInsightsResultForTranslation(contentInsightsRequest);
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'requesting content insights for translation' });
|
|
421
|
+
}
|
|
291
422
|
};
|
|
292
423
|
EdgeLanguageWeaverClient.prototype.translate = function (request) {
|
|
293
424
|
if (request.input && request.input.length > 1) {
|
|
@@ -323,14 +454,14 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
323
454
|
switch (_a.label) {
|
|
324
455
|
case 0:
|
|
325
456
|
if (!translateFileRequest.languagePairId) {
|
|
326
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return reject({ message: TranslationConstants_1.
|
|
457
|
+
return [2 /*return*/, new Promise(function (resolve, reject) { return reject({ message: TranslationConstants_1.MISSING_REQUIRED_LANGUAGE_PAIR_ID_ERROR }); })];
|
|
327
458
|
}
|
|
328
459
|
validationError = (0, TranslateFileUtil_1.validateInputDataForFileTranslation)(translateFileRequest);
|
|
329
460
|
if (validationError) {
|
|
330
461
|
return [2 /*return*/, Promise.reject({ message: validationError })];
|
|
331
462
|
}
|
|
332
463
|
fileSize = translateFileRequest.input ? Utils_1.default.getFileSize(translateFileRequest.input) : 0;
|
|
333
|
-
return [4 /*yield*/, this.
|
|
464
|
+
return [4 /*yield*/, this.getEdgeTranslateRequest(translateFileRequest)];
|
|
334
465
|
case 1:
|
|
335
466
|
request = _a.sent();
|
|
336
467
|
formData = createBodyForTranslationTextRequest(request);
|
|
@@ -340,7 +471,7 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
340
471
|
var statusPromise = _this.obtainFinalStatus(translationResponse.translationId, fileSize);
|
|
341
472
|
return _this.handleStatusResponse(translationResponse.translationId, statusPromise, function (statusResponse) {
|
|
342
473
|
var _a;
|
|
343
|
-
return _this.getFileTranslationResponse(
|
|
474
|
+
return _this.getFileTranslationResponse(translateFileRequest, translationResponse.translationId, (_a = statusResponse.profile) === null || _a === void 0 ? void 0 : _a.languagePairId);
|
|
344
475
|
});
|
|
345
476
|
})
|
|
346
477
|
.catch(function (error) { return Promise.reject(error); })];
|
|
@@ -364,7 +495,7 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
364
495
|
}
|
|
365
496
|
}
|
|
366
497
|
else {
|
|
367
|
-
return Promise.reject(EdgeTranslationException_1.default.getTranslationException(statusResponse.substate, translationId, TranslationConstants_1.
|
|
498
|
+
return Promise.reject(EdgeTranslationException_1.default.getTranslationException(statusResponse.substate, translationId, TranslationConstants_1.TRANSLATION_TIMEOUT_ERROR_MESSAGE));
|
|
368
499
|
}
|
|
369
500
|
})
|
|
370
501
|
.catch(function (error) { return Promise.reject(error); });
|
|
@@ -377,7 +508,7 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
377
508
|
switch (_a.label) {
|
|
378
509
|
case 0:
|
|
379
510
|
if (!translateBatchFileRequest.languagePairId) {
|
|
380
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return reject({ message: TranslationConstants_1.
|
|
511
|
+
return [2 /*return*/, new Promise(function (resolve, reject) { return reject({ message: TranslationConstants_1.MISSING_REQUIRED_LANGUAGE_PAIR_ID_ERROR }); })];
|
|
381
512
|
}
|
|
382
513
|
return [4 /*yield*/, (0, TranslateFileUtil_1.validateInputDataForBatchFileTranslation)(translateBatchFileRequest)];
|
|
383
514
|
case 1:
|
|
@@ -420,6 +551,8 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
420
551
|
if (!Utils_1.default.isBrowser() && typeof translateBatchFileRequest.outputDir === 'string') {
|
|
421
552
|
request.outputDir = translateBatchFileRequest.outputDir;
|
|
422
553
|
}
|
|
554
|
+
request.pdfConverter = translateBatchFileRequest.pdfConverter;
|
|
555
|
+
request.linguisticOptions = translateBatchFileRequest.linguisticOptions;
|
|
423
556
|
return this.requestTranslateFile(request);
|
|
424
557
|
};
|
|
425
558
|
EdgeLanguageWeaverClient.prototype.translateSyncText = function (translateTextRequest) {
|
|
@@ -427,7 +560,7 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
427
560
|
if (error) {
|
|
428
561
|
return new Promise(function (resolve, reject) { return reject(error); });
|
|
429
562
|
}
|
|
430
|
-
var formData = createBodyForTranslationTextRequest(translateTextRequest);
|
|
563
|
+
var formData = createBodyForTranslationTextRequest(translateTextRequest.toEdgeTranslateRequest());
|
|
431
564
|
return this._client.requestMultipart(this._token, 'POST', TranslationConstants_1.EDGE_QUICK_TRANSLATION_PATH, formData);
|
|
432
565
|
};
|
|
433
566
|
EdgeLanguageWeaverClient.prototype.translateAsyncText = function (translateTextRequest) {
|
|
@@ -436,7 +569,7 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
436
569
|
if (error) {
|
|
437
570
|
return new Promise(function (resolve, reject) { return reject(error); });
|
|
438
571
|
}
|
|
439
|
-
var formData = createBodyForTranslationTextRequest(translateTextRequest);
|
|
572
|
+
var formData = createBodyForTranslationTextRequest(translateTextRequest.toEdgeTranslateRequest());
|
|
440
573
|
var translationPromise = this._client.requestMultipart(this._token, 'POST', TranslationConstants_1.EDGE_ASYNC_TRANSLATION_PATH, formData);
|
|
441
574
|
return translationPromise
|
|
442
575
|
.then(function (translationResponse) {
|
|
@@ -459,10 +592,11 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
459
592
|
.catch(function (error) { return reject(error); });
|
|
460
593
|
});
|
|
461
594
|
};
|
|
462
|
-
EdgeLanguageWeaverClient.prototype.getFileTranslationResponse = function (
|
|
595
|
+
EdgeLanguageWeaverClient.prototype.getFileTranslationResponse = function (request, requestId, languagePairId) {
|
|
463
596
|
var _this = this;
|
|
464
597
|
return new Promise(function (resolve, reject) {
|
|
465
|
-
|
|
598
|
+
var edgeRequestId = request instanceof EdgeRetrieveFileRequest_1.default ? request.translationId : requestId;
|
|
599
|
+
_this.retrieveTranslation(edgeRequestId)
|
|
466
600
|
.then(function (contentResponse) { return __awaiter(_this, void 0, void 0, function () {
|
|
467
601
|
var edgeTranslationFileResult, fs;
|
|
468
602
|
return __generator(this, function (_a) {
|
|
@@ -470,20 +604,19 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
470
604
|
case 0:
|
|
471
605
|
edgeTranslationFileResult = new EdgeTranslationFileResult_1.default();
|
|
472
606
|
edgeTranslationFileResult.languagePairId = languagePairId;
|
|
473
|
-
edgeTranslationFileResult.
|
|
607
|
+
edgeTranslationFileResult.translationId = edgeRequestId;
|
|
474
608
|
edgeTranslationFileResult.fileContent = contentResponse.data;
|
|
475
609
|
if (Utils_1.default.isBrowser()) {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
610
|
+
edgeTranslationFileResult.filename =
|
|
611
|
+
request.outputFile || (0, TranslateFileUtil_1.getFileNameFromHeaders)(contentResponse, request);
|
|
612
|
+
edgeTranslationFileResult.mimeType =
|
|
613
|
+
request.outputFormat ||
|
|
614
|
+
FormatToMimeType_1.formatToMimeType[Utils_1.default.getFormatForFile(edgeTranslationFileResult.filename)];
|
|
615
|
+
edgeTranslationFileResult.fileContent = Utils_1.default.decodeStringFromBase64ToBlob(contentResponse.data);
|
|
483
616
|
}
|
|
484
|
-
if (!(
|
|
617
|
+
if (!(request.outputDir && !Utils_1.default.isBrowser())) return [3 /*break*/, 2];
|
|
485
618
|
fs = require('fs');
|
|
486
|
-
return [4 /*yield*/, fs.promises.writeFile(Utils_1.default.getFullPath(
|
|
619
|
+
return [4 /*yield*/, fs.promises.writeFile(Utils_1.default.getFullPath(request.outputDir, request.outputFile || (0, TranslateFileUtil_1.getFileNameFromHeaders)(contentResponse, request)), contentResponse.data, { encoding: 'base64' }, function (error) { return reject(error); })];
|
|
487
620
|
case 1:
|
|
488
621
|
_a.sent();
|
|
489
622
|
_a.label = 2;
|
|
@@ -504,7 +637,9 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
504
637
|
EdgeLanguageWeaverClient.prototype.obtainFinalStatus = function (requestId, fileSize) {
|
|
505
638
|
var self = this;
|
|
506
639
|
return new Promise(function (resolve, reject) {
|
|
507
|
-
var delay = fileSize
|
|
640
|
+
var delay = fileSize !== undefined && fileSize < 500
|
|
641
|
+
? TranslationConstants_1.SMALL_INPUT_GET_TRANSLATION_STATUS_DELAY
|
|
642
|
+
: TranslationConstants_1.LARGE_INPUT_GET_TRANSLATION_STATUS_DELAY;
|
|
508
643
|
var startTime = new Date().getTime();
|
|
509
644
|
getStatus();
|
|
510
645
|
function getStatus() {
|
|
@@ -525,7 +660,7 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
525
660
|
}
|
|
526
661
|
});
|
|
527
662
|
};
|
|
528
|
-
EdgeLanguageWeaverClient.prototype.
|
|
663
|
+
EdgeLanguageWeaverClient.prototype.getEdgeTranslateRequest = function (translateFileRequest) {
|
|
529
664
|
return __awaiter(this, void 0, void 0, function () {
|
|
530
665
|
var encodedFile, request;
|
|
531
666
|
return __generator(this, function (_a) {
|
|
@@ -533,14 +668,9 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
533
668
|
case 0: return [4 /*yield*/, Utils_1.default.getEncodedFile(translateFileRequest.input)];
|
|
534
669
|
case 1:
|
|
535
670
|
encodedFile = _a.sent();
|
|
536
|
-
request =
|
|
537
|
-
request.languagePairId = translateFileRequest.languagePairId;
|
|
538
|
-
request.dictionaries = translateFileRequest.dictionaries;
|
|
539
|
-
request.outputFormat = translateFileRequest.outputFormat;
|
|
671
|
+
request = translateFileRequest.toEdgeTranslateRequest();
|
|
540
672
|
request.inputFormat =
|
|
541
673
|
translateFileRequest.inputFormat || Utils_1.default.getFormatForFile(translateFileRequest.input || '');
|
|
542
|
-
request.title = translateFileRequest.title;
|
|
543
|
-
request.encoding = translateFileRequest.encoding;
|
|
544
674
|
request.addInput(encodedFile);
|
|
545
675
|
return [2 /*return*/, request];
|
|
546
676
|
}
|
|
@@ -568,13 +698,12 @@ var EdgeLanguageWeaverClient = /** @class */ (function () {
|
|
|
568
698
|
this._client.baseUrl = this._url;
|
|
569
699
|
};
|
|
570
700
|
EdgeLanguageWeaverClient.prototype.getLanguagePairForGivenData = function (source, target, model) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
});
|
|
701
|
+
if (this._languagePairsService) {
|
|
702
|
+
return this._languagePairsService.getLanguagePairForGivenData(source, target, model);
|
|
703
|
+
}
|
|
704
|
+
else {
|
|
705
|
+
return Promise.reject({ message: TranslationConstants_1.GENERIC_ERROR + 'getting the language pairs' });
|
|
706
|
+
}
|
|
578
707
|
};
|
|
579
708
|
return EdgeLanguageWeaverClient;
|
|
580
709
|
}());
|
|
@@ -605,6 +734,14 @@ function createBodyForTranslationTextRequest(translateTextRequest) {
|
|
|
605
734
|
if (translateTextRequest.encoding) {
|
|
606
735
|
formData.append(TranslationConstants_1.ENCODING, translateTextRequest.encoding);
|
|
607
736
|
}
|
|
737
|
+
if (translateTextRequest.pdfConverter) {
|
|
738
|
+
formData.append(TranslationConstants_1.PDF_CONVERTER, PdfConverter_1.PdfConverterEdge[translateTextRequest.pdfConverter]);
|
|
739
|
+
}
|
|
740
|
+
if (translateTextRequest.linguisticOptions) {
|
|
741
|
+
translateTextRequest.linguisticOptions.forEach(function (value, key) {
|
|
742
|
+
formData.append(TranslationConstants_1.LINGUISTIC_OPTIONS, key + ':' + value);
|
|
743
|
+
});
|
|
744
|
+
}
|
|
608
745
|
return formData;
|
|
609
746
|
}
|
|
610
747
|
//# sourceMappingURL=EdgeLanguageWeaverClient.js.map
|