@memori.ai/memori-api-client 6.0.2 → 6.0.4
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 +14 -0
- package/dist/backend/importExport.d.ts +5 -1
- package/dist/backend/importExport.js +24 -0
- package/dist/backend/importExport.js.map +1 -1
- package/dist/backend.d.ts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/types.d.ts +10 -1
- package/esm/backend/importExport.d.ts +5 -1
- package/esm/backend/importExport.js +24 -0
- package/esm/backend/importExport.js.map +1 -1
- package/esm/backend.d.ts +8 -0
- package/esm/index.d.ts +8 -0
- package/esm/types.d.ts +10 -1
- package/package.json +1 -1
- package/src/backend/importExport.ts +85 -27
- package/src/types.ts +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [6.0.4](https://github.com/memori-ai/memori-api-client/compare/v6.0.3...v6.0.4) (2025-03-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Changes
|
|
7
|
+
|
|
8
|
+
* update import/export functions to improve API handling and documentation ([4446f7a](https://github.com/memori-ai/memori-api-client/commit/4446f7a00312b413f53090586314d7ffec6f13e8))
|
|
9
|
+
|
|
10
|
+
## [6.0.3](https://github.com/memori-ai/memori-api-client/compare/v6.0.2...v6.0.3) (2025-03-13)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add ImportMemoriParams interface and import/export functions for Memori objects ([e3d641b](https://github.com/memori-ai/memori-api-client/commit/e3d641b288947cf8ee413b756f84e44cccc7ee36))
|
|
16
|
+
|
|
3
17
|
## [6.0.2](https://github.com/memori-ai/memori-api-client/compare/v6.0.1...v6.0.2) (2025-03-13)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResponseSpec, ImportParams, ImportStatus, CsvSpecs, JSONLSpecs } from '../types';
|
|
1
|
+
import type { ResponseSpec, ImportParams, ImportStatus, CsvSpecs, JSONLSpecs, ImportMemoriParams } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
3
|
importCSV: (authToken: string, memoriID: string, rows: string[], params: Omit<ImportParams, 'txtSpecs'>) => Promise<ResponseSpec & {
|
|
4
4
|
status: ImportStatus;
|
|
@@ -12,7 +12,11 @@ declare const _default: (apiUrl: string) => {
|
|
|
12
12
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<ImportParams, 'txtSpecs'>) => Promise<ResponseSpec & {
|
|
13
13
|
status: ImportStatus;
|
|
14
14
|
}>;
|
|
15
|
+
importMemori: (authToken: string, rows?: string[], params?: ImportMemoriParams) => Promise<ResponseSpec & {
|
|
16
|
+
status: ImportStatus;
|
|
17
|
+
}>;
|
|
15
18
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: CsvSpecs, password?: string) => Promise<string>;
|
|
16
19
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: JSONLSpecs, password?: string) => Promise<string>;
|
|
20
|
+
exportMemori: (authToken: string, memoriID: string, password?: string) => Promise<ArrayBuffer>;
|
|
17
21
|
};
|
|
18
22
|
export default _default;
|
|
@@ -34,6 +34,14 @@ exports.default = (apiUrl) => ({
|
|
|
34
34
|
...params,
|
|
35
35
|
},
|
|
36
36
|
}),
|
|
37
|
+
importMemori: async (authToken, rows, params) => (0, apiFetcher_1.apiFetcher)(`/ImportExport/ImportMemori/${authToken}`, {
|
|
38
|
+
apiUrl,
|
|
39
|
+
method: 'POST',
|
|
40
|
+
body: {
|
|
41
|
+
rows,
|
|
42
|
+
...params,
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
37
45
|
exportCSV: async (authToken, memoriID, csvSpecs, password) => (0, apiFetcher_1.apiFetcher)(`/ImportExport/ExportCSV/${authToken}/${memoriID}`, {
|
|
38
46
|
apiUrl,
|
|
39
47
|
method: 'POST',
|
|
@@ -52,5 +60,21 @@ exports.default = (apiUrl) => ({
|
|
|
52
60
|
},
|
|
53
61
|
text: true,
|
|
54
62
|
}),
|
|
63
|
+
exportMemori: async (authToken, memoriID, password) => {
|
|
64
|
+
const response = await fetch(`${apiUrl}/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
headers: {
|
|
67
|
+
'Content-Type': 'application/json',
|
|
68
|
+
Accept: 'application/octet-stream, application/zip',
|
|
69
|
+
},
|
|
70
|
+
body: JSON.stringify({
|
|
71
|
+
password,
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
if (!response.ok) {
|
|
75
|
+
throw new Error(`API responded with status: ${response.status}`);
|
|
76
|
+
}
|
|
77
|
+
return response.arrayBuffer();
|
|
78
|
+
},
|
|
55
79
|
});
|
|
56
80
|
//# sourceMappingURL=importExport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importExport.js","sourceRoot":"","sources":["../../src/backend/importExport.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"importExport.js","sourceRoot":"","sources":["../../src/backend/importExport.ts"],"names":[],"mappings":";;AAQA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACF,IAAA,uBAAU,EAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASH,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACF,IAAA,uBAAU,EAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,I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AM;QACd,IAAI,EAAE;YACJ,UAAU;YACV,QAAQ;SACT;QACD,IAAI,EAAE,IAAI;KACX,CAAoB;IAGvB,YAAY,EAAE,KAAK,EACjB,SAAiB,EACjB,QAAgB,EAChB,QAAiB,EACjB,EAAE;QAEF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,GAAG,MAAM,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAC9D;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,2CAA2C;aACpD;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,QAAQ;aACT,CAAC;SACH,CACF,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;SAClE;QAGD,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;CACF,CAAC,CAAC"}
|
package/dist/backend.d.ts
CHANGED
|
@@ -74,8 +74,12 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
74
74
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
75
75
|
status: import("./types").ImportStatus;
|
|
76
76
|
}>;
|
|
77
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
78
|
+
status: import("./types").ImportStatus;
|
|
79
|
+
}>;
|
|
77
80
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
78
81
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
82
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
79
83
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
80
84
|
notifications: import("./types").Notification[];
|
|
81
85
|
}>;
|
|
@@ -443,8 +447,12 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
443
447
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
444
448
|
status: import("./types").ImportStatus;
|
|
445
449
|
}>;
|
|
450
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
451
|
+
status: import("./types").ImportStatus;
|
|
452
|
+
}>;
|
|
446
453
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
447
454
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
455
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
448
456
|
};
|
|
449
457
|
process: {
|
|
450
458
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
package/dist/index.d.ts
CHANGED
|
@@ -794,8 +794,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
794
794
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
795
795
|
status: import("./types").ImportStatus;
|
|
796
796
|
}>;
|
|
797
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
798
|
+
status: import("./types").ImportStatus;
|
|
799
|
+
}>;
|
|
797
800
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
798
801
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
802
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
799
803
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
800
804
|
notifications: import("./types").Notification[];
|
|
801
805
|
}>;
|
|
@@ -1163,8 +1167,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1163
1167
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
1164
1168
|
status: import("./types").ImportStatus;
|
|
1165
1169
|
}>;
|
|
1170
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
1171
|
+
status: import("./types").ImportStatus;
|
|
1172
|
+
}>;
|
|
1166
1173
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
1167
1174
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
1175
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
1168
1176
|
};
|
|
1169
1177
|
process: {
|
|
1170
1178
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
package/dist/types.d.ts
CHANGED
|
@@ -818,6 +818,15 @@ export interface ImportParams {
|
|
|
818
818
|
linkTitle?: string;
|
|
819
819
|
memoryTags?: string[];
|
|
820
820
|
}
|
|
821
|
+
export interface ImportMemoriParams {
|
|
822
|
+
memoriName: string;
|
|
823
|
+
memoriPassword: string;
|
|
824
|
+
privacyType: string;
|
|
825
|
+
memoriZipAssetId: string;
|
|
826
|
+
importName: string;
|
|
827
|
+
forceImport: boolean;
|
|
828
|
+
notes: string;
|
|
829
|
+
}
|
|
821
830
|
export interface AnalysisParams {
|
|
822
831
|
query: string;
|
|
823
832
|
threshold?: number;
|
|
@@ -853,7 +862,7 @@ export interface ProcessStatus {
|
|
|
853
862
|
lastChangeTimestamp?: string;
|
|
854
863
|
}
|
|
855
864
|
export interface ImportStatus extends ProcessStatus {
|
|
856
|
-
importType: 'CSV' | 'TXT';
|
|
865
|
+
importType: 'CSV' | 'TXT' | 'Memori';
|
|
857
866
|
importSize: number;
|
|
858
867
|
importName?: string;
|
|
859
868
|
importedMemories?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResponseSpec, ImportParams, ImportStatus, CsvSpecs, JSONLSpecs } from '../types';
|
|
1
|
+
import type { ResponseSpec, ImportParams, ImportStatus, CsvSpecs, JSONLSpecs, ImportMemoriParams } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
3
|
importCSV: (authToken: string, memoriID: string, rows: string[], params: Omit<ImportParams, 'txtSpecs'>) => Promise<ResponseSpec & {
|
|
4
4
|
status: ImportStatus;
|
|
@@ -12,7 +12,11 @@ declare const _default: (apiUrl: string) => {
|
|
|
12
12
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<ImportParams, 'txtSpecs'>) => Promise<ResponseSpec & {
|
|
13
13
|
status: ImportStatus;
|
|
14
14
|
}>;
|
|
15
|
+
importMemori: (authToken: string, rows?: string[], params?: ImportMemoriParams) => Promise<ResponseSpec & {
|
|
16
|
+
status: ImportStatus;
|
|
17
|
+
}>;
|
|
15
18
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: CsvSpecs, password?: string) => Promise<string>;
|
|
16
19
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: JSONLSpecs, password?: string) => Promise<string>;
|
|
20
|
+
exportMemori: (authToken: string, memoriID: string, password?: string) => Promise<ArrayBuffer>;
|
|
17
21
|
};
|
|
18
22
|
export default _default;
|
|
@@ -32,6 +32,14 @@ export default (apiUrl) => ({
|
|
|
32
32
|
...params,
|
|
33
33
|
},
|
|
34
34
|
}),
|
|
35
|
+
importMemori: async (authToken, rows, params) => apiFetcher(`/ImportExport/ImportMemori/${authToken}`, {
|
|
36
|
+
apiUrl,
|
|
37
|
+
method: 'POST',
|
|
38
|
+
body: {
|
|
39
|
+
rows,
|
|
40
|
+
...params,
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
35
43
|
exportCSV: async (authToken, memoriID, csvSpecs, password) => apiFetcher(`/ImportExport/ExportCSV/${authToken}/${memoriID}`, {
|
|
36
44
|
apiUrl,
|
|
37
45
|
method: 'POST',
|
|
@@ -50,5 +58,21 @@ export default (apiUrl) => ({
|
|
|
50
58
|
},
|
|
51
59
|
text: true,
|
|
52
60
|
}),
|
|
61
|
+
exportMemori: async (authToken, memoriID, password) => {
|
|
62
|
+
const response = await fetch(`${apiUrl}/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
headers: {
|
|
65
|
+
'Content-Type': 'application/json',
|
|
66
|
+
Accept: 'application/octet-stream, application/zip',
|
|
67
|
+
},
|
|
68
|
+
body: JSON.stringify({
|
|
69
|
+
password,
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
if (!response.ok) {
|
|
73
|
+
throw new Error(`API responded with status: ${response.status}`);
|
|
74
|
+
}
|
|
75
|
+
return response.arrayBuffer();
|
|
76
|
+
},
|
|
53
77
|
});
|
|
54
78
|
//# sourceMappingURL=importExport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importExport.js","sourceRoot":"","sources":["../../src/backend/importExport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"importExport.js","sourceRoot":"","sources":["../../src/backend/importExport.ts"],"names":[],"mappings":"AAQA,OAAO,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YACJ,GAAG,MAAM;SACV;KACF,CAIA;IAUH,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,QAAkB,EAClB,QAAiB,EACjB,EAAE,CACF,UAAU,CAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,QAAQ;YACR,QAAQ;SACT;QACD,IAAI,EAAE,IAAI;KACX,CAAoB;IAUvB,WAAW,EAAE,KAAK,EAChB,SAAiB,EACjB,QAAgB,EAChB,UAAsB,EACtB,QAAiB,EACjB,EAAE,CACF,UAAU,CAAC,6BAA6B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC/D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,UAAU;YACV,QAAQ;SACT;QACD,IAAI,EAAE,IAAI;KACX,CAAoB;IAGvB,YAAY,EAAE,KAAK,EACjB,SAAiB,EACjB,QAAgB,EAChB,QAAiB,EACjB,EAAE;QAEF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,GAAG,MAAM,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAC9D;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,2CAA2C;aACpD;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,QAAQ;aACT,CAAC;SACH,CACF,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;SAClE;QAGD,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;CACF,CAAC,CAAC"}
|
package/esm/backend.d.ts
CHANGED
|
@@ -74,8 +74,12 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
74
74
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
75
75
|
status: import("./types").ImportStatus;
|
|
76
76
|
}>;
|
|
77
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
78
|
+
status: import("./types").ImportStatus;
|
|
79
|
+
}>;
|
|
77
80
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
78
81
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
82
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
79
83
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
80
84
|
notifications: import("./types").Notification[];
|
|
81
85
|
}>;
|
|
@@ -443,8 +447,12 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
443
447
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
444
448
|
status: import("./types").ImportStatus;
|
|
445
449
|
}>;
|
|
450
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
451
|
+
status: import("./types").ImportStatus;
|
|
452
|
+
}>;
|
|
446
453
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
447
454
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
455
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
448
456
|
};
|
|
449
457
|
process: {
|
|
450
458
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
package/esm/index.d.ts
CHANGED
|
@@ -794,8 +794,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
794
794
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
795
795
|
status: import("./types").ImportStatus;
|
|
796
796
|
}>;
|
|
797
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
798
|
+
status: import("./types").ImportStatus;
|
|
799
|
+
}>;
|
|
797
800
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
798
801
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
802
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
799
803
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
800
804
|
notifications: import("./types").Notification[];
|
|
801
805
|
}>;
|
|
@@ -1163,8 +1167,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1163
1167
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
1164
1168
|
status: import("./types").ImportStatus;
|
|
1165
1169
|
}>;
|
|
1170
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
1171
|
+
status: import("./types").ImportStatus;
|
|
1172
|
+
}>;
|
|
1166
1173
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
1167
1174
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
1175
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<ArrayBuffer>;
|
|
1168
1176
|
};
|
|
1169
1177
|
process: {
|
|
1170
1178
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
package/esm/types.d.ts
CHANGED
|
@@ -818,6 +818,15 @@ export interface ImportParams {
|
|
|
818
818
|
linkTitle?: string;
|
|
819
819
|
memoryTags?: string[];
|
|
820
820
|
}
|
|
821
|
+
export interface ImportMemoriParams {
|
|
822
|
+
memoriName: string;
|
|
823
|
+
memoriPassword: string;
|
|
824
|
+
privacyType: string;
|
|
825
|
+
memoriZipAssetId: string;
|
|
826
|
+
importName: string;
|
|
827
|
+
forceImport: boolean;
|
|
828
|
+
notes: string;
|
|
829
|
+
}
|
|
821
830
|
export interface AnalysisParams {
|
|
822
831
|
query: string;
|
|
823
832
|
threshold?: number;
|
|
@@ -853,7 +862,7 @@ export interface ProcessStatus {
|
|
|
853
862
|
lastChangeTimestamp?: string;
|
|
854
863
|
}
|
|
855
864
|
export interface ImportStatus extends ProcessStatus {
|
|
856
|
-
importType: 'CSV' | 'TXT';
|
|
865
|
+
importType: 'CSV' | 'TXT' | 'Memori';
|
|
857
866
|
importSize: number;
|
|
858
867
|
importName?: string;
|
|
859
868
|
importedMemories?: number;
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
ImportStatus,
|
|
5
5
|
CsvSpecs,
|
|
6
6
|
JSONLSpecs,
|
|
7
|
+
ImportMemoriParams,
|
|
7
8
|
} from '../types';
|
|
8
9
|
import { apiFetcher } from '../apiFetcher';
|
|
9
10
|
|
|
@@ -66,19 +67,19 @@ export default (apiUrl: string) => ({
|
|
|
66
67
|
}
|
|
67
68
|
>,
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Imports a dictionary to a Memori object.
|
|
72
|
+
* @param {string} authToken - The login token.
|
|
73
|
+
* @param {string} memoriID - The ID of the Memori object.
|
|
74
|
+
* @param {string[]} rows Rows of the CSV file.
|
|
75
|
+
* @param {ImportParams} params The specifications and content of the CSV file
|
|
76
|
+
*/
|
|
77
|
+
importDictionary: async (
|
|
78
|
+
authToken: string,
|
|
79
|
+
memoriID: string,
|
|
80
|
+
rows: string[],
|
|
81
|
+
params: Omit<ImportParams, 'txtSpecs'>
|
|
82
|
+
) =>
|
|
82
83
|
apiFetcher(`/ImportExport/ImportDictionary/${authToken}/${memoriID}`, {
|
|
83
84
|
apiUrl,
|
|
84
85
|
method: 'POST',
|
|
@@ -92,20 +93,48 @@ export default (apiUrl: string) => ({
|
|
|
92
93
|
}
|
|
93
94
|
>,
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
apiFetcher(
|
|
96
|
+
/**
|
|
97
|
+
* Starts an Import process for functions and intents from a jsonl file.
|
|
98
|
+
* @param {string} authToken - The login token.
|
|
99
|
+
* @param {string} memoriID - The ID of the Memori object.
|
|
100
|
+
* @param {string[]} rows Rows of the jsonl file.
|
|
101
|
+
* @param {ImportParams} params The specifications and content of the jsonl file
|
|
102
|
+
*/
|
|
103
|
+
importFunctionsIntents: async (
|
|
104
|
+
authToken: string,
|
|
105
|
+
memoriID: string,
|
|
106
|
+
rows: string[],
|
|
107
|
+
params: Omit<ImportParams, 'txtSpecs'>
|
|
108
|
+
) =>
|
|
109
|
+
apiFetcher(
|
|
110
|
+
`/ImportExport/ImportFunctionsIntents/${authToken}/${memoriID}`,
|
|
111
|
+
{
|
|
112
|
+
apiUrl,
|
|
113
|
+
method: 'POST',
|
|
114
|
+
body: {
|
|
115
|
+
rows,
|
|
116
|
+
...params,
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
) as Promise<
|
|
120
|
+
ResponseSpec & {
|
|
121
|
+
status: ImportStatus;
|
|
122
|
+
}
|
|
123
|
+
>,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Starts an Import process for functions and intents from a jsonl file.
|
|
127
|
+
* @param {string} authToken - The login token.
|
|
128
|
+
* @param {string} memoriID - The ID of the Memori object.
|
|
129
|
+
* @param {string[]} rows Rows of the jsonl file.
|
|
130
|
+
* @param {ImportParams} params The specifications and content of the jsonl file
|
|
131
|
+
*/
|
|
132
|
+
importMemori: async (
|
|
133
|
+
authToken: string,
|
|
134
|
+
rows?: string[],
|
|
135
|
+
params?: ImportMemoriParams
|
|
136
|
+
) =>
|
|
137
|
+
apiFetcher(`/ImportExport/ImportMemori/${authToken}`, {
|
|
109
138
|
apiUrl,
|
|
110
139
|
method: 'POST',
|
|
111
140
|
body: {
|
|
@@ -165,4 +194,33 @@ export default (apiUrl: string) => ({
|
|
|
165
194
|
},
|
|
166
195
|
text: true,
|
|
167
196
|
}) as Promise<string>,
|
|
197
|
+
|
|
198
|
+
// Updated exportMemori function for the API repository
|
|
199
|
+
exportMemori: async (
|
|
200
|
+
authToken: string,
|
|
201
|
+
memoriID: string,
|
|
202
|
+
password?: string
|
|
203
|
+
) => {
|
|
204
|
+
// Modify the apiFetcher call to handle binary data
|
|
205
|
+
const response = await fetch(
|
|
206
|
+
`${apiUrl}/ImportExport/ExportMemori/${authToken}/${memoriID}`,
|
|
207
|
+
{
|
|
208
|
+
method: 'POST',
|
|
209
|
+
headers: {
|
|
210
|
+
'Content-Type': 'application/json',
|
|
211
|
+
Accept: 'application/octet-stream, application/zip',
|
|
212
|
+
},
|
|
213
|
+
body: JSON.stringify({
|
|
214
|
+
password,
|
|
215
|
+
}),
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
if (!response.ok) {
|
|
220
|
+
throw new Error(`API responded with status: ${response.status}`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Return the binary data as ArrayBuffer
|
|
224
|
+
return response.arrayBuffer();
|
|
225
|
+
},
|
|
168
226
|
});
|
package/src/types.ts
CHANGED
|
@@ -1516,6 +1516,16 @@ export interface ImportParams {
|
|
|
1516
1516
|
memoryTags?: string[];
|
|
1517
1517
|
}
|
|
1518
1518
|
|
|
1519
|
+
export interface ImportMemoriParams {
|
|
1520
|
+
memoriName: string;
|
|
1521
|
+
memoriPassword: string;
|
|
1522
|
+
privacyType: string;
|
|
1523
|
+
memoriZipAssetId: string;
|
|
1524
|
+
importName: string;
|
|
1525
|
+
forceImport: boolean;
|
|
1526
|
+
notes: string;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1519
1529
|
export interface AnalysisParams {
|
|
1520
1530
|
/**
|
|
1521
1531
|
* @type {string}
|
|
@@ -1649,7 +1659,7 @@ export interface ImportStatus extends ProcessStatus {
|
|
|
1649
1659
|
* - CSV: for tabular documents
|
|
1650
1660
|
* - TXT: for text documents
|
|
1651
1661
|
*/
|
|
1652
|
-
importType: 'CSV' | 'TXT';
|
|
1662
|
+
importType: 'CSV' | 'TXT' | 'Memori';
|
|
1653
1663
|
/**
|
|
1654
1664
|
* @type {number}
|
|
1655
1665
|
* Size of the imported document in characters.
|