@memori.ai/memori-api-client 1.1.0 → 1.2.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/CHANGELOG.md +7 -0
- package/dist/engine/importExport.d.ts +21 -4
- package/dist/memori-api-client.cjs.development.js +106 -11
- 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 +106 -11
- package/dist/memori-api-client.esm.js.map +1 -1
- package/dist/types.d.ts +74 -21
- package/package.json +1 -1
- package/src/engine/importExport.ts +44 -8
- package/src/types.ts +78 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [1.2.0](https://github.com/memori-ai/memori-api-client/compare/v1.1.0...v1.2.0) (2023-03-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update import apis ([1e924ef](https://github.com/memori-ai/memori-api-client/commit/1e924ef54c3ce38312a0e7d169fd60702c43f3f8))
|
|
9
|
+
|
|
3
10
|
## [1.1.0](https://github.com/memori-ai/memori-api-client/compare/v1.0.0...v1.1.0) (2023-02-16)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import { ResponseSpec, ImportReponse,
|
|
1
|
+
import { ResponseSpec, ImportReponse, ExportCSVParams, ImportParams } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
3
|
/**
|
|
4
4
|
* Imports memories from a CSV file.
|
|
5
5
|
* @param {string} sessionId The session ID
|
|
6
|
-
* @param {string[]}
|
|
7
|
-
* @param {
|
|
6
|
+
* @param {string[]} rows Rows of the CSV file.
|
|
7
|
+
* @param {ImportParams} params The specifications and content of the CSV file
|
|
8
8
|
*/
|
|
9
|
-
importCSV: (sessionId: string,
|
|
9
|
+
importCSV: (sessionId: string, rows: string[], params: ImportParams) => Promise<ResponseSpec & ImportReponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the status of an ongoing Import process.
|
|
12
|
+
* @param {string} importID The import process ID
|
|
13
|
+
*/
|
|
14
|
+
importStatus: (importID: string) => Promise<ResponseSpec & ImportReponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Interrupts an ongoing Import process.
|
|
17
|
+
* @param {string} importID The import process ID
|
|
18
|
+
*/
|
|
19
|
+
stopImport: (importID: string) => Promise<ResponseSpec & ImportReponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Imports memories from a TXT file.
|
|
22
|
+
* @param {string} sessionId The session ID
|
|
23
|
+
* @param {string[]} rows Rows of the TXT file.
|
|
24
|
+
* @param {ImportCSVParams} params The specifications and content of the TXT file
|
|
25
|
+
*/
|
|
26
|
+
importTXT: (sessionId: string, rows: string[], params: Omit<ImportParams, 'csvSpecs'>) => Promise<ResponseSpec & ImportReponse>;
|
|
10
27
|
/**
|
|
11
28
|
* Exports memories to a CSV file.
|
|
12
29
|
* @param {string} sessionID The session ID
|
|
@@ -1665,11 +1665,11 @@ var importExport = (function (apiUrl) {
|
|
|
1665
1665
|
/**
|
|
1666
1666
|
* Imports memories from a CSV file.
|
|
1667
1667
|
* @param {string} sessionId The session ID
|
|
1668
|
-
* @param {string[]}
|
|
1669
|
-
* @param {
|
|
1668
|
+
* @param {string[]} rows Rows of the CSV file.
|
|
1669
|
+
* @param {ImportParams} params The specifications and content of the CSV file
|
|
1670
1670
|
*/
|
|
1671
1671
|
importCSV: function () {
|
|
1672
|
-
var _importCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId,
|
|
1672
|
+
var _importCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId, rows, params) {
|
|
1673
1673
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1674
1674
|
while (1) {
|
|
1675
1675
|
switch (_context.prev = _context.next) {
|
|
@@ -1678,7 +1678,7 @@ var importExport = (function (apiUrl) {
|
|
|
1678
1678
|
method: 'POST',
|
|
1679
1679
|
apiUrl: apiUrl,
|
|
1680
1680
|
body: _extends({
|
|
1681
|
-
|
|
1681
|
+
rows: rows
|
|
1682
1682
|
}, params)
|
|
1683
1683
|
}));
|
|
1684
1684
|
|
|
@@ -1697,6 +1697,101 @@ var importExport = (function (apiUrl) {
|
|
|
1697
1697
|
return importCSV;
|
|
1698
1698
|
}(),
|
|
1699
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
|
+
|
|
1700
1795
|
/**
|
|
1701
1796
|
* Exports memories to a CSV file.
|
|
1702
1797
|
* @param {string} sessionID The session ID
|
|
@@ -1704,12 +1799,12 @@ var importExport = (function (apiUrl) {
|
|
|
1704
1799
|
* @returns The CSV file content
|
|
1705
1800
|
*/
|
|
1706
1801
|
exportCSV: function () {
|
|
1707
|
-
var _exportCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1708
|
-
return _regeneratorRuntime().wrap(function
|
|
1802
|
+
var _exportCSV = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sessionID, params) {
|
|
1803
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1709
1804
|
while (1) {
|
|
1710
|
-
switch (
|
|
1805
|
+
switch (_context5.prev = _context5.next) {
|
|
1711
1806
|
case 0:
|
|
1712
|
-
return
|
|
1807
|
+
return _context5.abrupt("return", apiFetcher("/ImportExport/ExportCSV/" + sessionID, {
|
|
1713
1808
|
method: 'POST',
|
|
1714
1809
|
apiUrl: apiUrl,
|
|
1715
1810
|
body: params,
|
|
@@ -1718,13 +1813,13 @@ var importExport = (function (apiUrl) {
|
|
|
1718
1813
|
|
|
1719
1814
|
case 1:
|
|
1720
1815
|
case "end":
|
|
1721
|
-
return
|
|
1816
|
+
return _context5.stop();
|
|
1722
1817
|
}
|
|
1723
1818
|
}
|
|
1724
|
-
},
|
|
1819
|
+
}, _callee5);
|
|
1725
1820
|
}));
|
|
1726
1821
|
|
|
1727
|
-
function exportCSV(
|
|
1822
|
+
function exportCSV(_x9, _x10) {
|
|
1728
1823
|
return _exportCSV.apply(this, arguments);
|
|
1729
1824
|
}
|
|
1730
1825
|
|