@memori.ai/memori-api-client 1.2.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 +21 -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 -40
  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 -897
  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 +36 -6
  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} +57 -50
  394. package/dist/memori-api-client.cjs.development.js +0 -4279
  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 -4273
  399. package/dist/memori-api-client.esm.js.map +0 -1
@@ -1,4273 +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[]} rows Rows of the CSV file.
1663
- * @param {ImportParams} params The specifications and content of the CSV file
1664
- */
1665
- importCSV: function () {
1666
- var _importCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, rows, 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
- rows: rows
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
- * Gets the status of an ongoing Import process.
1696
- * @param {string} importID The import process ID
1697
- */
1698
- importStatus: function () {
1699
- var _importStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(importID) {
1700
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1701
- while (1) {
1702
- switch (_context2.prev = _context2.next) {
1703
- case 0:
1704
- return _context2.abrupt("return", apiFetcher("/ImportExport/ImportStatus/" + importID, {
1705
- method: 'GET',
1706
- apiUrl: apiUrl
1707
- }));
1708
-
1709
- case 1:
1710
- case "end":
1711
- return _context2.stop();
1712
- }
1713
- }
1714
- }, _callee2);
1715
- }));
1716
-
1717
- function importStatus(_x4) {
1718
- return _importStatus.apply(this, arguments);
1719
- }
1720
-
1721
- return importStatus;
1722
- }(),
1723
-
1724
- /**
1725
- * Interrupts an ongoing Import process.
1726
- * @param {string} importID The import process ID
1727
- */
1728
- stopImport: function () {
1729
- var _stopImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(importID) {
1730
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1731
- while (1) {
1732
- switch (_context3.prev = _context3.next) {
1733
- case 0:
1734
- return _context3.abrupt("return", apiFetcher("/ImportExport/StopImport/" + importID, {
1735
- method: 'POST',
1736
- apiUrl: apiUrl
1737
- }));
1738
-
1739
- case 1:
1740
- case "end":
1741
- return _context3.stop();
1742
- }
1743
- }
1744
- }, _callee3);
1745
- }));
1746
-
1747
- function stopImport(_x5) {
1748
- return _stopImport.apply(this, arguments);
1749
- }
1750
-
1751
- return stopImport;
1752
- }(),
1753
-
1754
- /**
1755
- * Imports memories from a TXT file.
1756
- * @param {string} sessionId The session ID
1757
- * @param {string[]} rows Rows of the TXT file.
1758
- * @param {ImportCSVParams} params The specifications and content of the TXT file
1759
- */
1760
- importTXT: function () {
1761
- var _importTXT = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, rows, params) {
1762
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1763
- while (1) {
1764
- switch (_context4.prev = _context4.next) {
1765
- case 0:
1766
- return _context4.abrupt("return", apiFetcher("/ImportExport/ImportTXT/" + sessionId, {
1767
- method: 'POST',
1768
- apiUrl: apiUrl,
1769
- body: _extends({
1770
- rows: rows
1771
- }, params)
1772
- }));
1773
-
1774
- case 1:
1775
- case "end":
1776
- return _context4.stop();
1777
- }
1778
- }
1779
- }, _callee4);
1780
- }));
1781
-
1782
- function importTXT(_x6, _x7, _x8) {
1783
- return _importTXT.apply(this, arguments);
1784
- }
1785
-
1786
- return importTXT;
1787
- }(),
1788
-
1789
- /**
1790
- * Exports memories to a CSV file.
1791
- * @param {string} sessionID The session ID
1792
- * @param {ExportCSVParams} params - The specifications of the CSV file
1793
- * @returns The CSV file content
1794
- */
1795
- exportCSV: function () {
1796
- var _exportCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionID, params) {
1797
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1798
- while (1) {
1799
- switch (_context5.prev = _context5.next) {
1800
- case 0:
1801
- return _context5.abrupt("return", apiFetcher("/ImportExport/ExportCSV/" + sessionID, {
1802
- method: 'POST',
1803
- apiUrl: apiUrl,
1804
- body: params,
1805
- text: true
1806
- }));
1807
-
1808
- case 1:
1809
- case "end":
1810
- return _context5.stop();
1811
- }
1812
- }
1813
- }, _callee5);
1814
- }));
1815
-
1816
- function exportCSV(_x9, _x10) {
1817
- return _exportCSV.apply(this, arguments);
1818
- }
1819
-
1820
- return exportCSV;
1821
- }()
1822
- };
1823
- });
1824
-
1825
- /*******************
1826
- * *
1827
- * Intents *
1828
- * *
1829
- *******************/
1830
-
1831
- var intents = (function (apiUrl) {
1832
- return {
1833
- /**
1834
- * Lists all Intent objects.
1835
- * @param {string} sessionId The session ID
1836
- */
1837
- getIntents: function () {
1838
- var _getIntents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
1839
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1840
- while (1) {
1841
- switch (_context.prev = _context.next) {
1842
- case 0:
1843
- return _context.abrupt("return", apiFetcher("/Intents/" + sessionId, {
1844
- method: 'GET',
1845
- apiUrl: apiUrl
1846
- }));
1847
-
1848
- case 1:
1849
- case "end":
1850
- return _context.stop();
1851
- }
1852
- }
1853
- }, _callee);
1854
- }));
1855
-
1856
- function getIntents(_x) {
1857
- return _getIntents.apply(this, arguments);
1858
- }
1859
-
1860
- return getIntents;
1861
- }(),
1862
-
1863
- /**
1864
- * Gets the details of an Intent object.
1865
- * @param {string} sessionId The session ID
1866
- * @param {string} intentId The Intent object ID
1867
- */
1868
- getIntent: function () {
1869
- var _getIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, intentId) {
1870
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1871
- while (1) {
1872
- switch (_context2.prev = _context2.next) {
1873
- case 0:
1874
- return _context2.abrupt("return", apiFetcher("/Intent/" + sessionId + "/" + intentId, {
1875
- method: 'GET',
1876
- apiUrl: apiUrl
1877
- }));
1878
-
1879
- case 1:
1880
- case "end":
1881
- return _context2.stop();
1882
- }
1883
- }
1884
- }, _callee2);
1885
- }));
1886
-
1887
- function getIntent(_x2, _x3) {
1888
- return _getIntent.apply(this, arguments);
1889
- }
1890
-
1891
- return getIntent;
1892
- }(),
1893
-
1894
- /**
1895
- * Updates an existing Intent object.
1896
- * @param {string} sessionId The session ID
1897
- * @param {Intent} intent The Intent object
1898
- */
1899
- patchIntent: function () {
1900
- var _patchIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, intent) {
1901
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1902
- while (1) {
1903
- switch (_context3.prev = _context3.next) {
1904
- case 0:
1905
- return _context3.abrupt("return", apiFetcher("/Intent/" + sessionId + "/" + intent.intentID, {
1906
- method: 'PATCH',
1907
- apiUrl: apiUrl,
1908
- body: intent
1909
- }));
1910
-
1911
- case 1:
1912
- case "end":
1913
- return _context3.stop();
1914
- }
1915
- }
1916
- }, _callee3);
1917
- }));
1918
-
1919
- function patchIntent(_x4, _x5) {
1920
- return _patchIntent.apply(this, arguments);
1921
- }
1922
-
1923
- return patchIntent;
1924
- }(),
1925
-
1926
- /**
1927
- * Removes an existing Intent object.
1928
- * @param {string} sessionId The session ID
1929
- * @param {string} intentId The Intent object ID
1930
- */
1931
- deleteIntent: function () {
1932
- var _deleteIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, intentId) {
1933
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1934
- while (1) {
1935
- switch (_context4.prev = _context4.next) {
1936
- case 0:
1937
- return _context4.abrupt("return", apiFetcher("/Intent/" + sessionId + "/" + intentId, {
1938
- method: 'DELETE',
1939
- apiUrl: apiUrl
1940
- }));
1941
-
1942
- case 1:
1943
- case "end":
1944
- return _context4.stop();
1945
- }
1946
- }
1947
- }, _callee4);
1948
- }));
1949
-
1950
- function deleteIntent(_x6, _x7) {
1951
- return _deleteIntent.apply(this, arguments);
1952
- }
1953
-
1954
- return deleteIntent;
1955
- }(),
1956
-
1957
- /**
1958
- * Adds a new Intent object.
1959
- * @param {string} sessionId The session ID
1960
- * @param {Intent} intent The Intent object
1961
- */
1962
- createIntent: function () {
1963
- var _createIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, intent) {
1964
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1965
- while (1) {
1966
- switch (_context5.prev = _context5.next) {
1967
- case 0:
1968
- return _context5.abrupt("return", apiFetcher("/Intent/" + sessionId, {
1969
- method: 'POST',
1970
- apiUrl: apiUrl,
1971
- body: intent
1972
- }));
1973
-
1974
- case 1:
1975
- case "end":
1976
- return _context5.stop();
1977
- }
1978
- }
1979
- }, _callee5);
1980
- }));
1981
-
1982
- function createIntent(_x8, _x9) {
1983
- return _createIntent.apply(this, arguments);
1984
- }
1985
-
1986
- return createIntent;
1987
- }(),
1988
-
1989
- /**
1990
- * Lists all Intent Slot objects.
1991
- * @param {string} sessionId The session ID
1992
- */
1993
- getIntentSlots: function () {
1994
- var _getIntentSlots = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId) {
1995
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1996
- while (1) {
1997
- switch (_context6.prev = _context6.next) {
1998
- case 0:
1999
- return _context6.abrupt("return", apiFetcher("/IntentSlots/" + sessionId, {
2000
- method: 'GET',
2001
- apiUrl: apiUrl
2002
- }));
2003
-
2004
- case 1:
2005
- case "end":
2006
- return _context6.stop();
2007
- }
2008
- }
2009
- }, _callee6);
2010
- }));
2011
-
2012
- function getIntentSlots(_x10) {
2013
- return _getIntentSlots.apply(this, arguments);
2014
- }
2015
-
2016
- return getIntentSlots;
2017
- }(),
2018
-
2019
- /**
2020
- * Gets the details of an Intent Slot object.
2021
- * @param {string} sessionId The session ID
2022
- * @param {string} slotId The Intent Slot object ID
2023
- */
2024
- getIntentSlot: function () {
2025
- var _getIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(sessionId, slotId) {
2026
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2027
- while (1) {
2028
- switch (_context7.prev = _context7.next) {
2029
- case 0:
2030
- return _context7.abrupt("return", apiFetcher("/IntentSlot/" + sessionId + "/" + slotId, {
2031
- method: 'GET',
2032
- apiUrl: apiUrl
2033
- }));
2034
-
2035
- case 1:
2036
- case "end":
2037
- return _context7.stop();
2038
- }
2039
- }
2040
- }, _callee7);
2041
- }));
2042
-
2043
- function getIntentSlot(_x11, _x12) {
2044
- return _getIntentSlot.apply(this, arguments);
2045
- }
2046
-
2047
- return getIntentSlot;
2048
- }(),
2049
-
2050
- /**
2051
- * Updates an existing Intent Slot object.
2052
- * @param {string} sessionId The session ID
2053
- * @param {IntentSlot} intentSlot The Intent Slot object
2054
- */
2055
- patchIntentSlot: function () {
2056
- var _patchIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(sessionId, intentSlot) {
2057
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2058
- while (1) {
2059
- switch (_context8.prev = _context8.next) {
2060
- case 0:
2061
- return _context8.abrupt("return", apiFetcher("/IntentSlot/" + sessionId + "/" + intentSlot.intentSlotID, {
2062
- method: 'PATCH',
2063
- apiUrl: apiUrl,
2064
- body: intentSlot
2065
- }));
2066
-
2067
- case 1:
2068
- case "end":
2069
- return _context8.stop();
2070
- }
2071
- }
2072
- }, _callee8);
2073
- }));
2074
-
2075
- function patchIntentSlot(_x13, _x14) {
2076
- return _patchIntentSlot.apply(this, arguments);
2077
- }
2078
-
2079
- return patchIntentSlot;
2080
- }(),
2081
-
2082
- /**
2083
- * Removes an existing Intent Slot object.
2084
- * @param {string} sessionId The session ID
2085
- * @param {string} slotId The Intent Slot object ID
2086
- */
2087
- deleteIntentSlot: function () {
2088
- var _deleteIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(sessionId, slotId) {
2089
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2090
- while (1) {
2091
- switch (_context9.prev = _context9.next) {
2092
- case 0:
2093
- return _context9.abrupt("return", apiFetcher("/IntentSlot/" + sessionId + "/" + slotId, {
2094
- method: 'DELETE',
2095
- apiUrl: apiUrl
2096
- }));
2097
-
2098
- case 1:
2099
- case "end":
2100
- return _context9.stop();
2101
- }
2102
- }
2103
- }, _callee9);
2104
- }));
2105
-
2106
- function deleteIntentSlot(_x15, _x16) {
2107
- return _deleteIntentSlot.apply(this, arguments);
2108
- }
2109
-
2110
- return deleteIntentSlot;
2111
- }(),
2112
-
2113
- /**
2114
- * Adds a new Intent Slot object.
2115
- * @param {string} sessionId The session ID
2116
- */
2117
- createIntentSlot: function () {
2118
- var _createIntentSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(sessionId, intentSlot) {
2119
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2120
- while (1) {
2121
- switch (_context10.prev = _context10.next) {
2122
- case 0:
2123
- return _context10.abrupt("return", apiFetcher("/IntentSlot/" + sessionId, {
2124
- method: 'POST',
2125
- apiUrl: apiUrl,
2126
- body: intentSlot
2127
- }));
2128
-
2129
- case 1:
2130
- case "end":
2131
- return _context10.stop();
2132
- }
2133
- }
2134
- }, _callee10);
2135
- }));
2136
-
2137
- function createIntentSlot(_x17, _x18) {
2138
- return _createIntentSlot.apply(this, arguments);
2139
- }
2140
-
2141
- return createIntentSlot;
2142
- }()
2143
- };
2144
- });
2145
-
2146
- /****************************
2147
- * *
2148
- * LocalizationKeys *
2149
- * *
2150
- ****************************/
2151
-
2152
- var localizationKeys = (function (apiUrl) {
2153
- return {
2154
- /**
2155
- * Lists all Localizaiton Keys.
2156
- * @param {string} sessionId The session ID
2157
- */
2158
- getLocalizationKeys: function () {
2159
- var _getLocalizationKeys = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
2160
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2161
- while (1) {
2162
- switch (_context.prev = _context.next) {
2163
- case 0:
2164
- return _context.abrupt("return", apiFetcher("/LocalizationKeys/" + sessionId, {
2165
- method: 'GET',
2166
- apiUrl: apiUrl
2167
- }));
2168
-
2169
- case 1:
2170
- case "end":
2171
- return _context.stop();
2172
- }
2173
- }
2174
- }, _callee);
2175
- }));
2176
-
2177
- function getLocalizationKeys(_x) {
2178
- return _getLocalizationKeys.apply(this, arguments);
2179
- }
2180
-
2181
- return getLocalizationKeys;
2182
- }(),
2183
-
2184
- /**
2185
- * Get an existing Localizaiton Key.
2186
- * @param {string} sessionId The session ID
2187
- * @param {string} key The key of the Localization Key
2188
- */
2189
- getLocalizationKey: function () {
2190
- var _getLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, key) {
2191
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2192
- while (1) {
2193
- switch (_context2.prev = _context2.next) {
2194
- case 0:
2195
- return _context2.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId + "/" + key, {
2196
- method: 'GET',
2197
- apiUrl: apiUrl
2198
- }));
2199
-
2200
- case 1:
2201
- case "end":
2202
- return _context2.stop();
2203
- }
2204
- }
2205
- }, _callee2);
2206
- }));
2207
-
2208
- function getLocalizationKey(_x2, _x3) {
2209
- return _getLocalizationKey.apply(this, arguments);
2210
- }
2211
-
2212
- return getLocalizationKey;
2213
- }(),
2214
-
2215
- /**
2216
- * Removes an existing Localizaiton Key. This is only possible if the key is part of
2217
- * a key set, where a key set is a set of keys of a common prefix and an index,
2218
- * e.g.: <code>INPUT_QUIT_1</code>, <code>INPUT_QUIT_2</code> etc.
2219
- * Any index can be specified, the key set will be reordered appropriately.
2220
- * @param {string} sessionId The session ID
2221
- * @param {string} key The key of the Localization Key
2222
- */
2223
- deleteLocalizationKey: function () {
2224
- var _deleteLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, key) {
2225
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2226
- while (1) {
2227
- switch (_context3.prev = _context3.next) {
2228
- case 0:
2229
- return _context3.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId + "/" + key, {
2230
- method: 'DELETE',
2231
- apiUrl: apiUrl
2232
- }));
2233
-
2234
- case 1:
2235
- case "end":
2236
- return _context3.stop();
2237
- }
2238
- }
2239
- }, _callee3);
2240
- }));
2241
-
2242
- function deleteLocalizationKey(_x4, _x5) {
2243
- return _deleteLocalizationKey.apply(this, arguments);
2244
- }
2245
-
2246
- return deleteLocalizationKey;
2247
- }(),
2248
-
2249
- /**
2250
- * Add an new Localization Key. This is only possible if the key is part of
2251
- * a key set, where a key set is a set of keys of a common prefix and an index,
2252
- * e.g.: <code>INPUT_QUIT_1</code>, <code>INPUT_QUIT_2</code> etc.
2253
- * Any index can be specified, the key set will be reordered appropriately.
2254
- * @param {string} sessionId The session ID
2255
- * @param {LocalizaitonKeyContent} localizationKey Localization Key
2256
- */
2257
- postLocalizationKey: function () {
2258
- var _postLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, localizationKey) {
2259
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2260
- while (1) {
2261
- switch (_context4.prev = _context4.next) {
2262
- case 0:
2263
- return _context4.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId, {
2264
- method: 'POST',
2265
- apiUrl: apiUrl,
2266
- body: localizationKey
2267
- }));
2268
-
2269
- case 1:
2270
- case "end":
2271
- return _context4.stop();
2272
- }
2273
- }
2274
- }, _callee4);
2275
- }));
2276
-
2277
- function postLocalizationKey(_x6, _x7) {
2278
- return _postLocalizationKey.apply(this, arguments);
2279
- }
2280
-
2281
- return postLocalizationKey;
2282
- }(),
2283
-
2284
- /**
2285
- * Updates an existing Localization Key.
2286
- * @param {string} sessionId The session ID
2287
- * @param {LocalizationKey} localizationKey Localization Key
2288
- */
2289
- patchLocalizationKey: function () {
2290
- var _patchLocalizationKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, localizationKey) {
2291
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2292
- while (1) {
2293
- switch (_context5.prev = _context5.next) {
2294
- case 0:
2295
- return _context5.abrupt("return", apiFetcher("/LocalizationKey/" + sessionId, {
2296
- method: 'PATCH',
2297
- apiUrl: apiUrl,
2298
- body: localizationKey
2299
- }));
2300
-
2301
- case 1:
2302
- case "end":
2303
- return _context5.stop();
2304
- }
2305
- }
2306
- }, _callee5);
2307
- }));
2308
-
2309
- function patchLocalizationKey(_x8, _x9) {
2310
- return _patchLocalizationKey.apply(this, arguments);
2311
- }
2312
-
2313
- return patchLocalizationKey;
2314
- }()
2315
- };
2316
- });
2317
-
2318
- /*****************
2319
- * *
2320
- * Media *
2321
- * *
2322
- *****************/
2323
-
2324
- var media = (function (apiUrl) {
2325
- return {
2326
- /**
2327
- * Lists all Medium objects of a Memory.
2328
- * @param {string} sessionId The session ID
2329
- * @param {string} memoryId The Memory object ID
2330
- */
2331
- getMedia: function () {
2332
- var _getMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, memoryId) {
2333
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2334
- while (1) {
2335
- switch (_context.prev = _context.next) {
2336
- case 0:
2337
- return _context.abrupt("return", apiFetcher("/Media/" + sessionId + "/" + memoryId, {
2338
- method: 'GET',
2339
- apiUrl: apiUrl
2340
- }));
2341
-
2342
- case 1:
2343
- case "end":
2344
- return _context.stop();
2345
- }
2346
- }
2347
- }, _callee);
2348
- }));
2349
-
2350
- function getMedia(_x, _x2) {
2351
- return _getMedia.apply(this, arguments);
2352
- }
2353
-
2354
- return getMedia;
2355
- }(),
2356
-
2357
- /**
2358
- * Removes all Medium objects from a Memory.
2359
- * @param {string} sessionId The session ID
2360
- * @param {string} memoryId The Memory object ID
2361
- */
2362
- deleteMedia: function () {
2363
- var _deleteMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, memoryId) {
2364
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2365
- while (1) {
2366
- switch (_context2.prev = _context2.next) {
2367
- case 0:
2368
- return _context2.abrupt("return", apiFetcher("/Media/" + sessionId + "/" + memoryId, {
2369
- method: 'DELETE',
2370
- apiUrl: apiUrl
2371
- }));
2372
-
2373
- case 1:
2374
- case "end":
2375
- return _context2.stop();
2376
- }
2377
- }
2378
- }, _callee2);
2379
- }));
2380
-
2381
- function deleteMedia(_x3, _x4) {
2382
- return _deleteMedia.apply(this, arguments);
2383
- }
2384
-
2385
- return deleteMedia;
2386
- }(),
2387
-
2388
- /**
2389
- * Gets the details of a Medium object of a Memory.
2390
- * @param {string} sessionId The session ID
2391
- * @param {string} memoryId The Memory object ID
2392
- * @param {string} mediumId The Medium object ID
2393
- */
2394
- getMedium: function () {
2395
- var _getMedium = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, memoryId, mediumId) {
2396
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2397
- while (1) {
2398
- switch (_context3.prev = _context3.next) {
2399
- case 0:
2400
- return _context3.abrupt("return", apiFetcher("/Medium/" + sessionId + "/" + memoryId + "/" + mediumId, {
2401
- method: 'GET',
2402
- apiUrl: apiUrl
2403
- }));
2404
-
2405
- case 1:
2406
- case "end":
2407
- return _context3.stop();
2408
- }
2409
- }
2410
- }, _callee3);
2411
- }));
2412
-
2413
- function getMedium(_x5, _x6, _x7) {
2414
- return _getMedium.apply(this, arguments);
2415
- }
2416
-
2417
- return getMedium;
2418
- }(),
2419
-
2420
- /**
2421
- * Updates an existing Medium object of a Memory.
2422
- * @param {string} sessionId The session ID
2423
- * @param {string} memoryId The Memory object ID
2424
- * @param {string} mediumId The Medium object ID
2425
- */
2426
- patchMedium: function () {
2427
- var _patchMedium = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, memoryId, mediumId) {
2428
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2429
- while (1) {
2430
- switch (_context4.prev = _context4.next) {
2431
- case 0:
2432
- return _context4.abrupt("return", apiFetcher("/Medium/" + sessionId + "/" + memoryId + "/" + mediumId, {
2433
- method: 'GET',
2434
- apiUrl: apiUrl
2435
- }));
2436
-
2437
- case 1:
2438
- case "end":
2439
- return _context4.stop();
2440
- }
2441
- }
2442
- }, _callee4);
2443
- }));
2444
-
2445
- function patchMedium(_x8, _x9, _x10) {
2446
- return _patchMedium.apply(this, arguments);
2447
- }
2448
-
2449
- return patchMedium;
2450
- }(),
2451
-
2452
- /**
2453
- * Removes an existing Medium object from a Memory.
2454
- * @param {string} sessionId The session ID
2455
- * @param {string} memoryId The Memory object ID
2456
- * @param {string} mediumId The Medium object ID
2457
- */
2458
- deleteMedium: function deleteMedium(sessionId, memoryId, mediumId) {
2459
- return apiFetcher("/Medium/" + sessionId + "/" + memoryId + "/" + mediumId, {
2460
- method: 'GET',
2461
- apiUrl: apiUrl
2462
- });
2463
- },
2464
-
2465
- /**
2466
- * Adds a new Medium object to a Memory.
2467
- * @param {string} sessionId The session ID
2468
- * @param {string} memoryId The Memory object ID
2469
- */
2470
- postMedium: function () {
2471
- var _postMedium = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, memoryId) {
2472
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2473
- while (1) {
2474
- switch (_context5.prev = _context5.next) {
2475
- case 0:
2476
- return _context5.abrupt("return", apiFetcher("/Medium/" + sessionId + "/" + memoryId, {
2477
- method: 'GET',
2478
- apiUrl: apiUrl
2479
- }));
2480
-
2481
- case 1:
2482
- case "end":
2483
- return _context5.stop();
2484
- }
2485
- }
2486
- }, _callee5);
2487
- }));
2488
-
2489
- function postMedium(_x11, _x12) {
2490
- return _postMedium.apply(this, arguments);
2491
- }
2492
-
2493
- return postMedium;
2494
- }()
2495
- };
2496
- });
2497
-
2498
- /********************
2499
- * *
2500
- * Memories *
2501
- * *
2502
- ********************/
2503
-
2504
- var memories = (function (apiUrl) {
2505
- return {
2506
- /**
2507
- * Lists all Memory objects.
2508
- * @param {string} sessionId The session ID
2509
- * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
2510
- */
2511
- getMemories: function () {
2512
- var _getMemories = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, type) {
2513
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2514
- while (1) {
2515
- switch (_context.prev = _context.next) {
2516
- case 0:
2517
- return _context.abrupt("return", apiFetcher("/Memories/" + sessionId + (type ? "/" + type : ''), {
2518
- method: 'GET',
2519
- apiUrl: apiUrl
2520
- }));
2521
-
2522
- case 1:
2523
- case "end":
2524
- return _context.stop();
2525
- }
2526
- }
2527
- }, _callee);
2528
- }));
2529
-
2530
- function getMemories(_x, _x2) {
2531
- return _getMemories.apply(this, arguments);
2532
- }
2533
-
2534
- return getMemories;
2535
- }(),
2536
-
2537
- /**
2538
- * Lists paginated Memory objects.
2539
- * @param {string} sessionId The session ID
2540
- * @param {number} from The starting index
2541
- * @param {number} howMany The number of items to return
2542
- * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
2543
- */
2544
- getMemoriesPaginated: function () {
2545
- var _getMemoriesPaginated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, from, howMany, type) {
2546
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2547
- while (1) {
2548
- switch (_context2.prev = _context2.next) {
2549
- case 0:
2550
- return _context2.abrupt("return", apiFetcher("/Memories/" + sessionId + "/" + from + "/" + howMany + (type ? "/" + type : ''), {
2551
- method: 'GET',
2552
- apiUrl: apiUrl
2553
- }));
2554
-
2555
- case 1:
2556
- case "end":
2557
- return _context2.stop();
2558
- }
2559
- }
2560
- }, _callee2);
2561
- }));
2562
-
2563
- function getMemoriesPaginated(_x3, _x4, _x5, _x6) {
2564
- return _getMemoriesPaginated.apply(this, arguments);
2565
- }
2566
-
2567
- return getMemoriesPaginated;
2568
- }(),
2569
-
2570
- /**
2571
- * Gets the details of a Memory object.
2572
- * @param {string} sessionId The session ID
2573
- * @param {string} memoryId The Memory object ID
2574
- */
2575
- getMemory: function () {
2576
- var _getMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, memoryId) {
2577
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2578
- while (1) {
2579
- switch (_context3.prev = _context3.next) {
2580
- case 0:
2581
- return _context3.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memoryId, {
2582
- method: 'GET',
2583
- apiUrl: apiUrl
2584
- }));
2585
-
2586
- case 1:
2587
- case "end":
2588
- return _context3.stop();
2589
- }
2590
- }
2591
- }, _callee3);
2592
- }));
2593
-
2594
- function getMemory(_x7, _x8) {
2595
- return _getMemory.apply(this, arguments);
2596
- }
2597
-
2598
- return getMemory;
2599
- }(),
2600
-
2601
- /**
2602
- * Updates an existing Memory object.
2603
- * @param {string} sessionId The session ID
2604
- * @param {Memory} memory The Memory object
2605
- */
2606
- patchMemory: function () {
2607
- var _patchMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, memory) {
2608
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2609
- while (1) {
2610
- switch (_context4.prev = _context4.next) {
2611
- case 0:
2612
- return _context4.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memory.memoryID, {
2613
- method: 'PATCH',
2614
- apiUrl: apiUrl,
2615
- body: memory
2616
- }));
2617
-
2618
- case 1:
2619
- case "end":
2620
- return _context4.stop();
2621
- }
2622
- }
2623
- }, _callee4);
2624
- }));
2625
-
2626
- function patchMemory(_x9, _x10) {
2627
- return _patchMemory.apply(this, arguments);
2628
- }
2629
-
2630
- return patchMemory;
2631
- }(),
2632
-
2633
- /**
2634
- * Removes an existing Memory object.
2635
- * @param {string} sessionId The session ID
2636
- * @param {string} memoryId The Memory object ID
2637
- */
2638
- deleteMemory: function () {
2639
- var _deleteMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, memoryId) {
2640
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2641
- while (1) {
2642
- switch (_context5.prev = _context5.next) {
2643
- case 0:
2644
- return _context5.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memoryId, {
2645
- method: 'DELETE',
2646
- apiUrl: apiUrl
2647
- }));
2648
-
2649
- case 1:
2650
- case "end":
2651
- return _context5.stop();
2652
- }
2653
- }
2654
- }, _callee5);
2655
- }));
2656
-
2657
- function deleteMemory(_x11, _x12) {
2658
- return _deleteMemory.apply(this, arguments);
2659
- }
2660
-
2661
- return deleteMemory;
2662
- }(),
2663
-
2664
- /**
2665
- * Adds a new Memory object.
2666
- * @param {string} sessionId The session ID
2667
- * @param {Memory} memory The Memory object
2668
- */
2669
- postMemory: function () {
2670
- var _postMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId, memory) {
2671
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2672
- while (1) {
2673
- switch (_context6.prev = _context6.next) {
2674
- case 0:
2675
- return _context6.abrupt("return", apiFetcher("/Memory/" + sessionId, {
2676
- method: 'POST',
2677
- apiUrl: apiUrl,
2678
- body: memory
2679
- }));
2680
-
2681
- case 1:
2682
- case "end":
2683
- return _context6.stop();
2684
- }
2685
- }
2686
- }, _callee6);
2687
- }));
2688
-
2689
- function postMemory(_x13, _x14) {
2690
- return _postMemory.apply(this, arguments);
2691
- }
2692
-
2693
- return postMemory;
2694
- }(),
2695
-
2696
- /**
2697
- * Checks if a Memory object is accessible from the specified session.
2698
- * @param {string} sessionId The session ID
2699
- * @param {string} memoryId The Memory object ID
2700
- */
2701
- getMemoryAccess: function () {
2702
- var _getMemoryAccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(sessionId, memoryId) {
2703
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2704
- while (1) {
2705
- switch (_context7.prev = _context7.next) {
2706
- case 0:
2707
- return _context7.abrupt("return", apiFetcher("/MemoryAccess/" + sessionId + "/" + memoryId, {
2708
- method: 'GET',
2709
- apiUrl: apiUrl
2710
- }));
2711
-
2712
- case 1:
2713
- case "end":
2714
- return _context7.stop();
2715
- }
2716
- }
2717
- }, _callee7);
2718
- }));
2719
-
2720
- function getMemoryAccess(_x15, _x16) {
2721
- return _getMemoryAccess.apply(this, arguments);
2722
- }
2723
-
2724
- return getMemoryAccess;
2725
- }()
2726
- };
2727
- });
2728
-
2729
- /***************
2730
- * *
2731
- * NLP *
2732
- * *
2733
- ***************/
2734
-
2735
- var nlp = (function (apiUrl) {
2736
- return {
2737
- /**
2738
- * Looks up the vector definition for a word.
2739
- * @param {string} sessionId The session ID
2740
- * @param {string} word Word to be looked up
2741
- */
2742
- getWordVector: function () {
2743
- var _getWordVector = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, word) {
2744
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2745
- while (1) {
2746
- switch (_context.prev = _context.next) {
2747
- case 0:
2748
- return _context.abrupt("return", apiFetcher("/WordVector/" + sessionId + "/" + word, {
2749
- method: 'GET',
2750
- apiUrl: apiUrl
2751
- }));
2752
-
2753
- case 1:
2754
- case "end":
2755
- return _context.stop();
2756
- }
2757
- }
2758
- }, _callee);
2759
- }));
2760
-
2761
- function getWordVector(_x, _x2) {
2762
- return _getWordVector.apply(this, arguments);
2763
- }
2764
-
2765
- return getWordVector;
2766
- }(),
2767
-
2768
- /**
2769
- * Searches for the 10 words most semantically similar words to the specified word.
2770
- * @param {string} sessionId The session ID
2771
- * @param {string} word Word to be looked up
2772
- */
2773
- getSimilarWords: function () {
2774
- var _getSimilarWords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, word) {
2775
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2776
- while (1) {
2777
- switch (_context2.prev = _context2.next) {
2778
- case 0:
2779
- return _context2.abrupt("return", apiFetcher("/SimilarWords/" + sessionId + "/" + word, {
2780
- method: 'GET',
2781
- apiUrl: apiUrl
2782
- }));
2783
-
2784
- case 1:
2785
- case "end":
2786
- return _context2.stop();
2787
- }
2788
- }
2789
- }, _callee2);
2790
- }));
2791
-
2792
- function getSimilarWords(_x3, _x4) {
2793
- return _getSimilarWords.apply(this, arguments);
2794
- }
2795
-
2796
- return getSimilarWords;
2797
- }(),
2798
-
2799
- /**
2800
- * Tries to guess the language of a sentence by analyzing key word occurrences.
2801
- * @param {string} sessionId The session ID
2802
- * @param {string} text Text to be used for guessing the language.
2803
- */
2804
- guessLanguage: function () {
2805
- var _guessLanguage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, text) {
2806
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2807
- while (1) {
2808
- switch (_context3.prev = _context3.next) {
2809
- case 0:
2810
- return _context3.abrupt("return", apiFetcher("/GuessLanguage/" + sessionId, {
2811
- method: 'POST',
2812
- apiUrl: apiUrl,
2813
- body: {
2814
- text: text
2815
- }
2816
- }));
2817
-
2818
- case 1:
2819
- case "end":
2820
- return _context3.stop();
2821
- }
2822
- }
2823
- }, _callee3);
2824
- }));
2825
-
2826
- function guessLanguage(_x5, _x6) {
2827
- return _guessLanguage.apply(this, arguments);
2828
- }
2829
-
2830
- return guessLanguage;
2831
- }(),
2832
-
2833
- /**
2834
- * Computes the similarity between a reference and a comparison sentences.
2835
- * @param {string} sessionId The session ID
2836
- * @param {string} referenceText Text of the reference sentence.
2837
- * @param {'QUESTION' | 'ANSWER'} referenceTextType Type of reference text, i.e. question or answer. Only types supported are: 'QUESTION' and 'ANSWER'.
2838
- * @param {string} comparisonText Text of the comparison sentence.
2839
- * @param {'QUESTION' | 'ANSWER'} comparisonTextType Type of comparison text, i.e. question or answer. Only types supported are: 'QUESTION' and 'ANSWER'.
2840
- */
2841
- computeSimilarity: function () {
2842
- var _computeSimilarity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, referenceText, referenceTextType, comparisonText, comparisonTextType) {
2843
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2844
- while (1) {
2845
- switch (_context4.prev = _context4.next) {
2846
- case 0:
2847
- return _context4.abrupt("return", apiFetcher("/ComputeSimilarity/" + sessionId, {
2848
- method: 'POST',
2849
- apiUrl: apiUrl,
2850
- body: {
2851
- referenceText: referenceText,
2852
- referenceTextType: referenceTextType,
2853
- comparisonText: comparisonText,
2854
- comparisonTextType: comparisonTextType
2855
- }
2856
- }));
2857
-
2858
- case 1:
2859
- case "end":
2860
- return _context4.stop();
2861
- }
2862
- }
2863
- }, _callee4);
2864
- }));
2865
-
2866
- function computeSimilarity(_x7, _x8, _x9, _x10, _x11) {
2867
- return _computeSimilarity.apply(this, arguments);
2868
- }
2869
-
2870
- return computeSimilarity;
2871
- }(),
2872
-
2873
- /**
2874
- * Checks the words of a sentence for their definition in the word vector dictionary.
2875
- * @param {string} sessionId The session ID
2876
- * @param {string} text Text of the sentence.
2877
- */
2878
- checkWords: function () {
2879
- var _checkWords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, text) {
2880
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2881
- while (1) {
2882
- switch (_context5.prev = _context5.next) {
2883
- case 0:
2884
- return _context5.abrupt("return", apiFetcher("/CheckWords/" + sessionId, {
2885
- method: 'POST',
2886
- apiUrl: apiUrl,
2887
- body: {
2888
- text: text
2889
- }
2890
- }));
2891
-
2892
- case 1:
2893
- case "end":
2894
- return _context5.stop();
2895
- }
2896
- }
2897
- }, _callee5);
2898
- }));
2899
-
2900
- function checkWords(_x12, _x13) {
2901
- return _checkWords.apply(this, arguments);
2902
- }
2903
-
2904
- return checkWords;
2905
- }()
2906
- };
2907
- });
2908
-
2909
- /******************
2910
- * *
2911
- * People *
2912
- * *
2913
- ******************/
2914
-
2915
- var people = (function (apiUrl) {
2916
- return {
2917
- /**
2918
- * Lists all Person objects.
2919
- * @param {string} sessionId The session ID
2920
- */
2921
- getPeople: function () {
2922
- var _getPeople = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
2923
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2924
- while (1) {
2925
- switch (_context.prev = _context.next) {
2926
- case 0:
2927
- return _context.abrupt("return", apiFetcher("/People/" + sessionId, {
2928
- method: 'GET',
2929
- apiUrl: apiUrl
2930
- }));
2931
-
2932
- case 1:
2933
- case "end":
2934
- return _context.stop();
2935
- }
2936
- }
2937
- }, _callee);
2938
- }));
2939
-
2940
- function getPeople(_x) {
2941
- return _getPeople.apply(this, arguments);
2942
- }
2943
-
2944
- return getPeople;
2945
- }(),
2946
-
2947
- /**
2948
- * Gets the details of a Person object.
2949
- * @param {string} sessionId The session ID
2950
- * @param {string} personId The Person object ID
2951
- */
2952
- getPerson: function () {
2953
- var _getPerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, personId) {
2954
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2955
- while (1) {
2956
- switch (_context2.prev = _context2.next) {
2957
- case 0:
2958
- return _context2.abrupt("return", apiFetcher("/Person/" + sessionId + "/" + personId, {
2959
- method: 'GET',
2960
- apiUrl: apiUrl
2961
- }));
2962
-
2963
- case 1:
2964
- case "end":
2965
- return _context2.stop();
2966
- }
2967
- }
2968
- }, _callee2);
2969
- }));
2970
-
2971
- function getPerson(_x2, _x3) {
2972
- return _getPerson.apply(this, arguments);
2973
- }
2974
-
2975
- return getPerson;
2976
- }(),
2977
-
2978
- /**
2979
- * Updates an existing Person object.
2980
- * @param {string} sessionId The session ID
2981
- * @param {Person} person The Person object
2982
- */
2983
- patchPerson: function () {
2984
- var _patchPerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, person) {
2985
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2986
- while (1) {
2987
- switch (_context3.prev = _context3.next) {
2988
- case 0:
2989
- return _context3.abrupt("return", apiFetcher("/Person/" + sessionId + "/" + person.personID, {
2990
- method: 'PATCH',
2991
- body: person,
2992
- apiUrl: apiUrl
2993
- }));
2994
-
2995
- case 1:
2996
- case "end":
2997
- return _context3.stop();
2998
- }
2999
- }
3000
- }, _callee3);
3001
- }));
3002
-
3003
- function patchPerson(_x4, _x5) {
3004
- return _patchPerson.apply(this, arguments);
3005
- }
3006
-
3007
- return patchPerson;
3008
- }(),
3009
-
3010
- /**
3011
- * Removes an existing Person object.
3012
- * @param {string} sessionId The session ID
3013
- * @param {string} personId The Person object ID
3014
- */
3015
- deletePerson: function () {
3016
- var _deletePerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, personId) {
3017
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3018
- while (1) {
3019
- switch (_context4.prev = _context4.next) {
3020
- case 0:
3021
- return _context4.abrupt("return", apiFetcher("/Person/" + sessionId + "/" + personId, {
3022
- method: 'DELETE',
3023
- apiUrl: apiUrl
3024
- }));
3025
-
3026
- case 1:
3027
- case "end":
3028
- return _context4.stop();
3029
- }
3030
- }
3031
- }, _callee4);
3032
- }));
3033
-
3034
- function deletePerson(_x6, _x7) {
3035
- return _deletePerson.apply(this, arguments);
3036
- }
3037
-
3038
- return deletePerson;
3039
- }(),
3040
-
3041
- /**
3042
- * Adds a new Person object.
3043
- * @param {string} sessionId - The session ID
3044
- * @param {Person} person - The Person object
3045
- */
3046
- postPerson: function () {
3047
- var _postPerson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, person) {
3048
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3049
- while (1) {
3050
- switch (_context5.prev = _context5.next) {
3051
- case 0:
3052
- return _context5.abrupt("return", apiFetcher("/Person/" + sessionId, {
3053
- method: 'POST',
3054
- body: person,
3055
- apiUrl: apiUrl
3056
- }));
3057
-
3058
- case 1:
3059
- case "end":
3060
- return _context5.stop();
3061
- }
3062
- }
3063
- }, _callee5);
3064
- }));
3065
-
3066
- function postPerson(_x8, _x9) {
3067
- return _postPerson.apply(this, arguments);
3068
- }
3069
-
3070
- return postPerson;
3071
- }()
3072
- };
3073
- });
3074
-
3075
- /*****************************
3076
- * *
3077
- * PromptedQuestions *
3078
- * *
3079
- *****************************/
3080
-
3081
- var promptedQuestions = (function (apiUrl) {
3082
- return {
3083
- /**
3084
- * Lists all Prompted Question objects.
3085
- * @param {string} sessionId The session ID
3086
- */
3087
- getPromptedQuestions: function () {
3088
- var _getPromptedQuestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3089
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3090
- while (1) {
3091
- switch (_context.prev = _context.next) {
3092
- case 0:
3093
- return _context.abrupt("return", apiFetcher("/PromptedQuestions/" + sessionId, {
3094
- method: 'GET',
3095
- apiUrl: apiUrl
3096
- }));
3097
-
3098
- case 1:
3099
- case "end":
3100
- return _context.stop();
3101
- }
3102
- }
3103
- }, _callee);
3104
- }));
3105
-
3106
- function getPromptedQuestions(_x) {
3107
- return _getPromptedQuestions.apply(this, arguments);
3108
- }
3109
-
3110
- return getPromptedQuestions;
3111
- }(),
3112
-
3113
- /**
3114
- * Gets the details of a Prompted Question object.
3115
- * @param {string} sessionId The session ID
3116
- * @param {string} promptId The Prompted Question object ID
3117
- */
3118
- getPromptedQuestion: function () {
3119
- var _getPromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, promptId) {
3120
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3121
- while (1) {
3122
- switch (_context2.prev = _context2.next) {
3123
- case 0:
3124
- return _context2.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId + "/" + promptId, {
3125
- method: 'GET',
3126
- apiUrl: apiUrl
3127
- }));
3128
-
3129
- case 1:
3130
- case "end":
3131
- return _context2.stop();
3132
- }
3133
- }
3134
- }, _callee2);
3135
- }));
3136
-
3137
- function getPromptedQuestion(_x2, _x3) {
3138
- return _getPromptedQuestion.apply(this, arguments);
3139
- }
3140
-
3141
- return getPromptedQuestion;
3142
- }(),
3143
-
3144
- /**
3145
- * Updates an existing Prompted Question object.
3146
- * @param {string} sessionId The session ID
3147
- * @param {string} promptId The Prompted Question object ID
3148
- */
3149
- patchPromptedQuestion: function () {
3150
- var _patchPromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, promptId) {
3151
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3152
- while (1) {
3153
- switch (_context3.prev = _context3.next) {
3154
- case 0:
3155
- return _context3.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId + "/" + promptId, {
3156
- method: 'GET',
3157
- apiUrl: apiUrl
3158
- }));
3159
-
3160
- case 1:
3161
- case "end":
3162
- return _context3.stop();
3163
- }
3164
- }
3165
- }, _callee3);
3166
- }));
3167
-
3168
- function patchPromptedQuestion(_x4, _x5) {
3169
- return _patchPromptedQuestion.apply(this, arguments);
3170
- }
3171
-
3172
- return patchPromptedQuestion;
3173
- }(),
3174
-
3175
- /**
3176
- * Removes an existing Prompted Question object.
3177
- * @param {string} sessionId The session ID
3178
- * @param {string} promptId The Prompted Question object ID
3179
- */
3180
- deletePromptedQuestion: function () {
3181
- var _deletePromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, promptId) {
3182
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3183
- while (1) {
3184
- switch (_context4.prev = _context4.next) {
3185
- case 0:
3186
- return _context4.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId + "/" + promptId, {
3187
- method: 'GET',
3188
- apiUrl: apiUrl
3189
- }));
3190
-
3191
- case 1:
3192
- case "end":
3193
- return _context4.stop();
3194
- }
3195
- }
3196
- }, _callee4);
3197
- }));
3198
-
3199
- function deletePromptedQuestion(_x6, _x7) {
3200
- return _deletePromptedQuestion.apply(this, arguments);
3201
- }
3202
-
3203
- return deletePromptedQuestion;
3204
- }(),
3205
-
3206
- /**
3207
- * Adds a new Prompted Question object.
3208
- * @param {string} sessionId The session ID
3209
- */
3210
- postPromptedQuestion: function () {
3211
- var _postPromptedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId) {
3212
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3213
- while (1) {
3214
- switch (_context5.prev = _context5.next) {
3215
- case 0:
3216
- return _context5.abrupt("return", apiFetcher("/PromptedQuestion/" + sessionId, {
3217
- method: 'GET',
3218
- apiUrl: apiUrl
3219
- }));
3220
-
3221
- case 1:
3222
- case "end":
3223
- return _context5.stop();
3224
- }
3225
- }
3226
- }, _callee5);
3227
- }));
3228
-
3229
- function postPromptedQuestion(_x8) {
3230
- return _postPromptedQuestion.apply(this, arguments);
3231
- }
3232
-
3233
- return postPromptedQuestion;
3234
- }()
3235
- };
3236
- });
3237
-
3238
- /******************
3239
- * *
3240
- * Search *
3241
- * *
3242
- ******************/
3243
-
3244
- var search = (function (apiUrl) {
3245
- return {
3246
- /**
3247
- * Searches for matching Memory objects using the same algorithm employed in the Text Entered event of the R1 state of the Dialog State Machine.
3248
- * @param {string} sessionId The session ID
3249
- * @param {SearchQuery} query Search query params
3250
- */
3251
- searchMemory: function () {
3252
- var _searchMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, query) {
3253
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3254
- while (1) {
3255
- switch (_context.prev = _context.next) {
3256
- case 0:
3257
- return _context.abrupt("return", apiFetcher("/Search/" + sessionId, {
3258
- method: 'POST',
3259
- body: query,
3260
- apiUrl: apiUrl
3261
- }));
3262
-
3263
- case 1:
3264
- case "end":
3265
- return _context.stop();
3266
- }
3267
- }
3268
- }, _callee);
3269
- }));
3270
-
3271
- function searchMemory(_x, _x2) {
3272
- return _searchMemory.apply(this, arguments);
3273
- }
3274
-
3275
- return searchMemory;
3276
- }(),
3277
-
3278
- /**
3279
- * Picks up to 5 random Memory objects using the same algorithm employed in the
3280
- * Timeout event of the R1 state of the Dialog State Machine.
3281
- * @param {string} sessionId The session ID
3282
- */
3283
- postRandom: function () {
3284
- var _postRandom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId) {
3285
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3286
- while (1) {
3287
- switch (_context2.prev = _context2.next) {
3288
- case 0:
3289
- return _context2.abrupt("return", apiFetcher("/Random/" + sessionId, {
3290
- method: 'POST',
3291
- apiUrl: apiUrl
3292
- }));
3293
-
3294
- case 1:
3295
- case "end":
3296
- return _context2.stop();
3297
- }
3298
- }
3299
- }, _callee2);
3300
- }));
3301
-
3302
- function postRandom(_x3) {
3303
- return _postRandom.apply(this, arguments);
3304
- }
3305
-
3306
- return postRandom;
3307
- }(),
3308
-
3309
- /**
3310
- * Picks up to 20 Memory Hint objects, obtained by searching for Story objects with a date or place set,
3311
- * and clustering dates and places within an uncertainty of at least 1 year or at least 100 km.
3312
- * Each Memory Hint may either suggest a date or a place, but not both.
3313
- * @param {string} sessionId The session ID
3314
- */
3315
- postHints: function () {
3316
- var _postHints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId) {
3317
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3318
- while (1) {
3319
- switch (_context3.prev = _context3.next) {
3320
- case 0:
3321
- return _context3.abrupt("return", apiFetcher("/Hints/" + sessionId, {
3322
- method: 'GET',
3323
- apiUrl: apiUrl
3324
- }));
3325
-
3326
- case 1:
3327
- case "end":
3328
- return _context3.stop();
3329
- }
3330
- }
3331
- }, _callee3);
3332
- }));
3333
-
3334
- function postHints(_x4) {
3335
- return _postHints.apply(this, arguments);
3336
- }
3337
-
3338
- return postHints;
3339
- }()
3340
- };
3341
- });
3342
-
3343
- /*******************
3344
- * *
3345
- * Session *
3346
- * *
3347
- *******************/
3348
-
3349
- var session = (function (apiUrl) {
3350
- return {
3351
- /**
3352
- * Initializes a new Dialog State Machine session for an existing Memori.
3353
- */
3354
- initSession: function () {
3355
- var _initSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
3356
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3357
- while (1) {
3358
- switch (_context.prev = _context.next) {
3359
- case 0:
3360
- return _context.abrupt("return", apiFetcher("/Session", {
3361
- method: 'POST',
3362
- body: params,
3363
- apiUrl: apiUrl
3364
- }));
3365
-
3366
- case 1:
3367
- case "end":
3368
- return _context.stop();
3369
- }
3370
- }
3371
- }, _callee);
3372
- }));
3373
-
3374
- function initSession(_x) {
3375
- return _initSession.apply(this, arguments);
3376
- }
3377
-
3378
- return initSession;
3379
- }(),
3380
-
3381
- /**
3382
- * Returns the current state of a session's Dialog State Machine.
3383
- * @param {string} sessionId The session ID
3384
- */
3385
- getSession: function () {
3386
- var _getSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId) {
3387
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3388
- while (1) {
3389
- switch (_context2.prev = _context2.next) {
3390
- case 0:
3391
- return _context2.abrupt("return", apiFetcher("/Session/" + sessionId, {
3392
- method: 'GET',
3393
- apiUrl: apiUrl
3394
- }));
3395
-
3396
- case 1:
3397
- case "end":
3398
- return _context2.stop();
3399
- }
3400
- }
3401
- }, _callee2);
3402
- }));
3403
-
3404
- function getSession(_x2) {
3405
- return _getSession.apply(this, arguments);
3406
- }
3407
-
3408
- return getSession;
3409
- }(),
3410
-
3411
- /**
3412
- * Closes the session and disposes of its Dialog State Machine.
3413
- * @param {string} sessionId The session ID
3414
- */
3415
- deleteSession: function () {
3416
- var _deleteSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId) {
3417
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3418
- while (1) {
3419
- switch (_context3.prev = _context3.next) {
3420
- case 0:
3421
- return _context3.abrupt("return", apiFetcher("/Session/" + sessionId, {
3422
- method: 'DELETE',
3423
- apiUrl: apiUrl
3424
- }));
3425
-
3426
- case 1:
3427
- case "end":
3428
- return _context3.stop();
3429
- }
3430
- }
3431
- }, _callee3);
3432
- }));
3433
-
3434
- function deleteSession(_x3) {
3435
- return _deleteSession.apply(this, arguments);
3436
- }
3437
-
3438
- return deleteSession;
3439
- }()
3440
- };
3441
- });
3442
-
3443
- /*****************
3444
- * *
3445
- * Stats *
3446
- * *
3447
- *****************/
3448
-
3449
- var stats = (function (apiUrl) {
3450
- return {
3451
- /**
3452
- * Computes usage statistics for the Memori of the current session.
3453
- * @param {string} sessionId The session ID
3454
- */
3455
- getStatistics: function () {
3456
- var _getStatistics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3457
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3458
- while (1) {
3459
- switch (_context.prev = _context.next) {
3460
- case 0:
3461
- return _context.abrupt("return", apiFetcher("/Statistics/" + sessionId, {
3462
- method: 'GET',
3463
- apiUrl: apiUrl
3464
- }));
3465
-
3466
- case 1:
3467
- case "end":
3468
- return _context.stop();
3469
- }
3470
- }
3471
- }, _callee);
3472
- }));
3473
-
3474
- function getStatistics(_x) {
3475
- return _getStatistics.apply(this, arguments);
3476
- }
3477
-
3478
- return getStatistics;
3479
- }(),
3480
-
3481
- /**
3482
- * Computes content quality indexes for a Memori.
3483
- * @param {string} memoriID - The Memori object ID
3484
- */
3485
- getContentQualityIndexes: function () {
3486
- var _getContentQualityIndexes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(memoriID) {
3487
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3488
- while (1) {
3489
- switch (_context2.prev = _context2.next) {
3490
- case 0:
3491
- return _context2.abrupt("return", apiFetcher("/ContentQualityIndexes/" + memoriID, {
3492
- method: 'GET',
3493
- apiUrl: apiUrl
3494
- }));
3495
-
3496
- case 1:
3497
- case "end":
3498
- return _context2.stop();
3499
- }
3500
- }
3501
- }, _callee2);
3502
- }));
3503
-
3504
- function getContentQualityIndexes(_x2) {
3505
- return _getContentQualityIndexes.apply(this, arguments);
3506
- }
3507
-
3508
- return getContentQualityIndexes;
3509
- }(),
3510
-
3511
- /**
3512
- * Computes text quality indexes for a Memori.
3513
- * @param {string} sessionId - The session ID
3514
- */
3515
- getTextQualityIndexes: function () {
3516
- var _getTextQualityIndexes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId) {
3517
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3518
- while (1) {
3519
- switch (_context3.prev = _context3.next) {
3520
- case 0:
3521
- return _context3.abrupt("return", apiFetcher("/TextQualityIndexes/" + sessionId, {
3522
- method: 'GET',
3523
- apiUrl: apiUrl
3524
- }));
3525
-
3526
- case 1:
3527
- case "end":
3528
- return _context3.stop();
3529
- }
3530
- }
3531
- }, _callee3);
3532
- }));
3533
-
3534
- function getTextQualityIndexes(_x3) {
3535
- return _getTextQualityIndexes.apply(this, arguments);
3536
- }
3537
-
3538
- return getTextQualityIndexes;
3539
- }(),
3540
-
3541
- /**
3542
- * Get the Event Log objects for the Memori of the current session in a specific date interval
3543
- * @param {string} sessionId The session ID
3544
- * @param {string} strDateFrom The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3545
- * @param {string} strDateTo The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3546
- */
3547
- getEventLogs: function () {
3548
- var _getEventLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, strDateFrom, strDateTo) {
3549
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3550
- while (1) {
3551
- switch (_context4.prev = _context4.next) {
3552
- case 0:
3553
- return _context4.abrupt("return", apiFetcher("/EventLogs/" + sessionId + "/" + strDateFrom + "/" + strDateTo, {
3554
- method: 'GET',
3555
- apiUrl: apiUrl
3556
- }));
3557
-
3558
- case 1:
3559
- case "end":
3560
- return _context4.stop();
3561
- }
3562
- }
3563
- }, _callee4);
3564
- }));
3565
-
3566
- function getEventLogs(_x4, _x5, _x6) {
3567
- return _getEventLogs.apply(this, arguments);
3568
- }
3569
-
3570
- return getEventLogs;
3571
- }(),
3572
-
3573
- /**
3574
- * Gets the Event Log objects for a specific Memory object in a specific date interval.
3575
- * @param {string} sessionId - The session ID
3576
- * @param {string} memoryId - The Memory object ID
3577
- * @param {string} strDateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3578
- * @param {string} strDateTo - The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3579
- */
3580
- getMemoryEventLogs: function () {
3581
- var _getMemoryEventLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, memoryId, strDateFrom, strDateTo) {
3582
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3583
- while (1) {
3584
- switch (_context5.prev = _context5.next) {
3585
- case 0:
3586
- return _context5.abrupt("return", apiFetcher("/EventLogs/" + sessionId + "/" + memoryId + "/" + strDateFrom + "/" + strDateTo, {
3587
- method: 'GET',
3588
- apiUrl: apiUrl
3589
- }));
3590
-
3591
- case 1:
3592
- case "end":
3593
- return _context5.stop();
3594
- }
3595
- }
3596
- }, _callee5);
3597
- }));
3598
-
3599
- function getMemoryEventLogs(_x7, _x8, _x9, _x10) {
3600
- return _getMemoryEventLogs.apply(this, arguments);
3601
- }
3602
-
3603
- return getMemoryEventLogs;
3604
- }(),
3605
-
3606
- /**
3607
- * Gets the Event Log objects for a specific Intent object in a specific date interval.
3608
- * @param {string} sessionId - The session ID
3609
- * @param {string} intentId - The Intent object ID
3610
- * @param {string} strDateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3611
- * @param {string} strDateTo - The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3612
- */
3613
- getIntentEventLogs: function () {
3614
- var _getIntentEventLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId, intentId, strDateFrom, strDateTo) {
3615
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3616
- while (1) {
3617
- switch (_context6.prev = _context6.next) {
3618
- case 0:
3619
- return _context6.abrupt("return", apiFetcher("/EventLogs/" + sessionId + "/" + intentId + "/" + strDateFrom + "/" + strDateTo, {
3620
- method: 'GET',
3621
- apiUrl: apiUrl
3622
- }));
3623
-
3624
- case 1:
3625
- case "end":
3626
- return _context6.stop();
3627
- }
3628
- }
3629
- }, _callee6);
3630
- }));
3631
-
3632
- function getIntentEventLogs(_x11, _x12, _x13, _x14) {
3633
- return _getIntentEventLogs.apply(this, arguments);
3634
- }
3635
-
3636
- return getIntentEventLogs;
3637
- }()
3638
- };
3639
- });
3640
-
3641
- /*******************************
3642
- * *
3643
- * UnansweredQuestions *
3644
- * *
3645
- *******************************/
3646
-
3647
- var unansweredQuestions = (function (apiUrl) {
3648
- return {
3649
- /**
3650
- * Lists all Unanswered Question objects.
3651
- * @param {string} sessionId The session ID
3652
- */
3653
- getUnansweredQuestions: function () {
3654
- var _getUnansweredQuestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3655
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3656
- while (1) {
3657
- switch (_context.prev = _context.next) {
3658
- case 0:
3659
- return _context.abrupt("return", apiFetcher("/UnansweredQuestions/" + sessionId, {
3660
- method: 'GET',
3661
- apiUrl: apiUrl
3662
- }));
3663
-
3664
- case 1:
3665
- case "end":
3666
- return _context.stop();
3667
- }
3668
- }
3669
- }, _callee);
3670
- }));
3671
-
3672
- function getUnansweredQuestions(_x) {
3673
- return _getUnansweredQuestions.apply(this, arguments);
3674
- }
3675
-
3676
- return getUnansweredQuestions;
3677
- }(),
3678
-
3679
- /**
3680
- * Lists paginated Unanswered Question objects.
3681
- * @param {string} sessionId The session ID
3682
- */
3683
- getUnansweredQuestionsPaginated: function () {
3684
- var _getUnansweredQuestionsPaginated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, from, howMany) {
3685
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3686
- while (1) {
3687
- switch (_context2.prev = _context2.next) {
3688
- case 0:
3689
- return _context2.abrupt("return", apiFetcher("/UnansweredQuestions/" + sessionId + "/" + from + "/" + howMany, {
3690
- method: 'GET',
3691
- apiUrl: apiUrl
3692
- }));
3693
-
3694
- case 1:
3695
- case "end":
3696
- return _context2.stop();
3697
- }
3698
- }
3699
- }, _callee2);
3700
- }));
3701
-
3702
- function getUnansweredQuestionsPaginated(_x2, _x3, _x4) {
3703
- return _getUnansweredQuestionsPaginated.apply(this, arguments);
3704
- }
3705
-
3706
- return getUnansweredQuestionsPaginated;
3707
- }(),
3708
-
3709
- /**
3710
- * Adds a new Unanswered Question object.
3711
- * @param {string} sessionId The session ID
3712
- * @param {UnansweredQuestion} unansweredQuestion The Unanswered Question object
3713
- */
3714
- postUnansweredQuestion: function () {
3715
- var _postUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, unansweredQuestion) {
3716
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3717
- while (1) {
3718
- switch (_context3.prev = _context3.next) {
3719
- case 0:
3720
- return _context3.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId, {
3721
- method: 'POST',
3722
- apiUrl: apiUrl,
3723
- body: unansweredQuestion
3724
- }));
3725
-
3726
- case 1:
3727
- case "end":
3728
- return _context3.stop();
3729
- }
3730
- }
3731
- }, _callee3);
3732
- }));
3733
-
3734
- function postUnansweredQuestion(_x5, _x6) {
3735
- return _postUnansweredQuestion.apply(this, arguments);
3736
- }
3737
-
3738
- return postUnansweredQuestion;
3739
- }(),
3740
-
3741
- /**
3742
- * Removes an existing Unanswered Question object.
3743
- * @param {string} sessionId The session ID
3744
- * @param {string} unansweredQuestionId The Unanswered Question object ID
3745
- */
3746
- deleteUnansweredQuestion: function () {
3747
- var _deleteUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, unansweredQuestionId) {
3748
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3749
- while (1) {
3750
- switch (_context4.prev = _context4.next) {
3751
- case 0:
3752
- return _context4.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId + "/" + unansweredQuestionId, {
3753
- method: 'DELETE',
3754
- apiUrl: apiUrl
3755
- }));
3756
-
3757
- case 1:
3758
- case "end":
3759
- return _context4.stop();
3760
- }
3761
- }
3762
- }, _callee4);
3763
- }));
3764
-
3765
- function deleteUnansweredQuestion(_x7, _x8) {
3766
- return _deleteUnansweredQuestion.apply(this, arguments);
3767
- }
3768
-
3769
- return deleteUnansweredQuestion;
3770
- }()
3771
- };
3772
- });
3773
-
3774
- /****************************
3775
- * *
3776
- * ContextVars *
3777
- * *
3778
- ****************************/
3779
-
3780
- var contextVars = (function (apiUrl) {
3781
- return {
3782
- /**
3783
- * Gets a list of currently known context variables.
3784
- * @param {string} sessionId The session ID
3785
- */
3786
- getContextVars: function () {
3787
- var _getContextVars = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3788
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3789
- while (1) {
3790
- switch (_context.prev = _context.next) {
3791
- case 0:
3792
- return _context.abrupt("return", apiFetcher("/ContextVars/" + sessionId, {
3793
- method: 'GET',
3794
- apiUrl: apiUrl
3795
- }));
3796
-
3797
- case 1:
3798
- case "end":
3799
- return _context.stop();
3800
- }
3801
- }
3802
- }, _callee);
3803
- }));
3804
-
3805
- function getContextVars(_x) {
3806
- return _getContextVars.apply(this, arguments);
3807
- }
3808
-
3809
- return getContextVars;
3810
- }(),
3811
-
3812
- /**
3813
- * Gets a list of currently known context variable names.
3814
- * @param {string} sessionId The session ID
3815
- */
3816
- getContextVarNames: function () {
3817
- var _getContextVarNames = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId) {
3818
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3819
- while (1) {
3820
- switch (_context2.prev = _context2.next) {
3821
- case 0:
3822
- return _context2.abrupt("return", apiFetcher("/ContextVarNames/" + sessionId, {
3823
- method: 'GET',
3824
- apiUrl: apiUrl
3825
- }));
3826
-
3827
- case 1:
3828
- case "end":
3829
- return _context2.stop();
3830
- }
3831
- }
3832
- }, _callee2);
3833
- }));
3834
-
3835
- function getContextVarNames(_x2) {
3836
- return _getContextVarNames.apply(this, arguments);
3837
- }
3838
-
3839
- return getContextVarNames;
3840
- }(),
3841
-
3842
- /**
3843
- * /memori/v2/ContextVarValues/{strSessionID}/{contextVarName}
3844
- * @param {string} sessionId The session ID
3845
- * @param {string} contextVarName The name of the context variable
3846
- */
3847
- getContextVarValues: function () {
3848
- var _getContextVarValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, contextVarName) {
3849
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3850
- while (1) {
3851
- switch (_context3.prev = _context3.next) {
3852
- case 0:
3853
- return _context3.abrupt("return", apiFetcher("/ContextVarValues/" + sessionId + "/" + contextVarName, {
3854
- method: 'GET',
3855
- apiUrl: apiUrl
3856
- }));
3857
-
3858
- case 1:
3859
- case "end":
3860
- return _context3.stop();
3861
- }
3862
- }
3863
- }, _callee3);
3864
- }));
3865
-
3866
- function getContextVarValues(_x3, _x4) {
3867
- return _getContextVarValues.apply(this, arguments);
3868
- }
3869
-
3870
- return getContextVarValues;
3871
- }()
3872
- };
3873
- });
3874
-
3875
- /****************************
3876
- * *
3877
- * CustomDictionary *
3878
- * *
3879
- ****************************/
3880
-
3881
- var customDictionary = (function (apiUrl) {
3882
- return {
3883
- /**
3884
- * Lists all Custom Words.
3885
- * @param {string} sessionId The session ID
3886
- */
3887
- getCustomWords: function () {
3888
- var _getCustomWords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
3889
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3890
- while (1) {
3891
- switch (_context.prev = _context.next) {
3892
- case 0:
3893
- return _context.abrupt("return", apiFetcher("/CustomWords/" + sessionId, {
3894
- method: 'GET',
3895
- apiUrl: apiUrl
3896
- }));
3897
-
3898
- case 1:
3899
- case "end":
3900
- return _context.stop();
3901
- }
3902
- }
3903
- }, _callee);
3904
- }));
3905
-
3906
- function getCustomWords(_x) {
3907
- return _getCustomWords.apply(this, arguments);
3908
- }
3909
-
3910
- return getCustomWords;
3911
- }(),
3912
-
3913
- /**
3914
- * Gets the details of a Custom Word object.
3915
- * @param {string} sessionId The session ID
3916
- * @param {string} customWordID The Custom Word object ID
3917
- */
3918
- getCustomWord: function () {
3919
- var _getCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, customWordID) {
3920
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3921
- while (1) {
3922
- switch (_context2.prev = _context2.next) {
3923
- case 0:
3924
- return _context2.abrupt("return", apiFetcher("/CustomWord/" + sessionId + "/" + customWordID, {
3925
- method: 'GET',
3926
- apiUrl: apiUrl
3927
- }));
3928
-
3929
- case 1:
3930
- case "end":
3931
- return _context2.stop();
3932
- }
3933
- }
3934
- }, _callee2);
3935
- }));
3936
-
3937
- function getCustomWord(_x2, _x3) {
3938
- return _getCustomWord.apply(this, arguments);
3939
- }
3940
-
3941
- return getCustomWord;
3942
- }(),
3943
-
3944
- /**
3945
- * Removes an existing Custom Word object.
3946
- * @param {string} sessionId The session ID
3947
- * @param {string} key The key of the Custom Word
3948
- */
3949
- deleteCustomWord: function () {
3950
- var _deleteCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, key) {
3951
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3952
- while (1) {
3953
- switch (_context3.prev = _context3.next) {
3954
- case 0:
3955
- return _context3.abrupt("return", apiFetcher("/CustomWord/" + sessionId + "/" + key, {
3956
- method: 'DELETE',
3957
- apiUrl: apiUrl
3958
- }));
3959
-
3960
- case 1:
3961
- case "end":
3962
- return _context3.stop();
3963
- }
3964
- }
3965
- }, _callee3);
3966
- }));
3967
-
3968
- function deleteCustomWord(_x4, _x5) {
3969
- return _deleteCustomWord.apply(this, arguments);
3970
- }
3971
-
3972
- return deleteCustomWord;
3973
- }(),
3974
-
3975
- /**
3976
- * Adds a new Custom Word object.
3977
- * @param {string} sessionId The session ID
3978
- * @param {CustomWord} customWord Custom Word
3979
- */
3980
- postCustomWord: function () {
3981
- var _postCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, customWord) {
3982
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3983
- while (1) {
3984
- switch (_context4.prev = _context4.next) {
3985
- case 0:
3986
- return _context4.abrupt("return", apiFetcher("/CustomWord/" + sessionId, {
3987
- method: 'POST',
3988
- apiUrl: apiUrl,
3989
- body: customWord
3990
- }));
3991
-
3992
- case 1:
3993
- case "end":
3994
- return _context4.stop();
3995
- }
3996
- }
3997
- }, _callee4);
3998
- }));
3999
-
4000
- function postCustomWord(_x6, _x7) {
4001
- return _postCustomWord.apply(this, arguments);
4002
- }
4003
-
4004
- return postCustomWord;
4005
- }(),
4006
-
4007
- /**
4008
- * Updates an existing Custom Word object.
4009
- * 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.
4010
- * @param {string} sessionId The session ID
4011
- * @param {CustomWord} customWord Custom Word
4012
- */
4013
- patchCustomWord: function () {
4014
- var _patchCustomWord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, customWord) {
4015
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
4016
- while (1) {
4017
- switch (_context5.prev = _context5.next) {
4018
- case 0:
4019
- return _context5.abrupt("return", apiFetcher("/CustomWord/" + sessionId + "/" + customWord.customWordID, {
4020
- method: 'PATCH',
4021
- apiUrl: apiUrl,
4022
- body: customWord
4023
- }));
4024
-
4025
- case 1:
4026
- case "end":
4027
- return _context5.stop();
4028
- }
4029
- }
4030
- }, _callee5);
4031
- }));
4032
-
4033
- function patchCustomWord(_x8, _x9) {
4034
- return _patchCustomWord.apply(this, arguments);
4035
- }
4036
-
4037
- return patchCustomWord;
4038
- }()
4039
- };
4040
- });
4041
-
4042
- /*************************
4043
- * *
4044
- * ChatLogs *
4045
- * *
4046
- *************************/
4047
-
4048
- var chatLogs = (function (apiUrl) {
4049
- return {
4050
- /**
4051
- * Gets the Chat Log objects for the Memori of the current session in a specific date interval.
4052
- * @param {string} sessionId The session ID
4053
- * @param {?string} dateFrom The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
4054
- * @param {?string} dateTo The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
4055
- */
4056
- getChatLogs: function () {
4057
- var _getChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, dateFrom, dateTo) {
4058
- return _regeneratorRuntime().wrap(function _callee$(_context) {
4059
- while (1) {
4060
- switch (_context.prev = _context.next) {
4061
- case 0:
4062
- return _context.abrupt("return", apiFetcher("/ChatLogs/" + sessionId + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
4063
- method: 'GET',
4064
- apiUrl: apiUrl
4065
- }));
4066
-
4067
- case 1:
4068
- case "end":
4069
- return _context.stop();
4070
- }
4071
- }
4072
- }, _callee);
4073
- }));
4074
-
4075
- function getChatLogs(_x, _x2, _x3) {
4076
- return _getChatLogs.apply(this, arguments);
4077
- }
4078
-
4079
- return getChatLogs;
4080
- }(),
4081
-
4082
- /**
4083
- * Gets the Chat Log objects for the Memori of the current session recorded during a specific other session.
4084
- * @param {string} sessionId The session ID
4085
- * @param {string} chatLogSessionID The session ID for which Chat Log objects are being searched
4086
- */
4087
- getSessionChatLogs: function () {
4088
- var _getSessionChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, chatLogSessionID) {
4089
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4090
- while (1) {
4091
- switch (_context2.prev = _context2.next) {
4092
- case 0:
4093
- return _context2.abrupt("return", apiFetcher("/SessionChatLogs/" + sessionId + "/" + chatLogSessionID, {
4094
- method: 'GET',
4095
- apiUrl: apiUrl
4096
- }));
4097
-
4098
- case 1:
4099
- case "end":
4100
- return _context2.stop();
4101
- }
4102
- }
4103
- }, _callee2);
4104
- }));
4105
-
4106
- function getSessionChatLogs(_x4, _x5) {
4107
- return _getSessionChatLogs.apply(this, arguments);
4108
- }
4109
-
4110
- return getSessionChatLogs;
4111
- }(),
4112
-
4113
- /**
4114
- * Removes all Chat Log objects in a specific date internval.
4115
- * @param {string} sessionId The session ID
4116
- * @param {?string} dateFrom The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
4117
- * @param {?string} dateTo The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
4118
- */
4119
- deleteChatLogs: function () {
4120
- var _deleteChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, dateFrom, dateTo) {
4121
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
4122
- while (1) {
4123
- switch (_context3.prev = _context3.next) {
4124
- case 0:
4125
- return _context3.abrupt("return", apiFetcher("/ChatLogs/" + sessionId + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
4126
- method: 'DELETE',
4127
- apiUrl: apiUrl
4128
- }));
4129
-
4130
- case 1:
4131
- case "end":
4132
- return _context3.stop();
4133
- }
4134
- }
4135
- }, _callee3);
4136
- }));
4137
-
4138
- function deleteChatLogs(_x6, _x7, _x8) {
4139
- return _deleteChatLogs.apply(this, arguments);
4140
- }
4141
-
4142
- return deleteChatLogs;
4143
- }(),
4144
-
4145
- /**
4146
- * Removes an existing Chat Log object.
4147
- * @param {string} sessionId The session ID
4148
- * @param {string} chatLogId The Chat Log object ID
4149
- */
4150
- deleteChatLog: function () {
4151
- var _deleteChatLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, chatLogId) {
4152
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
4153
- while (1) {
4154
- switch (_context4.prev = _context4.next) {
4155
- case 0:
4156
- return _context4.abrupt("return", apiFetcher("/ChatLog/" + sessionId + "/" + chatLogId, {
4157
- method: 'DELETE',
4158
- apiUrl: apiUrl
4159
- }));
4160
-
4161
- case 1:
4162
- case "end":
4163
- return _context4.stop();
4164
- }
4165
- }
4166
- }, _callee4);
4167
- }));
4168
-
4169
- function deleteChatLog(_x9, _x10) {
4170
- return _deleteChatLog.apply(this, arguments);
4171
- }
4172
-
4173
- return deleteChatLog;
4174
- }()
4175
- };
4176
- });
4177
-
4178
- var engine = (function (apiUrl) {
4179
- return _extends({
4180
- correlationPairs: correlationPairs(apiUrl)
4181
- }, correlationPairs(apiUrl), {
4182
- dialog: dialog(apiUrl)
4183
- }, dialog(apiUrl), {
4184
- importExport: importExport(apiUrl)
4185
- }, importExport(apiUrl), {
4186
- intents: intents(apiUrl)
4187
- }, intents(apiUrl), {
4188
- localizationKeys: localizationKeys(apiUrl)
4189
- }, localizationKeys(apiUrl), {
4190
- media: media(apiUrl)
4191
- }, media(apiUrl), {
4192
- memories: memories(apiUrl)
4193
- }, memories(apiUrl), {
4194
- nlp: nlp(apiUrl)
4195
- }, nlp(apiUrl), {
4196
- people: people(apiUrl)
4197
- }, people(apiUrl), {
4198
- promptedQuestions: promptedQuestions(apiUrl)
4199
- }, promptedQuestions(apiUrl), {
4200
- search: search(apiUrl)
4201
- }, search(apiUrl), {
4202
- session: session(apiUrl)
4203
- }, session(apiUrl), {
4204
- stats: stats(apiUrl)
4205
- }, stats(apiUrl), {
4206
- unansweredQuestions: unansweredQuestions(apiUrl)
4207
- }, unansweredQuestions(apiUrl), {
4208
- contextVars: contextVars(apiUrl)
4209
- }, contextVars(apiUrl), {
4210
- customDictionary: customDictionary(apiUrl)
4211
- }, customDictionary(apiUrl), {
4212
- chatLogs: chatLogs(apiUrl)
4213
- }, chatLogs(apiUrl));
4214
- });
4215
-
4216
- 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'];
4217
- var anonTag = '👤';
4218
-
4219
- var constants = {
4220
- __proto__: null,
4221
- allowedMediaTypes: allowedMediaTypes,
4222
- anonTag: anonTag
4223
- };
4224
-
4225
- var asset$1 = (function (apiUrl) {
4226
- return {
4227
- /**
4228
- * getResourceUrl
4229
- * @description Returns the correct URL of a resource from the DB.
4230
- * @param {obj} params
4231
- * @param {string=} params.type - wheather is the avatar or the cover
4232
- * @param {string=} params.resourceURI - the resource URI
4233
- * @param {string=} params.sessionID - the session ID, required for memory media attachments
4234
- * @param {string=} params.baseURL - the base URL for default static assets (defaults to https://app.twincreator.com)
4235
- * @returns {string}
4236
- */
4237
- getResourceUrl: function getResourceUrl(_ref) {
4238
- var type = _ref.type,
4239
- resourceURI = _ref.resourceURI,
4240
- sessionID = _ref.sessionID,
4241
- _ref$baseURL = _ref.baseURL,
4242
- baseURL = _ref$baseURL === void 0 ? 'https://app.twincreator.com' : _ref$baseURL;
4243
- var defaultUri = type === 'cover' ? baseURL + "/images/memoriCover.png" : baseURL + "/images/memoriAvatar.png";
4244
-
4245
- if (!resourceURI || resourceURI.length === 0) {
4246
- return defaultUri;
4247
- } else if (resourceURI.includes('memoriai/memory')) {
4248
- return resourceURI + "?memori-ai-session-id=" + sessionID;
4249
- } else if (resourceURI.startsWith('https://') || resourceURI.startsWith('http://')) {
4250
- return "" + resourceURI + (sessionID ? "/" + sessionID : '');
4251
- } else if (resourceURI.startsWith('cloud://')) {
4252
- return apiUrl.replace(/v2/, 'v1') + "/CloudAsset/" + resourceURI.replace('cloud://', '');
4253
- } else if (resourceURI.startsWith('guid://')) {
4254
- return apiUrl.replace(/v2/, 'v1') + "/GuidAsset/" + resourceURI.replace('guid://', '');
4255
- } else {
4256
- return defaultUri;
4257
- }
4258
- }
4259
- };
4260
- });
4261
-
4262
- var api = function api(hostname) {
4263
- var apiUrl = getApiUrl(hostname);
4264
- return _extends({
4265
- backend: backendAPI(apiUrl + "/api/v2")
4266
- }, engine(apiUrl + "/memori/v2"), {
4267
- constants: constants,
4268
- asset: asset$1(apiUrl + "/api/v2")
4269
- });
4270
- };
4271
-
4272
- export default api;
4273
- //# sourceMappingURL=memori-api-client.esm.js.map