@memori.ai/memori-api-client 5.3.1 → 5.4.1
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 +19 -0
- package/dist/backend/asset.d.ts +3 -0
- package/dist/backend/asset.js +4 -0
- package/dist/backend/asset.js.map +1 -1
- package/dist/backend/completionConfig.d.ts +7 -1
- package/dist/backend/completionConfig.js.map +1 -1
- package/dist/backend/tenant.d.ts +17 -0
- package/dist/backend/tenant.js +25 -0
- package/dist/backend/tenant.js.map +1 -0
- package/dist/backend/tenant.test.d.ts +1 -0
- package/dist/backend/tenant.test.js +14 -0
- package/dist/backend/tenant.test.js.map +1 -0
- package/dist/backend/user.d.ts +1 -4
- package/dist/backend/user.js +0 -3
- package/dist/backend/user.js.map +1 -1
- package/dist/backend.d.ts +48 -8
- package/dist/backend.js +3 -0
- package/dist/backend.js.map +1 -1
- package/dist/engine/contextVars.d.ts +3 -1
- package/dist/engine/contextVars.js.map +1 -1
- package/dist/engine/nlp.d.ts +9 -0
- package/dist/engine/nlp.js +15 -0
- package/dist/engine/nlp.js.map +1 -1
- package/dist/engine/stats.d.ts +4 -1
- package/dist/engine/stats.js +5 -1
- package/dist/engine/stats.js.map +1 -1
- package/dist/engine.d.ts +32 -4
- package/dist/index.d.ts +80 -12
- package/esm/backend/asset.d.ts +3 -0
- package/esm/backend/asset.js +4 -0
- package/esm/backend/asset.js.map +1 -1
- package/esm/backend/completionConfig.d.ts +7 -1
- package/esm/backend/completionConfig.js.map +1 -1
- package/esm/backend/tenant.d.ts +17 -0
- package/esm/backend/tenant.js +23 -0
- package/esm/backend/tenant.js.map +1 -0
- package/esm/backend/tenant.test.d.ts +1 -0
- package/esm/backend/tenant.test.js +11 -0
- package/esm/backend/tenant.test.js.map +1 -0
- package/esm/backend/user.d.ts +1 -4
- package/esm/backend/user.js +0 -3
- package/esm/backend/user.js.map +1 -1
- package/esm/backend.d.ts +48 -8
- package/esm/backend.js +3 -0
- package/esm/backend.js.map +1 -1
- package/esm/engine/contextVars.d.ts +3 -1
- package/esm/engine/contextVars.js.map +1 -1
- package/esm/engine/nlp.d.ts +9 -0
- package/esm/engine/nlp.js +15 -0
- package/esm/engine/nlp.js.map +1 -1
- package/esm/engine/stats.d.ts +4 -1
- package/esm/engine/stats.js +5 -1
- package/esm/engine/stats.js.map +1 -1
- package/esm/engine.d.ts +32 -4
- package/esm/index.d.ts +80 -12
- package/package.json +1 -1
- package/src/backend/asset.ts +11 -0
- package/src/backend/completionConfig.ts +14 -2
- package/src/backend/tenant.test.ts +17 -0
- package/src/backend/tenant.ts +74 -0
- package/src/backend/user.ts +0 -13
- package/src/backend.ts +3 -0
- package/src/engine/contextVars.ts +3 -1
- package/src/engine/nlp.ts +66 -0
- package/src/engine/stats.ts +24 -5
package/esm/engine/stats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/engine/stats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/engine/stats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,qBAAqB,EAAE,KAAK,EAAE,SAAiB,EAAE,SAAkB,EAAE,EAAE,CACrE,UAAU,CACR,uBAAuB,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EACrE;QACE,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CA2BF;IAQH,YAAY,EAAE,KAAK,EACjB,SAAiB,EACjB,WAAmB,EACnB,SAAiB,EACjB,EAAE,CACF,UAAU,CAAC,cAAc,SAAS,IAAI,WAAW,IAAI,SAAS,EAAE,EAAE;QAChE,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IASH,kBAAkB,EAAE,KAAK,EACvB,SAAiB,EACjB,QAAgB,EAChB,WAAmB,EACnB,SAAiB,EACjB,EAAE,CACF,UAAU,CACR,cAAc,SAAS,IAAI,QAAQ,IAAI,WAAW,IAAI,SAAS,EAAE,EACjE;QACE,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAKF;IASH,kBAAkB,EAAE,KAAK,EACvB,SAAiB,EACjB,QAAgB,EAChB,WAAmB,EACnB,SAAiB,EACjB,EAAE,CACF,UAAU,CACR,cAAc,SAAS,IAAI,QAAQ,IAAI,WAAW,IAAI,SAAS,EAAE,EACjE;QACE,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAKF;IAOH,mBAAmB,EAAE,KAAK,EAAE,SAAiB,EAAE,iBAAyB,EAAE,EAAE,CAC1E,UAAU,CAAC,qBAAqB,SAAS,IAAI,iBAAiB,EAAE,EAAE;QAChE,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;CACJ,CAAC,CAAC"}
|
package/esm/engine.d.ts
CHANGED
|
@@ -242,7 +242,9 @@ declare const _default: (apiUrl: string) => {
|
|
|
242
242
|
}) => Promise<import("./types").ResponseSpec>;
|
|
243
243
|
};
|
|
244
244
|
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
245
|
-
|
|
245
|
+
contextVars: {
|
|
246
|
+
[variable: string]: string[];
|
|
247
|
+
};
|
|
246
248
|
}>;
|
|
247
249
|
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
248
250
|
contextVarNames: string[];
|
|
@@ -253,7 +255,9 @@ declare const _default: (apiUrl: string) => {
|
|
|
253
255
|
}>;
|
|
254
256
|
contextVars: {
|
|
255
257
|
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
256
|
-
|
|
258
|
+
contextVars: {
|
|
259
|
+
[variable: string]: string[];
|
|
260
|
+
};
|
|
257
261
|
}>;
|
|
258
262
|
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
259
263
|
contextVarNames: string[];
|
|
@@ -287,7 +291,7 @@ declare const _default: (apiUrl: string) => {
|
|
|
287
291
|
}>;
|
|
288
292
|
deleteUnansweredQuestion: (sessionId: string, unansweredQuestionId: string) => Promise<import("./types").ResponseSpec>;
|
|
289
293
|
};
|
|
290
|
-
getTextQualityIndexes: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
294
|
+
getTextQualityIndexes: (sessionId: string, timestamp?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
291
295
|
textQualityIndex: number;
|
|
292
296
|
undefinedWords: string[];
|
|
293
297
|
contentTextQualityIndex: number;
|
|
@@ -302,8 +306,11 @@ declare const _default: (apiUrl: string) => {
|
|
|
302
306
|
getIntentEventLogs: (sessionId: string, intentId: string, strDateFrom: string, strDateTo: string) => Promise<import("./types").ResponseSpec & {
|
|
303
307
|
eventLogs: import("./types").EventLog[];
|
|
304
308
|
}>;
|
|
309
|
+
getSessionEventLogs: (sessionID: string, eventLogSessionID: string) => Promise<import("./types").ResponseSpec & {
|
|
310
|
+
eventLogs: import("./types").EventLog[];
|
|
311
|
+
}>;
|
|
305
312
|
stats: {
|
|
306
|
-
getTextQualityIndexes: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
313
|
+
getTextQualityIndexes: (sessionId: string, timestamp?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
307
314
|
textQualityIndex: number;
|
|
308
315
|
undefinedWords: string[];
|
|
309
316
|
contentTextQualityIndex: number;
|
|
@@ -318,6 +325,9 @@ declare const _default: (apiUrl: string) => {
|
|
|
318
325
|
getIntentEventLogs: (sessionId: string, intentId: string, strDateFrom: string, strDateTo: string) => Promise<import("./types").ResponseSpec & {
|
|
319
326
|
eventLogs: import("./types").EventLog[];
|
|
320
327
|
}>;
|
|
328
|
+
getSessionEventLogs: (sessionID: string, eventLogSessionID: string) => Promise<import("./types").ResponseSpec & {
|
|
329
|
+
eventLogs: import("./types").EventLog[];
|
|
330
|
+
}>;
|
|
321
331
|
};
|
|
322
332
|
initSession: (params: import("./types").OpenSession) => Promise<import("./types").ResponseSpec & {
|
|
323
333
|
sessionID: string;
|
|
@@ -435,6 +445,15 @@ declare const _default: (apiUrl: string) => {
|
|
|
435
445
|
checkWords: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
436
446
|
undefinedWords: string[];
|
|
437
447
|
}>;
|
|
448
|
+
suggestAnswer: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
449
|
+
answer: string;
|
|
450
|
+
}>;
|
|
451
|
+
suggestTags: (sessionId: string, question: string, answer: string, questionVariants?: string[] | undefined) => Promise<import("./types").ResponseSpec & {
|
|
452
|
+
tags: string[];
|
|
453
|
+
}>;
|
|
454
|
+
suggestQuestions: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
455
|
+
questions: string[];
|
|
456
|
+
}>;
|
|
438
457
|
nlp: {
|
|
439
458
|
getWordVector: (sessionId: string, word: string) => Promise<import("./types").ResponseSpec & {
|
|
440
459
|
vector: number[];
|
|
@@ -454,6 +473,15 @@ declare const _default: (apiUrl: string) => {
|
|
|
454
473
|
checkWords: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
455
474
|
undefinedWords: string[];
|
|
456
475
|
}>;
|
|
476
|
+
suggestAnswer: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
477
|
+
answer: string;
|
|
478
|
+
}>;
|
|
479
|
+
suggestTags: (sessionId: string, question: string, answer: string, questionVariants?: string[] | undefined) => Promise<import("./types").ResponseSpec & {
|
|
480
|
+
tags: string[];
|
|
481
|
+
}>;
|
|
482
|
+
suggestQuestions: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
483
|
+
questions: string[];
|
|
484
|
+
}>;
|
|
457
485
|
};
|
|
458
486
|
getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
459
487
|
memories: import("./types").Memory[];
|
package/esm/index.d.ts
CHANGED
|
@@ -251,7 +251,9 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
251
251
|
}) => Promise<import("./types").ResponseSpec>;
|
|
252
252
|
};
|
|
253
253
|
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
254
|
-
|
|
254
|
+
contextVars: {
|
|
255
|
+
[variable: string]: string[];
|
|
256
|
+
};
|
|
255
257
|
}>;
|
|
256
258
|
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
257
259
|
contextVarNames: string[];
|
|
@@ -262,7 +264,9 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
262
264
|
}>;
|
|
263
265
|
contextVars: {
|
|
264
266
|
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
265
|
-
|
|
267
|
+
contextVars: {
|
|
268
|
+
[variable: string]: string[];
|
|
269
|
+
};
|
|
266
270
|
}>;
|
|
267
271
|
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
268
272
|
contextVarNames: string[];
|
|
@@ -296,7 +300,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
296
300
|
}>;
|
|
297
301
|
deleteUnansweredQuestion: (sessionId: string, unansweredQuestionId: string) => Promise<import("./types").ResponseSpec>;
|
|
298
302
|
};
|
|
299
|
-
getTextQualityIndexes: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
303
|
+
getTextQualityIndexes: (sessionId: string, timestamp?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
300
304
|
textQualityIndex: number;
|
|
301
305
|
undefinedWords: string[];
|
|
302
306
|
contentTextQualityIndex: number;
|
|
@@ -311,8 +315,11 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
311
315
|
getIntentEventLogs: (sessionId: string, intentId: string, strDateFrom: string, strDateTo: string) => Promise<import("./types").ResponseSpec & {
|
|
312
316
|
eventLogs: import("./types").EventLog[];
|
|
313
317
|
}>;
|
|
318
|
+
getSessionEventLogs: (sessionID: string, eventLogSessionID: string) => Promise<import("./types").ResponseSpec & {
|
|
319
|
+
eventLogs: import("./types").EventLog[];
|
|
320
|
+
}>;
|
|
314
321
|
stats: {
|
|
315
|
-
getTextQualityIndexes: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
322
|
+
getTextQualityIndexes: (sessionId: string, timestamp?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
316
323
|
textQualityIndex: number;
|
|
317
324
|
undefinedWords: string[];
|
|
318
325
|
contentTextQualityIndex: number;
|
|
@@ -327,6 +334,9 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
327
334
|
getIntentEventLogs: (sessionId: string, intentId: string, strDateFrom: string, strDateTo: string) => Promise<import("./types").ResponseSpec & {
|
|
328
335
|
eventLogs: import("./types").EventLog[];
|
|
329
336
|
}>;
|
|
337
|
+
getSessionEventLogs: (sessionID: string, eventLogSessionID: string) => Promise<import("./types").ResponseSpec & {
|
|
338
|
+
eventLogs: import("./types").EventLog[];
|
|
339
|
+
}>;
|
|
330
340
|
};
|
|
331
341
|
initSession: (params: import("./types").OpenSession) => Promise<import("./types").ResponseSpec & {
|
|
332
342
|
sessionID: string;
|
|
@@ -444,6 +454,15 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
444
454
|
checkWords: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
445
455
|
undefinedWords: string[];
|
|
446
456
|
}>;
|
|
457
|
+
suggestAnswer: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
458
|
+
answer: string;
|
|
459
|
+
}>;
|
|
460
|
+
suggestTags: (sessionId: string, question: string, answer: string, questionVariants?: string[] | undefined) => Promise<import("./types").ResponseSpec & {
|
|
461
|
+
tags: string[];
|
|
462
|
+
}>;
|
|
463
|
+
suggestQuestions: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
464
|
+
questions: string[];
|
|
465
|
+
}>;
|
|
447
466
|
nlp: {
|
|
448
467
|
getWordVector: (sessionId: string, word: string) => Promise<import("./types").ResponseSpec & {
|
|
449
468
|
vector: number[];
|
|
@@ -463,6 +482,15 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
463
482
|
checkWords: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
464
483
|
undefinedWords: string[];
|
|
465
484
|
}>;
|
|
485
|
+
suggestAnswer: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
486
|
+
answer: string;
|
|
487
|
+
}>;
|
|
488
|
+
suggestTags: (sessionId: string, question: string, answer: string, questionVariants?: string[] | undefined) => Promise<import("./types").ResponseSpec & {
|
|
489
|
+
tags: string[];
|
|
490
|
+
}>;
|
|
491
|
+
suggestQuestions: (sessionId: string, text: string) => Promise<import("./types").ResponseSpec & {
|
|
492
|
+
questions: string[];
|
|
493
|
+
}>;
|
|
466
494
|
};
|
|
467
495
|
getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
468
496
|
memories: import("./types").Memory[];
|
|
@@ -685,6 +713,19 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
685
713
|
deleteCorrelationPair: (sessionId: string, pairId: string) => Promise<import("./types").ResponseSpec>;
|
|
686
714
|
};
|
|
687
715
|
backend: {
|
|
716
|
+
healthCheck: () => Promise<import("./types").ResponseSpec>;
|
|
717
|
+
getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
|
|
718
|
+
tenant: import("./types").TenantBase;
|
|
719
|
+
}>;
|
|
720
|
+
getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
|
|
721
|
+
tenants: import("./types").TenantBase[];
|
|
722
|
+
}>;
|
|
723
|
+
createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
|
|
724
|
+
tenant: import("./types").TenantBase;
|
|
725
|
+
}>;
|
|
726
|
+
patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
|
|
727
|
+
tenant: import("./types").TenantBase;
|
|
728
|
+
}>;
|
|
688
729
|
postOutcome: (authToken: string, outcomeCode: string) => Promise<import("./types").ResponseSpec>;
|
|
689
730
|
getUserBadges: (authToken: string) => Promise<import("./types").ResponseSpec & {
|
|
690
731
|
badges: import("./types").Badge[];
|
|
@@ -700,12 +741,18 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
700
741
|
}>;
|
|
701
742
|
updateCompletionConfig: (authToken: string, config: Partial<import("./types").CompletionConfig> & {
|
|
702
743
|
completionConfigID: string;
|
|
703
|
-
}) => Promise<import("./types").ResponseSpec
|
|
744
|
+
}) => Promise<import("./types").ResponseSpec & {
|
|
745
|
+
config: import("./types").CompletionConfig;
|
|
746
|
+
appliedMemoriIDs?: string[] | undefined;
|
|
747
|
+
appliedMemoriNames?: string[] | undefined;
|
|
748
|
+
}>;
|
|
704
749
|
deleteCompletionConfig: (authToken: string, configID: string) => Promise<import("./types").ResponseSpec>;
|
|
705
750
|
createCompletionConfig: (authToken: string, config: import("./types").CompletionConfig & {
|
|
706
751
|
completionConfigID?: string | undefined;
|
|
707
752
|
}) => Promise<import("./types").ResponseSpec & {
|
|
708
753
|
config: import("./types").CompletionConfig;
|
|
754
|
+
appliedMemoriIDs?: string[] | undefined;
|
|
755
|
+
appliedMemoriNames?: string[] | undefined;
|
|
709
756
|
}>;
|
|
710
757
|
analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
|
|
711
758
|
status: import("./types").AnalysisStatus;
|
|
@@ -832,9 +879,6 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
832
879
|
flowID?: string | undefined;
|
|
833
880
|
}>;
|
|
834
881
|
recoverUsername: (user: import("./types").User) => Promise<import("./types").ResponseSpec>;
|
|
835
|
-
getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
|
|
836
|
-
tenant: import("./types").Tenant;
|
|
837
|
-
}>;
|
|
838
882
|
resendVerificationCode: (user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec>;
|
|
839
883
|
createUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
840
884
|
user: import("./types").User;
|
|
@@ -900,6 +944,9 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
900
944
|
asset: import("./types").Asset;
|
|
901
945
|
}>;
|
|
902
946
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
947
|
+
getAssetList: (authToken: string) => Promise<import("./types").ResponseSpec & {
|
|
948
|
+
assets: import("./types").Asset[];
|
|
949
|
+
}>;
|
|
903
950
|
updateAsset: (authToken: string, assetURL: string, asset: import("./types").Asset) => Promise<import("./types").ResponseSpec & {
|
|
904
951
|
asset: import("./types").Asset;
|
|
905
952
|
}>;
|
|
@@ -910,6 +957,9 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
910
957
|
asset: import("./types").Asset;
|
|
911
958
|
}>;
|
|
912
959
|
getAsset: (fileName: string, sessionID: string) => Promise<any>;
|
|
960
|
+
getAssetList: (authToken: string) => Promise<import("./types").ResponseSpec & {
|
|
961
|
+
assets: import("./types").Asset[];
|
|
962
|
+
}>;
|
|
913
963
|
updateAsset: (authToken: string, assetURL: string, asset: import("./types").Asset) => Promise<import("./types").ResponseSpec & {
|
|
914
964
|
asset: import("./types").Asset;
|
|
915
965
|
}>;
|
|
@@ -1011,9 +1061,6 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1011
1061
|
flowID?: string | undefined;
|
|
1012
1062
|
}>;
|
|
1013
1063
|
recoverUsername: (user: import("./types").User) => Promise<import("./types").ResponseSpec>;
|
|
1014
|
-
getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
|
|
1015
|
-
tenant: import("./types").Tenant;
|
|
1016
|
-
}>;
|
|
1017
1064
|
resendVerificationCode: (user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec>;
|
|
1018
1065
|
createUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
1019
1066
|
user: import("./types").User;
|
|
@@ -1130,12 +1177,18 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1130
1177
|
}>;
|
|
1131
1178
|
updateCompletionConfig: (authToken: string, config: Partial<import("./types").CompletionConfig> & {
|
|
1132
1179
|
completionConfigID: string;
|
|
1133
|
-
}) => Promise<import("./types").ResponseSpec
|
|
1180
|
+
}) => Promise<import("./types").ResponseSpec & {
|
|
1181
|
+
config: import("./types").CompletionConfig;
|
|
1182
|
+
appliedMemoriIDs?: string[] | undefined;
|
|
1183
|
+
appliedMemoriNames?: string[] | undefined;
|
|
1184
|
+
}>;
|
|
1134
1185
|
deleteCompletionConfig: (authToken: string, configID: string) => Promise<import("./types").ResponseSpec>;
|
|
1135
1186
|
createCompletionConfig: (authToken: string, config: import("./types").CompletionConfig & {
|
|
1136
1187
|
completionConfigID?: string | undefined;
|
|
1137
1188
|
}) => Promise<import("./types").ResponseSpec & {
|
|
1138
1189
|
config: import("./types").CompletionConfig;
|
|
1190
|
+
appliedMemoriIDs?: string[] | undefined;
|
|
1191
|
+
appliedMemoriNames?: string[] | undefined;
|
|
1139
1192
|
}>;
|
|
1140
1193
|
};
|
|
1141
1194
|
badge: {
|
|
@@ -1147,6 +1200,21 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1147
1200
|
badge: import("./types").Badge;
|
|
1148
1201
|
}>;
|
|
1149
1202
|
};
|
|
1203
|
+
tenant: {
|
|
1204
|
+
healthCheck: () => Promise<import("./types").ResponseSpec>;
|
|
1205
|
+
getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
|
|
1206
|
+
tenant: import("./types").TenantBase;
|
|
1207
|
+
}>;
|
|
1208
|
+
getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
|
|
1209
|
+
tenants: import("./types").TenantBase[];
|
|
1210
|
+
}>;
|
|
1211
|
+
createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
|
|
1212
|
+
tenant: import("./types").TenantBase;
|
|
1213
|
+
}>;
|
|
1214
|
+
patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
|
|
1215
|
+
tenant: import("./types").TenantBase;
|
|
1216
|
+
}>;
|
|
1217
|
+
};
|
|
1150
1218
|
};
|
|
1151
1219
|
};
|
|
1152
1220
|
export default api;
|
package/package.json
CHANGED
package/src/backend/asset.ts
CHANGED
|
@@ -66,6 +66,17 @@ export default (apiUrl: string) => ({
|
|
|
66
66
|
method: 'GET',
|
|
67
67
|
}),
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Gets a list of Asset objects owned the currently logged in User.
|
|
71
|
+
* @param {string} authToken - The login token
|
|
72
|
+
* @returns The list of Asset objects.
|
|
73
|
+
*/
|
|
74
|
+
getAssetList: (authToken: string) =>
|
|
75
|
+
apiFetcher(`/Assets/${authToken}`, {
|
|
76
|
+
apiUrl,
|
|
77
|
+
method: 'GET',
|
|
78
|
+
}) as Promise<ResponseSpec & { assets: Asset[] }>,
|
|
79
|
+
|
|
69
80
|
/**
|
|
70
81
|
* Updates an Asset object
|
|
71
82
|
* @param {string} authToken - The login token
|
|
@@ -49,7 +49,13 @@ export default (apiUrl: string) => ({
|
|
|
49
49
|
apiUrl,
|
|
50
50
|
method: 'PATCH',
|
|
51
51
|
body: config,
|
|
52
|
-
}) as Promise<
|
|
52
|
+
}) as Promise<
|
|
53
|
+
ResponseSpec & {
|
|
54
|
+
config: CompletionConfig;
|
|
55
|
+
appliedMemoriIDs?: string[];
|
|
56
|
+
appliedMemoriNames?: string[];
|
|
57
|
+
}
|
|
58
|
+
>,
|
|
53
59
|
|
|
54
60
|
/**
|
|
55
61
|
* Deletes an existing Completion Config object.
|
|
@@ -73,5 +79,11 @@ export default (apiUrl: string) => ({
|
|
|
73
79
|
apiUrl,
|
|
74
80
|
method: 'POST',
|
|
75
81
|
body: config,
|
|
76
|
-
}) as Promise<
|
|
82
|
+
}) as Promise<
|
|
83
|
+
ResponseSpec & {
|
|
84
|
+
config: CompletionConfig;
|
|
85
|
+
appliedMemoriIDs?: string[];
|
|
86
|
+
appliedMemoriNames?: string[];
|
|
87
|
+
}
|
|
88
|
+
>,
|
|
77
89
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import memori from '../index';
|
|
2
|
+
|
|
3
|
+
const client = memori('https://backend.memori.ai');
|
|
4
|
+
|
|
5
|
+
describe('backend/tenant api', () => {
|
|
6
|
+
it('works on tenant apis', async () => {
|
|
7
|
+
expect(
|
|
8
|
+
await client.backend.tenant.getTenantConfig('www.aisuru.com')
|
|
9
|
+
).not.toBeNull();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('works on tenant apis with shorthand version', async () => {
|
|
13
|
+
expect(
|
|
14
|
+
await client.backend.getTenantConfig('www.aisuru.com')
|
|
15
|
+
).not.toBeNull();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ResponseSpec, TenantBase } from '../types';
|
|
2
|
+
import { apiFetcher } from '../apiFetcher';
|
|
3
|
+
|
|
4
|
+
export default (apiUrl: string) => ({
|
|
5
|
+
/**
|
|
6
|
+
* Health check for the backend
|
|
7
|
+
*/
|
|
8
|
+
healthCheck: () =>
|
|
9
|
+
apiFetcher(`/HealthCheck`, {
|
|
10
|
+
apiUrl,
|
|
11
|
+
method: 'GET',
|
|
12
|
+
}) as Promise<ResponseSpec>,
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Gets the details of a Tenant object.
|
|
16
|
+
* @param tenantName - The name of the tenant
|
|
17
|
+
*/
|
|
18
|
+
getTenantConfig: (tenantName: string) =>
|
|
19
|
+
apiFetcher(`/Tenant/${tenantName}`, { apiUrl }) as Promise<
|
|
20
|
+
ResponseSpec & {
|
|
21
|
+
tenant: TenantBase;
|
|
22
|
+
}
|
|
23
|
+
>,
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Gets the list of of all Tenant objects.
|
|
27
|
+
* @param authToken - The login token
|
|
28
|
+
*/
|
|
29
|
+
getTenantList: (authToken: string) =>
|
|
30
|
+
apiFetcher(`/Tenants/${authToken}`, {
|
|
31
|
+
apiUrl,
|
|
32
|
+
method: 'GET',
|
|
33
|
+
}) as Promise<ResponseSpec & { tenants: TenantBase[] }>,
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Duplicates a Tenant object.
|
|
37
|
+
* @param {string} authToken - The login token
|
|
38
|
+
* @param {string} name - The name of the Tenant to duplicate
|
|
39
|
+
* @param {TenantBase} tenant
|
|
40
|
+
* @returns The specifications of the new Tenant object
|
|
41
|
+
*/
|
|
42
|
+
createTenant: (
|
|
43
|
+
authToken: string,
|
|
44
|
+
name: string,
|
|
45
|
+
tenant: Partial<TenantBase>
|
|
46
|
+
) =>
|
|
47
|
+
apiFetcher(`/Tenant/${authToken}/${name}`, {
|
|
48
|
+
apiUrl,
|
|
49
|
+
method: 'POST',
|
|
50
|
+
body: tenant,
|
|
51
|
+
}) as Promise<
|
|
52
|
+
ResponseSpec & {
|
|
53
|
+
tenant: TenantBase;
|
|
54
|
+
}
|
|
55
|
+
>,
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Updates the details of a Tenant object.
|
|
59
|
+
* @param {string} authToken - The login token
|
|
60
|
+
* @param {string} name - The name of the Tenant to update
|
|
61
|
+
* @param {TenantBase} tenant
|
|
62
|
+
* @returns The new specifications of the Tenant object
|
|
63
|
+
*/
|
|
64
|
+
patchTenant: (authToken: string, name: string, tenant: Partial<TenantBase>) =>
|
|
65
|
+
apiFetcher(`/Tenant/${authToken}/${name}`, {
|
|
66
|
+
apiUrl,
|
|
67
|
+
method: 'PATCH',
|
|
68
|
+
body: tenant,
|
|
69
|
+
}) as Promise<
|
|
70
|
+
ResponseSpec & {
|
|
71
|
+
tenant: TenantBase;
|
|
72
|
+
}
|
|
73
|
+
>,
|
|
74
|
+
});
|
package/src/backend/user.ts
CHANGED
|
@@ -182,19 +182,6 @@ export default (apiUrl: string) => ({
|
|
|
182
182
|
method: 'POST',
|
|
183
183
|
}) as Promise<ResponseSpec>,
|
|
184
184
|
|
|
185
|
-
/**
|
|
186
|
-
* Gets the details of a Tenant object.
|
|
187
|
-
* @param tenantName - The name of the tenant
|
|
188
|
-
*/
|
|
189
|
-
getTenantConfig: (tenantName: string) =>
|
|
190
|
-
apiFetcher(`/Tenant/${tenantName}`, {
|
|
191
|
-
apiUrl,
|
|
192
|
-
}) as Promise<
|
|
193
|
-
ResponseSpec & {
|
|
194
|
-
tenant: Tenant;
|
|
195
|
-
}
|
|
196
|
-
>,
|
|
197
|
-
|
|
198
185
|
/**
|
|
199
186
|
* Re-sends the verification code to confirm a pending User registration.
|
|
200
187
|
* @param {User} user - The user object
|
package/src/backend.ts
CHANGED
|
@@ -10,6 +10,7 @@ import process from './backend/process';
|
|
|
10
10
|
import analysis from './backend/analysis';
|
|
11
11
|
import completionConfig from './backend/completionConfig';
|
|
12
12
|
import badge from './backend/badge';
|
|
13
|
+
import tenant from './backend/tenant';
|
|
13
14
|
|
|
14
15
|
const backendAPI = (apiUrl: string) => ({
|
|
15
16
|
asset: asset(apiUrl),
|
|
@@ -24,6 +25,7 @@ const backendAPI = (apiUrl: string) => ({
|
|
|
24
25
|
analysis: analysis(apiUrl),
|
|
25
26
|
completionConfig: completionConfig(apiUrl),
|
|
26
27
|
badge: badge(apiUrl),
|
|
28
|
+
tenant: tenant(apiUrl),
|
|
27
29
|
...asset(apiUrl),
|
|
28
30
|
...memori(apiUrl),
|
|
29
31
|
...user(apiUrl),
|
|
@@ -36,6 +38,7 @@ const backendAPI = (apiUrl: string) => ({
|
|
|
36
38
|
...analysis(apiUrl),
|
|
37
39
|
...completionConfig(apiUrl),
|
|
38
40
|
...badge(apiUrl),
|
|
41
|
+
...tenant(apiUrl),
|
|
39
42
|
});
|
|
40
43
|
|
|
41
44
|
export default backendAPI;
|
package/src/engine/nlp.ts
CHANGED
|
@@ -113,4 +113,70 @@ export default (apiUrl: string) => ({
|
|
|
113
113
|
undefinedWords: string[];
|
|
114
114
|
}
|
|
115
115
|
>,
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Tries to suggest the answer for a question, using as much content as possible from the session's associated Memori object.
|
|
119
|
+
* @param {string} sessionId The session ID
|
|
120
|
+
* @param {string} text Text of the sentence.
|
|
121
|
+
*/
|
|
122
|
+
suggestAnswer: async (sessionId: string, text: string) =>
|
|
123
|
+
apiFetcher(`/SuggestAnswer/${sessionId}`, {
|
|
124
|
+
method: 'POST',
|
|
125
|
+
apiUrl,
|
|
126
|
+
body: { text },
|
|
127
|
+
}) as Promise<
|
|
128
|
+
ResponseSpec & {
|
|
129
|
+
/**
|
|
130
|
+
* Suggested answer. May be null if no answer could be suggested.
|
|
131
|
+
*/
|
|
132
|
+
answer: string;
|
|
133
|
+
}
|
|
134
|
+
>,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Tries to suggest tags for a a question and its answer.
|
|
138
|
+
* Differently from ```SuggestAnswer```, no content from the session's associated Memori object is used.
|
|
139
|
+
* @param {string} sessionId The session ID
|
|
140
|
+
* @param {string} question Text of question.
|
|
141
|
+
* @param {string} answer Answer to the question (and its variants).
|
|
142
|
+
* @param {string[]=} questionVariants Optional list of question variants.
|
|
143
|
+
*/
|
|
144
|
+
suggestTags: async (
|
|
145
|
+
sessionId: string,
|
|
146
|
+
question: string,
|
|
147
|
+
answer: string,
|
|
148
|
+
questionVariants?: string[]
|
|
149
|
+
) =>
|
|
150
|
+
apiFetcher(`/SuggestTags/${sessionId}`, {
|
|
151
|
+
method: 'POST',
|
|
152
|
+
apiUrl,
|
|
153
|
+
body: { question, answer, questionVariants },
|
|
154
|
+
}) as Promise<
|
|
155
|
+
ResponseSpec & {
|
|
156
|
+
/**
|
|
157
|
+
* Suggested tags. May be null or empty if no tags could be suggested.
|
|
158
|
+
*/
|
|
159
|
+
tags: string[];
|
|
160
|
+
}
|
|
161
|
+
>,
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Tries to suggest questions for an answer.
|
|
165
|
+
* Differently from ```SuggestAnswer```, no content from the session's associated Memori object is used.
|
|
166
|
+
* @param {string} sessionId The session ID
|
|
167
|
+
* @param {string} text Text of the sentence.
|
|
168
|
+
*/
|
|
169
|
+
suggestQuestions: async (sessionId: string, text: string) =>
|
|
170
|
+
apiFetcher(`/SuggestQuestions/${sessionId}`, {
|
|
171
|
+
method: 'POST',
|
|
172
|
+
apiUrl,
|
|
173
|
+
body: { text },
|
|
174
|
+
}) as Promise<
|
|
175
|
+
ResponseSpec & {
|
|
176
|
+
/**
|
|
177
|
+
* Suggested questions. May be null or empty if no questions could be suggested.
|
|
178
|
+
*/
|
|
179
|
+
questions: string[];
|
|
180
|
+
}
|
|
181
|
+
>,
|
|
116
182
|
});
|
package/src/engine/stats.ts
CHANGED
|
@@ -11,12 +11,16 @@ export default (apiUrl: string) => ({
|
|
|
11
11
|
/**
|
|
12
12
|
* Computes text quality indexes for a Memori.
|
|
13
13
|
* @param {string} sessionId - The session ID
|
|
14
|
+
* @param {string=} timestamp - The optional latest update timestamp, in UTC time, in the format yyyyMMddHHmmssfff
|
|
14
15
|
*/
|
|
15
|
-
getTextQualityIndexes: async (sessionId: string) =>
|
|
16
|
-
apiFetcher(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
getTextQualityIndexes: async (sessionId: string, timestamp?: string) =>
|
|
17
|
+
apiFetcher(
|
|
18
|
+
`/TextQualityIndexes/${sessionId}${timestamp ? `/${timestamp}` : ''}`,
|
|
19
|
+
{
|
|
20
|
+
method: 'GET',
|
|
21
|
+
apiUrl,
|
|
22
|
+
}
|
|
23
|
+
) as Promise<
|
|
20
24
|
ResponseSpec & {
|
|
21
25
|
/**
|
|
22
26
|
* @type {number}
|
|
@@ -113,4 +117,19 @@ export default (apiUrl: string) => ({
|
|
|
113
117
|
eventLogs: EventLog[];
|
|
114
118
|
}
|
|
115
119
|
>,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Gets the Event Log objects for the Memori of the current session recorded during a specific other session.
|
|
123
|
+
* @param {string} sessionID The session ID
|
|
124
|
+
* @param {string} eventLogSessionID The session ID for which Event Log objects are being searched
|
|
125
|
+
*/
|
|
126
|
+
getSessionEventLogs: async (sessionID: string, eventLogSessionID: string) =>
|
|
127
|
+
apiFetcher(`/SessionEventLogs/${sessionID}/${eventLogSessionID}`, {
|
|
128
|
+
method: 'GET',
|
|
129
|
+
apiUrl,
|
|
130
|
+
}) as Promise<
|
|
131
|
+
ResponseSpec & {
|
|
132
|
+
eventLogs: EventLog[];
|
|
133
|
+
}
|
|
134
|
+
>,
|
|
116
135
|
});
|