Line data Source code
1 : import type { SearchQuery } from 'algoliasearch/dist/lite/browser'
2 :
3 : import type {
4 : SearchAttribute,
5 : SearchNodePacksParams
6 : } from '@/types/algoliaTypes'
7 :
8 2355 : const RETRIEVE_ATTRIBUTES: SearchAttribute[] = [
9 : 'comfy_nodes',
10 : 'name',
11 : 'description',
12 : 'latest_version',
13 : 'status',
14 : 'publisher_id',
15 : 'total_install',
16 : 'create_time',
17 : 'update_time',
18 : 'license',
19 : 'repository_url',
20 : 'latest_version_status',
21 : 'comfy_node_extract_status',
22 : 'id',
23 : 'icon_url',
24 : 'github_stars',
25 : 'supported_os',
26 : 'supported_comfyui_version',
27 : 'supported_comfyui_frontend_version',
28 : 'supported_accelerators',
29 : 'banner_url'
30 : ]
31 :
32 : /** The nodes_index request for one pack search query. */
33 0 : export function buildPackSearchRequest(
34 : query: string,
35 : params: SearchNodePacksParams
36 : ): SearchQuery {
37 0 : const { pageSize, pageNumber, ...rest } = params
38 0 : return {
39 : query,
40 : indexName: 'nodes_index',
41 : attributesToRetrieve: RETRIEVE_ATTRIBUTES,
42 : ...rest,
43 : hitsPerPage: pageSize,
44 : page: pageNumber
45 : }
46 : }
|