mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(editor): Add new /templates/search endpoint (#8227)
Updating n8n front-end to use the new search endpoint powered by TypeSense. Endpoint is deployed on staging API so, in order to test it, use this env var: ```export N8N_TEMPLATES_HOST=https://api-staging.n8n.io/api``` **NOTE**: This PR should not be merged until [backend changes](https://github.com/n8n-io/creators-site/pull/118) are merged and released. ## Related tickets and issues https://linear.app/n8n/issue/ADO-1555/update-in-app-search-to-work-with-the-new-back-end ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [ ] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
This commit is contained in:
@@ -830,6 +830,19 @@ export interface ITemplatesWorkflowInfo {
|
||||
};
|
||||
}
|
||||
|
||||
export type TemplateSearchFacet = {
|
||||
field_name: string;
|
||||
sampled: boolean;
|
||||
stats: {
|
||||
total_values: number;
|
||||
};
|
||||
counts: Array<{
|
||||
count: number;
|
||||
highlighted: string;
|
||||
value: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
export interface ITemplatesWorkflowResponse extends ITemplatesWorkflow, IWorkflowTemplate {
|
||||
description: string | null;
|
||||
image: ITemplatesImage[];
|
||||
@@ -845,7 +858,7 @@ export interface ITemplatesWorkflowFull extends ITemplatesWorkflowResponse {
|
||||
}
|
||||
|
||||
export interface ITemplatesQuery {
|
||||
categories: number[];
|
||||
categories: string[];
|
||||
search: string;
|
||||
}
|
||||
|
||||
@@ -1357,7 +1370,7 @@ export interface INodeTypesState {
|
||||
}
|
||||
|
||||
export interface ITemplateState {
|
||||
categories: { [id: string]: ITemplatesCategory };
|
||||
categories: ITemplatesCategory[];
|
||||
collections: { [id: string]: ITemplatesCollection };
|
||||
workflows: { [id: string]: ITemplatesWorkflow | ITemplatesWorkflowFull };
|
||||
workflowSearches: {
|
||||
@@ -1365,6 +1378,7 @@ export interface ITemplateState {
|
||||
workflowIds: string[];
|
||||
totalWorkflows: number;
|
||||
loadingMore?: boolean;
|
||||
categories?: ITemplatesCategory[];
|
||||
};
|
||||
};
|
||||
collectionSearches: {
|
||||
|
||||
Reference in New Issue
Block a user