@memori.ai/memori-api-client 6.0.2 → 6.0.3
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/backend/importExport.d.ts +5 -1
- package/dist/backend/importExport.js +16 -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 +16 -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 +41 -0
- package/src/types.ts +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [6.0.3](https://github.com/memori-ai/memori-api-client/compare/v6.0.2...v6.0.3) (2025-03-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add ImportMemoriParams interface and import/export functions for Memori objects ([e3d641b](https://github.com/memori-ai/memori-api-client/commit/e3d641b288947cf8ee413b756f84e44cccc7ee36))
|
|
9
|
+
|
|
3
10
|
## [6.0.2](https://github.com/memori-ai/memori-api-client/compare/v6.0.1...v6.0.2) (2025-03-13)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -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<string>;
|
|
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,13 @@ exports.default = (apiUrl) => ({
|
|
|
52
60
|
},
|
|
53
61
|
text: true,
|
|
54
62
|
}),
|
|
63
|
+
exportMemori: async (authToken, memoriID, password) => (0, apiFetcher_1.apiFetcher)(`/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
64
|
+
apiUrl,
|
|
65
|
+
method: 'POST',
|
|
66
|
+
text: true,
|
|
67
|
+
body: {
|
|
68
|
+
password,
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
55
71
|
});
|
|
56
72
|
//# 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,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASD,gBAAgB,EAAE,KAAK,EACrB,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACJ,IAAA,uBAAU,EAAC,kCAAkC,SAAS,IAAI,QAAQ,EAAE,EAAE;QACpE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASD,sBAAsB,EAAE,KAAK,EAC3B,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACJ,IAAA,uBAAU,EAAC,wCAAwC,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC1E,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASA,YAAY,EAAE,KAAK,EAClB,SAAiB,EACjB,IAAc,EACd,MAA0B,EAC1B,EAAE,CACJ,IAAA,uBAAU,EAAC,8BAA8B,SAAS,EAAE,EAAE;QACpD,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IAUH,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,QAAkB,EAClB,QAAiB,EACjB,EAAE,CACF,IAAA,uBAAU,EAAC,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,IAAA,uBAAU,EAAC,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;IAGrB,YAAY,EAAE,KAAK,EACnB,SAAiB,EACjB,QAAgB,EAChB,QAAiB,EACjB,EAAE,CACA,IAAA,uBAAU,EAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAChE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;QACV,IAAI,EAAE;YACJ,QAAQ;SACT;KACF,CAAoB;CAC1B,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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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<string>;
|
|
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,13 @@ export default (apiUrl) => ({
|
|
|
50
58
|
},
|
|
51
59
|
text: true,
|
|
52
60
|
}),
|
|
61
|
+
exportMemori: async (authToken, memoriID, password) => apiFetcher(`/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
62
|
+
apiUrl,
|
|
63
|
+
method: 'POST',
|
|
64
|
+
text: true,
|
|
65
|
+
body: {
|
|
66
|
+
password,
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
53
69
|
});
|
|
54
70
|
//# 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,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACF,UAAU,CAAC,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,UAAU,CAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASD,gBAAgB,EAAE,KAAK,EACrB,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACJ,UAAU,CAAC,kCAAkC,SAAS,IAAI,QAAQ,EAAE,EAAE;QACpE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASD,sBAAsB,EAAE,KAAK,EAC3B,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACJ,UAAU,CAAC,wCAAwC,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC1E,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASA,YAAY,EAAE,KAAK,EAClB,SAAiB,EACjB,IAAc,EACd,MAA0B,EAC1B,EAAE,CACJ,UAAU,CAAC,8BAA8B,SAAS,EAAE,EAAE;QACpD,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;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;IAGrB,YAAY,EAAE,KAAK,EACnB,SAAiB,EACjB,QAAgB,EAChB,QAAiB,EACjB,EAAE,CACA,UAAU,CAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAChE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;QACV,IAAI,EAAE;YACJ,QAAQ;SACT;KACF,CAAoB;CAC1B,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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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[], params: import("./types").ImportMemoriParams) => 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<string>;
|
|
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
|
|
|
@@ -118,6 +119,31 @@ export default (apiUrl: string) => ({
|
|
|
118
119
|
}
|
|
119
120
|
>,
|
|
120
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Starts an Import process for functions and intents from a jsonl file.
|
|
124
|
+
* @param {string} authToken - The login token.
|
|
125
|
+
* @param {string} memoriID - The ID of the Memori object.
|
|
126
|
+
* @param {string[]} rows Rows of the jsonl file.
|
|
127
|
+
* @param {ImportParams} params The specifications and content of the jsonl file
|
|
128
|
+
*/
|
|
129
|
+
importMemori: async (
|
|
130
|
+
authToken: string,
|
|
131
|
+
rows: string[],
|
|
132
|
+
params: ImportMemoriParams
|
|
133
|
+
) =>
|
|
134
|
+
apiFetcher(`/ImportExport/ImportMemori/${authToken}`, {
|
|
135
|
+
apiUrl,
|
|
136
|
+
method: 'POST',
|
|
137
|
+
body: {
|
|
138
|
+
rows,
|
|
139
|
+
...params,
|
|
140
|
+
},
|
|
141
|
+
}) as Promise<
|
|
142
|
+
ResponseSpec & {
|
|
143
|
+
status: ImportStatus;
|
|
144
|
+
}
|
|
145
|
+
>,
|
|
146
|
+
|
|
121
147
|
/**
|
|
122
148
|
* Exports contents of a Memori object to a CSV file.
|
|
123
149
|
* @param {string} authToken - The login token.
|
|
@@ -165,4 +191,19 @@ export default (apiUrl: string) => ({
|
|
|
165
191
|
},
|
|
166
192
|
text: true,
|
|
167
193
|
}) as Promise<string>,
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
exportMemori: async (
|
|
197
|
+
authToken: string,
|
|
198
|
+
memoriID: string,
|
|
199
|
+
password?: string
|
|
200
|
+
) =>
|
|
201
|
+
apiFetcher(`/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
202
|
+
apiUrl,
|
|
203
|
+
method: 'POST',
|
|
204
|
+
text: true,
|
|
205
|
+
body: {
|
|
206
|
+
password,
|
|
207
|
+
},
|
|
208
|
+
}) as Promise<string>,
|
|
168
209
|
});
|
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.
|