@memori.ai/memori-api-client 0.3.2 → 0.4.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.
- package/dist/engine/memories.d.ts +8 -0
- package/dist/engine/unansweredQuestions.d.ts +8 -0
- package/dist/memori-api-client.cjs.development.js +101 -41
- package/dist/memori-api-client.cjs.development.js.map +1 -1
- package/dist/memori-api-client.cjs.production.min.js +1 -1
- package/dist/memori-api-client.cjs.production.min.js.map +1 -1
- package/dist/memori-api-client.esm.js +101 -41
- package/dist/memori-api-client.esm.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/engine/memories.ts +19 -0
- package/src/engine/unansweredQuestions.ts +19 -0
- package/src/types.ts +1 -0
|
@@ -7,6 +7,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
7
7
|
getMemories: (sessionId: string) => Promise<ResponseSpec & {
|
|
8
8
|
memories: Memory[];
|
|
9
9
|
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Lists paginated Memory objects.
|
|
12
|
+
* @param {string} sessionId The session ID
|
|
13
|
+
*/
|
|
14
|
+
getMemoriesPaginated: (sessionId: string, from: number, howMany: number) => Promise<ResponseSpec & {
|
|
15
|
+
count: number;
|
|
16
|
+
memories: Memory[];
|
|
17
|
+
}>;
|
|
10
18
|
/**
|
|
11
19
|
* Gets the details of a Memory object.
|
|
12
20
|
* @param {string} sessionId The session ID
|
|
@@ -7,6 +7,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
7
7
|
getUnansweredQuestions: (sessionId: string) => Promise<ResponseSpec & {
|
|
8
8
|
unansweredQuestions: UnansweredQuestion[];
|
|
9
9
|
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Lists paginated Unanswered Question objects.
|
|
12
|
+
* @param {string} sessionId The session ID
|
|
13
|
+
*/
|
|
14
|
+
getUnansweredQuestionsPaginated: (sessionId: string, from: number, howMany: string) => Promise<ResponseSpec & {
|
|
15
|
+
count: number;
|
|
16
|
+
unansweredQuestions: UnansweredQuestion[];
|
|
17
|
+
}>;
|
|
10
18
|
/**
|
|
11
19
|
* Removes an existing Unanswered Question object.
|
|
12
20
|
* @param {string} sessionId The session ID
|
|
@@ -2350,17 +2350,16 @@ var memories = (function (apiUrl) {
|
|
|
2350
2350
|
}(),
|
|
2351
2351
|
|
|
2352
2352
|
/**
|
|
2353
|
-
*
|
|
2353
|
+
* Lists paginated Memory objects.
|
|
2354
2354
|
* @param {string} sessionId The session ID
|
|
2355
|
-
* @param {string} memoryId The Memory object ID
|
|
2356
2355
|
*/
|
|
2357
|
-
|
|
2358
|
-
var
|
|
2356
|
+
getMemoriesPaginated: function () {
|
|
2357
|
+
var _getMemoriesPaginated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, from, howMany) {
|
|
2359
2358
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2360
2359
|
while (1) {
|
|
2361
2360
|
switch (_context2.prev = _context2.next) {
|
|
2362
2361
|
case 0:
|
|
2363
|
-
return _context2.abrupt("return", apiFetcher("/
|
|
2362
|
+
return _context2.abrupt("return", apiFetcher("/Memories/" + sessionId + "/" + from + "/" + howMany, {
|
|
2364
2363
|
method: 'GET',
|
|
2365
2364
|
apiUrl: apiUrl
|
|
2366
2365
|
}));
|
|
@@ -2373,7 +2372,38 @@ var memories = (function (apiUrl) {
|
|
|
2373
2372
|
}, _callee2);
|
|
2374
2373
|
}));
|
|
2375
2374
|
|
|
2376
|
-
function
|
|
2375
|
+
function getMemoriesPaginated(_x2, _x3, _x4) {
|
|
2376
|
+
return _getMemoriesPaginated.apply(this, arguments);
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
return getMemoriesPaginated;
|
|
2380
|
+
}(),
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* Gets the details of a Memory object.
|
|
2384
|
+
* @param {string} sessionId The session ID
|
|
2385
|
+
* @param {string} memoryId The Memory object ID
|
|
2386
|
+
*/
|
|
2387
|
+
getMemory: function () {
|
|
2388
|
+
var _getMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, memoryId) {
|
|
2389
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2390
|
+
while (1) {
|
|
2391
|
+
switch (_context3.prev = _context3.next) {
|
|
2392
|
+
case 0:
|
|
2393
|
+
return _context3.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memoryId, {
|
|
2394
|
+
method: 'GET',
|
|
2395
|
+
apiUrl: apiUrl
|
|
2396
|
+
}));
|
|
2397
|
+
|
|
2398
|
+
case 1:
|
|
2399
|
+
case "end":
|
|
2400
|
+
return _context3.stop();
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
}, _callee3);
|
|
2404
|
+
}));
|
|
2405
|
+
|
|
2406
|
+
function getMemory(_x5, _x6) {
|
|
2377
2407
|
return _getMemory.apply(this, arguments);
|
|
2378
2408
|
}
|
|
2379
2409
|
|
|
@@ -2386,12 +2416,12 @@ var memories = (function (apiUrl) {
|
|
|
2386
2416
|
* @param {Memory} memory The Memory object
|
|
2387
2417
|
*/
|
|
2388
2418
|
patchMemory: function () {
|
|
2389
|
-
var _patchMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2390
|
-
return _regeneratorRuntime().wrap(function
|
|
2419
|
+
var _patchMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sessionId, memory) {
|
|
2420
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2391
2421
|
while (1) {
|
|
2392
|
-
switch (
|
|
2422
|
+
switch (_context4.prev = _context4.next) {
|
|
2393
2423
|
case 0:
|
|
2394
|
-
return
|
|
2424
|
+
return _context4.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memory.memoryID, {
|
|
2395
2425
|
method: 'PATCH',
|
|
2396
2426
|
apiUrl: apiUrl,
|
|
2397
2427
|
body: memory
|
|
@@ -2399,13 +2429,13 @@ var memories = (function (apiUrl) {
|
|
|
2399
2429
|
|
|
2400
2430
|
case 1:
|
|
2401
2431
|
case "end":
|
|
2402
|
-
return
|
|
2432
|
+
return _context4.stop();
|
|
2403
2433
|
}
|
|
2404
2434
|
}
|
|
2405
|
-
},
|
|
2435
|
+
}, _callee4);
|
|
2406
2436
|
}));
|
|
2407
2437
|
|
|
2408
|
-
function patchMemory(
|
|
2438
|
+
function patchMemory(_x7, _x8) {
|
|
2409
2439
|
return _patchMemory.apply(this, arguments);
|
|
2410
2440
|
}
|
|
2411
2441
|
|
|
@@ -2418,25 +2448,25 @@ var memories = (function (apiUrl) {
|
|
|
2418
2448
|
* @param {string} memoryId The Memory object ID
|
|
2419
2449
|
*/
|
|
2420
2450
|
deleteMemory: function () {
|
|
2421
|
-
var _deleteMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2422
|
-
return _regeneratorRuntime().wrap(function
|
|
2451
|
+
var _deleteMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionId, memoryId) {
|
|
2452
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2423
2453
|
while (1) {
|
|
2424
|
-
switch (
|
|
2454
|
+
switch (_context5.prev = _context5.next) {
|
|
2425
2455
|
case 0:
|
|
2426
|
-
return
|
|
2456
|
+
return _context5.abrupt("return", apiFetcher("/Memory/" + sessionId + "/" + memoryId, {
|
|
2427
2457
|
method: 'DELETE',
|
|
2428
2458
|
apiUrl: apiUrl
|
|
2429
2459
|
}));
|
|
2430
2460
|
|
|
2431
2461
|
case 1:
|
|
2432
2462
|
case "end":
|
|
2433
|
-
return
|
|
2463
|
+
return _context5.stop();
|
|
2434
2464
|
}
|
|
2435
2465
|
}
|
|
2436
|
-
},
|
|
2466
|
+
}, _callee5);
|
|
2437
2467
|
}));
|
|
2438
2468
|
|
|
2439
|
-
function deleteMemory(
|
|
2469
|
+
function deleteMemory(_x9, _x10) {
|
|
2440
2470
|
return _deleteMemory.apply(this, arguments);
|
|
2441
2471
|
}
|
|
2442
2472
|
|
|
@@ -2449,12 +2479,12 @@ var memories = (function (apiUrl) {
|
|
|
2449
2479
|
* @param {Memory} memory The Memory object
|
|
2450
2480
|
*/
|
|
2451
2481
|
postMemory: function () {
|
|
2452
|
-
var _postMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2453
|
-
return _regeneratorRuntime().wrap(function
|
|
2482
|
+
var _postMemory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId, memory) {
|
|
2483
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
2454
2484
|
while (1) {
|
|
2455
|
-
switch (
|
|
2485
|
+
switch (_context6.prev = _context6.next) {
|
|
2456
2486
|
case 0:
|
|
2457
|
-
return
|
|
2487
|
+
return _context6.abrupt("return", apiFetcher("/Memory/" + sessionId, {
|
|
2458
2488
|
method: 'POST',
|
|
2459
2489
|
apiUrl: apiUrl,
|
|
2460
2490
|
body: memory
|
|
@@ -2462,13 +2492,13 @@ var memories = (function (apiUrl) {
|
|
|
2462
2492
|
|
|
2463
2493
|
case 1:
|
|
2464
2494
|
case "end":
|
|
2465
|
-
return
|
|
2495
|
+
return _context6.stop();
|
|
2466
2496
|
}
|
|
2467
2497
|
}
|
|
2468
|
-
},
|
|
2498
|
+
}, _callee6);
|
|
2469
2499
|
}));
|
|
2470
2500
|
|
|
2471
|
-
function postMemory(
|
|
2501
|
+
function postMemory(_x11, _x12) {
|
|
2472
2502
|
return _postMemory.apply(this, arguments);
|
|
2473
2503
|
}
|
|
2474
2504
|
|
|
@@ -2481,25 +2511,25 @@ var memories = (function (apiUrl) {
|
|
|
2481
2511
|
* @param {string} memoryId The Memory object ID
|
|
2482
2512
|
*/
|
|
2483
2513
|
getMemoryAccess: function () {
|
|
2484
|
-
var _getMemoryAccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2485
|
-
return _regeneratorRuntime().wrap(function
|
|
2514
|
+
var _getMemoryAccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(sessionId, memoryId) {
|
|
2515
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
2486
2516
|
while (1) {
|
|
2487
|
-
switch (
|
|
2517
|
+
switch (_context7.prev = _context7.next) {
|
|
2488
2518
|
case 0:
|
|
2489
|
-
return
|
|
2519
|
+
return _context7.abrupt("return", apiFetcher("/MemoryAccess/" + sessionId + "/" + memoryId, {
|
|
2490
2520
|
method: 'GET',
|
|
2491
2521
|
apiUrl: apiUrl
|
|
2492
2522
|
}));
|
|
2493
2523
|
|
|
2494
2524
|
case 1:
|
|
2495
2525
|
case "end":
|
|
2496
|
-
return
|
|
2526
|
+
return _context7.stop();
|
|
2497
2527
|
}
|
|
2498
2528
|
}
|
|
2499
|
-
},
|
|
2529
|
+
}, _callee7);
|
|
2500
2530
|
}));
|
|
2501
2531
|
|
|
2502
|
-
function getMemoryAccess(
|
|
2532
|
+
function getMemoryAccess(_x13, _x14) {
|
|
2503
2533
|
return _getMemoryAccess.apply(this, arguments);
|
|
2504
2534
|
}
|
|
2505
2535
|
|
|
@@ -3459,18 +3489,17 @@ var unansweredQuestions = (function (apiUrl) {
|
|
|
3459
3489
|
}(),
|
|
3460
3490
|
|
|
3461
3491
|
/**
|
|
3462
|
-
*
|
|
3492
|
+
* Lists paginated Unanswered Question objects.
|
|
3463
3493
|
* @param {string} sessionId The session ID
|
|
3464
|
-
* @param {string} unansweredQuestionId The Unanswered Question object ID
|
|
3465
3494
|
*/
|
|
3466
|
-
|
|
3467
|
-
var
|
|
3495
|
+
getUnansweredQuestionsPaginated: function () {
|
|
3496
|
+
var _getUnansweredQuestionsPaginated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId, from, howMany) {
|
|
3468
3497
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3469
3498
|
while (1) {
|
|
3470
3499
|
switch (_context2.prev = _context2.next) {
|
|
3471
3500
|
case 0:
|
|
3472
|
-
return _context2.abrupt("return", apiFetcher("/
|
|
3473
|
-
method: '
|
|
3501
|
+
return _context2.abrupt("return", apiFetcher("/UnansweredQuestions/" + sessionId + "/" + from + "/" + howMany, {
|
|
3502
|
+
method: 'GET',
|
|
3474
3503
|
apiUrl: apiUrl
|
|
3475
3504
|
}));
|
|
3476
3505
|
|
|
@@ -3482,7 +3511,38 @@ var unansweredQuestions = (function (apiUrl) {
|
|
|
3482
3511
|
}, _callee2);
|
|
3483
3512
|
}));
|
|
3484
3513
|
|
|
3485
|
-
function
|
|
3514
|
+
function getUnansweredQuestionsPaginated(_x2, _x3, _x4) {
|
|
3515
|
+
return _getUnansweredQuestionsPaginated.apply(this, arguments);
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
return getUnansweredQuestionsPaginated;
|
|
3519
|
+
}(),
|
|
3520
|
+
|
|
3521
|
+
/**
|
|
3522
|
+
* Removes an existing Unanswered Question object.
|
|
3523
|
+
* @param {string} sessionId The session ID
|
|
3524
|
+
* @param {string} unansweredQuestionId The Unanswered Question object ID
|
|
3525
|
+
*/
|
|
3526
|
+
deleteUnansweredQuestion: function () {
|
|
3527
|
+
var _deleteUnansweredQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, unansweredQuestionId) {
|
|
3528
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
3529
|
+
while (1) {
|
|
3530
|
+
switch (_context3.prev = _context3.next) {
|
|
3531
|
+
case 0:
|
|
3532
|
+
return _context3.abrupt("return", apiFetcher("/UnansweredQuestion/" + sessionId + "/" + unansweredQuestionId, {
|
|
3533
|
+
method: 'DELETE',
|
|
3534
|
+
apiUrl: apiUrl
|
|
3535
|
+
}));
|
|
3536
|
+
|
|
3537
|
+
case 1:
|
|
3538
|
+
case "end":
|
|
3539
|
+
return _context3.stop();
|
|
3540
|
+
}
|
|
3541
|
+
}
|
|
3542
|
+
}, _callee3);
|
|
3543
|
+
}));
|
|
3544
|
+
|
|
3545
|
+
function deleteUnansweredQuestion(_x5, _x6) {
|
|
3486
3546
|
return _deleteUnansweredQuestion.apply(this, arguments);
|
|
3487
3547
|
}
|
|
3488
3548
|
|