@memori.ai/memori-api-client 1.2.0 → 2.1.0

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