@memori.ai/memori-api-client 3.0.0 → 4.0.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 +23 -0
- package/dist/backend/analysis.d.ts +11 -0
- package/dist/backend/analysis.js +17 -0
- package/dist/backend/analysis.js.map +1 -0
- package/dist/backend/analysis.test.d.ts +1 -0
- package/dist/backend/analysis.test.js +14 -0
- package/dist/backend/analysis.test.js.map +1 -0
- package/dist/backend/importExport.d.ts +3 -12
- package/dist/backend/importExport.js +0 -12
- package/dist/backend/importExport.js.map +1 -1
- package/dist/backend/importExport.test.js +10 -2
- package/dist/backend/importExport.test.js.map +1 -1
- package/dist/backend/process.d.ts +16 -0
- package/dist/backend/process.js +22 -0
- package/dist/backend/process.js.map +1 -0
- package/dist/backend/process.test.d.ts +1 -0
- package/dist/backend/process.test.js +14 -0
- package/dist/backend/process.test.js.map +1 -0
- package/dist/backend.d.ts +44 -20
- package/dist/backend.js +6 -0
- package/dist/backend.js.map +1 -1
- package/dist/index.d.ts +44 -20
- package/dist/types.d.ts +46 -12
- package/esm/backend/analysis.d.ts +11 -0
- package/esm/backend/analysis.js +15 -0
- package/esm/backend/analysis.js.map +1 -0
- package/esm/backend/analysis.test.d.ts +1 -0
- package/esm/backend/analysis.test.js +11 -0
- package/esm/backend/analysis.test.js.map +1 -0
- package/esm/backend/importExport.d.ts +3 -12
- package/esm/backend/importExport.js +0 -12
- package/esm/backend/importExport.js.map +1 -1
- package/esm/backend/importExport.test.js +10 -2
- package/esm/backend/importExport.test.js.map +1 -1
- package/esm/backend/process.d.ts +16 -0
- package/esm/backend/process.js +20 -0
- package/esm/backend/process.js.map +1 -0
- package/esm/backend/process.test.d.ts +1 -0
- package/esm/backend/process.test.js +11 -0
- package/esm/backend/process.test.js.map +1 -0
- package/esm/backend.d.ts +44 -20
- package/esm/backend.js +6 -0
- package/esm/backend.js.map +1 -1
- package/esm/index.d.ts +44 -20
- package/esm/types.d.ts +46 -12
- package/package.json +1 -1
- package/src/backend/analysis.test.ts +25 -0
- package/src/backend/analysis.ts +64 -0
- package/src/backend/importExport.test.ts +14 -4
- package/src/backend/importExport.ts +3 -47
- package/src/backend/process.test.ts +23 -0
- package/src/backend/process.ts +86 -0
- package/src/backend.ts +6 -0
- package/src/types.ts +150 -27
|
@@ -16,18 +16,6 @@ export default (apiUrl) => ({
|
|
|
16
16
|
...params,
|
|
17
17
|
},
|
|
18
18
|
}),
|
|
19
|
-
importProcesses: async (authToken) => apiFetcher(`/ImportExport/ImportProcesses/${authToken}`, {
|
|
20
|
-
apiUrl,
|
|
21
|
-
method: 'GET',
|
|
22
|
-
}),
|
|
23
|
-
importStatus: async (authToken, importID) => apiFetcher(`/ImportExport/ImportStatus/${authToken}/${importID}`, {
|
|
24
|
-
apiUrl,
|
|
25
|
-
method: 'GET',
|
|
26
|
-
}),
|
|
27
|
-
stopImport: async (authToken, importID) => apiFetcher(`/ImportExport/StopImport/${authToken}/${importID}`, {
|
|
28
|
-
apiUrl,
|
|
29
|
-
method: 'POST',
|
|
30
|
-
}),
|
|
31
19
|
exportCSV: async (authToken, memoriID, csvSpecs, password) => apiFetcher(`/ImportExport/ExportCSV/${authToken}/${memoriID}`, {
|
|
32
20
|
apiUrl,
|
|
33
21
|
method: 'POST',
|
|
@@ -1 +1 @@
|
|
|
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,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACF,UAAU,CAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASH,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACF,UAAU,CAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;
|
|
1
|
+
{"version":3,"file":"importExport.js","sourceRoot":"","sources":["../../src/backend/importExport.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAQlC,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACF,UAAU,CAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IASH,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,IAAc,EACd,MAAsC,EACtC,EAAE,CACF,UAAU,CAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,IAAI;YACJ,GAAG,MAAM;SACV;KACF,CAIA;IAUH,SAAS,EAAE,KAAK,EACd,SAAiB,EACjB,QAAgB,EAChB,QAAkB,EAClB,QAAiB,EACjB,EAAE,CACF,UAAU,CAAC,2BAA2B,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7D,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,QAAQ;YACR,QAAQ;SACT;QACD,IAAI,EAAE,IAAI;KACX,CAAoB;IAUvB,WAAW,EAAE,KAAK,EAChB,SAAiB,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"}
|
|
@@ -2,10 +2,18 @@ import memori from '../index';
|
|
|
2
2
|
const client = memori('https://backend.memori.ai');
|
|
3
3
|
describe('backend/importexport api', () => {
|
|
4
4
|
it('works on importexport apis', async () => {
|
|
5
|
-
expect(await client.backend.importExport.
|
|
5
|
+
expect(await client.backend.importExport.exportCSV('768b9654-e781-4c3c-81fa-ae1529d1bfbe', 'be2e4a44-890b-483b-a26a-f6e122f36e2b', {
|
|
6
|
+
newLine: '\n',
|
|
7
|
+
questionColumnName: 'Question',
|
|
8
|
+
answerColumnName: 'Answer',
|
|
9
|
+
})).not.toBeNull();
|
|
6
10
|
});
|
|
7
11
|
it('works on importexport apis with shorthand version', async () => {
|
|
8
|
-
expect(await client.backend.
|
|
12
|
+
expect(await client.backend.exportCSV('768b9654-e781-4c3c-81fa-ae1529d1bfbe', 'be2e4a44-890b-483b-a26a-f6e122f36e2b', {
|
|
13
|
+
newLine: '\n',
|
|
14
|
+
questionColumnName: 'Question',
|
|
15
|
+
answerColumnName: 'Answer',
|
|
16
|
+
})).not.toBeNull();
|
|
9
17
|
});
|
|
10
18
|
});
|
|
11
19
|
//# sourceMappingURL=importExport.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importExport.test.js","sourceRoot":"","sources":["../../src/backend/importExport.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"importExport.test.js","sourceRoot":"","sources":["../../src/backend/importExport.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CACzC,sCAAsC,EACtC,sCAAsC,EACtC;YACE,OAAO,EAAE,IAAI;YACb,kBAAkB,EAAE,UAAU;YAC9B,gBAAgB,EAAE,QAAQ;SAC3B,CACF,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAC5B,sCAAsC,EACtC,sCAAsC,EACtC;YACE,OAAO,EAAE,IAAI;YACb,kBAAkB,EAAE,UAAU;YAC9B,gBAAgB,EAAE,QAAQ;SAC3B,CACF,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ResponseSpec, ProcessStatus } from '../types';
|
|
2
|
+
declare const _default: (apiUrl: string) => {
|
|
3
|
+
getProcesses: <T = ProcessStatus>(authToken: string, processType?: ProcessStatus['processType']) => Promise<ResponseSpec & {
|
|
4
|
+
processes: T[];
|
|
5
|
+
}>;
|
|
6
|
+
getMemoriProcesses: <T_1 = ProcessStatus>(authToken: string, memoriID: string, processType?: ProcessStatus['processType']) => Promise<ResponseSpec & {
|
|
7
|
+
processes: T_1[];
|
|
8
|
+
}>;
|
|
9
|
+
getProcessStatus: <T_2 = ProcessStatus>(authToken: string, processID: string) => Promise<ResponseSpec & {
|
|
10
|
+
status: T_2;
|
|
11
|
+
}>;
|
|
12
|
+
stopProcess: <T_3 = ProcessStatus>(authToken: string, processID: string) => Promise<ResponseSpec & {
|
|
13
|
+
status: T_3;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { apiFetcher } from '../apiFetcher';
|
|
2
|
+
export default (apiUrl) => ({
|
|
3
|
+
getProcesses: async (authToken, processType) => apiFetcher(`/Processes/${authToken}${processType ? `/${processType}` : ''}`, {
|
|
4
|
+
apiUrl,
|
|
5
|
+
method: 'GET',
|
|
6
|
+
}),
|
|
7
|
+
getMemoriProcesses: async (authToken, memoriID, processType) => apiFetcher(`/MemoriProcesses/${authToken}/${memoriID}${processType ? `/${processType}` : ''}`, {
|
|
8
|
+
apiUrl,
|
|
9
|
+
method: 'GET',
|
|
10
|
+
}),
|
|
11
|
+
getProcessStatus: async (authToken, processID) => apiFetcher(`/ProcessStatus/${authToken}/${processID}`, {
|
|
12
|
+
apiUrl,
|
|
13
|
+
method: 'GET',
|
|
14
|
+
}),
|
|
15
|
+
stopProcess: async (authToken, processID) => apiFetcher(`/StopProcess/${authToken}/${processID}`, {
|
|
16
|
+
apiUrl,
|
|
17
|
+
method: 'POST',
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/backend/process.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,KAAK,EACjB,SAAiB,EACjB,WAA0C,EAC1C,EAAE,CACF,UAAU,CACR,cAAc,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAChE;QACE,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAKF;IAQH,kBAAkB,EAAE,KAAK,EACvB,SAAiB,EACjB,QAAgB,EAChB,WAA0C,EAC1C,EAAE,CACF,UAAU,CACR,oBAAoB,SAAS,IAAI,QAAQ,GACvC,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EACpC,EAAE,EACF;QACE,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAKF;IAOH,gBAAgB,EAAE,KAAK,EACrB,SAAiB,EACjB,SAAiB,EACjB,EAAE,CACF,UAAU,CAAC,kBAAkB,SAAS,IAAI,SAAS,EAAE,EAAE;QACrD,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAIA;IAOH,WAAW,EAAE,KAAK,EAChB,SAAiB,EACjB,SAAiB,EACjB,EAAE,CACF,UAAU,CAAC,gBAAgB,SAAS,IAAI,SAAS,EAAE,EAAE;QACnD,MAAM;QACN,MAAM,EAAE,MAAM;KACf,CAIA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import memori from '../index';
|
|
2
|
+
const client = memori('https://backend-staging.memori.ai');
|
|
3
|
+
describe('backend/process api', () => {
|
|
4
|
+
it('works on process apis', async () => {
|
|
5
|
+
expect(await client.backend.process.getProcessStatus('768b9654-e781-4c3c-81fa-ae1529d1bfbe', 'be2e4a44-890b-483b-a26a-f6e122f36e2b')).not.toBeNull();
|
|
6
|
+
});
|
|
7
|
+
it('works on process apis with shorthand version', async () => {
|
|
8
|
+
expect(await client.backend.getProcessStatus('768b9654-e781-4c3c-81fa-ae1529d1bfbe', 'be2e4a44-890b-483b-a26a-f6e122f36e2b')).not.toBeNull();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=process.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.test.js","sourceRoot":"","sources":["../../src/backend/process.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,mCAAmC,CAAC,CAAC;AAE3D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAC3C,sCAAsC,EACtC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,gBAAgB,CACnC,sCAAsC,EACtC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/esm/backend.d.ts
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
declare const backendAPI: (apiUrl: string) => {
|
|
2
|
-
|
|
3
|
-
status: import("./types").
|
|
2
|
+
analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
|
|
3
|
+
status: import("./types").AnalysisStatus;
|
|
4
4
|
}>;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
6
|
+
count: number;
|
|
7
|
+
matches: import("./types").UserQueryMatch[];
|
|
8
|
+
}>;
|
|
9
|
+
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
10
|
+
processes: T[];
|
|
11
|
+
}>;
|
|
12
|
+
getMemoriProcesses: <T_1 = import("./types").ProcessStatus>(authToken: string, memoriID: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
13
|
+
processes: T_1[];
|
|
7
14
|
}>;
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
getProcessStatus: <T_2 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
16
|
+
status: T_2;
|
|
10
17
|
}>;
|
|
11
|
-
|
|
12
|
-
status:
|
|
18
|
+
stopProcess: <T_3 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
19
|
+
status: T_3;
|
|
13
20
|
}>;
|
|
14
|
-
|
|
15
|
-
status: import("./types").
|
|
21
|
+
importCSV: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
22
|
+
status: import("./types").ImportStatus;
|
|
23
|
+
}>;
|
|
24
|
+
importTXT: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "csvSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
25
|
+
status: import("./types").ImportStatus;
|
|
16
26
|
}>;
|
|
17
27
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
18
28
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
@@ -366,22 +376,36 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
366
376
|
};
|
|
367
377
|
importExport: {
|
|
368
378
|
importCSV: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
369
|
-
status: import("./types").
|
|
379
|
+
status: import("./types").ImportStatus;
|
|
370
380
|
}>;
|
|
371
381
|
importTXT: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "csvSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
372
|
-
status: import("./types").
|
|
382
|
+
status: import("./types").ImportStatus;
|
|
383
|
+
}>;
|
|
384
|
+
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
385
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
386
|
+
};
|
|
387
|
+
process: {
|
|
388
|
+
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
389
|
+
processes: T[];
|
|
373
390
|
}>;
|
|
374
|
-
|
|
375
|
-
|
|
391
|
+
getMemoriProcesses: <T_1 = import("./types").ProcessStatus>(authToken: string, memoriID: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
392
|
+
processes: T_1[];
|
|
376
393
|
}>;
|
|
377
|
-
|
|
378
|
-
status:
|
|
394
|
+
getProcessStatus: <T_2 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
395
|
+
status: T_2;
|
|
379
396
|
}>;
|
|
380
|
-
|
|
381
|
-
status:
|
|
397
|
+
stopProcess: <T_3 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
398
|
+
status: T_3;
|
|
399
|
+
}>;
|
|
400
|
+
};
|
|
401
|
+
analysis: {
|
|
402
|
+
analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
|
|
403
|
+
status: import("./types").AnalysisStatus;
|
|
404
|
+
}>;
|
|
405
|
+
getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
406
|
+
count: number;
|
|
407
|
+
matches: import("./types").UserQueryMatch[];
|
|
382
408
|
}>;
|
|
383
|
-
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
384
|
-
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
385
409
|
};
|
|
386
410
|
};
|
|
387
411
|
export default backendAPI;
|
package/esm/backend.js
CHANGED
|
@@ -6,6 +6,8 @@ import invitation from './backend/invitation';
|
|
|
6
6
|
import consumptionLogs from './backend/consumptionLogs';
|
|
7
7
|
import notifications from './backend/notifications';
|
|
8
8
|
import importExport from './backend/importExport';
|
|
9
|
+
import process from './backend/process';
|
|
10
|
+
import analysis from './backend/analysis';
|
|
9
11
|
const backendAPI = (apiUrl) => ({
|
|
10
12
|
asset: asset(apiUrl),
|
|
11
13
|
memori: memori(apiUrl),
|
|
@@ -15,6 +17,8 @@ const backendAPI = (apiUrl) => ({
|
|
|
15
17
|
consumptionLogs: consumptionLogs(apiUrl),
|
|
16
18
|
notifications: notifications(apiUrl),
|
|
17
19
|
importExport: importExport(apiUrl),
|
|
20
|
+
process: process(apiUrl),
|
|
21
|
+
analysis: analysis(apiUrl),
|
|
18
22
|
...asset(apiUrl),
|
|
19
23
|
...memori(apiUrl),
|
|
20
24
|
...user(apiUrl),
|
|
@@ -23,6 +27,8 @@ const backendAPI = (apiUrl) => ({
|
|
|
23
27
|
...consumptionLogs(apiUrl),
|
|
24
28
|
...notifications(apiUrl),
|
|
25
29
|
...importExport(apiUrl),
|
|
30
|
+
...process(apiUrl),
|
|
31
|
+
...analysis(apiUrl),
|
|
26
32
|
});
|
|
27
33
|
export default backendAPI;
|
|
28
34
|
//# sourceMappingURL=backend.js.map
|
package/esm/backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,YAAY,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAE1C,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC;IACxC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC;IACpC,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC;IAC1B,GAAG,KAAK,CAAC,MAAM,CAAC;IAChB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjB,GAAG,IAAI,CAAC,MAAM,CAAC;IACf,GAAG,WAAW,CAAC,MAAM,CAAC;IACtB,GAAG,UAAU,CAAC,MAAM,CAAC;IACrB,GAAG,eAAe,CAAC,MAAM,CAAC;IAC1B,GAAG,aAAa,CAAC,MAAM,CAAC;IACxB,GAAG,YAAY,CAAC,MAAM,CAAC;IACvB,GAAG,OAAO,CAAC,MAAM,CAAC;IAClB,GAAG,QAAQ,CAAC,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
package/esm/index.d.ts
CHANGED
|
@@ -606,20 +606,30 @@ declare const api: (hostname?: string) => {
|
|
|
606
606
|
deleteCorrelationPair: (sessionId: string, pairId: string) => Promise<import("./types").ResponseSpec>;
|
|
607
607
|
};
|
|
608
608
|
backend: {
|
|
609
|
-
|
|
610
|
-
status: import("./types").
|
|
609
|
+
analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
|
|
610
|
+
status: import("./types").AnalysisStatus;
|
|
611
611
|
}>;
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
613
|
+
count: number;
|
|
614
|
+
matches: import("./types").UserQueryMatch[];
|
|
614
615
|
}>;
|
|
615
|
-
|
|
616
|
-
|
|
616
|
+
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
617
|
+
processes: T[];
|
|
617
618
|
}>;
|
|
618
|
-
|
|
619
|
-
|
|
619
|
+
getMemoriProcesses: <T_1 = import("./types").ProcessStatus>(authToken: string, memoriID: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
620
|
+
processes: T_1[];
|
|
620
621
|
}>;
|
|
621
|
-
|
|
622
|
-
status:
|
|
622
|
+
getProcessStatus: <T_2 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
623
|
+
status: T_2;
|
|
624
|
+
}>;
|
|
625
|
+
stopProcess: <T_3 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
626
|
+
status: T_3;
|
|
627
|
+
}>;
|
|
628
|
+
importCSV: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
629
|
+
status: import("./types").ImportStatus;
|
|
630
|
+
}>;
|
|
631
|
+
importTXT: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "csvSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
632
|
+
status: import("./types").ImportStatus;
|
|
623
633
|
}>;
|
|
624
634
|
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
625
635
|
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
@@ -973,22 +983,36 @@ declare const api: (hostname?: string) => {
|
|
|
973
983
|
};
|
|
974
984
|
importExport: {
|
|
975
985
|
importCSV: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "txtSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
976
|
-
status: import("./types").
|
|
986
|
+
status: import("./types").ImportStatus;
|
|
977
987
|
}>;
|
|
978
988
|
importTXT: (authToken: string, memoriID: string, rows: string[], params: Omit<import("./types").ImportParams, "csvSpecs">) => Promise<import("./types").ResponseSpec & {
|
|
979
|
-
status: import("./types").
|
|
989
|
+
status: import("./types").ImportStatus;
|
|
980
990
|
}>;
|
|
981
|
-
|
|
982
|
-
|
|
991
|
+
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
992
|
+
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
993
|
+
};
|
|
994
|
+
process: {
|
|
995
|
+
getProcesses: <T = import("./types").ProcessStatus>(authToken: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
996
|
+
processes: T[];
|
|
983
997
|
}>;
|
|
984
|
-
|
|
985
|
-
|
|
998
|
+
getMemoriProcesses: <T_1 = import("./types").ProcessStatus>(authToken: string, memoriID: string, processType?: "Import" | "Analysis" | undefined) => Promise<import("./types").ResponseSpec & {
|
|
999
|
+
processes: T_1[];
|
|
986
1000
|
}>;
|
|
987
|
-
|
|
988
|
-
status:
|
|
1001
|
+
getProcessStatus: <T_2 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
1002
|
+
status: T_2;
|
|
1003
|
+
}>;
|
|
1004
|
+
stopProcess: <T_3 = import("./types").ProcessStatus>(authToken: string, processID: string) => Promise<import("./types").ResponseSpec & {
|
|
1005
|
+
status: T_3;
|
|
1006
|
+
}>;
|
|
1007
|
+
};
|
|
1008
|
+
analysis: {
|
|
1009
|
+
analyzeUserQuery: (authToken: string, memoriID: string, params: import("./types").AnalysisParams) => Promise<import("./types").ResponseSpec & {
|
|
1010
|
+
status: import("./types").AnalysisStatus;
|
|
1011
|
+
}>;
|
|
1012
|
+
getUserQueryMatches: (authToken: string, analysisID: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
1013
|
+
count: number;
|
|
1014
|
+
matches: import("./types").UserQueryMatch[];
|
|
989
1015
|
}>;
|
|
990
|
-
exportCSV: (authToken: string, memoriID: string, csvSpecs: import("./types").CsvSpecs, password?: string | undefined) => Promise<string>;
|
|
991
|
-
exportJSONL: (authToken: string, memoriID: string, jsonlSpecs: import("./types").JSONLSpecs, password?: string | undefined) => Promise<string>;
|
|
992
1016
|
};
|
|
993
1017
|
};
|
|
994
1018
|
};
|
package/esm/types.d.ts
CHANGED
|
@@ -108,13 +108,12 @@ export declare type User = {
|
|
|
108
108
|
newsletterSubscribed?: boolean;
|
|
109
109
|
maxMemori?: number;
|
|
110
110
|
numMemori?: number;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
canEditIntegrations?: boolean;
|
|
115
|
-
canEditDynamicIntents?: boolean;
|
|
116
|
-
canEditMemoriChaining?: boolean;
|
|
111
|
+
enableMemoriCreation?: boolean;
|
|
112
|
+
enableBoardOfExperts?: boolean;
|
|
113
|
+
enableDCMIntegration?: boolean;
|
|
117
114
|
enableBadges?: boolean;
|
|
115
|
+
enableVirtualSpaces?: boolean;
|
|
116
|
+
enableDeepThought?: boolean;
|
|
118
117
|
monthSessions?: number;
|
|
119
118
|
monthValidSessions?: number;
|
|
120
119
|
maxFreeSessions?: number;
|
|
@@ -203,6 +202,7 @@ export type TenantBase = {
|
|
|
203
202
|
name?: string;
|
|
204
203
|
description?: string;
|
|
205
204
|
logoURL?: string;
|
|
205
|
+
adminEmail?: string;
|
|
206
206
|
aliases?: string[];
|
|
207
207
|
adminCount?: number;
|
|
208
208
|
userCount?: number;
|
|
@@ -665,22 +665,56 @@ export interface ImportWarning {
|
|
|
665
665
|
similarityLevel: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
666
666
|
}[];
|
|
667
667
|
}
|
|
668
|
-
export interface
|
|
669
|
-
|
|
668
|
+
export interface AnalysisParams {
|
|
669
|
+
query: string;
|
|
670
|
+
}
|
|
671
|
+
export interface AnalysisWarning {
|
|
672
|
+
warningType: 'Error' | string;
|
|
673
|
+
text?: string;
|
|
674
|
+
}
|
|
675
|
+
export interface AnalysisWarning {
|
|
676
|
+
warningType: 'Error' | string;
|
|
677
|
+
text?: string;
|
|
678
|
+
}
|
|
679
|
+
export interface ProcessStatus {
|
|
680
|
+
processID: string;
|
|
681
|
+
memoriID: string;
|
|
682
|
+
processUserName: string;
|
|
683
|
+
processType: 'Import' | 'Analysis';
|
|
670
684
|
status: 'Pending' | 'Starting' | 'Running' | 'Stopped' | 'Completed' | 'Failed';
|
|
671
685
|
error?: string;
|
|
672
686
|
progress: number;
|
|
673
|
-
|
|
674
|
-
importSize: number;
|
|
675
|
-
importName?: string;
|
|
676
|
-
importSpecsJSON?: string;
|
|
687
|
+
processSpecsJSON?: string;
|
|
677
688
|
begin?: string;
|
|
678
689
|
end?: string;
|
|
679
690
|
eta?: number;
|
|
691
|
+
creationTimestamp?: string;
|
|
692
|
+
lastChangeTimestamp?: string;
|
|
693
|
+
}
|
|
694
|
+
export interface ImportStatus extends ProcessStatus {
|
|
695
|
+
importType: 'CSV' | 'TXT';
|
|
696
|
+
importSize: number;
|
|
697
|
+
importName?: string;
|
|
680
698
|
importedMemories?: number;
|
|
681
699
|
importWarningsCount?: number;
|
|
682
700
|
importWarnings?: ImportWarning[];
|
|
683
701
|
}
|
|
702
|
+
export interface AnalysisStatus extends ProcessStatus {
|
|
703
|
+
analysisType: 'UserQuery';
|
|
704
|
+
query?: string;
|
|
705
|
+
analysisWarningsCount?: number;
|
|
706
|
+
analysisWarnings?: AnalysisWarning[];
|
|
707
|
+
}
|
|
708
|
+
export interface UserQueryMatch {
|
|
709
|
+
userQueryMatchID: string;
|
|
710
|
+
analysisID: string;
|
|
711
|
+
memoriID: string;
|
|
712
|
+
engineUserID: string;
|
|
713
|
+
userName: string;
|
|
714
|
+
userTenantName: string;
|
|
715
|
+
userEmail: string;
|
|
716
|
+
match: number;
|
|
717
|
+
}
|
|
684
718
|
export interface Badge {
|
|
685
719
|
badgeID?: string;
|
|
686
720
|
date?: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import memori from '../index';
|
|
2
|
+
|
|
3
|
+
const client = memori('https://backend-staging.memori.ai');
|
|
4
|
+
|
|
5
|
+
describe('backend/analysis api', () => {
|
|
6
|
+
it('works on analysis apis', async () => {
|
|
7
|
+
expect(
|
|
8
|
+
await client.backend.analysis.analyzeUserQuery(
|
|
9
|
+
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
|
|
10
|
+
'be2e4a44-890b-483b-a26a-f6e122f36e2b',
|
|
11
|
+
{ query: 'test' }
|
|
12
|
+
)
|
|
13
|
+
).not.toBeNull();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('works on analysis apis with shorthand version', async () => {
|
|
17
|
+
expect(
|
|
18
|
+
await client.backend.analyzeUserQuery(
|
|
19
|
+
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
|
|
20
|
+
'be2e4a44-890b-483b-a26a-f6e122f36e2b',
|
|
21
|
+
{ query: 'test' }
|
|
22
|
+
)
|
|
23
|
+
).not.toBeNull();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ResponseSpec,
|
|
3
|
+
AnalysisParams,
|
|
4
|
+
AnalysisStatus,
|
|
5
|
+
UserQueryMatch,
|
|
6
|
+
} from '../types';
|
|
7
|
+
import { apiFetcher } from '../apiFetcher';
|
|
8
|
+
|
|
9
|
+
export default (apiUrl: string) => ({
|
|
10
|
+
/**
|
|
11
|
+
* Starts an Analysis process for User/query match on Deep Thought known facts.
|
|
12
|
+
* @param {string} authToken - The login token.
|
|
13
|
+
* @param {string} memoriID - The ID of the Memori object.
|
|
14
|
+
* @param {AnalysisParams} params The specifications of the analysis
|
|
15
|
+
*/
|
|
16
|
+
analyzeUserQuery: async (
|
|
17
|
+
authToken: string,
|
|
18
|
+
memoriID: string,
|
|
19
|
+
params: AnalysisParams
|
|
20
|
+
) =>
|
|
21
|
+
apiFetcher(`/Analysis/AnalyzeUserQuery/${authToken}/${memoriID}`, {
|
|
22
|
+
apiUrl,
|
|
23
|
+
method: 'POST',
|
|
24
|
+
body: {
|
|
25
|
+
...params,
|
|
26
|
+
},
|
|
27
|
+
}) as Promise<
|
|
28
|
+
ResponseSpec & {
|
|
29
|
+
status: AnalysisStatus;
|
|
30
|
+
}
|
|
31
|
+
>,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Lists Deep Thought User/query Match objects of the specified Analysis object, with pagination.
|
|
35
|
+
* @param {string} authToken - The login token.
|
|
36
|
+
* @param {string} analysisID - The Analysis process ID
|
|
37
|
+
* @param {number} from The 0-based index of the first Expert Reference object to list
|
|
38
|
+
* @param {number} howMany The number of the Expert Reference objects to list
|
|
39
|
+
*/
|
|
40
|
+
getUserQueryMatches: async (
|
|
41
|
+
authToken: string,
|
|
42
|
+
analysisID: string,
|
|
43
|
+
from: number,
|
|
44
|
+
howMany: number
|
|
45
|
+
) =>
|
|
46
|
+
apiFetcher(
|
|
47
|
+
`/Analysis/AnalyzeUserQuery/${authToken}/${analysisID}/${from}/${howMany}`,
|
|
48
|
+
{
|
|
49
|
+
apiUrl,
|
|
50
|
+
method: 'GET',
|
|
51
|
+
}
|
|
52
|
+
) as Promise<
|
|
53
|
+
ResponseSpec & {
|
|
54
|
+
/**
|
|
55
|
+
* Total number of Deep Thought User/query Match objects.
|
|
56
|
+
*/
|
|
57
|
+
count: number;
|
|
58
|
+
/**
|
|
59
|
+
* The list of Deep Thought User/query Match objects.
|
|
60
|
+
*/
|
|
61
|
+
matches: UserQueryMatch[];
|
|
62
|
+
}
|
|
63
|
+
>,
|
|
64
|
+
});
|
|
@@ -5,18 +5,28 @@ const client = memori('https://backend.memori.ai');
|
|
|
5
5
|
describe('backend/importexport api', () => {
|
|
6
6
|
it('works on importexport apis', async () => {
|
|
7
7
|
expect(
|
|
8
|
-
await client.backend.importExport.
|
|
8
|
+
await client.backend.importExport.exportCSV(
|
|
9
9
|
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
|
|
10
|
-
'be2e4a44-890b-483b-a26a-f6e122f36e2b'
|
|
10
|
+
'be2e4a44-890b-483b-a26a-f6e122f36e2b',
|
|
11
|
+
{
|
|
12
|
+
newLine: '\n',
|
|
13
|
+
questionColumnName: 'Question',
|
|
14
|
+
answerColumnName: 'Answer',
|
|
15
|
+
}
|
|
11
16
|
)
|
|
12
17
|
).not.toBeNull();
|
|
13
18
|
});
|
|
14
19
|
|
|
15
20
|
it('works on importexport apis with shorthand version', async () => {
|
|
16
21
|
expect(
|
|
17
|
-
await client.backend.
|
|
22
|
+
await client.backend.exportCSV(
|
|
18
23
|
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
|
|
19
|
-
'be2e4a44-890b-483b-a26a-f6e122f36e2b'
|
|
24
|
+
'be2e4a44-890b-483b-a26a-f6e122f36e2b',
|
|
25
|
+
{
|
|
26
|
+
newLine: '\n',
|
|
27
|
+
questionColumnName: 'Question',
|
|
28
|
+
answerColumnName: 'Answer',
|
|
29
|
+
}
|
|
20
30
|
)
|
|
21
31
|
).not.toBeNull();
|
|
22
32
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ResponseSpec,
|
|
3
3
|
ImportParams,
|
|
4
|
-
|
|
4
|
+
ImportStatus,
|
|
5
5
|
CsvSpecs,
|
|
6
6
|
JSONLSpecs,
|
|
7
7
|
} from '../types';
|
|
@@ -36,7 +36,7 @@ export default (apiUrl: string) => ({
|
|
|
36
36
|
},
|
|
37
37
|
}) as Promise<
|
|
38
38
|
ResponseSpec & {
|
|
39
|
-
status:
|
|
39
|
+
status: ImportStatus;
|
|
40
40
|
}
|
|
41
41
|
>,
|
|
42
42
|
|
|
@@ -62,51 +62,7 @@ export default (apiUrl: string) => ({
|
|
|
62
62
|
},
|
|
63
63
|
}) as Promise<
|
|
64
64
|
ResponseSpec & {
|
|
65
|
-
status:
|
|
66
|
-
}
|
|
67
|
-
>,
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Gets a list of Import processes started by the currently logged in User.
|
|
71
|
-
* @param {string} authToken - The login token.
|
|
72
|
-
*/
|
|
73
|
-
importProcesses: async (authToken: string) =>
|
|
74
|
-
apiFetcher(`/ImportExport/ImportProcesses/${authToken}`, {
|
|
75
|
-
apiUrl,
|
|
76
|
-
method: 'GET',
|
|
77
|
-
}) as Promise<
|
|
78
|
-
ResponseSpec & {
|
|
79
|
-
importProcesses: ImportResponse[];
|
|
80
|
-
}
|
|
81
|
-
>,
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Gets the status of an Import process.
|
|
85
|
-
* @param {string} authToken - The login token.
|
|
86
|
-
* @param {string} importID The import process ID
|
|
87
|
-
*/
|
|
88
|
-
importStatus: async (authToken: string, importID: string) =>
|
|
89
|
-
apiFetcher(`/ImportExport/ImportStatus/${authToken}/${importID}`, {
|
|
90
|
-
apiUrl,
|
|
91
|
-
method: 'GET',
|
|
92
|
-
}) as Promise<
|
|
93
|
-
ResponseSpec & {
|
|
94
|
-
status: ImportResponse;
|
|
95
|
-
}
|
|
96
|
-
>,
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Interrupts an ongoing Import process.
|
|
100
|
-
* @param {string} authToken - The login token.
|
|
101
|
-
* @param {string} importID The import process ID
|
|
102
|
-
*/
|
|
103
|
-
stopImport: async (authToken: string, importID: string) =>
|
|
104
|
-
apiFetcher(`/ImportExport/StopImport/${authToken}/${importID}`, {
|
|
105
|
-
apiUrl,
|
|
106
|
-
method: 'POST',
|
|
107
|
-
}) as Promise<
|
|
108
|
-
ResponseSpec & {
|
|
109
|
-
status: ImportResponse;
|
|
65
|
+
status: ImportStatus;
|
|
110
66
|
}
|
|
111
67
|
>,
|
|
112
68
|
|