@memori.ai/memori-api-client 0.10.3 → 0.11.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.
@@ -1221,14 +1221,16 @@ var correlationPairs = (function (apiUrl) {
1221
1221
  /**
1222
1222
  * Lists all Correlation Pair objects.
1223
1223
  * @param {string} sessionId The session ID
1224
+ * @param {number=} from The starting index
1225
+ * @param {number=} howMany The number of items to return
1224
1226
  */
1225
1227
  getCorrelationPairs: function () {
1226
- var _getCorrelationPairs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
1228
+ var _getCorrelationPairs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, from, howMany) {
1227
1229
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1228
1230
  while (1) {
1229
1231
  switch (_context.prev = _context.next) {
1230
1232
  case 0:
1231
- return _context.abrupt("return", apiFetcher("/CorrelationPairs/" + sessionId, {
1233
+ return _context.abrupt("return", apiFetcher("/CorrelationPairs/" + sessionId + (from ? "/" + from + (howMany ? "/" + howMany : '') : ''), {
1232
1234
  method: 'GET',
1233
1235
  apiUrl: apiUrl
1234
1236
  }));
@@ -1241,7 +1243,7 @@ var correlationPairs = (function (apiUrl) {
1241
1243
  }, _callee);
1242
1244
  }));
1243
1245
 
1244
- function getCorrelationPairs(_x) {
1246
+ function getCorrelationPairs(_x, _x2, _x3) {
1245
1247
  return _getCorrelationPairs.apply(this, arguments);
1246
1248
  }
1247
1249
 
@@ -1249,19 +1251,20 @@ var correlationPairs = (function (apiUrl) {
1249
1251
  }(),
1250
1252
 
1251
1253
  /**
1252
- * Removes an existing Correlation Pair object.
1254
+ * Adds a new Correlation Pair object.
1253
1255
  * @param {string} sessionId The session ID
1254
- * @param {string} pairId The Correlation Pair object ID
1256
+ * @param {CorrelationPair} correlationPair The Correlation Pair object
1255
1257
  */
1256
- deleteCorrelationPair: function () {
1257
- var _deleteCorrelationPair = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, pairId) {
1258
+ postCorrelationPair: function () {
1259
+ var _postCorrelationPair = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, correlationPair) {
1258
1260
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1259
1261
  while (1) {
1260
1262
  switch (_context2.prev = _context2.next) {
1261
1263
  case 0:
1262
- return _context2.abrupt("return", apiFetcher("/CorrelationPair/" + sessionId + "/" + pairId, {
1263
- method: 'GET',
1264
- apiUrl: apiUrl
1264
+ return _context2.abrupt("return", apiFetcher("/CorrelationPair/" + sessionId, {
1265
+ method: 'POST',
1266
+ apiUrl: apiUrl,
1267
+ body: correlationPair
1265
1268
  }));
1266
1269
 
1267
1270
  case 1:
@@ -1272,7 +1275,38 @@ var correlationPairs = (function (apiUrl) {
1272
1275
  }, _callee2);
1273
1276
  }));
1274
1277
 
1275
- function deleteCorrelationPair(_x2, _x3) {
1278
+ function postCorrelationPair(_x4, _x5) {
1279
+ return _postCorrelationPair.apply(this, arguments);
1280
+ }
1281
+
1282
+ return postCorrelationPair;
1283
+ }(),
1284
+
1285
+ /**
1286
+ * Removes an existing Correlation Pair object.
1287
+ * @param {string} sessionId The session ID
1288
+ * @param {string} pairId The Correlation Pair object ID
1289
+ */
1290
+ deleteCorrelationPair: function () {
1291
+ var _deleteCorrelationPair = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, pairId) {
1292
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1293
+ while (1) {
1294
+ switch (_context3.prev = _context3.next) {
1295
+ case 0:
1296
+ return _context3.abrupt("return", apiFetcher("/CorrelationPair/" + sessionId + "/" + pairId, {
1297
+ method: 'DELETE',
1298
+ apiUrl: apiUrl
1299
+ }));
1300
+
1301
+ case 1:
1302
+ case "end":
1303
+ return _context3.stop();
1304
+ }
1305
+ }
1306
+ }, _callee3);
1307
+ }));
1308
+
1309
+ function deleteCorrelationPair(_x6, _x7) {
1276
1310
  return _deleteCorrelationPair.apply(this, arguments);
1277
1311
  }
1278
1312
 
@@ -2352,14 +2386,15 @@ var memories = (function (apiUrl) {
2352
2386
  /**
2353
2387
  * Lists all Memory objects.
2354
2388
  * @param {string} sessionId The session ID
2389
+ * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
2355
2390
  */
2356
2391
  getMemories: function () {
2357
- var _getMemories = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
2392
+ var _getMemories = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, type) {
2358
2393
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2359
2394
  while (1) {
2360
2395
  switch (_context.prev = _context.next) {
2361
2396
  case 0:
2362
- return _context.abrupt("return", apiFetcher("/Memories/" + sessionId, {
2397
+ return _context.abrupt("return", apiFetcher("/Memories/" + sessionId + (type ? "/" + type : ''), {
2363
2398
  method: 'GET',
2364
2399
  apiUrl: apiUrl
2365
2400
  }));
@@ -2372,7 +2407,7 @@ var memories = (function (apiUrl) {
2372
2407
  }, _callee);
2373
2408
  }));
2374
2409
 
2375
- function getMemories(_x) {
2410
+ function getMemories(_x, _x2) {
2376
2411
  return _getMemories.apply(this, arguments);
2377
2412
  }
2378
2413
 
@@ -2384,7 +2419,7 @@ var memories = (function (apiUrl) {
2384
2419
  * @param {string} sessionId The session ID
2385
2420
  * @param {number} from The starting index
2386
2421
  * @param {number} howMany The number of items to return
2387
- * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS
2422
+ * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
2388
2423
  */
2389
2424
  getMemoriesPaginated: function () {
2390
2425
  var _getMemoriesPaginated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, from, howMany, type) {
@@ -2405,7 +2440,7 @@ var memories = (function (apiUrl) {
2405
2440
  }, _callee2);
2406
2441
  }));
2407
2442
 
2408
- function getMemoriesPaginated(_x2, _x3, _x4, _x5) {
2443
+ function getMemoriesPaginated(_x3, _x4, _x5, _x6) {
2409
2444
  return _getMemoriesPaginated.apply(this, arguments);
2410
2445
  }
2411
2446
 
@@ -2436,7 +2471,7 @@ var memories = (function (apiUrl) {
2436
2471
  }, _callee3);
2437
2472
  }));
2438
2473
 
2439
- function getMemory(_x6, _x7) {
2474
+ function getMemory(_x7, _x8) {
2440
2475
  return _getMemory.apply(this, arguments);
2441
2476
  }
2442
2477
 
@@ -2468,7 +2503,7 @@ var memories = (function (apiUrl) {
2468
2503
  }, _callee4);
2469
2504
  }));
2470
2505
 
2471
- function patchMemory(_x8, _x9) {
2506
+ function patchMemory(_x9, _x10) {
2472
2507
  return _patchMemory.apply(this, arguments);
2473
2508
  }
2474
2509
 
@@ -2499,7 +2534,7 @@ var memories = (function (apiUrl) {
2499
2534
  }, _callee5);
2500
2535
  }));
2501
2536
 
2502
- function deleteMemory(_x10, _x11) {
2537
+ function deleteMemory(_x11, _x12) {
2503
2538
  return _deleteMemory.apply(this, arguments);
2504
2539
  }
2505
2540
 
@@ -2531,7 +2566,7 @@ var memories = (function (apiUrl) {
2531
2566
  }, _callee6);
2532
2567
  }));
2533
2568
 
2534
- function postMemory(_x12, _x13) {
2569
+ function postMemory(_x13, _x14) {
2535
2570
  return _postMemory.apply(this, arguments);
2536
2571
  }
2537
2572
 
@@ -2562,7 +2597,7 @@ var memories = (function (apiUrl) {
2562
2597
  }, _callee7);
2563
2598
  }));
2564
2599
 
2565
- function getMemoryAccess(_x14, _x15) {
2600
+ function getMemoryAccess(_x15, _x16) {
2566
2601
  return _getMemoryAccess.apply(this, arguments);
2567
2602
  }
2568
2603
 
@@ -3551,31 +3586,63 @@ var unansweredQuestions = (function (apiUrl) {
3551
3586
  return getUnansweredQuestionsPaginated;
3552
3587
  }(),
3553
3588
 
3589
+ /**
3590
+ * Adds a new Unanswered Question object.
3591
+ * @param {string} sessionId The session ID
3592
+ * @param {UnansweredQuestion} unansweredQuestion The Unanswered Question object
3593
+ */
3594
+ postUnansweredQuestion: function () {
3595
+ var _postUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, unansweredQuestion) {
3596
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3597
+ while (1) {
3598
+ switch (_context3.prev = _context3.next) {
3599
+ case 0:
3600
+ return _context3.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId, {
3601
+ method: 'POST',
3602
+ apiUrl: apiUrl,
3603
+ body: unansweredQuestion
3604
+ }));
3605
+
3606
+ case 1:
3607
+ case "end":
3608
+ return _context3.stop();
3609
+ }
3610
+ }
3611
+ }, _callee3);
3612
+ }));
3613
+
3614
+ function postUnansweredQuestion(_x5, _x6) {
3615
+ return _postUnansweredQuestion.apply(this, arguments);
3616
+ }
3617
+
3618
+ return postUnansweredQuestion;
3619
+ }(),
3620
+
3554
3621
  /**
3555
3622
  * Removes an existing Unanswered Question object.
3556
3623
  * @param {string} sessionId The session ID
3557
3624
  * @param {string} unansweredQuestionId The Unanswered Question object ID
3558
3625
  */
