@memori.ai/memori-api-client 6.0.3 → 6.0.5
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 +2 -2
- package/dist/backend/importExport.js +17 -8
- package/dist/backend/importExport.js.map +1 -1
- package/dist/backend.d.ts +4 -4
- package/dist/index.d.ts +4 -4
- package/esm/backend/importExport.d.ts +2 -2
- package/esm/backend/importExport.js +17 -8
- package/esm/backend/importExport.js.map +1 -1
- package/esm/backend.d.ts +4 -4
- package/esm/index.d.ts +4 -4
- package/package.json +1 -1
- package/src/backend/importExport.ts +72 -57
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [6.0.5](https://github.com/memori-ai/memori-api-client/compare/v6.0.4...v6.0.5) (2025-03-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Changes
|
|
7
|
+
|
|
8
|
+
* streamline apiFetcher usage for binary data handling in import/export functions ([6adc72a](https://github.com/memori-ai/memori-api-client/commit/6adc72a8293ef4ecc0cccc00c74fe3ee9e69164e))
|
|
9
|
+
|
|
10
|
+
## [6.0.4](https://github.com/memori-ai/memori-api-client/compare/v6.0.3...v6.0.4) (2025-03-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Changes
|
|
14
|
+
|
|
15
|
+
* update import/export functions to improve API handling and documentation ([4446f7a](https://github.com/memori-ai/memori-api-client/commit/4446f7a00312b413f53090586314d7ffec6f13e8))
|
|
16
|
+
|
|
3
17
|
## [6.0.3](https://github.com/memori-ai/memori-api-client/compare/v6.0.2...v6.0.3) (2025-03-13)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -12,11 +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
|
|
15
|
+
importMemori: (authToken: string, rows?: string[], params?: ImportMemoriParams) => Promise<ResponseSpec & {
|
|
16
16
|
status: ImportStatus;
|
|
17
17
|
}>;
|
|
18
18
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: CsvSpecs, password?: string) => Promise<string>;
|
|
19
19
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: JSONLSpecs, password?: string) => Promise<string>;
|
|
20
|
-
exportMemori: (authToken: string, memoriID: string, password?: string) => Promise<
|
|
20
|
+
exportMemori: (authToken: string, memoriID: string, password?: string) => Promise<any>;
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
@@ -60,13 +60,22 @@ exports.default = (apiUrl) => ({
|
|
|
60
60
|
},
|
|
61
61
|
text: true,
|
|
62
62
|
}),
|
|
63
|
-
exportMemori: async (authToken, memoriID, password) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
exportMemori: async (authToken, memoriID, password) => {
|
|
64
|
+
const response = await (0, apiFetcher_1.apiFetcher)(`/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
65
|
+
apiUrl,
|
|
66
|
+
method: 'POST',
|
|
67
|
+
headers: {
|
|
68
|
+
'Content-Type': 'application/json',
|
|
69
|
+
Accept: 'application/octet-stream, application/zip',
|
|
70
|
+
},
|
|
71
|
+
body: {
|
|
72
|
+
password,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
if (!response.ok) {
|
|
76
|
+
throw new Error(`API responded with status: ${response.status}`);
|
|
77
|
+
}
|
|
78
|
+
return response.arrayBuffer();
|
|
79
|
+
},
|
|
71
80
|
});
|
|
72
81
|
//# sourceMappingURL=importExport.js.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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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QACD,IAAI,EAAE,IAAI;KACX,CAAoB;IAGvB,YAAY,EAAE,KAAK,EACjB,SAAiB,EACjB,QAAgB,EAChB,QAAiB,EACjB,EAAE;QAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAU,EAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;YACvF,MAAM;YACN,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,2CAA2C;aACpD;YACD,IAAI,EAAE;gBACJ,QAAQ;aACT;SACF,CAAC,CAAC;QAEH,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,12 +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
|
|
77
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
78
78
|
status: import("./types").ImportStatus;
|
|
79
79
|
}>;
|
|
80
80
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
81
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<
|
|
82
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
83
83
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
84
84
|
notifications: import("./types").Notification[];
|
|
85
85
|
}>;
|
|
@@ -447,12 +447,12 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
447
447
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
448
448
|
status: import("./types").ImportStatus;
|
|
449
449
|
}>;
|
|
450
|
-
importMemori: (authToken: string, rows
|
|
450
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
451
451
|
status: import("./types").ImportStatus;
|
|
452
452
|
}>;
|
|
453
453
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
454
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<
|
|
455
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
456
456
|
};
|
|
457
457
|
process: {
|
|
458
458
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
package/dist/index.d.ts
CHANGED
|
@@ -794,12 +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
|
|
797
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
798
798
|
status: import("./types").ImportStatus;
|
|
799
799
|
}>;
|
|
800
800
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
801
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<
|
|
802
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
803
803
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
804
804
|
notifications: import("./types").Notification[];
|
|
805
805
|
}>;
|
|
@@ -1167,12 +1167,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1167
1167
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
1168
1168
|
status: import("./types").ImportStatus;
|
|
1169
1169
|
}>;
|
|
1170
|
-
importMemori: (authToken: string, rows
|
|
1170
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
1171
1171
|
status: import("./types").ImportStatus;
|
|
1172
1172
|
}>;
|
|
1173
1173
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
1174
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<
|
|
1175
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
1176
1176
|
};
|
|
1177
1177
|
process: {
|
|
1178
1178
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
@@ -12,11 +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
|
|
15
|
+
importMemori: (authToken: string, rows?: string[], params?: ImportMemoriParams) => Promise<ResponseSpec & {
|
|
16
16
|
status: ImportStatus;
|
|
17
17
|
}>;
|
|
18
18
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: CsvSpecs, password?: string) => Promise<string>;
|
|
19
19
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: JSONLSpecs, password?: string) => Promise<string>;
|
|
20
|
-
exportMemori: (authToken: string, memoriID: string, password?: string) => Promise<
|
|
20
|
+
exportMemori: (authToken: string, memoriID: string, password?: string) => Promise<any>;
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
@@ -58,13 +58,22 @@ export default (apiUrl) => ({
|
|
|
58
58
|
},
|
|
59
59
|
text: true,
|
|
60
60
|
}),
|
|
61
|
-
exportMemori: async (authToken, memoriID, password) =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
exportMemori: async (authToken, memoriID, password) => {
|
|
62
|
+
const response = await apiFetcher(`/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
63
|
+
apiUrl,
|
|
64
|
+
method: 'POST',
|
|
65
|
+
headers: {
|
|
66
|
+
'Content-Type': 'application/json',
|
|
67
|
+
Accept: 'application/octet-stream, application/zip',
|
|
68
|
+
},
|
|
69
|
+
body: {
|
|
70
|
+
password,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
if (!response.ok) {
|
|
74
|
+
throw new Error(`API responded with status: ${response.status}`);
|
|
75
|
+
}
|
|
76
|
+
return response.arrayBuffer();
|
|
77
|
+
},
|
|
69
78
|
});
|
|
70
79
|
//# sourceMappingURL=importExport.js.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,QA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B,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,UAAU,CAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;YACvF,MAAM;YACN,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,2CAA2C;aACpD;YACD,IAAI,EAAE;gBACJ,QAAQ;aACT;SACF,CAAC,CAAC;QAEH,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,12 +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
|
|
77
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
78
78
|
status: import("./types").ImportStatus;
|
|
79
79
|
}>;
|
|
80
80
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
81
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<
|
|
82
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
83
83
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
84
84
|
notifications: import("./types").Notification[];
|
|
85
85
|
}>;
|
|
@@ -447,12 +447,12 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
447
447
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
448
448
|
status: import("./types").ImportStatus;
|
|
449
449
|
}>;
|
|
450
|
-
importMemori: (authToken: string, rows
|
|
450
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
451
451
|
status: import("./types").ImportStatus;
|
|
452
452
|
}>;
|
|
453
453
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
454
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<
|
|
455
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
456
456
|
};
|
|
457
457
|
process: {
|
|
458
458
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
package/esm/index.d.ts
CHANGED
|
@@ -794,12 +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
|
|
797
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
798
798
|
status: import("./types").ImportStatus;
|
|
799
799
|
}>;
|
|
800
800
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
801
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<
|
|
802
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
803
803
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
804
804
|
notifications: import("./types").Notification[];
|
|
805
805
|
}>;
|
|
@@ -1167,12 +1167,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1167
1167
|
importFunctionsIntents: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
1168
1168
|
status: import("./types").ImportStatus;
|
|
1169
1169
|
}>;
|
|
1170
|
-
importMemori: (authToken: string, rows
|
|
1170
|
+
importMemori: (authToken: string, rows?: string[] | undefined, params?: import("./types").ImportMemoriParams | undefined) => Promise<import("./types").ResponseSpec & {
|
|
1171
1171
|
status: import("./types").ImportStatus;
|
|
1172
1172
|
}>;
|
|
1173
1173
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
1174
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<
|
|
1175
|
+
exportMemori: (authToken: string, memoriID: string, password?: string | undefined) => Promise<any>;
|
|
1176
1176
|
};
|
|
1177
1177
|
process: {
|
|
1178
1178
|
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
package/package.json
CHANGED
|
@@ -67,19 +67,19 @@ export default (apiUrl: string) => ({
|
|
|
67
67
|
}
|
|
68
68
|
>,
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
) =>
|
|
83
83
|
apiFetcher(`/ImportExport/ImportDictionary/${authToken}/${memoriID}`, {
|
|
84
84
|
apiUrl,
|
|
85
85
|
method: 'POST',
|
|
@@ -93,44 +93,47 @@ export default (apiUrl: string) => ({
|
|
|
93
93
|
}
|
|
94
94
|
>,
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
apiFetcher(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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<
|
|
117
120
|
ResponseSpec & {
|
|
118
121
|
status: ImportStatus;
|
|
119
122
|
}
|
|
120
123
|
>,
|
|
121
124
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
+
) =>
|
|
134
137
|
apiFetcher(`/ImportExport/ImportMemori/${authToken}`, {
|
|
135
138
|
apiUrl,
|
|
136
139
|
method: 'POST',
|
|
@@ -192,18 +195,30 @@ export default (apiUrl: string) => ({
|
|
|
192
195
|
text: true,
|
|
193
196
|
}) as Promise<string>,
|
|
194
197
|
|
|
195
|
-
|
|
196
|
-
|
|
198
|
+
// Updated exportMemori function for the API repository
|
|
199
|
+
exportMemori: async (
|
|
197
200
|
authToken: string,
|
|
198
201
|
memoriID: string,
|
|
199
202
|
password?: string
|
|
200
|
-
) =>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
203
|
+
) => {
|
|
204
|
+
// Modify the apiFetcher call to handle binary data
|
|
205
|
+
const response = await apiFetcher(`/ImportExport/ExportMemori/${authToken}/${memoriID}`, {
|
|
206
|
+
apiUrl,
|
|
207
|
+
method: 'POST',
|
|
208
|
+
headers: {
|
|
209
|
+
'Content-Type': 'application/json',
|
|
210
|
+
Accept: 'application/octet-stream, application/zip',
|
|
211
|
+
},
|
|
212
|
+
body: {
|
|
213
|
+
password,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
if (!response.ok) {
|
|
218
|
+
throw new Error(`API responded with status: ${response.status}`);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Return the binary data as ArrayBuffer
|
|
222
|
+
return response.arrayBuffer();
|
|
223
|
+
},
|
|
209
224
|
});
|