import { ApiTriggerType } from '../../index.js';
import { GroupBrief } from '../group/index.js';
import { ApplicationUserStatus } from '../user/index.js';
export declare enum OrganizationRbacAction {
    MANAGE = "manage"
}
export declare enum RbacAction {
    READ = "read",
    CREATE = "create",
    UPDATE = "update",
    DELETE = "delete",
    DEPLOY = "deploy",
    SHARE = "share",
    BUILD = "build",
    EXECUTE = "execute",
    RESET = "reset"
}
export declare enum GroupRbacAction {
    READ = "read",
    DELETE = "delete",
    UPDATE = "update"
}
export declare enum RbacRole {
    VIEWER = "viewer",
    BUILDER = "builder",
    CONFIGURATOR = "configurator",
    OWNER = "owner",
    NONE = "none",
    EXECUTOR = "executor"
}
export declare enum PermissionedEntities {
    APPLICATION = "application",
    APPLICATION_V2 = "application_v2",
    API_V3 = "api_v3",
    API = "api",
    ORGANIZATION = "organization",
    /**
     * @deprecated The Datasource entity is being deprecated in favor of the Integration entity.
     */
    DATASOURCE = "datasource",
    INTEGRATION = "integration",
    SECRET_STORE = "secret_store"
}
export declare enum PermissionEntityType {
    APPLICATION = "application",
    APPLICATION_V2 = "application_v2",
    WORKFLOW = "workflow",
    SCHEDULED_JOB = "scheduled_job",
    /**
     * @deprecated The Datasource entity is being deprecated in favor of the Integration entity.
     */
    DATASOURCE = "datasource",
    INTEGRATION = "integration"
}
type BaseShareEntryDto = {
    id: string;
    role: RbacRole;
    name: string;
    actorId: string;
};
export type UserShareEntryDto = BaseShareEntryDto & {
    type: 'user';
    email: string;
    status: ApplicationUserStatus;
};
export type GroupShareEntryDto = BaseShareEntryDto & {
    type: 'group';
    size?: number;
};
export type ShareEntryDto = UserShareEntryDto | GroupShareEntryDto;
export declare const isUserShareEntry: (shareEntry: ShareEntryDto) => shareEntry is UserShareEntryDto;
export declare const isGroupShareEntry: (shareEntry: ShareEntryDto) => shareEntry is GroupShareEntryDto;
export type ShareEntryCreationDto = {
    lookupId: string;
    type: 'user' | 'group';
    role: RbacRole;
};
type BasePermissionEntity = {
    id: string;
    type: PermissionEntityType;
    name: string;
};
export type ApplicationEntity = BasePermissionEntity;
export type WorkflowEntity = BasePermissionEntity;
type JobEntity = BasePermissionEntity;
/**
 * @deprecated The Datasource entity is being deprecated in favor of the Integration entity.
 */
