@memori.ai/memori-api-client 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +17 -89
  3. package/dist/apiFetcher.d.ts +7 -7
  4. package/dist/apiFetcher.js +17 -0
  5. package/dist/apiFetcher.js.map +1 -0
  6. package/dist/backend/asset.d.ts +13 -44
  7. package/dist/backend/asset.js +31 -0
  8. package/dist/backend/asset.js.map +1 -0
  9. package/dist/backend/asset.test.d.ts +1 -0
  10. package/dist/backend/asset.test.js +14 -0
  11. package/dist/backend/asset.test.js.map +1 -0
  12. package/dist/backend/consumptionLogs.d.ts +13 -40
  13. package/dist/backend/consumptionLogs.js +15 -0
  14. package/dist/backend/consumptionLogs.js.map +1 -0
  15. package/dist/backend/consumptionLogs.test.d.ts +1 -0
  16. package/dist/backend/consumptionLogs.test.js +14 -0
  17. package/dist/backend/consumptionLogs.test.js.map +1 -0
  18. package/dist/backend/integration.d.ts +20 -55
  19. package/dist/backend/integration.js +29 -0
  20. package/dist/backend/integration.js.map +1 -0
  21. package/dist/backend/integration.test.d.ts +1 -0
  22. package/dist/backend/integration.test.js +14 -0
  23. package/dist/backend/integration.test.js.map +1 -0
  24. package/dist/backend/invitation.d.ts +34 -91
  25. package/dist/backend/invitation.js +43 -0
  26. package/dist/backend/invitation.js.map +1 -0
  27. package/dist/backend/invitation.test.d.ts +1 -0
  28. package/dist/backend/invitation.test.js +14 -0
  29. package/dist/backend/invitation.test.js.map +1 -0
  30. package/dist/backend/memori.d.ts +61 -173
  31. package/dist/backend/memori.js +72 -0
  32. package/dist/backend/memori.js.map +1 -0
  33. package/dist/backend/memori.test.d.ts +1 -0
  34. package/dist/backend/memori.test.js +14 -0
  35. package/dist/backend/memori.test.js.map +1 -0
  36. package/dist/backend/notifications.d.ts +10 -20
  37. package/dist/backend/notifications.js +12 -0
  38. package/dist/backend/notifications.js.map +1 -0
  39. package/dist/backend/notifications.test.d.ts +1 -0
  40. package/dist/backend/notifications.test.js +14 -0
  41. package/dist/backend/notifications.test.js.map +1 -0
  42. package/dist/backend/user.d.ts +41 -109
  43. package/dist/backend/user.js +68 -0
  44. package/dist/backend/user.js.map +1 -0
  45. package/dist/backend/user.test.d.ts +1 -0
  46. package/dist/backend/user.test.js +14 -0
  47. package/dist/backend/user.test.js.map +1 -0
  48. package/dist/backend.d.ts +345 -333
  49. package/dist/backend.js +28 -0
  50. package/dist/backend.js.map +1 -0
  51. package/dist/client.test.d.ts +1 -0
  52. package/dist/client.test.js +32 -0
  53. package/dist/client.test.js.map +1 -0
  54. package/dist/constants.d.ts +2 -2
  55. package/dist/constants.js +24 -0
  56. package/dist/constants.js.map +1 -0
  57. package/dist/constants.test.d.ts +1 -0
  58. package/dist/constants.test.js +14 -0
  59. package/dist/constants.test.js.map +1 -0
  60. package/dist/engine/chatLogs.d.ts +12 -39
  61. package/dist/engine/chatLogs.js +22 -0
  62. package/dist/engine/chatLogs.js.map +1 -0
  63. package/dist/engine/chatLogs.test.d.ts +1 -0
  64. package/dist/engine/chatLogs.test.js +14 -0
  65. package/dist/engine/chatLogs.test.js.map +1 -0
  66. package/dist/engine/contextVars.d.ts +14 -32
  67. package/dist/engine/contextVars.js +18 -0
  68. package/dist/engine/contextVars.js.map +1 -0
  69. package/dist/engine/contextVars.test.d.ts +1 -0
  70. package/dist/engine/contextVars.test.js +14 -0
  71. package/dist/engine/contextVars.test.js.map +1 -0
  72. package/dist/engine/correlationPairs.d.ts +11 -32
  73. package/dist/engine/correlationPairs.js +19 -0
  74. package/dist/engine/correlationPairs.js.map +1 -0
  75. package/dist/engine/correlationPairs.test.d.ts +1 -0
  76. package/dist/engine/correlationPairs.test.js +14 -0
  77. package/dist/engine/correlationPairs.test.js.map +1 -0
  78. package/dist/engine/customDictionary.d.ts +17 -47
  79. package/dist/engine/customDictionary.js +28 -0
  80. package/dist/engine/customDictionary.js.map +1 -0
  81. package/dist/engine/customDictionary.test.d.ts +1 -0
  82. package/dist/engine/customDictionary.test.js +14 -0
  83. package/dist/engine/customDictionary.test.js.map +1 -0
  84. package/dist/engine/dialog.d.ts +32 -82
  85. package/dist/engine/dialog.js +53 -0
  86. package/dist/engine/dialog.js.map +1 -0
  87. package/dist/engine/dialog.test.d.ts +1 -0
  88. package/dist/engine/dialog.test.js +20 -0
  89. package/dist/engine/dialog.test.js.map +1 -0
  90. package/dist/engine/importExport.d.ts +20 -23
  91. package/dist/engine/importExport.js +40 -0
  92. package/dist/engine/importExport.js.map +1 -0
  93. package/dist/engine/importExport.test.d.ts +1 -0
  94. package/dist/engine/importExport.test.js +25 -0
  95. package/dist/engine/importExport.test.js.map +1 -0
  96. package/dist/engine/intents.d.ts +38 -90
  97. package/dist/engine/intents.js +50 -0
  98. package/dist/engine/intents.js.map +1 -0
  99. package/dist/engine/intents.test.d.ts +1 -0
  100. package/dist/engine/intents.test.js +14 -0
  101. package/dist/engine/intents.test.js.map +1 -0
  102. package/dist/engine/localizationKeys.d.ts +15 -50
  103. package/dist/engine/localizationKeys.js +28 -0
  104. package/dist/engine/localizationKeys.js.map +1 -0
  105. package/dist/engine/localizationKeys.test.d.ts +1 -0
  106. package/dist/engine/localizationKeys.test.js +14 -0
  107. package/dist/engine/localizationKeys.test.js.map +1 -0
  108. package/dist/engine/media.d.ts +10 -48
  109. package/dist/engine/media.js +30 -0
  110. package/dist/engine/media.js.map +1 -0
  111. package/dist/engine/media.test.d.ts +1 -0
  112. package/dist/engine/media.test.js +14 -0
  113. package/dist/engine/media.test.js.map +1 -0
  114. package/dist/engine/memories.d.ts +20 -62
  115. package/dist/engine/memories.js +36 -0
  116. package/dist/engine/memories.js.map +1 -0
  117. package/dist/engine/memories.test.d.ts +1 -0
  118. package/dist/engine/memories.test.js +14 -0
  119. package/dist/engine/memories.test.js.map +1 -0
  120. package/dist/engine/nlp.d.ts +22 -66
  121. package/dist/engine/nlp.js +34 -0
  122. package/dist/engine/nlp.js.map +1 -0
  123. package/dist/engine/nlp.test.d.ts +1 -0
  124. package/dist/engine/nlp.test.js +14 -0
  125. package/dist/engine/nlp.test.js.map +1 -0
  126. package/dist/engine/people.d.ts +17 -46
  127. package/dist/engine/people.js +28 -0
  128. package/dist/engine/people.js.map +1 -0
  129. package/dist/engine/people.test.d.ts +1 -0
  130. package/dist/engine/people.test.js +14 -0
  131. package/dist/engine/people.test.js.map +1 -0
  132. package/dist/engine/promptedQuestions.d.ts +9 -37
  133. package/dist/engine/promptedQuestions.js +26 -0
  134. package/dist/engine/promptedQuestions.js.map +1 -0
  135. package/dist/engine/promptedQuestions.test.d.ts +1 -0
  136. package/dist/engine/promptedQuestions.test.js +14 -0
  137. package/dist/engine/promptedQuestions.test.js.map +1 -0
  138. package/dist/engine/search.d.ts +9 -30
  139. package/dist/engine/search.js +19 -0
  140. package/dist/engine/search.js.map +1 -0
  141. package/dist/engine/search.test.d.ts +1 -0
  142. package/dist/engine/search.test.js +14 -0
  143. package/dist/engine/search.test.js.map +1 -0
  144. package/dist/engine/session.d.ts +12 -28
  145. package/dist/engine/session.js +19 -0
  146. package/dist/engine/session.js.map +1 -0
  147. package/dist/engine/session.test.d.ts +1 -0
  148. package/dist/engine/session.test.js +14 -0
  149. package/dist/engine/session.test.js.map +1 -0
  150. package/dist/engine/stats.d.ts +27 -92
  151. package/dist/engine/stats.js +30 -0
  152. package/dist/engine/stats.js.map +1 -0
  153. package/dist/engine/stats.test.d.ts +1 -0
  154. package/dist/engine/stats.test.js +14 -0
  155. package/dist/engine/stats.test.js.map +1 -0
  156. package/dist/engine/unansweredQuestions.d.ts +15 -38
  157. package/dist/engine/unansweredQuestions.js +23 -0
  158. package/dist/engine/unansweredQuestions.js.map +1 -0
  159. package/dist/engine/unansweredQuestions.test.d.ts +1 -0
  160. package/dist/engine/unansweredQuestions.test.js +14 -0
  161. package/dist/engine/unansweredQuestions.test.js.map +1 -0
  162. package/dist/engine.d.ts +501 -473
  163. package/dist/engine.js +57 -0
  164. package/dist/engine.js.map +1 -0
  165. package/dist/helpers/asset.d.ts +10 -20
  166. package/dist/helpers/asset.js +29 -0
  167. package/dist/helpers/asset.js.map +1 -0
  168. package/dist/helpers/asset.test.d.ts +1 -0
  169. package/dist/helpers/asset.test.js +68 -0
  170. package/dist/helpers/asset.test.js.map +1 -0
  171. package/dist/helpers/getApiUrl.d.ts +1 -1
  172. package/dist/helpers/getApiUrl.js +9 -0
  173. package/dist/helpers/getApiUrl.js.map +1 -0
  174. package/dist/helpers/getApiUrl.test.d.ts +1 -0
  175. package/dist/helpers/getApiUrl.test.js +15 -0
  176. package/dist/helpers/getApiUrl.test.js.map +1 -0
  177. package/dist/index.d.ts +850 -810
  178. package/dist/index.js +19 -8
  179. package/dist/index.js.map +1 -0
  180. package/dist/types.d.ts +627 -844
  181. package/dist/types.js +3 -0
  182. package/dist/types.js.map +1 -0
  183. package/esm/apiFetcher.d.ts +7 -0
  184. package/esm/apiFetcher.js +12 -0
  185. package/esm/apiFetcher.js.map +1 -0
  186. package/esm/backend/asset.d.ts +13 -0
  187. package/esm/backend/asset.js +29 -0
  188. package/esm/backend/asset.js.map +1 -0
  189. package/esm/backend/asset.test.d.ts +1 -0
  190. package/esm/backend/asset.test.js +11 -0
  191. package/esm/backend/asset.test.js.map +1 -0
  192. package/esm/backend/consumptionLogs.d.ts +13 -0
  193. package/esm/backend/consumptionLogs.js +13 -0
  194. package/esm/backend/consumptionLogs.js.map +1 -0
  195. package/esm/backend/consumptionLogs.test.d.ts +1 -0
  196. package/esm/backend/consumptionLogs.test.js +11 -0
  197. package/esm/backend/consumptionLogs.test.js.map +1 -0
  198. package/esm/backend/integration.d.ts +20 -0
  199. package/esm/backend/integration.js +27 -0
  200. package/esm/backend/integration.js.map +1 -0
  201. package/esm/backend/integration.test.d.ts +1 -0
  202. package/esm/backend/integration.test.js +11 -0
  203. package/esm/backend/integration.test.js.map +1 -0
  204. package/esm/backend/invitation.d.ts +34 -0
  205. package/esm/backend/invitation.js +41 -0
  206. package/esm/backend/invitation.js.map +1 -0
  207. package/esm/backend/invitation.test.d.ts +1 -0
  208. package/esm/backend/invitation.test.js +11 -0
  209. package/esm/backend/invitation.test.js.map +1 -0
  210. package/esm/backend/memori.d.ts +61 -0
  211. package/esm/backend/memori.js +70 -0
  212. package/esm/backend/memori.js.map +1 -0
  213. package/esm/backend/memori.test.d.ts +1 -0
  214. package/esm/backend/memori.test.js +11 -0
  215. package/esm/backend/memori.test.js.map +1 -0
  216. package/esm/backend/notifications.d.ts +10 -0
  217. package/esm/backend/notifications.js +10 -0
  218. package/esm/backend/notifications.js.map +1 -0
  219. package/esm/backend/notifications.test.d.ts +1 -0
  220. package/esm/backend/notifications.test.js +11 -0
  221. package/esm/backend/notifications.test.js.map +1 -0
  222. package/esm/backend/user.d.ts +41 -0
  223. package/esm/backend/user.js +66 -0
  224. package/esm/backend/user.js.map +1 -0
  225. package/esm/backend/user.test.d.ts +1 -0
  226. package/esm/backend/user.test.js +11 -0
  227. package/esm/backend/user.test.js.map +1 -0
  228. package/esm/backend.d.ts +345 -0
  229. package/esm/backend.js +25 -0
  230. package/esm/backend.js.map +1 -0
  231. package/esm/client.test.d.ts +1 -0
  232. package/esm/client.test.js +29 -0
  233. package/esm/client.test.js.map +1 -0
  234. package/esm/constants.d.ts +2 -0
  235. package/esm/constants.js +21 -0
  236. package/esm/constants.js.map +1 -0
  237. package/esm/constants.test.d.ts +1 -0
  238. package/esm/constants.test.js +11 -0
  239. package/esm/constants.test.js.map +1 -0
  240. package/esm/engine/chatLogs.d.ts +12 -0
  241. package/esm/engine/chatLogs.js +20 -0
  242. package/esm/engine/chatLogs.js.map +1 -0
  243. package/esm/engine/chatLogs.test.d.ts +1 -0
  244. package/esm/engine/chatLogs.test.js +11 -0
  245. package/esm/engine/chatLogs.test.js.map +1 -0
  246. package/esm/engine/contextVars.d.ts +14 -0
  247. package/esm/engine/contextVars.js +16 -0
  248. package/esm/engine/contextVars.js.map +1 -0
  249. package/esm/engine/contextVars.test.d.ts +1 -0
  250. package/esm/engine/contextVars.test.js +11 -0
  251. package/esm/engine/contextVars.test.js.map +1 -0
  252. package/esm/engine/correlationPairs.d.ts +11 -0
  253. package/esm/engine/correlationPairs.js +17 -0
  254. package/esm/engine/correlationPairs.js.map +1 -0
  255. package/esm/engine/correlationPairs.test.d.ts +1 -0
  256. package/esm/engine/correlationPairs.test.js +11 -0
  257. package/esm/engine/correlationPairs.test.js.map +1 -0
  258. package/esm/engine/customDictionary.d.ts +17 -0
  259. package/esm/engine/customDictionary.js +26 -0
  260. package/esm/engine/customDictionary.js.map +1 -0
  261. package/esm/engine/customDictionary.test.d.ts +1 -0
  262. package/esm/engine/customDictionary.test.js +11 -0
  263. package/esm/engine/customDictionary.test.js.map +1 -0
  264. package/esm/engine/dialog.d.ts +32 -0
  265. package/esm/engine/dialog.js +51 -0
  266. package/esm/engine/dialog.js.map +1 -0
  267. package/esm/engine/dialog.test.d.ts +1 -0
  268. package/esm/engine/dialog.test.js +17 -0
  269. package/esm/engine/dialog.test.js.map +1 -0
  270. package/esm/engine/importExport.d.ts +20 -0
  271. package/esm/engine/importExport.js +38 -0
  272. package/esm/engine/importExport.js.map +1 -0
  273. package/esm/engine/importExport.test.d.ts +1 -0
  274. package/esm/engine/importExport.test.js +22 -0
  275. package/esm/engine/importExport.test.js.map +1 -0
  276. package/esm/engine/intents.d.ts +38 -0
  277. package/esm/engine/intents.js +48 -0
  278. package/esm/engine/intents.js.map +1 -0
  279. package/esm/engine/intents.test.d.ts +1 -0
  280. package/esm/engine/intents.test.js +11 -0
  281. package/esm/engine/intents.test.js.map +1 -0
  282. package/esm/engine/localizationKeys.d.ts +15 -0
  283. package/esm/engine/localizationKeys.js +26 -0
  284. package/esm/engine/localizationKeys.js.map +1 -0
  285. package/esm/engine/localizationKeys.test.d.ts +1 -0
  286. package/esm/engine/localizationKeys.test.js +11 -0
  287. package/esm/engine/localizationKeys.test.js.map +1 -0
  288. package/esm/engine/media.d.ts +10 -0
  289. package/esm/engine/media.js +28 -0
  290. package/esm/engine/media.js.map +1 -0
  291. package/esm/engine/media.test.d.ts +1 -0
  292. package/esm/engine/media.test.js +11 -0
  293. package/esm/engine/media.test.js.map +1 -0
  294. package/esm/engine/memories.d.ts +20 -0
  295. package/esm/engine/memories.js +34 -0
  296. package/esm/engine/memories.js.map +1 -0
  297. package/esm/engine/memories.test.d.ts +1 -0
  298. package/esm/engine/memories.test.js +11 -0
  299. package/esm/engine/memories.test.js.map +1 -0
  300. package/esm/engine/nlp.d.ts +22 -0
  301. package/esm/engine/nlp.js +32 -0
  302. package/esm/engine/nlp.js.map +1 -0
  303. package/esm/engine/nlp.test.d.ts +1 -0
  304. package/esm/engine/nlp.test.js +11 -0
  305. package/esm/engine/nlp.test.js.map +1 -0
  306. package/esm/engine/people.d.ts +17 -0
  307. package/esm/engine/people.js +26 -0
  308. package/esm/engine/people.js.map +1 -0
  309. package/esm/engine/people.test.d.ts +1 -0
  310. package/esm/engine/people.test.js +11 -0
  311. package/esm/engine/people.test.js.map +1 -0
  312. package/esm/engine/promptedQuestions.d.ts +9 -0
  313. package/esm/engine/promptedQuestions.js +24 -0
  314. package/esm/engine/promptedQuestions.js.map +1 -0
  315. package/esm/engine/promptedQuestions.test.d.ts +1 -0
  316. package/esm/engine/promptedQuestions.test.js +11 -0
  317. package/esm/engine/promptedQuestions.test.js.map +1 -0
  318. package/esm/engine/search.d.ts +9 -0
  319. package/esm/engine/search.js +17 -0
  320. package/esm/engine/search.js.map +1 -0
  321. package/esm/engine/search.test.d.ts +1 -0
  322. package/esm/engine/search.test.js +11 -0
  323. package/esm/engine/search.test.js.map +1 -0
  324. package/esm/engine/session.d.ts +12 -0
  325. package/esm/engine/session.js +17 -0
  326. package/esm/engine/session.js.map +1 -0
  327. package/esm/engine/session.test.d.ts +1 -0
  328. package/esm/engine/session.test.js +11 -0
  329. package/esm/engine/session.test.js.map +1 -0
  330. package/esm/engine/stats.d.ts +27 -0
  331. package/esm/engine/stats.js +28 -0
  332. package/esm/engine/stats.js.map +1 -0
  333. package/esm/engine/stats.test.d.ts +1 -0
  334. package/esm/engine/stats.test.js +11 -0
  335. package/esm/engine/stats.test.js.map +1 -0
  336. package/esm/engine/unansweredQuestions.d.ts +15 -0
  337. package/esm/engine/unansweredQuestions.js +21 -0
  338. package/esm/engine/unansweredQuestions.js.map +1 -0
  339. package/esm/engine/unansweredQuestions.test.d.ts +1 -0
  340. package/esm/engine/unansweredQuestions.test.js +11 -0
  341. package/esm/engine/unansweredQuestions.test.js.map +1 -0
  342. package/esm/engine.d.ts +501 -0
  343. package/esm/engine.js +54 -0
  344. package/esm/engine.js.map +1 -0
  345. package/esm/helpers/asset.d.ts +10 -0
  346. package/esm/helpers/asset.js +27 -0
  347. package/esm/helpers/asset.js.map +1 -0
  348. package/esm/helpers/asset.test.d.ts +1 -0
  349. package/esm/helpers/asset.test.js +65 -0
  350. package/esm/helpers/asset.test.js.map +1 -0
  351. package/esm/helpers/getApiUrl.d.ts +1 -0
  352. package/esm/helpers/getApiUrl.js +5 -0
  353. package/esm/helpers/getApiUrl.js.map +1 -0
  354. package/esm/helpers/getApiUrl.test.d.ts +1 -0
  355. package/esm/helpers/getApiUrl.test.js +13 -0
  356. package/esm/helpers/getApiUrl.test.js.map +1 -0
  357. package/esm/index.d.ts +850 -0
  358. package/esm/index.js +16 -0
  359. package/esm/index.js.map +1 -0
  360. package/esm/types.d.ts +627 -0
  361. package/esm/types.js +2 -0
  362. package/esm/types.js.map +1 -0
  363. package/package.json +112 -46
  364. package/src/backend/asset.test.ts +23 -0
  365. package/src/backend/consumptionLogs.test.ts +25 -0
  366. package/src/backend/integration.test.ts +23 -0
  367. package/src/backend/invitation.test.ts +23 -0
  368. package/src/backend/memori.test.ts +23 -0
  369. package/src/backend/notifications.test.ts +21 -0
  370. package/src/backend/user.test.ts +23 -0
  371. package/src/client.test.ts +48 -0
  372. package/src/constants.test.ts +12 -0
  373. package/src/engine/chatLogs.test.ts +17 -0
  374. package/src/engine/contextVars.test.ts +19 -0
  375. package/src/engine/correlationPairs.test.ts +19 -0
  376. package/src/engine/customDictionary.test.ts +19 -0
  377. package/src/engine/dialog.test.ts +23 -0
  378. package/src/engine/importExport.test.ts +38 -0
  379. package/src/engine/importExport.ts +76 -10
  380. package/src/engine/intents.test.ts +23 -0
  381. package/src/engine/localizationKeys.test.ts +23 -0
  382. package/src/engine/media.test.ts +23 -0
  383. package/src/engine/memories.test.ts +17 -0
  384. package/src/engine/nlp.test.ts +23 -0
  385. package/src/engine/people.test.ts +23 -0
  386. package/src/engine/promptedQuestions.test.ts +23 -0
  387. package/src/engine/search.test.ts +17 -0
  388. package/src/engine/session.test.ts +17 -0
  389. package/src/engine/stats.test.ts +17 -0
  390. package/src/engine/unansweredQuestions.test.ts +21 -0
  391. package/src/helpers/asset.test.ts +116 -0
  392. package/src/helpers/getApiUrl.test.ts +15 -0
  393. package/src/{types.ts → types.d.ts} +85 -23
  394. package/dist/memori-api-client.cjs.development.js +0 -4184
  395. package/dist/memori-api-client.cjs.development.js.map +0 -1
  396. package/dist/memori-api-client.cjs.production.min.js +0 -2
  397. package/dist/memori-api-client.cjs.production.min.js.map +0 -1
  398. package/dist/memori-api-client.esm.js +0 -4178
  399. package/dist/memori-api-client.esm.js.map +0 -1
