import { WorkspaceEvents, WorkspaceEventsPayloads } from '@/modules/workspacesCore/domain/events' import { Workspace, WorkspaceAcl } from '@/modules/workspaces/domain/types' /** Workspace */ type UpsertWorkspaceArgs = { workspace: Workspace } export type UpsertWorkspace = (args: UpsertWorkspaceArgs) => Promise type GetWorkspaceArgs = { workspaceId: string } export type GetWorkspace = (args: GetWorkspaceArgs) => Promise /** WorkspaceRole */ type DeleteWorkspaceRoleArgs = { workspaceId: string userId: string } export type DeleteWorkspaceRole = ( args: DeleteWorkspaceRoleArgs ) => Promise type GetWorkspaceRolesArgs = { workspaceId: string } /** Get all roles in a given workspaces. */ export type GetWorkspaceRoles = (args: GetWorkspaceRolesArgs) => Promise type GetWorkspaceRoleForUserArgs = { userId: string workspaceId: string } /** Get role for given user in a specific workspace. */ export type GetWorkspaceRoleForUser = ( args: GetWorkspaceRoleForUserArgs ) => Promise type GetWorkspaceRolesForUserArgs = { userId: string } type GetWorkspaceRolesForUserOptions = { /** If provided, limit results to roles in given workspaces. */ workspaceIdFilter?: string[] } /** Get roles for given user across several (or all) workspaces. */ export type GetWorkspaceRolesForUser = ( args: GetWorkspaceRolesForUserArgs, options?: GetWorkspaceRolesForUserOptions ) => Promise export type UpsertWorkspaceRole = (args: WorkspaceAcl) => Promise /** Blob */ export type StoreBlob = (args: string) => Promise /** Events */ export type EmitWorkspaceEvent = (args: { event: TEvent payload: WorkspaceEventsPayloads[TEvent] }) => Promise