import { OrgRole } from "@inkeep/agents-core";

//#region src/domains/manage/routes/triggerHelpers.d.ts
declare function validateRunAsUserIds(params: {
  runAsUserIds: string[];
  callerId: string;
  tenantId: string;
  projectId: string;
  tenantRole: OrgRole;
}): Promise<void>;
declare function validateRunAsUserId(params: {
  runAsUserId: string;
  callerId: string;
  tenantId: string;
  projectId: string;
  tenantRole: OrgRole;
}): Promise<void>;
/**
 * Check if a non-admin user is allowed to mutate a trigger.
 * Admins can mutate any trigger. Non-admins can only mutate triggers they created,
 * that run as them, or that are solely associated to them via runAsUserIds.
 */
declare function assertCanMutateTrigger(params: {
  trigger: {
    createdBy?: string | null;
    runAsUserId?: string | null;
    runAsUserIds?: (string | null)[] | null;
  };
  callerId: string;
  tenantRole: OrgRole;
}): void;
declare function validateTriggerPermissions(params: {
  triggerData: {
    runAsUserId?: string | null;
    runAsUserIds?: string[];
    createdBy?: string | null;
    [key: string]: unknown;
  };
  existing: {
    id: string;
    runAsUserId?: string | null;
    createdBy?: string | null;
  } | undefined;
  callerId: string;
  tenantId: string;
  projectId: string;
  tenantRole: OrgRole;
}): Promise<void>;
//#endregion
export { assertCanMutateTrigger, validateRunAsUserId, validateRunAsUserIds, validateTriggerPermissions };