@azure/ai-language-text 1.1.0-alpha.20241204.2 → 1.1.0-alpha.20241205.3

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 (309) hide show
  1. package/dist/browser/azureKeyCredentialPolicy.d.ts +9 -0
  2. package/dist/browser/azureKeyCredentialPolicy.d.ts.map +1 -0
  3. package/dist/browser/constants.d.ts +14 -0
  4. package/dist/browser/constants.d.ts.map +1 -0
  5. package/dist/browser/generated/generatedClient.d.ts +33 -0
  6. package/dist/browser/generated/generatedClient.d.ts.map +1 -0
  7. package/{dist-esm/src → dist/browser}/generated/generatedClient.js +3 -3
  8. package/dist/browser/generated/generatedClient.js.map +1 -0
  9. package/dist/browser/generated/index.d.ts +4 -0
  10. package/dist/browser/generated/index.d.ts.map +1 -0
  11. package/dist/browser/generated/index.js +11 -0
  12. package/dist/browser/generated/index.js.map +1 -0
  13. package/dist/browser/generated/models/index.d.ts +2034 -0
  14. package/dist/browser/generated/models/index.d.ts.map +1 -0
  15. package/dist/browser/generated/models/mappers.d.ts +171 -0
  16. package/dist/browser/generated/models/mappers.d.ts.map +1 -0
  17. package/dist/browser/generated/models/parameters.d.ts +12 -0
  18. package/dist/browser/generated/models/parameters.d.ts.map +1 -0
  19. package/{dist-esm/src → dist/browser}/generated/models/parameters.js +1 -1
  20. package/{dist-esm/src → dist/browser}/generated/models/parameters.js.map +1 -1
  21. package/dist/browser/generated/operations/analyzeText.d.ts +27 -0
  22. package/dist/browser/generated/operations/analyzeText.d.ts.map +1 -0
  23. package/{dist-esm/src → dist/browser}/generated/operations/analyzeText.js +2 -2
  24. package/dist/browser/generated/operations/analyzeText.js.map +1 -0
  25. package/dist/browser/generated/operations/index.d.ts +2 -0
  26. package/dist/browser/generated/operations/index.d.ts.map +1 -0
  27. package/{dist-esm/src/generated → dist/browser/generated/operations}/index.js +1 -3
  28. package/dist/browser/generated/operations/index.js.map +1 -0
  29. package/dist/browser/generated/operationsInterfaces/analyzeText.d.ts +19 -0
  30. package/dist/browser/generated/operationsInterfaces/analyzeText.d.ts.map +1 -0
  31. package/dist/browser/generated/operationsInterfaces/analyzeText.js.map +1 -0
  32. package/dist/browser/generated/operationsInterfaces/index.d.ts +2 -0
  33. package/dist/browser/generated/operationsInterfaces/index.d.ts.map +1 -0
  34. package/dist/browser/generated/operationsInterfaces/index.js +9 -0
  35. package/dist/browser/generated/operationsInterfaces/index.js.map +1 -0
  36. package/dist/browser/index.d.ts +16 -0
  37. package/dist/browser/index.d.ts.map +1 -0
  38. package/{dist-esm/src → dist/browser}/index.js +3 -3
  39. package/dist/browser/index.js.map +1 -0
  40. package/dist/browser/logger.d.ts +6 -0
  41. package/dist/browser/logger.d.ts.map +1 -0
  42. package/dist/browser/lro.d.ts +60 -0
  43. package/dist/browser/lro.d.ts.map +1 -0
  44. package/{dist-esm/src → dist/browser}/lro.js +5 -5
  45. package/dist/browser/lro.js.map +1 -0
  46. package/dist/browser/models.d.ts +881 -0
  47. package/dist/browser/models.d.ts.map +1 -0
  48. package/{dist-esm/src → dist/browser}/models.js +1 -1
  49. package/dist/browser/models.js.map +1 -0
  50. package/dist/browser/package.json +3 -0
  51. package/dist/browser/textAnalysisClient.d.ts +487 -0
  52. package/dist/browser/textAnalysisClient.d.ts.map +1 -0
  53. package/{dist-esm/src → dist/browser}/textAnalysisClient.js +7 -7
  54. package/dist/browser/textAnalysisClient.js.map +1 -0
  55. package/dist/browser/transforms.d.ts +12 -0
  56. package/dist/browser/transforms.d.ts.map +1 -0
  57. package/{dist-esm/src → dist/browser}/transforms.js +1 -1
  58. package/dist/browser/transforms.js.map +1 -0
  59. package/dist/browser/util.d.ts +57 -0
  60. package/dist/browser/util.d.ts.map +1 -0
  61. package/{dist-esm/src → dist/browser}/util.js +1 -1
  62. package/dist/browser/util.js.map +1 -0
  63. package/dist/commonjs/azureKeyCredentialPolicy.d.ts +9 -0
  64. package/dist/commonjs/azureKeyCredentialPolicy.d.ts.map +1 -0
  65. package/dist/commonjs/azureKeyCredentialPolicy.js +25 -0
  66. package/dist/commonjs/azureKeyCredentialPolicy.js.map +1 -0
  67. package/dist/commonjs/constants.d.ts +14 -0
  68. package/dist/commonjs/constants.d.ts.map +1 -0
  69. package/dist/commonjs/constants.js +19 -0
  70. package/dist/commonjs/constants.js.map +1 -0
  71. package/dist/commonjs/generated/generatedClient.d.ts +33 -0
  72. package/dist/commonjs/generated/generatedClient.d.ts.map +1 -0
  73. package/dist/commonjs/generated/generatedClient.js +134 -0
  74. package/dist/commonjs/generated/generatedClient.js.map +1 -0
  75. package/dist/commonjs/generated/index.d.ts +4 -0
  76. package/dist/commonjs/generated/index.d.ts.map +1 -0
  77. package/dist/commonjs/generated/index.js +16 -0
  78. package/dist/commonjs/generated/index.js.map +1 -0
  79. package/dist/commonjs/generated/models/index.d.ts +2034 -0
  80. package/dist/commonjs/generated/models/index.d.ts.map +1 -0
  81. package/dist/commonjs/generated/models/index.js +735 -0
  82. package/dist/commonjs/generated/models/index.js.map +1 -0
  83. package/dist/commonjs/generated/models/mappers.d.ts +171 -0
  84. package/dist/commonjs/generated/models/mappers.d.ts.map +1 -0
  85. package/dist/commonjs/generated/models/mappers.js +2848 -0
  86. package/dist/commonjs/generated/models/mappers.js.map +1 -0
  87. package/dist/commonjs/generated/models/parameters.d.ts +12 -0
  88. package/dist/commonjs/generated/models/parameters.d.ts.map +1 -0
  89. package/dist/commonjs/generated/models/parameters.js +101 -0
  90. package/dist/commonjs/generated/models/parameters.js.map +1 -0
  91. package/dist/commonjs/generated/operations/analyzeText.d.ts +27 -0
  92. package/dist/commonjs/generated/operations/analyzeText.d.ts.map +1 -0
  93. package/dist/commonjs/generated/operations/analyzeText.js +83 -0
  94. package/dist/commonjs/generated/operations/analyzeText.js.map +1 -0
  95. package/dist/commonjs/generated/operations/index.d.ts +2 -0
  96. package/dist/commonjs/generated/operations/index.d.ts.map +1 -0
  97. package/dist/commonjs/generated/operations/index.js +12 -0
  98. package/dist/commonjs/generated/operations/index.js.map +1 -0
  99. package/dist/commonjs/generated/operationsInterfaces/analyzeText.d.ts +19 -0
  100. package/dist/commonjs/generated/operationsInterfaces/analyzeText.d.ts.map +1 -0
  101. package/dist/commonjs/generated/operationsInterfaces/analyzeText.js +10 -0
  102. package/dist/commonjs/generated/operationsInterfaces/analyzeText.js.map +1 -0
  103. package/dist/commonjs/generated/operationsInterfaces/index.d.ts +2 -0
  104. package/dist/commonjs/generated/operationsInterfaces/index.d.ts.map +1 -0
  105. package/dist/commonjs/generated/operationsInterfaces/index.js +12 -0
  106. package/dist/commonjs/generated/operationsInterfaces/index.js.map +1 -0
  107. package/dist/commonjs/index.d.ts +16 -0
  108. package/dist/commonjs/index.d.ts.map +1 -0
  109. package/dist/commonjs/index.js +31 -0
  110. package/dist/commonjs/index.js.map +1 -0
  111. package/dist/commonjs/logger.d.ts +6 -0
  112. package/dist/commonjs/logger.d.ts.map +1 -0
  113. package/dist/commonjs/logger.js +12 -0
  114. package/dist/commonjs/logger.js.map +1 -0
  115. package/dist/commonjs/lro.d.ts +60 -0
  116. package/dist/commonjs/lro.d.ts.map +1 -0
  117. package/dist/commonjs/lro.js +200 -0
  118. package/dist/commonjs/lro.js.map +1 -0
  119. package/dist/commonjs/models.d.ts +881 -0
  120. package/dist/commonjs/models.d.ts.map +1 -0
  121. package/dist/commonjs/models.js +38 -0
  122. package/dist/commonjs/models.js.map +1 -0
  123. package/dist/commonjs/package.json +3 -0
  124. package/dist/commonjs/textAnalysisClient.d.ts +487 -0
  125. package/dist/commonjs/textAnalysisClient.d.ts.map +1 -0
  126. package/dist/commonjs/textAnalysisClient.js +211 -0
  127. package/dist/commonjs/textAnalysisClient.js.map +1 -0
  128. package/dist/commonjs/transforms.d.ts +12 -0
  129. package/dist/commonjs/transforms.d.ts.map +1 -0
  130. package/dist/commonjs/transforms.js +388 -0
  131. package/dist/commonjs/transforms.js.map +1 -0
  132. package/dist/commonjs/tsdoc-metadata.json +11 -0
  133. package/dist/commonjs/util.d.ts +57 -0
  134. package/dist/commonjs/util.d.ts.map +1 -0
  135. package/dist/commonjs/util.js +141 -0
  136. package/dist/commonjs/util.js.map +1 -0
  137. package/dist/esm/azureKeyCredentialPolicy.d.ts +9 -0
  138. package/dist/esm/azureKeyCredentialPolicy.d.ts.map +1 -0
  139. package/dist/esm/azureKeyCredentialPolicy.js +22 -0
  140. package/dist/esm/azureKeyCredentialPolicy.js.map +1 -0
  141. package/dist/esm/constants.d.ts +14 -0
  142. package/dist/esm/constants.d.ts.map +1 -0
  143. package/dist/esm/constants.js +16 -0
  144. package/dist/esm/constants.js.map +1 -0
  145. package/dist/esm/generated/generatedClient.d.ts +33 -0
  146. package/dist/esm/generated/generatedClient.d.ts.map +1 -0
  147. package/dist/esm/generated/generatedClient.js +129 -0
  148. package/dist/esm/generated/generatedClient.js.map +1 -0
  149. package/dist/esm/generated/index.d.ts +4 -0
  150. package/dist/esm/generated/index.d.ts.map +1 -0
  151. package/dist/esm/generated/index.js +11 -0
  152. package/dist/esm/generated/index.js.map +1 -0
  153. package/dist/esm/generated/models/index.d.ts +2034 -0
  154. package/dist/esm/generated/models/index.d.ts.map +1 -0
  155. package/dist/esm/generated/models/index.js +732 -0
  156. package/dist/esm/generated/models/index.js.map +1 -0
  157. package/dist/esm/generated/models/mappers.d.ts +171 -0
  158. package/dist/esm/generated/models/mappers.d.ts.map +1 -0
  159. package/dist/esm/generated/models/mappers.js +2843 -0
  160. package/dist/esm/generated/models/mappers.js.map +1 -0
  161. package/dist/esm/generated/models/parameters.d.ts +12 -0
  162. package/dist/esm/generated/models/parameters.d.ts.map +1 -0
  163. package/dist/esm/generated/models/parameters.js +98 -0
  164. package/dist/esm/generated/models/parameters.js.map +1 -0
  165. package/dist/esm/generated/operations/analyzeText.d.ts +27 -0
  166. package/dist/esm/generated/operations/analyzeText.d.ts.map +1 -0
  167. package/dist/esm/generated/operations/analyzeText.js +78 -0
  168. package/dist/esm/generated/operations/analyzeText.js.map +1 -0
  169. package/dist/esm/generated/operations/index.d.ts +2 -0
  170. package/dist/esm/generated/operations/index.d.ts.map +1 -0
  171. package/dist/esm/generated/operations/index.js +9 -0
  172. package/dist/esm/generated/operations/index.js.map +1 -0
  173. package/dist/esm/generated/operationsInterfaces/analyzeText.d.ts +19 -0
  174. package/dist/esm/generated/operationsInterfaces/analyzeText.d.ts.map +1 -0
  175. package/{dist-esm/src/generated/operationsInterfaces/index.js → dist/esm/generated/operationsInterfaces/analyzeText.js} +2 -2
  176. package/dist/esm/generated/operationsInterfaces/analyzeText.js.map +1 -0
  177. package/dist/esm/generated/operationsInterfaces/index.d.ts +2 -0
  178. package/dist/esm/generated/operationsInterfaces/index.d.ts.map +1 -0
  179. package/dist/esm/generated/operationsInterfaces/index.js +9 -0
  180. package/dist/esm/generated/operationsInterfaces/index.js.map +1 -0
  181. package/dist/esm/index.d.ts +16 -0
  182. package/dist/esm/index.d.ts.map +1 -0
  183. package/dist/esm/index.js +18 -0
  184. package/dist/esm/index.js.map +1 -0
  185. package/dist/esm/logger.d.ts +6 -0
  186. package/dist/esm/logger.d.ts.map +1 -0
  187. package/dist/esm/logger.js +9 -0
  188. package/dist/esm/logger.js.map +1 -0
  189. package/dist/esm/lro.d.ts +60 -0
  190. package/dist/esm/lro.d.ts.map +1 -0
  191. package/dist/esm/lro.js +191 -0
  192. package/dist/esm/lro.js.map +1 -0
  193. package/dist/esm/models.d.ts +881 -0
  194. package/dist/esm/models.d.ts.map +1 -0
  195. package/dist/esm/models.js +35 -0
  196. package/dist/esm/models.js.map +1 -0
  197. package/dist/esm/package.json +3 -0
  198. package/dist/esm/textAnalysisClient.d.ts +487 -0
  199. package/dist/esm/textAnalysisClient.d.ts.map +1 -0
  200. package/dist/esm/textAnalysisClient.js +207 -0
  201. package/dist/esm/textAnalysisClient.js.map +1 -0
  202. package/dist/esm/transforms.d.ts +12 -0
  203. package/dist/esm/transforms.d.ts.map +1 -0
  204. package/dist/esm/transforms.js +383 -0
  205. package/dist/esm/transforms.js.map +1 -0
  206. package/dist/esm/util.d.ts +57 -0
  207. package/dist/esm/util.d.ts.map +1 -0
  208. package/dist/esm/util.js +131 -0
  209. package/dist/esm/util.js.map +1 -0
  210. package/dist/react-native/azureKeyCredentialPolicy.d.ts +9 -0
  211. package/dist/react-native/azureKeyCredentialPolicy.d.ts.map +1 -0
  212. package/dist/react-native/azureKeyCredentialPolicy.js +22 -0
  213. package/dist/react-native/azureKeyCredentialPolicy.js.map +1 -0
  214. package/dist/react-native/constants.d.ts +14 -0
  215. package/dist/react-native/constants.d.ts.map +1 -0
  216. package/dist/react-native/constants.js +16 -0
  217. package/dist/react-native/constants.js.map +1 -0
  218. package/dist/react-native/generated/generatedClient.d.ts +33 -0
  219. package/dist/react-native/generated/generatedClient.d.ts.map +1 -0
  220. package/dist/react-native/generated/generatedClient.js +129 -0
  221. package/dist/react-native/generated/generatedClient.js.map +1 -0
  222. package/dist/react-native/generated/index.d.ts +4 -0
  223. package/dist/react-native/generated/index.d.ts.map +1 -0
  224. package/dist/react-native/generated/index.js +11 -0
  225. package/dist/react-native/generated/index.js.map +1 -0
  226. package/dist/react-native/generated/models/index.d.ts +2034 -0
  227. package/dist/react-native/generated/models/index.d.ts.map +1 -0
  228. package/dist/react-native/generated/models/index.js +732 -0
  229. package/dist/react-native/generated/models/index.js.map +1 -0
  230. package/dist/react-native/generated/models/mappers.d.ts +171 -0
  231. package/dist/react-native/generated/models/mappers.d.ts.map +1 -0
  232. package/dist/react-native/generated/models/mappers.js +2843 -0
  233. package/dist/react-native/generated/models/mappers.js.map +1 -0
  234. package/dist/react-native/generated/models/parameters.d.ts +12 -0
  235. package/dist/react-native/generated/models/parameters.d.ts.map +1 -0
  236. package/dist/react-native/generated/models/parameters.js +98 -0
  237. package/dist/react-native/generated/models/parameters.js.map +1 -0
  238. package/dist/react-native/generated/operations/analyzeText.d.ts +27 -0
  239. package/dist/react-native/generated/operations/analyzeText.d.ts.map +1 -0
  240. package/dist/react-native/generated/operations/analyzeText.js +78 -0
  241. package/dist/react-native/generated/operations/analyzeText.js.map +1 -0
  242. package/dist/react-native/generated/operations/index.d.ts +2 -0
  243. package/dist/react-native/generated/operations/index.d.ts.map +1 -0
  244. package/dist/react-native/generated/operations/index.js +9 -0
  245. package/dist/react-native/generated/operations/index.js.map +1 -0
  246. package/dist/react-native/generated/operationsInterfaces/analyzeText.d.ts +19 -0
  247. package/dist/react-native/generated/operationsInterfaces/analyzeText.d.ts.map +1 -0
  248. package/{dist-esm/src/generated/operations/index.js → dist/react-native/generated/operationsInterfaces/analyzeText.js} +2 -2
  249. package/dist/react-native/generated/operationsInterfaces/analyzeText.js.map +1 -0
  250. package/dist/react-native/generated/operationsInterfaces/index.d.ts +2 -0
  251. package/dist/react-native/generated/operationsInterfaces/index.d.ts.map +1 -0
  252. package/dist/react-native/generated/operationsInterfaces/index.js +9 -0
  253. package/dist/react-native/generated/operationsInterfaces/index.js.map +1 -0
  254. package/dist/react-native/index.d.ts +16 -0
  255. package/dist/react-native/index.d.ts.map +1 -0
  256. package/dist/react-native/index.js +18 -0
  257. package/dist/react-native/index.js.map +1 -0
  258. package/dist/react-native/logger.d.ts +6 -0
  259. package/dist/react-native/logger.d.ts.map +1 -0
  260. package/dist/react-native/logger.js +9 -0
  261. package/dist/react-native/logger.js.map +1 -0
  262. package/dist/react-native/lro.d.ts +60 -0
  263. package/dist/react-native/lro.d.ts.map +1 -0
  264. package/dist/react-native/lro.js +191 -0
  265. package/dist/react-native/lro.js.map +1 -0
  266. package/dist/react-native/models.d.ts +881 -0
  267. package/dist/react-native/models.d.ts.map +1 -0
  268. package/dist/react-native/models.js +35 -0
  269. package/dist/react-native/models.js.map +1 -0
  270. package/dist/react-native/package.json +3 -0
  271. package/dist/react-native/textAnalysisClient.d.ts +487 -0
  272. package/dist/react-native/textAnalysisClient.d.ts.map +1 -0
  273. package/dist/react-native/textAnalysisClient.js +207 -0
  274. package/dist/react-native/textAnalysisClient.js.map +1 -0
  275. package/dist/react-native/transforms.d.ts +12 -0
  276. package/dist/react-native/transforms.d.ts.map +1 -0
  277. package/dist/react-native/transforms.js +383 -0
  278. package/dist/react-native/transforms.js.map +1 -0
  279. package/dist/react-native/util.d.ts +57 -0
  280. package/dist/react-native/util.d.ts.map +1 -0
  281. package/dist/react-native/util.js +131 -0
  282. package/dist/react-native/util.js.map +1 -0
  283. package/package.json +71 -50
  284. package/dist/index.js +0 -5015
  285. package/dist/index.js.map +0 -1
  286. package/dist-esm/src/generated/generatedClient.js.map +0 -1
  287. package/dist-esm/src/generated/index.js.map +0 -1
  288. package/dist-esm/src/generated/operations/analyzeText.js.map +0 -1
  289. package/dist-esm/src/generated/operations/index.js.map +0 -1
  290. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js.map +0 -1
  291. package/dist-esm/src/generated/operationsInterfaces/index.js.map +0 -1
  292. package/dist-esm/src/index.js.map +0 -1
  293. package/dist-esm/src/lro.js.map +0 -1
  294. package/dist-esm/src/models.js.map +0 -1
  295. package/dist-esm/src/textAnalysisClient.js.map +0 -1
  296. package/dist-esm/src/transforms.js.map +0 -1
  297. package/dist-esm/src/util.js.map +0 -1
  298. package/types/ai-language-text.d.ts +0 -2716
  299. /package/{dist-esm/src → dist/browser}/azureKeyCredentialPolicy.js +0 -0
  300. /package/{dist-esm/src → dist/browser}/azureKeyCredentialPolicy.js.map +0 -0
  301. /package/{dist-esm/src → dist/browser}/constants.js +0 -0
  302. /package/{dist-esm/src → dist/browser}/constants.js.map +0 -0
  303. /package/{dist-esm/src → dist/browser}/generated/models/index.js +0 -0
  304. /package/{dist-esm/src → dist/browser}/generated/models/index.js.map +0 -0
  305. /package/{dist-esm/src → dist/browser}/generated/models/mappers.js +0 -0
  306. /package/{dist-esm/src → dist/browser}/generated/models/mappers.js.map +0 -0
  307. /package/{dist-esm/src → dist/browser}/generated/operationsInterfaces/analyzeText.js +0 -0
  308. /package/{dist-esm/src → dist/browser}/logger.js +0 -0
  309. /package/{dist-esm/src → dist/browser}/logger.js.map +0 -0
