@memori.ai/memori-api-client 2.2.2 → 2.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/CHANGELOG.md +14 -0
- package/dist/backend/asset.d.ts +2 -2
- package/dist/backend/asset.js +2 -2
- package/dist/backend/asset.js.map +1 -1
- package/dist/backend/importExport.d.ts +2 -1
- package/dist/backend/importExport.js +9 -0
- package/dist/backend/importExport.js.map +1 -1
- package/dist/backend/memori.js +4 -4
- package/dist/backend/memori.js.map +1 -1
- package/dist/backend.d.ts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/types.d.ts +31 -5
- package/esm/backend/asset.d.ts +2 -2
- package/esm/backend/asset.js +2 -2
- package/esm/backend/asset.js.map +1 -1
- package/esm/backend/importExport.d.ts +2 -1
- package/esm/backend/importExport.js +9 -0
- package/esm/backend/importExport.js.map +1 -1
- package/esm/backend/memori.js +4 -4
- package/esm/backend/memori.js.map +1 -1
- package/esm/backend.d.ts +6 -4
- package/esm/index.d.ts +6 -4
- package/esm/types.d.ts +31 -5
- package/package.json +1 -1
- package/src/backend/asset.ts +12 -6
- package/src/backend/importExport.ts +25 -0
- package/src/backend/memori.ts +6 -6
- package/src/types.ts +65 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [2.4.0](https://github.com/memori-ai/memori-api-client/compare/v2.3.0...v2.4.0) (2023-11-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update api and typings ([535d118](https://github.com/memori-ai/memori-api-client/commit/535d118730bbc80435385a8df093e65fae41fe02))
|
|
9
|
+
|
|
10
|
+
## [2.3.0](https://github.com/memori-ai/memori-api-client/compare/v2.2.2...v2.3.0) (2023-09-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* update import typings ([4bb0cdd](https://github.com/memori-ai/memori-api-client/commit/4bb0cddd0126fce7e210d4cca800c4f4cee3d7e3))
|
|
16
|
+
|
|
3
17
|
## [2.2.2](https://github.com/memori-ai/memori-api-client/compare/v2.2.1...v2.2.2) (2023-08-25)
|
|
4
18
|
|
|
5
19
|
|
package/dist/backend/asset.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponseSpec, Asset } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
4
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
3
|
+
getUploadAssetURL: (authToken: string, memoriID?: string, memoryID?: string) => string;
|
|
4
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string, memoryID?: string) => Promise<ResponseSpec & {
|
|
5
5
|
asset: Asset;
|
|
6
6
|
}>;
|
|
7
7
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
package/dist/backend/asset.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const apiFetcher_1 = require("../apiFetcher");
|
|
4
4
|
exports.default = (apiUrl) => ({
|
|
5
|
-
getUploadAssetURL: (authToken, memoriID, memoryID) => `${apiUrl}/Asset/${authToken}
|
|
5
|
+
getUploadAssetURL: (authToken, memoriID, memoryID) => `${apiUrl}/Asset/${authToken}${memoriID ? `/${memoriID}` : ''}${memoryID ? `/${memoryID}` : ''}`,
|
|
6
6
|
uploadAsset: async (fileName, fileUrl, authToken, memoriID, memoryID) => {
|
|
7
7
|
const data = new FormData();
|
|
8
8
|
const file = await fetch(fileUrl);
|
|
9
9
|
const fileBlob = await file.blob();
|
|
10
10
|
data.append(fileName, fileBlob, fileName);
|
|
11
|
-
const upload = await fetch(`${apiUrl}/Asset/${authToken}
|
|
11
|
+
const upload = await fetch(`${apiUrl}/Asset/${authToken}${memoriID ? `/${memoriID}` : ''}${memoryID ? `/${memoryID}` : ''}`, {
|
|
12
12
|
method: 'POST',
|
|
13
13
|
body: data,
|
|
14
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/backend/asset.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/backend/asset.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,iBAAiB,EAAE,CACjB,SAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,EAAE,CACF,GAAG,MAAM,UAAU,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAC3D,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAC9B,EAAE;IASJ,WAAW,EAAE,KAAK,EAChB,QAAgB,EAChB,OAAe,EACf,SAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,EAAE;QACF,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAEnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAE1C,MAAM,MAAM,GAAG,MAAM,KAAK,CACxB,GAAG,MAAM,UAAU,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAC3D,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAC9B,EAAE,EACF;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CACF,CAAC;QACF,OAAO,CAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAI1B,CAAC;IACJ,CAAC;IAQD,QAAQ,EAAE,CAAC,QAAgB,EAAE,SAAiB,EAAE,EAAE,CAChD,IAAA,uBAAU,EAAC,UAAU,QAAQ,IAAI,SAAS,EAAE,EAAE;QAC5C,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAAC;IAQJ,WAAW,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,KAAY,EAAE,EAAE,CACjE,IAAA,uBAAU,EAAC,UAAU,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;QACpE,MAAM;QACN,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,KAAK;KACZ,CAA6C;IAOhD,WAAW,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACnD,IAAA,uBAAU,EAAC,UAAU,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;QACpE,MAAM;QACN,MAAM,EAAE,QAAQ;KACjB,CAA0B;CAC9B,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResponseSpec, ImportParams, ImportResponse, CsvSpecs } from '../types';
|
|
1
|
+
import type { ResponseSpec, ImportParams, ImportResponse, CsvSpecs, JSONLSpecs } 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: ImportResponse;
|
|
@@ -16,5 +16,6 @@ declare const _default: (apiUrl: string) => {
|
|
|
16
16
|
status: ImportResponse;
|
|
17
17
|
}>;
|
|
18
18
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: CsvSpecs, password?: string) => Promise<string>;
|
|
19
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: JSONLSpecs, password?: string) => Promise<string>;
|
|
19
20
|
};
|
|
20
21
|
export default _default;
|
|
@@ -39,5 +39,14 @@ exports.default = (apiUrl) => ({
|
|
|
39
39
|
},
|
|
40
40
|
text: true,
|
|
41
41
|
}),
|
|
42
|
+
exportJSONL: async (authToken, memoriID, jsonlSpecs, password) => (0, apiFetcher_1.apiFetcher)(`/ImportExport/ExportJSONL/${authToken}/${memoriID}`, {
|
|
43
|
+
apiUrl,
|
|
44
|
+
method: 'POST',
|
|
45
|
+
body: {
|
|
46
|
+
jsonlSpecs,
|
|
47
|
+
password,
|
|
48
|
+
},
|
|
49
|
+
text: true,
|
|
50
|
+
}),
|
|
42
51
|
});
|
|
43
52
|
//# 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":";;AAOA,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;QAC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Module", { value: true });
|
|
3
3
|
const apiFetcher_1 = require("../apiFetcher");
|
|
4
4
|
exports.default = (apiUrl) => ({
|
|
5
|
-
getTenantPublicMemoriList: (tenant) => (0, apiFetcher_1.apiFetcher)(`/TenantPublicMemori/${
|
|
5
|
+
getTenantPublicMemoriList: (tenant) => (0, apiFetcher_1.apiFetcher)(`/TenantPublicMemori/${encodeURIComponent(tenant)}`, {
|
|
6
6
|
apiUrl,
|
|
7
7
|
}),
|
|
8
|
-
getTenantMetaverseMemoriList: (tenant) => (0, apiFetcher_1.apiFetcher)(`/TenantMetaverseMemori/${
|
|
8
|
+
getTenantMetaverseMemoriList: (tenant) => (0, apiFetcher_1.apiFetcher)(`/TenantMetaverseMemori/${encodeURIComponent(tenant)}`, {
|
|
9
9
|
apiUrl,
|
|
10
10
|
}),
|
|
11
11
|
getPublicMemoriList: (authToken) => (0, apiFetcher_1.apiFetcher)(`/PublicMemori/${authToken}`, {
|
|
@@ -26,7 +26,7 @@ exports.default = (apiUrl) => ({
|
|
|
26
26
|
getSharedMemoriList: (authToken) => (0, apiFetcher_1.apiFetcher)(`/SharedMemori/${authToken}`, {
|
|
27
27
|
apiUrl,
|
|
28
28
|
}),
|
|
29
|
-
getTenantCategories: (tenant) => (0, apiFetcher_1.apiFetcher)(`/TenantMemoriCategories/${
|
|
29
|
+
getTenantCategories: (tenant) => (0, apiFetcher_1.apiFetcher)(`/TenantMemoriCategories/${encodeURIComponent(tenant)}`, {
|
|
30
30
|
apiUrl,
|
|
31
31
|
}),
|
|
32
32
|
getMemoriConfigs: (authToken) => (0, apiFetcher_1.apiFetcher)(`/MemoriConfigs/${authToken}`, {
|
|
@@ -53,7 +53,7 @@ exports.default = (apiUrl) => ({
|
|
|
53
53
|
getMemoriByUserAndId: (tenantName, userID, memoriID, authToken) => (0, apiFetcher_1.apiFetcher)(`/MemoriById/${tenantName}/${userID}/${memoriID}${authToken ? `/${authToken}` : ''}`, {
|
|
54
54
|
apiUrl,
|
|
55
55
|
}),
|
|
56
|
-
getMemori: (tenant, userName, memoriName, authToken) => (0, apiFetcher_1.apiFetcher)(`/Memori/${
|
|
56
|
+
getMemori: (tenant, userName, memoriName, authToken) => (0, apiFetcher_1.apiFetcher)(`/Memori/${encodeURIComponent(tenant)}/${encodeURIComponent(userName)}/${encodeURIComponent(memoriName)}/${authToken !== null && authToken !== void 0 ? authToken : ''}`, {
|
|
57
57
|
apiUrl,
|
|
58
58
|
}),
|
|
59
59
|
getMemoriSessions: (authToken, memoriID, dateFrom, dateTo) => (0, apiFetcher_1.apiFetcher)(`/MemoriSessions/${authToken}/${memoriID}${dateFrom ? `/${dateFrom}` : ''}${dateFrom && dateTo ? `/${dateTo}` : ''}`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memori.js","sourceRoot":"","sources":["../../src/backend/memori.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,yBAAyB,EAAE,CAAC,MAAc,EAAE,EAAE,CAC5C,IAAA,uBAAU,EAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"memori.js","sourceRoot":"","sources":["../../src/backend/memori.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,yBAAyB,EAAE,CAAC,MAAc,EAAE,EAAE,CAC5C,IAAA,uBAAU,EAAC,uBAAuB,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE;QAC9D,MAAM;KACP,CAIA;IAOH,4BAA4B,EAAE,CAAC,MAAc,EAAE,EAAE,CAC/C,IAAA,uBAAU,EAAC,0BAA0B,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE;QACjE,MAAM;KACP,CAIA;IAOH,mBAAmB,EAAE,CAAC,SAAiB,EAAE,EAAE,CACzC,IAAA,uBAAU,EAAC,iBAAiB,SAAS,EAAE,EAAE;QACvC,MAAM;KACP,CAIA;IAOH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QAAQ,EAAE,CAAC,CAAC,CAAC,EAC9B,GAAG,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAC3C;QACE,MAAM;KACP,CAMF;IASH,cAAc,EAAE,CACd,SAAiB,EACjB,MAGC,EACD,EAAE,CACF,IAAA,uBAAU,EAAC,mBAAmB,SAAS,EAAE,EAAE;QACzC,MAAM;QACN,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;KACf,CAA0B;IAQ7B,oBAAoB,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAC5D,IAAA,uBAAU,EAAC,yBAAyB,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC3D,MAAM;QACN,MAAM,EAAE,MAAM;KACf,CAA0B;CAC9B,CAAC,CAAC"}
|
package/dist/backend.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
15
15
|
status: import("./types").ImportResponse;
|
|
16
16
|
}>;
|
|
17
17
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
18
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
18
19
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
19
20
|
notifications: import("./types").Notification[];
|
|
20
21
|
}>;
|
|
@@ -170,8 +171,8 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
170
171
|
ownerUserName: string;
|
|
171
172
|
}) => Promise<import("./types").ResponseSpec>;
|
|
172
173
|
memoriContentUpdated: (authToken: string, memoriID: string) => Promise<import("./types").ResponseSpec>;
|
|
173
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
174
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
174
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
175
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
175
176
|
asset: import("./types").Asset;
|
|
176
177
|
}>;
|
|
177
178
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -180,8 +181,8 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
180
181
|
}>;
|
|
181
182
|
deleteAsset: (authToken: string, assetURL: string) => Promise<import("./types").ResponseSpec>;
|
|
182
183
|
asset: {
|
|
183
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
184
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
184
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
185
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
185
186
|
asset: import("./types").Asset;
|
|
186
187
|
}>;
|
|
187
188
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -374,6 +375,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
374
375
|
status: import("./types").ImportResponse;
|
|
375
376
|
}>;
|
|
376
377
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
378
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
377
379
|
};
|
|
378
380
|
};
|
|
379
381
|
export default backendAPI;
|
package/dist/index.d.ts
CHANGED
|
@@ -485,6 +485,7 @@ declare const api: (hostname?: string) => {
|
|
|
485
485
|
status: import("./types").ImportResponse;
|
|
486
486
|
}>;
|
|
487
487
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
488
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
488
489
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
489
490
|
notifications: import("./types").Notification[];
|
|
490
491
|
}>;
|
|
@@ -640,8 +641,8 @@ declare const api: (hostname?: string) => {
|
|
|
640
641
|
ownerUserName: string;
|
|
641
642
|
}) => Promise<import("./types").ResponseSpec>;
|
|
642
643
|
memoriContentUpdated: (authToken: string, memoriID: string) => Promise<import("./types").ResponseSpec>;
|
|
643
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
644
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
644
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
645
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
645
646
|
asset: import("./types").Asset;
|
|
646
647
|
}>;
|
|
647
648
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -650,8 +651,8 @@ declare const api: (hostname?: string) => {
|
|
|
650
651
|
}>;
|
|
651
652
|
deleteAsset: (authToken: string, assetURL: string) => Promise<import("./types").ResponseSpec>;
|
|
652
653
|
asset: {
|
|
653
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
654
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
654
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
655
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
655
656
|
asset: import("./types").Asset;
|
|
656
657
|
}>;
|
|
657
658
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -844,6 +845,7 @@ declare const api: (hostname?: string) => {
|
|
|
844
845
|
status: import("./types").ImportResponse;
|
|
845
846
|
}>;
|
|
846
847
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
848
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
847
849
|
};
|
|
848
850
|
};
|
|
849
851
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -49,19 +49,23 @@ export declare type Memori = {
|
|
|
49
49
|
publishedInTheMetaverse?: boolean;
|
|
50
50
|
metaverseEnvironment?: string;
|
|
51
51
|
exposed?: boolean;
|
|
52
|
-
ageRestriction?: number;
|
|
53
|
-
nsfw?: boolean;
|
|
54
52
|
disableR2R3Loop?: boolean;
|
|
55
53
|
disableR4Loop?: boolean;
|
|
56
54
|
disableR5Loop?: boolean;
|
|
55
|
+
ageRestriction?: number;
|
|
56
|
+
nsfw?: boolean;
|
|
57
57
|
enableCompletions?: boolean;
|
|
58
58
|
completionDescription?: string;
|
|
59
|
+
completionProvider?: '-' | 'OpenAI';
|
|
60
|
+
completionProviderConfig?: string;
|
|
61
|
+
enableDeepThought?: boolean;
|
|
62
|
+
disableCompletionMediaExtraction?: boolean;
|
|
59
63
|
chainingMemoriID?: string;
|
|
60
64
|
chainingBaseURL?: string;
|
|
61
65
|
chainingPassword?: string;
|
|
62
|
-
properties?: {
|
|
63
|
-
[key: string]:
|
|
64
|
-
};
|
|
66
|
+
properties?: [{
|
|
67
|
+
[key: string]: string;
|
|
68
|
+
}];
|
|
65
69
|
creationTimestamp?: string;
|
|
66
70
|
lastChangeTimestamp?: string;
|
|
67
71
|
blockedUntil?: string;
|
|
@@ -106,22 +110,30 @@ export declare type User = {
|
|
|
106
110
|
canEditIntegrations?: boolean;
|
|
107
111
|
canEditDynamicIntents?: boolean;
|
|
108
112
|
canEditMemoriChaining?: boolean;
|
|
113
|
+
enableBadges?: boolean;
|
|
109
114
|
monthSessions?: number;
|
|
110
115
|
monthValidSessions?: number;
|
|
111
116
|
maxFreeSessions?: number;
|
|
112
117
|
nonFreeSessionCost?: number;
|
|
113
118
|
monthCompletions?: number;
|
|
114
119
|
maxCompletions?: number;
|
|
120
|
+
monthImportedSize?: number;
|
|
121
|
+
maxImportSize?: number;
|
|
115
122
|
creationTimestamp?: string;
|
|
116
123
|
lastChangeTimestamp?: string;
|
|
117
124
|
referral?: string;
|
|
118
125
|
couponCode?: string;
|
|
126
|
+
defaultCompletionProvider?: '-' | 'OpenAI';
|
|
127
|
+
defaultCompletionProviderConfig?: string;
|
|
119
128
|
paying?: boolean;
|
|
120
129
|
notificationPrefs?: NotificationPrefs[];
|
|
121
130
|
birthDate?: string;
|
|
122
131
|
age?: number;
|
|
123
132
|
tnCAndPPAccepted?: boolean;
|
|
124
133
|
tnCAndPPAcceptanceDate?: string;
|
|
134
|
+
avatarURL?: string;
|
|
135
|
+
avatar3DURL?: string;
|
|
136
|
+
avatar3DURLType?: string;
|
|
125
137
|
};
|
|
126
138
|
export declare type IntegrationResource = {
|
|
127
139
|
name: string;
|
|
@@ -504,6 +516,12 @@ export type ConsumptionLog = {
|
|
|
504
516
|
totalSessions: number;
|
|
505
517
|
validSessions: number;
|
|
506
518
|
completions: number;
|
|
519
|
+
promptTokens: {
|
|
520
|
+
[key: string]: number;
|
|
521
|
+
};
|
|
522
|
+
completionTokens: {
|
|
523
|
+
[key: string]: number;
|
|
524
|
+
};
|
|
507
525
|
};
|
|
508
526
|
export type Notification = {
|
|
509
527
|
notificationID: string;
|
|
@@ -609,12 +627,17 @@ export interface TxtSpecs {
|
|
|
609
627
|
sourceAttachmentTitle?: string;
|
|
610
628
|
questionsGenerationInstructions?: string;
|
|
611
629
|
}
|
|
630
|
+
export interface JSONLSpecs {
|
|
631
|
+
platform?: string;
|
|
632
|
+
includeInstructions?: boolean;
|
|
633
|
+
}
|
|
612
634
|
export interface ImportParams {
|
|
613
635
|
forceImport?: boolean;
|
|
614
636
|
csvSpecs?: CsvSpecs;
|
|
615
637
|
txtSpecs?: TxtSpecs;
|
|
616
638
|
conclusive?: boolean;
|
|
617
639
|
notPickable?: boolean;
|
|
640
|
+
importName?: string;
|
|
618
641
|
contextVarsToSet?: {
|
|
619
642
|
[key: string]: string;
|
|
620
643
|
};
|
|
@@ -635,10 +658,13 @@ export interface ImportResponse {
|
|
|
635
658
|
progress: number;
|
|
636
659
|
importType: 'CSV' | 'TXT';
|
|
637
660
|
importSize: number;
|
|
661
|
+
importName?: string;
|
|
662
|
+
importSpecsJSON?: string;
|
|
638
663
|
begin?: string;
|
|
639
664
|
end?: string;
|
|
640
665
|
eta?: number;
|
|
641
666
|
importedMemories?: number;
|
|
667
|
+
importWarningsCount?: number;
|
|
642
668
|
importWarnings?: ImportWarning[];
|
|
643
669
|
}
|
|
644
670
|
export interface Badge {
|
package/esm/backend/asset.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponseSpec, Asset } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
4
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
3
|
+
getUploadAssetURL: (authToken: string, memoriID?: string, memoryID?: string) => string;
|
|
4
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string, memoryID?: string) => Promise<ResponseSpec & {
|
|
5
5
|
asset: Asset;
|
|
6
6
|
}>;
|
|
7
7
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
package/esm/backend/asset.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { apiFetcher } from '../apiFetcher';
|
|
2
2
|
export default (apiUrl) => ({
|
|
3
|
-
getUploadAssetURL: (authToken, memoriID, memoryID) => `${apiUrl}/Asset/${authToken}
|
|
3
|
+
getUploadAssetURL: (authToken, memoriID, memoryID) => `${apiUrl}/Asset/${authToken}${memoriID ? `/${memoriID}` : ''}${memoryID ? `/${memoryID}` : ''}`,
|
|
4
4
|
uploadAsset: async (fileName, fileUrl, authToken, memoriID, memoryID) => {
|
|
5
5
|
const data = new FormData();
|
|
6
6
|
const file = await fetch(fileUrl);
|
|
7
7
|
const fileBlob = await file.blob();
|
|
8
8
|
data.append(fileName, fileBlob, fileName);
|
|
9
|
-
const upload = await fetch(`${apiUrl}/Asset/${authToken}
|
|
9
|
+
const upload = await fetch(`${apiUrl}/Asset/${authToken}${memoriID ? `/${memoriID}` : ''}${memoryID ? `/${memoryID}` : ''}`, {
|
|
10
10
|
method: 'POST',
|
|
11
11
|
body: data,
|
|
12
12
|
});
|
package/esm/backend/asset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/backend/asset.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/backend/asset.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,iBAAiB,EAAE,CACjB,SAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,EAAE,CACF,GAAG,MAAM,UAAU,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAC3D,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAC9B,EAAE;IASJ,WAAW,EAAE,KAAK,EAChB,QAAgB,EAChB,OAAe,EACf,SAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,EAAE;QACF,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,G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,4 @@
|
|
|
1
|
-
import type { ResponseSpec, ImportParams, ImportResponse, CsvSpecs } from '../types';
|
|
1
|
+
import type { ResponseSpec, ImportParams, ImportResponse, CsvSpecs, JSONLSpecs } 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: ImportResponse;
|
|
@@ -16,5 +16,6 @@ declare const _default: (apiUrl: string) => {
|
|
|
16
16
|
status: ImportResponse;
|
|
17
17
|
}>;
|
|
18
18
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: CsvSpecs, password?: string) => Promise<string>;
|
|
19
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: JSONLSpecs, password?: string) => Promise<string>;
|
|
19
20
|
};
|
|
20
21
|
export default _default;
|
|
@@ -37,5 +37,14 @@ export default (apiUrl) => ({
|
|
|
37
37
|
},
|
|
38
38
|
text: true,
|
|
39
39
|
}),
|
|
40
|
+
exportJSONL: async (authToken, memoriID, jsonlSpecs, password) => apiFetcher(`/ImportExport/ExportJSONL/${authToken}/${memoriID}`, {
|
|
41
|
+
apiUrl,
|
|
42
|
+
method: 'POST',
|
|
43
|
+
body: {
|
|
44
|
+
jsonlSpecs,
|
|
45
|
+
password,
|
|
46
|
+
},
|
|
47
|
+
text: true,
|
|
48
|
+
}),
|
|
40
49
|
});
|
|
41
50
|
//# 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":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,SAAS,EAAE,KA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iB,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;CACxB,CAAC,CAAC"}
|
package/esm/backend/memori.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { apiFetcher } from '../apiFetcher';
|
|
2
2
|
export default (apiUrl) => ({
|
|
3
|
-
getTenantPublicMemoriList: (tenant) => apiFetcher(`/TenantPublicMemori/${
|
|
3
|
+
getTenantPublicMemoriList: (tenant) => apiFetcher(`/TenantPublicMemori/${encodeURIComponent(tenant)}`, {
|
|
4
4
|
apiUrl,
|
|
5
5
|
}),
|
|
6
|
-
getTenantMetaverseMemoriList: (tenant) => apiFetcher(`/TenantMetaverseMemori/${
|
|
6
|
+
getTenantMetaverseMemoriList: (tenant) => apiFetcher(`/TenantMetaverseMemori/${encodeURIComponent(tenant)}`, {
|
|
7
7
|
apiUrl,
|
|
8
8
|
}),
|
|
9
9
|
getPublicMemoriList: (authToken) => apiFetcher(`/PublicMemori/${authToken}`, {
|
|
@@ -24,7 +24,7 @@ export default (apiUrl) => ({
|
|
|
24
24
|
getSharedMemoriList: (authToken) => apiFetcher(`/SharedMemori/${authToken}`, {
|
|
25
25
|
apiUrl,
|
|
26
26
|
}),
|
|
27
|
-
getTenantCategories: (tenant) => apiFetcher(`/TenantMemoriCategories/${
|
|
27
|
+
getTenantCategories: (tenant) => apiFetcher(`/TenantMemoriCategories/${encodeURIComponent(tenant)}`, {
|
|
28
28
|
apiUrl,
|
|
29
29
|
}),
|
|
30
30
|
getMemoriConfigs: (authToken) => apiFetcher(`/MemoriConfigs/${authToken}`, {
|
|
@@ -51,7 +51,7 @@ export default (apiUrl) => ({
|
|
|
51
51
|
getMemoriByUserAndId: (tenantName, userID, memoriID, authToken) => apiFetcher(`/MemoriById/${tenantName}/${userID}/${memoriID}${authToken ? `/${authToken}` : ''}`, {
|
|
52
52
|
apiUrl,
|
|
53
53
|
}),
|
|
54
|
-
getMemori: (tenant, userName, memoriName, authToken) => apiFetcher(`/Memori/${
|
|
54
|
+
getMemori: (tenant, userName, memoriName, authToken) => apiFetcher(`/Memori/${encodeURIComponent(tenant)}/${encodeURIComponent(userName)}/${encodeURIComponent(memoriName)}/${authToken !== null && authToken !== void 0 ? authToken : ''}`, {
|
|
55
55
|
apiUrl,
|
|
56
56
|
}),
|
|
57
57
|
getMemoriSessions: (authToken, memoriID, dateFrom, dateTo) => apiFetcher(`/MemoriSessions/${authToken}/${memoriID}${dateFrom ? `/${dateFrom}` : ''}${dateFrom && dateTo ? `/${dateTo}` : ''}`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memori.js","sourceRoot":"","sources":["../../src/backend/memori.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,yBAAyB,EAAE,CAAC,MAAc,EAAE,EAAE,CAC5C,UAAU,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"memori.js","sourceRoot":"","sources":["../../src/backend/memori.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,yBAAyB,EAAE,CAAC,MAAc,EAAE,EAAE,CAC5C,UAAU,CAAC,uBAAuB,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE;QAC9D,MAAM;KACP,CAIA;IAOH,4BAA4B,EAAE,CAAC,MAAc,EAAE,EAAE,CAC/C,UAAU,CAAC,0BAA0B,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE;QACjE,MAAM;KACP,CAIA;IAOH,mBAAmB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AI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAC9B,GAAG,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAC3C;QACE,MAAM;KACP,CAMF;IASH,cAAc,EAAE,CACd,SAAiB,EACjB,MAGC,EACD,EAAE,CACF,UAAU,CAAC,mBAAmB,SAAS,EAAE,EAAE;QACzC,MAAM;QACN,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;KACf,CAA0B;IAQ7B,oBAAoB,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAC5D,UAAU,CAAC,yBAAyB,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC3D,MAAM;QACN,MAAM,EAAE,MAAM;KACf,CAA0B;CAC9B,CAAC,CAAC"}
|
package/esm/backend.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
15
15
|
status: import("./types").ImportResponse;
|
|
16
16
|
}>;
|
|
17
17
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
18
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
18
19
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
19
20
|
notifications: import("./types").Notification[];
|
|
20
21
|
}>;
|
|
@@ -170,8 +171,8 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
170
171
|
ownerUserName: string;
|
|
171
172
|
}) => Promise<import("./types").ResponseSpec>;
|
|
172
173
|
memoriContentUpdated: (authToken: string, memoriID: string) => Promise<import("./types").ResponseSpec>;
|
|
173
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
174
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
174
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
175
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
175
176
|
asset: import("./types").Asset;
|
|
176
177
|
}>;
|
|
177
178
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -180,8 +181,8 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
180
181
|
}>;
|
|
181
182
|
deleteAsset: (authToken: string, assetURL: string) => Promise<import("./types").ResponseSpec>;
|
|
182
183
|
asset: {
|
|
183
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
184
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
184
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
185
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
185
186
|
asset: import("./types").Asset;
|
|
186
187
|
}>;
|
|
187
188
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -374,6 +375,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
374
375
|
status: import("./types").ImportResponse;
|
|
375
376
|
}>;
|
|
376
377
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
378
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
377
379
|
};
|
|
378
380
|
};
|
|
379
381
|
export default backendAPI;
|
package/esm/index.d.ts
CHANGED
|
@@ -485,6 +485,7 @@ declare const api: (hostname?: string) => {
|
|
|
485
485
|
status: import("./types").ImportResponse;
|
|
486
486
|
}>;
|
|
487
487
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
488
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
488
489
|
getTenantNotifications: (tenantID: string) => Promise<import("./types").ResponseSpec & {
|
|
489
490
|
notifications: import("./types").Notification[];
|
|
490
491
|
}>;
|
|
@@ -640,8 +641,8 @@ declare const api: (hostname?: string) => {
|
|
|
640
641
|
ownerUserName: string;
|
|
641
642
|
}) => Promise<import("./types").ResponseSpec>;
|
|
642
643
|
memoriContentUpdated: (authToken: string, memoriID: string) => Promise<import("./types").ResponseSpec>;
|
|
643
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
644
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
644
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
645
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
645
646
|
asset: import("./types").Asset;
|
|
646
647
|
}>;
|
|
647
648
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -650,8 +651,8 @@ declare const api: (hostname?: string) => {
|
|
|
650
651
|
}>;
|
|
651
652
|
deleteAsset: (authToken: string, assetURL: string) => Promise<import("./types").ResponseSpec>;
|
|
652
653
|
asset: {
|
|
653
|
-
getUploadAssetURL: (authToken: string, memoriID
|
|
654
|
-
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID
|
|
654
|
+
getUploadAssetURL: (authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => string;
|
|
655
|
+
uploadAsset: (fileName: string, fileUrl: string, authToken: string, memoriID?: string | undefined, memoryID?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
655
656
|
asset: import("./types").Asset;
|
|
656
657
|
}>;
|
|
657
658
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
@@ -844,6 +845,7 @@ declare const api: (hostname?: string) => {
|
|
|
844
845
|
status: import("./types").ImportResponse;
|
|
845
846
|
}>;
|
|
846
847
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
848
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
847
849
|
};
|
|
848
850
|
};
|
|
849
851
|
};
|
package/esm/types.d.ts
CHANGED
|
@@ -49,19 +49,23 @@ export declare type Memori = {
|
|
|
49
49
|
publishedInTheMetaverse?: boolean;
|
|
50
50
|
metaverseEnvironment?: string;
|
|
51
51
|
exposed?: boolean;
|
|
52
|
-
ageRestriction?: number;
|
|
53
|
-
nsfw?: boolean;
|
|
54
52
|
disableR2R3Loop?: boolean;
|
|
55
53
|
disableR4Loop?: boolean;
|
|
56
54
|
disableR5Loop?: boolean;
|
|
55
|
+
ageRestriction?: number;
|
|
56
|
+
nsfw?: boolean;
|
|
57
57
|
enableCompletions?: boolean;
|
|
58
58
|
completionDescription?: string;
|
|
59
|
+
completionProvider?: '-' | 'OpenAI';
|
|
60
|
+
completionProviderConfig?: string;
|
|
61
|
+
enableDeepThought?: boolean;
|
|
62
|
+
disableCompletionMediaExtraction?: boolean;
|
|
59
63
|
chainingMemoriID?: string;
|
|
60
64
|
chainingBaseURL?: string;
|
|
61
65
|
chainingPassword?: string;
|
|
62
|
-
properties?: {
|
|
63
|
-
[key: string]:
|
|
64
|
-
};
|
|
66
|
+
properties?: [{
|
|
67
|
+
[key: string]: string;
|
|
68
|
+
}];
|
|
65
69
|
creationTimestamp?: string;
|
|
66
70
|
lastChangeTimestamp?: string;
|
|
67
71
|
blockedUntil?: string;
|
|
@@ -106,22 +110,30 @@ export declare type User = {
|
|
|
106
110
|
canEditIntegrations?: boolean;
|
|
107
111
|
canEditDynamicIntents?: boolean;
|
|
108
112
|
canEditMemoriChaining?: boolean;
|
|
113
|
+
enableBadges?: boolean;
|
|
109
114
|
monthSessions?: number;
|
|
110
115
|
monthValidSessions?: number;
|
|
111
116
|
maxFreeSessions?: number;
|
|
112
117
|
nonFreeSessionCost?: number;
|
|
113
118
|
monthCompletions?: number;
|
|
114
119
|
maxCompletions?: number;
|
|
120
|
+
monthImportedSize?: number;
|
|
121
|
+
maxImportSize?: number;
|
|
115
122
|
creationTimestamp?: string;
|
|
116
123
|
lastChangeTimestamp?: string;
|
|
117
124
|
referral?: string;
|
|
118
125
|
couponCode?: string;
|
|
126
|
+
defaultCompletionProvider?: '-' | 'OpenAI';
|
|
127
|
+
defaultCompletionProviderConfig?: string;
|
|
119
128
|
paying?: boolean;
|
|
120
129
|
notificationPrefs?: NotificationPrefs[];
|
|
121
130
|
birthDate?: string;
|
|
122
131
|
age?: number;
|
|
123
132
|
tnCAndPPAccepted?: boolean;
|
|
124
133
|
tnCAndPPAcceptanceDate?: string;
|
|
134
|
+
avatarURL?: string;
|
|
135
|
+
avatar3DURL?: string;
|
|
136
|
+
avatar3DURLType?: string;
|
|
125
137
|
};
|
|
126
138
|
export declare type IntegrationResource = {
|
|
127
139
|
name: string;
|
|
@@ -504,6 +516,12 @@ export type ConsumptionLog = {
|
|
|
504
516
|
totalSessions: number;
|
|
505
517
|
validSessions: number;
|
|
506
518
|
completions: number;
|
|
519
|
+
promptTokens: {
|
|
520
|
+
[key: string]: number;
|
|
521
|
+
};
|
|
522
|
+
completionTokens: {
|
|
523
|
+
[key: string]: number;
|
|
524
|
+
};
|
|
507
525
|
};
|
|
508
526
|
export type Notification = {
|
|
509
527
|
notificationID: string;
|
|
@@ -609,12 +627,17 @@ export interface TxtSpecs {
|
|
|
609
627
|
sourceAttachmentTitle?: string;
|
|
610
628
|
questionsGenerationInstructions?: string;
|
|
611
629
|
}
|
|
630
|
+
export interface JSONLSpecs {
|
|
631
|
+
platform?: string;
|
|
632
|
+
includeInstructions?: boolean;
|
|
633
|
+
}
|
|
612
634
|
export interface ImportParams {
|
|
613
635
|
forceImport?: boolean;
|
|
614
636
|
csvSpecs?: CsvSpecs;
|
|
615
637
|
txtSpecs?: TxtSpecs;
|
|
616
638
|
conclusive?: boolean;
|
|
617
639
|
notPickable?: boolean;
|
|
640
|
+
importName?: string;
|
|
618
641
|
contextVarsToSet?: {
|
|
619
642
|
[key: string]: string;
|
|
620
643
|
};
|
|
@@ -635,10 +658,13 @@ export interface ImportResponse {
|
|
|
635
658
|
progress: number;
|
|
636
659
|
importType: 'CSV' | 'TXT';
|
|
637
660
|
importSize: number;
|
|
661
|
+
importName?: string;
|
|
662
|
+
importSpecsJSON?: string;
|
|
638
663
|
begin?: string;
|
|
639
664
|
end?: string;
|
|
640
665
|
eta?: number;
|
|
641
666
|
importedMemories?: number;
|
|
667
|
+
importWarningsCount?: number;
|
|
642
668
|
importWarnings?: ImportWarning[];
|
|
643
669
|
}
|
|
644
670
|
export interface Badge {
|
package/package.json
CHANGED
package/src/backend/asset.ts
CHANGED
|
@@ -5,17 +5,23 @@ export default (apiUrl: string) => ({
|
|
|
5
5
|
/**
|
|
6
6
|
* URL to upload a file creating a new Asset object to access it.
|
|
7
7
|
* @param {string} authToken - The login token
|
|
8
|
-
* @param {string} memoriID - The memori ID
|
|
8
|
+
* @param {string=} memoriID - The memori ID
|
|
9
9
|
* @param {string=} memoryID - The memory ID
|
|
10
10
|
* @returns The URL to upload a file
|
|
11
11
|
*/
|
|
12
|
-
getUploadAssetURL: (
|
|
13
|
-
|
|
12
|
+
getUploadAssetURL: (
|
|
13
|
+
authToken: string,
|
|
14
|
+
memoriID?: string,
|
|
15
|
+
memoryID?: string
|
|
16
|
+
) =>
|
|
17
|
+
`${apiUrl}/Asset/${authToken}${memoriID ? `/${memoriID}` : ''}${
|
|
18
|
+
memoryID ? `/${memoryID}` : ''
|
|
19
|
+
}`,
|
|
14
20
|
|
|
15
21
|
/**
|
|
16
22
|
* Uploads a file and creates a new Asset object to access it.
|
|
17
23
|
* @param {string} authToken - The login token
|
|
18
|
-
* @param {string} memoriID - The memori ID
|
|
24
|
+
* @param {string=} memoriID - The memori ID
|
|
19
25
|
* @param {string=} memoryID - The memory ID
|
|
20
26
|
* @returns Response of an Upload Asset request.
|
|
21
27
|
*/
|
|
@@ -23,7 +29,7 @@ export default (apiUrl: string) => ({
|
|
|
23
29
|
fileName: string,
|
|
24
30
|
fileUrl: string,
|
|
25
31
|
authToken: string,
|
|
26
|
-
memoriID
|
|
32
|
+
memoriID?: string,
|
|
27
33
|
memoryID?: string
|
|
28
34
|
) => {
|
|
29
35
|
const data = new FormData();
|
|
@@ -33,7 +39,7 @@ export default (apiUrl: string) => ({
|
|
|
33
39
|
data.append(fileName, fileBlob, fileName);
|
|
34
40
|
|
|
35
41
|
const upload = await fetch(
|
|
36
|
-
`${apiUrl}/Asset/${authToken}
|
|
42
|
+
`${apiUrl}/Asset/${authToken}${memoriID ? `/${memoriID}` : ''}${
|
|
37
43
|
memoryID ? `/${memoryID}` : ''
|
|
38
44
|
}`,
|
|
39
45
|
{
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
ImportParams,
|
|
4
4
|
ImportResponse,
|
|
5
5
|
CsvSpecs,
|
|
6
|
+
JSONLSpecs,
|
|
6
7
|
} from '../types';
|
|
7
8
|
import { apiFetcher } from '../apiFetcher';
|
|
8
9
|
|
|
@@ -132,4 +133,28 @@ export default (apiUrl: string) => ({
|
|
|
132
133
|
},
|
|
133
134
|
text: true,
|
|
134
135
|
}) as Promise<string>,
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Exports contents of a Memori object to a JSONL file, suitable for fine-tuning with generative AI platforms.
|
|
139
|
+
* @param {string} authToken - The login token.
|
|
140
|
+
* @param {string} memoriID - The ID of the Memori object.
|
|
141
|
+
* @param {JSONLSpecs} jsonlSpecs - Specifications for requests involving import/export of JSONL contents.
|
|
142
|
+
* @param {string=} password - Memori password, if its privacy model is set to Secret.
|
|
143
|
+
* @returns The JSONL file content
|
|
144
|
+
*/
|
|
145
|
+
exportJSONL: async (
|
|
146
|
+
authToken: string,
|
|
147
|
+
memoriID: string,
|
|
148
|
+
jsonlSpecs: JSONLSpecs,
|
|
149
|
+
password?: string
|
|
150
|
+
) =>
|
|
151
|
+
apiFetcher(`/ImportExport/ExportJSONL/${authToken}/${memoriID}`, {
|
|
152
|
+
apiUrl,
|
|
153
|
+
method: 'POST',
|
|
154
|
+
body: {
|
|
155
|
+
jsonlSpecs,
|
|
156
|
+
password,
|
|
157
|
+
},
|
|
158
|
+
text: true,
|
|
159
|
+
}) as Promise<string>,
|
|
135
160
|
});
|
package/src/backend/memori.ts
CHANGED
|
@@ -8,7 +8,7 @@ export default (apiUrl: string) => ({
|
|
|
8
8
|
* @returns A list of Memori objects
|
|
9
9
|
*/
|
|
10
10
|
getTenantPublicMemoriList: (tenant: string) =>
|
|
11
|
-
apiFetcher(`/TenantPublicMemori/${
|
|
11
|
+
apiFetcher(`/TenantPublicMemori/${encodeURIComponent(tenant)}`, {
|
|
12
12
|
apiUrl,
|
|
13
13
|
}) as Promise<
|
|
14
14
|
ResponseSpec & {
|
|
@@ -22,7 +22,7 @@ export default (apiUrl: string) => ({
|
|
|
22
22
|
* @returns A list of Memori objects
|
|
23
23
|
*/
|
|
24
24
|
getTenantMetaverseMemoriList: (tenant: string) =>
|
|
25
|
-
apiFetcher(`/TenantMetaverseMemori/${
|
|
25
|
+
apiFetcher(`/TenantMetaverseMemori/${encodeURIComponent(tenant)}`, {
|
|
26
26
|
apiUrl,
|
|
27
27
|
}) as Promise<
|
|
28
28
|
ResponseSpec & {
|
|
@@ -142,7 +142,7 @@ export default (apiUrl: string) => ({
|
|
|
142
142
|
* @returns A list of Memori categories
|
|
143
143
|
*/
|
|
144
144
|
getTenantCategories: (tenant: string) =>
|
|
145
|
-
apiFetcher(`/TenantMemoriCategories/${
|
|
145
|
+
apiFetcher(`/TenantMemoriCategories/${encodeURIComponent(tenant)}`, {
|
|
146
146
|
apiUrl,
|
|
147
147
|
}) as Promise<
|
|
148
148
|
ResponseSpec & {
|
|
@@ -253,9 +253,9 @@ export default (apiUrl: string) => ({
|
|
|
253
253
|
authToken?: string
|
|
254
254
|
) =>
|
|
255
255
|
apiFetcher(
|
|
256
|
-
`/Memori/${
|
|
257
|
-
|
|
258
|
-
)}/${authToken ?? ''}`,
|
|
256
|
+
`/Memori/${encodeURIComponent(tenant)}/${encodeURIComponent(
|
|
257
|
+
userName
|
|
258
|
+
)}/${encodeURIComponent(memoriName)}/${authToken ?? ''}`,
|
|
259
259
|
{
|
|
260
260
|
apiUrl,
|
|
261
261
|
}
|
package/src/types.ts
CHANGED
|
@@ -60,17 +60,30 @@ export declare type Memori = {
|
|
|
60
60
|
publishedInTheMetaverse?: boolean;
|
|
61
61
|
metaverseEnvironment?: string;
|
|
62
62
|
exposed?: boolean;
|
|
63
|
-
ageRestriction?: number;
|
|
64
|
-
nsfw?: boolean;
|
|
65
63
|
disableR2R3Loop?: boolean;
|
|
66
64
|
disableR4Loop?: boolean;
|
|
67
65
|
disableR5Loop?: boolean;
|
|
66
|
+
ageRestriction?: number;
|
|
67
|
+
nsfw?: boolean;
|
|
68
68
|
enableCompletions?: boolean;
|
|
69
69
|
completionDescription?: string;
|
|
70
|
+
completionProvider?: '-' | 'OpenAI';
|
|
71
|
+
/**
|
|
72
|
+
* Format: chiave1:valore1|chiave2:valore2|...|chiaveN:valoreN
|
|
73
|
+
*
|
|
74
|
+
* OpenAI accetta i seguenti:
|
|
75
|
+
* - APIKey è l'API key
|
|
76
|
+
* - Model è il nome del modello: gpt-3.5-turbo, gpt-4 ecc.
|
|
77
|
+
* - MaxTokens è il numero massimo di token in output
|
|
78
|
+
* - Temperature è la temperature
|
|
79
|
+
*/
|
|
80
|
+
completionProviderConfig?: string;
|
|
81
|
+
enableDeepThought?: boolean;
|
|
82
|
+
disableCompletionMediaExtraction?: boolean;
|
|
70
83
|
chainingMemoriID?: string;
|
|
71
84
|
chainingBaseURL?: string;
|
|
72
85
|
chainingPassword?: string;
|
|
73
|
-
properties?: { [key: string]:
|
|
86
|
+
properties?: [{ [key: string]: string }];
|
|
74
87
|
creationTimestamp?: string;
|
|
75
88
|
lastChangeTimestamp?: string;
|
|
76
89
|
blockedUntil?: string;
|
|
@@ -138,22 +151,39 @@ export declare type User = {
|
|
|
138
151
|
canEditIntegrations?: boolean;
|
|
139
152
|
canEditDynamicIntents?: boolean;
|
|
140
153
|
canEditMemoriChaining?: boolean;
|
|
154
|
+
enableBadges?: boolean;
|
|
141
155
|
monthSessions?: number;
|
|
142
156
|
monthValidSessions?: number;
|
|
143
157
|
maxFreeSessions?: number;
|
|
144
158
|
nonFreeSessionCost?: number;
|
|
145
159
|
monthCompletions?: number;
|
|
146
160
|
maxCompletions?: number;
|
|
161
|
+
monthImportedSize?: number;
|
|
162
|
+
maxImportSize?: number;
|
|
147
163
|
creationTimestamp?: string;
|
|
148
164
|
lastChangeTimestamp?: string;
|
|
149
165
|
referral?: string;
|
|
150
166
|
couponCode?: string;
|
|
167
|
+
defaultCompletionProvider?: '-' | 'OpenAI';
|
|
168
|
+
/**
|
|
169
|
+
* Format: chiave1:valore1|chiave2:valore2|...|chiaveN:valoreN
|
|
170
|
+
*
|
|
171
|
+
* OpenAI accetta i seguenti:
|
|
172
|
+
* - APIKey è l'API key
|
|
173
|
+
* - Model è il nome del modello: gpt-3.5-turbo, gpt-4 ecc.
|
|
174
|
+
* - MaxTokens è il numero massimo di token in output
|
|
175
|
+
* - Temperature è la temperature
|
|
176
|
+
*/
|
|
177
|
+
defaultCompletionProviderConfig?: string;
|
|
151
178
|
paying?: boolean;
|
|
152
179
|
notificationPrefs?: NotificationPrefs[];
|
|
153
180
|
birthDate?: string;
|
|
154
181
|
age?: number;
|
|
155
182
|
tnCAndPPAccepted?: boolean;
|
|
156
183
|
tnCAndPPAcceptanceDate?: string;
|
|
184
|
+
avatarURL?: string;
|
|
185
|
+
avatar3DURL?: string;
|
|
186
|
+
avatar3DURLType?: string;
|
|
157
187
|
};
|
|
158
188
|
|
|
159
189
|
export declare type IntegrationResource = {
|
|
@@ -568,6 +598,8 @@ export type ConsumptionLog = {
|
|
|
568
598
|
totalSessions: number;
|
|
569
599
|
validSessions: number;
|
|
570
600
|
completions: number;
|
|
601
|
+
promptTokens: { [key: string]: number };
|
|
602
|
+
completionTokens: { [key: string]: number };
|
|
571
603
|
};
|
|
572
604
|
|
|
573
605
|
export type Notification = {
|
|
@@ -907,12 +939,28 @@ export interface TxtSpecs {
|
|
|
907
939
|
questionsGenerationInstructions?: string;
|
|
908
940
|
}
|
|
909
941
|
|
|
942
|
+
export interface JSONLSpecs {
|
|
943
|
+
/**
|
|
944
|
+
* @type {string=}
|
|
945
|
+
* Name of the platform for which the JSONL is intended.
|
|
946
|
+
* Currently supported values are:
|
|
947
|
+
* - OpenAI: the OpenAI platform
|
|
948
|
+
*/
|
|
949
|
+
platform?: string;
|
|
950
|
+
/**
|
|
951
|
+
* @type {boolean=}
|
|
952
|
+
* If True the JSONL includes the instructions for the generative AI, i.e. the "System" role of each message. Used only in Export operations.
|
|
953
|
+
*/
|
|
954
|
+
includeInstructions?: boolean;
|
|
955
|
+
}
|
|
956
|
+
|
|
910
957
|
export interface ImportParams {
|
|
911
958
|
forceImport?: boolean;
|
|
912
959
|
csvSpecs?: CsvSpecs;
|
|
913
960
|
txtSpecs?: TxtSpecs;
|
|
914
961
|
conclusive?: boolean;
|
|
915
962
|
notPickable?: boolean;
|
|
963
|
+
importName?: string;
|
|
916
964
|
contextVarsToSet?: {
|
|
917
965
|
[key: string]: string;
|
|
918
966
|
};
|
|
@@ -974,6 +1022,16 @@ export interface ImportResponse {
|
|
|
974
1022
|
* Size of the imported document in characters.
|
|
975
1023
|
*/
|
|
976
1024
|
importSize: number;
|
|
1025
|
+
/**
|
|
1026
|
+
* @type {string?}
|
|
1027
|
+
* Name of this import, if set when the Import process was requested.
|
|
1028
|
+
*/
|
|
1029
|
+
importName?: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* @type {string?}
|
|
1032
|
+
* Original parameters of the Import process request, as a JSON structure, excluding the document rows.
|
|
1033
|
+
*/
|
|
1034
|
+
importSpecsJSON?: string;
|
|
977
1035
|
/**
|
|
978
1036
|
* @type {string=}
|
|
979
1037
|
* Timestamp of start of the Import process. Null until the Import process is in Starting status.
|
|
@@ -995,6 +1053,10 @@ export interface ImportResponse {
|
|
|
995
1053
|
* Number of Imported Memory objects so far.
|
|
996
1054
|
*/
|
|
997
1055
|
importedMemories?: number;
|
|
1056
|
+
/**
|
|
1057
|
+
* Number of Import Warning objects
|
|
1058
|
+
*/
|
|
1059
|
+
importWarningsCount?: number;
|
|
998
1060
|
/**
|
|
999
1061
|
* List of Import Warning objects. May be empty.
|
|
1000
1062
|
*/
|