import { SiteFeatures, ChatApp, AuthenticatedUser, RecordOrUndef, ChatAppOverridableFeatures, AccessRules, ChatUser } from '../types/chatbot/chatbot-types.js'; import '@aws-sdk/client-bedrock-agent-runtime'; import '@aws-sdk/client-bedrock-agentcore'; declare function gunzipBase64EncodedString(base64EncodedString: string): string; declare function gzipAndBase64EncodeString(string: string): string; /** * Compute what features the user is and isn't allowed to use for this chat app. * * Feature hierarchy (in order of precedence): * 1. Site level (/pika-config.ts) - Controls ultimate availability * 2. Chat app level (chatApp.features) - Can override site settings * 3. Admin override level (chatApp.override.features) - Can override chat app settings * * Note that we always return siteAdmin: { websiteEnabled: false } because we only check that for real when they try to access the admin page itself. * * Override rules: * - Site level controls whether a feature can be used at all * - Chat apps can override site level (but only to restrict) * - Admins can override chat app level completely (but cannot enable features disabled at site level) * - When overriding, complete feature configuration must be provided (no merging) */ declare function getOverridableFeatures(siteFeatures: SiteFeatures, chatApp: ChatApp, user: AuthenticatedUser): ChatAppOverridableFeatures; /** * Generic function to check if a user has access to a feature based on user types and roles. * This implements the same logic used in get for checking user access rules. * * **Access Control Logic:** * - If the feature is disabled (`enabled: false`), no access regardless of other rules * - If no userTypes or userRoles are specified, no access is granted (secure by default) * - If multiple userTypes are provided, a user need only have one of them to have access (OR logic) * - If multiple userRoles are provided, a user need only have one of them to have access (OR logic) * - If both userTypes and userRoles are provided, the `applyRulesAs` setting determines how they're combined: * - `'and'` (default): User must match a userType AND have a userRole * - `'or'`: User must match a userType OR have a userRole * * @param user - The authenticated user to check access for * @param feature - The feature configuration with user access rules * @returns Whether the user has access to the feature */ declare function checkUserAccessToFeature(user: AuthenticatedUser, feature: AccessRules): boolean; declare function getEntityIdForUser(user: ChatUser, overrideDataForThisChatApp: RecordOrUndef, entityAttributeName?: string): string | undefined; export { checkUserAccessToFeature, getEntityIdForUser, getOverridableFeatures, gunzipBase64EncodedString, gzipAndBase64EncodeString };