/**
 * JIRA Sync Wrapper
 *
 * Wraps JIRA sync operations with the SyncInterceptor for permission checks
 * and audit logging. This provides a consistent interface for all JIRA sync
 * operations while ensuring they go through the permission enforcement layer.
 *
 * Usage:
 * ```typescript
 * const wrapper = new JiraSyncWrapper({
 *   client: new JiraClient({ baseUrl, credentials }),
 *   projectKey: 'PROJ',
 *   interceptor,
 *   logger
 * });
 *
 * // All operations now go through permission enforcement
 * const issue = await wrapper.createIssue(params);
 * ```
 *
 * @module sync/jira-sync-wrapper
 */
import { SyncInterceptor } from '../core/sync/sync-interceptor.js';
import { JiraClient, JiraIssue, JiraIssueCreate, JiraIssueUpdate } from '../integrations/jira/jira-client.js';
import { Logger } from '../utils/logger.js';
/**
 * Wrapper options
 */
export interface JiraSyncWrapperOptions {
    /**
     * JIRA client instance
     */
    client: JiraClient;
    /**
     * Default project key for operations
     */
    projectKey: string;
    /**
     * Sync interceptor for permission checking
     */
    interceptor: SyncInterceptor;
    /**
     * Logger instance
     */
    logger?: Logger;
}
/**
 * Operation result with additional metadata
 */
export interface WrappedOperationResult<T> {
    /**
     * Whether the operation was allowed and succeeded
     */
    success: boolean;
    /**
     * The result of the operation (null if denied or failed)
     */
    result: T | null;
    /**
     * Reason for denial (if denied)
     */
    denialReason?: string;
    /**
     * Error message (if failed)
     */
    error?: string;
    /**
     * Duration of the operation in milliseconds
     */
    durationMs: number;
}
/**
 * JiraSyncWrapper - Permission-enforced JIRA sync operations
 *
 * All JIRA sync operations pass through the SyncInterceptor which:
 * 1. Checks permissions before execution
 * 2. Logs all attempts (success, denied, error)
 * 3. Provides consistent error handling
 */
export declare class JiraSyncWrapper {
    private readonly client;
    private readonly projectKey;
    private readonly interceptor;
    private readonly logger;
    constructor(options: JiraSyncWrapperOptions);
    /**
     * Create a JIRA issue
     *
     * @param issue - Issue creation parameters
     * @param origin - Item origin (internal or external)
     * @returns Wrapped operation result
     */
    createIssue(issue: JiraIssueCreate, origin?: 'internal' | 'external'): Promise<WrappedOperationResult<JiraIssue>>;
    /**
     * Update a JIRA issue
     *
     * @param update - Issue update parameters
     * @param origin - Item origin (internal or external)
     * @returns Wrapped operation result
     */
    updateIssue(update: JiraIssueUpdate, origin?: 'internal' | 'external'): Promise<WrappedOperationResult<JiraIssue>>;
    /**
     * Update issue status (transition)
     *
     * @param issueKey - JIRA issue key
     * @param targetStatus - Target status name
     * @returns Wrapped operation result
     */
    updateStatus(issueKey: string, targetStatus: string): Promise<WrappedOperationResult<JiraIssue>>;
    /**
     * Get a JIRA issue (read-only, always allowed)
     *
     * @param issueKey - JIRA issue key
     * @returns Wrapped operation result
     */
    getIssue(issueKey: string): Promise<WrappedOperationResult<JiraIssue>>;
    /**
     * Search issues with JQL filter (read-only, always allowed)
     *
     * @param jql - JQL query string
     * @param maxResults - Maximum results to return
     * @returns Wrapped operation result
     */
    searchIssues(jql: string, maxResults?: number): Promise<WrappedOperationResult<JiraIssue[]>>;
    /**
     * Add labels to a JIRA issue
     *
     * @param issueKey - JIRA issue key
     * @param labels - Labels to add
     * @param origin - Item origin
     * @returns Wrapped operation result
     */
    addLabels(issueKey: string, labels: string[], origin?: 'internal' | 'external'): Promise<WrappedOperationResult<JiraIssue>>;
    /**
     * Check if an operation would be allowed (pre-flight check)
     *
     * @param operation - Operation type
     * @param itemId - Item ID
     * @returns true if operation would be allowed
     */
    wouldAllow(operation: 'upsert-internal' | 'upsert-external' | 'update-status' | 'read', itemId: string): boolean;
    /**
     * Get the underlying client for operations that don't need interception
     */
    getClient(): JiraClient;
    /**
     * Get the project key
     */
    getProjectKey(): string;
    /**
     * Convert interceptor result to wrapped result
     */
    private toWrappedResult;
}
//# sourceMappingURL=jira-sync-wrapper.d.ts.map