@@ -1,4178 +0,0 @@
1
- import fetch$1 from 'cross-fetch';
2
-
3
- function _regeneratorRuntime() {
4
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
5
-
6
- _regeneratorRuntime = function () {
7
- return exports;
8
- };
9
-
10
- var exports = {},
11
- Op = Object.prototype,
12
- hasOwn = Op.hasOwnProperty,
13
- $Symbol = "function" == typeof Symbol ? Symbol : {},
14
- iteratorSymbol = $Symbol.iterator || "@@iterator",
15
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
16
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
17
-
18
- function define(obj, key, value) {
19
- return Object.defineProperty(obj, key, {
20
- value: value,
21
- enumerable: !0,
22
- configurable: !0,
23
- writable: !0
24
- }), obj[key];
25
- }
26
-
27
- try {
28
- define({}, "");
29
- } catch (err) {
30
- define = function (obj, key, value) {
31
- return obj[key] = value;
32
- };
33
- }
34
-
35
- function wrap(innerFn, outerFn, self, tryLocsList) {
36
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
37
- generator = Object.create(protoGenerator.prototype),
38
- context = new Context(tryLocsList || []);
39
- return generator._invoke = function (innerFn, self, context) {
40
- var state = "suspendedStart";
41
- return function (method, arg) {
42
- if ("executing" === state) throw new Error("Generator is already running");
43
-
44
- if ("completed" === state) {
45
- if ("throw" === method) throw arg;
46
- return doneResult();
47
- }
48
-
49
- for (context.method = method, context.arg = arg;;) {
50
- var delegate = context.delegate;
51
-
52
- if (delegate) {
53
- var delegateResult = maybeInvokeDelegate(delegate, context);
54
-
55
- if (delegateResult) {
56
- if (delegateResult === ContinueSentinel) continue;
57
- return delegateResult;
58
- }
59
- }
60
-
61
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
62
- if ("suspendedStart" === state) throw state = "completed", context.arg;
63
- context.dispatchException(context.arg);
64
- } else "return" === context.method && context.abrupt("return", context.arg);
65
- state = "executing";
66
- var record = tryCatch(innerFn, self, context);
67
-
68
- if ("normal" === record.type) {
69
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
70
- return {
71
- value: record.arg,
72
- done: context.done
73
- };
74
- }
75
-
76
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
77
- }
78
- };
79
- }(innerFn, self, context), generator;
80
- }
81
-
82
- function tryCatch(fn, obj, arg) {
83
- try {
84
- return {
85
- type: "normal",
86
- arg: fn.call(obj, arg)
87
- };
88
- } catch (err) {
89
- return {
90
- type: "throw",
91
- arg: err
92
- };
93
- }
94
- }
95
-
96
- exports.wrap = wrap;
97
- var ContinueSentinel = {};
98
-
99
- function Generator() {}
100
-
101
- function GeneratorFunction() {}
102
-
103
- function GeneratorFunctionPrototype() {}
104
-
105
- var IteratorPrototype = {};
106
- define(IteratorPrototype, iteratorSymbol, function () {
107
- return this;
108
- });
109
- var getProto = Object.getPrototypeOf,
110
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
111
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
112
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
113
-
114
- function defineIteratorMethods(prototype) {
115
- ["next", "throw", "return"].forEach(function (method) {
116
- define(prototype, method, function (arg) {
117
- return this._invoke(method, arg);
118
- });
119
- });
120
- }
121
-
122
- function AsyncIterator(generator, PromiseImpl) {
123
- function invoke(method, arg, resolve, reject) {
124
- var record = tryCatch(generator[method], generator, arg);
125
-
126
- if ("throw" !== record.type) {
127
- var result = record.arg,
128
- value = result.value;
129
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
130
- invoke("next", value, resolve, reject);
131
- }, function (err) {
132
- invoke("throw", err, resolve, reject);
133
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
134
- result.value = unwrapped, resolve(result);
135
- }, function (error) {
136
- return invoke("throw", error, resolve, reject);
137
- });
138
- }
139
-
140
- reject(record.arg);
141
- }
142
-
143
- var previousPromise;
144
-
145
- this._invoke = function (method, arg) {
146
- function callInvokeWithMethodAndArg() {
147
- return new PromiseImpl(function (resolve, reject) {
148
- invoke(method, arg, resolve, reject);
149
- });
150
- }
151
-
152
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
153
- };
154
- }
155
-
156
- function maybeInvokeDelegate(delegate, context) {
157
- var method = delegate.iterator[context.method];
158
-
159
- if (undefined === method) {
160
- if (context.delegate = null, "throw" === context.method) {
161
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
162
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
163
- }
164
-
165
- return ContinueSentinel;
166
- }
167
-
168
- var record = tryCatch(method, delegate.iterator, context.arg);
169
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
170
- var info = record.arg;
171
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
172
- }
173
-
174
- function pushTryEntry(locs) {
175
- var entry = {
176
- tryLoc: locs[0]
177
- };
178
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
179
- }
180
-
181
- function resetTryEntry(entry) {
182
- var record = entry.completion || {};
183
- record.type = "normal", delete record.arg, entry.completion = record;
184
- }
185
-
186
- function Context(tryLocsList) {
187
- this.tryEntries = [{
188
- tryLoc: "root"
189
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
190
- }
191
-
192
- function values(iterable) {
193
- if (iterable) {
194
- var iteratorMethod = iterable[iteratorSymbol];
195
- if (iteratorMethod) return iteratorMethod.call(iterable);
196
- if ("function" == typeof iterable.next) return iterable;
197
-
198
- if (!isNaN(iterable.length)) {
199
- var i = -1,
200
- next = function next() {
201
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
202
-
203
- return next.value = undefined, next.done = !0, next;
204
- };
205
-
206
- return next.next = next;
207
- }
208
- }
209
-
210
- return {
211
- next: doneResult
212
- };
213
- }
214
-
215
- function doneResult() {
216
- return {
217
- value: undefined,
218
- done: !0
219
- };
220
- }
221
-
222
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
223
- var ctor = "function" == typeof genFun && genFun.constructor;
224
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
225
- }, exports.mark = function (genFun) {
226
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
227
- }, exports.awrap = function (arg) {
228
- return {
229
- __await: arg
230
- };
231
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
232
- return this;
233
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
234
- void 0 === PromiseImpl && (PromiseImpl = Promise);
235
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
236
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
237
- return result.done ? result.value : iter.next();
238
- });
239
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
240
- return this;
241
- }), define(Gp, "toString", function () {
242
- return "[object Generator]";
243
- }), exports.keys = function (object) {
244
- var keys = [];
245
-
246
- for (var key in object) keys.push(key);
247
-
248
- return keys.reverse(), function next() {
249
- for (; keys.length;) {
250
- var key = keys.pop();
251
- if (key in object) return next.value = key, next.done = !1, next;
252
- }
253
-
254
- return next.done = !0, next;
255
- };
256
- }, exports.values = values, Context.prototype = {
257
- constructor: Context,
258
- reset: function (skipTempReset) {
259
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
260
- },
261
- stop: function () {
262
- this.done = !0;
263
- var rootRecord = this.tryEntries[0].completion;
264
- if ("throw" === rootRecord.type) throw rootRecord.arg;
265
- return this.rval;
266
- },
267
- dispatchException: function (exception) {
268
- if (this.done) throw exception;
269
- var context = this;
270
-
271
- function handle(loc, caught) {
272
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
273
- }
274
-
275
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
276
- var entry = this.tryEntries[i],
277
- record = entry.completion;
278
- if ("root" === entry.tryLoc) return handle("end");
279
-
280
- if (entry.tryLoc <= this.prev) {
281
- var hasCatch = hasOwn.call(entry, "catchLoc"),
282
- hasFinally = hasOwn.call(entry, "finallyLoc");
283
-
284
- if (hasCatch && hasFinally) {
285
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
286
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
287
- } else if (hasCatch) {
288
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
289
- } else {
290
- if (!hasFinally) throw new Error("try statement without catch or finally");
291
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
292
- }
293
- }
294
- }
295
- },
296
- abrupt: function (type, arg) {
297
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
298
- var entry = this.tryEntries[i];
299
-
300
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
301
- var finallyEntry = entry;
302
- break;
303
- }
304
- }
305
-
306
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
307
- var record = finallyEntry ? finallyEntry.completion : {};
308
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
309
- },
310
- complete: function (record, afterLoc) {
311
- if ("throw" === record.type) throw record.arg;
312
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
313
- },
314
- finish: function (finallyLoc) {
315
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
316
- var entry = this.tryEntries[i];
317
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
318
- }
319
- },
320
- catch: function (tryLoc) {
321
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
322
- var entry = this.tryEntries[i];
323
-
324
- if (entry.tryLoc === tryLoc) {
325
- var record = entry.completion;
326
-
327
- if ("throw" === record.type) {
328
- var thrown = record.arg;
329
- resetTryEntry(entry);
330
- }
331
-
332
- return thrown;
333
- }
334
- }
335
-
336
- throw new Error("illegal catch attempt");
337
- },
338
- delegateYield: function (iterable, resultName, nextLoc) {
339
- return this.delegate = {
340
- iterator: values(iterable),
341
- resultName: resultName,
342
- nextLoc: nextLoc
343
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
344
- }
345
- }, exports;
346
- }
347
-
348
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
349
- try {
350
- var info = gen[key](arg);
351
- var value = info.value;
352
- } catch (error) {
353
- reject(error);
354
- return;
355
- }
356
-
357
- if (info.done) {
358
- resolve(value);
359
- } else {
360
- Promise.resolve(value).then(_next, _throw);
361
- }
362
- }
363
-
364
- function _asyncToGenerator(fn) {
365
- return function () {
366
- var self = this,
367
- args = arguments;
368
- return new Promise(function (resolve, reject) {
369
- var gen = fn.apply(self, args);
370
-
371
- function _next(value) {
372
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
373
- }
374
-
375
- function _throw(err) {
376
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
377
- }
378
-
379
- _next(undefined);
380
- });
381
- };
382
- }
383
-
384
- function _extends() {
385
- _extends = Object.assign ? Object.assign.bind() : function (target) {
386
- for (var i = 1; i < arguments.length; i++) {
387
- var source = arguments[i];
388
-
389
- for (var key in source) {
390
- if (Object.prototype.hasOwnProperty.call(source, key)) {
391
- target[key] = source[key];
392
- }
393
- }
394
- }
395
-
396
- return target;
397
- };
398
- return _extends.apply(this, arguments);
399
- }
400
-
401
- var getApiUrl = function getApiUrl(hostname) {
402
- return hostname ? new URL(hostname.startsWith('http') ? hostname : "https://" + hostname).origin : 'https://backend.memori.ai';
403
- };
404
-
405
- var apiFetcher = function apiFetcher(path, opts) {
406
- return fetch$1("" + opts.apiUrl + path, _extends({}, opts, {
407
- body: opts != null && opts.body ? JSON.stringify(opts.body) : undefined,
408
- mode: 'cors',
409
- credentials: 'include',
410
- headers: _extends({
411
- // "Access-Control-Allow-Origin": "*",
412
- 'Content-Type': 'application/json'
413
- }, opts == null ? void 0 : opts.headers)
414
- })).then(function (res) {
415
- return opts != null && opts.text ? res.text() : res.json();
416
- });
417
- };
418
-
419
- var memori = (function (apiUrl) {
420
- return {
421
- /**
422
- * Gets a list of all the public Memori objects for a specific Tenant.
423
- * @param tenant - The name of the tenant
424
- * @returns A list of Memori objects
425
- */
426
- getTenantPublicMemoriList: function getTenantPublicMemoriList(tenant) {
427
- return apiFetcher("/TenantPublicMemori/" + encodeURI(tenant), {
428
- apiUrl: apiUrl
429
- });
430
- },
431
-
432
- /**
433
- * Gets a list of all the public Memori objects published on the Metaverse for a specific Tenant.
434
- * @param tenant - The name of the tenant
435
- * @returns A list of Memori objects
436
- */
437
- getTenantMetaverseMemoriList: function getTenantMetaverseMemoriList(tenant) {
438
- return apiFetcher("/TenantMetaverseMemori/" + encodeURI(tenant), {
439
- apiUrl: apiUrl
440
- });
441
- },
442
-
443
- /**
444
- * Gets a list of all the public Memori objects for a specific Tenant accessible from user session.
445
- * @param authToken - The login token
446
- * @returns A list of Memori objects
447
- */
448
- getPublicMemoriList: function getPublicMemoriList(authToken) {
449
- return apiFetcher("/PublicMemori/" + authToken, {
450
- apiUrl: apiUrl
451
- });
452
- },
453
-
454
- /**
455
- * Gets a list of all Memori objects.
456
- * @param authToken - The login token
457
- * @returns A list of Memori objects
458
- */
459
- getAllMemori: function getAllMemori(authToken) {
460
- return apiFetcher("/AllMemori/" + authToken, {
461
- apiUrl: apiUrl
462
- });
463
- },
464
-
465
- /**
466
- * Gets a list of Memori objects owned by the specified user.
467
- * @param {string} tenantName - The name of the tenant
468
- * @param {string} userID - The user name
469
- * @param {string=} authToken - The login token
470
- * @returns A list of Memori objects
471
- */
472
- getUserByIDMemoriList: function getUserByIDMemoriList(tenantName, userID, authToken) {
473
- return apiFetcher("/UserMemoriByID/" + tenantName + "/" + userID + (authToken ? "/" + authToken : ''), {
474
- apiUrl: apiUrl
475
- });
476
- },
477
-
478
- /**
479
- * Gets a list of Memori objects owned by the specified user.
480
- * @param {string} tenantName - The name of the tenant
481
- * @param {string} userName - The user name
482
- * @param {string=} authToken - The login token
483
- * @returns A list of Memori objects
484
- */
485
- getUserMemoriList: function getUserMemoriList(tenantName, userName, authToken) {
486
- return apiFetcher("/UserMemori/" + tenantName + "/" + userName + (authToken ? "/" + authToken : ''), {
487
- apiUrl: apiUrl
488
- });
489
- },
490
-
491
- /**
492
- * Gets a list of Memori objects for the currently logged in User.
493
- * @param authToken - The login token
494
- * @returns A list of Memori objects
495
- */
496
- getMemoriList: function getMemoriList(authToken) {
497
- return apiFetcher("/Memori/" + authToken, {
498
- apiUrl: apiUrl
499
- });
500
- },
501
-
502
- /**
503
- * Gets a list of Memori objects for the currently logged in User.
504
- * @param authToken - The login token
505
- * @returns A list of Memori objects
506
- */
507
- getSharedMemoriList: function getSharedMemoriList(authToken) {
508
- return apiFetcher("/SharedMemori/" + authToken, {
509
- apiUrl: apiUrl
510
- });
511
- },
512
-
513
- /**
514
- * Gets a list of all the known Memori categories (or tags).
515
- * @param {string} tenant - The name of the tenant
516
- * @returns A list of Memori categories
517
- */
518
- getTenantCategories: function getTenantCategories(tenant) {
519
- return apiFetcher("/TenantMemoriCategories/" + encodeURI(tenant), {
520
- apiUrl: apiUrl
521
- });
522
- },
523
-
524
- /**
525
- * Gets a list of all the Memori Configuration objects.
526
- * @param authToken - The login token
527
- * @returns A list of Memori Configuration objects
528
- */
529
- getMemoriConfigs: function getMemoriConfigs(authToken) {
530
- return apiFetcher("/MemoriConfigs/" + authToken, {
531
- apiUrl: apiUrl
532
- });
533
- },
534
-
535
- /**
536
- * Register a new Memori object.
537
- * @param authToken - The login token
538
- * @param memori - The Memori object
539
- * @returns The created Memori object
540
- */
541
- createMemori: function createMemori(authToken, memori) {
542
- return apiFetcher("/Memori/" + authToken, {
543
- apiUrl: apiUrl,
544
- body: memori,
545
- method: 'POST'
546
- });
547
- },
548
-
549
- /**
550
- * Update an existing Memori object.
551
- * @param authToken - The login token
552
- * @param memori - The Memori object
553
- * @returns The created Memori object
554
- */
555
- updateMemori: function updateMemori(authToken, memori) {
556
- return apiFetcher("/Memori/" + authToken + "/" + memori.memoriID, {
557
- apiUrl: apiUrl,
558
- body: memori,
559
- method: 'PATCH'
560
- });
561
- },
562
-
563
- /**
564
- * Deletes an existing Memori object.
565
- * @param authToken - The login token
566
- * @param memori - The Memori object
567
- */
568
- deleteMemori: function deleteMemori(authToken, memori) {
569
- return apiFetcher("/Memori/" + authToken, {
570
- apiUrl: apiUrl,
571
- body: memori,
572
- method: 'DELETE'
573
- });
574
- },
575
-
576
- /**
577
- * Gets the details of a Memori object of the currently logged in User.
578
- * @param authToken - The login token
579
- * @param memoriID - The ID of the Memori object
580
- * @returns A Memori object
581
- */
582
- getMemoriById: function getMemoriById(authToken, memoriID) {
583
- return apiFetcher("/Memori/" + authToken + "/" + memoriID, {
584
- apiUrl: apiUrl
585
- });
586
- },
587
-
588
- /**
589
- * Gets the details of a Memori object of the currently logged in User.
590
- * @param {string} tenantName - The Name of the Tenant
591
- * @param {string} userID - The ID of the User object
592
- * @param {string} memoriID - The ID of the Memori object
593
- * @param {string?} authToken - The login token
594
- * @returns A Memori object
595
- */
596
- getMemoriByUserAndId: function getMemoriByUserAndId(tenantName, userID, memoriID, authToken) {
597
- return apiFetcher("/MemoriById/" + tenantName + "/" + userID + "/" + memoriID + (authToken ? "/" + authToken : ''), {
598
- apiUrl: apiUrl
599
- });
600
- },
601
-
602
- /**
603
- * Gets the details of a Memori object by name, owner and tenant
604
- * @param {string} tenant - The name of the tenant
605
- * @param {string} userName - The name of the user
606
- * @param {string} memoriName - The name of the Memori object
607
- * @param {string=} [authToken=''] - The token of the Memori object
608
- */
609
- getMemori: function getMemori(tenant, userName, memoriName, authToken) {
610
- return apiFetcher("/Memori/" + encodeURI(tenant) + "/" + encodeURI(userName) + "/" + encodeURI(memoriName) + "/" + (authToken != null ? authToken : ''), {
611
- apiUrl: apiUrl
612
- });
613
- },
614
-
615
- /**
616
- * Gets the statistics for sessions opened in a specified interval for the specified Memori object.
617
- * @param {string} authToken - The login token
618
- * @param {string} memoriID - The ID of the Memori object
619
- * @param {string=} dateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
620
- * @param {string=} dateTo - The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
621
- */
622
- getMemoriSessions: function getMemoriSessions(authToken, memoriID, dateFrom, dateTo) {
623
- return apiFetcher("/MemoriSessions/" + authToken + "/" + memoriID + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
624
- apiUrl: apiUrl
625
- });
626
- },
627
-
628
- /**
629
- * Transfers an existing Memori object to another User.
630
- * The new owner must be specified by either a OwnerUserID or a OwnerUserName-OwnerTenantName pair.
631
- * The OwnerUserName may also specify a user e-mail.
632
- * @param {string} authToken - The login token
633
- * @param {Memori} memori - The Memori object
634
- */
635
- transferMemori: function transferMemori(authToken, memori) {
636
- return apiFetcher("/TransferMemori/" + authToken, {
637
- apiUrl: apiUrl,
638
- body: memori,
639
- method: 'POST'
640
- });
641
- },
642
-
643
- /**
644
- * Signals that the content of a Memori object has been updated.
645
- * Consequently, a run of the Content Quality Job will be scheduled as soon as possible.
646
- * @param {string} authToken - The login token
647
- * @param {string} memoriID - The ID of the Memori object
648
- */
649
- memoriContentUpdated: function memoriContentUpdated(authToken, memoriID) {
650
- return apiFetcher("/MemoriContentUpdated/" + authToken + "/" + memoriID, {
651
- apiUrl: apiUrl,
652
- method: 'POST'
653
- });
654
- }
655
- };
656
- });
657
-
658
- var user = (function (apiUrl) {
659
- return {
660
- /**
661
- * Registers a new user.
662
- * @param user - The user object
663
- * @returns The created user object
664
- */
665
- userSignUp: function userSignUp(user) {
666
- return apiFetcher('/User', {
667
- apiUrl: apiUrl,
668
- body: user,
669
- method: 'POST'
670
- });
671
- },
672
-
673
- /**
674
- * Confirms the registration of a User and performs a Login.
675
- * @param user - The user object
676
- * @returns The created user object
677
- */
678
- userConfirmSignUp: function userConfirmSignUp(user) {
679
- return apiFetcher('/UserConfirm', {
680
- apiUrl: apiUrl,
681
- body: user,
682
- method: 'POST'
683
- });
684
- },
685
-
686
- /**
687
- * Tries a login with the specified credentials and returns a login token if successful.
688
- * @param user - The user object
689
- * @returns The logged in user object
690
- */
691
- userLogin: function userLogin(user) {
692
- return apiFetcher('/Login', {
693
- apiUrl: apiUrl,
694
- body: user,
695
- method: 'POST'
696
- });
697
- },
698
-
699
- /**
700
- * Logs out the user.
701
- * @param authToken - The login token
702
- */
703
- userLogout: function userLogout(authToken) {
704
- return apiFetcher("/Logout/" + authToken, {
705
- apiUrl: apiUrl,
706
- method: 'POST'
707
- });
708
- },
709
-
710
- /**
711
- * Gets the details of a User object.
712
- * @param authToken - The login token
713
- * @param userID - The user ID
714
- * @returns The user object
715
- */
716
- getUser: function getUser(authToken, userID) {
717
- return apiFetcher("/User/" + authToken + "/" + userID, {
718
- apiUrl: apiUrl
719
- });
720
- },
721
-
722
- /**
723
- * Gets a list of all the existing User objects.
724
- * @param authToken - The login token
725
- * @returns A list of User objects
726
- */
727
- getUsersList: function getUsersList(authToken) {
728
- return apiFetcher("/Users/" + authToken, {
729
- apiUrl: apiUrl
730
- });
731
- },
732
-
733
- /**
734
- * Deletes the currently logged in User.
735
- * @param {string} authToken - The login token
736
- * @param {string} userID: The User ID
737
- */
738
- deleteUser: function deleteUser(authToken, userID) {
739
- return apiFetcher("/User/" + authToken + "/" + userID, {
740
- apiUrl: apiUrl,
741
- method: 'DELETE'
742
- });
743
- },
744
-
745
- /**
746
- * Updates the details of a User object.
747
- * @param authToken - The login token
748
- * @param userID - The user ID
749
- * @returns The user object
750
- */
751
- updateUser: function updateUser(authToken, userID, user) {
752
- return apiFetcher("/User/" + authToken + "/" + userID, {
753
- apiUrl: apiUrl,
754
- method: 'PATCH',
755
- body: user
756
- });
757
- },
758
-
759
- /**
760
- * Resets a User's password.
761
- * If found, the User receives a verification code via e-mail.
762
- * The code must be sent via the ResetConfirm API, passing the same User object
763
- * sent to this API with the addition of the verification code and the new password.
764
- * @param {User} user - The user object
765
- */
766
- resetPassword: function resetPassword(user) {
767
- return apiFetcher("/ResetPassword", {
768
- apiUrl: apiUrl,
769
- body: user,
770
- method: 'POST'
771
- });
772
- },
773
-
774
- /**
775
- * Confirms the password reset of a User and performs a Login
776
- * @param {User} user - The user object
777
- */
778
- resetConfirm: function resetConfirm(user) {
779
- return apiFetcher("/ResetConfirm", {
780
- apiUrl: apiUrl,
781
- body: user,
782
- method: 'POST'
783
- });
784
- },
785
-
786
- /**
787
- * Recovers a User's name and sends it to their configured e-mail.
788
- * @param {User} user - The user object
789
- */
790
- recoverUsername: function recoverUsername(user) {
791
- return apiFetcher("/RecoverUsername", {
792
- apiUrl: apiUrl,
793
- body: user,
794
- method: 'POST'
795
- });
796
- },
797
-
798
- /**
799
- * Gets the details of a Tenant object.
800
- * @param tenantName - The name of the tenant
801
- */
802
- getTenantConfig: function getTenantConfig(tenantName) {
803
- return apiFetcher("/Tenant/" + tenantName, {
804
- apiUrl: apiUrl
805
- });
806
- },
807
-
808
- /**
809
- * Re-sends the verification code to confirm a pending User registration.
810
- * @param {User} user - The user object
811
- */
812
- resendVerificationCode: function resendVerificationCode(user) {
813
- return apiFetcher("/ResendVerificationCode", {
814
- apiUrl: apiUrl,
815
- body: user,
816
- method: 'POST'
817
- });
818
- },
819
-
820
- /**
821
- * Registers a new user.
822
- * @param {User} user - The user object
823
- */
824
- createUser: function createUser(authToken, user) {
825
- return apiFetcher("/User/" + authToken, {
826
- apiUrl: apiUrl,
827
- body: user,
828
- method: 'POST'
829
- });
830
- }
831
- };
832
- });
833
-
834
- var integration = (function (apiUrl) {
835
- return {
836
- /**
837
- * Gets a list of integration objects for a specified Memori object.
838
- * @param memoriID - The id of the Memori object
839
- * @param authToken - The login token
840
- * @returns A list of Integration objects
841
- */
842
- getMemoriIntegrationsList: function getMemoriIntegrationsList(authToken, memoriID) {
843
- return apiFetcher("/Integrations/" + authToken + "/" + memoriID, {
844
- apiUrl: apiUrl
845
- });
846
- },
847
-
848
- /**
849
- * Gets a list of integration objects.
850
- * @param authToken - The login token
851
- * @returns A list of Integration objects
852
- */
853
- getAllIntegrationsList: function getAllIntegrationsList(authToken) {
854
- return apiFetcher("/AllIntegrations/" + authToken, {
855
- apiUrl: apiUrl
856
- });
857
- },
858
-
859
- /**
860
- * Gets the detail of an integration object of the currently logged in User.
861
- * @param authToken - The login token
862
- * @param integrationID - The ID of the integration object
863
- * @returns The Integration object
864
- */
865
- getIntegration: function getIntegration(authToken, integrationID) {
866
- return apiFetcher("/Integration/" + authToken + "/" + integrationID, {
867
- apiUrl: apiUrl
868
- });
869
- },
870
-
871
- /**
872
- * Delete an exsisting integration object.
873
- * @param authToken - The login token
874
- * @param integrationID - The ID of the integration object
875
- */
876
- deleteIntegration: function deleteIntegration(authToken, integrationID) {
877
- return apiFetcher("/Integration/" + authToken + "/" + integrationID, {
878
- apiUrl: apiUrl,
879
- method: 'DELETE'
880
- });
881
- },
882
-
883
- /**
884
- * Register a new integration object.
885
- * @param authToken - The login token
886
- * @param integration - The Integration object
887
- * @returns The Integration object
888
- */
889
- createIntegration: function createIntegration(authToken, integration) {
890
- return apiFetcher("/Integration/" + authToken, {
891
- apiUrl: apiUrl,
892
- method: 'POST',
893
- body: integration
894
- });
895
- },
896
-
897
- /**
898
- * Updates the integration object.
899
- * @param authToken - The login token
900
- * @param integrationID - The id of the Integration object
901
- * @param integration - The Integration object
902
- * @returns The Integration object
903
- */
904
- updateIntegration: function updateIntegration(authToken, integrationID, integration) {
905
- return apiFetcher("/Integration/" + authToken + "/" + integrationID, {
906
- apiUrl: apiUrl,
907
- method: 'PATCH',
908
- body: integration
909
- });
910
- }
911
- };
912
- });
913
-
914
- var asset = (function (apiUrl) {
915
- return {
916
- /**
917
- * URL to upload a file creating a new Asset object to access it.
918
- * @param {string} authToken - The login token
919
- * @param {string} memoriID - The memori ID
920
- * @param {string=} memoryID - The memory ID
921
- * @returns The URL to upload a file
922
- */
923
- getUploadAssetURL: function getUploadAssetURL(authToken, memoriID, memoryID) {
924
- return apiUrl + "/Asset/" + authToken + "/" + memoriID + (memoryID ? "/" + memoryID : '');
925
- },
926
-
927
- /**
928
- * Uploads a file and creates a new Asset object to access it.
929
- * @param {string} authToken - The login token
930
- * @param {string} memoriID - The memori ID
931
- * @param {string=} memoryID - The memory ID
932
- * @returns Response of an Upload Asset request.
933
- */
934
- uploadAsset: function () {
935
- var _uploadAsset = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fileName, fileUrl, authToken, memoriID, memoryID) {
936
- var data, file, fileBlob, upload;
937
- return _regeneratorRuntime().wrap(function _callee$(_context) {
938
- while (1) {
939
- switch (_context.prev = _context.next) {
940
- case 0:
941
- data = new FormData();
942
- _context.next = 3;
943
- return fetch(fileUrl);
944
-
945
- case 3:
946
- file = _context.sent;
947
- _context.next = 6;
948
- return file.blob();
949
-
950
- case 6:
951
- fileBlob = _context.sent;
952
- data.append(fileName, fileBlob, fileName);
953
- _context.next = 10;
954
- return fetch(apiUrl + "/Asset/" + authToken + "/" + memoriID + (memoryID ? "/" + memoryID : ''), {
955
- method: 'POST',
956
- body: data
957
- });
958
-
959
- case 10:
960
- upload = _context.sent;
961
- _context.next = 13;
962
- return upload.json();
963
-
964
- case 13:
965
- return _context.abrupt("return", _context.sent);
966
-
967
- case 14:
968
- case "end":
969
- return _context.stop();
970
- }
971
- }
972
- }, _callee);
973
- }));
974
-
975
- function uploadAsset(_x, _x2, _x3, _x4, _x5) {
976
- return _uploadAsset.apply(this, arguments);
977
- }
978
-
979
- return uploadAsset;
980
- }(),
981
-
982
- /**
983
- * Downloads a file from an Asset object
984
- * @param {string} fileName - The file name
985
- * @param {string} sessionID - The session ID
986
- * @returns The asset file
987
- */
988
- getAsset: function getAsset(fileName, sessionID) {
989
- return apiFetcher("/Asset/" + fileName + "/" + sessionID, {
990
- apiUrl: apiUrl,
991
- method: 'GET'
992
- });
993
- },
994
-
995
- /**
996
- * Updates an Asset object
997
- * @param {string} authToken - The login token
998
- * @param {string} assetURL - The asset URL
999
- * @returns The updated asset object
1000
- */
1001
- updateAsset: function updateAsset(authToken, assetURL, asset) {
1002
- return apiFetcher("/Asset/" + authToken + "/" + assetURL.split('/').reverse()[0], {
1003
- apiUrl: apiUrl,
1004
- method: 'PATCH',
1005
- body: asset
1006
- });
1007
- },
1008
-
1009
- /**
1010
- * Deletes an Asset object
1011
- * @param {string} authToken - The login token
1012
- * @param {string} assetURL - The asset URL
1013
- */
1014
- deleteAsset: function deleteAsset(authToken, assetURL) {
1015
- return apiFetcher("/Asset/" + authToken + "/" + assetURL.split('/').reverse()[0], {
1016
- apiUrl: apiUrl,
1017
- method: 'DELETE'
1018
- });
1019
- }
1020
- };
1021
- });
1022
-
1023
- var invitation = (function (apiUrl) {
1024
- return {
1025
- /**
1026
- * Gets a list of invitations sent by the currently logged in User.
1027
- * @param {string} authToken - The login token
1028
- * @returns The list of Invitation objects.
1029
- */
1030
- getSentInvitations: function getSentInvitations(authToken) {
1031
- return apiFetcher("/SentInvitations/" + authToken, {
1032
- apiUrl: apiUrl
1033
- });
1034
- },
1035
-
1036
- /**
1037
- * Gets a list of invitations sent for the specified Memori object
1038
- * @param {string} authToken - The login token
1039
- * @param {string} memoriId - The ID of the Memori object
1040
- * @returns The list of Invitation objects.
1041
- */
1042
- getMemoriInvitations: function getMemoriInvitations(authToken, memoriId) {
1043
- return apiFetcher("/MemoriInvitations/" + authToken + "/" + memoriId, {
1044
- apiUrl: apiUrl
1045
- });
1046
- },
1047
-
1048
- /**
1049
- * Gets a list of invitations received by the currently logged in User.
1050
- * @param {string} authToken - The login token
1051
- * @returns The list of Invitation objects.
1052
- */
1053
- getReceivedInvitations: function getReceivedInvitations(authToken) {
1054
- return apiFetcher("/ReceivedInvitations/" + authToken, {
1055
- apiUrl: apiUrl
1056
- });
1057
- },
1058
-
1059
- /**
1060
- * Gets a list of all invitation objects
1061
- * @param {string} authToken - The login token
1062
- * @returns The list of Invitation objects.
1063
- */
1064
- getAllInvitations: function getAllInvitations(authToken) {
1065
- return apiFetcher("/AllInvitations/" + authToken, {
1066
- apiUrl: apiUrl
1067
- });
1068
- },
1069
-
1070
- /**
1071
- * Gets the details of an Invitation object of the currently logged in User.
1072
- * @param {string} authToken - The login token
1073
- * @param {string} invitationId - The ID of the Invitation object
1074
- * @returns The Invitation object.
1075
- */
1076
- getInvitation: function getInvitation(authToken, invitationId) {
1077
- return apiFetcher("/Invitation/" + authToken + "/" + invitationId, {
1078
- apiUrl: apiUrl
1079
- });
1080
- },
1081
-
1082
- /**
1083
- * Updates an existing Invitation object sent by the currently logged in User.
1084
- * @param {string} authToken - The login token
1085
- * @param {Invitation} invitation - The Invitation object
1086
- * @returns The Invitation object.
1087
- */
1088
- updateInvitation: function updateInvitation(authToken, invitation) {
1089
- return apiFetcher("/Invitation/" + authToken + "/" + invitation.invitationID, {
1090
- apiUrl: apiUrl,
1091
- method: 'PATCH',
1092
- body: invitation
1093
- });
1094
- },
1095
-
1096
- /**
1097
- * Deletes an existing Invitation object.
1098
- * @param {string} authToken - The login token
1099
- * @param {string} invitationId - The ID of the Invitation object
1100
- * @returns The Invitation object.
1101
- */
1102
- deleteInvitation: function deleteInvitation(authToken, invitationId) {
1103
- return apiFetcher("/Invitation/" + authToken + "/" + invitationId, {
1104
- apiUrl: apiUrl,
1105
- method: 'DELETE'
1106
- });
1107
- },
1108
-
1109
- /**
1110
- * Accepts an Invitation object.
1111
- * @param {string} authToken - The login token
1112
- * @param {string} invitationId - The ID of the Invitation object
1113
- * @returns The Invitation object.
1114
- */
1115
- acceptInvitation: function acceptInvitation(authToken, invitationId) {
1116
- return apiFetcher("/AcceptInvitation/" + authToken + "/" + invitationId, {
1117
- apiUrl: apiUrl,
1118
- method: 'POST'
1119
- });
1120
- },
1121
-
1122
- /**
1123
- * Rejects an Invitation object.
1124
- * @param {string} authToken - The login token
1125
- * @param {string} invitationId - The ID of the Invitation object
1126
- * @returns The Invitation object.
1127
- */
1128
- rejectInvitation: function rejectInvitation(authToken, invitationId) {
1129
- return apiFetcher("/RejectInvitation/" + authToken + "/" + invitationId, {
1130
- apiUrl: apiUrl,
1131
- method: 'POST'
1132
- });
1133
- },
1134
-
1135
- /**
1136
- * Send a new Invitation object
1137
- * @param {string} authToken - The login token
1138
- * @param {Invitation} invitation - The Invitation object
1139
- * @returns The Invitation object.
1140
- */
1141
- sendInvitation: function sendInvitation(authToken, invitation) {
1142
- return apiFetcher("/SendInvitation/" + authToken, {
1143
- apiUrl: apiUrl,
1144
- method: 'POST',
1145
- body: invitation
1146
- });
1147
- }
1148
- };
1149
- });
1150
-
1151
- var consumptionLogs = (function (apiUrl) {
1152
- return {
1153
- /**
1154
- * Gets the Consumption Log objects for a specific Tenant in a specific date interval.
1155
- * @param {string} authToken - The login token
1156
- * @param {string} tenantID - The name of the tenant
1157
- * @param {string} type - Type of consumption (i.e. granularity), it may either be Daily or Monthly
1158
- * @param {string=} dateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMdd
1159
- * @param {string=} dateTo - The optional end of the date interval, in UTC time, in the format yyyyMMdd
1160
- * @returns The list of Consumption Logs objects.
1161
- */
1162
- getTenantConsumptionLogs: function getTenantConsumptionLogs(authToken, tenantID, type, dateFrom, dateTo) {
1163
- return apiFetcher("/TenantConsumptionLogs/" + authToken + "/" + tenantID + "/" + type + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
1164
- apiUrl: apiUrl
1165
- });
1166
- },
1167
-
1168
- /**
1169
- * Gets the Consumption Log objects for a specific User in a specific date interval.
1170
- * @param {string} authToken - The login token
1171
- * @param {string} userID - The ID of the User object
1172
- * @param {string} type - Type of consumption (i.e. granularity), it may either be Daily or Monthly
1173
- * @param {string=} dateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMdd
1174
- * @param {string=} dateTo - The optional end of the date interval, in UTC time, in the format yyyyMMdd
1175
- * @returns The list of Consumption Logs objects.
1176
- */
1177
- getUserConsumptionLogs: function getUserConsumptionLogs(authToken, userID, type, dateFrom, dateTo) {
1178
- return apiFetcher("/UserConsumptionLogs/" + authToken + "/" + userID + "/" + type + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
1179
- apiUrl: apiUrl
1180
- });
1181
- },
1182
-
1183
- /**
1184
- * Gets the Consumption Log objects for a specific Memori in a specific date interval.
1185
- * @param {string} authToken - The login token
1186
- * @param {string} memoriID - The ID of the Memori object
1187
- * @param {string} type - Type of consumption (i.e. granularity), it may either be Daily or Monthly
1188
- * @param {string=} dateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMdd
1189
- * @param {string=} dateTo - The optional end of the date interval, in UTC time, in the format yyyyMMdd
1190
- * @returns The list of Consumption Logs objects.
1191
- */
1192
- getMemoriConsumptionLogs: function getMemoriConsumptionLogs(authToken, memoriID, type, dateFrom, dateTo) {
1193
- return apiFetcher("/MemoriConsumptionLogs/" + authToken + "/" + memoriID + "/" + type + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
1194
- apiUrl: apiUrl
1195
- });
1196
- }
1197
- };
1198
- });
1199
-
1200
- var notifications = (function (apiUrl) {
1201
- return {
1202
- /**
1203
- * Gets the Notification objects available for a specific Tenant.
1204
- * @param {string} tenantID - The name of the tenant
1205
- * @returns The list of Notification objects.
1206
- */
1207
- getTenantNotifications: function getTenantNotifications(tenantID) {
1208
- return apiFetcher("/TenantNotifications/" + tenantID, {
1209
- apiUrl: apiUrl
1210
- });
1211
- },
1212
-
1213
- /**
1214
- * Gets the Notification objects available for a specific User.
1215
- * @param {string} authToken - The login token
1216
- * @returns The list of Notification objects.
1217
- */
1218
- getUserNotifications: function getUserNotifications(authToken) {
1219
- return apiFetcher("/UserNotifications/" + authToken, {
1220
- apiUrl: apiUrl
1221
- });
1222
- }
1223
- };
1224
- });
1225
-
1226
- var backendAPI = function backendAPI(apiUrl) {
1227
- return _extends({
1228
- asset: asset(apiUrl),
1229
- memori: memori(apiUrl),
1230
- user: user(apiUrl),
1231
- integration: integration(apiUrl),
1232
- invitation: invitation(apiUrl),
1233
- consumptionLogs: consumptionLogs(apiUrl),
1234
- notifications: notifications(apiUrl)
1235
- }, asset(apiUrl), memori(apiUrl), user(apiUrl), integration(apiUrl), invitation(apiUrl), consumptionLogs(apiUrl), notifications(apiUrl));
1236
- };
1237
-
1238
- /****************************
1239
- * *
1240
- * CorrelationPairs *
1241
- * *
1242
- ****************************/
1243
-
1244
- var correlationPairs = (function (apiUrl) {
1245
- return {
1246
- /**
1247
- * Lists all Correlation Pair objects.
1248
- * @param {string} sessionId The session ID
1249
- * @param {number=} from The starting index
1250
- * @param {number=} howMany The number of items to return
1251
- */
1252
- getCorrelationPairs: function () {
1253
- var _getCorrelationPairs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, from, howMany) {
1254
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1255
- while (1) {
1256
- switch (_context.prev = _context.next) {
1257
- case 0:
1258
- return _context.abrupt("return", apiFetcher("/CorrelationPairs/" + sessionId + (from ? "/" + from + (howMany ? "/" + howMany : '') : ''), {
1259
- method: 'GET',
1260
- apiUrl: apiUrl
1261
- }));
1262
-
1263
- case 1:
1264
- case "end":
1265
- return _context.stop();
1266
- }
1267
- }
1268
- }, _callee);
1269
- }));
1270
-
1271
- function getCorrelationPairs(_x, _x2, _x3) {
1272
- return _getCorrelationPairs.apply(this, arguments);
1273
- }
1274
-
1275
- return getCorrelationPairs;
1276
- }(),
1277
-
1278
- /**
1279
- * Adds a new Correlation Pair object.
1280
- * @param {string} sessionId The session ID
1281
- * @param {CorrelationPair} correlationPair The Correlation Pair object
1282
- */
1283
- postCorrelationPair: function () {
1284
- var _postCorrelationPair = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, correlationPair) {
1285
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1286
- while (1) {
1287
- switch (_context2.prev = _context2.next) {
1288
- case 0:
1289
- return _context2.abrupt("return", apiFetcher("/CorrelationPair/" + sessionId, {
1290
- method: 'POST',
1291
- apiUrl: apiUrl,
1292
- body: correlationPair
1293
- }));
1294
-
1295
- case 1:
1296
- case "end":
1297
- return _context2.stop();
1298
- }
1299
- }
1300
- }, _callee2);
1301
- }));
1302
-
1303
- function postCorrelationPair(_x4, _x5) {
1304
- return _postCorrelationPair.apply(this, arguments);
1305
- }
1306
-
1307
- return postCorrelationPair;
1308
- }(),
1309
-
1310
- /**
1311
- * Removes an existing Correlation Pair object.
1312
- * @param {string} sessionId The session ID
1313
- * @param {string} pairId The Correlation Pair object ID
1314
- */
1315
- deleteCorrelationPair: function () {
1316
- var _deleteCorrelationPair = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, pairId) {
1317
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1318
- while (1) {
1319
- switch (_context3.prev = _context3.next) {
1320
- case 0:
1321
- return _context3.abrupt("return", apiFetcher("/CorrelationPair/" + sessionId + "/" + pairId, {
1322
- method: 'DELETE',
1323
- apiUrl: apiUrl
1324
- }));
1325
-
1326
- case 1:
1327
- case "end":
1328
- return _context3.stop();
1329
- }
1330
- }
1331
- }, _callee3);
1332
- }));
1333
-
1334
- function deleteCorrelationPair(_x6, _x7) {
1335
- return _deleteCorrelationPair.apply(this, arguments);
1336
- }
1337
-
1338
- return deleteCorrelationPair;
1339
- }()
1340
- };
1341
- });
1342
-
1343
- /******************
1344
- * *
1345
- * Dialog *
1346
- * *
1347
- ******************/
1348
-
1349
- var dialog = (function (apiUrl) {
1350
- return {
1351
- /**
1352
- * Submits a Text Entered event to the session's Dialog State Machine.
1353
- * @param {object} params
1354
- * @param {string} params.sessionId The session ID
1355
- * @param {string} params.text The text entered by the user
1356
- */
1357
- postTextEnteredEvent: function () {
1358
- var _postTextEnteredEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
1359
- var sessionId, text;
1360
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1361
- while (1) {
1362
- switch (_context.prev = _context.next) {
1363
- case 0:
1364
- sessionId = _ref.sessionId, text = _ref.text;
1365
- return _context.abrupt("return", apiFetcher("/TextEnteredEvent/" + sessionId, {
1366
- method: 'POST',
1367
- apiUrl: apiUrl,
1368
- body: {
1369
- text: text
1370
- }
1371
- }));
1372
-
1373
- case 2:
1374
- case "end":
1375
- return _context.stop();
1376
- }
1377
- }
1378
- }, _callee);
1379
- }));
1380
-
1381
- function postTextEnteredEvent(_x) {
1382
- return _postTextEnteredEvent.apply(this, arguments);
1383
- }
1384
-
1385
- return postTextEnteredEvent;
1386
- }(),
1387
-
1388
- /**
1389
- * Submits a Place Changed event to the session's Dialog State Machine.
1390
- * @param {object} params
1391
- * @param {string} params.sessionId - The session ID
1392
- * @param {string} params.placeName - The name of the place
1393
- * @param {number} params.latitude - The latitude of the place
1394
- * @param {number} params.longitude - The longitude of the place
1395
- * @param {number} params.uncertaintyKm - The uncertainty of the place in kilometers
1396
- */
1397
- postPlaceChangedEvent: function () {
1398
- var _postPlaceChangedEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
1399
- var sessionId, placeName, latitude, longitude, uncertaintyKm;
1400
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1401
- while (1) {
1402
- switch (_context2.prev = _context2.next) {
1403
- case 0:
1404
- sessionId = _ref2.sessionId, placeName = _ref2.placeName, latitude = _ref2.latitude, longitude = _ref2.longitude, uncertaintyKm = _ref2.uncertaintyKm;
1405
- return _context2.abrupt("return", apiFetcher("/PlaceChangedEvent/" + sessionId, {
1406
- method: 'POST',
1407
- apiUrl: apiUrl,
1408
- body: {
1409
- placeName: placeName,
1410
- latitude: latitude,
1411
- longitude: longitude,
1412
- uncertaintyKm: uncertaintyKm
1413
- }
1414
- }));
1415
-
1416
- case 2:
1417
- case "end":
1418
- return _context2.stop();
1419
- }
1420
- }
1421
- }, _callee2);
1422
- }));
1423
-
1424
- function postPlaceChangedEvent(_x2) {
1425
- return _postPlaceChangedEvent.apply(this, arguments);
1426
- }
1427
-
1428
- return postPlaceChangedEvent;
1429
- }(),
1430
-
1431
- /**
1432
- * Submits a Date Changed event to the session's Dialog State Machine.
1433
- * @param {string} sessionId The session ID
1434
- */
1435
- postDateChangedEvent: function () {
1436
- var _postDateChangedEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId) {
1437
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1438
- while (1) {
1439
- switch (_context3.prev = _context3.next) {
1440
- case 0:
1441
- return _context3.abrupt("return", apiFetcher("/DateChangedEvent/" + sessionId, {
1442
- method: 'POST',
1443
- apiUrl: apiUrl
1444
- }));
1445
-
1446
- case 1:
1447
- case "end":
1448
- return _context3.stop();
1449
- }
1450
- }
1451
- }, _callee3);
1452
- }));
1453
-
1454
- function postDateChangedEvent(_x3) {
1455
- return _postDateChangedEvent.apply(this, arguments);
1456
- }
1457
-
1458
- return postDateChangedEvent;
1459
- }(),
1460
-
1461
- /**
1462
- * Submits a Tag Changed event to the session's Dialog State Machine.
1463
- * @param {string} sessionId The session ID
1464
- * @param {string} tag The tag to set
1465
- */
1466
- postTagChangedEvent: function () {
1467
- var _postTagChangedEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, tag) {
1468
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1469
- while (1) {
1470
- switch (_context4.prev = _context4.next) {
1471
- case 0:
1472
- return _context4.abrupt("return", apiFetcher("/TagChangedEvent/" + sessionId, {
1473
- method: 'POST',
1474
- apiUrl: apiUrl,
1475
- body: {
1476
- tag: tag
1477
- }
1478
- }));
1479
-
1480
- case 1:
1481
- case "end":
1482
- return _context4.stop();
1483
- }
1484
- }
1485
- }, _callee4);
1486
- }));
1487
-
1488
- function postTagChangedEvent(_x4, _x5) {
1489
- return _postTagChangedEvent.apply(this, arguments);
1490
- }
1491
-
1492
- return postTagChangedEvent;
1493
- }(),
1494
-
1495
- /**
1496
- * Submits a Timeout event to the session's Dialog State Machine.
1497
- * @param {string} sessionId The session ID
1498
- */
1499
- postTimeoutEvent: function () {
1500
- var _postTimeoutEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId) {
1501
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1502
- while (1) {
1503
- switch (_context5.prev = _context5.next) {
1504
- case 0:
1505
- return _context5.abrupt("return", apiFetcher("/TimeoutEvent/" + sessionId, {
1506
- method: 'POST',
1507
- apiUrl: apiUrl
1508
- }));
1509
-
1510
- case 1:
1511
- case "end":
1512
- return _context5.stop();
1513
- }
1514
- }
1515
- }, _callee5);
1516
- }));
1517
-
1518
- function postTimeoutEvent(_x6) {
1519
- return _postTimeoutEvent.apply(this, arguments);
1520
- }
1521
-
1522
- return postTimeoutEvent;
1523
- }(),
1524
-
1525
- /**
1526
- * Submits a Medium Selected event to the session's Dialog State Machine.
1527
- * @param {string} sessionId The session ID
1528
- * @param {Medium} medium The medium to set
1529
- */
1530
- postMediumSelectedEvent: function () {
1531
- var _postMediumSelectedEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId, medium) {
1532
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1533
- while (1) {
1534
- switch (_context6.prev = _context6.next) {
1535
- case 0:
1536
- return _context6.abrupt("return", apiFetcher("/MediumSelectedEvent/" + sessionId, {
1537
- method: 'POST',
1538
- apiUrl: apiUrl,
1539
- body: {
1540
- medium: medium
1541
- }
1542
- }));
1543
-
1544
- case 1:
1545
- case "end":
1546
- return _context6.stop();
1547
- }
1548
- }
1549
- }, _callee6);
1550
- }));
1551
-
1552
- function postMediumSelectedEvent(_x7, _x8) {
1553
- return _postMediumSelectedEvent.apply(this, arguments);
1554
- }
1555
-
1556
- return postMediumSelectedEvent;
1557
- }(),
1558
-
1559
- /**
1560
- * Submits a Date Selected event to the session's Dialog State Machine.
1561
- * @param {string} sessionId The session ID
1562
- */
1563
- postDateSelectedEvent: function () {
1564
- var _postDateSelectedEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(sessionId) {
1565
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1566
- while (1) {
1567
- switch (_context7.prev = _context7.next) {
1568
- case 0:
1569
- return _context7.abrupt("return", apiFetcher("/DateSelectedEvent/" + sessionId, {
1570
- method: 'GET',
1571
- apiUrl: apiUrl
1572
- }));
1573
-
1574
- case 1:
1575
- case "end":
1576
- return _context7.stop();
1577
- }
1578
- }
1579
- }, _callee7);
1580
- }));
1581
-
1582
- function postDateSelectedEvent(_x9) {
1583
- return _postDateSelectedEvent.apply(this, arguments);
1584
- }
1585
-
1586
- return postDateSelectedEvent;
1587
- }(),
1588
-
1589
- /**
1590
- * Submits a Place Selected event to the session's Dialog State Machine.
1591
- * @param {string} sessionId The session ID
1592
- */
1593
- postPlaceSelectedEvent: function () {
1594
- var _postPlaceSelectedEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(sessionId) {
1595
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1596
- while (1) {
1597
- switch (_context8.prev = _context8.next) {
1598
- case 0:
1599
- return _context8.abrupt("return", apiFetcher("/PlaceSelectedEvent/" + sessionId, {
1600
- method: 'GET',
1601
- apiUrl: apiUrl
1602
- }));
1603
-
1604
- case 1:
1605
- case "end":
1606
- return _context8.stop();
1607
- }
1608
- }
1609
- }, _callee8);
1610
- }));
1611
-
1612
- function postPlaceSelectedEvent(_x10) {
1613
- return _postPlaceSelectedEvent.apply(this, arguments);
1614
- }
1615
-
1616
- return postPlaceSelectedEvent;
1617
- }(),
1618
-
1619
- /**
1620
- * Submits a Tag Selected event to the session's Dialog State Machine.
1621
- * @param {string} sessionId The session ID
1622
- */
1623
- postTagSelectedEvent: function () {
1624
- var _postTagSelectedEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(sessionId) {
1625
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1626
- while (1) {
1627
- switch (_context9.prev = _context9.next) {
1628
- case 0:
1629
- return _context9.abrupt("return", apiFetcher("/TagSelectedEvent/" + sessionId, {
1630
- method: 'GET',
1631
- apiUrl: apiUrl
1632
- }));
1633
-
1634
- case 1:
1635
- case "end":
1636
- return _context9.stop();
1637
- }
1638
- }
1639
- }, _callee9);
1640
- }));
1641
-
1642
- function postTagSelectedEvent(_x11) {
1643
- return _postTagSelectedEvent.apply(this, arguments);
1644
- }
1645
-
1646
- return postTagSelectedEvent;
1647
- }()
1648
- };
1649
- });
1650
-
1651
- /************************
1652
- * *
1653
- * ImportExport *
1654
- * *
1655
- ************************/
1656
-
1657
- var importExport = (function (apiUrl) {
1658
- return {
1659
- /**
1660
- * Imports memories from a CSV file.
1661
- * @param {string} sessionId The session ID
1662
- * @param {string[]} csvRows Rows of the CSV file.
1663
- * @param {ImportCSVParams} params The specifications and content of the CSV file
1664
- */
1665
- importCSV: function () {
1666
- var _importCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, csvRows, params) {
1667
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1668
- while (1) {
1669
- switch (_context.prev = _context.next) {
1670
- case 0:
1671
- return _context.abrupt("return", apiFetcher("/ImportExport/ImportCSV/" + sessionId, {
1672
- method: 'POST',
1673
- apiUrl: apiUrl,
1674
- body: _extends({
1675
- csvRows: csvRows
1676
- }, params)
1677
- }));
1678
-
1679
- case 1:
1680
- case "end":
1681
- return _context.stop();
1682
- }
1683
- }
1684
- }, _callee);
1685
- }));
1686
-
1687
- function importCSV(_x, _x2, _x3) {
1688
- return _importCSV.apply(this, arguments);
1689
- }
1690
-
1691
- return importCSV;
1692
- }(),
1693
-
1694
- /**
1695
- * Exports memories to a CSV file.
1696
- * @param {string} sessionID The session ID
1697
- * @param {ExportCSVParams} params - The specifications of the CSV file
1698
- * @returns The CSV file content
1699
- */
1700
- exportCSV: function () {
1701
- var _exportCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionID, params) {
1702
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1703
- while (1) {
1704
- switch (_context2.prev = _context2.next) {
1705
- case 0:
1706
- return _context2.abrupt("return", apiFetcher("/ImportExport/ExportCSV/" + sessionID, {
1707
- method: 'POST',
1708
- apiUrl: apiUrl,
1709
- body: params,
1710
- text: true
1711
- }));
1712
-
1713
- case 1:
1714
- case "end":
1715
- return _context2.stop();
1716
- }
1717
- }
1718
- }, _callee2);
1719
- }));
1720
-
1721
- function exportCSV(_x4, _x5) {
1722
- return _exportCSV.apply(this, arguments);
1723
- }
1724
-
1725
- return exportCSV;
1726
- }()
1727
- };
1728
- });
1729
-
1730
- /*******************
1731
- * *
1732
- * Intents *
1733
- * *
1734
- *******************/
1735
-
1736
- var intents = (function (apiUrl) {
1737
- return {
1738
- /**
1739
- * Lists all Intent objects.
1740
- * @param {string} sessionId The session ID
1741
- */
1742
- getIntents: function () {
1743
- var _getIntents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
1744
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1745
- while (1) {
1746
- switch (_context.prev = _context.next) {
1747
- case 0:
1748
- return _context.abrupt("return", apiFetcher("/Intents/" + sessionId, {
1749
- method: 'GET',
1750
- apiUrl: apiUrl
1751
- }));
1752
-
1753
- case 1:
1754
- case "end":
1755
- return _context.stop();
1756
- }
1757
- }
1758
- }, _callee);
1759
- }));
1760
-
1761
- function getIntents(_x) {
1762
- return _getIntents.apply(this, arguments);
1763
- }
1764
-
1765
- return getIntents;
1766
- }(),
1767
-
1768
- /**
1769
- * Gets the details of an Intent object.
1770
- * @param {string} sessionId The session ID
1771
- * @param {string} intentId The Intent object ID
1772
- */
1773
- getIntent: function () {
1774
- var _getIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, intentId) {
1775
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1776
- while (1) {
1777
- switch (_context2.prev = _context2.next) {
1778
- case 0:
1779
- return _context2.abrupt("return", apiFetcher("/Intent/" + sessionId + "/" + intentId, {
1780
- method: 'GET',
1781
- apiUrl: apiUrl
1782
- }));
1783
-
1784
- case 1:
1785
- case "end":
1786
- return _context2.stop();
1787
- }
1788
- }
1789
- }, _callee2);
1790
- }));
1791
-
1792
- function getIntent(_x2, _x3) {
1793
- return _getIntent.apply(this, arguments);
1794
- }
1795
-
1796
- return getIntent;
1797
- }(),
1798
-
1799
- /**
1800
- * Updates an existing Intent object.
1801
- * @param {string} sessionId The session ID
1802
- * @param {Intent} intent The Intent object
1803
- */
1804
- patchIntent: function () {
1805
- var _patchIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, intent) {
1806
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1807
- while (1) {
1808
- switch (_context3.prev = _context3.next) {
1809
- case 0:
1810
- return _context3.abrupt("return", apiFetcher("/Intent/" + sessionId + "/" + intent.intentID, {
1811
- method: 'PATCH',
1812
- apiUrl: apiUrl,
1813
- body: intent
1814
- }));
1815
-
1816
- case 1:
1817
- case "end":
1818
- return _context3.stop();
1819
- }
1820
- }
1821
- }, _callee3);
1822
- }));
1823
-
1824
- function patchIntent(_x4, _x5) {
1825
- return _patchIntent.apply(this, arguments);
1826
- }
1827
-
1828
- return patchIntent;
1829
- }(),
1830
-
1831
- /**
1832
- * Removes an existing Intent object.
1833
- * @param {string} sessionId The session ID
1834
- * @param {string} intentId The Intent object ID
1835
- */
1836
- deleteIntent: function () {
1837
- var _deleteIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, intentId) {
1838
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1839
- while (1) {
1840
- switch (_context4.prev = _context4.next) {
1841
- case 0:
1842
- return _context4.abrupt("return", apiFetcher("/Intent/" + sessionId + "/" + intentId, {
1843
- method: 'DELETE',
1844
- apiUrl: apiUrl
1845
- }));
1846
-
1847
- case 1:
1848
- case "end":
1849
- return _context4.stop();
1850
- }
1851
- }
1852
- }, _callee4);
1853
- }));
1854
-
1855
- function deleteIntent(_x6, _x7) {
1856
- return _deleteIntent.apply(this, arguments);
1857
- }
1858
-
1859
- return deleteIntent;
1860
- }(),
1861
-
1862
- /**
1863
- * Adds a new Intent object.
1864
- * @param {string} sessionId The session ID
1865
- * @param {Intent} intent The Intent object
1866
- */
1867
- createIntent: function () {
1868
- var _createIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, intent) {
1869
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1870
- while (1) {
1871
- switch (_context5.prev = _context5.next) {
1872
- case 0:
1873
- return _context5.abrupt("return", apiFetcher("/Intent/" + sessionId, {
1874
- method: 'POST',
1875
- apiUrl: apiUrl,
1876
- body: intent
1877
- }));
1878
-
1879
- case 1:
1880
- case "end":
1881
- return _context5.stop();
1882
- }
1883
- }
1884
- }, _callee5);
1885
- }));
1886
-
1887
- function createIntent(_x8, _x9) {
1888
- return _createIntent.apply(this, arguments);
1889
- }
1890
-
1891
- return createIntent;
1892
- }(),
1893
-
1894
- /**
1895
- * Lists all Intent Slot objects.
1896
- * @param {string} sessionId The session ID
1897
- */
1898
- getIntentSlots: function () {
1899
- var _getIntentSlots = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId) {
1900
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1901
- while (1) {
1902
- switch (_context6.prev = _context6.next) {
1903
- case 0:
1904
- return _context6.abrupt("return", apiFetcher("/IntentSlots/" + sessionId, {
1905
- method: 'GET',
1906
- apiUrl: apiUrl
1907
- }));
1908
-
1909
- case 1:
1910
- case "end":
1911
- return _context6.stop();
1912
- }
1913
- }
1914
- }, _callee6);
1915
- }));
1916
-
1917
- function getIntentSlots(_x10) {
1918
- return _getIntentSlots.apply(this, arguments);
1919
- }
1920
-
1921
- return getIntentSlots;
1922
- }(),
1923
-
1924
- /**
1925
- * Gets the details of an Intent Slot object.
1926
- * @param {string} sessionId The session ID
1927
- * @param {string} slotId The Intent Slot object ID
1928
- */
1929
- getIntentSlot: function () {
1930
- var _getIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(sessionId, slotId) {
1931
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1932
- while (1) {
1933
- switch (_context7.prev = _context7.next) {
1934
- case 0:
1935
- return _context7.abrupt("return", apiFetcher("/IntentSlot/" + sessionId + "/" + slotId, {
1936
- method: 'GET',
1937
- apiUrl: apiUrl
1938
- }));
1939
-
1940
- case 1:
1941
- case "end":
1942
- return _context7.stop();
1943
- }
1944
- }
1945
- }, _callee7);
1946
- }));
1947
-
1948
- function getIntentSlot(_x11, _x12) {
1949
- return _getIntentSlot.apply(this, arguments);
1950
- }
1951
-
1952
- return getIntentSlot;
1953
- }(),
1954
-
1955
- /**
1956
- * Updates an existing Intent Slot object.
1957
- * @param {string} sessionId The session ID
1958
- * @param {IntentSlot} intentSlot The Intent Slot object
1959
- */
1960
- patchIntentSlot: function () {
1961
- var _patchIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(sessionId, intentSlot) {
1962
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1963
- while (1) {
1964
- switch (_context8.prev = _context8.next) {
1965
- case 0:
1966
- return _context8.abrupt("return", apiFetcher("/IntentSlot/" + sessionId + "/" + intentSlot.intentSlotID, {
1967
- method: 'PATCH',
1968
- apiUrl: apiUrl,
1969
- body: intentSlot
1970
- }));
1971
-
1972
- case 1:
1973
- case "end":
1974
- return _context8.stop();
1975
- }
1976
- }
1977
- }, _callee8);
1978
- }));
1979
-
1980
- function patchIntentSlot(_x13, _x14) {
1981
- return _patchIntentSlot.apply(this, arguments);
1982
- }
1983
-
1984
- return patchIntentSlot;
1985
- }(),
1986
-
1987
- /**
1988
- * Removes an existing Intent Slot object.
1989
- * @param {string} sessionId The session ID
1990
- * @param {string} slotId The Intent Slot object ID
1991
- */
1992
- deleteIntentSlot: function () {
1993
- var _deleteIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(sessionId, slotId) {
1994
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1995
- while (1) {
1996
- switch (_context9.prev = _context9.next) {
1997
- case 0:
1998
- return _context9.abrupt("return", apiFetcher("/IntentSlot/" + sessionId + "/" + slotId, {
1999
- method: 'DELETE',
2000
- apiUrl: apiUrl
2001
- }));
2002
-
2003
- case 1:
2004
- case "end":
2005
- return _context9.stop();
2006
- }
2007
- }
2008
- }, _callee9);
2009
- }));
2010
-
2011
- function deleteIntentSlot(_x15, _x16) {
2012
- return _deleteIntentSlot.apply(this, arguments);
2013
- }
2014
-
2015
- return deleteIntentSlot;
2016
- }(),
2017
-
2018
- /**
2019
- * Adds a new Intent Slot object.
2020
- * @param {string} sessionId The session ID
2021
- */
2022
- createIntentSlot: function () {
2023
- var _createIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(sessionId, intentSlot) {
2024
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2025
- while (1) {
2026
- switch (_context10.prev = _context10.next) {
2027
- case 0:
2028
- return _context10.abrupt("return", apiFetcher("/IntentSlot/" + sessionId, {
2029
- method: 'POST',
2030
- apiUrl: apiUrl,
2031
- body: intentSlot
2032
- }));
2033
-
2034
- case 1:
2035
- case "end":
2036
- return _context10.stop();
2037
- }
2038
- }
2039
- }, _callee10);
2040
- }));
2041
-
2042
- function createIntentSlot(_x17, _x18) {
2043
- return _createIntentSlot.apply(this, arguments);
2044
- }
2045
-
2046
- return createIntentSlot;
2047
- }()
2048
- };
2049
- });
2050
-
2051
- /****************************
2052
- * *
2053
- * LocalizationKeys *
2054
- * *
2055
- ****************************/
2056
-
2057
- var localizationKeys = (function (apiUrl) {
2058
- return {
2059
- /**
2060
- * Lists all Localizaiton Keys.
2061
- * @param {string} sessionId The session ID
2062
- */
2063
- getLocalizationKeys: function () {
2064
- var _getLocalizationKeys = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
2065
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2066
- while (1) {
2067
- switch (_context.prev = _context.next) {
2068
- case 0:
2069
- return _context.abrupt("return", apiFetcher("/LocalizationKeys/" + sessionId, {
2070
- method: 'GET',
2071
- apiUrl: apiUrl
2072
- }));
2073
-
2074
- case 1:
2075
- case "end":
2076
- return _context.stop();
2077
- }
2078
- }
2079
- }, _callee);
2080
- }));
2081
-
2082
- function getLocalizationKeys(_x) {
2083
- return _getLocalizationKeys.apply(this, arguments);
2084
- }
2085
-
2086
- return getLocalizationKeys;
2087
- }(),
2088
-
2089
- /**
2090
- * Get an existing Localizaiton Key.
2091
- * @param {string} sessionId The session ID
2092
- * @param {string} key The key of the Localization Key
2093
- */
2094
- getLocalizationKey: function () {
2095
- var _getLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, key) {
2096
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2097
- while (1) {
2098
- switch (_context2.prev = _context2.next) {
2099
- case 0:
2100
- return _context2.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId + "/" + key, {
2101
- method: 'GET',
2102
- apiUrl: apiUrl
2103
- }));
2104
-
2105
- case 1:
2106
- case "end":
2107
- return _context2.stop();
2108
- }
2109
- }
2110
- }, _callee2);
2111
- }));
2112
-
2113
- function getLocalizationKey(_x2, _x3) {
2114
- return _getLocalizationKey.apply(this, arguments);
2115
- }
2116
-
2117
- return getLocalizationKey;
2118
- }(),
2119
-
2120
- /**
2121
- * Removes an existing Localizaiton Key. This is only possible if the key is part of
2122
- * a key set, where a key set is a set of keys of a common prefix and an index,
2123
- * e.g.: <code>INPUT_QUIT_1</code>, <code>INPUT_QUIT_2</code> etc.
2124
- * Any index can be specified, the key set will be reordered appropriately.
2125
- * @param {string} sessionId The session ID
2126
- * @param {string} key The key of the Localization Key
2127
- */
2128
- deleteLocalizationKey: function () {
2129
- var _deleteLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, key) {
2130
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2131
- while (1) {
2132
- switch (_context3.prev = _context3.next) {
2133
- case 0:
2134
- return _context3.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId + "/" + key, {
2135
- method: 'DELETE',
2136
- apiUrl: apiUrl
2137
- }));
2138
-
2139
- case 1:
2140
- case "end":
2141
- return _context3.stop();
2142
- }
2143
- }
2144
- }, _callee3);
2145
- }));
2146
-
2147
- function deleteLocalizationKey(_x4, _x5) {
2148
- return _deleteLocalizationKey.apply(this, arguments);
2149
- }
2150
-
2151
- return deleteLocalizationKey;
2152
- }(),
2153
-
2154
- /**
2155
- * Add an new Localization Key. This is only possible if the key is part of
2156
- * a key set, where a key set is a set of keys of a common prefix and an index,
2157
- * e.g.: <code>INPUT_QUIT_1</code>, <code>INPUT_QUIT_2</code> etc.
2158
- * Any index can be specified, the key set will be reordered appropriately.
2159
- * @param {string} sessionId The session ID
2160
- * @param {LocalizaitonKeyContent} localizationKey Localization Key
2161
- */
2162
- postLocalizationKey: function () {
2163
- var _postLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, localizationKey) {
2164
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2165
- while (1) {
2166
- switch (_context4.prev = _context4.next) {
2167
- case 0:
2168
- return _context4.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId, {
2169
- method: 'POST',
2170
- apiUrl: apiUrl,
2171
- body: localizationKey
2172
- }));
2173
-
2174
- case 1:
2175
- case "end":
2176
- return _context4.stop();
2177
- }
2178
- }
2179
- }, _callee4);
2180
- }));
2181
-
2182
- function postLocalizationKey(_x6, _x7) {
2183
- return _postLocalizationKey.apply(this, arguments);
2184
- }
2185
-
2186
- return postLocalizationKey;
2187
- }(),
2188
-
2189
- /**
2190
- * Updates an existing Localization Key.
2191
- * @param {string} sessionId The session ID
2192
- * @param {LocalizationKey} localizationKey Localization Key
2193
- */
2194
- patchLocalizationKey: function () {
2195
- var _patchLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, localizationKey) {
2196
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2197
- while (1) {
2198
- switch (_context5.prev = _context5.next) {
2199
- case 0:
2200
- return _context5.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId, {
2201
- method: 'PATCH',
2202
- apiUrl: apiUrl,
2203
- body: localizationKey
2204
- }));
2205
-
2206
- case 1:
2207
- case "end":
2208
- return _context5.stop();
2209
- }
2210
- }
2211
- }, _callee5);
2212
- }));
2213
-
2214
- function patchLocalizationKey(_x8, _x9) {
2215
- return _patchLocalizationKey.apply(this, arguments);
2216
- }
2217
-
2218
- return patchLocalizationKey;
2219
- }()
2220
- };
2221
- });
2222
-
2223
- /*****************
2224
- * *
2225
- * Media *
2226
- * *
2227
- *****************/
2228
-
2229
- var media = (function (apiUrl) {
2230
- return {
2231
- /**
2232
- * Lists all Medium objects of a Memory.
2233
- * @param {string} sessionId The session ID
2234
- * @param {string} memoryId The Memory object ID
2235
- */
2236
- getMedia: function () {
2237
- var _getMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, memoryId) {
2238
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2239
- while (1) {
2240
- switch (_context.prev = _context.next) {
2241
- case 0:
2242
- return _context.abrupt("return", apiFetcher("/Media/" + sessionId + "/" + memoryId, {
2243
- method: 'GET',
2244
- apiUrl: apiUrl
2245
- }));
2246
-
2247
- case 1:
2248
- case "end":
2249
- return _context.stop();
2250
- }
2251
- }
2252
- }, _callee);
2253
- }));
2254
-
2255
- function getMedia(_x, _x2) {
2256
- return _getMedia.apply(this, arguments);
2257
- }
2258
-
2259
- return getMedia;
2260
- }(),
2261
-
2262
- /**
2263
- * Removes all Medium objects from a Memory.
2264
- * @param {string} sessionId The session ID
2265
- * @param {string} memoryId The Memory object ID
2266
- */
2267
- deleteMedia: function () {
2268
- var _deleteMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, memoryId) {
2269
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2270
- while (1) {
2271
- switch (_context2.prev = _context2.next) {
2272
- case 0:
2273
- return _context2.abrupt("return", apiFetcher("/Media/" + sessionId + "/" + memoryId, {
2274
- method: 'DELETE',
2275
- apiUrl: apiUrl
2276
- }));
2277
-
2278
- case 1:
2279
- case "end":
2280
- return _context2.stop();
2281
- }
2282
- }
2283
- }, _callee2);
2284
- }));
2285
-
2286
- function deleteMedia(_x3, _x4) {
2287
- return _deleteMedia.apply(this, arguments);
2288
- }
2289
-
2290
- return deleteMedia;
2291
- }(),
2292
-
2293
- /**
2294
- * Gets the details of a Medium object of a Memory.
2295
- * @param {string} sessionId The session ID
2296
- * @param {string} memoryId The Memory object ID
2297
- * @param {string} mediumId The Medium object ID
2298
- */
2299
- getMedium: function () {
2300
- var _getMedium = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, memoryId, mediumId) {
2301
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2302
- while (1) {
2303
- switch (_context3.prev = _context3.next) {
2304
- case 0:
2305
- return _context3.abrupt("return", apiFetcher("/Medium/" + sessionId + "/" + memoryId + "/" + mediumId, {
2306
- method: 'GET',
2307
- apiUrl: apiUrl
2308
- }));
2309
-
2310
- case 1:
2311
- case "end":
2312
- return _context3.stop();
2313
- }
2314
- }
2315
- }, _callee3);
2316
- }));
2317
-
2318
- function getMedium(_x5, _x6, _x7) {
2319
- return _getMedium.apply(this, arguments);
2320
- }
2321
-
2322
- return getMedium;
2323
- }(),
2324
-
2325
- /**
2326
- * Updates an existing Medium object of a Memory.
2327
- * @param {string} sessionId The session ID
2328
- * @param {string} memoryId The Memory object ID
2329
- * @param {string} mediumId The Medium object ID
2330
- */
2331
- patchMedium: function () {
2332
- var _patchMedium = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, memoryId, mediumId) {
2333
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2334
- while (1) {
2335
- switch (_context4.prev = _context4.next) {
2336
- case 0:
2337
- return _context4.abrupt("return", apiFetcher("/Medium/" + sessionId + "/" + memoryId + "/" + mediumId, {
2338
- method: 'GET',
2339
- apiUrl: apiUrl
2340
- }));
2341
-
2342
- case 1:
2343
- case "end":
2344
- return _context4.stop();
2345
- }
2346
- }
2347
- }, _callee4);
2348
- }));
2349
-
2350
- function patchMedium(_x8, _x9, _x10) {
2351
- return _patchMedium.apply(this, arguments);
2352
- }
2353
-
2354
- return patchMedium;
2355
- }(),
2356
-
2357
- /**
2358
- * Removes an existing Medium object from a Memory.
2359
- * @param {string} sessionId The session ID
2360
- * @param {string} memoryId The Memory object ID
2361
- * @param {string} mediumId The Medium object ID
2362
- */
2363
- deleteMedium: function deleteMedium(sessionId, memoryId, mediumId) {
2364
- return apiFetcher("/Medium/" + sessionId + "/" + memoryId + "/" + mediumId, {
2365
- method: 'GET',
2366
- apiUrl: apiUrl
2367
- });
2368
- },
2369
-
2370
- /**
2371
- * Adds a new Medium object to a Memory.
2372
- * @param {string} sessionId The session ID
2373
- * @param {string} memoryId The Memory object ID
2374
- */
2375
- postMedium: function () {
2376
- var _postMedium = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, memoryId) {
2377
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2378
- while (1) {
2379
- switch (_context5.prev = _context5.next) {
2380
- case 0:
2381
- return _context5.abrupt("return", apiFetcher("/Medium/" + sessionId + "/" + memoryId, {
2382
- method: 'GET',
2383
- apiUrl: apiUrl
2384
- }));
2385
-
2386
- case 1:
2387
- case "end":
2388
- return _context5.stop();
2389
- }
2390
- }
2391
- }, _callee5);
2392
- }));
2393
-
2394
- function postMedium(_x11, _x12) {
2395
- return _postMedium.apply(this, arguments);
2396
- }
2397
-
2398
- return postMedium;
2399
- }()
2400
- };
2401
- });
2402
-
2403
- /********************
2404
- * *
2405
- * Memories *
2406
- * *
2407
- ********************/
2408
-
2409
- var memories = (function (apiUrl) {
2410
- return {
2411
- /**
2412
- * Lists all Memory objects.
2413
- * @param {string} sessionId The session ID
2414
- * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
2415
- */
2416
- getMemories: function () {
2417
- var _getMemories = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, type) {
2418
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2419
- while (1) {
2420
- switch (_context.prev = _context.next) {
2421
- case 0:
2422
- return _context.abrupt("return", apiFetcher("/Memories/" + sessionId + (type ? "/" + type : ''), {
2423
- method: 'GET',
2424
- apiUrl: apiUrl
2425
- }));
2426
-
2427
- case 1:
2428
- case "end":
2429
- return _context.stop();
2430
- }
2431
- }
2432
- }, _callee);
2433
- }));
2434
-
2435
- function getMemories(_x, _x2) {
2436
- return _getMemories.apply(this, arguments);
2437
- }
2438
-
2439
- return getMemories;
2440
- }(),
2441
-
2442
- /**
2443
- * Lists paginated Memory objects.
2444
- * @param {string} sessionId The session ID
2445
- * @param {number} from The starting index
2446
- * @param {number} howMany The number of items to return
2447
- * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
2448
- */
2449
- getMemoriesPaginated: function () {
2450
- var _getMemoriesPaginated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, from, howMany, type) {
2451
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2452
- while (1) {
2453
- switch (_context2.prev = _context2.next) {
2454
- case 0:
2455
- return _context2.abrupt("return", apiFetcher("/Memories/" + sessionId + "/" + from + "/" + howMany + (type ? "/" + type : ''), {
2456
- method: 'GET',
2457
- apiUrl: apiUrl
2458
- }));
2459
-
2460
- case 1:
2461
- case "end":
2462
- return _context2.stop();
2463
- }
2464
- }
2465
- }, _callee2);
2466
- }));
2467
-
2468
- function getMemoriesPaginated(_x3, _x4, _x5, _x6) {
2469
- return _getMemoriesPaginated.apply(this, arguments);
2470
- }
2471
-
2472
- return getMemoriesPaginated;
2473
- }(),
2474
-
2475
- /**
2476
- * Gets the details of a Memory object.
2477
- * @param {string} sessionId The session ID
2478
- * @param {string} memoryId The Memory object ID
2479
- */
2480
- getMemory: function () {
2481
- var _getMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, memoryId) {
2482
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2483
- while (1) {
2484
- switch (_context3.prev = _context3.next) {
2485
- case 0:
2486
- return _context3.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memoryId, {
2487
- method: 'GET',
2488
- apiUrl: apiUrl
2489
- }));
2490
-
2491
- case 1:
2492
- case "end":
2493
- return _context3.stop();
2494
- }
2495
- }
2496
- }, _callee3);
2497
- }));
2498
-
2499
- function getMemory(_x7, _x8) {
2500
- return _getMemory.apply(this, arguments);
2501
- }
2502
-
2503
- return getMemory;
2504
- }(),
2505
-
2506
- /**
2507
- * Updates an existing Memory object.
2508
- * @param {string} sessionId The session ID
2509
- * @param {Memory} memory The Memory object
2510
- */
2511
- patchMemory: function () {
2512
- var _patchMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, memory) {
2513
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2514
- while (1) {
2515
- switch (_context4.prev = _context4.next) {
2516
- case 0:
2517
- return _context4.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memory.memoryID, {
2518
- method: 'PATCH',
2519
- apiUrl: apiUrl,
2520
- body: memory
2521
- }));
2522
-
2523
- case 1:
2524
- case "end":
2525
- return _context4.stop();
2526
- }
2527
- }
2528
- }, _callee4);
2529
- }));
2530
-
2531
- function patchMemory(_x9, _x10) {
2532
- return _patchMemory.apply(this, arguments);
2533
- }
2534
-
2535
- return patchMemory;
2536
- }(),
2537
-
2538
- /**
2539
- * Removes an existing Memory object.
2540
- * @param {string} sessionId The session ID
2541
- * @param {string} memoryId The Memory object ID
2542
- */
2543
- deleteMemory: function () {
2544
- var _deleteMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, memoryId) {
2545
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2546
- while (1) {
2547
- switch (_context5.prev = _context5.next) {
2548
- case 0:
2549
- return _context5.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memoryId, {
2550
- method: 'DELETE',
2551
- apiUrl: apiUrl
2552
- }));
2553
-
2554
- case 1:
2555
- case "end":
2556
- return _context5.stop();
2557
- }
2558
- }
2559
- }, _callee5);
2560
- }));
2561
-
2562
- function deleteMemory(_x11, _x12) {
2563
- return _deleteMemory.apply(this, arguments);
2564
- }
2565
-
2566
- return deleteMemory;
2567
- }(),
2568
-
2569
- /**
2570
- * Adds a new Memory object.
2571
- * @param {string} sessionId The session ID
2572
- * @param {Memory} memory The Memory object
2573
- */
2574
- postMemory: function () {
2575
- var _postMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId, memory) {
2576
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2577
- while (1) {
2578
- switch (_context6.prev = _context6.next) {
2579
- case 0:
2580
- return _context6.abrupt("return", apiFetcher("/Memory/" + sessionId, {
2581
- method: 'POST',
2582
- apiUrl: apiUrl,
2583
- body: memory
2584
- }));
2585
-
2586
- case 1:
2587
- case "end":
2588
- return _context6.stop();
2589
- }
2590
- }
2591
- }, _callee6);
2592
- }));
2593
-
2594
- function postMemory(_x13, _x14) {
2595
- return _postMemory.apply(this, arguments);
2596
- }
2597
-
2598
- return postMemory;
2599
- }(),
2600
-
2601
- /**
2602
- * Checks if a Memory object is accessible from the specified session.
2603
- * @param {string} sessionId The session ID
2604
- * @param {string} memoryId The Memory object ID
2605
- */
2606
- getMemoryAccess: function () {
2607
- var _getMemoryAccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(sessionId, memoryId) {
2608
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2609
- while (1) {
2610
- switch (_context7.prev = _context7.next) {
2611
- case 0:
2612
- return _context7.abrupt("return", apiFetcher("/MemoryAccess/" + sessionId + "/" + memoryId, {
2613
- method: 'GET',
2614
- apiUrl: apiUrl
2615
- }));
2616
-
2617
- case 1:
2618
- case "end":
2619
- return _context7.stop();
2620
- }
2621
- }
2622
- }, _callee7);
2623
- }));
2624
-
2625
- function getMemoryAccess(_x15, _x16) {
2626
- return _getMemoryAccess.apply(this, arguments);
2627
- }
2628
-
2629
- return getMemoryAccess;
2630
- }()
2631
- };
2632
- });
2633
-
2634
- /***************
2635
- * *
2636
- * NLP *
2637
- * *
2638
- ***************/
2639
-
2640
- var nlp = (function (apiUrl) {
2641
- return {
2642
- /**
2643
- * Looks up the vector definition for a word.
2644
- * @param {string} sessionId The session ID
2645
- * @param {string} word Word to be looked up
2646
- */
2647
- getWordVector: function () {
2648
- var _getWordVector = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, word) {
2649
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2650
- while (1) {
2651
- switch (_context.prev = _context.next) {
2652
- case 0:
2653
- return _context.abrupt("return", apiFetcher("/WordVector/" + sessionId + "/" + word, {
2654
- method: 'GET',
2655
- apiUrl: apiUrl
2656
- }));
2657
-
2658
- case 1:
2659
- case "end":
2660
- return _context.stop();
2661
- }
2662
- }
2663
- }, _callee);
2664
- }));
2665
-
2666
- function getWordVector(_x, _x2) {
2667
- return _getWordVector.apply(this, arguments);
2668
- }
2669
-
2670
- return getWordVector;
2671
- }(),
2672
-
2673
- /**
2674
- * Searches for the 10 words most semantically similar words to the specified word.
2675
- * @param {string} sessionId The session ID
2676
- * @param {string} word Word to be looked up
2677
- */
2678
- getSimilarWords: function () {
2679
- var _getSimilarWords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, word) {
2680
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2681
- while (1) {
2682
- switch (_context2.prev = _context2.next) {
2683
- case 0:
2684
- return _context2.abrupt("return", apiFetcher("/SimilarWords/" + sessionId + "/" + word, {
2685
- method: 'GET',
2686
- apiUrl: apiUrl
2687
- }));
2688
-
2689
- case 1:
2690
- case "end":
2691
- return _context2.stop();
2692
- }
2693
- }
2694
- }, _callee2);
2695
- }));
2696
-
2697
- function getSimilarWords(_x3, _x4) {
2698
- return _getSimilarWords.apply(this, arguments);
2699
- }
2700
-
2701
- return getSimilarWords;
2702
- }(),
2703
-
2704
- /**
2705
- * Tries to guess the language of a sentence by analyzing key word occurrences.
2706
- * @param {string} sessionId The session ID
2707
- * @param {string} text Text to be used for guessing the language.
2708
- */
2709
- guessLanguage: function () {
2710
- var _guessLanguage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, text) {
2711
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2712
- while (1) {
2713
- switch (_context3.prev = _context3.next) {
2714
- case 0:
2715
- return _context3.abrupt("return", apiFetcher("/GuessLanguage/" + sessionId, {
2716
- method: 'POST',
2717
- apiUrl: apiUrl,
2718
- body: {
2719
- text: text
2720
- }
2721
- }));
2722
-
2723
- case 1:
2724
- case "end":
2725
- return _context3.stop();
2726
- }
2727
- }
2728
- }, _callee3);
2729
- }));
2730
-
2731
- function guessLanguage(_x5, _x6) {
2732
- return _guessLanguage.apply(this, arguments);
2733
- }
2734
-
2735
- return guessLanguage;
2736
- }(),
2737
-
2738
- /**
2739
- * Computes the similarity between a reference and a comparison sentences.
2740
- * @param {string} sessionId The session ID
2741
- * @param {string} referenceText Text of the reference sentence.
2742
- * @param {'QUESTION' | 'ANSWER'} referenceTextType Type of reference text, i.e. question or answer. Only types supported are: 'QUESTION' and 'ANSWER'.
2743
- * @param {string} comparisonText Text of the comparison sentence.
2744
- * @param {'QUESTION' | 'ANSWER'} comparisonTextType Type of comparison text, i.e. question or answer. Only types supported are: 'QUESTION' and 'ANSWER'.
2745
- */
2746
- computeSimilarity: function () {
2747
- var _computeSimilarity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, referenceText, referenceTextType, comparisonText, comparisonTextType) {
2748
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2749
- while (1) {
2750
- switch (_context4.prev = _context4.next) {
2751
- case 0:
2752
- return _context4.abrupt("return", apiFetcher("/ComputeSimilarity/" + sessionId, {
2753
- method: 'POST',
2754
- apiUrl: apiUrl,
2755
- body: {
2756
- referenceText: referenceText,
2757
- referenceTextType: referenceTextType,
2758
- comparisonText: comparisonText,
2759
- comparisonTextType: comparisonTextType
2760
- }
2761
- }));
2762
-
2763
- case 1:
2764
- case "end":
2765
- return _context4.stop();
2766
- }
2767
- }
2768
- }, _callee4);
2769
- }));
2770
-
2771
- function computeSimilarity(_x7, _x8, _x9, _x10, _x11) {
2772
- return _computeSimilarity.apply(this, arguments);
2773
- }
2774
-
2775
- return computeSimilarity;
2776
- }(),
2777
-
2778
- /**
2779
- * Checks the words of a sentence for their definition in the word vector dictionary.
2780
- * @param {string} sessionId The session ID
2781
- * @param {string} text Text of the sentence.
2782
- */
2783
- checkWords: function () {
2784
- var _checkWords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, text) {
2785
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2786
- while (1) {
2787
- switch (_context5.prev = _context5.next) {
2788
- case 0:
2789
- return _context5.abrupt("return", apiFetcher("/CheckWords/" + sessionId, {
2790
- method: 'POST',
2791
- apiUrl: apiUrl,
2792
- body: {
2793
- text: text
2794
- }
2795
- }));
2796
-
2797
- case 1:
2798
- case "end":
2799
- return _context5.stop();
2800
- }
2801
- }
2802
- }, _callee5);
2803
- }));
2804
-
2805
- function checkWords(_x12, _x13) {
2806
- return _checkWords.apply(this, arguments);
2807
- }
2808
-
2809
- return checkWords;
2810
- }()
2811
- };
2812
- });
2813
-
2814
- /******************
2815
- * *
2816
- * People *
2817
- * *
2818
- ******************/
2819
-
2820
- var people = (function (apiUrl) {
2821
- return {
2822
- /**
2823
- * Lists all Person objects.
2824
- * @param {string} sessionId The session ID
2825
- */
2826
- getPeople: function () {
2827
- var _getPeople = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
2828
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2829
- while (1) {
2830
- switch (_context.prev = _context.next) {
2831
- case 0:
2832
- return _context.abrupt("return", apiFetcher("/People/" + sessionId, {
2833
- method: 'GET',
2834
- apiUrl: apiUrl
2835
- }));
2836
-
2837
- case 1:
2838
- case "end":
2839
- return _context.stop();
2840
- }
2841
- }
2842
- }, _callee);
2843
- }));
2844
-
2845
- function getPeople(_x) {
2846
- return _getPeople.apply(this, arguments);
2847
- }
2848
-
2849
- return getPeople;
2850
- }(),
2851
-
2852
- /**
2853
- * Gets the details of a Person object.
2854
- * @param {string} sessionId The session ID
2855
- * @param {string} personId The Person object ID
2856
- */
2857
- getPerson: function () {
2858
- var _getPerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, personId) {
2859
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2860
- while (1) {
2861
- switch (_context2.prev = _context2.next) {
2862
- case 0:
2863
- return _context2.abrupt("return", apiFetcher("/Person/" + sessionId + "/" + personId, {
2864
- method: 'GET',
2865
- apiUrl: apiUrl
2866
- }));
2867
-
2868
- case 1:
2869
- case "end":
2870
- return _context2.stop();
2871
- }
2872
- }
2873
- }, _callee2);
2874
- }));
2875
-
2876
- function getPerson(_x2, _x3) {
2877
- return _getPerson.apply(this, arguments);
2878
- }
2879
-
2880
- return getPerson;
2881
- }(),
2882
-
2883
- /**
2884
- * Updates an existing Person object.
2885
- * @param {string} sessionId The session ID
2886
- * @param {Person} person The Person object
2887
- */
2888
- patchPerson: function () {
2889
- var _patchPerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, person) {
2890
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2891
- while (1) {
2892
- switch (_context3.prev = _context3.next) {
2893
- case 0:
2894
- return _context3.abrupt("return", apiFetcher("/Person/" + sessionId + "/" + person.personID, {
2895
- method: 'PATCH',
2896
- body: person,
2897
- apiUrl: apiUrl
2898
- }));
2899
-
2900
- case 1:
2901
- case "end":
2902
- return _context3.stop();
2903
- }
2904
- }
2905
- }, _callee3);
2906
- }));
2907
-
2908
- function patchPerson(_x4, _x5) {
2909
- return _patchPerson.apply(this, arguments);
2910
- }
2911
-
2912
- return patchPerson;
2913
- }(),
2914
-
2915
- /**
2916
- * Removes an existing Person object.
2917
- * @param {string} sessionId The session ID
2918
- * @param {string} personId The Person object ID
2919
- */
2920
- deletePerson: function () {
2921
- var _deletePerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, personId) {
2922
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2923
- while (1) {
2924
- switch (_context4.prev = _context4.next) {
2925
- case 0:
2926
- return _context4.abrupt("return", apiFetcher("/Person/" + sessionId + "/" + personId, {
2927
- method: 'DELETE',
2928
- apiUrl: apiUrl
2929
- }));
2930
-
2931
- case 1:
2932
- case "end":
2933
- return _context4.stop();
2934
- }
2935
- }
2936
- }, _callee4);
2937
- }));
2938
-
2939
- function deletePerson(_x6, _x7) {
2940
- return _deletePerson.apply(this, arguments);
2941
- }
2942
-
2943
- return deletePerson;
2944
- }(),
2945
-
2946
- /**
2947
- * Adds a new Person object.
2948
- * @param {string} sessionId - The session ID
2949
- * @param {Person} person - The Person object
2950
- */
2951
- postPerson: function () {
2952
- var _postPerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, person) {
2953
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2954
- while (1) {
2955
- switch (_context5.prev = _context5.next) {
2956
- case 0:
2957
- return _context5.abrupt("return", apiFetcher("/Person/" + sessionId, {
2958
- method: 'POST',
2959
- body: person,
2960
- apiUrl: apiUrl
2961
- }));
2962
-
2963
- case 1:
2964
- case "end":
2965
- return _context5.stop();
2966
- }
2967
- }
2968
- }, _callee5);
2969
- }));
2970
-
2971
- function postPerson(_x8, _x9) {
2972
- return _postPerson.apply(this, arguments);
2973
- }
2974
-
2975
- return postPerson;
2976
- }()
2977
- };
2978
- });
2979
-
2980
- /*****************************
2981
- * *
2982
- * PromptedQuestions *
2983
- * *
2984
- *****************************/
2985
-
2986
- var promptedQuestions = (function (apiUrl) {
2987
- return {
2988
- /**
2989
- * Lists all Prompted Question objects.
2990
- * @param {string} sessionId The session ID
2991
- */
2992
- getPromptedQuestions: function () {
2993
- var _getPromptedQuestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
2994
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2995
- while (1) {
2996
- switch (_context.prev = _context.next) {
2997
- case 0:
2998
- return _context.abrupt("return", apiFetcher("/PromptedQuestions/" + sessionId, {
2999
- method: 'GET',
3000
- apiUrl: apiUrl
3001
- }));
3002
-
3003
- case 1:
3004
- case "end":
3005
- return _context.stop();
3006
- }
3007
- }
3008
- }, _callee);
3009
- }));
3010
-
3011
- function getPromptedQuestions(_x) {
3012
- return _getPromptedQuestions.apply(this, arguments);
3013
- }
3014
-
3015
- return getPromptedQuestions;
3016
- }(),
3017
-
3018
- /**
3019
- * Gets the details of a Prompted Question object.
3020
- * @param {string} sessionId The session ID
3021
- * @param {string} promptId The Prompted Question object ID
3022
- */
3023
- getPromptedQuestion: function () {
3024
- var _getPromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, promptId) {
3025
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3026
- while (1) {
3027
- switch (_context2.prev = _context2.next) {
3028
- case 0:
3029
- return _context2.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId + "/" + promptId, {
3030
- method: 'GET',
3031
- apiUrl: apiUrl
3032
- }));
3033
-
3034
- case 1:
3035
- case "end":
3036
- return _context2.stop();
3037
- }
3038
- }
3039
- }, _callee2);
3040
- }));
3041
-
3042
- function getPromptedQuestion(_x2, _x3) {
3043
- return _getPromptedQuestion.apply(this, arguments);
3044
- }
3045
-
3046
- return getPromptedQuestion;
3047
- }(),
3048
-
3049
- /**
3050
- * Updates an existing Prompted Question object.
3051
- * @param {string} sessionId The session ID
3052
- * @param {string} promptId The Prompted Question object ID
3053
- */
3054
- patchPromptedQuestion: function () {
3055
- var _patchPromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, promptId) {
3056
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3057
- while (1) {
3058
- switch (_context3.prev = _context3.next) {
3059
- case 0:
3060
- return _context3.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId + "/" + promptId, {
3061
- method: 'GET',
3062
- apiUrl: apiUrl
3063
- }));
3064
-
3065
- case 1:
3066
- case "end":
3067
- return _context3.stop();
3068
- }
3069
- }
3070
- }, _callee3);
3071
- }));
3072
-
3073
- function patchPromptedQuestion(_x4, _x5) {
3074
- return _patchPromptedQuestion.apply(this, arguments);
3075
- }
3076
-
3077
- return patchPromptedQuestion;
3078
- }(),
3079
-
3080
- /**
3081
- * Removes an existing Prompted Question object.
3082
- * @param {string} sessionId The session ID
3083
- * @param {string} promptId The Prompted Question object ID
3084
- */
3085
- deletePromptedQuestion: function () {
3086
- var _deletePromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, promptId) {
3087
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3088
- while (1) {
3089
- switch (_context4.prev = _context4.next) {
3090
- case 0:
3091
- return _context4.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId + "/" + promptId, {
3092
- method: 'GET',
3093
- apiUrl: apiUrl
3094
- }));
3095
-
3096
- case 1:
3097
- case "end":
3098
- return _context4.stop();
3099
- }
3100
- }
3101
- }, _callee4);
3102
- }));
3103
-
3104
- function deletePromptedQuestion(_x6, _x7) {
3105
- return _deletePromptedQuestion.apply(this, arguments);
3106
- }
3107
-
3108
- return deletePromptedQuestion;
3109
- }(),
3110
-
3111
- /**
3112
- * Adds a new Prompted Question object.
3113
- * @param {string} sessionId The session ID
3114
- */
3115
- postPromptedQuestion: function () {
3116
- var _postPromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId) {
3117
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3118
- while (1) {
3119
- switch (_context5.prev = _context5.next) {
3120
- case 0:
3121
- return _context5.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId, {
3122
- method: 'GET',
3123
- apiUrl: apiUrl
3124
- }));
3125
-
3126
- case 1:
3127
- case "end":
3128
- return _context5.stop();
3129
- }
3130
- }
3131
- }, _callee5);
3132
- }));
3133
-
3134
- function postPromptedQuestion(_x8) {
3135
- return _postPromptedQuestion.apply(this, arguments);
3136
- }
3137
-
3138
- return postPromptedQuestion;
3139
- }()
3140
- };
3141
- });
3142
-
3143
- /******************
3144
- * *
3145
- * Search *
3146
- * *
3147
- ******************/
3148
-
3149
- var search = (function (apiUrl) {
3150
- return {
3151
- /**
3152
- * Searches for matching Memory objects using the same algorithm employed in the Text Entered event of the R1 state of the Dialog State Machine.
3153
- * @param {string} sessionId The session ID
3154
- * @param {SearchQuery} query Search query params
3155
- */
3156
- searchMemory: function () {
3157
- var _searchMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, query) {
3158
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3159
- while (1) {
3160
- switch (_context.prev = _context.next) {
3161
- case 0:
3162
- return _context.abrupt("return", apiFetcher("/Search/" + sessionId, {
3163
- method: 'POST',
3164
- body: query,
3165
- apiUrl: apiUrl
3166
- }));
3167
-
3168
- case 1:
3169
- case "end":
3170
- return _context.stop();
3171
- }
3172
- }
3173
- }, _callee);
3174
- }));
3175
-
3176
- function searchMemory(_x, _x2) {
3177
- return _searchMemory.apply(this, arguments);
3178
- }
3179
-
3180
- return searchMemory;
3181
- }(),
3182
-
3183
- /**
3184
- * Picks up to 5 random Memory objects using the same algorithm employed in the
3185
- * Timeout event of the R1 state of the Dialog State Machine.
3186
- * @param {string} sessionId The session ID
3187
- */
3188
- postRandom: function () {
3189
- var _postRandom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId) {
3190
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3191
- while (1) {
3192
- switch (_context2.prev = _context2.next) {
3193
- case 0:
3194
- return _context2.abrupt("return", apiFetcher("/Random/" + sessionId, {
3195
- method: 'POST',
3196
- apiUrl: apiUrl
3197
- }));
3198
-
3199
- case 1:
3200
- case "end":
3201
- return _context2.stop();
3202
- }
3203
- }
3204
- }, _callee2);
3205
- }));
3206
-
3207
- function postRandom(_x3) {
3208
- return _postRandom.apply(this, arguments);
3209
- }
3210
-
3211
- return postRandom;
3212
- }(),
3213
-
3214
- /**
3215
- * Picks up to 20 Memory Hint objects, obtained by searching for Story objects with a date or place set,
3216
- * and clustering dates and places within an uncertainty of at least 1 year or at least 100 km.
3217
- * Each Memory Hint may either suggest a date or a place, but not both.
3218
- * @param {string} sessionId The session ID
3219
- */
3220
- postHints: function () {
3221
- var _postHints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId) {
3222
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3223
- while (1) {
3224
- switch (_context3.prev = _context3.next) {
3225
- case 0:
3226
- return _context3.abrupt("return", apiFetcher("/Hints/" + sessionId, {
3227
- method: 'GET',
3228
- apiUrl: apiUrl
3229
- }));
3230
-
3231
- case 1:
3232
- case "end":
3233
- return _context3.stop();
3234
- }
3235
- }
3236
- }, _callee3);
3237
- }));
3238
-
3239
- function postHints(_x4) {
3240
- return _postHints.apply(this, arguments);
3241
- }
3242
-
3243
- return postHints;
3244
- }()
3245
- };
3246
- });
3247
-
3248
- /*******************
3249
- * *
3250
- * Session *
3251
- * *
3252
- *******************/
3253
-
3254
- var session = (function (apiUrl) {
3255
- return {
3256
- /**
3257
- * Initializes a new Dialog State Machine session for an existing Memori.
3258
- */
3259
- initSession: function () {
3260
- var _initSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
3261
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3262
- while (1) {
3263
- switch (_context.prev = _context.next) {
3264
- case 0:
3265
- return _context.abrupt("return", apiFetcher("/Session", {
3266
- method: 'POST',
3267
- body: params,
3268
- apiUrl: apiUrl
3269
- }));
3270
-
3271
- case 1:
3272
- case "end":
3273
- return _context.stop();
3274
- }
3275
- }
3276
- }, _callee);
3277
- }));
3278
-
3279
- function initSession(_x) {
3280
- return _initSession.apply(this, arguments);
3281
- }
3282
-
3283
- return initSession;
3284
- }(),
3285
-
3286
- /**
3287
- * Returns the current state of a session's Dialog State Machine.
3288
- * @param {string} sessionId The session ID
3289
- */
3290
- getSession: function () {
3291
- var _getSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId) {
3292
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3293
- while (1) {
3294
- switch (_context2.prev = _context2.next) {
3295
- case 0:
3296
- return _context2.abrupt("return", apiFetcher("/Session/" + sessionId, {
3297
- method: 'GET',
3298
- apiUrl: apiUrl
3299
- }));
3300
-
3301
- case 1:
3302
- case "end":
3303
- return _context2.stop();
3304
- }
3305
- }
3306
- }, _callee2);
3307
- }));
3308
-
3309
- function getSession(_x2) {
3310
- return _getSession.apply(this, arguments);
3311
- }
3312
-
3313
- return getSession;
3314
- }(),
3315
-
3316
- /**
3317
- * Closes the session and disposes of its Dialog State Machine.
3318
- * @param {string} sessionId The session ID
3319
- */
3320
- deleteSession: function () {
3321
- var _deleteSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId) {
3322
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3323
- while (1) {
3324
- switch (_context3.prev = _context3.next) {
3325
- case 0:
3326
- return _context3.abrupt("return", apiFetcher("/Session/" + sessionId, {
3327
- method: 'DELETE',
3328
- apiUrl: apiUrl
3329
- }));
3330
-
3331
- case 1:
3332
- case "end":
3333
- return _context3.stop();
3334
- }
3335
- }
3336
- }, _callee3);
3337
- }));
3338
-
3339
- function deleteSession(_x3) {
3340
- return _deleteSession.apply(this, arguments);
3341
- }
3342
-
3343
- return deleteSession;
3344
- }()
3345
- };
3346
- });
3347
-
3348
- /*****************
3349
- * *
3350
- * Stats *
3351
- * *
3352
- *****************/
3353
-
3354
- var stats = (function (apiUrl) {
3355
- return {
3356
- /**
3357
- * Computes usage statistics for the Memori of the current session.
3358
- * @param {string} sessionId The session ID
3359
- */
3360
- getStatistics: function () {
3361
- var _getStatistics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3362
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3363
- while (1) {
3364
- switch (_context.prev = _context.next) {
3365
- case 0:
3366
- return _context.abrupt("return", apiFetcher("/Statistics/" + sessionId, {
3367
- method: 'GET',
3368
- apiUrl: apiUrl
3369
- }));
3370
-
3371
- case 1:
3372
- case "end":
3373
- return _context.stop();
3374
- }
3375
- }
3376
- }, _callee);
3377
- }));
3378
-
3379
- function getStatistics(_x) {
3380
- return _getStatistics.apply(this, arguments);
3381
- }
3382
-
3383
- return getStatistics;
3384
- }(),
3385
-
3386
- /**
3387
- * Computes content quality indexes for a Memori.
3388
- * @param {string} memoriID - The Memori object ID
3389
- */
3390
- getContentQualityIndexes: function () {
3391
- var _getContentQualityIndexes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(memoriID) {
3392
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3393
- while (1) {
3394
- switch (_context2.prev = _context2.next) {
3395
- case 0:
3396
- return _context2.abrupt("return", apiFetcher("/ContentQualityIndexes/" + memoriID, {
3397
- method: 'GET',
3398
- apiUrl: apiUrl
3399
- }));
3400
-
3401
- case 1:
3402
- case "end":
3403
- return _context2.stop();
3404
- }
3405
- }
3406
- }, _callee2);
3407
- }));
3408
-
3409
- function getContentQualityIndexes(_x2) {
3410
- return _getContentQualityIndexes.apply(this, arguments);
3411
- }
3412
-
3413
- return getContentQualityIndexes;
3414
- }(),
3415
-
3416
- /**
3417
- * Computes text quality indexes for a Memori.
3418
- * @param {string} sessionId - The session ID
3419
- */
3420
- getTextQualityIndexes: function () {
3421
- var _getTextQualityIndexes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId) {
3422
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3423
- while (1) {
3424
- switch (_context3.prev = _context3.next) {
3425
- case 0:
3426
- return _context3.abrupt("return", apiFetcher("/TextQualityIndexes/" + sessionId, {
3427
- method: 'GET',
3428
- apiUrl: apiUrl
3429
- }));
3430
-
3431
- case 1:
3432
- case "end":
3433
- return _context3.stop();
3434
- }
3435
- }
3436
- }, _callee3);
3437
- }));
3438
-
3439
- function getTextQualityIndexes(_x3) {
3440
- return _getTextQualityIndexes.apply(this, arguments);
3441
- }
3442
-
3443
- return getTextQualityIndexes;
3444
- }(),
3445
-
3446
- /**
3447
- * Get the Event Log objects for the Memori of the current session in a specific date interval
3448
- * @param {string} sessionId The session ID
3449
- * @param {string} strDateFrom The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3450
- * @param {string} strDateTo The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3451
- */
3452
- getEventLogs: function () {
3453
- var _getEventLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, strDateFrom, strDateTo) {
3454
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3455
- while (1) {
3456
- switch (_context4.prev = _context4.next) {
3457
- case 0:
3458
- return _context4.abrupt("return", apiFetcher("/EventLogs/" + sessionId + "/" + strDateFrom + "/" + strDateTo, {
3459
- method: 'GET',
3460
- apiUrl: apiUrl
3461
- }));
3462
-
3463
- case 1:
3464
- case "end":
3465
- return _context4.stop();
3466
- }
3467
- }
3468
- }, _callee4);
3469
- }));
3470
-
3471
- function getEventLogs(_x4, _x5, _x6) {
3472
- return _getEventLogs.apply(this, arguments);
3473
- }
3474
-
3475
- return getEventLogs;
3476
- }(),
3477
-
3478
- /**
3479
- * Gets the Event Log objects for a specific Memory object in a specific date interval.
3480
- * @param {string} sessionId - The session ID
3481
- * @param {string} memoryId - The Memory object ID
3482
- * @param {string} strDateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3483
- * @param {string} strDateTo - The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3484
- */
3485
- getMemoryEventLogs: function () {
3486
- var _getMemoryEventLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, memoryId, strDateFrom, strDateTo) {
3487
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3488
- while (1) {
3489
- switch (_context5.prev = _context5.next) {
3490
- case 0:
3491
- return _context5.abrupt("return", apiFetcher("/EventLogs/" + sessionId + "/" + memoryId + "/" + strDateFrom + "/" + strDateTo, {
3492
- method: 'GET',
3493
- apiUrl: apiUrl
3494
- }));
3495
-
3496
- case 1:
3497
- case "end":
3498
- return _context5.stop();
3499
- }
3500
- }
3501
- }, _callee5);
3502
- }));
3503
-
3504
- function getMemoryEventLogs(_x7, _x8, _x9, _x10) {
3505
- return _getMemoryEventLogs.apply(this, arguments);
3506
- }
3507
-
3508
- return getMemoryEventLogs;
3509
- }(),
3510
-
3511
- /**
3512
- * Gets the Event Log objects for a specific Intent object in a specific date interval.
3513
- * @param {string} sessionId - The session ID
3514
- * @param {string} intentId - The Intent object ID
3515
- * @param {string} strDateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3516
- * @param {string} strDateTo - The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3517
- */
3518
- getIntentEventLogs: function () {
3519
- var _getIntentEventLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId, intentId, strDateFrom, strDateTo) {
3520
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3521
- while (1) {
3522
- switch (_context6.prev = _context6.next) {
3523
- case 0:
3524
- return _context6.abrupt("return", apiFetcher("/EventLogs/" + sessionId + "/" + intentId + "/" + strDateFrom + "/" + strDateTo, {
3525
- method: 'GET',
3526
- apiUrl: apiUrl
3527
- }));
3528
-
3529
- case 1:
3530
- case "end":
3531
- return _context6.stop();
3532
- }
3533
- }
3534
- }, _callee6);
3535
- }));
3536
-
3537
- function getIntentEventLogs(_x11, _x12, _x13, _x14) {
3538
- return _getIntentEventLogs.apply(this, arguments);
3539
- }
3540
-
3541
- return getIntentEventLogs;
3542
- }()
3543
- };
3544
- });
3545
-
3546
- /*******************************
3547
- * *
3548
- * UnansweredQuestions *
3549
- * *
3550
- *******************************/
3551
-
3552
- var unansweredQuestions = (function (apiUrl) {
3553
- return {
3554
- /**
3555
- * Lists all Unanswered Question objects.
3556
- * @param {string} sessionId The session ID
3557
- */
3558
- getUnansweredQuestions: function () {
3559
- var _getUnansweredQuestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3560
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3561
- while (1) {
3562
- switch (_context.prev = _context.next) {
3563
- case 0:
3564
- return _context.abrupt("return", apiFetcher("/UnansweredQuestions/" + sessionId, {
3565
- method: 'GET',
3566
- apiUrl: apiUrl
3567
- }));
3568
-
3569
- case 1:
3570
- case "end":
3571
- return _context.stop();
3572
- }
3573
- }
3574
- }, _callee);
3575
- }));
3576
-
3577
- function getUnansweredQuestions(_x) {
3578
- return _getUnansweredQuestions.apply(this, arguments);
3579
- }
3580
-
3581
- return getUnansweredQuestions;
3582
- }(),
3583
-
3584
- /**
3585
- * Lists paginated Unanswered Question objects.
3586
- * @param {string} sessionId The session ID
3587
- */
3588
- getUnansweredQuestionsPaginated: function () {
3589
- var _getUnansweredQuestionsPaginated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, from, howMany) {
3590
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3591
- while (1) {
3592
- switch (_context2.prev = _context2.next) {
3593
- case 0:
3594
- return _context2.abrupt("return", apiFetcher("/UnansweredQuestions/" + sessionId + "/" + from + "/" + howMany, {
3595
- method: 'GET',
3596
- apiUrl: apiUrl
3597
- }));
3598
-
3599
- case 1:
3600
- case "end":
3601
- return _context2.stop();
3602
- }
3603
- }
3604
- }, _callee2);
3605
- }));
3606
-
3607
- function getUnansweredQuestionsPaginated(_x2, _x3, _x4) {
3608
- return _getUnansweredQuestionsPaginated.apply(this, arguments);
3609
- }
3610
-
3611
- return getUnansweredQuestionsPaginated;
3612
- }(),
3613
-
3614
- /**
3615
- * Adds a new Unanswered Question object.
3616
- * @param {string} sessionId The session ID
3617
- * @param {UnansweredQuestion} unansweredQuestion The Unanswered Question object
3618
- */
3619
- postUnansweredQuestion: function () {
3620
- var _postUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, unansweredQuestion) {
3621
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3622
- while (1) {
3623
- switch (_context3.prev = _context3.next) {
3624
- case 0:
3625
- return _context3.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId, {
3626
- method: 'POST',
3627
- apiUrl: apiUrl,
3628
- body: unansweredQuestion
3629
- }));
3630
-
3631
- case 1:
3632
- case "end":
3633
- return _context3.stop();
3634
- }
3635
- }
3636
- }, _callee3);
3637
- }));
3638
-
3639
- function postUnansweredQuestion(_x5, _x6) {
3640
- return _postUnansweredQuestion.apply(this, arguments);
3641
- }
3642
-
3643
- return postUnansweredQuestion;
3644
- }(),
3645
-
3646
- /**
3647
- * Removes an existing Unanswered Question object.
3648
- * @param {string} sessionId The session ID
3649
- * @param {string} unansweredQuestionId The Unanswered Question object ID
3650
- */
3651
- deleteUnansweredQuestion: function () {
3652
- var _deleteUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, unansweredQuestionId) {
3653
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3654
- while (1) {
3655
- switch (_context4.prev = _context4.next) {
3656
- case 0:
3657
- return _context4.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId + "/" + unansweredQuestionId, {
3658
- method: 'DELETE',
3659
- apiUrl: apiUrl
3660
- }));
3661
-
3662
- case 1:
3663
- case "end":
3664
- return _context4.stop();
3665
- }
3666
- }
3667
- }, _callee4);
3668
- }));
3669
-
3670
- function deleteUnansweredQuestion(_x7, _x8) {
3671
- return _deleteUnansweredQuestion.apply(this, arguments);
3672
- }
3673
-
3674
- return deleteUnansweredQuestion;
3675
- }()
3676
- };
3677
- });
3678
-
3679
- /****************************
3680
- * *
3681
- * ContextVars *
3682
- * *
3683
- ****************************/
3684
-
3685
- var contextVars = (function (apiUrl) {
3686
- return {
3687
- /**
3688
- * Gets a list of currently known context variables.
3689
- * @param {string} sessionId The session ID
3690
- */
3691
- getContextVars: function () {
3692
- var _getContextVars = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3693
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3694
- while (1) {
3695
- switch (_context.prev = _context.next) {
3696
- case 0:
3697
- return _context.abrupt("return", apiFetcher("/ContextVars/" + sessionId, {
3698
- method: 'GET',
3699
- apiUrl: apiUrl
3700
- }));
3701
-
3702
- case 1:
3703
- case "end":
3704
- return _context.stop();
3705
- }
3706
- }
3707
- }, _callee);
3708
- }));
3709
-
3710
- function getContextVars(_x) {
3711
- return _getContextVars.apply(this, arguments);
3712
- }
3713
-
3714
- return getContextVars;
3715
- }(),
3716
-
3717
- /**
3718
- * Gets a list of currently known context variable names.
3719
- * @param {string} sessionId The session ID
3720
- */
3721
- getContextVarNames: function () {
3722
- var _getContextVarNames = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId) {
3723
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3724
- while (1) {
3725
- switch (_context2.prev = _context2.next) {
3726
- case 0:
3727
- return _context2.abrupt("return", apiFetcher("/ContextVarNames/" + sessionId, {
3728
- method: 'GET',
3729
- apiUrl: apiUrl
3730
- }));
3731
-
3732
- case 1:
3733
- case "end":
3734
- return _context2.stop();
3735
- }
3736
- }
3737
- }, _callee2);
3738
- }));
3739
-
3740
- function getContextVarNames(_x2) {
3741
- return _getContextVarNames.apply(this, arguments);
3742
- }
3743
-
3744
- return getContextVarNames;
3745
- }(),
3746
-
3747
- /**
3748
- * /memori/v2/ContextVarValues/{strSessionID}/{contextVarName}
3749
- * @param {string} sessionId The session ID
3750
- * @param {string} contextVarName The name of the context variable
3751
- */
3752
- getContextVarValues: function () {
3753
- var _getContextVarValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, contextVarName) {
3754
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3755
- while (1) {
3756
- switch (_context3.prev = _context3.next) {
3757
- case 0:
3758
- return _context3.abrupt("return", apiFetcher("/ContextVarValues/" + sessionId + "/" + contextVarName, {
3759
- method: 'GET',
3760
- apiUrl: apiUrl
3761
- }));
3762
-
3763
- case 1:
3764
- case "end":
3765
- return _context3.stop();
3766
- }
3767
- }
3768
- }, _callee3);
3769
- }));
3770
-
3771
- function getContextVarValues(_x3, _x4) {
3772
- return _getContextVarValues.apply(this, arguments);
3773
- }
3774
-
3775
- return getContextVarValues;
3776
- }()
3777
- };
3778
- });
3779
-
3780
- /****************************
3781
- * *
3782
- * CustomDictionary *
3783
- * *
3784
- ****************************/
3785
-
3786
- var customDictionary = (function (apiUrl) {
3787
- return {
3788
- /**
3789
- * Lists all Custom Words.
3790
- * @param {string} sessionId The session ID
3791
- */
3792
- getCustomWords: function () {
3793
- var _getCustomWords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3794
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3795
- while (1) {
3796
- switch (_context.prev = _context.next) {
3797
- case 0:
3798
- return _context.abrupt("return", apiFetcher("/CustomWords/" + sessionId, {
3799
- method: 'GET',
3800
- apiUrl: apiUrl
3801
- }));
3802
-
3803
- case 1:
3804
- case "end":
3805
- return _context.stop();
3806
- }
3807
- }
3808
- }, _callee);
3809
- }));
3810
-
3811
- function getCustomWords(_x) {
3812
- return _getCustomWords.apply(this, arguments);
3813
- }
3814
-
3815
- return getCustomWords;
3816
- }(),
3817
-
3818
- /**
3819
- * Gets the details of a Custom Word object.
3820
- * @param {string} sessionId The session ID
3821
- * @param {string} customWordID The Custom Word object ID
3822
- */
3823
- getCustomWord: function () {
3824
- var _getCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, customWordID) {
3825
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3826
- while (1) {
3827
- switch (_context2.prev = _context2.next) {
3828
- case 0:
3829
- return _context2.abrupt("return", apiFetcher("/CustomWord/" + sessionId + "/" + customWordID, {
3830
- method: 'GET',
3831
- apiUrl: apiUrl
3832
- }));
3833
-
3834
- case 1:
3835
- case "end":
3836
- return _context2.stop();
3837
- }
3838
- }
3839
- }, _callee2);
3840
- }));
3841
-
3842
- function getCustomWord(_x2, _x3) {
3843
- return _getCustomWord.apply(this, arguments);
3844
- }
3845
-
3846
- return getCustomWord;
3847
- }(),
3848
-
3849
- /**
3850
- * Removes an existing Custom Word object.
3851
- * @param {string} sessionId The session ID
3852
- * @param {string} key The key of the Custom Word
3853
- */
3854
- deleteCustomWord: function () {
3855
- var _deleteCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, key) {
3856
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3857
- while (1) {
3858
- switch (_context3.prev = _context3.next) {
3859
- case 0:
3860
- return _context3.abrupt("return", apiFetcher("/CustomWord/" + sessionId + "/" + key, {
3861
- method: 'DELETE',
3862
- apiUrl: apiUrl
3863
- }));
3864
-
3865
- case 1:
3866
- case "end":
3867
- return _context3.stop();
3868
- }
3869
- }
3870
- }, _callee3);
3871
- }));
3872
-
3873
- function deleteCustomWord(_x4, _x5) {
3874
- return _deleteCustomWord.apply(this, arguments);
3875
- }
3876
-
3877
- return deleteCustomWord;
3878
- }(),
3879
-
3880
- /**
3881
- * Adds a new Custom Word object.
3882
- * @param {string} sessionId The session ID
3883
- * @param {CustomWord} customWord Custom Word
3884
- */
3885
- postCustomWord: function () {
3886
- var _postCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, customWord) {
3887
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3888
- while (1) {
3889
- switch (_context4.prev = _context4.next) {
3890
- case 0:
3891
- return _context4.abrupt("return", apiFetcher("/CustomWord/" + sessionId, {
3892
- method: 'POST',
3893
- apiUrl: apiUrl,
3894
- body: customWord
3895
- }));
3896
-
3897
- case 1:
3898
- case "end":
3899
- return _context4.stop();
3900
- }
3901
- }
3902
- }, _callee4);
3903
- }));
3904
-
3905
- function postCustomWord(_x6, _x7) {
3906
- return _postCustomWord.apply(this, arguments);
3907
- }
3908
-
3909
- return postCustomWord;
3910
- }(),
3911
-
3912
- /**
3913
- * Updates an existing Custom Word object.
3914
- * Only the Definition field is considered for update. To change the Word field a new Custom Word must be added and the existing must be removed.
3915
- * @param {string} sessionId The session ID
3916
- * @param {CustomWord} customWord Custom Word
3917
- */
3918
- patchCustomWord: function () {
3919
- var _patchCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, customWord) {
3920
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3921
- while (1) {
3922
- switch (_context5.prev = _context5.next) {
3923
- case 0:
3924
- return _context5.abrupt("return", apiFetcher("/CustomWord/" + sessionId + "/" + customWord.customWordID, {
3925
- method: 'PATCH',
3926
- apiUrl: apiUrl,
3927
- body: customWord
3928
- }));
3929
-
3930
- case 1:
3931
- case "end":
3932
- return _context5.stop();
3933
- }
3934
- }
3935
- }, _callee5);
3936
- }));
3937
-
3938
- function patchCustomWord(_x8, _x9) {
3939
- return _patchCustomWord.apply(this, arguments);
3940
- }
3941
-
3942
- return patchCustomWord;
3943
- }()
3944
- };
3945
- });
3946
-
3947
- /*************************
3948
- * *
3949
- * ChatLogs *
3950
- * *
3951
- *************************/
3952
-
3953
- var chatLogs = (function (apiUrl) {
3954
- return {
3955
- /**
3956
- * Gets the Chat Log objects for the Memori of the current session in a specific date interval.
3957
- * @param {string} sessionId The session ID
3958
- * @param {?string} dateFrom The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3959
- * @param {?string} dateTo The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3960
- */
3961
- getChatLogs: function () {
3962
- var _getChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, dateFrom, dateTo) {
3963
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3964
- while (1) {
3965
- switch (_context.prev = _context.next) {
3966
- case 0:
3967
- return _context.abrupt("return", apiFetcher("/ChatLogs/" + sessionId + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
3968
- method: 'GET',
3969
- apiUrl: apiUrl
3970
- }));
3971
-
3972
- case 1:
3973
- case "end":
3974
- return _context.stop();
3975
- }
3976
- }
3977
- }, _callee);
3978
- }));
3979
-
3980
- function getChatLogs(_x, _x2, _x3) {
3981
- return _getChatLogs.apply(this, arguments);
3982
- }
3983
-
3984
- return getChatLogs;
3985
- }(),
3986
-
3987
- /**
3988
- * Gets the Chat Log objects for the Memori of the current session recorded during a specific other session.
3989
- * @param {string} sessionId The session ID
3990
- * @param {string} chatLogSessionID The session ID for which Chat Log objects are being searched
3991
- */
3992
- getSessionChatLogs: function () {
3993
- var _getSessionChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, chatLogSessionID) {
3994
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3995
- while (1) {
3996
- switch (_context2.prev = _context2.next) {
3997
- case 0:
3998
- return _context2.abrupt("return", apiFetcher("/SessionChatLogs/" + sessionId + "/" + chatLogSessionID, {
3999
- method: 'GET',
4000
- apiUrl: apiUrl
4001
- }));
4002
-
4003
- case 1:
4004
- case "end":
4005
- return _context2.stop();
4006
- }
4007
- }
4008
- }, _callee2);
4009
- }));
4010
-
4011
- function getSessionChatLogs(_x4, _x5) {
4012
- return _getSessionChatLogs.apply(this, arguments);
4013
- }
4014
-
4015
- return getSessionChatLogs;
4016
- }(),
4017
-
4018
- /**
4019
- * Removes all Chat Log objects in a specific date internval.
4020
- * @param {string} sessionId The session ID
4021
- * @param {?string} dateFrom The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
4022
- * @param {?string} dateTo The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
4023
- */
4024
- deleteChatLogs: function () {
4025
- var _deleteChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, dateFrom, dateTo) {
4026
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
4027
- while (1) {
4028
- switch (_context3.prev = _context3.next) {
4029
- case 0:
4030
- return _context3.abrupt("return", apiFetcher("/ChatLogs/" + sessionId + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
4031
- method: 'DELETE',
4032
- apiUrl: apiUrl
4033
- }));
4034
-
4035
- case 1:
4036
- case "end":
4037
- return _context3.stop();
4038
- }
4039
- }
4040
- }, _callee3);
4041
- }));
4042
-
4043
- function deleteChatLogs(_x6, _x7, _x8) {
4044
- return _deleteChatLogs.apply(this, arguments);
4045
- }
4046
-
4047
- return deleteChatLogs;
4048
- }(),
4049
-
4050
- /**
4051
- * Removes an existing Chat Log object.
4052
- * @param {string} sessionId The session ID
4053
- * @param {string} chatLogId The Chat Log object ID
4054
- */
4055
- deleteChatLog: function () {
4056
- var _deleteChatLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, chatLogId) {
4057
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
4058
- while (1) {
4059
- switch (_context4.prev = _context4.next) {
4060
- case 0:
4061
- return _context4.abrupt("return", apiFetcher("/ChatLog/" + sessionId + "/" + chatLogId, {
4062
- method: 'DELETE',
4063
- apiUrl: apiUrl
4064
- }));
4065
-
4066
- case 1:
4067
- case "end":
4068
- return _context4.stop();
4069
- }
4070
- }
4071
- }, _callee4);
4072
- }));
4073
-
4074
- function deleteChatLog(_x9, _x10) {
4075
- return _deleteChatLog.apply(this, arguments);
4076
- }
4077
-
4078
- return deleteChatLog;
4079
- }()
4080
- };
4081
- });
4082
-
4083
- var engine = (function (apiUrl) {
4084
- return _extends({
4085
- correlationPairs: correlationPairs(apiUrl)
4086
- }, correlationPairs(apiUrl), {
4087
- dialog: dialog(apiUrl)
4088
- }, dialog(apiUrl), {
4089
- importExport: importExport(apiUrl)
4090
- }, importExport(apiUrl), {
4091
- intents: intents(apiUrl)
4092
- }, intents(apiUrl), {
4093
- localizationKeys: localizationKeys(apiUrl)
4094
- }, localizationKeys(apiUrl), {
4095
- media: media(apiUrl)
4096
- }, media(apiUrl), {
4097
- memories: memories(apiUrl)
4098
- }, memories(apiUrl), {
4099
- nlp: nlp(apiUrl)
4100
- }, nlp(apiUrl), {
4101
- people: people(apiUrl)
4102
- }, people(apiUrl), {
4103
- promptedQuestions: promptedQuestions(apiUrl)
4104
- }, promptedQuestions(apiUrl), {
4105
- search: search(apiUrl)
4106
- }, search(apiUrl), {
4107
- session: session(apiUrl)
4108
- }, session(apiUrl), {
4109
- stats: stats(apiUrl)
4110
- }, stats(apiUrl), {
4111
- unansweredQuestions: unansweredQuestions(apiUrl)
4112
- }, unansweredQuestions(apiUrl), {
4113
- contextVars: contextVars(apiUrl)
4114
- }, contextVars(apiUrl), {
4115
- customDictionary: customDictionary(apiUrl)
4116
- }, customDictionary(apiUrl), {
4117
- chatLogs: chatLogs(apiUrl)
4118
- }, chatLogs(apiUrl));
4119
- });
4120
-
4121
- var allowedMediaTypes = ['image/jpeg', 'image/png', 'image/jpg', 'image/gif', 'text/plain', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/pdf', 'video/mp4', 'video/avi', 'audio/mpeg3', 'audio/wav', 'audio/mpeg', 'video/mpeg', 'model/gltf-binary'];
4122
- var anonTag = '👤';
4123
-
4124
- var constants = {
4125
- __proto__: null,
4126
- allowedMediaTypes: allowedMediaTypes,
4127
- anonTag: anonTag
4128
- };
4129
-
4130
- var asset$1 = (function (apiUrl) {
4131
- return {
4132
- /**
4133
- * getResourceUrl
4134
- * @description Returns the correct URL of a resource from the DB.
4135
- * @param {obj} params
4136
- * @param {string=} params.type - wheather is the avatar or the cover
4137
- * @param {string=} params.resourceURI - the resource URI
4138
- * @param {string=} params.sessionID - the session ID, required for memory media attachments
4139
- * @param {string=} params.baseURL - the base URL for default static assets (defaults to https://app.twincreator.com)
4140
- * @returns {string}
4141
- */
4142
- getResourceUrl: function getResourceUrl(_ref) {
4143
- var type = _ref.type,
4144
- resourceURI = _ref.resourceURI,
4145
- sessionID = _ref.sessionID,
4146
- _ref$baseURL = _ref.baseURL,
4147
- baseURL = _ref$baseURL === void 0 ? 'https://app.twincreator.com' : _ref$baseURL;
4148
- var defaultUri = type === 'cover' ? baseURL + "/images/memoriCover.png" : baseURL + "/images/memoriAvatar.png";
4149
-
4150
- if (!resourceURI || resourceURI.length === 0) {
4151
- return defaultUri;
4152
- } else if (resourceURI.includes('memoriai/memory')) {
4153
- return resourceURI + "?memori-ai-session-id=" + sessionID;
4154
- } else if (resourceURI.startsWith('https://') || resourceURI.startsWith('http://')) {
4155
- return "" + resourceURI + (sessionID ? "/" + sessionID : '');
4156
- } else if (resourceURI.startsWith('cloud://')) {
4157
- return apiUrl.replace(/v2/, 'v1') + "/CloudAsset/" + resourceURI.replace('cloud://', '');
4158
- } else if (resourceURI.startsWith('guid://')) {
4159
- return apiUrl.replace(/v2/, 'v1') + "/GuidAsset/" + resourceURI.replace('guid://', '');
4160
- } else {
4161
- return defaultUri;
4162
- }
4163
- }
4164
- };
4165
- });
4166
-
4167
- var api = function api(hostname) {
4168
- var apiUrl = getApiUrl(hostname);
4169
- return _extends({
4170
- backend: backendAPI(apiUrl + "/api/v2")
4171
- }, engine(apiUrl + "/memori/v2"), {
4172
- constants: constants,
4173
- asset: asset$1(apiUrl + "/api/v2")
4174
- });
4175
- };
4176
-
4177
- export default api;
4178
- //# sourceMappingURL=memori-api-client.esm.js.map