3559
3626
  deleteUnansweredQuestion: function () {
3560
- var _deleteUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, unansweredQuestionId) {
3561
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3627
+ var _deleteUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, unansweredQuestionId) {
3628
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3562
3629
  while (1) {
3563
- switch (_context3.prev = _context3.next) {
3630
+ switch (_context4.prev = _context4.next) {
3564
3631
  case 0:
3565
- return _context3.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId + "/" + unansweredQuestionId, {
3632
+ return _context4.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId + "/" + unansweredQuestionId, {
3566
3633
  method: 'DELETE',
3567
3634
  apiUrl: apiUrl
3568
3635
  }));
3569
3636
 
3570
3637
  case 1:
3571
3638
  case "end":
3572
- return _context3.stop();
3639
+ return _context4.stop();
3573
3640
  }
3574
3641
  }
3575
- }, _callee3);
3642
+ }, _callee4);
3576
3643
  }));
3577
3644
 
3578
- function deleteUnansweredQuestion(_x5, _x6) {
3645
+ function deleteUnansweredQuestion(_x7, _x8) {
3579
3646
  return _deleteUnansweredQuestion.apply(this, arguments);
3580
3647
  }
3581
3648
 
@@ -3892,6 +3959,37 @@ var chatLogs = (function (apiUrl) {
3892
3959
  return getChatLogs;
3893
3960
  }(),
3894
3961
 
3962
+ /**
3963
+ * Gets the Chat Log objects for the Memori of the current session recorded during a specific other session.
3964
+ * @param {string} sessionId The session ID
3965
+ * @param {string} chatLogSessionID The session ID for which Chat Log objects are being searched
3966
+ */
3967
+ getSessionChatLogs: function () {
3968
+ var _getSessionChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, chatLogSessionID) {
3969
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3970
+ while (1) {
3971
+ switch (_context2.prev = _context2.next) {
3972
+ case 0:
3973
+ return _context2.abrupt("return", apiFetcher("/SessionChatLogs/" + sessionId + "/" + chatLogSessionID, {
3974
+ method: 'GET',
3975
+ apiUrl: apiUrl
3976
+ }));
3977
+
3978
+ case 1:
3979
+ case "end":
3980
+ return _context2.stop();
3981
+ }
3982
+ }
3983
+ }, _callee2);
3984
+ }));
3985
+
3986
+ function getSessionChatLogs(_x4, _x5) {
3987
+ return _getSessionChatLogs.apply(this, arguments);
3988
+ }
3989
+
3990
+ return getSessionChatLogs;
3991
+ }(),
3992
+
3895
3993
  /**
3896
3994
  * Removes all Chat Log objects in a specific date internval.
3897
3995
  * @param {string} sessionId The session ID
@@ -3899,25 +3997,25 @@ var chatLogs = (function (apiUrl) {
3899
3997
  * @param {?string} dateTo The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
3900
3998
  */
