@language-weaver/lw-sdk-js 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/lib/CloudLanguageWeaverClient.d.ts +61 -0
  2. package/lib/CloudLanguageWeaverClient.js +514 -0
  3. package/lib/CloudLanguageWeaverClient.js.map +1 -0
  4. package/lib/EdgeLanguageWeaverClient.d.ts +60 -0
  5. package/lib/EdgeLanguageWeaverClient.js +580 -0
  6. package/lib/EdgeLanguageWeaverClient.js.map +1 -0
  7. package/lib/LanguageWeaverClient.d.ts +15 -0
  8. package/lib/LanguageWeaverClient.js +3 -0
  9. package/lib/LanguageWeaverClient.js.map +1 -0
  10. package/lib/SdkFactory.d.ts +9 -0
  11. package/lib/SdkFactory.js +56 -0
  12. package/lib/SdkFactory.js.map +1 -0
  13. package/lib/auth/LanguageWeaverAuthentication.d.ts +12 -0
  14. package/lib/auth/LanguageWeaverAuthentication.js +25 -0
  15. package/lib/auth/LanguageWeaverAuthentication.js.map +1 -0
  16. package/lib/auth/domain/SelfInformation.d.ts +8 -0
  17. package/lib/auth/domain/SelfInformation.js +29 -0
  18. package/lib/auth/domain/SelfInformation.js.map +1 -0
  19. package/lib/auth/domain/Token.d.ts +15 -0
  20. package/lib/auth/domain/Token.js +53 -0
  21. package/lib/auth/domain/Token.js.map +1 -0
  22. package/lib/auth/domain/UserSelfInformation.d.ts +38 -0
  23. package/lib/auth/domain/UserSelfInformation.js +129 -0
  24. package/lib/auth/domain/UserSelfInformation.js.map +1 -0
  25. package/lib/common/api/ErrorResponse.d.ts +9 -0
  26. package/lib/common/api/ErrorResponse.js +31 -0
  27. package/lib/common/api/ErrorResponse.js.map +1 -0
  28. package/lib/common/configurations/ClientConfiguration.d.ts +14 -0
  29. package/lib/common/configurations/ClientConfiguration.js +46 -0
  30. package/lib/common/configurations/ClientConfiguration.js.map +1 -0
  31. package/lib/common/configurations/CredentialsConfiguration.d.ts +9 -0
  32. package/lib/common/configurations/CredentialsConfiguration.js +35 -0
  33. package/lib/common/configurations/CredentialsConfiguration.js.map +1 -0
  34. package/lib/common/configurations/RetryConfiguration.d.ts +8 -0
  35. package/lib/common/configurations/RetryConfiguration.js +31 -0
  36. package/lib/common/configurations/RetryConfiguration.js.map +1 -0
  37. package/lib/common/configurations/TokenConfiguration.d.ts +10 -0
  38. package/lib/common/configurations/TokenConfiguration.js +29 -0
  39. package/lib/common/configurations/TokenConfiguration.js.map +1 -0
  40. package/lib/common/constants/EdgeFinalSubStatuses.d.ts +5 -0
  41. package/lib/common/constants/EdgeFinalSubStatuses.js +9 -0
  42. package/lib/common/constants/EdgeFinalSubStatuses.js.map +1 -0
  43. package/lib/common/constants/EdgeStatuses.d.ts +3 -0
  44. package/lib/common/constants/EdgeStatuses.js +7 -0
  45. package/lib/common/constants/EdgeStatuses.js.map +1 -0
  46. package/lib/common/constants/FileExtensions.d.ts +2 -0
  47. package/lib/common/constants/FileExtensions.js +52 -0
  48. package/lib/common/constants/FileExtensions.js.map +1 -0
  49. package/lib/common/constants/FormatToMimeType.d.ts +1 -0
  50. package/lib/common/constants/FormatToMimeType.js +33 -0
  51. package/lib/common/constants/FormatToMimeType.js.map +1 -0
  52. package/lib/common/constants/TranslationConstants.d.ts +62 -0
  53. package/lib/common/constants/TranslationConstants.js +69 -0
  54. package/lib/common/constants/TranslationConstants.js.map +1 -0
  55. package/lib/common/constants/languages/Iso639Mapping.d.ts +1 -0
  56. package/lib/common/constants/languages/Iso639Mapping.js +95 -0
  57. package/lib/common/constants/languages/Iso639Mapping.js.map +1 -0
  58. package/lib/common/exceptions/EdgeTranslationException.d.ts +3 -0
  59. package/lib/common/exceptions/EdgeTranslationException.js +17 -0
  60. package/lib/common/exceptions/EdgeTranslationException.js.map +1 -0
  61. package/lib/common/exceptions/TranslationException.d.ts +4 -0
  62. package/lib/common/exceptions/TranslationException.js +17 -0
  63. package/lib/common/exceptions/TranslationException.js.map +1 -0
  64. package/lib/common/requests/RestClient.d.ts +34 -0
  65. package/lib/common/requests/RestClient.js +331 -0
  66. package/lib/common/requests/RestClient.js.map +1 -0
  67. package/lib/common/requests/TraceRequestInfo.d.ts +9 -0
  68. package/lib/common/requests/TraceRequestInfo.js +20 -0
  69. package/lib/common/requests/TraceRequestInfo.js.map +1 -0
  70. package/lib/common/utils/HttpUtils.d.ts +5 -0
  71. package/lib/common/utils/HttpUtils.js +26 -0
  72. package/lib/common/utils/HttpUtils.js.map +1 -0
  73. package/lib/common/utils/Utils.d.ts +34 -0
  74. package/lib/common/utils/Utils.js +319 -0
  75. package/lib/common/utils/Utils.js.map +1 -0
  76. package/lib/index.d.ts +51 -0
  77. package/lib/index.js +99 -0
  78. package/lib/index.js.map +1 -0
  79. package/lib/translation/common/Format.d.ts +39 -0
  80. package/lib/translation/common/Format.js +52 -0
  81. package/lib/translation/common/Format.js.map +1 -0
  82. package/lib/translation/common/Product.d.ts +4 -0
  83. package/lib/translation/common/Product.js +9 -0
  84. package/lib/translation/common/Product.js.map +1 -0
  85. package/lib/translation/common/Regions.d.ts +4 -0
  86. package/lib/translation/common/Regions.js +9 -0
  87. package/lib/translation/common/Regions.js.map +1 -0
  88. package/lib/translation/common/Statuses.d.ts +6 -0
  89. package/lib/translation/common/Statuses.js +10 -0
  90. package/lib/translation/common/Statuses.js.map +1 -0
  91. package/lib/translation/translate/request/TranslateBatchFileRequest.d.ts +21 -0
  92. package/lib/translation/translate/request/TranslateBatchFileRequest.js +84 -0
  93. package/lib/translation/translate/request/TranslateBatchFileRequest.js.map +1 -0
  94. package/lib/translation/translate/request/TranslateFileRequest.d.ts +12 -0
  95. package/lib/translation/translate/request/TranslateFileRequest.js +68 -0
  96. package/lib/translation/translate/request/TranslateFileRequest.js.map +1 -0
  97. package/lib/translation/translate/request/TranslateRequest.d.ts +19 -0
  98. package/lib/translation/translate/request/TranslateRequest.js +67 -0
  99. package/lib/translation/translate/request/TranslateRequest.js.map +1 -0
  100. package/lib/translation/translate/request/TranslateTextRequest.d.ts +7 -0
  101. package/lib/translation/translate/request/TranslateTextRequest.js +46 -0
  102. package/lib/translation/translate/request/TranslateTextRequest.js.map +1 -0
  103. package/lib/translation/translate/request/cloud/CloudTranslateBatchFileRequest.d.ts +3 -0
  104. package/lib/translation/translate/request/cloud/CloudTranslateBatchFileRequest.js +30 -0
  105. package/lib/translation/translate/request/cloud/CloudTranslateBatchFileRequest.js.map +1 -0
  106. package/lib/translation/translate/request/cloud/CloudTranslateFileRequest.d.ts +3 -0
  107. package/lib/translation/translate/request/cloud/CloudTranslateFileRequest.js +30 -0
  108. package/lib/translation/translate/request/cloud/CloudTranslateFileRequest.js.map +1 -0
  109. package/lib/translation/translate/request/cloud/CloudTranslateTextRequest.d.ts +3 -0
  110. package/lib/translation/translate/request/cloud/CloudTranslateTextRequest.js +30 -0
  111. package/lib/translation/translate/request/cloud/CloudTranslateTextRequest.js.map +1 -0
  112. package/lib/translation/translate/request/edge/EdgeTranslateBatchFileRequest.d.ts +16 -0
  113. package/lib/translation/translate/request/edge/EdgeTranslateBatchFileRequest.js +70 -0
  114. package/lib/translation/translate/request/edge/EdgeTranslateBatchFileRequest.js.map +1 -0
  115. package/lib/translation/translate/request/edge/EdgeTranslateFileRequest.d.ts +16 -0
  116. package/lib/translation/translate/request/edge/EdgeTranslateFileRequest.js +70 -0
  117. package/lib/translation/translate/request/edge/EdgeTranslateFileRequest.js.map +1 -0
  118. package/lib/translation/translate/request/edge/EdgeTranslateTextRequest.d.ts +16 -0
  119. package/lib/translation/translate/request/edge/EdgeTranslateTextRequest.js +70 -0
  120. package/lib/translation/translate/request/edge/EdgeTranslateTextRequest.js.map +1 -0
  121. package/lib/translation/translate/response/AsyncTranslationResponse.d.ts +20 -0
  122. package/lib/translation/translate/response/AsyncTranslationResponse.js +69 -0
  123. package/lib/translation/translate/response/AsyncTranslationResponse.js.map +1 -0
  124. package/lib/translation/translate/response/DictionaryResponse.d.ts +11 -0
  125. package/lib/translation/translate/response/DictionaryResponse.js +39 -0
  126. package/lib/translation/translate/response/DictionaryResponse.js.map +1 -0
  127. package/lib/translation/translate/response/LanguagePair.d.ts +14 -0
  128. package/lib/translation/translate/response/LanguagePair.js +49 -0
  129. package/lib/translation/translate/response/LanguagePair.js.map +1 -0
  130. package/lib/translation/translate/response/StatusTranslationResponse.d.ts +19 -0
  131. package/lib/translation/translate/response/StatusTranslationResponse.js +59 -0
  132. package/lib/translation/translate/response/StatusTranslationResponse.js.map +1 -0
  133. package/lib/translation/translate/response/TranslationStatistics.d.ts +20 -0
  134. package/lib/translation/translate/response/TranslationStatistics.js +69 -0
  135. package/lib/translation/translate/response/TranslationStatistics.js.map +1 -0
  136. package/lib/translation/translate/response/cloud/CloudDictionaryResponse.d.ts +32 -0
  137. package/lib/translation/translate/response/cloud/CloudDictionaryResponse.js +110 -0
  138. package/lib/translation/translate/response/cloud/CloudDictionaryResponse.js.map +1 -0
  139. package/lib/translation/translate/response/cloud/CloudLanguagePair.d.ts +17 -0
  140. package/lib/translation/translate/response/cloud/CloudLanguagePair.js +59 -0
  141. package/lib/translation/translate/response/cloud/CloudLanguagePair.js.map +1 -0
  142. package/lib/translation/translate/response/edge/EdgeAsyncTranslationResponse.d.ts +5 -0
  143. package/lib/translation/translate/response/edge/EdgeAsyncTranslationResponse.js +19 -0
  144. package/lib/translation/translate/response/edge/EdgeAsyncTranslationResponse.js.map +1 -0
  145. package/lib/translation/translate/response/edge/EdgeDictionaryResponse.d.ts +11 -0
  146. package/lib/translation/translate/response/edge/EdgeDictionaryResponse.js +39 -0
  147. package/lib/translation/translate/response/edge/EdgeDictionaryResponse.js.map +1 -0
  148. package/lib/translation/translate/response/edge/EdgeLanguagePair.d.ts +9 -0
  149. package/lib/translation/translate/response/edge/EdgeLanguagePair.js +50 -0
  150. package/lib/translation/translate/response/edge/EdgeLanguagePair.js.map +1 -0
  151. package/lib/translation/translate/response/edge/EdgeStatusTranslationResponse.d.ts +26 -0
  152. package/lib/translation/translate/response/edge/EdgeStatusTranslationResponse.js +79 -0
  153. package/lib/translation/translate/response/edge/EdgeStatusTranslationResponse.js.map +1 -0
  154. package/lib/translation/translate/response/edge/MemberPair.d.ts +29 -0
  155. package/lib/translation/translate/response/edge/MemberPair.js +99 -0
  156. package/lib/translation/translate/response/edge/MemberPair.js.map +1 -0
  157. package/lib/translation/translate/response/edge/Profile.d.ts +26 -0
  158. package/lib/translation/translate/response/edge/Profile.js +89 -0
  159. package/lib/translation/translate/response/edge/Profile.js.map +1 -0
  160. package/lib/translation/translate/response/edge/Result.d.ts +32 -0
  161. package/lib/translation/translate/response/edge/Result.js +109 -0
  162. package/lib/translation/translate/response/edge/Result.js.map +1 -0
  163. package/lib/translation/translate/response/edge/Timestamps.d.ts +11 -0
  164. package/lib/translation/translate/response/edge/Timestamps.js +39 -0
  165. package/lib/translation/translate/response/edge/Timestamps.js.map +1 -0
  166. package/lib/translation/translate/result/DictionariesResult.d.ts +6 -0
  167. package/lib/translation/translate/result/DictionariesResult.js +19 -0
  168. package/lib/translation/translate/result/DictionariesResult.js.map +1 -0
  169. package/lib/translation/translate/result/LanguagePairsResult.d.ts +6 -0
  170. package/lib/translation/translate/result/LanguagePairsResult.js +19 -0
  171. package/lib/translation/translate/result/LanguagePairsResult.js.map +1 -0
  172. package/lib/translation/translate/result/TranslateTextResult.d.ts +5 -0
  173. package/lib/translation/translate/result/TranslateTextResult.js +19 -0
  174. package/lib/translation/translate/result/TranslateTextResult.js.map +1 -0
  175. package/lib/translation/translate/result/TranslationBatchFileResult.d.ts +6 -0
  176. package/lib/translation/translate/result/TranslationBatchFileResult.js +19 -0
  177. package/lib/translation/translate/result/TranslationBatchFileResult.js.map +1 -0
  178. package/lib/translation/translate/result/TranslationFileResult.d.ts +11 -0
  179. package/lib/translation/translate/result/TranslationFileResult.js +39 -0
  180. package/lib/translation/translate/result/TranslationFileResult.js.map +1 -0
  181. package/lib/translation/translate/result/cloud/CloudDictionariesResult.d.ts +18 -0
  182. package/lib/translation/translate/result/cloud/CloudDictionariesResult.js +59 -0
  183. package/lib/translation/translate/result/cloud/CloudDictionariesResult.js.map +1 -0
  184. package/lib/translation/translate/result/cloud/CloudLanguagePairsResult.d.ts +9 -0
  185. package/lib/translation/translate/result/cloud/CloudLanguagePairsResult.js +29 -0
  186. package/lib/translation/translate/result/cloud/CloudLanguagePairsResult.js.map +1 -0
  187. package/lib/translation/translate/result/cloud/CloudTranslationBatchFileResult.d.ts +3 -0
  188. package/lib/translation/translate/result/cloud/CloudTranslationBatchFileResult.js +30 -0
  189. package/lib/translation/translate/result/cloud/CloudTranslationBatchFileResult.js.map +1 -0
  190. package/lib/translation/translate/result/cloud/CloudTranslationFileResult.d.ts +26 -0
  191. package/lib/translation/translate/result/cloud/CloudTranslationFileResult.js +100 -0
  192. package/lib/translation/translate/result/cloud/CloudTranslationFileResult.js.map +1 -0
  193. package/lib/translation/translate/result/cloud/CloudTranslationTextResult.d.ts +28 -0
  194. package/lib/translation/translate/result/cloud/CloudTranslationTextResult.js +89 -0
  195. package/lib/translation/translate/result/cloud/CloudTranslationTextResult.js.map +1 -0
  196. package/lib/translation/translate/result/edge/EdgeDictionariesResult.d.ts +18 -0
  197. package/lib/translation/translate/result/edge/EdgeDictionariesResult.js +59 -0
  198. package/lib/translation/translate/result/edge/EdgeDictionariesResult.js.map +1 -0
  199. package/lib/translation/translate/result/edge/EdgeLanguagePairsResult.d.ts +6 -0
  200. package/lib/translation/translate/result/edge/EdgeLanguagePairsResult.js +20 -0
  201. package/lib/translation/translate/result/edge/EdgeLanguagePairsResult.js.map +1 -0
  202. package/lib/translation/translate/result/edge/EdgeTranslationBatchFileResult.d.ts +3 -0
  203. package/lib/translation/translate/result/edge/EdgeTranslationBatchFileResult.js +30 -0
  204. package/lib/translation/translate/result/edge/EdgeTranslationBatchFileResult.js.map +1 -0
  205. package/lib/translation/translate/result/edge/EdgeTranslationFileResult.d.ts +9 -0
  206. package/lib/translation/translate/result/edge/EdgeTranslationFileResult.js +50 -0
  207. package/lib/translation/translate/result/edge/EdgeTranslationFileResult.js.map +1 -0
  208. package/lib/translation/translate/result/edge/EdgeTranslationTextResult.d.ts +6 -0
  209. package/lib/translation/translate/result/edge/EdgeTranslationTextResult.js +40 -0
  210. package/lib/translation/translate/result/edge/EdgeTranslationTextResult.js.map +1 -0
  211. package/lib/translation/translate/utils/TranslateFileUtil.d.ts +8 -0
  212. package/lib/translation/translate/utils/TranslateFileUtil.js +266 -0
  213. package/lib/translation/translate/utils/TranslateFileUtil.js.map +1 -0
  214. package/lib/version.d.ts +1 -0
  215. package/lib/version.js +5 -0
  216. package/lib/version.js.map +1 -0
  217. package/package.json +45 -0
  218. package/readme.md +17 -0
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var RetryConfiguration = /** @class */ (function () {
4
+ function RetryConfiguration() {
5
+ this._attempts = 3;
6
+ this._delay = 5000; // ms
7
+ }
8
+ Object.defineProperty(RetryConfiguration.prototype, "attempts", {
9
+ get: function () {
10
+ return this._attempts;
11
+ },
12
+ set: function (value) {
13
+ this._attempts = value;
14
+ },
15
+ enumerable: false,
16
+ configurable: true
17
+ });
18
+ Object.defineProperty(RetryConfiguration.prototype, "delay", {
19
+ get: function () {
20
+ return this._delay;
21
+ },
22
+ set: function (value) {
23
+ this._delay = value;
24
+ },
25
+ enumerable: false,
26
+ configurable: true
27
+ });
28
+ return RetryConfiguration;
29
+ }());
30
+ exports.default = RetryConfiguration;
31
+ //# sourceMappingURL=RetryConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RetryConfiguration.js","sourceRoot":"","sources":["../../../src/common/configurations/RetryConfiguration.ts"],"names":[],"mappings":";;AAAA;IAAA;QACY,cAAS,GAAW,CAAC,CAAC;QACtB,WAAM,GAAW,IAAI,CAAC,CAAC,KAAK;IAiBxC,CAAC;IAfG,sBAAI,wCAAQ;aAAZ;YACI,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAED,UAAa,KAAa;YACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;;;OAJA;IAMD,sBAAI,qCAAK;aAAT;YACI,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;aAED,UAAU,KAAa;YACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;;;OAJA;IAKL,yBAAC;AAAD,CAAC,AAnBD,IAmBC"}
@@ -0,0 +1,10 @@
1
+ import Token from '../../auth/domain/Token';
2
+ import { Product } from '../../translation/common/Product';
3
+ export default class TokenConfiguration {
4
+ private _token;
5
+ private _product;
6
+ get token(): Token | undefined;
7
+ set token(value: Token | undefined);
8
+ get product(): Product | undefined;
9
+ set product(value: Product | undefined);
10
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var TokenConfiguration = /** @class */ (function () {
4
+ function TokenConfiguration() {
5
+ }
6
+ Object.defineProperty(TokenConfiguration.prototype, "token", {
7
+ get: function () {
8
+ return this._token;
9
+ },
10
+ set: function (value) {
11
+ this._token = value;
12
+ },
13
+ enumerable: false,
14
+ configurable: true
15
+ });
16
+ Object.defineProperty(TokenConfiguration.prototype, "product", {
17
+ get: function () {
18
+ return this._product;
19
+ },
20
+ set: function (value) {
21
+ this._product = value;
22
+ },
23
+ enumerable: false,
24
+ configurable: true
25
+ });
26
+ return TokenConfiguration;
27
+ }());
28
+ exports.default = TokenConfiguration;
29
+ //# sourceMappingURL=TokenConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenConfiguration.js","sourceRoot":"","sources":["../../../src/common/configurations/TokenConfiguration.ts"],"names":[],"mappings":";;AAGA;IAAA;IAmBA,CAAC;IAfG,sBAAI,qCAAK;aAAT;YACI,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;aAED,UAAU,KAAwB;YAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;;;OAJA;IAMD,sBAAI,uCAAO;aAAX;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAAY,KAA0B;YAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAJA;IAKL,yBAAC;AAAD,CAAC,AAnBD,IAmBC"}
@@ -0,0 +1,5 @@
1
+ export declare const CANCELED = "canceled";
2
+ export declare const SUCCEEDED = "succeeded";
3
+ export declare const FAILED = "failed";
4
+ export declare const TRANSLATING = "translating";
5
+ export declare const UNKNOWN = "unknown";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNKNOWN = exports.TRANSLATING = exports.FAILED = exports.SUCCEEDED = exports.CANCELED = void 0;
4
+ exports.CANCELED = 'canceled';
5
+ exports.SUCCEEDED = 'succeeded';
6
+ exports.FAILED = 'failed';
7
+ exports.TRANSLATING = 'translating';
8
+ exports.UNKNOWN = 'unknown';
9
+ //# sourceMappingURL=EdgeFinalSubStatuses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeFinalSubStatuses.js","sourceRoot":"","sources":["../../../src/common/constants/EdgeFinalSubStatuses.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,MAAM,GAAG,QAAQ,CAAC;AAClB,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,OAAO,GAAG,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const PREPARING = "preparing";
2
+ export declare const IN_PROGRESS = "inProgress";
3
+ export declare const DONE = "done";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DONE = exports.IN_PROGRESS = exports.PREPARING = void 0;
4
+ exports.PREPARING = 'preparing';
5
+ exports.IN_PROGRESS = 'inProgress';
6
+ exports.DONE = 'done';
7
+ //# sourceMappingURL=EdgeStatuses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeStatuses.js","sourceRoot":"","sources":["../../../src/common/constants/EdgeStatuses.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,WAAW,GAAG,YAAY,CAAC;AAC3B,QAAA,IAAI,GAAG,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Format } from '../../translation/common/Format';
2
+ export declare const fileExtensions: Record<string, Format>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fileExtensions = void 0;
4
+ var Format_1 = require("../../translation/common/Format");
5
+ exports.fileExtensions = {
6
+ txt: Format_1.Format.PLAIN,
7
+ xline: Format_1.Format.XLINE,
8
+ htm: Format_1.Format.HTML,
9
+ html: Format_1.Format.HTML,
10
+ xhtml: Format_1.Format.HTML,
11
+ xml: Format_1.Format.XML,
12
+ sdlxml: Format_1.Format.SDLXML,
13
+ tmx: Format_1.Format.TMX,
14
+ xliff: Format_1.Format.XLIFF,
15
+ bcm: Format_1.Format.BCM,
16
+ pdf: Format_1.Format.PDF,
17
+ rtf: Format_1.Format.RTF,
18
+ docx: Format_1.Format.DOCX,
19
+ dotx: Format_1.Format.DOCX,
20
+ docm: Format_1.Format.DOCX,
21
+ dotm: Format_1.Format.DOCX,
22
+ xlsx: Format_1.Format.XLSX,
23
+ xltx: Format_1.Format.XLSX,
24
+ xlsm: Format_1.Format.XLSX,
25
+ xltm: Format_1.Format.XLSX,
26
+ xlam: Format_1.Format.XLSX,
27
+ xlsb: Format_1.Format.XLSX,
28
+ pptx: Format_1.Format.PPTX,
29
+ potx: Format_1.Format.PPTX,
30
+ ppsx: Format_1.Format.PPTX,
31
+ pptm: Format_1.Format.PPTX,
32
+ potm: Format_1.Format.PPTX,
33
+ ppsm: Format_1.Format.PPTX,
34
+ doc: Format_1.Format.DOC,
35
+ dot: Format_1.Format.DOC,
36
+ xls: Format_1.Format.XLS,
37
+ xlt: Format_1.Format.XLS,
38
+ xla: Format_1.Format.XLS,
39
+ ppt: Format_1.Format.PPT,
40
+ pot: Format_1.Format.PPT,
41
+ pps: Format_1.Format.PPT,
42
+ odt: Format_1.Format.ODT,
43
+ ods: Format_1.Format.ODS,
44
+ odp: Format_1.Format.ODP,
45
+ gif: Format_1.Format.GIF,
46
+ jpg: Format_1.Format.JPG,
47
+ jpeg: Format_1.Format.JPG,
48
+ png: Format_1.Format.PNG,
49
+ eml: Format_1.Format.EML,
50
+ msg: Format_1.Format.MSG,
51
+ };
52
+ //# sourceMappingURL=FileExtensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileExtensions.js","sourceRoot":"","sources":["../../../src/common/constants/FileExtensions.ts"],"names":[],"mappings":";;;AAAA,0DAAyD;AAE5C,QAAA,cAAc,GAA2B;IAClD,GAAG,EAAE,eAAM,CAAC,KAAK;IACjB,KAAK,EAAE,eAAM,CAAC,KAAK;IACnB,GAAG,EAAE,eAAM,CAAC,IAAI;IAChB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,KAAK,EAAE,eAAM,CAAC,IAAI;IAClB,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,MAAM,EAAE,eAAM,CAAC,MAAM;IACrB,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,KAAK,EAAE,eAAM,CAAC,KAAK;IACnB,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IAEjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IAEjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IACjB,IAAI,EAAE,eAAM,CAAC,IAAI;IAEjB,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IAEf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IAEf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IAEf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,IAAI,EAAE,eAAM,CAAC,GAAG;IAChB,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;CAClB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const formatToMimeType: Record<string, string>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatToMimeType = void 0;
4
+ exports.formatToMimeType = {
5
+ UNK: 'unk',
6
+ NONE: 'none',
7
+ AUTO: 'auto',
8
+ XML: 'text/xml',
9
+ HTML: 'text/html',
10
+ UTF: 'text/plain',
11
+ XLINE: 'text/x-line',
12
+ TMX: 'text/x-tmx',
13
+ XLIFF: 'application/x-xliff',
14
+ PDF: 'application/pdf',
15
+ ODT: 'application/vnd.oasis.opendocument.text',
16
+ ODS: 'application/vnd.oasis.opendocument.spreadsheet',
17
+ ODP: 'application/vnd.oasis.opendocument.presentation',
18
+ RTF: 'application/rtf',
19
+ BCM: 'application/bcm',
20
+ DOC: 'application/msword',
21
+ XLS: 'application/vnd.ms-excel',
22
+ PPT: 'application/vnd.ms-powerpoint',
23
+ DOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
24
+ XLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
25
+ PPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
26
+ JPG: 'image/jpeg',
27
+ TIFF: 'image/tiff',
28
+ PNG: 'image/png',
29
+ GIF: 'image/gif',
30
+ PLAIN: 'text/plain',
31
+ SDLXML: 'text/x-sdl-strict-xml',
32
+ };
33
+ //# sourceMappingURL=FormatToMimeType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatToMimeType.js","sourceRoot":"","sources":["../../../src/common/constants/FormatToMimeType.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAA2B;IACpD,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,YAAY;IACjB,KAAK,EAAE,aAAa;IACpB,GAAG,EAAE,YAAY;IACjB,KAAK,EAAE,qBAAqB;IAC5B,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,yCAAyC;IAC9C,GAAG,EAAE,gDAAgD;IACrD,GAAG,EAAE,iDAAiD;IACtD,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,0BAA0B;IAC/B,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,yEAAyE;IAC/E,IAAI,EAAE,mEAAmE;IACzE,IAAI,EAAE,2EAA2E;IACjF,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,uBAAuB;CAClC,CAAC"}
@@ -0,0 +1,62 @@
1
+ export declare const CREDENTIALS_LOGIN_PATH = "/v4/token";
2
+ export declare const SELF_PATH = "/v4/accounts/api-credentials/self";
3
+ export declare const USER_SELF_PATH = "/v4/accounts/users/self";
4
+ export declare const SYNC_TRANSLATION_PATH = "/v4/mt/translations/sync";
5
+ export declare const ASYNC_TRANSLATION_PATH = "/v4/mt/translations/async";
6
+ export declare const EDGE_LANGUAGE_PAIRS_PATH = "/api/v2/language-pairs?chains=also";
7
+ export declare const EDGE_GET_ALL_DICTIONARIES_PATH = "/api/v2/dictionaries";
8
+ export declare const EDGE_ASYNC_TRANSLATION_PATH = "/api/v2/translations";
9
+ export declare const EDGE_ASYNC_METADATA_PATH = "/api/v2/translations/{0}/metadata";
10
+ export declare const EDGE_QUICK_TRANSLATION_PATH = "/api/v2/translations/quick";
11
+ export declare const INPUT = "input";
12
+ export declare const TARGET_LANGUAGE_ID = "targetLanguageId";
13
+ export declare const SOURCE_LANGUAGE_ID = "sourceLanguageId";
14
+ export declare const MODEL = "model";
15
+ export declare const INPUT_FORMAT = "inputFormat";
16
+ export declare const DICTIONARIES = "dictionaries";
17
+ export declare const LANGUAGE_PAIR_ID = "languagePairId";
18
+ export declare const DICTIONARY_IDS = "dictionaryIds";
19
+ export declare const OUTPUT_FORMAT = "outputFormat";
20
+ export declare const TITLE = "title";
21
+ export declare const ENCODING = "encoding";
22
+ export declare const SMALL_INPUT_GET_TRANSLATION_STATUS_DELAY = 100;
23
+ export declare const LARGE_INPUT_GET_TRANSLATION_STATUS_DELAY = 500;
24
+ export declare const CHECK_STATUS_TIMEOUT = 300000;
25
+ export declare const THREAD_NUMBER_FOR_BATCH_TRANSLATION = 4;
26
+ export declare const SYNC_SIZE_LIMIT = 1000;
27
+ export declare const MAX_FILE_SIZE_LIMIT = 104857600;
28
+ export declare const MAX_ASYNC_TEXT_SIZE_LIMIT = 2097152;
29
+ export declare const DEFAULT_DICTIONARIES_PAGE_SIZE = 100;
30
+ export declare const US_URL = "https://us.api.languageweaver.com";
31
+ export declare const EUROPE_URL = "https://api.languageweaver.com";
32
+ export declare const EDGE_DEFAULT_URL = "http://localhost:8001";
33
+ export declare const LW_CLIENT_ID_ENV_VAR = "LW_CLIENT_ID";
34
+ export declare const LW_CLIENT_SECRET_ENV_VAR = "LW_CLIENT_SECRET";
35
+ export declare const LW_PRODUCT_ENV_VAR = "LW_PRODUCT";
36
+ export declare const LW_EDGE_OVERWRITE_URL = "LW_EDGE_OVERWRITE_URL";
37
+ export declare const LW_CLOUD_REGION = "LW_CLOUD_REGION";
38
+ export declare const REACT_APP_LW_CLIENT_ID_ENV_VAR = "REACT_APP_LW_CLIENT_ID";
39
+ export declare const REACT_APP_LW_CLIENT_SECRET_ENV_VAR = "REACT_APP_LW_CLIENT_SECRET";
40
+ export declare const REACT_APP_LW_PRODUCT_ENV_VAR = "REACT_APP_LW_PRODUCT";
41
+ export declare const REACT_APP_LW_EDGE_OVERWRITE_URL = "REACT_APP_LW_EDGE_OVERWRITE_URL";
42
+ export declare const REACT_APP_LW_CLOUD_REGION = "REACT_APP_LW_CLOUD_REGION";
43
+ export declare const AUTHORIZATION = "Authorization";
44
+ export declare const ACCEPT = "Accept";
45
+ export declare const CONTENT_TYPE = "Content-Type";
46
+ export declare const CLIENT_ID = "clientId";
47
+ export declare const CLIENT_SECRET = "clientSecret";
48
+ export declare const TRANSLATION_TIMEOUT = "Translation timeout";
49
+ export declare const MISSING_REQUIRED_LANGUAGE_PAIR_ID = "Missing required languagePairId";
50
+ export declare const MISSING_REQUIRED_INPUT_FILE_ERROR = "Missing required input file";
51
+ export declare const MISSING_REQUIRED_INPUT_DIRECTORY_ERROR = "Missing required input directory";
52
+ export declare const MISSING_REQUIRED_INPUT_FILES_ERROR = "Missing required input files";
53
+ export declare const MISSING_REQUIRED_OUTPUT_FILE_ERROR = "Missing required output file";
54
+ export declare const MISSING_REQUIRED_OUTPUT_DIRECTORY_ERROR = "Missing required output directory";
55
+ export declare const READ_FILES_FROM_DIRECTORY_FAILED_ERROR = "Cannot read files from input directory";
56
+ export declare const REQUIRED_INPUT_FILE_OF_TYPE_OBJECT_ERROR = "Input file must be a File object";
57
+ export declare const REQUIRED_INPUT_FILE_OF_TYPE_STRING_ERROR = "Input file must be a string";
58
+ export declare const REQUIRED_INPUT_FILES_OF_TYPE_OBJECT_ERROR = "All input files must be instances of File object";
59
+ export declare const REQUIRED_INPUT_DIRECTORY_OF_TYPE_STRING_ERROR = "Input file must be a string";
60
+ export declare const INVALID_PATH_ERROR = "Invalid file path: ";
61
+ export declare const INVALID_DIRECTORY_ERROR = "Invalid directory: ";
62
+ export declare const LANGUAGE_PAIR_NOT_FOUND_ERROR = "No language pair found for given source, target and model";
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MISSING_REQUIRED_INPUT_FILE_ERROR = exports.MISSING_REQUIRED_LANGUAGE_PAIR_ID = exports.TRANSLATION_TIMEOUT = exports.CLIENT_SECRET = exports.CLIENT_ID = exports.CONTENT_TYPE = exports.ACCEPT = exports.AUTHORIZATION = exports.REACT_APP_LW_CLOUD_REGION = exports.REACT_APP_LW_EDGE_OVERWRITE_URL = exports.REACT_APP_LW_PRODUCT_ENV_VAR = exports.REACT_APP_LW_CLIENT_SECRET_ENV_VAR = exports.REACT_APP_LW_CLIENT_ID_ENV_VAR = exports.LW_CLOUD_REGION = exports.LW_EDGE_OVERWRITE_URL = exports.LW_PRODUCT_ENV_VAR = exports.LW_CLIENT_SECRET_ENV_VAR = exports.LW_CLIENT_ID_ENV_VAR = exports.EDGE_DEFAULT_URL = exports.EUROPE_URL = exports.US_URL = exports.DEFAULT_DICTIONARIES_PAGE_SIZE = exports.MAX_ASYNC_TEXT_SIZE_LIMIT = exports.MAX_FILE_SIZE_LIMIT = exports.SYNC_SIZE_LIMIT = exports.THREAD_NUMBER_FOR_BATCH_TRANSLATION = exports.CHECK_STATUS_TIMEOUT = exports.LARGE_INPUT_GET_TRANSLATION_STATUS_DELAY = exports.SMALL_INPUT_GET_TRANSLATION_STATUS_DELAY = exports.ENCODING = exports.TITLE = exports.OUTPUT_FORMAT = exports.DICTIONARY_IDS = exports.LANGUAGE_PAIR_ID = exports.DICTIONARIES = exports.INPUT_FORMAT = exports.MODEL = exports.SOURCE_LANGUAGE_ID = exports.TARGET_LANGUAGE_ID = exports.INPUT = exports.EDGE_QUICK_TRANSLATION_PATH = exports.EDGE_ASYNC_METADATA_PATH = exports.EDGE_ASYNC_TRANSLATION_PATH = exports.EDGE_GET_ALL_DICTIONARIES_PATH = exports.EDGE_LANGUAGE_PAIRS_PATH = exports.ASYNC_TRANSLATION_PATH = exports.SYNC_TRANSLATION_PATH = exports.USER_SELF_PATH = exports.SELF_PATH = exports.CREDENTIALS_LOGIN_PATH = void 0;
4
+ exports.LANGUAGE_PAIR_NOT_FOUND_ERROR = exports.INVALID_DIRECTORY_ERROR = exports.INVALID_PATH_ERROR = exports.REQUIRED_INPUT_DIRECTORY_OF_TYPE_STRING_ERROR = exports.REQUIRED_INPUT_FILES_OF_TYPE_OBJECT_ERROR = exports.REQUIRED_INPUT_FILE_OF_TYPE_STRING_ERROR = exports.REQUIRED_INPUT_FILE_OF_TYPE_OBJECT_ERROR = exports.READ_FILES_FROM_DIRECTORY_FAILED_ERROR = exports.MISSING_REQUIRED_OUTPUT_DIRECTORY_ERROR = exports.MISSING_REQUIRED_OUTPUT_FILE_ERROR = exports.MISSING_REQUIRED_INPUT_FILES_ERROR = exports.MISSING_REQUIRED_INPUT_DIRECTORY_ERROR = void 0;
5
+ exports.CREDENTIALS_LOGIN_PATH = '/v4/token';
6
+ exports.SELF_PATH = '/v4/accounts/api-credentials/self';
7
+ exports.USER_SELF_PATH = '/v4/accounts/users/self';
8
+ exports.SYNC_TRANSLATION_PATH = '/v4/mt/translations/sync';
9
+ exports.ASYNC_TRANSLATION_PATH = '/v4/mt/translations/async';
10
+ exports.EDGE_LANGUAGE_PAIRS_PATH = '/api/v2/language-pairs?chains=also';
11
+ exports.EDGE_GET_ALL_DICTIONARIES_PATH = '/api/v2/dictionaries';
12
+ exports.EDGE_ASYNC_TRANSLATION_PATH = '/api/v2/translations';
13
+ exports.EDGE_ASYNC_METADATA_PATH = '/api/v2/translations/{0}/metadata';
14
+ exports.EDGE_QUICK_TRANSLATION_PATH = '/api/v2/translations/quick';
15
+ exports.INPUT = 'input';
16
+ exports.TARGET_LANGUAGE_ID = 'targetLanguageId';
17
+ exports.SOURCE_LANGUAGE_ID = 'sourceLanguageId';
18
+ exports.MODEL = 'model';
19
+ exports.INPUT_FORMAT = 'inputFormat';
20
+ exports.DICTIONARIES = 'dictionaries';
21
+ exports.LANGUAGE_PAIR_ID = 'languagePairId';
22
+ exports.DICTIONARY_IDS = 'dictionaryIds';
23
+ exports.OUTPUT_FORMAT = 'outputFormat';
24
+ exports.TITLE = 'title';
25
+ exports.ENCODING = 'encoding';
26
+ exports.SMALL_INPUT_GET_TRANSLATION_STATUS_DELAY = 100;
27
+ exports.LARGE_INPUT_GET_TRANSLATION_STATUS_DELAY = 500;
28
+ exports.CHECK_STATUS_TIMEOUT = 300000; // timeout in milliseconds
29
+ exports.THREAD_NUMBER_FOR_BATCH_TRANSLATION = 4;
30
+ exports.SYNC_SIZE_LIMIT = 1000; // characters
31
+ exports.MAX_FILE_SIZE_LIMIT = 104857600; // 100MB in bytes
32
+ exports.MAX_ASYNC_TEXT_SIZE_LIMIT = 2097152; // 2MB in bytes
33
+ exports.DEFAULT_DICTIONARIES_PAGE_SIZE = 100;
34
+ exports.US_URL = 'https://us.api.languageweaver.com';
35
+ exports.EUROPE_URL = 'https://api.languageweaver.com';
36
+ exports.EDGE_DEFAULT_URL = 'http://localhost:8001';
37
+ // Environment variables keys
38
+ exports.LW_CLIENT_ID_ENV_VAR = 'LW_CLIENT_ID';
39
+ exports.LW_CLIENT_SECRET_ENV_VAR = 'LW_CLIENT_SECRET';
40
+ exports.LW_PRODUCT_ENV_VAR = 'LW_PRODUCT';
41
+ exports.LW_EDGE_OVERWRITE_URL = 'LW_EDGE_OVERWRITE_URL';
42
+ exports.LW_CLOUD_REGION = 'LW_CLOUD_REGION';
43
+ // React - Environment variables keys
44
+ exports.REACT_APP_LW_CLIENT_ID_ENV_VAR = 'REACT_APP_LW_CLIENT_ID';
45
+ exports.REACT_APP_LW_CLIENT_SECRET_ENV_VAR = 'REACT_APP_LW_CLIENT_SECRET';
46
+ exports.REACT_APP_LW_PRODUCT_ENV_VAR = 'REACT_APP_LW_PRODUCT';
47
+ exports.REACT_APP_LW_EDGE_OVERWRITE_URL = 'REACT_APP_LW_EDGE_OVERWRITE_URL';
48
+ exports.REACT_APP_LW_CLOUD_REGION = 'REACT_APP_LW_CLOUD_REGION';
49
+ exports.AUTHORIZATION = 'Authorization';
50
+ exports.ACCEPT = 'Accept';
51
+ exports.CONTENT_TYPE = 'Content-Type';
52
+ exports.CLIENT_ID = 'clientId';
53
+ exports.CLIENT_SECRET = 'clientSecret';
54
+ exports.TRANSLATION_TIMEOUT = 'Translation timeout';
55
+ exports.MISSING_REQUIRED_LANGUAGE_PAIR_ID = 'Missing required languagePairId';
56
+ exports.MISSING_REQUIRED_INPUT_FILE_ERROR = 'Missing required input file';
57
+ exports.MISSING_REQUIRED_INPUT_DIRECTORY_ERROR = 'Missing required input directory';
58
+ exports.MISSING_REQUIRED_INPUT_FILES_ERROR = 'Missing required input files';
59
+ exports.MISSING_REQUIRED_OUTPUT_FILE_ERROR = 'Missing required output file';
60
+ exports.MISSING_REQUIRED_OUTPUT_DIRECTORY_ERROR = 'Missing required output directory';
61
+ exports.READ_FILES_FROM_DIRECTORY_FAILED_ERROR = 'Cannot read files from input directory';
62
+ exports.REQUIRED_INPUT_FILE_OF_TYPE_OBJECT_ERROR = 'Input file must be a File object';
63
+ exports.REQUIRED_INPUT_FILE_OF_TYPE_STRING_ERROR = 'Input file must be a string';
64
+ exports.REQUIRED_INPUT_FILES_OF_TYPE_OBJECT_ERROR = 'All input files must be instances of File object';
65
+ exports.REQUIRED_INPUT_DIRECTORY_OF_TYPE_STRING_ERROR = 'Input file must be a string';
66
+ exports.INVALID_PATH_ERROR = 'Invalid file path: ';
67
+ exports.INVALID_DIRECTORY_ERROR = 'Invalid directory: ';
68
+ exports.LANGUAGE_PAIR_NOT_FOUND_ERROR = 'No language pair found for given source, target and model';
69
+ //# sourceMappingURL=TranslationConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TranslationConstants.js","sourceRoot":"","sources":["../../../src/common/constants/TranslationConstants.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
1
+ export declare const iso639Mapping: Record<string, any>;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.iso639Mapping = void 0;
4
+ exports.iso639Mapping = {
5
+ unk: 'unk',
6
+ afr: 'af',
7
+ alb: 'sq',
8
+ amh: 'am',
9
+ ara: 'ar',
10
+ arz: 'ar-arabizi',
11
+ arm: 'hy',
12
+ aze: 'az',
13
+ baq: 'eu',
14
+ bel: 'be',
15
+ ben: 'bn',
16
+ bih: 'bh',
17
+ bul: 'bg',
18
+ cat: 'ca',
19
+ ceb: 'ceb',
20
+ chr: 'chr',
21
+ chi: 'zh-Hans',
22
+ cht: 'zh-Hant',
23
+ hrv: 'hr',
24
+ cze: 'cs',
25
+ dan: 'da',
26
+ fad: 'prs-AF',
27
+ dut: 'nl',
28
+ eng: 'en',
29
+ est: 'et',
30
+ fin: 'fi',
31
+ fra: 'fr',
32
+ glg: 'gl',
33
+ lug: 'lg',
34
+ geo: 'ka',
35
+ ger: 'de',
36
+ gre: 'el',
37
+ guj: 'gu',
38
+ hau: 'ha',
39
+ heb: 'he',
40
+ hin: 'hi',
41
+ hmn: 'hmn',
42
+ hun: 'hu',
43
+ ice: 'is',
44
+ ind: 'id',
45
+ iku: 'iu',
46
+ gle: 'ga',
47
+ ita: 'it',
48
+ jpn: 'ja',
49
+ jav: 'jv',
50
+ kan: 'kn',
51
+ kin: 'rw',
52
+ kor: 'ko',
53
+ lav: 'lv',
54
+ lif: 'lif',
55
+ lit: 'lt',
56
+ mac: 'mk',
57
+ may: 'ms',
58
+ mal: 'ml',
59
+ mlt: 'mt',
60
+ mar: 'mr',
61
+ nep: 'ne',
62
+ nor: 'no',
63
+ ori: 'or',
64
+ oss: 'os',
65
+ pus: 'ps',
66
+ per: 'fa',
67
+ pol: 'pl',
68
+ por: 'pt',
69
+ ptb: 'pt-BR',
70
+ ptp: 'pt-PT',
71
+ rum: 'ro',
72
+ rus: 'ru',
73
+ srp: 'sr',
74
+ slo: 'sk',
75
+ slv: 'sl',
76
+ som: 'so',
77
+ spa: 'es',
78
+ sun: 'su',
79
+ swa: 'sw',
80
+ swe: 'sv',
81
+ syr: 'syr',
82
+ tgl: 'tl',
83
+ tgk: 'tg',
84
+ tam: 'ta',
85
+ tel: 'te',
86
+ tha: 'th',
87
+ tur: 'tr',
88
+ ukr: 'uk',
89
+ urd: 'ur',
90
+ uzb: 'uz',
91
+ vie: 'vi',
92
+ wel: 'cy',
93
+ yid: 'yi',
94
+ };
95
+ //# sourceMappingURL=Iso639Mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Iso639Mapping.js","sourceRoot":"","sources":["../../../../src/common/constants/languages/Iso639Mapping.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAwB;IAC9C,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;CACZ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export default class EdgeTranslationException {
2
+ static getTranslationException(translationStatus: string | undefined, requestId: string | undefined, errorMessage?: string): Record<string, any>;
3
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var EdgeTranslationException = /** @class */ (function () {
4
+ function EdgeTranslationException() {
5
+ }
6
+ EdgeTranslationException.getTranslationException = function (translationStatus, requestId, errorMessage) {
7
+ var message = "Received status ".concat(translationStatus, " for translation with \n TranslationId: ").concat(requestId);
8
+ return {
9
+ message: errorMessage ? message + " \n with error message: ".concat(errorMessage) : message,
10
+ translationStatus: translationStatus,
11
+ requestId: requestId,
12
+ };
13
+ };
14
+ return EdgeTranslationException;
15
+ }());
16
+ exports.default = EdgeTranslationException;
17
+ //# sourceMappingURL=EdgeTranslationException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeTranslationException.js","sourceRoot":"","sources":["../../../src/common/exceptions/EdgeTranslationException.ts"],"names":[],"mappings":";;AAAA;IAAA;IAcA,CAAC;IAbU,gDAAuB,GAA9B,UACI,iBAAqC,EACrC,SAA6B,EAC7B,YAAqB;QAErB,IAAM,OAAO,GAAG,0BAAmB,iBAAiB,qDAA2C,SAAS,CAAE,CAAC;QAE3G,OAAO;YACH,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,GAAG,kCAA2B,YAAY,CAAE,CAAC,CAAC,CAAC,OAAO;YACrF,iBAAiB,mBAAA;YACjB,SAAS,WAAA;SACZ,CAAC;IACN,CAAC;IACL,+BAAC;AAAD,CAAC,AAdD,IAcC"}
@@ -0,0 +1,4 @@
1
+ import ErrorResponse from '../api/ErrorResponse';
2
+ export default class TranslationException {
3
+ static getTranslationException(translationStatus: string, requestId: string | undefined, errors?: ErrorResponse[] | undefined): Record<string, any>;
4
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var TranslationException = /** @class */ (function () {
4
+ function TranslationException() {
5
+ }
6
+ TranslationException.getTranslationException = function (translationStatus, requestId, errors) {
7
+ var message = "Received status ".concat(translationStatus, " for translation with \n RequestId: ").concat(requestId);
8
+ return {
9
+ message: errors ? message + " \n with errors: ".concat(JSON.stringify(errors)) : message,
10
+ translationStatus: translationStatus,
11
+ requestId: requestId,
12
+ };
13
+ };
14
+ return TranslationException;
15
+ }());
16
+ exports.default = TranslationException;
17
+ //# sourceMappingURL=TranslationException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TranslationException.js","sourceRoot":"","sources":["../../../src/common/exceptions/TranslationException.ts"],"names":[],"mappings":";;AAEA;IAAA;IAcA,CAAC;IAbU,4CAAuB,GAA9B,UACI,iBAAyB,EACzB,SAA6B,EAC7B,MAAoC;QAEpC,IAAM,OAAO,GAAG,0BAAmB,iBAAiB,iDAAuC,SAAS,CAAE,CAAC;QAEvG,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG,2BAAoB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAE,CAAC,CAAC,CAAC,OAAO;YAClF,iBAAiB,mBAAA;YACjB,SAAS,WAAA;SACZ,CAAC;IACN,CAAC;IACL,2BAAC;AAAD,CAAC,AAdD,IAcC"}
@@ -0,0 +1,34 @@
1
+ import Token from '../../auth/domain/Token';
2
+ import ClientConfiguration from '../configurations/ClientConfiguration';
3
+ declare type RequestConfig = {
4
+ hasStreamResponse?: boolean;
5
+ headersNeeded?: boolean;
6
+ };
7
+ export default class RestClient {
8
+ private _baseUrl;
9
+ private _withTraceHeaders;
10
+ private _clientConfiguration;
11
+ private _regenerateToken;
12
+ constructor(url: string, withTraceHeaders?: boolean);
13
+ get baseUrl(): string;
14
+ set baseUrl(value: string);
15
+ get regenerateToken(): ((token: Token) => void) | undefined;
16
+ set regenerateToken(value: ((token: Token) => void) | undefined);
17
+ get clientConfiguration(): ClientConfiguration | undefined;
18
+ set clientConfiguration(value: ClientConfiguration | undefined);
19
+ requestJson(token: Token | undefined, method: string, url: string, body?: any, queryStringParams?: object, config?: RequestConfig): Promise<any>;
20
+ requestMultipart(token: Token | undefined, method: string, url: string, body?: any, queryStringParams?: object): Promise<any>;
21
+ getFetchOptionsForJsonRequest(token: Token | undefined, method: string, body: any, hasStreamResponse?: boolean): Record<string, any>;
22
+ getFetchOptionsForMultipartRequest(token: Token | undefined, method: string, body: any): Record<string, any>;
23
+ private addTraceHeaders;
24
+ private addAuthorizationHeader;
25
+ private processBodyValues;
26
+ request(method: string, url: string, options: Record<string, any>, queryStringParams?: object, attempt?: number, config?: RequestConfig): Promise<any>;
27
+ getFetchUrl(method: string, url: string, queryStringParams?: object): string;
28
+ getUrlWithParams(url: string, queryStringParams: object): string;
29
+ getQueryParamsString(params: any): string;
30
+ processParameterValue(param: any): any;
31
+ handleResponse(response: any, traceId: string, config?: RequestConfig): Promise<Record<string, any>>;
32
+ shouldRetryRequest(attempt: number, response: any, url: string): Promise<boolean>;
33
+ }
34
+ export {};