// Code generated by go run ./cmd/auth-capabilities --write; DO NOT EDIT.

export const INSTANCE_CAPABILITIES = {
    manageUsers: 'instance.manage_users',
    viewAllSites: 'instance.view_all_sites',
    manageSettings: 'instance.manage_settings',
    viewSystem: 'instance.view_system',
    viewActivation: 'instance.view_activation',
    manageSystem: 'instance.manage_system',
    runMaintenance: 'instance.run_maintenance',
    viewAudit: 'instance.view_audit',
    exportAudit: 'instance.export_audit',
    manageSiteExclusions: 'instance.manage_site_exclusions',
    manageImports: 'instance.manage_imports'
} as const;

export const SITE_CAPABILITIES = {
    view: 'site.view',
    manageData: 'site.manage_data',
    manageGoals: 'site.manage_goals',
    manageTeam: 'site.manage_team',
    delete: 'site.delete'
} as const;

export const TEAM_CAPABILITIES = {
    viewMembers: 'team.view_members',
    manageMembers: 'team.manage_members',
    viewAudit: 'team.view_audit',
    manageSettings: 'team.manage_settings',
    manageApiClients: 'team.manage_api_clients',
    manageIntegrations: 'team.manage_integrations',
    transferOwnership: 'team.transfer_ownership',
    archive: 'team.archive'
} as const;

export type InstanceCapability = (typeof INSTANCE_CAPABILITIES)[keyof typeof INSTANCE_CAPABILITIES];
export type SiteCapability = (typeof SITE_CAPABILITIES)[keyof typeof SITE_CAPABILITIES];
export type TeamCapability = (typeof TEAM_CAPABILITIES)[keyof typeof TEAM_CAPABILITIES];
export type AccessCapability = InstanceCapability | SiteCapability | TeamCapability;

export const INSTANCE_ROLE_CAPABILITIES = {
    owner: [
        INSTANCE_CAPABILITIES.manageUsers,
        INSTANCE_CAPABILITIES.viewAllSites,
        INSTANCE_CAPABILITIES.manageSettings,
        INSTANCE_CAPABILITIES.viewSystem,
        INSTANCE_CAPABILITIES.viewActivation,
        INSTANCE_CAPABILITIES.manageSystem,
        INSTANCE_CAPABILITIES.runMaintenance,
        INSTANCE_CAPABILITIES.viewAudit,
        INSTANCE_CAPABILITIES.exportAudit,
        INSTANCE_CAPABILITIES.manageSiteExclusions,
        INSTANCE_CAPABILITIES.manageImports,
        SITE_CAPABILITIES.view,
        SITE_CAPABILITIES.manageData,
        SITE_CAPABILITIES.manageGoals,
        SITE_CAPABILITIES.manageTeam,
        SITE_CAPABILITIES.delete
    ],
    admin: [
        INSTANCE_CAPABILITIES.viewAllSites,
        INSTANCE_CAPABILITIES.viewSystem,
        INSTANCE_CAPABILITIES.runMaintenance,
        INSTANCE_CAPABILITIES.viewAudit,
        INSTANCE_CAPABILITIES.manageSiteExclusions,
        INSTANCE_CAPABILITIES.manageImports,
        SITE_CAPABILITIES.view
    ],
    user: []
} as const satisfies Record<string, readonly AccessCapability[]>;

export const SITE_ROLE_CAPABILITIES = {
    owner: [SITE_CAPABILITIES.view, SITE_CAPABILITIES.manageData, SITE_CAPABILITIES.manageGoals, SITE_CAPABILITIES.manageTeam, SITE_CAPABILITIES.delete],
    admin: [SITE_CAPABILITIES.view, SITE_CAPABILITIES.manageData, SITE_CAPABILITIES.manageGoals, SITE_CAPABILITIES.manageTeam],
    editor: [SITE_CAPABILITIES.view, SITE_CAPABILITIES.manageGoals],
    viewer: [SITE_CAPABILITIES.view]
} as const satisfies Record<string, readonly AccessCapability[]>;

export const TEAM_ROLE_CAPABILITIES = {
    owner: [
        TEAM_CAPABILITIES.viewMembers,
        TEAM_CAPABILITIES.manageMembers,
        TEAM_CAPABILITIES.viewAudit,
        TEAM_CAPABILITIES.manageSettings,
        TEAM_CAPABILITIES.manageApiClients,
        TEAM_CAPABILITIES.manageIntegrations,
        TEAM_CAPABILITIES.transferOwnership,
        TEAM_CAPABILITIES.archive
    ],
    admin: [TEAM_CAPABILITIES.viewMembers, TEAM_CAPABILITIES.manageMembers, TEAM_CAPABILITIES.viewAudit, TEAM_CAPABILITIES.manageSettings, TEAM_CAPABILITIES.manageApiClients, TEAM_CAPABILITIES.manageIntegrations],
    member: [TEAM_CAPABILITIES.viewMembers]
} as const satisfies Record<string, readonly AccessCapability[]>;

export type InstanceRole = keyof typeof INSTANCE_ROLE_CAPABILITIES;
export type SiteRole = keyof typeof SITE_ROLE_CAPABILITIES;
export type TeamRole = keyof typeof TEAM_ROLE_CAPABILITIES;
