@memori.ai/memori-api-client 4.0.1 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
 
2
2
 
3
+ ## [4.0.3](https://github.com/memori-ai/memori-api-client/compare/v4.0.2...v4.0.3) (2024-03-29)
4
+
5
+
6
+ ### Changes
7
+
8
+ * add threshold in followers search apis ([4cf6140](https://github.com/memori-ai/memori-api-client/commit/4cf6140a80b7748b73d50a79aa8251bcc0661b6b))
9
+
10
+ ## [4.0.2](https://github.com/memori-ai/memori-api-client/compare/v4.0.1...v4.0.2) (2024-03-25)
11
+
12
+
13
+ ### Maintenance
14
+
15
+ * add attributes to ProcessStatus ([c72da0a](https://github.com/memori-ai/memori-api-client/commit/c72da0adca92f7a799cbdba640b010ef3f9040ee))
16
+
3
17
  ## [4.0.1](https://github.com/memori-ai/memori-api-client/compare/v4.0.0...v4.0.1) (2024-03-22)
4
18
 
5
19
 
@@ -3,7 +3,7 @@ declare const _default: (apiUrl: string) => {
3
3
  analyzeUserQuery: (authToken: string, memoriID: string, params: AnalysisParams) => Promise<ResponseSpec & {
4
4
  status: AnalysisStatus;
5
5
  }>;
6
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<ResponseSpec & {
6
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number) => Promise<ResponseSpec & {
7
7
  count: number;
8
8
  matches: UserQueryMatch[];
9
9
  }>;
@@ -9,7 +9,7 @@ exports.default = (apiUrl) => ({
9
9
  ...params,
10
10
  },
11
11
  }),
12
- getUserQueryMatches: async (authToken, analysisID, from, howMany) => (0, apiFetcher_1.apiFetcher)(`/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}`, {
12
+ getUserQueryMatches: async (authToken, analysisID, from, howMany, threshold) => (0, apiFetcher_1.apiFetcher)(`/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}${threshold ? `/${threshold}` : ''}`, {
13
13
  apiUrl,
14
14
  method: 'GET',
15
15
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/backend/analysis.ts"],"names":[],"mappings":";;AAMA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAOlC,gBAAgB,EAAE,KAAK,EACrB,SAAiB,EACjB,QAAgB,EAChB,MAAsB,EACtB,EAAE,CACF,IAAA,uBAAU,EAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAChE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASH,mBAAmB,EAAE,KAAK,EACxB,SAAiB,EACjB,UAAkB,EAClB,IAAY,EACZ,OAAe,EACf,EAAE,CACF,IAAA,uBAAU,EACR,8BAA8B,SAAS,IAAI,UAAU,IAAI,IAAI,IAAI,OAAO,EAAE,EAC1E;QACE,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAYF;CACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/backend/analysis.ts"],"names":[],"mappings":";;AAMA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAOlC,gBAAgB,EAAE,KAAK,EACrB,SAAiB,EACjB,QAAgB,EAChB,MAAsB,EACtB,EAAE,CACF,IAAA,uBAAU,EAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAChE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IAUH,mBAAmB,EAAE,KAAK,EACxB,SAAiB,EACjB,UAAkB,EAClB,IAAY,EACZ,OAAe,EACf,SAAkB,EAClB,EAAE,CACF,IAAA,uBAAU,EACR,8BAA8B,SAAS,IAAI,UAAU,IAAI,IAAI,IAAI,OAAO,GACtE,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAChC,EAAE,EACF;QACE,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAYF;CACJ,CAAC,CAAC"}
package/dist/backend.d.ts CHANGED
@@ -2,7 +2,7 @@ declare const backendAPI: (apiUrl: string) => {
2
2
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
3
3
  status: import("./types").AnalysisStatus;
4
4
  }>;
5
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
5
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
6
6
  count: number;
7
7
  matches: import("./types").UserQueryMatch[];
8
8
  }>;
@@ -402,7 +402,7 @@ declare const backendAPI: (apiUrl: string) => {
402
402
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
403
403
  status: import("./types").AnalysisStatus;
404
404
  }>;
405
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
405
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
406
406
  count: number;
407
407
  matches: import("./types").UserQueryMatch[];
408
408
  }>;
package/dist/index.d.ts CHANGED
@@ -609,7 +609,7 @@ declare const api: (hostname?: string) => {
609
609
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
610
610
  status: import("./types").AnalysisStatus;
611
611
  }>;
612
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
612
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
613
613
  count: number;
614
614
  matches: import("./types").UserQueryMatch[];
615
615
  }>;
@@ -1009,7 +1009,7 @@ declare const api: (hostname?: string) => {
1009
1009
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
1010
1010
  status: import("./types").AnalysisStatus;
1011
1011
  }>;
1012
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
1012
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
1013
1013
  count: number;
1014
1014
  matches: import("./types").UserQueryMatch[];
1015
1015
  }>;
package/dist/types.d.ts CHANGED
@@ -667,6 +667,7 @@ export interface ImportWarning {
667
667
  }
668
668
  export interface AnalysisParams {
669
669
  query: string;
670
+ threshold?: number;
670
671
  }
671
672
  export interface AnalysisWarning {
672
673
  warningType: 'Error' | string;
@@ -688,6 +689,8 @@ export interface ProcessStatus {
688
689
  begin?: string;
689
690
  end?: string;
690
691
  eta?: number;
692
+ processedElements?: number;
693
+ totalElements?: number;
691
694
  creationTimestamp?: string;
692
695
  lastChangeTimestamp?: string;
693
696
  }
@@ -3,7 +3,7 @@ declare const _default: (apiUrl: string) => {
3
3
  analyzeUserQuery: (authToken: string, memoriID: string, params: AnalysisParams) => Promise<ResponseSpec & {
4
4
  status: AnalysisStatus;
5
5
  }>;
6
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<ResponseSpec & {
6
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number) => Promise<ResponseSpec & {
7
7
  count: number;
8
8
  matches: UserQueryMatch[];
9
9
  }>;
@@ -7,7 +7,7 @@ export default (apiUrl) => ({
7
7
  ...params,
8
8
  },
9
9
  }),
10
- getUserQueryMatches: async (authToken, analysisID, from, howMany) => apiFetcher(`/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}`, {
10
+ getUserQueryMatches: async (authToken, analysisID, from, howMany, threshold) => apiFetcher(`/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}${threshold ? `/${threshold}` : ''}`, {
11
11
  apiUrl,
12
12
  method: 'GET',
13
13
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/backend/analysis.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAOlC,gBAAgB,EAAE,KAAK,EACrB,SAAiB,EACjB,QAAgB,EAChB,MAAsB,EACtB,EAAE,CACF,UAAU,CAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAChE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASH,mBAAmB,EAAE,KAAK,EACxB,SAAiB,EACjB,UAAkB,EAClB,IAAY,EACZ,OAAe,EACf,EAAE,CACF,UAAU,CACR,8BAA8B,SAAS,IAAI,UAAU,IAAI,IAAI,IAAI,OAAO,EAAE,EAC1E;QACE,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAYF;CACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/backend/analysis.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAOlC,gBAAgB,EAAE,KAAK,EACrB,SAAiB,EACjB,QAAgB,EAChB,MAAsB,EACtB,EAAE,CACF,UAAU,CAAC,8BAA8B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAChE,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IAUH,mBAAmB,EAAE,KAAK,EACxB,SAAiB,EACjB,UAAkB,EAClB,IAAY,EACZ,OAAe,EACf,SAAkB,EAClB,EAAE,CACF,UAAU,CACR,8BAA8B,SAAS,IAAI,UAAU,IAAI,IAAI,IAAI,OAAO,GACtE,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAChC,EAAE,EACF;QACE,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAYF;CACJ,CAAC,CAAC"}
package/esm/backend.d.ts CHANGED
@@ -2,7 +2,7 @@ declare const backendAPI: (apiUrl: string) => {
2
2
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
3
3
  status: import("./types").AnalysisStatus;
4
4
  }>;
5
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
5
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
6
6
  count: number;
7
7
  matches: import("./types").UserQueryMatch[];
8
8
  }>;
@@ -402,7 +402,7 @@ declare const backendAPI: (apiUrl: string) => {
402
402
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
403
403
  status: import("./types").AnalysisStatus;
404
404
  }>;
405
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
405
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
406
406
  count: number;
407
407
  matches: import("./types").UserQueryMatch[];
408
408
  }>;
package/esm/index.d.ts CHANGED
@@ -609,7 +609,7 @@ declare const api: (hostname?: string) => {
609
609
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
610
610
  status: import("./types").AnalysisStatus;
611
611
  }>;
612
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
612
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
613
613
  count: number;
614
614
  matches: import("./types").UserQueryMatch[];
615
615
  }>;
@@ -1009,7 +1009,7 @@ declare const api: (hostname?: string) => {
1009
1009
  analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
1010
1010
  status: import("./types").AnalysisStatus;
1011
1011
  }>;
1012
- getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
1012
+ getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number, threshold?: number | undefined) => Promise<import("./types").ResponseSpec & {
1013
1013
  count: number;
1014
1014
  matches: import("./types").UserQueryMatch[];
1015
1015
  }>;
package/esm/types.d.ts CHANGED
@@ -667,6 +667,7 @@ export interface ImportWarning {
667
667
  }
668
668
  export interface AnalysisParams {
669
669
  query: string;
670
+ threshold?: number;
670
671
  }
671
672
  export interface AnalysisWarning {
672
673
  warningType: 'Error' | string;
@@ -688,6 +689,8 @@ export interface ProcessStatus {
688
689
  begin?: string;
689
690
  end?: string;
690
691
  eta?: number;
692
+ processedElements?: number;
693
+ totalElements?: number;
691
694
  creationTimestamp?: string;
692
695
  lastChangeTimestamp?: string;
693
696
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.1",
2
+ "version": "4.0.3",
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",
@@ -36,15 +36,19 @@ export default (apiUrl: string) => ({
36
36
  * @param {string} analysisID - The Analysis process ID
37
37
  * @param {number} from The 0-based index of the first Expert Reference object to list
38
38
  * @param {number} howMany The number of the Expert Reference objects to list
39
+ * @param {number=} threshold Threshold between 0.0 and 1.0. User objects whose match level is below this threshold will be discarded. If null, all User objects will be returned.
39
40
  */
40
41
  getUserQueryMatches: async (
41
42
  authToken: string,
42
43
  analysisID: string,
43
44
  from: number,
44
- howMany: number
45
+ howMany: number,
46
+ threshold?: number
45
47
  ) =>
46
48
  apiFetcher(
47
- `/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}`,
49
+ `/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}${
50
+ threshold ? `/${threshold}` : ''
51
+ }`,
48
52
  {
49
53
  apiUrl,
50
54
  method: 'GET',
package/src/types.ts CHANGED
@@ -1034,7 +1034,17 @@ export interface ImportWarning {
1034
1034
  }
1035
1035
 
1036
1036
  export interface AnalysisParams {
1037
+ /**
1038
+ * @type {string}
1039
+ * Query to be matched with User objects in the analysis.
1040
+ */
1037
1041
  query: string;
1042
+ /**
1043
+ * @type {number=}
1044
+ * Threshold between 0.0 and 1.0. User objects whose match level is below this threshold will be discarded.
1045
+ * If null, all User objects will be returned.
1046
+ */
1047
+ threshold?: number;
1038
1048
  }
1039
1049
 
1040
1050
  export interface AnalysisWarning {
@@ -1140,6 +1150,16 @@ export interface ProcessStatus {
1140
1150
  * Estimated time required to complete the Import process, in seconds.
1141
1151
  */
1142
1152
  eta?: number;
1153
+ /**
1154
+ * @type {number=}
1155
+ * Number of elements this Process has processed so far.
1156
+ */
1157
+ processedElements?: number;
1158
+ /**
1159
+ * @type {number=}
1160
+ * Total elements this Process is processing.
1161
+ */
1162
+ totalElements?: number;
1143
1163
  creationTimestamp?: string;
1144
1164
  lastChangeTimestamp?: string;
1145
1165
  }