Signed-off-by: yyh <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: CodingOnStar <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Coding On Star <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: -LAN- <[email protected]> Co-authored-by: statxc <[email protected]>
15 lines
539 B
TypeScript
15 lines
539 B
TypeScript
import type { ToolWithProvider } from '../../types'
|
|
import type { ToolNodeType } from './types'
|
|
import { CollectionType } from '@/app/components/tools/types'
|
|
|
|
type ToolAuthorizationCollection = Pick<ToolWithProvider, 'allow_delete' | 'is_team_authorization'>
|
|
|
|
export const isToolAuthorizationRequired = (
|
|
providerType: ToolNodeType['provider_type'],
|
|
collection?: ToolAuthorizationCollection,
|
|
) => {
|
|
return providerType === CollectionType.builtIn
|
|
&& !!collection?.allow_delete
|
|
&& collection?.is_team_authorization === false
|
|
}
|