import { type OrganizationRole, type Organization, type OrganizationInvitation, type Application } from '../db-entries/index.js'; import { type ToZodObject } from '../utils/zod.js'; import { type UserInfo, type FeaturedUser } from './user.js'; /** * The simplified organization scope entity that is returned for some endpoints. */ export type OrganizationScopeEntity = { id: string; name: string; }; /** * The simplified resource scope entity that is returned for some endpoints. */ export type ResourceScopeEntity = { id: string; name: string; resource: { id: string; name: string; }; }; export type OrganizationRoleWithScopes = OrganizationRole & { scopes: OrganizationScopeEntity[]; resourceScopes: ResourceScopeEntity[]; }; export declare const organizationRoleWithScopesGuard: ToZodObject; /** * The simplified organization role entity that is returned in the `roles` field * of the organization. */ export type OrganizationRoleEntity = { id: string; name: string; }; /** * The organization entity with the `organizationRoles` field that contains the * roles of the current member of the organization. */ export type OrganizationWithRoles = Organization & { /** The roles of the current member of the organization. */ organizationRoles: OrganizationRoleEntity[]; }; export declare const organizationWithOrganizationRolesGuard: ToZodObject; /** * The user entity with the `organizationRoles` field that contains the roles of * the user in the organization. */ export type UserWithOrganizationRoles = UserInfo & { /** The roles of the user in the organization. */ organizationRoles: OrganizationRoleEntity[]; }; export declare const userWithOrganizationRolesGuard: ToZodObject; /** * The organization entity with optional `usersCount` and `featuredUsers` fields. * They are useful for displaying the organization list in the frontend. */ export type OrganizationWithFeatured = Organization & { usersCount?: number; featuredUsers?: FeaturedUser[]; }; /** * The application entity with the `organizationRoles` field that contains the roles * of the application in the organization. */ export type ApplicationWithOrganizationRoles = Application & { /** The roles of the application in the organization. */ organizationRoles: OrganizationRoleEntity[]; }; export declare const applicationWithOrganizationRolesGuard: ToZodObject; /** * The organization invitation with additional fields: * * - `organizationRoles`: The roles to be assigned to the user when accepting the invitation. */ export type OrganizationInvitationEntity = OrganizationInvitation & { organizationRoles: OrganizationRoleEntity[]; }; export declare const organizationInvitationEntityGuard: ToZodObject;