import { Duration } from 'aws-cdk-lib'; import { PolicyStatement } from 'aws-cdk-lib/aws-iam'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { Chain, StateMachine } from 'aws-cdk-lib/aws-stepfunctions'; import { Construct } from 'constructs'; import { BaseDocumentProcessingProps } from '../base-document-processing'; import { IAdapter } from './adapter'; /** * Props for the Queued S3 Adapter */ export interface QueuedS3AdapterProps { /** * S3 bucket for document storage with organized prefixes (raw/, processed/, failed/). * If not provided, a new bucket will be created with auto-delete enabled based on removalPolicy. * * @default create a new bucket */ readonly bucket?: Bucket; /** * S3 prefix where the raw files would be stored. * This serves as the trigger point for processing * * @default "raw/" */ readonly rawPrefix?: string; /** * S3 prefix where the processed files would be stored. * * @default "processed/" */ readonly processedPrefix?: string; /** * S3 prefix where the files that failed processing would be stored. * * @default "failed/" */ readonly failedPrefix?: string; /** * SQS queue visibility timeout for processing messages. * Should be longer than expected processing time to prevent duplicate processing. * @default Duration.seconds(300) */ readonly queueVisibilityTimeout?: Duration; /** * The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. * * @default 5 */ readonly dlqMaxReceiveCount?: number; } /** * This adapter allows the intelligent document processing workflow * to be triggered by files that are uploaded into a S3 Bucket. */ export declare class QueuedS3Adapter implements IAdapter { private readonly adapterProps; private readonly resources; private readonly prefixes; constructor(adapterProps?: QueuedS3AdapterProps); /** * Ensures a prefix ends with '/'. * @param prefix - The prefix to normalize * @param defaultValue - Default value if prefix is undefined * @returns The normalized prefix ending with '/' */ private normalizePrefix; init(scope: Construct, props: BaseDocumentProcessingProps): void; createIngressTrigger(scope: Construct, stateMachine: StateMachine, props: BaseDocumentProcessingProps): Record; private createSQSConsumerLambda; generateAdapterIAMPolicies(additionalIAMActions?: string[], narrowActions?: boolean): PolicyStatement[]; createFailedChain(scope: Construct, idPrefix?: string): Chain; createSuccessChain(scope: Construct, idPrefix?: string): Chain; }