@elqnt/docs 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.tsx","../models/docs.ts","../util/index.tsx"],"sourcesContent":["export * from \"./models\";\nexport * from \"./util\";\n// export * from \"./context\";\n// export * from \"./hooks\";\n// export * from \"./components\";\n","// Code generated by tygo. DO NOT EDIT.\nimport { Variable } from \"@elqnt/types\";\n\n//////////\n// source: api.go\n\nexport interface DocumentValidationRequest {\n fileName: string;\n templateName: string;\n docBlob: string;\n fields: DocTemplateField[];\n validationRules: DocTemplateValidationRule[];\n}\nexport interface DocumentValidationResponse {\n success: boolean;\n message: string;\n fields: DocTemplateField[];\n}\n\n//////////\n// source: azure-doc-intelligence-models.go\n\nexport interface AzureDocumentIntelligenceResponse {\n status: string;\n createdDateTime: string;\n lastUpdatedDateTime: string;\n analyzeResult: AnalyzeResult;\n}\nexport interface AnalyzeResult {\n apiVersion: string;\n modelId: string;\n stringIndexType: string;\n pages: Page[];\n content: string;\n contentFormat: string;\n Paragraphs: Paragraph[];\n Tables: Tables[];\n}\nexport interface DocumentLayout {\n paragraphs: Paragraph[];\n tables: Tables[];\n pages: PageInfo[];\n}\nexport interface Page {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n words: Word[];\n lines: Line[];\n}\nexport interface Line {\n content: string;\n spans: Span[];\n}\nexport interface Paragraph {\n content: string;\n role: string;\n spans: Span[];\n boundingRegions: BoundingRegion[];\n}\nexport interface BoundingRegion {\n pageNumber: number /* int */;\n polygon: number /* float64 */[];\n}\nexport interface Word {\n content: string;\n boundingBox: number /* float64 */[];\n confidence: number /* float64 */;\n span: Span;\n}\nexport interface Span {\n offset: number /* int */;\n length: number /* int */;\n}\nexport interface Tables {\n rowCount: number /* int */;\n columnCount: number /* int */;\n cells: Cells[];\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n}\nexport interface Cells {\n kind?: string;\n rowIndex: number /* int */;\n columnIndex: number /* int */;\n content: string;\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n elements: string[];\n}\nexport interface Spans {\n offset: number /* int */;\n length: number /* int */;\n}\n\n//////////\n// source: citations-models.go\n\n/**\n * ** our own custom types mainly for the docs ingestion\n */\nexport interface PageInfo {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n}\nexport interface ParagraphContent {\n paragraph_number: number /* int */;\n content: string;\n role: string;\n}\nexport interface ParagraphContentReference {\n page_number: number /* int */;\n paragraph_number: number /* int */;\n markdown_tag: string;\n}\nexport interface DocumentReference {\n URL: string;\n Title: string;\n PageNumber: number /* int */;\n ParagraphReferences: ParagraphReference[];\n}\nexport interface ParagraphReference {\n ParagraphNumber: number /* int */;\n BoundingRegions: BoundingRegion[];\n}\nexport interface DocsIngestionRequest {\n urls: string[];\n mode: string;\n brief: string;\n labels: string[];\n}\nexport interface RawAnalysisRequest {\n fileUrl: string;\n model: 'prebuilt-read' | 'prebuilt-layout';\n fromPage: number /* int */;\n toPage: number /* int */;\n outputMarkdown: boolean;\n}\n/**\n * Citation represents the citation data for a page chunk\n */\nexport interface Citation {\n boundingRegions: BoundingRegion[];\n pageInfo?: PageInfo;\n}\n/**\n * PageChunk represents a chunk of document content with its associated citations\n */\nexport interface PageChunk {\n text: string;\n citations: Citation;\n}\n\n//////////\n// source: doc-analysis-models.go\n\n/**\n * DocAnalysisConfig holds configuration for document analysis processing\n */\nexport interface DocAnalysisConfig {\n maxConcurrentEmbeddings: number /* int */;\n batchStorageSize: number /* int */;\n embeddingTimeout: any /* time.Duration */;\n}\n/**\n * DocumentAnalysisResult represents the result of analyzing a document\n */\nexport interface DocumentAnalysisResult {\n docId: string;\n success: boolean;\n message: string;\n metadata: DocumentMetadata;\n totalChunks: number /* int */;\n successCount: number /* int */;\n errorCount: number /* int */;\n status: string;\n}\nexport interface DocumentAnalysisReference {\n doc_id: string;\n url: string;\n title: string;\n}\n\n//////////\n// source: doc-flow-models.go\n\nexport interface WorkflowDocumentExtractionRequest {\n orgID: string;\n instanceID: string;\n nodeID: string;\n fileUrl: string;\n schema: any /* types.JSONSchema */;\n instructions: string;\n documentType: string;\n subType: string; // the workflow node sub type, determines the document extraction function to use\n companyID: string;\n}\nexport interface WorkflowDocumentExtractionStatus {\n status: string;\n error?: string;\n timestamp: number /* int64 */;\n percentage: number /* int */;\n}\nexport interface WorkflowDocumentExtractionResponse {\n result: { [key: string]: any};\n}\n\n//////////\n// source: jobs-models.go\n\nexport interface DocJob {\n id?: string /* ObjectID */;\n templateId: string;\n templateTitle: string;\n title: string;\n label: string;\n fields: { [key: string]: Variable };\n status: 'started' | 'pending' | 'failed' | 'success';\n progress: number /* int */;\n fileUrls: string[];\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n createdBy: string;\n updatedBy: string;\n}\nexport type DocJobStatus = string;\nexport const DocJobStatusStarted: DocJobStatus = \"started\";\nexport const DocJobStatusInProgress: DocJobStatus = \"in progress\";\nexport const DocJobStatusPending: DocJobStatus = \"pending\";\nexport const DocJobStatusFailed: DocJobStatus = \"failed\";\nexport const DocJobStatusSuccess: DocJobStatus = \"success\";\nexport interface DocExtractionResult {\n id?: string /* ObjectID */;\n jobId: string;\n templateId: string;\n fileUrl: string;\n fields: DocTemplateField[];\n status: DocJobStatus;\n label: string;\n error: string;\n message: string;\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n}\n\n//////////\n// source: poc-models.go\n\nexport interface QuarterlyFinancialStatement {\n companyName: string;\n year: number /* int */;\n quarter: number /* int */;\n totalAssets: number /* float64 */;\n totalEquity: number /* float64 */;\n totalLiabilities: number /* float64 */;\n totalRevenueForPeriod: number /* float64 */;\n totalRevenuePrevPeriod: number /* float64 */;\n totalOperatingIncome: number /* float64 */;\n totalOperatingExpenses: number /* float64 */;\n profitLossForPeriod: number /* float64 */;\n}\nexport interface PassportInfo {\n firstNameEn: string;\n secondNameEn: string;\n thirdNameEn: string;\n fourthNameEn: string;\n lastNameEn: string;\n firstNameAr: string;\n secondNameAr: string;\n thirdNameAr: string;\n fourthNameAr: string;\n lastNameAr: string;\n passportNumber: string;\n nationality: string;\n dateOfBirth: string;\n expiryDate: string;\n passportType: string;\n gender: string;\n}\nexport interface QuotationAnalyzeRequest {\n fileUrls: string[];\n rfqTables: RFQTable[];\n rfqLineItems: RFQLineItem[];\n evaluationCriteria: string;\n}\nexport interface RFQAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface RFQAnalyzeResponse {\n rfqLineItems: RFQLineItem[];\n rfqTables: RFQTable[];\n}\nexport interface RFQTable {\n title: string;\n markdown: string;\n}\nexport interface QuotationAnalyzeResponse {\n quotationLineItems: QuotationLineItem[];\n}\nexport interface RFQLineItem {\n item_name: string;\n description: string;\n quantity: number /* int */;\n}\nexport interface QuotationLineItem {\n item_name: string;\n supplier_name: string;\n description: string;\n quantity: number /* int */;\n item_price: number /* float64 */;\n total_price: number /* float64 */;\n notes: string;\n meet_criteria: boolean;\n}\nexport interface InvoiceAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface InvoiceAnalyzeResponse {\n supplier_name: string;\n customer_name: string;\n invoice_date: string;\n invoice_due_date: string;\n invoice_number: string;\n invoice_total: number /* float64 */;\n invoice_items_tables: MarkdownTable[];\n}\nexport interface MarkdownTable {\n title: string;\n markdown: string;\n}\n\n//////////\n// source: search-models.go\n\n/**\n * DocumentChunk represents a chunk of analyzed document for ClickHouse\n */\nexport interface DocumentChunk {\n doc_id: string;\n title: string;\n doc_url: string;\n chunk_id: string;\n chunk_text: string;\n chunk_index: number /* uint32 */;\n embeddings: number /* float64 */[];\n citations: Citation;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n}\n/**\n * DocumentMetadata represents document-level metadata for ClickHouse\n */\nexport interface DocumentMetadata {\n doc_id: string;\n title: string;\n doc_url: string;\n total_chunks: number /* uint32 */;\n page_count: number /* uint32 */;\n from_page: number /* uint32 */;\n to_page: number /* uint32 */;\n status: string;\n model: string;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n updated_at: string /* RFC3339 */;\n}\n\n//////////\n// source: templates-models.go\n\nexport interface DocTemplate {\n id?: string /* ObjectID */;\n name: string;\n title: string;\n description?: string;\n fields: DocTemplateField[];\n validationRules?: DocTemplateValidationRule[];\n}\nexport interface DocTemplateField {\n name: string;\n title: string;\n description?: string;\n dataType: string;\n required?: boolean;\n options?: string[];\n defaultValue?: string;\n value?: any;\n validationRules?: DocTemplateValidationRule[];\n subFields?: DocTemplateField[];\n issues: string;\n}\nexport interface DocTemplateValidationRule {\n type: ValidationRuleType;\n expectedValue?: any;\n isValid: boolean;\n error?: string;\n}\nexport type ValidationRuleType = string;\nexport const ValidationRuleTypeEqual: ValidationRuleType = \"equal\";\nexport const ValidationRuleTypeGreaterThan: ValidationRuleType = \"greaterThan\";\nexport const ValidationRuleTypeLessThan: ValidationRuleType = \"lessThan\";\nexport const ValidationRuleTypeRegex: ValidationRuleType = \"regex\";\nexport const ValidationRuleTypeRequired: ValidationRuleType = \"required\";\nexport const ValidationRuleTypeNotEmpty: ValidationRuleType = \"notEmpty\";\nexport const ValidationRuleTypeNotEqual: ValidationRuleType = \"notEqual\";\nexport const ValidationRuleTypeNotExpired: ValidationRuleType = \"notExpired\";\nexport const ValidationRuleTypeCustom: ValidationRuleType = \"custom\";\n","import { File, FileSpreadsheet, FileText } from \"lucide-react\";\nexport const getFileIcon = (fileName: string) => {\n const extensionMatch = fileName.match(/\\.([^.]+)$/);\n const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;\n\n if (!extension) return <File className=\"w-8 h-8 text-gray-500\" />;\n\n switch (extension) {\n case \"pdf\":\n return <File className=\"w-8 h-8 text-red-500\" />;\n case \"doc\":\n case \"docx\":\n return <FileText className=\"w-8 h-8 text-blue-500\" />;\n case \"xls\":\n case \"xlsx\":\n return <FileSpreadsheet className=\"w-8 h-8 text-green-500\" />;\n default:\n return <File className=\"w-8 h-8 text-gray-500\" />;\n }\n};\n\nexport const getFileName = (url: string) => {\n const fileName = decodeURIComponent(url.split(\"/\").pop() ?? \"\");\n\n const cleanFileName = fileName\n .replace(/%28(\\d+)%29/g, \"($1)\") // Replace %28 and %29 with parentheses\n .replace(/[^\\w\\s().-]/g, \"\") // Remove any other special characters\n .replace(/\\s+/g, \"_\") // Replace spaces with underscores\n .replace(/-\\d+(?=\\.pdf)/g, \"\"); // Remove the trailing number before .pdf\n\n return cleanFileName;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACuOO,IAAM,sBAAoC;AAC1C,IAAM,yBAAuC;AAC7C,IAAM,sBAAoC;AAC1C,IAAM,qBAAmC;AACzC,IAAM,sBAAoC;AA4K1C,IAAM,0BAA8C;AACpD,IAAM,gCAAoD;AAC1D,IAAM,6BAAiD;AACvD,IAAM,0BAA8C;AACpD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,+BAAmD;AACzD,IAAM,2BAA+C;;;AC/Z5D,0BAAgD;AAKvB;AAJlB,IAAM,cAAc,CAAC,aAAqB;AAC/C,QAAM,iBAAiB,SAAS,MAAM,YAAY;AAClD,QAAM,YAAY,iBAAiB,eAAe,CAAC,EAAE,YAAY,IAAI;AAErE,MAAI,CAAC,UAAW,QAAO,4CAAC,4BAAK,WAAU,yBAAwB;AAE/D,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO,4CAAC,4BAAK,WAAU,wBAAuB;AAAA,IAChD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,4CAAC,gCAAS,WAAU,yBAAwB;AAAA,IACrD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,4CAAC,uCAAgB,WAAU,0BAAyB;AAAA,IAC7D;AACE,aAAO,4CAAC,4BAAK,WAAU,yBAAwB;AAAA,EACnD;AACF;AAEO,IAAM,cAAc,CAAC,QAAgB;AAC1C,QAAM,WAAW,mBAAmB,IAAI,MAAM,GAAG,EAAE,IAAI,KAAK,EAAE;AAE9D,QAAM,gBAAgB,SACnB,QAAQ,gBAAgB,MAAM,EAC9B,QAAQ,gBAAgB,EAAE,EAC1B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,kBAAkB,EAAE;AAE/B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../index.tsx","../models/docs.ts","../util/index.tsx"],"sourcesContent":["export * from \"./models\";\nexport * from \"./util\";\n// export * from \"./context\";\n// export * from \"./hooks\";\n// export * from \"./components\";\n","// Code generated by tygo. DO NOT EDIT.\nimport { Variable } from \"@elqnt/types\";\n\n//////////\n// source: api.go\n\nexport interface DocumentValidationRequest {\n fileName: string;\n templateName: string;\n docBlob: string;\n fields: DocTemplateField[];\n validationRules: DocTemplateValidationRule[];\n}\nexport interface DocumentValidationResponse {\n success: boolean;\n message: string;\n fields: DocTemplateField[];\n}\n\n//////////\n// source: azure-doc-intelligence-models.go\n\nexport interface AzureDocumentIntelligenceResponse {\n status: string;\n createdDateTime: string;\n lastUpdatedDateTime: string;\n analyzeResult: AnalyzeResult;\n}\nexport interface AnalyzeResult {\n apiVersion: string;\n modelId: string;\n stringIndexType: string;\n pages: Page[];\n content: string;\n contentFormat: string;\n Paragraphs: Paragraph[];\n Tables: Tables[];\n}\nexport interface DocumentLayout {\n paragraphs: Paragraph[];\n tables: Tables[];\n pages: PageInfo[];\n}\nexport interface Page {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n words: Word[];\n lines: Line[];\n}\nexport interface Line {\n content: string;\n spans: Span[];\n}\nexport interface Paragraph {\n content: string;\n role: string;\n spans: Span[];\n boundingRegions: BoundingRegion[];\n}\nexport interface BoundingRegion {\n pageNumber: number /* int */;\n polygon: number /* float64 */[];\n}\nexport interface Word {\n content: string;\n boundingBox: number /* float64 */[];\n confidence: number /* float64 */;\n span: Span;\n}\nexport interface Span {\n offset: number /* int */;\n length: number /* int */;\n}\nexport interface Tables {\n rowCount: number /* int */;\n columnCount: number /* int */;\n cells: Cells[];\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n}\nexport interface Cells {\n kind?: string;\n rowIndex: number /* int */;\n columnIndex: number /* int */;\n content: string;\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n elements: string[];\n}\nexport interface Spans {\n offset: number /* int */;\n length: number /* int */;\n}\n\n//////////\n// source: citations-models.go\n\n/**\n * ** our own custom types mainly for the docs ingestion\n */\nexport interface PageInfo {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n}\nexport interface ParagraphContent {\n paragraph_number: number /* int */;\n content: string;\n role: string;\n}\nexport interface ParagraphContentReference {\n page_number: number /* int */;\n paragraph_number: number /* int */;\n markdown_tag: string;\n}\nexport interface DocumentReference {\n URL: string;\n Title: string;\n PageNumber: number /* int */;\n ParagraphReferences: ParagraphReference[];\n}\nexport interface ParagraphReference {\n ParagraphNumber: number /* int */;\n BoundingRegions: BoundingRegion[];\n}\nexport interface DocsIngestionRequest {\n urls: string[];\n mode: string;\n brief: string;\n labels: string[];\n}\nexport interface RawAnalysisRequest {\n fileUrl: string;\n model: 'prebuilt-read' | 'prebuilt-layout';\n fromPage: number /* int */;\n toPage: number /* int */;\n outputMarkdown: boolean;\n}\n/**\n * Citation represents the citation data for a page chunk\n */\nexport interface Citation {\n boundingRegions: BoundingRegion[];\n pageInfo?: PageInfo;\n}\n/**\n * PageChunk represents a chunk of document content with its associated citations\n */\nexport interface PageChunk {\n text: string;\n citations: Citation;\n}\n\n//////////\n// source: doc-analysis-models.go\n\n/**\n * DocAnalysisConfig holds configuration for document analysis processing\n */\nexport interface DocAnalysisConfig {\n maxConcurrentEmbeddings: number /* int */;\n batchStorageSize: number /* int */;\n embeddingTimeout: any /* time.Duration */;\n}\n/**\n * DocumentAnalysisResult represents the result of analyzing a document\n */\nexport interface DocumentAnalysisResult {\n docId: string;\n success: boolean;\n message: string;\n metadata: DocumentMetadata;\n totalChunks: number /* int */;\n successCount: number /* int */;\n errorCount: number /* int */;\n status: string;\n}\nexport interface DocumentAnalysisReference {\n doc_id: string;\n url: string;\n title: string;\n}\n\n//////////\n// source: doc-flow-models.go\n\nexport interface WorkflowDocumentExtractionRequest {\n orgID: string;\n instanceID: string;\n nodeID: string;\n fileUrl: string;\n schema: any /* types.JSONSchema */;\n instructions: string;\n documentType: string;\n subType: string; // the workflow node sub type, determines the document extraction function to use\n companyID: string;\n}\nexport interface WorkflowDocumentExtractionStatus {\n status: string;\n error?: string;\n timestamp: number /* int64 */;\n percentage: number /* int */;\n}\nexport interface WorkflowDocumentExtractionResponse {\n result: { [key: string]: any};\n}\n\n//////////\n// source: jobs-models.go\n\nexport interface DocJob {\n id?: string /* ObjectID */;\n templateId: string;\n templateTitle: string;\n title: string;\n label: string;\n fields: { [key: string]: Variable };\n status: 'started' | 'pending' | 'failed' | 'success';\n progress: number /* int */;\n fileUrls: string[];\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n createdBy: string;\n updatedBy: string;\n}\nexport type DocJobStatus = string;\nexport const DocJobStatusStarted: DocJobStatus = \"started\";\nexport const DocJobStatusInProgress: DocJobStatus = \"in progress\";\nexport const DocJobStatusPending: DocJobStatus = \"pending\";\nexport const DocJobStatusFailed: DocJobStatus = \"failed\";\nexport const DocJobStatusSuccess: DocJobStatus = \"success\";\nexport interface DocExtractionResult {\n id?: string /* ObjectID */;\n jobId: string;\n templateId: string;\n fileUrl: string;\n fields: DocTemplateField[];\n status: DocJobStatus;\n label: string;\n error: string;\n message: string;\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n}\n\n//////////\n// source: poc-models.go\n\nexport interface QuarterlyFinancialStatement {\n companyName: string;\n year: number /* int */;\n quarter: number /* int */;\n totalAssets: number /* float64 */;\n totalEquity: number /* float64 */;\n totalLiabilities: number /* float64 */;\n totalRevenueForPeriod: number /* float64 */;\n totalRevenuePrevPeriod: number /* float64 */;\n totalOperatingIncome: number /* float64 */;\n totalOperatingExpenses: number /* float64 */;\n profitLossForPeriod: number /* float64 */;\n}\nexport interface PassportInfo {\n firstNameEn: string;\n secondNameEn: string;\n thirdNameEn: string;\n fourthNameEn: string;\n lastNameEn: string;\n firstNameAr: string;\n secondNameAr: string;\n thirdNameAr: string;\n fourthNameAr: string;\n lastNameAr: string;\n passportNumber: string;\n nationality: string;\n dateOfBirth: string;\n expiryDate: string;\n passportType: string;\n gender: string;\n}\nexport interface QuotationAnalyzeRequest {\n fileUrls: string[];\n rfqTables: RFQTable[];\n rfqLineItems: RFQLineItem[];\n evaluationCriteria: string;\n}\nexport interface RFQAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface RFQAnalyzeResponse {\n rfqLineItems: RFQLineItem[];\n rfqTables: RFQTable[];\n}\nexport interface RFQTable {\n title: string;\n markdown: string;\n}\nexport interface QuotationAnalyzeResponse {\n quotationLineItems: QuotationLineItem[];\n}\nexport interface RFQLineItem {\n item_name: string;\n description: string;\n quantity: number /* int */;\n}\nexport interface QuotationLineItem {\n item_name: string;\n supplier_name: string;\n description: string;\n quantity: number /* int */;\n item_price: number /* float64 */;\n total_price: number /* float64 */;\n notes: string;\n meet_criteria: boolean;\n}\nexport interface InvoiceAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface InvoiceAnalyzeResponse {\n supplier_name: string;\n customer_name: string;\n invoice_date: string;\n invoice_due_date: string;\n invoice_number: string;\n invoice_total: number /* float64 */;\n invoice_items_tables: MarkdownTable[];\n}\nexport interface MarkdownTable {\n title: string;\n markdown: string;\n}\n\n//////////\n// source: search-models.go\n\n/**\n * DocumentChunk represents a chunk of analyzed document for ClickHouse\n */\nexport interface DocumentChunk {\n doc_id: string;\n title: string;\n doc_url: string;\n chunk_id: string;\n chunk_text: string;\n chunk_index: number /* uint32 */;\n embeddings: number /* float64 */[];\n citations: Citation;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n}\n/**\n * DocumentMetadata represents document-level metadata for ClickHouse\n */\nexport interface DocumentMetadata {\n doc_id: string;\n title: string;\n doc_url: string;\n total_chunks: number /* uint32 */;\n page_count: number /* uint32 */;\n from_page: number /* uint32 */;\n to_page: number /* uint32 */;\n status: string;\n model: string;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n updated_at: string /* RFC3339 */;\n}\n\n//////////\n// source: templates-models.go\n\nexport interface DocTemplate {\n id?: string /* ObjectID */;\n name: string;\n title: string;\n description?: string;\n fields: DocTemplateField[];\n validationRules?: DocTemplateValidationRule[];\n}\nexport interface DocTemplateField {\n name: string;\n title: string;\n description?: string;\n dataType: string;\n required?: boolean;\n options?: string[];\n defaultValue?: string;\n value?: any;\n validationRules?: DocTemplateValidationRule[];\n subFields?: DocTemplateField[];\n issues: string;\n}\nexport interface DocTemplateValidationRule {\n type: ValidationRuleType;\n expectedValue?: any;\n isValid: boolean;\n error?: string;\n}\nexport type ValidationRuleType = string;\nexport const ValidationRuleTypeEqual: ValidationRuleType = \"equal\";\nexport const ValidationRuleTypeGreaterThan: ValidationRuleType = \"greaterThan\";\nexport const ValidationRuleTypeLessThan: ValidationRuleType = \"lessThan\";\nexport const ValidationRuleTypeRegex: ValidationRuleType = \"regex\";\nexport const ValidationRuleTypeRequired: ValidationRuleType = \"required\";\nexport const ValidationRuleTypeNotEmpty: ValidationRuleType = \"notEmpty\";\nexport const ValidationRuleTypeNotEqual: ValidationRuleType = \"notEqual\";\nexport const ValidationRuleTypeNotExpired: ValidationRuleType = \"notExpired\";\nexport const ValidationRuleTypeCustom: ValidationRuleType = \"custom\";\n","import { File, FileSpreadsheet, FileText } from \"lucide-react\";\nexport const getFileIcon = (fileName: string) => {\n const extensionMatch = fileName.match(/\\.([^.]+)$/);\n const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;\n\n if (!extension) return <File className=\"w-8 h-8 text-gray-500\" />;\n\n switch (extension) {\n case \"pdf\":\n return <File className=\"w-8 h-8 text-red-500\" />;\n case \"doc\":\n case \"docx\":\n return <FileText className=\"w-8 h-8 text-blue-500\" />;\n case \"xls\":\n case \"xlsx\":\n return <FileSpreadsheet className=\"w-8 h-8 text-green-500\" />;\n default:\n return <File className=\"w-8 h-8 text-gray-500\" />;\n }\n};\n\nexport const getFileName = (url: string) => {\n const fileName = decodeURIComponent(url.split(\"/\").pop() ?? \"\");\n\n const cleanFileName = fileName\n .replace(/%28(\\d+)%29/g, \"($1)\") // Replace %28 and %29 with parentheses\n .replace(/[^\\w\\s().-]/g, \"\") // Remove any other special characters\n .replace(/\\s+/g, \"_\") // Replace spaces with underscores\n .replace(/-\\d+(?=\\.pdf)/g, \"\"); // Remove the trailing number before .pdf\n\n return cleanFileName;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACuOO,IAAM,sBAAoC;AAC1C,IAAM,yBAAuC;AAC7C,IAAM,sBAAoC;AAC1C,IAAM,qBAAmC;AACzC,IAAM,sBAAoC;AA4K1C,IAAM,0BAA8C;AACpD,IAAM,gCAAoD;AAC1D,IAAM,6BAAiD;AACvD,IAAM,0BAA8C;AACpD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,+BAAmD;AACzD,IAAM,2BAA+C;;;AC/Z5D,0BAAgD;AAKvB;AAJlB,IAAM,cAAc,CAAC,aAAqB;AAC/C,QAAM,iBAAiB,SAAS,MAAM,YAAY;AAClD,QAAM,YAAY,iBAAiB,eAAe,CAAC,EAAE,YAAY,IAAI;AAErE,MAAI,CAAC,UAAW,QAAO,4CAAC,4BAAK,WAAU,yBAAwB;AAE/D,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO,4CAAC,4BAAK,WAAU,wBAAuB;AAAA,IAChD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,4CAAC,gCAAS,WAAU,yBAAwB;AAAA,IACrD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,4CAAC,uCAAgB,WAAU,0BAAyB;AAAA,IAC7D;AACE,aAAO,4CAAC,4BAAK,WAAU,yBAAwB;AAAA,EACnD;AACF;AAEO,IAAM,cAAc,CAAC,QAAgB;AAC1C,QAAM,WAAW,mBAAmB,IAAI,MAAM,GAAG,EAAE,IAAI,KAAK,EAAE;AAE9D,QAAM,gBAAgB,SACnB,QAAQ,gBAAgB,MAAM,EAC9B,QAAQ,gBAAgB,EAAE,EAC1B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,kBAAkB,EAAE;AAE/B,SAAO;AACT;","names":[]}
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../models/docs.ts","../util/index.tsx"],"sourcesContent":["// Code generated by tygo. DO NOT EDIT.\nimport { Variable } from \"@elqnt/types\";\n\n//////////\n// source: api.go\n\nexport interface DocumentValidationRequest {\n fileName: string;\n templateName: string;\n docBlob: string;\n fields: DocTemplateField[];\n validationRules: DocTemplateValidationRule[];\n}\nexport interface DocumentValidationResponse {\n success: boolean;\n message: string;\n fields: DocTemplateField[];\n}\n\n//////////\n// source: azure-doc-intelligence-models.go\n\nexport interface AzureDocumentIntelligenceResponse {\n status: string;\n createdDateTime: string;\n lastUpdatedDateTime: string;\n analyzeResult: AnalyzeResult;\n}\nexport interface AnalyzeResult {\n apiVersion: string;\n modelId: string;\n stringIndexType: string;\n pages: Page[];\n content: string;\n contentFormat: string;\n Paragraphs: Paragraph[];\n Tables: Tables[];\n}\nexport interface DocumentLayout {\n paragraphs: Paragraph[];\n tables: Tables[];\n pages: PageInfo[];\n}\nexport interface Page {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n words: Word[];\n lines: Line[];\n}\nexport interface Line {\n content: string;\n spans: Span[];\n}\nexport interface Paragraph {\n content: string;\n role: string;\n spans: Span[];\n boundingRegions: BoundingRegion[];\n}\nexport interface BoundingRegion {\n pageNumber: number /* int */;\n polygon: number /* float64 */[];\n}\nexport interface Word {\n content: string;\n boundingBox: number /* float64 */[];\n confidence: number /* float64 */;\n span: Span;\n}\nexport interface Span {\n offset: number /* int */;\n length: number /* int */;\n}\nexport interface Tables {\n rowCount: number /* int */;\n columnCount: number /* int */;\n cells: Cells[];\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n}\nexport interface Cells {\n kind?: string;\n rowIndex: number /* int */;\n columnIndex: number /* int */;\n content: string;\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n elements: string[];\n}\nexport interface Spans {\n offset: number /* int */;\n length: number /* int */;\n}\n\n//////////\n// source: citations-models.go\n\n/**\n * ** our own custom types mainly for the docs ingestion\n */\nexport interface PageInfo {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n}\nexport interface ParagraphContent {\n paragraph_number: number /* int */;\n content: string;\n role: string;\n}\nexport interface ParagraphContentReference {\n page_number: number /* int */;\n paragraph_number: number /* int */;\n markdown_tag: string;\n}\nexport interface DocumentReference {\n URL: string;\n Title: string;\n PageNumber: number /* int */;\n ParagraphReferences: ParagraphReference[];\n}\nexport interface ParagraphReference {\n ParagraphNumber: number /* int */;\n BoundingRegions: BoundingRegion[];\n}\nexport interface DocsIngestionRequest {\n urls: string[];\n mode: string;\n brief: string;\n labels: string[];\n}\nexport interface RawAnalysisRequest {\n fileUrl: string;\n model: 'prebuilt-read' | 'prebuilt-layout';\n fromPage: number /* int */;\n toPage: number /* int */;\n outputMarkdown: boolean;\n}\n/**\n * Citation represents the citation data for a page chunk\n */\nexport interface Citation {\n boundingRegions: BoundingRegion[];\n pageInfo?: PageInfo;\n}\n/**\n * PageChunk represents a chunk of document content with its associated citations\n */\nexport interface PageChunk {\n text: string;\n citations: Citation;\n}\n\n//////////\n// source: doc-analysis-models.go\n\n/**\n * DocAnalysisConfig holds configuration for document analysis processing\n */\nexport interface DocAnalysisConfig {\n maxConcurrentEmbeddings: number /* int */;\n batchStorageSize: number /* int */;\n embeddingTimeout: any /* time.Duration */;\n}\n/**\n * DocumentAnalysisResult represents the result of analyzing a document\n */\nexport interface DocumentAnalysisResult {\n docId: string;\n success: boolean;\n message: string;\n metadata: DocumentMetadata;\n totalChunks: number /* int */;\n successCount: number /* int */;\n errorCount: number /* int */;\n status: string;\n}\nexport interface DocumentAnalysisReference {\n doc_id: string;\n url: string;\n title: string;\n}\n\n//////////\n// source: doc-flow-models.go\n\nexport interface WorkflowDocumentExtractionRequest {\n orgID: string;\n instanceID: string;\n nodeID: string;\n fileUrl: string;\n schema: any /* types.JSONSchema */;\n instructions: string;\n documentType: string;\n subType: string; // the workflow node sub type, determines the document extraction function to use\n companyID: string;\n}\nexport interface WorkflowDocumentExtractionStatus {\n status: string;\n error?: string;\n timestamp: number /* int64 */;\n percentage: number /* int */;\n}\nexport interface WorkflowDocumentExtractionResponse {\n result: { [key: string]: any};\n}\n\n//////////\n// source: jobs-models.go\n\nexport interface DocJob {\n id?: string /* ObjectID */;\n templateId: string;\n templateTitle: string;\n title: string;\n label: string;\n fields: { [key: string]: Variable };\n status: 'started' | 'pending' | 'failed' | 'success';\n progress: number /* int */;\n fileUrls: string[];\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n createdBy: string;\n updatedBy: string;\n}\nexport type DocJobStatus = string;\nexport const DocJobStatusStarted: DocJobStatus = \"started\";\nexport const DocJobStatusInProgress: DocJobStatus = \"in progress\";\nexport const DocJobStatusPending: DocJobStatus = \"pending\";\nexport const DocJobStatusFailed: DocJobStatus = \"failed\";\nexport const DocJobStatusSuccess: DocJobStatus = \"success\";\nexport interface DocExtractionResult {\n id?: string /* ObjectID */;\n jobId: string;\n templateId: string;\n fileUrl: string;\n fields: DocTemplateField[];\n status: DocJobStatus;\n label: string;\n error: string;\n message: string;\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n}\n\n//////////\n// source: poc-models.go\n\nexport interface QuarterlyFinancialStatement {\n companyName: string;\n year: number /* int */;\n quarter: number /* int */;\n totalAssets: number /* float64 */;\n totalEquity: number /* float64 */;\n totalLiabilities: number /* float64 */;\n totalRevenueForPeriod: number /* float64 */;\n totalRevenuePrevPeriod: number /* float64 */;\n totalOperatingIncome: number /* float64 */;\n totalOperatingExpenses: number /* float64 */;\n profitLossForPeriod: number /* float64 */;\n}\nexport interface PassportInfo {\n firstNameEn: string;\n secondNameEn: string;\n thirdNameEn: string;\n fourthNameEn: string;\n lastNameEn: string;\n firstNameAr: string;\n secondNameAr: string;\n thirdNameAr: string;\n fourthNameAr: string;\n lastNameAr: string;\n passportNumber: string;\n nationality: string;\n dateOfBirth: string;\n expiryDate: string;\n passportType: string;\n gender: string;\n}\nexport interface QuotationAnalyzeRequest {\n fileUrls: string[];\n rfqTables: RFQTable[];\n rfqLineItems: RFQLineItem[];\n evaluationCriteria: string;\n}\nexport interface RFQAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface RFQAnalyzeResponse {\n rfqLineItems: RFQLineItem[];\n rfqTables: RFQTable[];\n}\nexport interface RFQTable {\n title: string;\n markdown: string;\n}\nexport interface QuotationAnalyzeResponse {\n quotationLineItems: QuotationLineItem[];\n}\nexport interface RFQLineItem {\n item_name: string;\n description: string;\n quantity: number /* int */;\n}\nexport interface QuotationLineItem {\n item_name: string;\n supplier_name: string;\n description: string;\n quantity: number /* int */;\n item_price: number /* float64 */;\n total_price: number /* float64 */;\n notes: string;\n meet_criteria: boolean;\n}\nexport interface InvoiceAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface InvoiceAnalyzeResponse {\n supplier_name: string;\n customer_name: string;\n invoice_date: string;\n invoice_due_date: string;\n invoice_number: string;\n invoice_total: number /* float64 */;\n invoice_items_tables: MarkdownTable[];\n}\nexport interface MarkdownTable {\n title: string;\n markdown: string;\n}\n\n//////////\n// source: search-models.go\n\n/**\n * DocumentChunk represents a chunk of analyzed document for ClickHouse\n */\nexport interface DocumentChunk {\n doc_id: string;\n title: string;\n doc_url: string;\n chunk_id: string;\n chunk_text: string;\n chunk_index: number /* uint32 */;\n embeddings: number /* float64 */[];\n citations: Citation;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n}\n/**\n * DocumentMetadata represents document-level metadata for ClickHouse\n */\nexport interface DocumentMetadata {\n doc_id: string;\n title: string;\n doc_url: string;\n total_chunks: number /* uint32 */;\n page_count: number /* uint32 */;\n from_page: number /* uint32 */;\n to_page: number /* uint32 */;\n status: string;\n model: string;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n updated_at: string /* RFC3339 */;\n}\n\n//////////\n// source: templates-models.go\n\nexport interface DocTemplate {\n id?: string /* ObjectID */;\n name: string;\n title: string;\n description?: string;\n fields: DocTemplateField[];\n validationRules?: DocTemplateValidationRule[];\n}\nexport interface DocTemplateField {\n name: string;\n title: string;\n description?: string;\n dataType: string;\n required?: boolean;\n options?: string[];\n defaultValue?: string;\n value?: any;\n validationRules?: DocTemplateValidationRule[];\n subFields?: DocTemplateField[];\n issues: string;\n}\nexport interface DocTemplateValidationRule {\n type: ValidationRuleType;\n expectedValue?: any;\n isValid: boolean;\n error?: string;\n}\nexport type ValidationRuleType = string;\nexport const ValidationRuleTypeEqual: ValidationRuleType = \"equal\";\nexport const ValidationRuleTypeGreaterThan: ValidationRuleType = \"greaterThan\";\nexport const ValidationRuleTypeLessThan: ValidationRuleType = \"lessThan\";\nexport const ValidationRuleTypeRegex: ValidationRuleType = \"regex\";\nexport const ValidationRuleTypeRequired: ValidationRuleType = \"required\";\nexport const ValidationRuleTypeNotEmpty: ValidationRuleType = \"notEmpty\";\nexport const ValidationRuleTypeNotEqual: ValidationRuleType = \"notEqual\";\nexport const ValidationRuleTypeNotExpired: ValidationRuleType = \"notExpired\";\nexport const ValidationRuleTypeCustom: ValidationRuleType = \"custom\";\n","import { File, FileSpreadsheet, FileText } from \"lucide-react\";\nexport const getFileIcon = (fileName: string) => {\n const extensionMatch = fileName.match(/\\.([^.]+)$/);\n const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;\n\n if (!extension) return <File className=\"w-8 h-8 text-gray-500\" />;\n\n switch (extension) {\n case \"pdf\":\n return <File className=\"w-8 h-8 text-red-500\" />;\n case \"doc\":\n case \"docx\":\n return <FileText className=\"w-8 h-8 text-blue-500\" />;\n case \"xls\":\n case \"xlsx\":\n return <FileSpreadsheet className=\"w-8 h-8 text-green-500\" />;\n default:\n return <File className=\"w-8 h-8 text-gray-500\" />;\n }\n};\n\nexport const getFileName = (url: string) => {\n const fileName = decodeURIComponent(url.split(\"/\").pop() ?? \"\");\n\n const cleanFileName = fileName\n .replace(/%28(\\d+)%29/g, \"($1)\") // Replace %28 and %29 with parentheses\n .replace(/[^\\w\\s().-]/g, \"\") // Remove any other special characters\n .replace(/\\s+/g, \"_\") // Replace spaces with underscores\n .replace(/-\\d+(?=\\.pdf)/g, \"\"); // Remove the trailing number before .pdf\n\n return cleanFileName;\n};\n"],"mappings":";;;AAuOO,IAAM,sBAAoC;AAC1C,IAAM,yBAAuC;AAC7C,IAAM,sBAAoC;AAC1C,IAAM,qBAAmC;AACzC,IAAM,sBAAoC;AA4K1C,IAAM,0BAA8C;AACpD,IAAM,gCAAoD;AAC1D,IAAM,6BAAiD;AACvD,IAAM,0BAA8C;AACpD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,+BAAmD;AACzD,IAAM,2BAA+C;;;AC/Z5D,SAAS,MAAM,iBAAiB,gBAAgB;AAKvB;AAJlB,IAAM,cAAc,CAAC,aAAqB;AAC/C,QAAM,iBAAiB,SAAS,MAAM,YAAY;AAClD,QAAM,YAAY,iBAAiB,eAAe,CAAC,EAAE,YAAY,IAAI;AAErE,MAAI,CAAC,UAAW,QAAO,oBAAC,QAAK,WAAU,yBAAwB;AAE/D,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO,oBAAC,QAAK,WAAU,wBAAuB;AAAA,IAChD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,oBAAC,YAAS,WAAU,yBAAwB;AAAA,IACrD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,oBAAC,mBAAgB,WAAU,0BAAyB;AAAA,IAC7D;AACE,aAAO,oBAAC,QAAK,WAAU,yBAAwB;AAAA,EACnD;AACF;AAEO,IAAM,cAAc,CAAC,QAAgB;AAC1C,QAAM,WAAW,mBAAmB,IAAI,MAAM,GAAG,EAAE,IAAI,KAAK,EAAE;AAE9D,QAAM,gBAAgB,SACnB,QAAQ,gBAAgB,MAAM,EAC9B,QAAQ,gBAAgB,EAAE,EAC1B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,kBAAkB,EAAE;AAE/B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../models/docs.ts","../util/index.tsx"],"sourcesContent":["// Code generated by tygo. DO NOT EDIT.\nimport { Variable } from \"@elqnt/types\";\n\n//////////\n// source: api.go\n\nexport interface DocumentValidationRequest {\n fileName: string;\n templateName: string;\n docBlob: string;\n fields: DocTemplateField[];\n validationRules: DocTemplateValidationRule[];\n}\nexport interface DocumentValidationResponse {\n success: boolean;\n message: string;\n fields: DocTemplateField[];\n}\n\n//////////\n// source: azure-doc-intelligence-models.go\n\nexport interface AzureDocumentIntelligenceResponse {\n status: string;\n createdDateTime: string;\n lastUpdatedDateTime: string;\n analyzeResult: AnalyzeResult;\n}\nexport interface AnalyzeResult {\n apiVersion: string;\n modelId: string;\n stringIndexType: string;\n pages: Page[];\n content: string;\n contentFormat: string;\n Paragraphs: Paragraph[];\n Tables: Tables[];\n}\nexport interface DocumentLayout {\n paragraphs: Paragraph[];\n tables: Tables[];\n pages: PageInfo[];\n}\nexport interface Page {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n words: Word[];\n lines: Line[];\n}\nexport interface Line {\n content: string;\n spans: Span[];\n}\nexport interface Paragraph {\n content: string;\n role: string;\n spans: Span[];\n boundingRegions: BoundingRegion[];\n}\nexport interface BoundingRegion {\n pageNumber: number /* int */;\n polygon: number /* float64 */[];\n}\nexport interface Word {\n content: string;\n boundingBox: number /* float64 */[];\n confidence: number /* float64 */;\n span: Span;\n}\nexport interface Span {\n offset: number /* int */;\n length: number /* int */;\n}\nexport interface Tables {\n rowCount: number /* int */;\n columnCount: number /* int */;\n cells: Cells[];\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n}\nexport interface Cells {\n kind?: string;\n rowIndex: number /* int */;\n columnIndex: number /* int */;\n content: string;\n boundingRegions: BoundingRegion[];\n spans: Spans[];\n elements: string[];\n}\nexport interface Spans {\n offset: number /* int */;\n length: number /* int */;\n}\n\n//////////\n// source: citations-models.go\n\n/**\n * ** our own custom types mainly for the docs ingestion\n */\nexport interface PageInfo {\n pageNumber: number /* int */;\n angle: number /* float64 */;\n width: number /* float64 */;\n height: number /* float64 */;\n unit: string;\n}\nexport interface ParagraphContent {\n paragraph_number: number /* int */;\n content: string;\n role: string;\n}\nexport interface ParagraphContentReference {\n page_number: number /* int */;\n paragraph_number: number /* int */;\n markdown_tag: string;\n}\nexport interface DocumentReference {\n URL: string;\n Title: string;\n PageNumber: number /* int */;\n ParagraphReferences: ParagraphReference[];\n}\nexport interface ParagraphReference {\n ParagraphNumber: number /* int */;\n BoundingRegions: BoundingRegion[];\n}\nexport interface DocsIngestionRequest {\n urls: string[];\n mode: string;\n brief: string;\n labels: string[];\n}\nexport interface RawAnalysisRequest {\n fileUrl: string;\n model: 'prebuilt-read' | 'prebuilt-layout';\n fromPage: number /* int */;\n toPage: number /* int */;\n outputMarkdown: boolean;\n}\n/**\n * Citation represents the citation data for a page chunk\n */\nexport interface Citation {\n boundingRegions: BoundingRegion[];\n pageInfo?: PageInfo;\n}\n/**\n * PageChunk represents a chunk of document content with its associated citations\n */\nexport interface PageChunk {\n text: string;\n citations: Citation;\n}\n\n//////////\n// source: doc-analysis-models.go\n\n/**\n * DocAnalysisConfig holds configuration for document analysis processing\n */\nexport interface DocAnalysisConfig {\n maxConcurrentEmbeddings: number /* int */;\n batchStorageSize: number /* int */;\n embeddingTimeout: any /* time.Duration */;\n}\n/**\n * DocumentAnalysisResult represents the result of analyzing a document\n */\nexport interface DocumentAnalysisResult {\n docId: string;\n success: boolean;\n message: string;\n metadata: DocumentMetadata;\n totalChunks: number /* int */;\n successCount: number /* int */;\n errorCount: number /* int */;\n status: string;\n}\nexport interface DocumentAnalysisReference {\n doc_id: string;\n url: string;\n title: string;\n}\n\n//////////\n// source: doc-flow-models.go\n\nexport interface WorkflowDocumentExtractionRequest {\n orgID: string;\n instanceID: string;\n nodeID: string;\n fileUrl: string;\n schema: any /* types.JSONSchema */;\n instructions: string;\n documentType: string;\n subType: string; // the workflow node sub type, determines the document extraction function to use\n companyID: string;\n}\nexport interface WorkflowDocumentExtractionStatus {\n status: string;\n error?: string;\n timestamp: number /* int64 */;\n percentage: number /* int */;\n}\nexport interface WorkflowDocumentExtractionResponse {\n result: { [key: string]: any};\n}\n\n//////////\n// source: jobs-models.go\n\nexport interface DocJob {\n id?: string /* ObjectID */;\n templateId: string;\n templateTitle: string;\n title: string;\n label: string;\n fields: { [key: string]: Variable };\n status: 'started' | 'pending' | 'failed' | 'success';\n progress: number /* int */;\n fileUrls: string[];\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n createdBy: string;\n updatedBy: string;\n}\nexport type DocJobStatus = string;\nexport const DocJobStatusStarted: DocJobStatus = \"started\";\nexport const DocJobStatusInProgress: DocJobStatus = \"in progress\";\nexport const DocJobStatusPending: DocJobStatus = \"pending\";\nexport const DocJobStatusFailed: DocJobStatus = \"failed\";\nexport const DocJobStatusSuccess: DocJobStatus = \"success\";\nexport interface DocExtractionResult {\n id?: string /* ObjectID */;\n jobId: string;\n templateId: string;\n fileUrl: string;\n fields: DocTemplateField[];\n status: DocJobStatus;\n label: string;\n error: string;\n message: string;\n createdAt: number /* int64 */;\n updatedAt: number /* int64 */;\n}\n\n//////////\n// source: poc-models.go\n\nexport interface QuarterlyFinancialStatement {\n companyName: string;\n year: number /* int */;\n quarter: number /* int */;\n totalAssets: number /* float64 */;\n totalEquity: number /* float64 */;\n totalLiabilities: number /* float64 */;\n totalRevenueForPeriod: number /* float64 */;\n totalRevenuePrevPeriod: number /* float64 */;\n totalOperatingIncome: number /* float64 */;\n totalOperatingExpenses: number /* float64 */;\n profitLossForPeriod: number /* float64 */;\n}\nexport interface PassportInfo {\n firstNameEn: string;\n secondNameEn: string;\n thirdNameEn: string;\n fourthNameEn: string;\n lastNameEn: string;\n firstNameAr: string;\n secondNameAr: string;\n thirdNameAr: string;\n fourthNameAr: string;\n lastNameAr: string;\n passportNumber: string;\n nationality: string;\n dateOfBirth: string;\n expiryDate: string;\n passportType: string;\n gender: string;\n}\nexport interface QuotationAnalyzeRequest {\n fileUrls: string[];\n rfqTables: RFQTable[];\n rfqLineItems: RFQLineItem[];\n evaluationCriteria: string;\n}\nexport interface RFQAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface RFQAnalyzeResponse {\n rfqLineItems: RFQLineItem[];\n rfqTables: RFQTable[];\n}\nexport interface RFQTable {\n title: string;\n markdown: string;\n}\nexport interface QuotationAnalyzeResponse {\n quotationLineItems: QuotationLineItem[];\n}\nexport interface RFQLineItem {\n item_name: string;\n description: string;\n quantity: number /* int */;\n}\nexport interface QuotationLineItem {\n item_name: string;\n supplier_name: string;\n description: string;\n quantity: number /* int */;\n item_price: number /* float64 */;\n total_price: number /* float64 */;\n notes: string;\n meet_criteria: boolean;\n}\nexport interface InvoiceAnalyzeRequest {\n fileUrl: string;\n instructions: string;\n}\nexport interface InvoiceAnalyzeResponse {\n supplier_name: string;\n customer_name: string;\n invoice_date: string;\n invoice_due_date: string;\n invoice_number: string;\n invoice_total: number /* float64 */;\n invoice_items_tables: MarkdownTable[];\n}\nexport interface MarkdownTable {\n title: string;\n markdown: string;\n}\n\n//////////\n// source: search-models.go\n\n/**\n * DocumentChunk represents a chunk of analyzed document for ClickHouse\n */\nexport interface DocumentChunk {\n doc_id: string;\n title: string;\n doc_url: string;\n chunk_id: string;\n chunk_text: string;\n chunk_index: number /* uint32 */;\n embeddings: number /* float64 */[];\n citations: Citation;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n}\n/**\n * DocumentMetadata represents document-level metadata for ClickHouse\n */\nexport interface DocumentMetadata {\n doc_id: string;\n title: string;\n doc_url: string;\n total_chunks: number /* uint32 */;\n page_count: number /* uint32 */;\n from_page: number /* uint32 */;\n to_page: number /* uint32 */;\n status: string;\n model: string;\n owner_email: string;\n visibility_level: string;\n created_at: string /* RFC3339 */;\n updated_at: string /* RFC3339 */;\n}\n\n//////////\n// source: templates-models.go\n\nexport interface DocTemplate {\n id?: string /* ObjectID */;\n name: string;\n title: string;\n description?: string;\n fields: DocTemplateField[];\n validationRules?: DocTemplateValidationRule[];\n}\nexport interface DocTemplateField {\n name: string;\n title: string;\n description?: string;\n dataType: string;\n required?: boolean;\n options?: string[];\n defaultValue?: string;\n value?: any;\n validationRules?: DocTemplateValidationRule[];\n subFields?: DocTemplateField[];\n issues: string;\n}\nexport interface DocTemplateValidationRule {\n type: ValidationRuleType;\n expectedValue?: any;\n isValid: boolean;\n error?: string;\n}\nexport type ValidationRuleType = string;\nexport const ValidationRuleTypeEqual: ValidationRuleType = \"equal\";\nexport const ValidationRuleTypeGreaterThan: ValidationRuleType = \"greaterThan\";\nexport const ValidationRuleTypeLessThan: ValidationRuleType = \"lessThan\";\nexport const ValidationRuleTypeRegex: ValidationRuleType = \"regex\";\nexport const ValidationRuleTypeRequired: ValidationRuleType = \"required\";\nexport const ValidationRuleTypeNotEmpty: ValidationRuleType = \"notEmpty\";\nexport const ValidationRuleTypeNotEqual: ValidationRuleType = \"notEqual\";\nexport const ValidationRuleTypeNotExpired: ValidationRuleType = \"notExpired\";\nexport const ValidationRuleTypeCustom: ValidationRuleType = \"custom\";\n","import { File, FileSpreadsheet, FileText } from \"lucide-react\";\nexport const getFileIcon = (fileName: string) => {\n const extensionMatch = fileName.match(/\\.([^.]+)$/);\n const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;\n\n if (!extension) return <File className=\"w-8 h-8 text-gray-500\" />;\n\n switch (extension) {\n case \"pdf\":\n return <File className=\"w-8 h-8 text-red-500\" />;\n case \"doc\":\n case \"docx\":\n return <FileText className=\"w-8 h-8 text-blue-500\" />;\n case \"xls\":\n case \"xlsx\":\n return <FileSpreadsheet className=\"w-8 h-8 text-green-500\" />;\n default:\n return <File className=\"w-8 h-8 text-gray-500\" />;\n }\n};\n\nexport const getFileName = (url: string) => {\n const fileName = decodeURIComponent(url.split(\"/\").pop() ?? \"\");\n\n const cleanFileName = fileName\n .replace(/%28(\\d+)%29/g, \"($1)\") // Replace %28 and %29 with parentheses\n .replace(/[^\\w\\s().-]/g, \"\") // Remove any other special characters\n .replace(/\\s+/g, \"_\") // Replace spaces with underscores\n .replace(/-\\d+(?=\\.pdf)/g, \"\"); // Remove the trailing number before .pdf\n\n return cleanFileName;\n};\n"],"mappings":";AAuOO,IAAM,sBAAoC;AAC1C,IAAM,yBAAuC;AAC7C,IAAM,sBAAoC;AAC1C,IAAM,qBAAmC;AACzC,IAAM,sBAAoC;AA4K1C,IAAM,0BAA8C;AACpD,IAAM,gCAAoD;AAC1D,IAAM,6BAAiD;AACvD,IAAM,0BAA8C;AACpD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,6BAAiD;AACvD,IAAM,+BAAmD;AACzD,IAAM,2BAA+C;;;AC/Z5D,SAAS,MAAM,iBAAiB,gBAAgB;AAKvB;AAJlB,IAAM,cAAc,CAAC,aAAqB;AAC/C,QAAM,iBAAiB,SAAS,MAAM,YAAY;AAClD,QAAM,YAAY,iBAAiB,eAAe,CAAC,EAAE,YAAY,IAAI;AAErE,MAAI,CAAC,UAAW,QAAO,oBAAC,QAAK,WAAU,yBAAwB;AAE/D,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO,oBAAC,QAAK,WAAU,wBAAuB;AAAA,IAChD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,oBAAC,YAAS,WAAU,yBAAwB;AAAA,IACrD,KAAK;AAAA,IACL,KAAK;AACH,aAAO,oBAAC,mBAAgB,WAAU,0BAAyB;AAAA,IAC7D;AACE,aAAO,oBAAC,QAAK,WAAU,yBAAwB;AAAA,EACnD;AACF;AAEO,IAAM,cAAc,CAAC,QAAgB;AAC1C,QAAM,WAAW,mBAAmB,IAAI,MAAM,GAAG,EAAE,IAAI,KAAK,EAAE;AAE9D,QAAM,gBAAgB,SACnB,QAAQ,gBAAgB,MAAM,EAC9B,QAAQ,gBAAgB,EAAE,EAC1B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,kBAAkB,EAAE;AAE/B,SAAO;AACT;","names":[]}
|