adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
229 lines • 6.17 kB
TypeScript
/**
* Adobe Document Generation API Client
*
* Provides integration with Adobe Document Generation APIs for
* template-based document creation with data merge capabilities.
*/
export interface DocumentGenerationRequest {
templateId: string;
data: DocumentData;
outputOptions: DocumentOutputOptions;
mergeOptions?: MergeOptions;
}
export interface DocumentData {
metadata: {
title: string;
author: string;
subject?: string;
keywords?: string[];
createdDate: Date;
};
content: {
[key: string]: any;
};
variables: {
[variableName: string]: any;
};
tables?: TableData[];
images?: ImageData[];
charts?: ChartData[];
}
export interface DocumentOutputOptions {
format: 'pdf' | 'docx' | 'pptx' | 'html';
quality: 'standard' | 'high' | 'print-ready';
protectionOptions?: DocumentProtectionOptions;
branding?: DocumentBranding;
}
export interface DocumentProtectionOptions {
password?: string;
permissions: {
printing: boolean;
copying: boolean;
editing: boolean;
commenting: boolean;
};
watermark?: {
text: string;
opacity: number;
position: 'diagonal' | 'header' | 'footer';
};
}
export interface DocumentBranding {
logoPath?: string;
headerText?: string;
footerText?: string;
colorScheme: {
primary: string;
secondary: string;
accent: string;
};
fonts: {
heading: string;
body: string;
monospace: string;
};
}
export interface MergeOptions {
removeEmptyParagraphs: boolean;
removeEmptyTables: boolean;
dateFormat: string;
numberFormat: string;
booleanFormat: {
true: string;
false: string;
};
}
export interface TableData {
id: string;
title?: string;
headers: string[];
rows: any[][];
styling?: TableStyling;
}
export interface TableStyling {
headerBackgroundColor: string;
headerTextColor: string;
rowAlternatingColors: string[];
borderColor: string;
borderWidth: number;
fontSize: number;
}
export interface ImageData {
id: string;
path: string;
caption?: string;
positioning: {
alignment: 'left' | 'center' | 'right';
width?: number;
height?: number;
maintainAspectRatio: boolean;
};
}
export interface ChartData {
id: string;
type: 'bar' | 'pie' | 'line' | 'area';
title: string;
data: {
labels: string[];
datasets: {
label: string;
data: number[];
backgroundColor?: string[];
borderColor?: string;
}[];
};
options?: {
responsive: boolean;
showLegend: boolean;
showLabels: boolean;
};
}
export interface DocumentTemplate {
id: string;
name: string;
description: string;
category: 'project-management' | 'requirements' | 'technical' | 'business' | 'compliance';
version: string;
templatePath: string;
variables: TemplateVariable[];
sections: TemplateSection[];
outputFormats: string[];
previewImage?: string;
}
export interface TemplateVariable {
name: string;
type: 'text' | 'number' | 'date' | 'boolean' | 'image' | 'table' | 'list';
required: boolean;
description: string;
defaultValue?: any;
validation?: VariableValidation;
}
export interface VariableValidation {
pattern?: string;
minLength?: number;
maxLength?: number;
minValue?: number;
maxValue?: number;
allowedValues?: any[];
}
export interface TemplateSection {
id: string;
name: string;
type: 'header' | 'footer' | 'body' | 'appendix';
variables: string[];
conditional?: {
variable: string;
condition: 'exists' | 'equals' | 'not-equals' | 'greater-than' | 'less-than';
value?: any;
};
}
export interface GeneratedDocument {
id: string;
templateUsed: string;
outputPath: string;
format: string;
pageCount: number;
fileSize: number;
variablesUsed: string[];
metadata: {
createdAt: Date;
processingTime: number;
template: string;
version: string;
dataHash: string;
};
previewUrl?: string;
}
export declare class DocumentGenerationAPIClient {
private authenticator;
private apiEndpoint;
private accessToken;
constructor();
/**
* Initialize the client and authenticate with Adobe Document Generation API
*/
initialize(): Promise<void>;
/**
* List available document templates
*/
listTemplates(category?: string): Promise<DocumentTemplate[]>;
/**
* Generate a document from template and data
*/
generateDocument(request: DocumentGenerationRequest): Promise<GeneratedDocument>;
/**
* Batch generate multiple documents from the same template
*/
batchGenerateDocuments(templateId: string, dataSet: DocumentData[], outputOptions: DocumentOutputOptions): Promise<GeneratedDocument[]>;
/**
* Generate documents in multiple formats from a single data source
*/
generateMultiFormatDocument(templateId: string, data: DocumentData, formats: string[]): Promise<GeneratedDocument[]>;
/**
* Preview a document without generating the final output
*/
previewDocument(templateId: string, data: DocumentData, previewOptions: {
pages?: number[];
format: 'html' | 'pdf';
}): Promise<{
previewUrl: string;
pageCount: number;
}>;
/**
* Validate document data against template requirements
*/
validateDocumentData(templateId: string, data: DocumentData): Promise<{
isValid: boolean;
errors: string[];
warnings: string[];
}>;
private ensureAuthenticated;
private getTemplate;
private validateRequest;
private processTemplate;
private applyDocumentBranding;
private generateFinalOutput;
private calculateDataHash;
}
export declare const documentGenerationClient: DocumentGenerationAPIClient;
//# sourceMappingURL=document-generation-client.d.ts.map