3901
3999
  deleteChatLogs: function () {
3902
- var _deleteChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, dateFrom, dateTo) {
3903
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4000
+ var _deleteChatLogs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, dateFrom, dateTo) {
4001
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3904
4002
  while (1) {
3905
- switch (_context2.prev = _context2.next) {
4003
+ switch (_context3.prev = _context3.next) {
3906
4004
  case 0:
3907
- return _context2.abrupt("return", apiFetcher("/ChatLogs/" + sessionId + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
4005
+ return _context3.abrupt("return", apiFetcher("/ChatLogs/" + sessionId + (dateFrom ? "/" + dateFrom : '') + (dateFrom && dateTo ? "/" + dateTo : ''), {
3908
4006
  method: 'DELETE',
3909
4007
  apiUrl: apiUrl
3910
4008
  }));
3911
4009
 
3912
4010
  case 1:
3913
4011
  case "end":
3914
- return _context2.stop();
4012
+ return _context3.stop();
3915
4013
  }
3916
4014
  }
3917
- }, _callee2);
4015
+ }, _callee3);
3918
4016
  }));
3919
4017
 
3920
- function deleteChatLogs(_x4, _x5, _x6) {
4018
+ function deleteChatLogs(_x6, _x7, _x8) {
3921
4019
  return _deleteChatLogs.apply(this, arguments);
3922
4020
  }
3923
4021
 
@@ -3930,25 +4028,25 @@ var chatLogs = (function (apiUrl) {
3930
4028
  * @param {string} chatLogId The Chat Log object ID
3931
4029
  */
3932
4030
  deleteChatLog: function () {
3933
- var _deleteChatLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, chatLogId) {
3934
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
4031
+ var _deleteChatLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, chatLogId) {
4032
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3935
4033
  while (1) {
3936
- switch (_context3.prev = _context3.next) {
4034
+ switch (_context4.prev = _context4.next) {
3937
4035
  case 0:
3938
- return _context3.abrupt("return", apiFetcher("/ChatLog/" + sessionId + "/" + chatLogId, {
4036
+ return _context4.abrupt("return", apiFetcher("/ChatLog/" + sessionId + "/" + chatLogId, {
3939
4037
  method: 'DELETE',
3940
4038
  apiUrl: apiUrl
3941
4039
  }));
3942
4040
 
3943
4041
  case 1:
3944
4042
  case "end":
3945
- return _context3.stop();
4043
+ return _context4.stop();
3946
4044
  }
3947
4045
  }
3948
- }, _callee3);
4046
+ }, _callee4);
3949
4047
  }));
3950
4048
 
3951
- function deleteChatLog(_x7, _x8) {
4049
+ function deleteChatLog(_x9, _x10) {
3952
4050
  return _deleteChatLog.apply(this, arguments);
3953
4051
  }
3954
4052