/** * Consent Page Types * * Canonical type definitions for consent page configuration and rendering. * * @module @kya-os/consent/types/page */ import type { ConsentBranding } from "./branding.types.js"; import type { ConsentTerms } from "./copy.types.js"; import type { ConsentCustomField } from "./config.types.js"; import type { ModeConfigs } from "./modes.types.js"; import type { OAuthIdentity } from "./api.types.js"; export type { ResolvedConsentConfig } from "./config.types.js"; /** * Consent Page Configuration * * Complete configuration for rendering a consent page. * Used for the initial page render request. */ export interface ConsentPageConfig { /** Tool name requiring authorization */ tool: string; /** Description of what the tool does */ toolDescription: string; /** Scopes being requested */ scopes: string[]; /** Agent DID requesting authorization */ agentDid: string; /** Session ID for tracking */ sessionId: string; /** Project ID from AgentShield */ projectId: string; /** Server URL for form submission */ serverUrl: string; /** OAuth/auth provider identifier */ provider?: string; /** Branding configuration */ branding?: ConsentBranding; /** Terms configuration */ terms?: ConsentTerms; /** Custom fields to collect */ customFields?: ConsentCustomField[]; /** Whether to auto-close window after success */ autoClose?: boolean; /** Whether OAuth authorization is required immediately */ oauthRequired?: boolean; /** The OAuth authorization URL to redirect to */ oauthUrl?: string; } /** * Extended Consent Page Configuration * * Extended configuration with mode-specific settings and OAuth state. * Used internally by templates for rendering. */ export interface ExtendedConsentPageConfig extends ConsentPageConfig { /** Expiration days for delegation */ expirationDays?: number; /** Mode-specific configurations */ modeConfig?: ModeConfigs; /** OAuth identity from previous authentication (included in form for approval) */ oauthIdentity?: OAuthIdentity; } /** * Credential Page Configuration * * Configuration for rendering a credentials login page. */ export interface CredentialPageConfig { /** Tool name */ tool: string; /** Agent DID */ agentDid: string; /** Session ID */ sessionId: string; /** Project ID */ projectId: string; /** Server URL */ serverUrl: string; /** CSRF token for form submission */ csrfToken: string; /** Provider identifier */ provider: string; /** Username field label */ usernameLabel?: string; /** Username field placeholder */ usernamePlaceholder?: string; /** Password field label */ passwordLabel?: string; /** Password field placeholder */ passwordPlaceholder?: string; /** Whether to show "Remember me" checkbox */ showRememberMe?: boolean; /** Whether to show "Forgot password" link */ showForgotPassword?: boolean; /** URL for forgot password page */ forgotPasswordUrl?: string; } /** * Success Page Configuration * * Configuration for rendering a success page after consent approval. */ export interface SuccessPageConfig { /** Delegation ID */ delegationId: string; /** Project ID */ projectId: string; /** Server URL */ serverUrl: string; /** Whether to auto-close the window */ autoClose?: boolean; /** Success page title */ title?: string; /** Success page description */ description?: string; /** Continue button text */ continueButtonText?: string; } //# sourceMappingURL=page.types.d.ts.map