UNPKG

n8n

Version:

n8n Workflow Automation Tool

30 lines (29 loc) 1.46 kB
import { LicenseState } from '@n8n/backend-common'; import type { User } from '@n8n/db'; import { ProjectRelationRepository, SharedWorkflowRepository } from '@n8n/db'; import { type ProjectRole, type WorkflowSharingRole, type Scope } from '@n8n/permissions'; import { RoleService } from '../services/role.service'; export type ShareWorkflowOptions = { scopes: Scope[]; projectId?: string; } | { projectRoles: ProjectRole[]; workflowRoles: WorkflowSharingRole[]; projectId?: string; }; export declare class WorkflowSharingService { private readonly sharedWorkflowRepository; private readonly roleService; private readonly projectRelationRepository; private readonly licenseState; constructor(sharedWorkflowRepository: SharedWorkflowRepository, roleService: RoleService, projectRelationRepository: ProjectRelationRepository, licenseState: LicenseState); getSharedWorkflowIds(user: User, options: ShareWorkflowOptions): Promise<string[]>; getSharedWorkflowIdsForScopes(user: User, scopes: Scope[], projectId?: string): Promise<string[]>; getSharedWithMeIds(user: User): Promise<string[]>; getSharedWorkflowScopes(workflowIds: string[], user: User): Promise<Array<[string, Scope[]]>>; getOwnedWorkflowsInPersonalProject(userId: string): Promise<string[]>; rolesGrantingScope(user: User, scope: Scope): Promise<{ projectRoles: string[]; workflowRoles: string[]; } | undefined>; }