type DatasourceEntity = BasePermissionEntity;
export type IntegrationEntity = BasePermissionEntity;
export type PermissionEntity = ApplicationEntity | WorkflowEntity | JobEntity | DatasourceEntity | IntegrationEntity;
export type EntityPermissionsDto = {
    entity: PermissionEntity;
    permissions: ShareEntryDto[];
};
export declare enum AssignmentTypeEnum {
    ROLE = "role",
    PERMISSION = "permission"
}
export declare enum PrincipalTypeEnum {
    GROUP = "group",
    USER = "user"
}
export declare enum ResourceTypeEnum {
    ACCESS_TOKENS = "access_tokens",
    AGENTS = "agents",
    APPLICATIONS = "apps",
    APPLICATIONS_APIS = "apps.apis",
    APPLICATIONS_PAGES = "apps.pages",
    BILLING = "billing",
    FOLDERS = "folders",
    GROUPS = "groups",
    GROUPS_MEMBERS = "groups.members",
    INTEGRATIONS = "integrations",
    LOGS = "logs",
    LOGS_STREAMS = "logs.streams",
    ORGANIZATION = "org",
    ORGANIZATION_USERS = "org.users",
    ORG_KNOWLEDGE = "org_knowledge",
    PROFILES = "profiles",
    REPOSITORIES = "repos",
    ROLES = "roles",
    SCHEDULED_JOBS = "jobs",
    SECRETS_STORES = "secrets_stores",
    WORKFLOWS = "workflows"
}
export declare enum RoleTypeEnum {
    APPLICATIONS = "apps",
    INTEGRATIONS = "integrations",
    ORGANIZATION = "org",// This represents a role that can contain permissions across resource type boundaries, to be used for organization-wide roles.
    SCHEDULED_JOBS = "jobs",
    WORKFLOWS = "workflows"
}
export declare enum ActionTypeEnum {
    BUILD = "build",
    CREATE = "create",
    DELETE = "delete",
    DEPLOY = "deploy",
    MANAGE = "manage",
    MANAGE_SCHEDULE = "manage_schedule",
    MANAGE_VISIBILITY = "manage_visibility",
    PREVIEW = "preview",
    READ = "read",
    RUN = "run",
    SHARE = "share",
    UPDATE = "update",
    VIEW = "view"
}
export declare const ActionTypeByResourceType: {
    readonly AGENTS: {
        readonly READ: ActionTypeEnum.READ;
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly BILLING: {
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly WORKFLOWS: {
        readonly DEPLOY: ActionTypeEnum.DEPLOY;
        readonly DELETE: ActionTypeEnum.DELETE;
        readonly CREATE: ActionTypeEnum.CREATE;
        readonly UPDATE: ActionTypeEnum.UPDATE;
        readonly SHARE: ActionTypeEnum.SHARE;
    };
    readonly SECRET_STORES: {
        readonly DELETE: ActionTypeEnum.DELETE;
        readonly CREATE: ActionTypeEnum.CREATE;
        readonly UPDATE: ActionTypeEnum.UPDATE;
        readonly SHARE: ActionTypeEnum.SHARE;
        readonly BUILD: ActionTypeEnum.BUILD;
    };
    readonly ROLE_MEMBERS: {
        readonly MANAGE: ActionTypeEnum.MANAGE;
        readonly READ: ActionTypeEnum.READ;
    };
    readonly PROFILES: {
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly ROLES: {
        readonly READ: ActionTypeEnum.READ;
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly REPOS: {
        readonly READ: ActionTypeEnum.READ;
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly GROUPS: {
        readonly READ: ActionTypeEnum.READ;
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly GROUP_MEMBERS: {
        readonly READ: ActionTypeEnum.READ;
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly ORGANIZATION: {
        readonly MANAGE: ActionTypeEnum.MANAGE;
        readonly READ: ActionTypeEnum.READ;
    };
    readonly ORGANIZATION_USERS: {
        readonly READ: ActionTypeEnum.READ;
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly ACCESS_TOKENS: {
        readonly READ: ActionTypeEnum.READ;
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly APPLICATIONS: {
        readonly CREATE: ActionTypeEnum.CREATE;
        readonly DELETE: ActionTypeEnum.DELETE;
        readonly DEPLOY: ActionTypeEnum.DEPLOY;
        readonly MANAGE_VISIBILITY: ActionTypeEnum.MANAGE_VISIBILITY;
        readonly PREVIEW: ActionTypeEnum.PREVIEW;
        readonly SHARE: ActionTypeEnum.SHARE;
        readonly UPDATE: ActionTypeEnum.UPDATE;
        readonly VIEW: ActionTypeEnum.VIEW;
    };
    readonly FOLDERS: {
        readonly MANAGE: ActionTypeEnum.MANAGE;
    };
    readonly INTEGRATIONS: {
        readonly CREATE: ActionTypeEnum.CREATE;
        readonly DELETE: ActionTypeEnum.DELETE;
        readonly BUILD: ActionTypeEnum.BUILD;
        readonly SHARE: ActionTypeEnum.SHARE;
        readonly UPDATE: ActionTypeEnum.UPDATE;
    };
    readonly LOGS: {
        readonly READ: ActionTypeEnum.READ;
    };
    readonly LOGS_STREAMS: {
        readonly MANAGE: ActionTypeEnum.MANAGE;
        readonly READ: ActionTypeEnum.READ;
    };
    readonly SCHEDULED_JOBS: {
        readonly CREATE: ActionTypeEnum.CREATE;
        readonly DELETE: ActionTypeEnum.DELETE;
        readonly DEPLOY: ActionTypeEnum.DEPLOY;
        readonly MANAGE_SCHEDULE: ActionTypeEnum.MANAGE_SCHEDULE;
        readonly RUN: ActionTypeEnum.RUN;
        readonly SHARE: ActionTypeEnum.SHARE;
        readonly UPDATE: ActionTypeEnum.UPDATE;
    };
    readonly ORG_KNOWLEDGE: {
        readonly CREATE: ActionTypeEnum.CREATE;
        readonly UPDATE: ActionTypeEnum.UPDATE;
        readonly DELETE: ActionTypeEnum.DELETE;
    };
};
type ResourceBrief = {
    id: string;
    name: string;
};
export type AssignmentDto = {
    id: string;
    created: Date;
    assignmentId: string;
    assignmentType: AssignmentTypeEnum;
    principalId: string;
    principalType: PrincipalTypeEnum;
    resourceId: string;
    resourceType: ResourceTypeEnum;
    role?: RoleDto;
    permission?: PermissionDto;
    group?: GroupBrief;
    user?: {
        id: string;
        name: string;
        email: string;
        status: ApplicationUserStatus;
    };
    api?: ResourceBrief & {
        triggerType: ApiTriggerType;
    };
    application?: ResourceBrief & {
        devEnvEnabled: boolean;
    };
    integration?: ResourceBrief;
};
export type RoleDto = {
    id: string;
    name: string;
    description: string;
    type: RoleTypeEnum;
    organizationId: string | null;
    permissions?: PermissionDto[];
};
export type PermissionDto = {
    id: string;
    actionType: ActionTypeEnum;
    resourceType: ResourceTypeEnum;
    description: string;
};
export type SimplePermissionDto = {
    actionType: ActionTypeEnum;
    resourceType: ResourceTypeEnum;
};
export type ResourcePermissions = {
    permissions: ActionTypeEnum[];
};
export declare class RoleSettingsDto {
    [RoleTypeEnum.ORGANIZATION]?: {
        new_user?: string | null;
    };
    [RoleTypeEnum.APPLICATIONS]?: {
        base?: string | null;
        creator?: string | null;
    };
    [RoleTypeEnum.INTEGRATIONS]?: {
        base?: string | null;
        creator?: string | null;
    };
    [RoleTypeEnum.SCHEDULED_JOBS]?: {
        base?: string | null;
        creator?: string | null;
    };
    [RoleTypeEnum.WORKFLOWS]?: {
        base?: string | null;
        creator?: string | null;
    };
    constructor(defaultRoles: {
        roleId: string | null;
        roleType: RoleTypeEnum;
        settingType: ResourceSettingType;
    }[]);
}
export declare enum ResourceSettingType {
    NEW_USER = "new_user",
    BASE = "base",
    CREATOR = "creator"
}
export type CreatorDto = {
    id: string;
    email: string;
    name: string;
};
export {};
//# sourceMappingURL=index.d.ts.map