@@ -0,0 +1 @@
1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;gBACtB,MAAM;gBACN,SAAS,kCAAO,IAAI,KAAE,iBAAiB,GAAE;gBACzC,KAAK;aACN,CAAC;YACF,WAAW,EAAE,wBAAwB,EAAE;YACvC,qBAAqB,CAAC,iBAAyB;gBAC7C,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;YAC9C,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,MAAM,EAAE,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC;QACzC,OAAO,4BAA4B,CAAC;YAClC,EAAE;YACF,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,OAAO;YACP,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AnalyzeActionName,\n AnalyzeActionParameters,\n AnalyzeBatchAction,\n AnalyzeBatchPoller,\n AnalyzeResult,\n BeginAnalyzeBatchOptions,\n RestoreAnalyzeBatchPollerOptions,\n TextAnalysisClientOptions,\n TextAnalysisOperationOptions,\n} from \"./models.js\";\nimport type {\n AnalyzeBatchActionUnion,\n GeneratedClientOptionalParams,\n LanguageDetectionInput,\n TextDocumentInput,\n} from \"./generated/models/index.js\";\nimport { DEFAULT_COGNITIVE_SCOPE, SDK_VERSION } from \"./constants.js\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { TracingClient } from \"@azure/core-tracing\";\nimport { createTracingClient } from \"@azure/core-tracing\";\nimport {\n convertToLanguageDetectionInput,\n convertToTextDocumentInput,\n getOperationOptions,\n isStringArray,\n} from \"./util.js\";\nimport {\n createAnalyzeBatchLro,\n createCreateAnalyzeBatchPollerLro,\n createPollerWithCancellation,\n createUpdateAnalyzeState,\n getDocIDsFromState,\n processAnalyzeResult,\n} from \"./lro.js\";\nimport { throwError, transformActionResult } from \"./transforms.js\";\nimport { GeneratedClient } from \"./generated/generatedClient.js\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { createHttpPoller } from \"@azure/core-lro\";\nimport { logger } from \"./logger.js\";\nimport { textAnalyticsAzureKeyCredentialPolicy } from \"./azureKeyCredentialPolicy.js\";\n\n/**\n * A client for interacting with the text analysis features in Azure Cognitive\n * Language Service.\n *\n * The client needs the endpoint of a Language resource and an authentication\n * method such as an API key or AAD. The API key and endpoint can be found in\n * the Language resource page in the Azure portal. They will be located in the\n * resource's Keys and Endpoint page, under Resource Management.\n *\n * ### Examples for authentication:\n *\n * #### API Key\n *\n * ```js\n * import { TextAnalysisClient, AzureKeyCredential } from \"@azure/ai-language-text\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new AzureKeyCredential(\"<api key>\");\n *\n * const client = new TextAnalysisClient(endpoint, credential);\n * ```\n *\n * #### Azure Active Directory\n *\n * See the [`@azure/identity`](https://npmjs.com/package/\\@azure/identity)\n * package for more information about authenticating with Azure Active Directory.\n *\n * ```js\n * import { TextAnalysisClient } from \"@azure/ai-language-text\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new DefaultAzureCredential();\n *\n * const client = new TextAnalysisClient(endpoint, credential);\n * ```\n */\nexport class TextAnalysisClient {\n private readonly _client: GeneratedClient;\n private readonly _tracing: TracingClient;\n private readonly defaultCountryHint: string;\n private readonly defaultLanguage: string;\n\n /**\n * Creates an instance of TextAnalysisClient with the endpoint of a Language\n * resource and an authentication method such as an API key or AAD.\n *\n * The API key and endpoint can be found in the Language resource page in the\n * Azure portal. They will be located in the resource's Keys and Endpoint page,\n * under Resource Management.\n *\n * ### Example\n *\n * ```js\n * import { TextAnalysisClient, AzureKeyCredential } from \"@azure/ai-language-text\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new AzureKeyCredential(\"<api key>\");\n *\n * const client = new TextAnalysisClient(endpoint, credential);\n * ```\n *\n * @param endpointUrl - The URL to the endpoint of a Cognitive Language Service resource\n * @param credential - Key credential to be used to authenticate requests to the service.\n * @param options - Used to configure the TextAnalytics client.\n */\n constructor(endpointUrl: string, credential: KeyCredential, options?: TextAnalysisClientOptions);\n /**\n * Creates an instance of TextAnalysisClient with the endpoint of a Language\n * resource and an authentication method such as an API key or AAD.\n *\n * The API key and endpoint can be found in the Language resource page in the\n * Azure portal. They will be located in the resource's Keys and Endpoint page,\n * under Resource Management.\n *\n * ### Example\n *\n * See the [`@azure/identity`](https://npmjs.com/package/\\@azure/identity)\n * package for more information about authenticating with Azure Active Directory.\n *\n * ```js\n * import { TextAnalysisClient } from \"@azure/ai-language-text\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new DefaultAzureCredential();\n *\n * const client = new TextAnalysisClient(endpoint, credential);\n * ```\n *\n * @param endpointUrl - The URL to the endpoint of a Cognitive Language Service resource\n * @param credential - Token credential to be used to authenticate requests to the service.\n * @param options - Used to configure the TextAnalytics client.\n */\n constructor(\n endpointUrl: string,\n credential: TokenCredential,\n options?: TextAnalysisClientOptions,\n );\n constructor(\n endpointUrl: string,\n credential: TokenCredential | KeyCredential,\n options: TextAnalysisClientOptions = {},\n ) {\n const {\n defaultCountryHint = \"us\",\n defaultLanguage = \"en\",\n serviceVersion,\n ...pipelineOptions\n } = options;\n this.defaultCountryHint = defaultCountryHint;\n this.defaultLanguage = defaultLanguage;\n\n const internalPipelineOptions: GeneratedClientOptionalParams = {\n ...pipelineOptions,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\"x-ms-correlation-request-id\", \"x-ms-request-id\"],\n },\n },\n apiVersion: serviceVersion,\n };\n\n this._client = new GeneratedClient(endpointUrl, internalPipelineOptions);\n\n const authPolicy = isTokenCredential(credential)\n ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })\n : textAnalyticsAzureKeyCredentialPolicy(credential);\n\n this._client.pipeline.addPolicy(authPolicy);\n this._tracing = createTracingClient({\n packageName: \"@azure/ai-language-text\",\n packageVersion: SDK_VERSION,\n namespace: \"Microsoft.CognitiveServices\",\n });\n }\n\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input strings are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}\n * for data limits.\n *\n * ### Examples\n *\n * #### Language detection\n *\n * ```js\n * const documents = [<input strings>];\n * const countryHint = \"us\";\n * const results = await client.analyze(\"LanguageDetection\", documents, countryHint);\n *\n * for (let i = 0; i < results.length; i++) {\n * const result = results[i];\n * if (result.error) {\n * // a document has an error instead of results\n * } else {\n * const { name, confidenceScore, iso6391Name } = result.primaryLanguage;\n * }\n * }\n * ```\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/language-detection/overview}\n * for more information on language detection.\n *\n * @param actionName - the name of the action to be performed on the input\n * documents, see ${@link AnalyzeActionName}\n * @param documents - the input documents to be analyzed\n * @param options - optional action parameters and settings for the operation\n *\n * @returns an array of results where each element contains the primary language\n * for the corresponding input document.\n */\n public async analyze<ActionName extends \"LanguageDetection\">(\n actionName: ActionName,\n documents: LanguageDetectionInput[],\n options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions,\n ): Promise<AnalyzeResult<ActionName>>;\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input strings are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}\n * for data limits.\n *\n * ### Examples\n *\n * #### Language detection\n *\n * ```js\n * const documents = [<input strings>];\n * const countryHint = \"us\";\n * const results = await client.analyze(\"LanguageDetection\", documents, countryHint);\n *\n * for (const result of results) {\n * if (result.error) {\n * // a document has an error instead of results\n * } else {\n * const { name, confidenceScore, iso6391Name } = result.primaryLanguage;\n * }\n * }\n * ```\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/language-detection/overview}\n * for more information on language detection.\n *\n * @param actionName - the name of the action to be performed on the input\n * documents, see ${@link AnalyzeActionName}\n * @param documents - the input documents to be analyzed\n * @param countryHint - Indicates the country of origin for all of\n * the input strings to assist the model in predicting the language they are\n * written in. If unspecified, this value will be set to the default\n * country hint in `TextAnalysisClientOptions`. If set to an empty string,\n * or the string \"none\", the service will apply a model where the country is\n * explicitly unset. The same country hint is applied to all strings in the\n * input collection.\n * @param options - optional action parameters and settings for the operation\n *\n * @returns an array of results where each element contains the primary language\n * for the corresponding input document.\n */\n public async analyze<ActionName extends \"LanguageDetection\">(\n actionName: ActionName,\n documents: string[],\n countryHint?: string,\n options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions,\n ): Promise<AnalyzeResult<ActionName>>;\n /**\n * Runs a predictive model to perform the action of choice on the input\n * documents. See ${@link AnalyzeActionName} for a list of supported\n * actions.\n *\n * The layout of each item in the results array depends on the action chosen.\n * For example, each PIIEntityRecognition document result consists of both\n * `entities` and `redactedText` where the former is a list of all Pii entities\n * in the text and the latter is the original text after all such Pii entities\n * have been redacted from it.\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}\n * for data limits.\n *\n * ### Examples\n *\n * #### Opinion mining\n *\n * ```js\n * const documents = [{\n * id: \"1\",\n * text: \"The food and service aren't the best\",\n * language: \"en\"\n * }];\n * const results = await client.analyze(\"SentimentAnalysis\", documents, {\n * includeOpinionMining: true,\n * });\n *\n * for (const result of results) {\n * if (result.error) {\n * // a document has an error instead of results\n * } else {\n * const { sentiment, confidenceScores, sentences } = result;\n * for (const { sentiment, confidenceScores, opinions } of sentences) {\n * for (const { target, assessments } of opinions) {\n * const { text, sentiment, confidenceScores } = target;\n * for (const { text, sentiment } of assessments) {\n * // Do something\n * }\n * }\n * }\n * }\n * }\n * ```\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/sentiment-opinion-mining/overview}\n * for more information on opinion mining.\n *\n * #### Personally identifiable information\n *\n * ```js\n * const documents = [<input documents>];\n * const categoriesFilter = [KnownPiiCategory.USSocialSecurityNumber];\n * const domainFilter = KnownPiiDomain.Phi;\n * const results = await client.analyze(\"PiiEntityRecognition\", documents, {\n * domainFilter, categoriesFilter\n * });\n *\n * for (const result of results) {\n * if (result.error) {\n * // a document has an error instead of results\n * } else {\n * const { entities, redactedText } = result;\n * for (const { text, category, confidenceScore, length, offset } of entities) {\n * // Do something\n * }\n * }\n * }\n * ```\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/personally-identifiable-information/overview}\n * for more information on personally identifiable information.\n *\n * @param actionName - the name of the action to be performed on the input\n * documents, see ${@link AnalyzeActionName}\n * @param documents - the input documents to be analyzed\n * @param options - optional action parameters and settings for the operation\n *\n * @returns an array of results corresponding to the input documents\n */\n public async analyze<ActionName extends AnalyzeActionName = AnalyzeActionName>(\n actionName: ActionName,\n documents: TextDocumentInput[],\n options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions,\n ): Promise<AnalyzeResult<ActionName>>;\n\n /**\n * Runs a predictive model to perform the action of choice on the input\n * strings. See ${@link AnalyzeActionName} for a list of supported\n * actions.\n *\n * The layout of each item in the results array depends on the action chosen.\n * For example, each PIIEntityRecognition document result consists of both\n * `entities` and `redactedText` where the former is a list of all Pii entities\n * in the text and the latter is the original text after all such Pii entities\n * have been redacted from it.\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}\n * for data limits.\n *\n * ### Examples\n *\n * #### Opinion mining\n *\n * ```js\n * const documents = [\"The food and service aren't the best\"];\n * const results = await client.analyze(\"SentimentAnalysis\", documents, {\n * includeOpinionMining: true,\n * });\n *\n * for (const result of results) {\n * if (result.error) {\n * // a document has an error instead of results\n * } else {\n * const { sentiment, confidenceScores, sentences } = result;\n * for (const { sentiment, confidenceScores, opinions } of sentences) {\n * for (const { target, assessments } of opinions) {\n * const { text, sentiment, confidenceScores } = target;\n * for (const { text, sentiment } of assessments) {\n * // Do something\n * }\n * }\n * }\n * }\n * }\n * ```\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/sentiment-opinion-mining/overview}\n * for more information on opinion mining.\n *\n * #### Personally identifiable information\n *\n * ```js\n * const documents = [<input strings>];\n * const languageCode = \"en\";\n * const categoriesFilter = [KnownPiiCategory.USSocialSecurityNumber];\n * const domainFilter = KnownPiiDomain.Phi;\n * const results = await client.analyze(\"PiiEntityRecognition\", documents, languageCode, {\n * domainFilter, categoriesFilter\n * });\n *\n * for (const result of results) {\n * if (result.error) {\n * // a document has an error instead of results\n * } else {\n * const { entities, redactedText } = result;\n * for (const { text, category, confidenceScore, length, offset } of entities) {\n * // Do something\n * }\n * }\n * }\n * ```\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/personally-identifiable-information/overview}\n * for more information on personally identifiable information.\n *\n * @param actionName - the name of the action to be performed on the input\n * documents, see ${@link AnalyzeActionName}\n * @param documents - the input documents to be analyzed\n * @param languageCode - the code of the language that all the input strings are\n * written in. If unspecified, this value will be set to the default\n * language in `TextAnalysisClientOptions`. If set to an empty string,\n * the service will apply a model where the language is explicitly set to\n * \"None\". Language support varies per action, for example, more information\n * about the languages supported for Entity Recognition actions can be\n * found in {@link https://docs.microsoft.com//azure/cognitive-services/language-service/named-entity-recognition/language-support}.\n * If set to \"auto\", the service will automatically infer the language from\n * the input text.\n * @param options - optional action parameters and settings for the operation\n *\n * @returns an array of results corresponding to the input documents\n */\n public async analyze<ActionName extends AnalyzeActionName = AnalyzeActionName>(\n actionName: ActionName,\n documents: string[],\n languageCode?: string,\n options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions,\n ): Promise<AnalyzeResult<ActionName>>;\n // implementation\n public async analyze<ActionName extends AnalyzeActionName = AnalyzeActionName>(\n actionName: ActionName,\n documents: string[] | LanguageDetectionInput[] | TextDocumentInput[],\n languageOrCountryHintOrOptions?:\n | string\n | (AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions),\n options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions,\n ): Promise<AnalyzeResult<ActionName>> {\n let realOptions: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions;\n\n if (documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n let realInputs: LanguageDetectionInput[] | TextDocumentInput[];\n if (isStringArray(documents)) {\n if (actionName === \"LanguageDetection\") {\n realInputs = convertToLanguageDetectionInput(\n documents,\n typeof languageOrCountryHintOrOptions === \"string\"\n ? languageOrCountryHintOrOptions\n : this.defaultCountryHint,\n );\n } else {\n realInputs = convertToTextDocumentInput(\n documents,\n typeof languageOrCountryHintOrOptions === \"string\"\n ? languageOrCountryHintOrOptions\n : this.defaultLanguage,\n );\n }\n realOptions = options || ({} as any);\n } else {\n realInputs = documents;\n realOptions =\n (languageOrCountryHintOrOptions as AnalyzeActionParameters<ActionName> &\n TextAnalysisOperationOptions) || {};\n }\n const { options: operationOptions, rest: action } = getOperationOptions(realOptions);\n return this._tracing.withSpan(\n \"TextAnalysisClient.analyze\",\n operationOptions,\n async (updatedOptions: TextAnalysisOperationOptions) =>\n throwError(\n this._client\n .analyze(\n {\n kind: actionName,\n analysisInput: {\n documents: realInputs,\n },\n parameters: action,\n } as any,\n updatedOptions,\n )\n .then(\n (result) =>\n transformActionResult(\n actionName,\n realInputs.map(({ id }) => id),\n result,\n ) as AnalyzeResult<ActionName>,\n ),\n ),\n );\n }\n\n /**\n * Performs an array (batch) of actions on the input documents. Each action has\n * a `kind` field that specifies the nature of the action. See ${@link AnalyzeBatchActionNames}\n * for a list of supported actions. In addition to `kind`, actions could also\n * have other parameters such as `disableServiceLogs` and `modelVersion`.\n *\n * The results array contains the results for those input actions where each\n * item also has a `kind` field that specifies the type of the results.\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}\n * for data limits.\n *\n * ### Examples\n *\n * #### Key phrase extraction and Pii entity recognition\n *\n * ```js\n * const poller = await client.beginAnalyzeBatch(\n * [{ kind: \"KeyPhraseExtraction\" }, { kind: \"PiiEntityRecognition\" }],\n * documents\n * );\n * const actionResults = await poller.pollUntilDone();\n *\n * for await (const actionResult of actionResults) {\n * if (actionResult.error) {\n * throw new Error(`Unexpected error`);\n * }\n * switch (actionResult.kind) {\n * case \"KeyPhraseExtraction\": {\n * for (const doc of actionResult.results) {\n * // do something\n * }\n * break;\n * }\n * case \"PiiEntityRecognition\": {\n * for (const doc of actionResult.results) {\n * // do something\n * }\n * break;\n * }\n * }\n * }\n * ```\n *\n * @param actions - an array of actions that will be run on the input documents\n * @param documents - the input documents to be analyzed\n * @param languageCode - the code of the language that all the input strings are\n * written in. If unspecified, this value will be set to the default\n * language in `TextAnalysisClientOptions`. If set to an empty string,\n * the service will apply a model where the language is explicitly set to\n * \"None\". Language support varies per action, for example, more information\n * about the languages supported for Entity Recognition actions can be\n * found in {@link https://docs.microsoft.com//azure/cognitive-services/language-service/named-entity-recognition/language-support}.\n * If set to \"auto\", the service will automatically infer the language from\n * the input text.\n * @param options - optional settings for the operation\n *\n * @returns an array of results corresponding to the input actions\n */\n async beginAnalyzeBatch(\n actions: AnalyzeBatchAction[],\n documents: string[],\n languageCode?: string,\n options?: BeginAnalyzeBatchOptions,\n ): Promise<AnalyzeBatchPoller>;\n /**\n * Performs an array (batch) of actions on the input documents. Each action has\n * a `kind` field that specifies the nature of the action. See ${@link AnalyzeBatchActionNames}\n * for a list of supported actions. In addition to `kind`, actions could also\n * have other parameters such as `disableServiceLogs` and `modelVersion`.\n *\n * The results array contains the results for those input actions where each\n * item also has a `kind` field that specifies the type of the results.\n *\n * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}\n * for data limits.\n *\n * ### Examples\n *\n * #### Keyphrase extraction and Pii entity recognition\n *\n * ```js\n * const poller = await client.beginAnalyzeBatch(\n * [{ kind: \"KeyPhraseExtraction\" }, { kind: \"PiiEntityRecognition\" }],\n * documents\n * );\n * const actionResults = await poller.pollUntilDone();\n *\n * for await (const actionResult of actionResults) {\n * if (actionResult.error) {\n * throw new Error(`Unexpected error`);\n * }\n * switch (actionResult.kind) {\n * case \"KeyPhraseExtraction\": {\n * for (const doc of actionResult.results) {\n * // do something\n * }\n * break;\n * }\n * case \"PiiEntityRecognition\": {\n * for (const doc of actionResult.results) {\n * // do something\n * }\n * break;\n * }\n * }\n * }\n * ```\n *\n * @param actions - an array of actions that will be run on the input documents\n * @param documents - the input documents to be analyzed\n * @param options - optional settings for the operation\n *\n * @returns an array of results corresponding to the input actions\n */\n async beginAnalyzeBatch(\n actions: AnalyzeBatchAction[],\n documents: TextDocumentInput[],\n options?: BeginAnalyzeBatchOptions,\n ): Promise<AnalyzeBatchPoller>;\n // implementation\n async beginAnalyzeBatch(\n actions: AnalyzeBatchAction[],\n documents: TextDocumentInput[] | string[],\n languageOrOptions?: BeginAnalyzeBatchOptions | string,\n options: BeginAnalyzeBatchOptions = {},\n ): Promise<AnalyzeBatchPoller> {\n let realOptions: BeginAnalyzeBatchOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const languageCode = (languageOrOptions as string) ?? this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, languageCode);\n realOptions = options;\n } else {\n realInputs = documents;\n realOptions = languageOrOptions as BeginAnalyzeBatchOptions;\n }\n const realActions = actions.map(\n ({ kind, actionName, ...rest }): AnalyzeBatchActionUnion & { parameters: unknown } => ({\n kind,\n actionName,\n parameters: rest,\n }),\n );\n const { includeStatistics, updateIntervalInMs, displayName, ...rest } = realOptions;\n const lro = createAnalyzeBatchLro({\n client: this._client,\n commonOptions: rest,\n documents: realInputs,\n initialRequestOptions: { displayName },\n pollRequestOptions: { includeStatistics },\n tasks: realActions,\n tracing: this._tracing,\n });\n\n const docIds = realInputs.map(({ id }) => id);\n\n const state = { continuationToken: \"\" };\n\n const poller = await createHttpPoller(lro, {\n intervalInMs: updateIntervalInMs,\n processResult: processAnalyzeResult({\n client: this._client,\n tracing: this._tracing,\n docIds,\n opOptions: { ...rest, includeStatistics },\n state,\n }),\n updateState: createUpdateAnalyzeState(docIds),\n withOperationLocation(operationLocation: string) {\n state.continuationToken = operationLocation;\n },\n });\n\n await poller.poll();\n const id = poller.getOperationState().id;\n return createPollerWithCancellation({\n id,\n client: this._client,\n options,\n poller,\n tracing: this._tracing,\n });\n }\n\n /**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n *\n * @param serializedState - the serialized state of another poller. It is the\n * result of `poller.toString()`\n * @param options - optional settings for the operation\n *\n * # Example\n *\n * `client.beginAnalyzeBatch` returns a promise that will resolve to a poller.\n * The state of the poller can be serialized and used to create another as follows:\n *\n * ```js\n * const serializedState = poller.toString();\n * const rehydratedPoller = await client.createAnalyzeBatchPoller(serializedState);\n * const actionResults = await rehydratedPoller.pollUntilDone();\n * ```\n */\n async restoreAnalyzeBatchPoller(\n serializedState: string,\n options?: RestoreAnalyzeBatchPollerOptions,\n ): Promise<AnalyzeBatchPoller>;\n // implementation\n async restoreAnalyzeBatchPoller(\n serializedState: string,\n options: RestoreAnalyzeBatchPollerOptions = {},\n ): Promise<AnalyzeBatchPoller> {\n const { includeStatistics, updateIntervalInMs, ...rest } = options;\n const docIds = getDocIDsFromState(serializedState);\n const lro = createCreateAnalyzeBatchPollerLro({\n client: this._client,\n options: { ...rest, includeStatistics },\n tracing: this._tracing,\n });\n\n const state = { continuationToken: \"\" };\n\n const poller = await createHttpPoller(lro, {\n intervalInMs: updateIntervalInMs,\n restoreFrom: serializedState,\n processResult: processAnalyzeResult({\n client: this._client,\n tracing: this._tracing,\n docIds,\n opOptions: { ...rest, includeStatistics },\n state,\n }),\n updateState: createUpdateAnalyzeState(),\n withOperationLocation(operationLocation: string) {\n state.continuationToken = operationLocation;\n },\n });\n\n await poller.poll();\n const id = poller.getOperationState().id;\n return createPollerWithCancellation({\n id,\n client: this._client,\n options,\n poller,\n tracing: this._tracing,\n });\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import type { AnalyzeResponse, AnalyzeTextLROResultUnion, ErrorModel } from "./generated/index.js";
2
+ import type { AnalyzeActionName, AnalyzeBatchResult, AnalyzeResult } from "./models.js";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare function transformActionResult<ActionName extends AnalyzeActionName>(actionName: ActionName, docIds: string[], response: AnalyzeResponse): AnalyzeResult<AnalyzeActionName>;
7
+ export declare function throwError<T>(p: Promise<T>): Promise<T>;
8
+ /**
9
+ * @internal
10
+ */
11
+ export declare function transformAnalyzeBatchResults(docIds: string[], response?: AnalyzeTextLROResultUnion[], errors?: ErrorModel[]): AnalyzeBatchResult[];
12
+ //# sourceMappingURL=transforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../../src/transforms.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,eAAe,EACf,yBAAyB,EAUzB,UAAU,EA6BX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,iBAAiB,EAEjB,kBAAkB,EAClB,aAAa,EAiBd,MAAM,aAAa,CAAC;AA4KrB;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,SAAS,iBAAiB,EACxE,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,eAAe,GACxB,aAAa,CAAC,iBAAiB,CAAC,CAyBlC;AAiDD,wBAAsB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAM7D;AA+CD;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,GAAE,yBAAyB,EAAO,EAC1C,MAAM,GAAE,UAAU,EAAO,GACxB,kBAAkB,EAAE,CAoMtB"}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { __rest } from "tslib";
4
- import { extractErrorPointerIndex, parseAssessmentIndex, parseHealthcareEntityIndex, sortResponseIdObjects, } from "./util";
4
+ import { extractErrorPointerIndex, parseAssessmentIndex, parseHealthcareEntityIndex, sortResponseIdObjects, } from "./util.js";
5
5
  import { RestError } from "@azure/core-rest-pipeline";
