Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

657 B
Raw Blame
import { skipToken } from '@tanstack/react-query'
import { consoleQuery } from '@/service/console'

export function pluginAssetQueryOptions(
  fileName: string | undefined,
  pluginUniqueIdentifier: string | undefined,
) {
  const isAssetFile = /^(?:\.\/|\/)?_assets\//.test(fileName ?? '')

  return consoleQuery.workspaces.current.plugin.asset.get.queryOptions({
    input:
      pluginUniqueIdentifier && fileName && isAssetFile
        ? {
            query: {
              plugin_unique_identifier: pluginUniqueIdentifier,
              file_name: fileName.replace(/^(?:\.\/|\/)?_assets\//, ''),
            },
          }
        : skipToken,
  })
}