@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,319 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var jwt_decode_1 = __importDefault(require("jwt-decode"));
43
+ var Iso639Mapping_1 = require("../constants/languages/Iso639Mapping");
44
+ var TranslationConstants_1 = require("../constants/TranslationConstants");
45
+ var FileExtensions_1 = require("../constants/FileExtensions");
46
+ var Format_1 = require("../../translation/common/Format");
47
+ var Utils = /** @class */ (function () {
48
+ function Utils() {
49
+ }
50
+ Utils.getLang3FromLangCode2 = function (code) {
51
+ var iso = Object.keys(Iso639Mapping_1.iso639Mapping).find(function (key) { return Iso639Mapping_1.iso639Mapping[key] === code; });
52
+ return iso || code;
53
+ };
54
+ Utils.getLanguageCode3 = function (language) {
55
+ if (language && language.length === 3) {
56
+ return language;
57
+ }
58
+ return language ? this.getLang3FromLangCode2(language) : '';
59
+ };
60
+ Utils.getInputSize = function (input) {
61
+ return input.reduce(function (acc, value) {
62
+ acc += value.length;
63
+ return acc;
64
+ }, 0);
65
+ };
66
+ Utils.getInputBytesSize = function (input) {
67
+ return input.reduce(function (acc, value) {
68
+ acc += getBytesSize(value);
69
+ return acc;
70
+ }, 0);
71
+ function getBytesSize(value) {
72
+ if (Utils.isBrowser()) {
73
+ return new Blob([value]).size;
74
+ }
75
+ else {
76
+ return Buffer.from(value).length;
77
+ }
78
+ }
79
+ };
80
+ Utils.isBrowser = function () {
81
+ return typeof window !== 'undefined';
82
+ };
83
+ Utils.encodeStringToBase64 = function (text) {
84
+ if (this.isBrowser()) {
85
+ return btoa(unescape(encodeURIComponent(text)));
86
+ }
87
+ else {
88
+ return Buffer.from(text, 'utf-8').toString('base64');
89
+ }
90
+ };
91
+ Utils.decodeStringFromBase64 = function (text) {
92
+ if (this.isBrowser()) {
93
+ return atob(text);
94
+ }
95
+ else {
96
+ return Buffer.from(text, 'base64').toString();
97
+ }
98
+ };
99
+ Utils.decodeStringFromBase64ToBlob = function (base64String) {
100
+ if (this.isBrowser()) {
101
+ var byteCharacters = this.decodeStringFromBase64(base64String);
102
+ var arrayBuffer = this.base64ToArrayBuffer(byteCharacters);
103
+ var blob = new Blob([arrayBuffer]);
104
+ return blob;
105
+ }
106
+ else {
107
+ return null;
108
+ }
109
+ };
110
+ Utils.base64ToArrayBuffer = function (binaryString) {
111
+ var binaryLen = binaryString.length;
112
+ var bytes = new Uint8Array(binaryLen);
113
+ for (var i = 0; i < binaryLen; i++) {
114
+ bytes[i] = binaryString.charCodeAt(i);
115
+ }
116
+ return bytes;
117
+ };
118
+ Utils.getEncodedFile = function (file) {
119
+ return __awaiter(this, void 0, void 0, function () {
120
+ return __generator(this, function (_a) {
121
+ switch (_a.label) {
122
+ case 0:
123
+ if (!Utils.isBrowser()) return [3 /*break*/, 2];
124
+ return [4 /*yield*/, this.getEncodedFileContentInBrowser(file)];
125
+ case 1: return [2 /*return*/, _a.sent()];
126
+ case 2: return [4 /*yield*/, this.getEncodedFileContentInNode(file)];
127
+ case 3: return [2 /*return*/, _a.sent()];
128
+ }
129
+ });
130
+ });
131
+ };
132
+ Utils.getEncodedFileContentInBrowser = function (file) {
133
+ return __awaiter(this, void 0, void 0, function () {
134
+ var reader;
135
+ return __generator(this, function (_a) {
136
+ if (!(file instanceof File)) {
137
+ return [2 /*return*/, ''];
138
+ }
139
+ reader = new FileReader();
140
+ reader.readAsDataURL(file);
141
+ return [2 /*return*/, new Promise(function (resolve) {
142
+ reader.onload = function () {
143
+ var result = reader.result;
144
+ if (typeof result === 'string') {
145
+ resolve(result.split(',')[1]);
146
+ }
147
+ else {
148
+ return resolve('');
149
+ }
150
+ };
151
+ })];
152
+ });
153
+ });
154
+ };
155
+ Utils.getEncodedFileContentInNode = function (file) {
156
+ return __awaiter(this, void 0, void 0, function () {
157
+ var _this = this;
158
+ return __generator(this, function (_a) {
159
+ return [2 /*return*/, new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
160
+ var fs, fileBuffer;
161
+ return __generator(this, function (_a) {
162
+ switch (_a.label) {
163
+ case 0:
164
+ if (!(typeof file === 'string')) return [3 /*break*/, 2];
165
+ fs = require('fs');
166
+ return [4 /*yield*/, fs.promises.readFile(file)];
167
+ case 1:
168
+ fileBuffer = _a.sent();
169
+ resolve(fileBuffer.toString('base64'));
170
+ _a.label = 2;
171
+ case 2:
172
+ resolve('');
173
+ return [2 /*return*/];
174
+ }
175
+ });
176
+ }); })];
177
+ });
178
+ });
179
+ };
180
+ Utils.getCloudClientIdEnvVar = function () {
181
+ if (Utils.isBrowser()) {
182
+ return process.env[TranslationConstants_1.REACT_APP_LW_CLIENT_ID_ENV_VAR] || process.env[TranslationConstants_1.LW_CLIENT_ID_ENV_VAR];
183
+ }
184
+ else {
185
+ return process.env[TranslationConstants_1.LW_CLIENT_ID_ENV_VAR];
186
+ }
187
+ };
188
+ Utils.getCloudClientSecretEnvVar = function () {
189
+ if (Utils.isBrowser()) {
190
+ return process.env[TranslationConstants_1.REACT_APP_LW_CLIENT_SECRET_ENV_VAR] || process.env[TranslationConstants_1.LW_CLIENT_SECRET_ENV_VAR];
191
+ }
192
+ else {
193
+ return process.env[TranslationConstants_1.LW_CLIENT_SECRET_ENV_VAR];
194
+ }
195
+ };
196
+ Utils.getEdgeOverwriteUrlEnvVar = function () {
197
+ if (Utils.isBrowser()) {
198
+ return process.env[TranslationConstants_1.REACT_APP_LW_EDGE_OVERWRITE_URL] || process.env[TranslationConstants_1.LW_EDGE_OVERWRITE_URL];
199
+ }
200
+ else {
201
+ return process.env[TranslationConstants_1.LW_EDGE_OVERWRITE_URL];
202
+ }
203
+ };
204
+ Utils.getCloudRegionEnvVar = function () {
205
+ if (Utils.isBrowser()) {
206
+ return process.env[TranslationConstants_1.REACT_APP_LW_CLOUD_REGION] || process.env[TranslationConstants_1.LW_CLOUD_REGION];
207
+ }
208
+ else {
209
+ return process.env[TranslationConstants_1.LW_CLOUD_REGION];
210
+ }
211
+ };
212
+ Utils.getProductEnvVar = function () {
213
+ if (Utils.isBrowser()) {
214
+ return process.env[TranslationConstants_1.REACT_APP_LW_PRODUCT_ENV_VAR] || process.env[TranslationConstants_1.LW_PRODUCT_ENV_VAR];
215
+ }
216
+ else {
217
+ return process.env[TranslationConstants_1.LW_PRODUCT_ENV_VAR];
218
+ }
219
+ };
220
+ Utils.isCloudCredentialsToken = function (token) {
221
+ if (!token || !token.accessToken) {
222
+ return false;
223
+ }
224
+ var decoded = (0, jwt_decode_1.default)(token.accessToken);
225
+ return decoded && decoded.sub ? decoded.sub.endsWith('@clients') : false;
226
+ };
227
+ Utils.getFormatForFile = function (file) {
228
+ var fileExtension = Utils.getExtension(file);
229
+ if (fileExtension) {
230
+ return FileExtensions_1.fileExtensions[fileExtension.toLowerCase()] || Format_1.Format.UNK;
231
+ }
232
+ return Format_1.Format.UNK;
233
+ };
234
+ Utils.getAbsolutePath = function (relativePath) {
235
+ var path = require('path');
236
+ return path.resolve(relativePath);
237
+ };
238
+ Utils.getFullPath = function (directory, filename) {
239
+ var path = require('path');
240
+ return path.join(this.getAbsolutePath(directory), filename);
241
+ };
242
+ Utils.getExtension = function (file) {
243
+ if (this.isBrowser()) {
244
+ return this.getExtensionInBrowser(file instanceof File ? file.name : file);
245
+ }
246
+ else {
247
+ return typeof file === 'string' ? this.getExtensionInNode(file) : '';
248
+ }
249
+ };
250
+ Utils.getExtensionInBrowser = function (filename) {
251
+ var lastIndex = filename.lastIndexOf('.');
252
+ return lastIndex > 0 ? filename.substring(lastIndex + 1) : '';
253
+ };
254
+ Utils.getExtensionInNode = function (file) {
255
+ var path = require('path');
256
+ return path.extname(file).substring(1);
257
+ };
258
+ Utils.validateDirectoryPath = function (directoryPath) {
259
+ try {
260
+ var fs = require('fs');
261
+ fs.statSync(directoryPath).isDirectory();
262
+ return null;
263
+ }
264
+ catch (e) {
265
+ return TranslationConstants_1.INVALID_DIRECTORY_ERROR + directoryPath;
266
+ }
267
+ };
268
+ Utils.validateFilePath = function (filePath) {
269
+ var fs = require('fs');
270
+ try {
271
+ fs.statSync(filePath).isFile();
272
+ return null;
273
+ }
274
+ catch (e) {
275
+ return TranslationConstants_1.INVALID_PATH_ERROR + filePath;
276
+ }
277
+ };
278
+ Utils.getFileSize = function (file) {
279
+ if (this.isBrowser()) {
280
+ return file instanceof File ? file.size : 0;
281
+ }
282
+ else {
283
+ var fs = require('fs');
284
+ return typeof file === 'string' ? fs.statSync(file).size : 0;
285
+ }
286
+ };
287
+ Utils.getFileBasename = function (file) {
288
+ if (this.isBrowser()) {
289
+ var filename = this.getFilename(file);
290
+ var extensionDot = filename.lastIndexOf('.');
291
+ return extensionDot > 0 ? filename.substring(0, extensionDot) : filename;
292
+ }
293
+ else {
294
+ var path = require('path');
295
+ return typeof file === 'string' ? path.basename(file, '.' + this.getExtension(file)) : '';
296
+ }
297
+ };
298
+ Utils.getFilename = function (file) {
299
+ if (this.isBrowser()) {
300
+ return file instanceof File ? file.name : '';
301
+ }
302
+ else {
303
+ var path = require('path');
304
+ return typeof file === 'string' ? path.basename(file) : '';
305
+ }
306
+ };
307
+ Utils.getNewFormDataObject = function () {
308
+ if (this.isBrowser()) {
309
+ return new FormData();
310
+ }
311
+ else {
312
+ var FormData_1 = require('form-data');
313
+ return new FormData_1();
314
+ }
315
+ };
316
+ return Utils;
317
+ }());
318
+ exports.default = Utils;
319
+ //# sourceMappingURL=Utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/common/utils/Utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA6C;AAE7C,sEAAqE;AACrE,0EAa2C;AAE3C,8DAA6D;AAC7D,0DAAyD;AAEzD;IAAA;IAkRA,CAAC;IAjRU,2BAAqB,GAA5B,UAA6B,IAAY;QACrC,IAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,6BAAa,CAAC,CAAC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,6BAAa,CAAC,GAAG,CAAC,KAAK,IAAI,EAA3B,CAA2B,CAAC,CAAC;QAElF,OAAO,GAAG,IAAI,IAAI,CAAC;IACvB,CAAC;IAEM,sBAAgB,GAAvB,UAAwB,QAA4B;QAChD,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACnC,OAAO,QAAQ,CAAC;SACnB;QAED,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,CAAC;IAEM,kBAAY,GAAnB,UAAoB,KAAe;QAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,KAAK;YAC3B,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC;YACpB,OAAO,GAAG,CAAC;QACf,CAAC,EAAE,CAAC,CAAC,CAAC;IACV,CAAC;IAEM,uBAAiB,GAAxB,UAAyB,KAAe;QACpC,OAAO,KAAK,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,KAAK;YA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C,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7F;IACL,CAAC;IAEM,iBAAW,GAAlB,UAAmB,IAAmB;QAClC,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;YAClB,OAAO,IAAI,YAAY,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;SAChD;aAAM;YACH,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;YAC7B,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9D;IACL,CAAC;IAEM,0BAAoB,GAA3B;QACI,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;YAClB,OAAO,IAAI,QAAQ,EAAE,CAAC;SACzB;aAAM;YACH,IAAM,UAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;YACtC,OAAO,IAAI,UAAQ,EAAE,CAAC;SACzB;IACL,CAAC;IACL,YAAC;AAAD,CAAC,AAlRD,IAkRC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ import SdkFactory from './SdkFactory';
2
+ import CloudLanguageWeaverClient from './CloudLanguageWeaverClient';
3
+ import EdgeLanguageWeaverClient from './EdgeLanguageWeaverClient';
4
+ import { LanguageWeaverClient } from './LanguageWeaverClient';
5
+ import CredentialsConfiguration from './common/configurations/CredentialsConfiguration';
6
+ import RetryConfiguration from './common/configurations/RetryConfiguration';
7
+ import ClientConfiguration from './common/configurations/ClientConfiguration';
8
+ import TokenConfiguration from './common/configurations/TokenConfiguration';
9
+ import { Product } from './translation/common/Product';
10
+ import { Regions } from './translation/common/Regions';
11
+ import { Format } from './translation/common/Format';
12
+ import HttpUtils from './common/utils/HttpUtils';
13
+ import Token from './auth/domain/Token';
14
+ import TranslateTextRequest from './translation/translate/request/TranslateTextRequest';
15
+ import CloudTranslateTextRequest from './translation/translate/request/cloud/CloudTranslateTextRequest';
16
+ import EdgeTranslateTextRequest from './translation/translate/request/edge/EdgeTranslateTextRequest';
17
+ import TranslateTextResult from './translation/translate/result/TranslateTextResult';
18
+ import CloudTranslationTextResult from './translation/translate/result/cloud/CloudTranslationTextResult';
19
+ import EdgeTranslationTextResult from './translation/translate/result/edge/EdgeTranslationTextResult';
20
+ import TranslateFileRequest from './translation/translate/request/TranslateFileRequest';
21
+ import CloudTranslateFileRequest from './translation/translate/request/cloud/CloudTranslateFileRequest';
22
+ import EdgeTranslateFileRequest from './translation/translate/request/edge/EdgeTranslateFileRequest';
23
+ import TranslationFileResult from './translation/translate/result/TranslationFileResult';
24
+ import CloudTranslationFileResult from './translation/translate/result/cloud/CloudTranslationFileResult';
25
+ import EdgeTranslationFileResult from './translation/translate/result/edge/EdgeTranslationFileResult';
26
+ import TranslateBatchFileRequest from './translation/translate/request/TranslateBatchFileRequest';
27
+ import CloudTranslateBatchFileRequest from './translation/translate/request/cloud/CloudTranslateBatchFileRequest';
28
+ import EdgeTranslateBatchFileRequest from './translation/translate/request/edge/EdgeTranslateBatchFileRequest';
29
+ import TranslationBatchFileResult from './translation/translate/result/TranslationBatchFileResult';
30
+ import CloudTranslationBatchFileResult from './translation/translate/result/cloud/CloudTranslationBatchFileResult';
31
+ import EdgeTranslationBatchFileResult from './translation/translate/result/edge/EdgeTranslationBatchFileResult';
32
+ import LanguagePairsResult from './translation/translate/result/LanguagePairsResult';
33
+ import LanguagePair from './translation/translate/response/LanguagePair';
34
+ import CloudLanguagePairsResult from './translation/translate/result/cloud/CloudLanguagePairsResult';
35
+ import EdgeLanguagePairsResult from './translation/translate/result/edge/EdgeLanguagePairsResult';
36
+ import CloudLanguagePair from './translation/translate/response/cloud/CloudLanguagePair';
37
+ import EdgeLanguagePair from './translation/translate/response/edge/EdgeLanguagePair';
38
+ import DictionariesResult from './translation/translate/result/DictionariesResult';
39
+ import DictionaryResponse from './translation/translate/response/DictionaryResponse';
40
+ import CloudDictionariesResult from './translation/translate/result/cloud/CloudDictionariesResult';
41
+ import CloudDictionaryResponse from './translation/translate/response/cloud/CloudDictionaryResponse';
42
+ import EdgeDictionariesResult from './translation/translate/result/edge/EdgeDictionariesResult';
43
+ import EdgeDictionaryResponse from './translation/translate/response/edge/EdgeDictionaryResponse';
44
+ export default SdkFactory;
45
+ export { CloudLanguageWeaverClient, EdgeLanguageWeaverClient, LanguageWeaverClient };
46
+ export { TokenConfiguration, CredentialsConfiguration, RetryConfiguration, ClientConfiguration };
47
+ export { Product, Regions, Format, HttpUtils };
48
+ export { Token };
49
+ export { TranslateTextRequest, CloudTranslateTextRequest, EdgeTranslateTextRequest, TranslateTextResult, CloudTranslationTextResult, EdgeTranslationTextResult, TranslateFileRequest, CloudTranslateFileRequest, EdgeTranslateFileRequest, TranslationFileResult, CloudTranslationFileResult, EdgeTranslationFileResult, TranslateBatchFileRequest, CloudTranslateBatchFileRequest, EdgeTranslateBatchFileRequest, TranslationBatchFileResult, CloudTranslationBatchFileResult, EdgeTranslationBatchFileResult, };
50
+ export { LanguagePair, LanguagePairsResult, CloudLanguagePair, CloudLanguagePairsResult, EdgeLanguagePair, EdgeLanguagePairsResult, };
51
+ export { DictionariesResult, DictionaryResponse, CloudDictionariesResult, CloudDictionaryResponse, EdgeDictionariesResult, EdgeDictionaryResponse, };
package/lib/index.js ADDED
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EdgeDictionaryResponse = exports.EdgeDictionariesResult = exports.CloudDictionaryResponse = exports.CloudDictionariesResult = exports.DictionaryResponse = exports.DictionariesResult = exports.EdgeLanguagePairsResult = exports.EdgeLanguagePair = exports.CloudLanguagePairsResult = exports.CloudLanguagePair = exports.LanguagePairsResult = exports.LanguagePair = exports.EdgeTranslationBatchFileResult = exports.CloudTranslationBatchFileResult = exports.TranslationBatchFileResult = exports.EdgeTranslateBatchFileRequest = exports.CloudTranslateBatchFileRequest = exports.TranslateBatchFileRequest = exports.EdgeTranslationFileResult = exports.CloudTranslationFileResult = exports.TranslationFileResult = exports.EdgeTranslateFileRequest = exports.CloudTranslateFileRequest = exports.TranslateFileRequest = exports.EdgeTranslationTextResult = exports.CloudTranslationTextResult = exports.TranslateTextResult = exports.EdgeTranslateTextRequest = exports.CloudTranslateTextRequest = exports.TranslateTextRequest = exports.Token = exports.HttpUtils = exports.Format = exports.Regions = exports.Product = exports.ClientConfiguration = exports.RetryConfiguration = exports.CredentialsConfiguration = exports.TokenConfiguration = exports.EdgeLanguageWeaverClient = exports.CloudLanguageWeaverClient = void 0;
7
+ /* Imports */
8
+ var SdkFactory_1 = __importDefault(require("./SdkFactory"));
9
+ var CloudLanguageWeaverClient_1 = __importDefault(require("./CloudLanguageWeaverClient"));
10
+ exports.CloudLanguageWeaverClient = CloudLanguageWeaverClient_1.default;
11
+ var EdgeLanguageWeaverClient_1 = __importDefault(require("./EdgeLanguageWeaverClient"));
12
+ exports.EdgeLanguageWeaverClient = EdgeLanguageWeaverClient_1.default;
13
+ // Configurations
14
+ var CredentialsConfiguration_1 = __importDefault(require("./common/configurations/CredentialsConfiguration"));
15
+ exports.CredentialsConfiguration = CredentialsConfiguration_1.default;
16
+ var RetryConfiguration_1 = __importDefault(require("./common/configurations/RetryConfiguration"));
17
+ exports.RetryConfiguration = RetryConfiguration_1.default;
18
+ var ClientConfiguration_1 = __importDefault(require("./common/configurations/ClientConfiguration"));
19
+ exports.ClientConfiguration = ClientConfiguration_1.default;
20
+ var TokenConfiguration_1 = __importDefault(require("./common/configurations/TokenConfiguration"));
21
+ exports.TokenConfiguration = TokenConfiguration_1.default;
22
+ // Common
23
+ var Product_1 = require("./translation/common/Product");
24
+ Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return Product_1.Product; } });
25
+ var Regions_1 = require("./translation/common/Regions");
26
+ Object.defineProperty(exports, "Regions", { enumerable: true, get: function () { return Regions_1.Regions; } });
27
+ var Format_1 = require("./translation/common/Format");
28
+ Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return Format_1.Format; } });
29
+ var HttpUtils_1 = __importDefault(require("./common/utils/HttpUtils"));
30
+ exports.HttpUtils = HttpUtils_1.default;
31
+ // Auth
32
+ var Token_1 = __importDefault(require("./auth/domain/Token"));
33
+ exports.Token = Token_1.default;
34
+ // Translation
35
+ var TranslateTextRequest_1 = __importDefault(require("./translation/translate/request/TranslateTextRequest"));
36
+ exports.TranslateTextRequest = TranslateTextRequest_1.default;
37
+ var CloudTranslateTextRequest_1 = __importDefault(require("./translation/translate/request/cloud/CloudTranslateTextRequest"));
38
+ exports.CloudTranslateTextRequest = CloudTranslateTextRequest_1.default;
39
+ var EdgeTranslateTextRequest_1 = __importDefault(require("./translation/translate/request/edge/EdgeTranslateTextRequest"));
40
+ exports.EdgeTranslateTextRequest = EdgeTranslateTextRequest_1.default;
41
+ var TranslateTextResult_1 = __importDefault(require("./translation/translate/result/TranslateTextResult"));
42
+ exports.TranslateTextResult = TranslateTextResult_1.default;
43
+ var CloudTranslationTextResult_1 = __importDefault(require("./translation/translate/result/cloud/CloudTranslationTextResult"));
44
+ exports.CloudTranslationTextResult = CloudTranslationTextResult_1.default;
45
+ var EdgeTranslationTextResult_1 = __importDefault(require("./translation/translate/result/edge/EdgeTranslationTextResult"));
46
+ exports.EdgeTranslationTextResult = EdgeTranslationTextResult_1.default;
47
+ var TranslateFileRequest_1 = __importDefault(require("./translation/translate/request/TranslateFileRequest"));
48
+ exports.TranslateFileRequest = TranslateFileRequest_1.default;
49
+ var CloudTranslateFileRequest_1 = __importDefault(require("./translation/translate/request/cloud/CloudTranslateFileRequest"));
50
+ exports.CloudTranslateFileRequest = CloudTranslateFileRequest_1.default;
51
+ var EdgeTranslateFileRequest_1 = __importDefault(require("./translation/translate/request/edge/EdgeTranslateFileRequest"));
52
+ exports.EdgeTranslateFileRequest = EdgeTranslateFileRequest_1.default;
53
+ var TranslationFileResult_1 = __importDefault(require("./translation/translate/result/TranslationFileResult"));
54
+ exports.TranslationFileResult = TranslationFileResult_1.default;
55
+ var CloudTranslationFileResult_1 = __importDefault(require("./translation/translate/result/cloud/CloudTranslationFileResult"));
56
+ exports.CloudTranslationFileResult = CloudTranslationFileResult_1.default;
57
+ var EdgeTranslationFileResult_1 = __importDefault(require("./translation/translate/result/edge/EdgeTranslationFileResult"));
58
+ exports.EdgeTranslationFileResult = EdgeTranslationFileResult_1.default;
59
+ var TranslateBatchFileRequest_1 = __importDefault(require("./translation/translate/request/TranslateBatchFileRequest"));
60
+ exports.TranslateBatchFileRequest = TranslateBatchFileRequest_1.default;
61
+ var CloudTranslateBatchFileRequest_1 = __importDefault(require("./translation/translate/request/cloud/CloudTranslateBatchFileRequest"));
62
+ exports.CloudTranslateBatchFileRequest = CloudTranslateBatchFileRequest_1.default;
63
+ var EdgeTranslateBatchFileRequest_1 = __importDefault(require("./translation/translate/request/edge/EdgeTranslateBatchFileRequest"));
64
+ exports.EdgeTranslateBatchFileRequest = EdgeTranslateBatchFileRequest_1.default;
65
+ var TranslationBatchFileResult_1 = __importDefault(require("./translation/translate/result/TranslationBatchFileResult"));
66
+ exports.TranslationBatchFileResult = TranslationBatchFileResult_1.default;
67
+ var CloudTranslationBatchFileResult_1 = __importDefault(require("./translation/translate/result/cloud/CloudTranslationBatchFileResult"));
68
+ exports.CloudTranslationBatchFileResult = CloudTranslationBatchFileResult_1.default;
69
+ var EdgeTranslationBatchFileResult_1 = __importDefault(require("./translation/translate/result/edge/EdgeTranslationBatchFileResult"));
70
+ exports.EdgeTranslationBatchFileResult = EdgeTranslationBatchFileResult_1.default;
71
+ // LPs
72
+ var LanguagePairsResult_1 = __importDefault(require("./translation/translate/result/LanguagePairsResult"));
73
+ exports.LanguagePairsResult = LanguagePairsResult_1.default;
74
+ var LanguagePair_1 = __importDefault(require("./translation/translate/response/LanguagePair"));
75
+ exports.LanguagePair = LanguagePair_1.default;
76
+ var CloudLanguagePairsResult_1 = __importDefault(require("./translation/translate/result/cloud/CloudLanguagePairsResult"));
77
+ exports.CloudLanguagePairsResult = CloudLanguagePairsResult_1.default;
78
+ var EdgeLanguagePairsResult_1 = __importDefault(require("./translation/translate/result/edge/EdgeLanguagePairsResult"));
79
+ exports.EdgeLanguagePairsResult = EdgeLanguagePairsResult_1.default;
80
+ var CloudLanguagePair_1 = __importDefault(require("./translation/translate/response/cloud/CloudLanguagePair"));
81
+ exports.CloudLanguagePair = CloudLanguagePair_1.default;
82
+ var EdgeLanguagePair_1 = __importDefault(require("./translation/translate/response/edge/EdgeLanguagePair"));
83
+ exports.EdgeLanguagePair = EdgeLanguagePair_1.default;
84
+ // Dictionaries
85
+ var DictionariesResult_1 = __importDefault(require("./translation/translate/result/DictionariesResult"));
86
+ exports.DictionariesResult = DictionariesResult_1.default;
87
+ var DictionaryResponse_1 = __importDefault(require("./translation/translate/response/DictionaryResponse"));
88
+ exports.DictionaryResponse = DictionaryResponse_1.default;
89
+ var CloudDictionariesResult_1 = __importDefault(require("./translation/translate/result/cloud/CloudDictionariesResult"));
90
+ exports.CloudDictionariesResult = CloudDictionariesResult_1.default;
91
+ var CloudDictionaryResponse_1 = __importDefault(require("./translation/translate/response/cloud/CloudDictionaryResponse"));
92
+ exports.CloudDictionaryResponse = CloudDictionaryResponse_1.default;
93
+ var EdgeDictionariesResult_1 = __importDefault(require("./translation/translate/result/edge/EdgeDictionariesResult"));
94
+ exports.EdgeDictionariesResult = EdgeDictionariesResult_1.default;
95
+ var EdgeDictionaryResponse_1 = __importDefault(require("./translation/translate/response/edge/EdgeDictionaryResponse"));
96
+ exports.EdgeDictionaryResponse = EdgeDictionaryResponse_1.default;
97
+ /* Exports */
98
+ exports.default = SdkFactory_1.default;
99
+ //# sourceMappingURL=index.js.map
@@ -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"ODT",
15
+ ODS = "ODS",
16
+ ODP = "ODP",
17
+ RTF = "RTF",
18
+ BCM = "BCM",
19
+ JSON = "JSON",
20
+ DOC = "DOC",
21
+ XLS = "XLS",
22
+ PPT = "PPT",
23
+ OOXML = "OOXML",
24
+ DOCX = "DOCX",
25
+ XLSX = "XLSX",
26
+ PPTX = "PPTX",
27
+ JPG = "JPG",
28
+ TIFF = "TIFF",
29
+ PNG = "PNG",
30
+ BMP = "BMP",
31
+ GIF = "GIF",
32
+ PLAIN = "PLAIN",
33
+ ETSPROTO = "ETSPROTO",
34
+ SDLXML = "SDLXML",
35
+ MSG = "MSG",
36
+ EML = "EML"
37
+ }
38
+ export declare const getFormatKeyByValue: (value: string) => string;
39
+ export declare const getFormatByKey: (key: string) => Format;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFormatByKey = exports.getFormatKeyByValue = exports.Format = void 0;
4
+ var Format;
5
+ (function (Format) {
6
+ Format["UNK"] = "UNK";
7
+ Format["NONE"] = "NONE";
8
+ Format["AUTO"] = "AUTO";
9
+ Format["XML"] = "XML";
10
+ Format["HTML"] = "HTML";
11
+ Format["UTF"] = "UTF";
12
+ Format["XLINE"] = "XLINE";
13
+ Format["SPT"] = "SPT";
14
+ Format["TMX"] = "TMX";
15
+ Format["XLIFF"] = "XLIFF";
16
+ Format["PDF"] = "PDF";
17
+ Format["ODF"] = "ODF";
18
+ Format["ODT"] = "ODT";
19
+ Format["ODS"] = "ODS";
20
+ Format["ODP"] = "ODP";
21
+ Format["RTF"] = "RTF";
22
+ Format["BCM"] = "BCM";
23
+ Format["JSON"] = "JSON";
24
+ Format["DOC"] = "DOC";
25
+ Format["XLS"] = "XLS";
26
+ Format["PPT"] = "PPT";
27
+ Format["OOXML"] = "OOXML";
28
+ Format["DOCX"] = "DOCX";
29
+ Format["XLSX"] = "XLSX";
30
+ Format["PPTX"] = "PPTX";
31
+ Format["JPG"] = "JPG";
32
+ Format["TIFF"] = "TIFF";
33
+ Format["PNG"] = "PNG";
34
+ Format["BMP"] = "BMP";
35
+ Format["GIF"] = "GIF";
36
+ Format["PLAIN"] = "PLAIN";
37
+ Format["ETSPROTO"] = "ETSPROTO";
38
+ Format["SDLXML"] = "SDLXML";
39
+ Format["MSG"] = "MSG";
40
+ Format["EML"] = "EML";
41
+ })(Format = exports.Format || (exports.Format = {}));
42
+ var getFormatKeyByValue = function (value) {
43
+ var index = Object.values(Format).indexOf(value);
44
+ var key = Object.keys(Format)[index];
45
+ return key;
46
+ };
47
+ exports.getFormatKeyByValue = getFormatKeyByValue;
48
+ var getFormatByKey = function (key) {
49
+ return Format[key] || Format.UNK;
50
+ };
51
+ exports.getFormatByKey = getFormatByKey;
52
+ //# sourceMappingURL=Format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Format.js","sourceRoot":"","sources":["../../../src/translation/common/Format.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAoCX;AApCD,WAAY,MAAM;IACd,qBAAW,CAAA;IACX,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,yBAAe,CAAA;IACf,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,yBAAe,CAAA;IACf,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,yBAAe,CAAA;IACf,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,qBAAW,CAAA;IACX,qBAAW,CAAA;AACf,CAAC,EApCW,MAAM,GAAN,cAAM,KAAN,cAAM,QAoCjB;AAEM,IAAM,mBAAmB,GAAG,UAAC,KAAa;IAC7C,IAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAe,CAAC,CAAC;IAC7D,IAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;IAEvC,OAAO,GAAG,CAAC;AACf,CAAC,CAAC;AALW,QAAA,mBAAmB,uBAK9B;AAEK,IAAM,cAAc,GAAG,UAAC,GAAW;IACtC,OAAO,MAAM,CAAC,GAA0B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC;AAC5D,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB"}
@@ -0,0 +1,4 @@
1
+ export declare enum Product {
2
+ CLOUD = "CLOUD",
3
+ EDGE = "EDGE"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Product = void 0;
4
+ var Product;
5
+ (function (Product) {
6
+ Product["CLOUD"] = "CLOUD";
7
+ Product["EDGE"] = "EDGE";
8
+ })(Product = exports.Product || (exports.Product = {}));
9
+ //# sourceMappingURL=Product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Product.js","sourceRoot":"","sources":["../../../src/translation/common/Product.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,0BAAe,CAAA;IACf,wBAAa,CAAA;AACjB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB"}
@@ -0,0 +1,4 @@
1
+ export declare enum Regions {
2
+ US = "US",
3
+ EUROPE = "EUROPE"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Regions = void 0;
4
+ var Regions;
5
+ (function (Regions) {
6
+ Regions["US"] = "US";
7
+ Regions["EUROPE"] = "EUROPE";
8
+ })(Regions = exports.Regions || (exports.Regions = {}));
9
+ //# sourceMappingURL=Regions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Regions.js","sourceRoot":"","sources":["../../../src/translation/common/Regions.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,oBAAS,CAAA;IACT,4BAAiB,CAAA;AACrB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB"}
@@ -0,0 +1,6 @@
1
+ export declare const UNK_TRANSLATION_STATUS = "UNK";
2
+ export declare const INIT_TRANSLATION_STATUS = "INIT";
3
+ export declare const TRANSLATING_TRANSLATION_STATUS = "TRANSLATING";
4
+ export declare const CANCELLED_TRANSLATION_STATUS = "CANCELLED";
5
+ export declare const DONE_TRANSLATION_STATUS = "DONE";
6
+ export declare const FAILED_TRANSLATION_STATUS = "FAILED";