6
6
  /**
7
7
  * Helper function for converting nested service error to the unified
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transforms.js","sourceRoot":"","sources":["../../src/transforms.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAoElC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD;;;GAGG;AACH,SAAS,mBAAmB,CAAC,UAAwC;IACnE,4BAA4B;IAC5B,IAAI,UAAU,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,mBAAmB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACpD,CAAC;IAED,yBACK,UAAU,EACb;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,EAAU,EAAE,KAAiB;IAChE,OAAO;QACL,EAAE;QACF,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC;KAClC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,wBAAwB,CAK/B,GAAa,EACb,QAGC,EACD,OAGC;IAED,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ensed under the MIT License.\n\nimport type {\n AbstractiveSummarizationLROResult,\n AnalyzeResponse,\n AnalyzeTextLROResultUnion,\n AssessmentSentiment,\n CustomEntityRecognitionLROResult,\n CustomMultiLabelClassificationLROResult,\n CustomSingleLabelClassificationLROResult,\n DocumentError,\n EntitiesTaskResult,\n EntityLinkingLROResult,\n EntityLinkingTaskResult,\n EntityRecognitionLROResult,\n ErrorModel,\n ErrorResponse,\n ExtractiveSummarizationLROResult,\n EntityLinkingResult as GeneratedEntityLinkingResult,\n EntitiesResult as GeneratedEntityRecognitionResult,\n HealthcareEntity as GeneratedHealthcareEntity,\n HealthcareResult as GeneratedHealthcareResult,\n KeyPhraseResult as GeneratedKeyPhraseExtractionResult,\n LanguageDetectionResult as GeneratedLanguageDetectionResult,\n PiiResult as GeneratedPiiEntityRecognitionResult,\n SentenceSentiment as GeneratedSentenceSentiment,\n SentimentResponse as GeneratedSentimentAnalysisResult,\n HealthcareLROResult,\n HealthcareRelation,\n HealthcareRelationEntity,\n InnerErrorModel,\n KeyPhraseExtractionLROResult,\n KeyPhraseTaskResult,\n KnownAnalyzeTextLROResultsKind,\n LanguageDetectionTaskResult,\n PiiEntityRecognitionLROResult,\n PiiTaskResult,\n SentenceTarget,\n SentimentLROResult,\n SentimentTaskResult,\n TargetRelation,\n CustomEntitiesResultDocumentsItem,\n CustomLabelClassificationResultDocumentsItem,\n HealthcareEntitiesDocumentResult,\n} from \"./generated/index.js\";\nimport type {\n AnalyzeActionName,\n AnalyzeBatchActionName,\n AnalyzeBatchResult,\n AnalyzeResult,\n EntityLinkingResult,\n EntityRecognitionResult,\n HealthcareEntity,\n HealthcareEntityRelation,\n HealthcareEntityRelationRole,\n HealthcareResult,\n HealthcareSuccessResult,\n KeyPhraseExtractionResult,\n LanguageDetectionResult,\n Opinion,\n PiiEntityRecognitionResult,\n SentenceSentiment,\n SentimentAnalysisResult,\n TextAnalysisError,\n TextAnalysisErrorResult,\n TextAnalysisSuccessResult,\n} from \"./models.js\";\nimport type { AssessmentIndex } from \"./util.js\";\nimport {\n extractErrorPointerIndex,\n parseAssessmentIndex,\n parseHealthcareEntityIndex,\n sortResponseIdObjects,\n} from \"./util.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Helper function for converting nested service error to the unified\n * TextAnalysisError\n */\nfunction toTextAnalysisError(errorModel: ErrorModel | InnerErrorModel): TextAnalysisError {\n // Return the deepest error.\n if (errorModel.innererror !== undefined) {\n return toTextAnalysisError(errorModel.innererror);\n }\n\n return {\n ...errorModel,\n };\n}\n\nfunction makeTextAnalysisErrorResult(id: string, error: ErrorModel): TextAnalysisErrorResult {\n return {\n id,\n error: toTextAnalysisError(error),\n };\n}\n\n/**\n * combines successful and erroneous results into a single array of results and\n * sort them so that the IDs order match that of the input documents array.\n * @param ids - the array of input document IDs.\n * @param response - the response received from the service.\n * @param options - an options bag that includes functions to process the results.\n */\nfunction transformDocumentResults<\n DocumentSuccess extends TextAnalysisSuccessResult,\n PublicDocumentSuccess extends TextAnalysisSuccessResult = DocumentSuccess,\n TError extends TextAnalysisErrorResult = TextAnalysisErrorResult,\n>(\n ids: string[],\n response: {\n documents: DocumentSuccess[];\n errors: DocumentError[];\n },\n options?: {\n processSuccess?: (successResult: DocumentSuccess) => PublicDocumentSuccess;\n processError?: (id: string, error: ErrorModel) => TError;\n },\n): (PublicDocumentSuccess | TextAnalysisErrorResult)[] {\n const { processError = makeTextAnalysisErrorResult, processSuccess } = options || {};\n const successResults = processSuccess\n ? response.documents.map(processSuccess)\n : response.documents;\n const unsortedResults = (\n successResults as (PublicDocumentSuccess | TextAnalysisErrorResult)[]\n ).concat(response.errors.map((error) => processError(error.id, error.error)));\n\n return sortResponseIdObjects(ids, unsortedResults);\n}\n\nfunction toLanguageDetectionResult(\n docIds: string[],\n results: GeneratedLanguageDetectionResult,\n): LanguageDetectionResult[] {\n return transformDocumentResults(docIds, results, {\n processSuccess: ({ detectedLanguage, ...rest }) => ({\n primaryLanguage: detectedLanguage,\n ...rest,\n }),\n });\n}\n\nfunction toPiiEntityRecognitionResult(\n docIds: string[],\n results: GeneratedPiiEntityRecognitionResult,\n): PiiEntityRecognitionResult[] {\n return transformDocumentResults(docIds, results);\n}\n\nfunction toSentimentAnalysisResult(\n docIds: string[],\n results: GeneratedSentimentAnalysisResult,\n): SentimentAnalysisResult[] {\n return transformDocumentResults(docIds, results, {\n processSuccess: ({ sentences, ...rest }) => ({\n ...rest,\n sentences: sentences.map((sentence) =>\n convertGeneratedSentenceSentiment(sentence, sentences),\n ),\n }),\n });\n}\n\n/**\n * Converts a sentence sentiment object returned by the service to another that\n * is user-friendly.\n *\n * @param sentence - The sentence sentiment object to be converted.\n * @param response - The entire response returned by the service.\n * @returns The user-friendly sentence sentiment object.\n * @internal\n */\nfunction convertGeneratedSentenceSentiment(\n { targets, assessments: _, ...rest }: GeneratedSentenceSentiment,\n sentences: GeneratedSentenceSentiment[],\n): SentenceSentiment {\n return {\n ...rest,\n opinions:\n targets?.map(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n ({ relations, ...rest }: SentenceTarget): Opinion => ({\n target: rest,\n assessments: relations\n .filter((relation) => relation.relationType === \"assessment\")\n .map((relation) => convertTargetRelationToAssessmentSentiment(relation, sentences)),\n }),\n ) ?? [],\n };\n}\n\n/**\n * Converts a target relation object returned by the service to an assessment\n * sentiment object where JSON pointers in the former are realized in the\n * latter.\n *\n * @param targetRelation - The target relation object to be converted.\n * @param response - The entire response returned by the service.\n * @returns The user-friendly assessment sentiment object.\n * @internal\n */\nfunction convertTargetRelationToAssessmentSentiment(\n targetRelation: TargetRelation,\n sentences: GeneratedSentenceSentiment[],\n): AssessmentSentiment {\n const assessmentPtr = targetRelation.ref;\n const assessmentIndex: AssessmentIndex = parseAssessmentIndex(assessmentPtr);\n const assessment =\n sentences?.[assessmentIndex.sentence].assessments?.[assessmentIndex.assessment];\n if (assessment !== undefined) {\n return assessment;\n } else {\n throw new Error(`Pointer \"${assessmentPtr}\" is not a valid Assessment pointer`);\n }\n}\n\nfunction toEntityLinkingResult(\n docIds: string[],\n results: GeneratedEntityLinkingResult,\n): EntityLinkingResult[] {\n return transformDocumentResults(docIds, results);\n}\n\nfunction toKeyPhraseExtractionResult(\n docIds: string[],\n results: GeneratedKeyPhraseExtractionResult,\n): KeyPhraseExtractionResult[] {\n return transformDocumentResults(docIds, results);\n}\n\nfunction toEntityRecognitionResult(\n docIds: string[],\n results: GeneratedEntityRecognitionResult,\n): EntityRecognitionResult[] {\n return transformDocumentResults(docIds, results);\n}\n\n/**\n * @internal\n */\nexport function transformActionResult<ActionName extends AnalyzeActionName>(\n actionName: ActionName,\n docIds: string[],\n response: AnalyzeResponse,\n): AnalyzeResult<AnalyzeActionName> {\n switch (response.kind) {\n case \"EntityLinkingResults\": {\n return toEntityLinkingResult(docIds, (response as EntityLinkingTaskResult).results);\n }\n case \"EntityRecognitionResults\": {\n return toEntityRecognitionResult(docIds, (response as EntitiesTaskResult).results);\n }\n case \"KeyPhraseExtractionResults\": {\n return toKeyPhraseExtractionResult(docIds, (response as KeyPhraseTaskResult).results);\n }\n case \"PiiEntityRecognitionResults\": {\n return toPiiEntityRecognitionResult(docIds, (response as PiiTaskResult).results);\n }\n case \"SentimentAnalysisResults\": {\n return toSentimentAnalysisResult(docIds, (response as SentimentTaskResult).results);\n }\n case \"LanguageDetectionResults\": {\n return toLanguageDetectionResult(docIds, (response as LanguageDetectionTaskResult).results);\n }\n default: {\n const __exhaust: never = response;\n throw new Error(`Unsupported results kind: ${__exhaust} for an action of type ${actionName}`);\n }\n }\n}\n\nfunction appendReadableErrorMessage(currentMessage: string, innerMessage: string): string {\n let message = currentMessage;\n if (message.slice(-1) !== \".\") {\n message = message + \".\";\n }\n return message + \" \" + innerMessage;\n}\n\n/**\n * @internal\n * parses incoming errors from the service/\n * @param error - the incoming error\n */\nfunction transformError(errorResponse: unknown): any {\n const strongErrorResponse = errorResponse as {\n response: {\n parsedBody?: ErrorResponse;\n };\n statusCode: number;\n };\n if (!strongErrorResponse.response) {\n throw errorResponse;\n }\n const topLevelError = strongErrorResponse.response.parsedBody?.error;\n if (!topLevelError) return errorResponse;\n let errorMessage = topLevelError.message;\n let code = topLevelError.code;\n function unwrap(error: ErrorModel | InnerErrorModel): ErrorModel {\n const innerError = error.innererror;\n if (innerError) {\n if (innerError.message) {\n errorMessage = appendReadableErrorMessage(errorMessage, innerError.message);\n }\n if (innerError.code) {\n code = innerError.code;\n }\n return unwrap(innerError);\n }\n return error as ErrorModel;\n }\n unwrap(topLevelError);\n return new RestError(errorMessage, {\n code,\n statusCode: strongErrorResponse.statusCode,\n });\n}\n\nexport async function throwError<T>(p: Promise<T>): Promise<T> {\n try {\n return await p;\n } catch (e: unknown) {\n throw transformError(e);\n }\n}\n\nfunction toHealthcareResult(\n docIds: string[],\n results: GeneratedHealthcareResult,\n): HealthcareResult[] {\n function makeHealthcareEntity(entity: GeneratedHealthcareEntity): HealthcareEntity {\n const { dataSources, ...rest } = entity;\n return {\n dataSources: dataSources ?? [],\n ...rest,\n };\n }\n function makeHealthcareRelation(\n entities: HealthcareEntity[],\n ): (relation: HealthcareRelation) => HealthcareEntityRelation {\n return ({\n entities: generatedEntities,\n relationType,\n confidenceScore,\n }: HealthcareRelation): HealthcareEntityRelation => ({\n relationType: relationType,\n confidenceScore,\n roles: generatedEntities.map(\n (role: HealthcareRelationEntity): HealthcareEntityRelationRole => ({\n entity: entities[parseHealthcareEntityIndex(role.ref)],\n name: role.role,\n }),\n ),\n });\n }\n return transformDocumentResults<HealthcareEntitiesDocumentResult, HealthcareSuccessResult>(\n docIds,\n results,\n {\n processSuccess: ({ entities, relations, ...rest }) => {\n const newEntities = entities.map(makeHealthcareEntity);\n return {\n entities: newEntities,\n entityRelations: relations.map(makeHealthcareRelation(newEntities)),\n ...rest,\n };\n },\n },\n );\n}\n\n/**\n * @internal\n */\nexport function transformAnalyzeBatchResults(\n docIds: string[],\n response: AnalyzeTextLROResultUnion[] = [],\n errors: ErrorModel[] = [],\n): AnalyzeBatchResult[] {\n const errorMap = toIndexErrorMap(errors);\n return response.map((actionData, idx): AnalyzeBatchResult => {\n const { lastUpdateDateTime: completedOn, actionName, kind: resultKind } = actionData;\n const error = errorMap.get(idx);\n switch (resultKind as KnownAnalyzeTextLROResultsKind) {\n case \"SentimentAnalysisLROResults\": {\n const kind = \"SentimentAnalysis\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as SentimentLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind,\n results: toSentimentAnalysisResult(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n case \"EntityRecognitionLROResults\": {\n const kind = \"EntityRecognition\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as EntityRecognitionLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind: \"EntityRecognition\",\n results: toEntityRecognitionResult(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n case \"PiiEntityRecognitionLROResults\": {\n const kind = \"PiiEntityRecognition\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as PiiEntityRecognitionLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind,\n results: toPiiEntityRecognitionResult(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n case \"KeyPhraseExtractionLROResults\": {\n const kind = \"KeyPhraseExtraction\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as KeyPhraseExtractionLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind,\n results: toKeyPhraseExtractionResult(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n case \"EntityLinkingLROResults\": {\n const kind = \"EntityLinking\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as EntityLinkingLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind,\n results: toEntityLinkingResult(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n case \"HealthcareLROResults\": {\n const kind = \"Healthcare\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as HealthcareLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind,\n results: toHealthcareResult(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n case \"CustomEntityRecognitionLROResults\": {\n const kind = \"CustomEntityRecognition\";\n if (actionData.status === \"failed\") {\n return returnErrorCustomTask(kind, error, completedOn);\n }\n const { results } = actionData as CustomEntityRecognitionLROResult;\n const { deploymentName, projectName, statistics } = results;\n return {\n kind,\n results: transformDocumentResults<CustomEntitiesResultDocumentsItem>(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n deploymentName,\n projectName,\n };\n }\n case \"CustomSingleLabelClassificationLROResults\": {\n const kind = \"CustomSingleLabelClassification\";\n if (actionData.status === \"failed\") {\n return returnErrorCustomTask(kind, error, completedOn);\n }\n const { results } = actionData as CustomSingleLabelClassificationLROResult;\n const { deploymentName, projectName, statistics } = results;\n return {\n kind,\n results: transformDocumentResults<CustomLabelClassificationResultDocumentsItem>(\n docIds,\n results,\n ),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n deploymentName,\n projectName,\n };\n }\n case \"CustomMultiLabelClassificationLROResults\": {\n const kind = \"CustomMultiLabelClassification\";\n if (actionData.status === \"failed\") {\n return returnErrorCustomTask(kind, error, completedOn);\n }\n const { results } = actionData as CustomMultiLabelClassificationLROResult;\n const { deploymentName, projectName, statistics } = results;\n return {\n kind,\n results: transformDocumentResults<CustomLabelClassificationResultDocumentsItem>(\n docIds,\n results,\n ),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n deploymentName,\n projectName,\n };\n }\n case \"ExtractiveSummarizationLROResults\": {\n const kind = \"ExtractiveSummarization\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as ExtractiveSummarizationLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind: \"ExtractiveSummarization\",\n results: transformDocumentResults(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n case \"AbstractiveSummarizationLROResults\": {\n const kind = \"AbstractiveSummarization\";\n if (actionData.status === \"failed\") {\n return returnErrorTask(kind, error, completedOn);\n }\n const { results } = actionData as AbstractiveSummarizationLROResult;\n const { modelVersion, statistics } = results;\n return {\n kind: \"AbstractiveSummarization\",\n results: transformDocumentResults(docIds, results),\n completedOn,\n ...(actionName ? { actionName } : {}),\n ...(statistics ? { statistics } : {}),\n modelVersion,\n };\n }\n default: {\n throw new Error(`Unsupported results kind: ${resultKind}`);\n }\n }\n });\n}\n/**\n * @internal\n * Transform a list of error into index and error Map\n */\nfunction toIndexErrorMap(errors: ErrorModel[]): Map<number, TextAnalysisError> {\n const errorMap = new Map<number, TextAnalysisError>();\n for (const error of errors) {\n const position = extractErrorPointerIndex(error);\n const { target, ...errorWithoutTarget } = error;\n errorMap.set(position, toTextAnalysisError(errorWithoutTarget));\n }\n return errorMap;\n}\n\n/**\n * Return the error for non-custom task\n *\n * @param kind - non custom task kind\n * @param error - error returned from the service\n * @param failedOn - the LastUpdateDateTime from the service\n * @returns - AnalyzeBatchResult with error\n */\nfunction returnErrorTask(\n kind: AnalyzeBatchActionName,\n error: TextAnalysisError | undefined,\n failedOn: Date,\n): AnalyzeBatchResult {\n if (!error) {\n throw new Error(\"Unexpected response from service - no errors for missing action results.\");\n }\n return {\n kind,\n modelVersion: \"\",\n failedOn,\n error,\n } as AnalyzeBatchResult;\n}\n/**\n * Return the error for non-custom task\n *\n * @param kind - non custom task kind\n * @param error - error returned from the service\n * @param failedOn - the LastUpdateDateTime from the service\n * @returns AnalyzeBatchResult for custom task with error\n */\nfunction returnErrorCustomTask(\n kind: AnalyzeBatchActionName,\n error: TextAnalysisError | undefined,\n failedOn: Date,\n): AnalyzeBatchResult {\n if (!error) {\n throw new Error(\"Unexpected response from service - no errors for missing action results.\");\n }\n return {\n kind,\n projectName: \"\",\n deploymentName: \"\",\n failedOn,\n error,\n } as AnalyzeBatchResult;\n}\n"]}
@@ -0,0 +1,57 @@
1
+ import type { ErrorModel, LanguageDetectionInput, TextDocumentInput } from "./generated/index.js";
2
+ import type { TextAnalysisOperationOptions } from "./models.js";
3
+ /**
4
+ * Given a sorted array of input objects (with a unique ID) and an unsorted array of results,
5
+ * return a sorted array of results.
6
+ *
7
+ * @internal
8
+ * @param sortedIds - An array of sorted IDs
9
+ * @param unsortedArray - An array of entries that contain `id` but are not sorted
10
+ */
11
+ export declare function sortResponseIdObjects<U extends {
12
+ id: string;
13
+ }>(sortedIds: string[], unsortedArray: U[]): U[];
14
+ /**
15
+ * @internal
16
+ */
17
+ export interface AssessmentIndex {
18
+ document: number;
19
+ sentence: number;
20
+ assessment: number;
21
+ }
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare function parseAssessmentIndex(pointer: string): AssessmentIndex;
26
+ /**
27
+ * Parses the index of the healthcare entity from a JSON pointer.
28
+ * @param pointer - a JSON pointer representing an entity
29
+ * @internal
30
+ */
31
+ export declare function parseHealthcareEntityIndex(pointer: string): number;
32
+ /**
33
+ * @internal
34
+ */
35
+ export declare function isStringArray(documents: unknown[]): documents is string[];
36
+ /**
37
+ * @internal
38
+ */
39
+ export declare function convertToTextDocumentInput(inputs: string[], language?: string): TextDocumentInput[];
40
+ /**
41
+ * @internal
42
+ */
43
+ export declare function convertToLanguageDetectionInput(inputs: string[], countryHint?: string): LanguageDetectionInput[];
44
+ /**
45
+ * @internal
46
+ */
47
+ export declare function getOperationOptions<OptionsT extends TextAnalysisOperationOptions>(options: OptionsT): {
48
+ options: TextAnalysisOperationOptions;
49
+ rest: Omit<OptionsT, "onResponse" | "abortSignal" | "includeStatistics" | "requestOptions" | "serializerOptions" | "tracingOptions">;
50
+ };
51
+ /**
52
+ *
53
+ * @param error - error with the target in the JSON error pointer format "#/items/0
54
+ * @returns number: the position of the task with error
55
+ */
56
+ export declare function extractErrorPointerIndex(error: ErrorModel): number;
57
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAGhE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAC5D,SAAS,EAAE,MAAM,EAAE,EACnB,aAAa,EAAE,CAAC,EAAE,GACjB,CAAC,EAAE,CA0BL;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAarE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQlE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,SAAS,IAAI,MAAM,EAAE,CAEzE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,iBAAiB,EAAE,CAQrB;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,EAAE,EAChB,WAAW,CAAC,EAAE,MAAM,GACnB,sBAAsB,EAAE,CAQ1B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,4BAA4B,EAC/E,OAAO,EAAE,QAAQ,GAChB;IACD,OAAO,EAAE,4BAA4B,CAAC;IACtC,IAAI,EAAE,IAAI,CACR,QAAQ,EACN,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,CACnB,CAAC;CACH,CAqBA;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAalE"}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { __rest } from "tslib";
4
- import { logger } from "./logger";
4
+ import { logger } from "./logger.js";
5
5
  /**
6
6
  * Given a sorted array of input objects (with a unique ID) and an unsorted array of results,
7
7
  * return a sorted array of results.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAIlC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAAmB,EACnB,aAAkB;IAElB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAa,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,aAAa,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;QA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GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAiB;IACxD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,CAAC,CAAC;IAEnE,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,sDAAsD,KAAK,CAAC,MAAM,kCAAkC,CACrG,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ErrorModel, LanguageDetectionInput, TextDocumentInput } from \"./generated/index.js\";\nimport type { TextAnalysisOperationOptions } from \"./models.js\";\nimport { logger } from \"./logger.js\";\n\n/**\n * Given a sorted array of input objects (with a unique ID) and an unsorted array of results,\n * return a sorted array of results.\n *\n * @internal\n * @param sortedIds - An array of sorted IDs\n * @param unsortedArray - An array of entries that contain `id` but are not sorted\n */\nexport function sortResponseIdObjects<U extends { id: string }>(\n sortedIds: string[],\n unsortedArray: U[],\n): U[] {\n const unsortedMap = new Map<string, U>();\n for (const item of unsortedArray) {\n unsortedMap.set(item.id, item);\n }\n\n if (unsortedArray.length !== sortedIds.length) {\n const ordinal = unsortedArray.length > sortedIds.length ? \"more\" : \"fewer\";\n logger.warning(\n `The service returned ${ordinal} responses than inputs. Some errors may be treated as fatal.`,\n );\n }\n\n const result: U[] = [];\n /**\n * When the results are returned in pages, sortedArray will probably have more\n * items than unsortedArray so it is ok to ignore the case when a sorted item\n * ID is not found in `unsortedMap`.\n */\n for (const id of sortedIds) {\n const item = unsortedMap.get(id);\n if (item) {\n result.push(item);\n }\n }\n return result;\n}\n\n/**\n * @internal\n */\nexport interface AssessmentIndex {\n document: number;\n sentence: number;\n assessment: number;\n}\n\n/**\n * @internal\n */\nexport function parseAssessmentIndex(pointer: string): AssessmentIndex {\n const regex = new RegExp(/#\\/documents\\/(\\d+)\\/sentences\\/(\\d+)\\/assessments\\/(\\d+)/);\n const res = regex.exec(pointer);\n if (res !== null) {\n const assessmentIndex: AssessmentIndex = {\n document: parseInt(res[1]),\n sentence: parseInt(res[2]),\n assessment: parseInt(res[3]),\n };\n return assessmentIndex;\n } else {\n throw new Error(`Pointer \"${pointer}\" is not a valid Assessment pointer`);\n }\n}\n\n/**\n * Parses the index of the healthcare entity from a JSON pointer.\n * @param pointer - a JSON pointer representing an entity\n * @internal\n */\nexport function parseHealthcareEntityIndex(pointer: string): number {\n const regex = new RegExp(/#\\/results\\/documents\\/(\\d+)\\/entities\\/(\\d+)/);\n const res = regex.exec(pointer);\n if (res !== null) {\n return parseInt(res[2]);\n } else {\n throw new Error(`Pointer \"${pointer}\" is not a valid healthcare entity pointer`);\n }\n}\n\n/**\n * @internal\n */\nexport function isStringArray(documents: unknown[]): documents is string[] {\n return typeof documents[0] === \"string\";\n}\n\n/**\n * @internal\n */\nexport function convertToTextDocumentInput(\n inputs: string[],\n language?: string,\n): TextDocumentInput[] {\n return inputs.map((text: string, index): TextDocumentInput => {\n return {\n id: String(index),\n language,\n text,\n };\n });\n}\n\n/**\n * @internal\n */\nexport function convertToLanguageDetectionInput(\n inputs: string[],\n countryHint?: string,\n): LanguageDetectionInput[] {\n return inputs.map((text: string, index): LanguageDetectionInput => {\n return {\n id: String(index),\n countryHint,\n text,\n };\n });\n}\n\n/**\n * @internal\n */\nexport function getOperationOptions<OptionsT extends TextAnalysisOperationOptions>(\n options: OptionsT,\n): {\n options: TextAnalysisOperationOptions;\n rest: Omit<\n OptionsT,\n | \"onResponse\"\n | \"abortSignal\"\n | \"includeStatistics\"\n | \"requestOptions\"\n | \"serializerOptions\"\n | \"tracingOptions\"\n >;\n} {\n const {\n abortSignal,\n includeStatistics,\n onResponse,\n requestOptions,\n serializerOptions,\n tracingOptions,\n ...rest\n } = options;\n return {\n options: {\n abortSignal,\n includeStatistics,\n onResponse,\n requestOptions,\n serializerOptions,\n tracingOptions,\n },\n rest,\n };\n}\n\n/**\n *\n * @param error - error with the target in the JSON error pointer format \"#/items/0\n * @returns number: the position of the task with error\n */\nexport function extractErrorPointerIndex(error: ErrorModel): number {\n if (!error.target) {\n throw new Error(\"Unexpected response from service - no target present\");\n }\n const position = parseInt(error.target.split(\"/\").pop() as string);\n\n if (isNaN(position)) {\n throw new Error(\n `Unexpected response from service - action pointer \"${error.target}\" is not a valid action pointer.`,\n );\n }\n\n return position;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { PipelinePolicy } from "@azure/core-rest-pipeline";
2
+ import type { KeyCredential } from "@azure/core-auth";
3
+ /**
4
+ * Create an HTTP pipeline policy to authenticate a request
5
+ * using an `AzureKeyCredential` for Text Analytics
6
+ * @internal
7
+ */
8
+ export declare function textAnalyticsAzureKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy;
9
+ //# sourceMappingURL=azureKeyCredentialPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azureKeyCredentialPolicy.d.ts","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAStD;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,UAAU,EAAE,aAAa,GAAG,cAAc,CAQ/F"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.textAnalyticsAzureKeyCredentialPolicy = textAnalyticsAzureKeyCredentialPolicy;
6
+ const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key";
7
+ /**
8
+ * The programmatic identifier of the textAnalyticsAzureKeyCredentialPolicy.
9
+ */
10
+ const textAnalyticsAzureKeyCredentialPolicyName = "textAnalyticsAzureKeyCredentialPolicy";
11
+ /**
12
+ * Create an HTTP pipeline policy to authenticate a request
13
+ * using an `AzureKeyCredential` for Text Analytics
14
+ * @internal
15
+ */
16
+ function textAnalyticsAzureKeyCredentialPolicy(credential) {
17
+ return {
18
+ name: textAnalyticsAzureKeyCredentialPolicyName,
19
+ sendRequest(request, next) {
20
+ request.headers.set(API_KEY_HEADER_NAME, credential.key);
21
+ return next(request);
22
+ },
23
+ };
24
+ }
25
+ //# sourceMappingURL=azureKeyCredentialPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azureKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAsBlC,sFAQC;AApBD,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAExD;;GAEG;AACH,MAAM,yCAAyC,GAAG,uCAAuC,CAAC;AAE1F;;;;GAIG;AACH,SAAgB,qCAAqC,CAAC,UAAyB;IAC7E,OAAO;QACL,IAAI,EAAE,yCAAyC;QAC/C,WAAW,CAAC,OAAwB,EAAE,IAAiB;YACrD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential } from \"@azure/core-auth\";\n\nconst API_KEY_HEADER_NAME = \"Ocp-Apim-Subscription-Key\";\n\n/**\n * The programmatic identifier of the textAnalyticsAzureKeyCredentialPolicy.\n */\nconst textAnalyticsAzureKeyCredentialPolicyName = \"textAnalyticsAzureKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Text Analytics\n * @internal\n */\nexport function textAnalyticsAzureKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: textAnalyticsAzureKeyCredentialPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(API_KEY_HEADER_NAME, credential.key);\n return next(request);\n },\n };\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The default AAD permissions scope for Cognitive Services.
3
+ * @internal
4
+ */
5
+ export declare const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
6
+ /**
7
+ * @internal
8
+ */
9
+ export declare const SDK_VERSION = "1.1.0";
10
+ /**
11
+ * @internal
12
+ */
13
+ export declare const clientName = "TextAnalysisClient";
14
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iDAAiD,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,UAAU,uBAAuB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.clientName = exports.SDK_VERSION = exports.DEFAULT_COGNITIVE_SCOPE = void 0;
6
+ /**
7
+ * The default AAD permissions scope for Cognitive Services.
8
+ * @internal
9
+ */
10
+ exports.DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
11
+ /**
12
+ * @internal
13
+ */
14
+ exports.SDK_VERSION = "1.1.0";
15
+ /**
16
+ * @internal
17
+ */
18
+ exports.clientName = "TextAnalysisClient";
19
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;GAGG;AACU,QAAA,uBAAuB,GAAG,8CAA8C,CAAC;AAEtF;;GAEG;AACU,QAAA,WAAW,GAAG,OAAO,CAAC;AAEnC;;GAEG;AACU,QAAA,UAAU,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * The default AAD permissions scope for Cognitive Services.\n * @internal\n */\nexport const DEFAULT_COGNITIVE_SCOPE = \"https://cognitiveservices.azure.com/.default\";\n\n/**\n * @internal\n */\nexport const SDK_VERSION = \"1.1.0\";\n\n/**\n * @internal\n */\nexport const clientName = \"TextAnalysisClient\";\n"]}
@@ -0,0 +1,33 @@
1
+ import * as coreClient from "@azure/core-client";
2
+ import { AnalyzeText } from "./operationsInterfaces/index.js";
3
+ import { GeneratedClientOptionalParams, AnalyzeActionUnion, AnalyzeOptionalParams, AnalyzeResponse, AnalyzeTextJobsInput, AnalyzeBatchOptionalParams, AnalyzeBatchResponse } from "./models/index.js";
4
+ /** @internal */
5
+ export declare class GeneratedClient extends coreClient.ServiceClient {
6
+ endpoint: string;
7
+ apiVersion: string;
8
+ /**
9
+ * Initializes a new instance of the GeneratedClient class.
10
+ * @param endpoint Supported Cognitive Services endpoint (e.g.,
11
+ * https://<resource-name>.api.cognitiveservices.azure.com).
12
+ * @param options The parameter options
13
+ */
14
+ constructor(endpoint: string, options?: GeneratedClientOptionalParams);
15
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
16
+ private addCustomApiVersionPolicy;
17
+ /**
18
+ * Submit a collection of text documents for analysis. Specify a single unique task to be executed
19
+ * immediately.
20
+ * @param body Collection of documents to analyze and a single task to execute.
21
+ * @param options The options parameters.
22
+ */
23
+ analyze(body: AnalyzeActionUnion, options?: AnalyzeOptionalParams): Promise<AnalyzeResponse>;
24
+ /**
25
+ * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed
26
+ * as a long-running operation.
27
+ * @param body Collection of documents to analyze and one or more tasks to execute.
28
+ * @param options The options parameters.
29
+ */
30
+ analyzeBatch(body: AnalyzeTextJobsInput, options?: AnalyzeBatchOptionalParams): Promise<AnalyzeBatchResponse>;
31
+ analyzeText: AnalyzeText;
32
+ }
33
+ //# sourceMappingURL=generatedClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatedClient.d.ts","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAOjD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,gBAAgB;AAChB,qBAAa,eAAgB,SAAQ,UAAU,CAAC,aAAa;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBACS,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,6BAA6B;IAqCrE,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC;;;;;OAKG;IACH,OAAO,CACL,IAAI,EAAE,kBAAkB,EACxB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,eAAe,CAAC;IAI3B;;;;;OAKG;IACH,YAAY,CACV,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,oBAAoB,CAAC;IAOhC,WAAW,EAAE,WAAW,CAAC;CAC1B"}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * Code generated by Microsoft (R) AutoRest Code Generator.
7
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.GeneratedClient = void 0;
11
+ const tslib_1 = require("tslib");
12
+ const coreClient = tslib_1.__importStar(require("@azure/core-client"));
13
+ const index_js_1 = require("./operations/index.js");
14
+ const Parameters = tslib_1.__importStar(require("./models/parameters.js"));
15
+ const Mappers = tslib_1.__importStar(require("./models/mappers.js"));
16
+ /** @internal */
17
+ class GeneratedClient extends coreClient.ServiceClient {
18
+ /**
19
+ * Initializes a new instance of the GeneratedClient class.
20
+ * @param endpoint Supported Cognitive Services endpoint (e.g.,
21
+ * https://<resource-name>.api.cognitiveservices.azure.com).
22
+ * @param options The parameter options
23
+ */
24
+ constructor(endpoint, options) {
25
+ var _a, _b;
26
+ if (endpoint === undefined) {
27
+ throw new Error("'endpoint' cannot be null");
28
+ }
29
+ // Initializing default values for options
30
+ if (!options) {
31
+ options = {};
32
+ }
33
+ const defaults = {
34
+ requestContentType: "application/json; charset=utf-8"
35
+ };
36
+ const packageDetails = `azsdk-js-ai-language-text/1.1.0`;
37
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
38
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
39
+ : `${packageDetails}`;
40
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
41
+ userAgentPrefix
42
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{Endpoint}/language" });
43
+ super(optionsWithDefaults);
44
+ // Parameter assignments
45
+ this.endpoint = endpoint;
46
+ // Assigning values to Constant parameters
47
+ this.apiVersion = options.apiVersion || "2023-04-01";
48
+ this.analyzeText = new index_js_1.AnalyzeTextImpl(this);
49
+ this.addCustomApiVersionPolicy(options.apiVersion);
50
+ }
51
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
52
+ addCustomApiVersionPolicy(apiVersion) {
53
+ if (!apiVersion) {
54
+ return;
55
+ }
56
+ const apiVersionPolicy = {
57
+ name: "CustomApiVersionPolicy",
58
+ async sendRequest(request, next) {
59
+ const param = request.url.split("?");
60
+ if (param.length > 1) {
61
+ const newParams = param[1].split("&").map((item) => {
62
+ if (item.indexOf("api-version") > -1) {
63
+ return "api-version=" + apiVersion;
64
+ }
65
+ else {
66
+ return item;
67
+ }
68
+ });
69
+ request.url = param[0] + "?" + newParams.join("&");
70
+ }
71
+ return next(request);
72
+ }
73
+ };
74
+ this.pipeline.addPolicy(apiVersionPolicy);
75
+ }
76
+ /**
77
+ * Submit a collection of text documents for analysis. Specify a single unique task to be executed
78
+ * immediately.
79
+ * @param body Collection of documents to analyze and a single task to execute.
80
+ * @param options The options parameters.
81
+ */
82
+ analyze(body, options) {
83
+ return this.sendOperationRequest({ body, options }, analyzeOperationSpec);
84
+ }
85
+ /**
86
+ * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed
87
+ * as a long-running operation.
88
+ * @param body Collection of documents to analyze and one or more tasks to execute.
89
+ * @param options The options parameters.
90
+ */
91
+ analyzeBatch(body, options) {
92
+ return this.sendOperationRequest({ body, options }, analyzeBatchOperationSpec);
93
+ }
94
+ }
95
+ exports.GeneratedClient = GeneratedClient;
96
+ // Operation Specifications
97
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
98
+ const analyzeOperationSpec = {
99
+ path: "/:analyze-text",
100
+ httpMethod: "POST",
101
+ responses: {
102
+ 200: {
103
+ bodyMapper: Mappers.AnalyzeTextTaskResult
104
+ },
105
+ default: {
106
+ bodyMapper: Mappers.ErrorResponse
107
+ }
108
+ },
109
+ requestBody: Parameters.body,
110
+ queryParameters: [Parameters.apiVersion, Parameters.includeStatistics],
111
+ urlParameters: [Parameters.endpoint],
112
+ headerParameters: [Parameters.contentType, Parameters.accept],
113
+ mediaType: "json",
114
+ serializer
115
+ };
116
+ const analyzeBatchOperationSpec = {
117
+ path: "/analyze-text/jobs",
118
+ httpMethod: "POST",
119
+ responses: {
120
+ 202: {
121
+ headersMapper: Mappers.GeneratedClientAnalyzeBatchHeaders
122
+ },
123
+ default: {
124
+ bodyMapper: Mappers.ErrorResponse
125
+ }
126
+ },
127
+ requestBody: Parameters.body1,
128
+ queryParameters: [Parameters.apiVersion],
129
+ urlParameters: [Parameters.endpoint],
130
+ headerParameters: [Parameters.contentType, Parameters.accept],
131
+ mediaType: "json",
132
+ serializer
133
+ };
134
+ //# sourceMappingURL=generatedClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatedClient.js","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AAMjD,oDAAwD;AAExD,2EAAqD;AACrD,qEAA+C;AAW/C,gBAAgB;AAChB,MAAa,eAAgB,SAAQ,UAAU,CAAC,aAAa;IAI3D;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,OAAuC;;QACnE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,iCAAiC,CAAC;QACzD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,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ACH,aAAa,EAAE,OAAO,CAAC,kCAAkC;SAC1D;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { AnalyzeTextImpl } from \"./operations/index.js\";\nimport { AnalyzeText } from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n GeneratedClientOptionalParams,\n AnalyzeActionUnion,\n AnalyzeOptionalParams,\n AnalyzeResponse,\n AnalyzeTextJobsInput,\n AnalyzeBatchOptionalParams,\n AnalyzeBatchResponse\n} from \"./models/index.js\";\n\n/** @internal */\nexport class GeneratedClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the GeneratedClient class.\n * @param endpoint Supported Cognitive Services endpoint (e.g.,\n * https://<resource-name>.api.cognitiveservices.azure.com).\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-ai-language-text/1.1.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{Endpoint}/language\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2023-04-01\";\n this.analyzeText = new AnalyzeTextImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify a single unique task to be executed\n * immediately.\n * @param body Collection of documents to analyze and a single task to execute.\n * @param options The options parameters.\n */\n analyze(\n body: AnalyzeActionUnion,\n options?: AnalyzeOptionalParams\n ): Promise<AnalyzeResponse> {\n return this.sendOperationRequest({ body, options }, analyzeOperationSpec);\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed\n * as a long-running operation.\n * @param body Collection of documents to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n analyzeBatch(\n body: AnalyzeTextJobsInput,\n options?: AnalyzeBatchOptionalParams\n ): Promise<AnalyzeBatchResponse> {\n return this.sendOperationRequest(\n { body, options },\n analyzeBatchOperationSpec\n );\n }\n\n analyzeText: AnalyzeText;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeOperationSpec: coreClient.OperationSpec = {\n path: \"/:analyze-text\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeTextTaskResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.body,\n queryParameters: [Parameters.apiVersion, Parameters.includeStatistics],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst analyzeBatchOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze-text/jobs\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.GeneratedClientAnalyzeBatchHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export * from "./models/index.js";
2
+ export { GeneratedClient } from "./generatedClient.js";
3
+ export * from "./operationsInterfaces/index.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAQA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * Code generated by Microsoft (R) AutoRest Code Generator.
7
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.GeneratedClient = void 0;
11
+ const tslib_1 = require("tslib");
12
+ tslib_1.__exportStar(require("./models/index.js"), exports);
13
+ var generatedClient_js_1 = require("./generatedClient.js");
14
+ Object.defineProperty(exports, "GeneratedClient", { enumerable: true, get: function () { return generatedClient_js_1.GeneratedClient; } });
15
+ tslib_1.__exportStar(require("./operationsInterfaces/index.js"), exports);
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,4DAAkC;AAClC,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,0EAAgD","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./models/index.js\";\nexport { GeneratedClient } from \"./generatedClient.js\";\nexport * from \"./operationsInterfaces/index.js\";\n"]}