keyshade icon indicating copy to clipboard operation
keyshade copied to clipboard

API: Implement global search feature in workspace

Open rajdip-b opened this issue 7 months ago • 15 comments

Description

Given a certain workspace, we would like to search the following items by partial name or note/description:

  • projects
  • environments
  • secrets
  • variables

Also note, we would only like to display the items that the user has access to.

Solution

  • Create an endpoint in workspace.controller.ts with the path /:workspaceId/global-search/:searchTerm
  • The searchTerm would be a non-null string field
  • Fetch projects, environments, secrets, variables whose name resemble with the search term.
  • Return the response in the following format:
    {
      projects: {
        id: string,
        name: string,
        description: string
      } [],
      environments: {
        id: string,
        name: string,
        description: string
      } [],
      variables: {
        id: string,
        name: string,
        note: string
      } [],
      secrets: {
        id: string,
        name: string,
        note: string
      } []
    }
    

rajdip-b avatar Jul 03 '24 13:07 rajdip-b