@fencyai/react 0.1.58 → 0.1.59
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createFile as createFileApi, } from '@fencyai/js';
|
|
1
|
+
import { createFile as createFileApi, searchFiles as searchFilesApi, } from '@fencyai/js';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useFencyContext } from '../../provider/useFencyContext';
|
|
4
4
|
import { useStream } from '../useStream';
|
|
@@ -55,8 +55,21 @@ export function useFiles(props) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
const searchFiles = async (params) => {
|
|
59
|
+
const clientSecret = await params.fetchClientSecret();
|
|
60
|
+
const response = await searchFilesApi({
|
|
61
|
+
pk: context.fency.publishableKey,
|
|
62
|
+
request: {
|
|
63
|
+
text: params.text,
|
|
64
|
+
clientSecret: clientSecret.clientSecret,
|
|
65
|
+
},
|
|
66
|
+
baseUrl: context.fency.baseUrl,
|
|
67
|
+
});
|
|
68
|
+
return response;
|
|
69
|
+
};
|
|
58
70
|
return {
|
|
59
71
|
createFile,
|
|
72
|
+
searchFiles,
|
|
60
73
|
files,
|
|
61
74
|
};
|
|
62
75
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types/UseFiles.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { CreateFileResponse, FencyFile } from '@fencyai/js';
|
|
1
|
+
import { CreateFileResponse, FencyFile, SearchFilesResponse } from '@fencyai/js';
|
|
2
2
|
import { CreateFileParams } from './CreateFileParams';
|
|
3
|
+
import { SearchFilesParams } from './SearchFilesParams';
|
|
3
4
|
export interface UseFiles {
|
|
4
5
|
createFile: (params: CreateFileParams) => Promise<CreateFileResponse>;
|
|
5
6
|
files: FencyFile[];
|
|
7
|
+
searchFiles: (params: SearchFilesParams) => Promise<SearchFilesResponse>;
|
|
6
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"import": "./lib/index.js",
|
|
14
|
-
"types": "./lib/index.d.ts"
|
|
14
|
+
"types": "./lib/index.d.ts",
|
|
15
|
+
"default": "./lib/index.js"
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
"directories": {
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"prepublishOnly": "npm run build"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@fencyai/js": "^0.1.
|
|
37
|
+
"@fencyai/js": "^0.1.59",
|
|
37
38
|
"@types/jest": "^29.5.11",
|
|
38
39
|
"@types/node": "^20.10.5",
|
|
39
40
|
"@types/react": "^18.2.45",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"typescript": "^5.3.3"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"@fencyai/js": "^0.1.
|
|
46
|
+
"@fencyai/js": "^0.1.59",
|
|
46
47
|
"react": ">=16.8.0",
|
|
47
48
|
"zod": "^4.0.5"
|
|
48
49
|
},
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"optional": false
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "27c0349b1a8de22d1175179a566598dba5daec6c"
|
|
55
56
|
}
|