@memori.ai/memori-api-client 4.2.0 → 4.2.2
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 +20 -0
- package/dist/engine/search.d.ts +10 -3
- package/dist/engine/search.js +8 -2
- package/dist/engine/search.js.map +1 -1
- package/dist/engine.d.ts +18 -4
- package/dist/index.d.ts +18 -4
- package/dist/types.d.ts +5 -0
- package/esm/engine/search.d.ts +10 -3
- package/esm/engine/search.js +8 -2
- package/esm/engine/search.js.map +1 -1
- package/esm/engine.d.ts +18 -4
- package/esm/index.d.ts +18 -4
- package/esm/types.d.ts +5 -0
- package/package.json +2 -1
- package/src/engine/search.ts +31 -5
- package/src/types.ts +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [4.2.2](https://github.com/memori-ai/memori-api-client/compare/v4.2.1...v4.2.2) (2024-06-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Maintenance
|
|
7
|
+
|
|
8
|
+
* add billingDelegation to tenant ([280fd19](https://github.com/memori-ai/memori-api-client/commit/280fd190ceb99976ec5d5a75e06ae77b3da863c2))
|
|
9
|
+
|
|
10
|
+
## [4.2.1](https://github.com/memori-ai/memori-api-client/compare/v4.2.0...v4.2.1) (2024-05-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Maintenance
|
|
14
|
+
|
|
15
|
+
* add memoryTags in DialogState ([081628d](https://github.com/memori-ai/memori-api-client/commit/081628dd4b8e7c37ba7f0fdde493defe11e4ddd9))
|
|
16
|
+
* add new Memory attributes ([b5081a6](https://github.com/memori-ai/memori-api-client/commit/b5081a6fd6a3e8d8a81b8046fc7d594553e42761))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
* update search apis ([becc45f](https://github.com/memori-ai/memori-api-client/commit/becc45fa54cd52238e6aa44714bf2541476969f5))
|
|
22
|
+
|
|
3
23
|
## [4.2.0](https://github.com/memori-ai/memori-api-client/compare/v4.1.3...v4.2.0) (2024-05-03)
|
|
4
24
|
|
|
5
25
|
|
package/dist/engine/search.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { ResponseSpec, SearchQuery, SearchMatches } from '../types';
|
|
1
|
+
import { ResponseSpec, SearchQuery, SearchMatches, Memory } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
3
|
searchMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
|
|
4
4
|
matches: SearchMatches[];
|
|
5
5
|
}>;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
getRandomMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
|
|
7
|
+
memories: Memory[];
|
|
8
|
+
}>;
|
|
9
|
+
getHints: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
|
|
10
|
+
memoryHints: string[];
|
|
11
|
+
}>;
|
|
12
|
+
getMemoryTags: (sessionId: string) => Promise<ResponseSpec & {
|
|
13
|
+
memoryTags: string[];
|
|
14
|
+
}>;
|
|
8
15
|
};
|
|
9
16
|
export default _default;
|
package/dist/engine/search.js
CHANGED
|
@@ -7,11 +7,17 @@ exports.default = (apiUrl) => ({
|
|
|
7
7
|
body: query,
|
|
8
8
|
apiUrl,
|
|
9
9
|
}),
|
|
10
|
-
|
|
10
|
+
getRandomMemory: async (sessionId, query) => (0, apiFetcher_1.apiFetcher)(`/Random/${sessionId}`, {
|
|
11
11
|
method: 'POST',
|
|
12
|
+
body: query,
|
|
13
|
+
apiUrl,
|
|
14
|
+
}),
|
|
15
|
+
getHints: async (sessionId, query) => (0, apiFetcher_1.apiFetcher)(`/Hints/${sessionId}`, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: query,
|
|
12
18
|
apiUrl,
|
|
13
19
|
}),
|
|
14
|
-
|
|
20
|
+
getMemoryTags: async (sessionId) => (0, apiFetcher_1.apiFetcher)(`/MemoryTags/${sessionId}`, {
|
|
15
21
|
method: 'GET',
|
|
16
22
|
apiUrl,
|
|
17
23
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/engine/search.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAC7D,IAAA,uBAAU,EAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/engine/search.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAC7D,IAAA,uBAAU,EAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAQH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAChE,IAAA,uBAAU,EAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IASH,QAAQ,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CACzD,IAAA,uBAAU,EAAC,UAAU,SAAS,EAAE,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAMH,aAAa,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACzC,IAAA,uBAAU,EAAC,eAAe,SAAS,EAAE,EAAE;QACrC,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;CACJ,CAAC,CAAC"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -342,14 +342,28 @@ declare const _default: (apiUrl: string) => {
|
|
|
342
342
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
343
343
|
matches: import("./types").SearchMatches[];
|
|
344
344
|
}>;
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
346
|
+
memories: import("./types").Memory[];
|
|
347
|
+
}>;
|
|
348
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
349
|
+
memoryHints: string[];
|
|
350
|
+
}>;
|
|
351
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
352
|
+
memoryTags: string[];
|
|
353
|
+
}>;
|
|
347
354
|
search: {
|
|
348
355
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
349
356
|
matches: import("./types").SearchMatches[];
|
|
350
357
|
}>;
|
|
351
|
-
|
|
352
|
-
|
|
358
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
359
|
+
memories: import("./types").Memory[];
|
|
360
|
+
}>;
|
|
361
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
362
|
+
memoryHints: string[];
|
|
363
|
+
}>;
|
|
364
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
365
|
+
memoryTags: string[];
|
|
366
|
+
}>;
|
|
353
367
|
};
|
|
354
368
|
getPeople: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
355
369
|
people: import("./types").Person[];
|
package/dist/index.d.ts
CHANGED
|
@@ -352,14 +352,28 @@ declare const api: (hostname?: string) => {
|
|
|
352
352
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
353
353
|
matches: import("./types").SearchMatches[];
|
|
354
354
|
}>;
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
356
|
+
memories: import("./types").Memory[];
|
|
357
|
+
}>;
|
|
358
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
359
|
+
memoryHints: string[];
|
|
360
|
+
}>;
|
|
361
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
362
|
+
memoryTags: string[];
|
|
363
|
+
}>;
|
|
357
364
|
search: {
|
|
358
365
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
359
366
|
matches: import("./types").SearchMatches[];
|
|
360
367
|
}>;
|
|
361
|
-
|
|
362
|
-
|
|
368
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
369
|
+
memories: import("./types").Memory[];
|
|
370
|
+
}>;
|
|
371
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
372
|
+
memoryHints: string[];
|
|
373
|
+
}>;
|
|
374
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
375
|
+
memoryTags: string[];
|
|
376
|
+
}>;
|
|
363
377
|
};
|
|
364
378
|
getPeople: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
365
379
|
people: import("./types").Person[];
|
package/dist/types.d.ts
CHANGED
|
@@ -230,6 +230,7 @@ export type TenantBase = {
|
|
|
230
230
|
enableBadges?: boolean;
|
|
231
231
|
enableVirtualSpaces?: boolean;
|
|
232
232
|
enableDeepThought?: boolean;
|
|
233
|
+
billingDelegation?: boolean;
|
|
233
234
|
creationTimestamp?: string;
|
|
234
235
|
lastChangeTimestamp?: string;
|
|
235
236
|
};
|
|
@@ -364,6 +365,7 @@ export declare type DialogState = {
|
|
|
364
365
|
contextVars?: {
|
|
365
366
|
[key: string]: string;
|
|
366
367
|
};
|
|
368
|
+
memoryTags?: string[];
|
|
367
369
|
};
|
|
368
370
|
export declare type Person = {
|
|
369
371
|
personID?: string;
|
|
@@ -478,6 +480,7 @@ export declare type Memory = {
|
|
|
478
480
|
help?: boolean;
|
|
479
481
|
notPickable?: boolean;
|
|
480
482
|
hints?: string[];
|
|
483
|
+
tags?: string[];
|
|
481
484
|
minTimeout?: number;
|
|
482
485
|
maxTimeout?: number;
|
|
483
486
|
contextVarsToSet?: {
|
|
@@ -489,6 +492,8 @@ export declare type Memory = {
|
|
|
489
492
|
contextVars?: {
|
|
490
493
|
[variable: string]: string;
|
|
491
494
|
};
|
|
495
|
+
dcmOutcomeType?: string;
|
|
496
|
+
dcmOutcomeCode?: string;
|
|
492
497
|
creationTimestamp?: string;
|
|
493
498
|
creationName?: string;
|
|
494
499
|
creationSessionID?: string;
|
package/esm/engine/search.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { ResponseSpec, SearchQuery, SearchMatches } from '../types';
|
|
1
|
+
import { ResponseSpec, SearchQuery, SearchMatches, Memory } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
3
|
searchMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
|
|
4
4
|
matches: SearchMatches[];
|
|
5
5
|
}>;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
getRandomMemory: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
|
|
7
|
+
memories: Memory[];
|
|
8
|
+
}>;
|
|
9
|
+
getHints: (sessionId: string, query?: SearchQuery) => Promise<ResponseSpec & {
|
|
10
|
+
memoryHints: string[];
|
|
11
|
+
}>;
|
|
12
|
+
getMemoryTags: (sessionId: string) => Promise<ResponseSpec & {
|
|
13
|
+
memoryTags: string[];
|
|
14
|
+
}>;
|
|
8
15
|
};
|
|
9
16
|
export default _default;
|
package/esm/engine/search.js
CHANGED
|
@@ -5,11 +5,17 @@ export default (apiUrl) => ({
|
|
|
5
5
|
body: query,
|
|
6
6
|
apiUrl,
|
|
7
7
|
}),
|
|
8
|
-
|
|
8
|
+
getRandomMemory: async (sessionId, query) => apiFetcher(`/Random/${sessionId}`, {
|
|
9
9
|
method: 'POST',
|
|
10
|
+
body: query,
|
|
11
|
+
apiUrl,
|
|
12
|
+
}),
|
|
13
|
+
getHints: async (sessionId, query) => apiFetcher(`/Hints/${sessionId}`, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
body: query,
|
|
10
16
|
apiUrl,
|
|
11
17
|
}),
|
|
12
|
-
|
|
18
|
+
getMemoryTags: async (sessionId) => apiFetcher(`/MemoryTags/${sessionId}`, {
|
|
13
19
|
method: 'GET',
|
|
14
20
|
apiUrl,
|
|
15
21
|
}),
|
package/esm/engine/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/engine/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAC7D,UAAU,CAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/engine/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAC7D,UAAU,CAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAQH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CAChE,UAAU,CAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IASH,QAAQ,EAAE,KAAK,EAAE,SAAiB,EAAE,KAAmB,EAAE,EAAE,CACzD,UAAU,CAAC,UAAU,SAAS,EAAE,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;QACX,MAAM;KACP,CAIA;IAMH,aAAa,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACzC,UAAU,CAAC,eAAe,SAAS,EAAE,EAAE;QACrC,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;CACJ,CAAC,CAAC"}
|
package/esm/engine.d.ts
CHANGED
|
@@ -342,14 +342,28 @@ declare const _default: (apiUrl: string) => {
|
|
|
342
342
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
343
343
|
matches: import("./types").SearchMatches[];
|
|
344
344
|
}>;
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
346
|
+
memories: import("./types").Memory[];
|
|
347
|
+
}>;
|
|
348
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
349
|
+
memoryHints: string[];
|
|
350
|
+
}>;
|
|
351
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
352
|
+
memoryTags: string[];
|
|
353
|
+
}>;
|
|
347
354
|
search: {
|
|
348
355
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
349
356
|
matches: import("./types").SearchMatches[];
|
|
350
357
|
}>;
|
|
351
|
-
|
|
352
|
-
|
|
358
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
359
|
+
memories: import("./types").Memory[];
|
|
360
|
+
}>;
|
|
361
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
362
|
+
memoryHints: string[];
|
|
363
|
+
}>;
|
|
364
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
365
|
+
memoryTags: string[];
|
|
366
|
+
}>;
|
|
353
367
|
};
|
|
354
368
|
getPeople: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
355
369
|
people: import("./types").Person[];
|
package/esm/index.d.ts
CHANGED
|
@@ -352,14 +352,28 @@ declare const api: (hostname?: string) => {
|
|
|
352
352
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
353
353
|
matches: import("./types").SearchMatches[];
|
|
354
354
|
}>;
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
356
|
+
memories: import("./types").Memory[];
|
|
357
|
+
}>;
|
|
358
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
359
|
+
memoryHints: string[];
|
|
360
|
+
}>;
|
|
361
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
362
|
+
memoryTags: string[];
|
|
363
|
+
}>;
|
|
357
364
|
search: {
|
|
358
365
|
searchMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
359
366
|
matches: import("./types").SearchMatches[];
|
|
360
367
|
}>;
|
|
361
|
-
|
|
362
|
-
|
|
368
|
+
getRandomMemory: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
369
|
+
memories: import("./types").Memory[];
|
|
370
|
+
}>;
|
|
371
|
+
getHints: (sessionId: string, query?: import("./types").SearchQuery | undefined) => Promise<import("./types").ResponseSpec & {
|
|
372
|
+
memoryHints: string[];
|
|
373
|
+
}>;
|
|
374
|
+
getMemoryTags: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
375
|
+
memoryTags: string[];
|
|
376
|
+
}>;
|
|
363
377
|
};
|
|
364
378
|
getPeople: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
365
379
|
people: import("./types").Person[];
|
package/esm/types.d.ts
CHANGED
|
@@ -230,6 +230,7 @@ export type TenantBase = {
|
|
|
230
230
|
enableBadges?: boolean;
|
|
231
231
|
enableVirtualSpaces?: boolean;
|
|
232
232
|
enableDeepThought?: boolean;
|
|
233
|
+
billingDelegation?: boolean;
|
|
233
234
|
creationTimestamp?: string;
|
|
234
235
|
lastChangeTimestamp?: string;
|
|
235
236
|
};
|
|
@@ -364,6 +365,7 @@ export declare type DialogState = {
|
|
|
364
365
|
contextVars?: {
|
|
365
366
|
[key: string]: string;
|
|
366
367
|
};
|
|
368
|
+
memoryTags?: string[];
|
|
367
369
|
};
|
|
368
370
|
export declare type Person = {
|
|
369
371
|
personID?: string;
|
|
@@ -478,6 +480,7 @@ export declare type Memory = {
|
|
|
478
480
|
help?: boolean;
|
|
479
481
|
notPickable?: boolean;
|
|
480
482
|
hints?: string[];
|
|
483
|
+
tags?: string[];
|
|
481
484
|
minTimeout?: number;
|
|
482
485
|
maxTimeout?: number;
|
|
483
486
|
contextVarsToSet?: {
|
|
@@ -489,6 +492,8 @@ export declare type Memory = {
|
|
|
489
492
|
contextVars?: {
|
|
490
493
|
[variable: string]: string;
|
|
491
494
|
};
|
|
495
|
+
dcmOutcomeType?: string;
|
|
496
|
+
dcmOutcomeCode?: string;
|
|
492
497
|
creationTimestamp?: string;
|
|
493
498
|
creationName?: string;
|
|
494
499
|
creationSessionID?: string;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.2.
|
|
2
|
+
"version": "4.2.2",
|
|
3
3
|
"name": "@memori.ai/memori-api-client",
|
|
4
4
|
"description": "React library to integrate a Memori in your app or website",
|
|
5
5
|
"license": "Apache-2.0",
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
"husky": "8.0.2",
|
|
184
184
|
"is-ci": "3.0.1",
|
|
185
185
|
"jest": "29.3.1",
|
|
186
|
+
"jest-fetch-mock": "^3.0.3",
|
|
186
187
|
"prettier": "2.8.0",
|
|
187
188
|
"release-it": "15.5.0",
|
|
188
189
|
"rimraf": "3.0.2",
|
package/src/engine/search.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResponseSpec, SearchQuery, SearchMatches } from '../types';
|
|
1
|
+
import { ResponseSpec, SearchQuery, SearchMatches, Memory } from '../types';
|
|
2
2
|
import { apiFetcher } from '../apiFetcher';
|
|
3
3
|
|
|
4
4
|
/******************
|
|
@@ -28,22 +28,48 @@ export default (apiUrl: string) => ({
|
|
|
28
28
|
* Picks up to 5 random Memory objects using the same algorithm employed in the
|
|
29
29
|
* Timeout event of the R1 state of the Dialog State Machine.
|
|
30
30
|
* @param {string} sessionId The session ID
|
|
31
|
+
* @param {SearchQuery} query Search query params
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
getRandomMemory: async (sessionId: string, query?: SearchQuery) =>
|
|
33
34
|
apiFetcher(`/Random/${sessionId}`, {
|
|
34
35
|
method: 'POST',
|
|
36
|
+
body: query,
|
|
35
37
|
apiUrl,
|
|
36
|
-
}) as Promise<
|
|
38
|
+
}) as Promise<
|
|
39
|
+
ResponseSpec & {
|
|
40
|
+
memories: Memory[];
|
|
41
|
+
}
|
|
42
|
+
>,
|
|
37
43
|
|
|
38
44
|
/**
|
|
39
45
|
* Picks up to 20 Memory Hint objects, obtained by searching for Story objects with a date or place set,
|
|
40
46
|
* and clustering dates and places within an uncertainty of at least 1 year or at least 100 km.
|
|
41
47
|
* Each Memory Hint may either suggest a date or a place, but not both.
|
|
42
48
|
* @param {string} sessionId The session ID
|
|
49
|
+
* @param {SearchQuery} query Search query params
|
|
43
50
|
*/
|
|
44
|
-
|
|
51
|
+
getHints: async (sessionId: string, query?: SearchQuery) =>
|
|
45
52
|
apiFetcher(`/Hints/${sessionId}`, {
|
|
53
|
+
method: 'POST',
|
|
54
|
+
body: query,
|
|
55
|
+
apiUrl,
|
|
56
|
+
}) as Promise<
|
|
57
|
+
ResponseSpec & {
|
|
58
|
+
memoryHints: string[];
|
|
59
|
+
}
|
|
60
|
+
>,
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Gets a list of all available memory tags.
|
|
64
|
+
* @param {string} sessionId The session ID
|
|
65
|
+
*/
|
|
66
|
+
getMemoryTags: async (sessionId: string) =>
|
|
67
|
+
apiFetcher(`/MemoryTags/${sessionId}`, {
|
|
46
68
|
method: 'GET',
|
|
47
69
|
apiUrl,
|
|
48
|
-
}) as Promise<
|
|
70
|
+
}) as Promise<
|
|
71
|
+
ResponseSpec & {
|
|
72
|
+
memoryTags: string[];
|
|
73
|
+
}
|
|
74
|
+
>,
|
|
49
75
|
});
|
package/src/types.ts
CHANGED
|
@@ -330,6 +330,7 @@ export type TenantBase = {
|
|
|
330
330
|
enableBadges?: boolean;
|
|
331
331
|
enableVirtualSpaces?: boolean;
|
|
332
332
|
enableDeepThought?: boolean;
|
|
333
|
+
billingDelegation?: boolean;
|
|
333
334
|
creationTimestamp?: string;
|
|
334
335
|
lastChangeTimestamp?: string;
|
|
335
336
|
};
|
|
@@ -467,6 +468,7 @@ export declare type DialogState = {
|
|
|
467
468
|
media?: Medium[];
|
|
468
469
|
knownTags?: { [key: string]: string };
|
|
469
470
|
contextVars?: { [key: string]: string };
|
|
471
|
+
memoryTags?: string[];
|
|
470
472
|
};
|
|
471
473
|
|
|
472
474
|
export declare type Person = {
|
|
@@ -680,6 +682,7 @@ export declare type Memory = {
|
|
|
680
682
|
help?: boolean;
|
|
681
683
|
notPickable?: boolean;
|
|
682
684
|
hints?: string[];
|
|
685
|
+
tags?: string[];
|
|
683
686
|
minTimeout?: number;
|
|
684
687
|
maxTimeout?: number;
|
|
685
688
|
contextVarsToSet?: { [variable: string]: string };
|
|
@@ -688,6 +691,15 @@ export declare type Memory = {
|
|
|
688
691
|
* Used for Unanswered Questions
|
|
689
692
|
*/
|
|
690
693
|
contextVars?: { [variable: string]: string };
|
|
694
|
+
/**
|
|
695
|
+
* Optional type of the outcome to be sent to the DCM platform when this Memory is emitted.
|
|
696
|
+
* @default "COMMON"
|
|
697
|
+
*/
|
|
698
|
+
dcmOutcomeType?: string;
|
|
699
|
+
/**
|
|
700
|
+
* Optional code of the outcome to be sent to the DCM platform when this Memory is emitted.
|
|
701
|
+
*/
|
|
702
|
+
dcmOutcomeCode?: string;
|
|
691
703
|
creationTimestamp?: string;
|
|
692
704
|
creationName?: string;
|
|
693
705
|
creationSessionID?: string;
|