@doclo/core 0.2.2 → 0.2.3

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ProviderVendor, A as AccessMethod } from './validation-BQO54qAY.js';
2
- export { G as AggregatedMetrics, B as BBox, r as CategorizeNodeConfig, t as ChunkMetadata, v as ChunkNodeConfig, u as ChunkOutput, n as CitationConfig, k as CitationSourceType, w as CombineNodeConfig, U as CompatibilityRule, C as ConsensusConfig, e as ConsensusMetadata, d as ConsensusRunResult, D as DocumentIR, b as DocumentIRExtras, y as EnhancedExtractionSchema, s as ExtractInputMode, E as ExtractNodeConfig, a0 as ExtractedImage, m as FieldCitation, F as FieldVotingDetails, H as FlowContext, a8 as FlowExecutionError, h as FlowInput, i as FlowInputValidation, j as FlowResult, a4 as FlowStepLocation, a9 as FlowValidationError, I as IRLine, a as IRPage, X as JSONSchemaNode, c as LLMJsonProvider, L as LLMProvider, _ as LanguageOptions, l as LineCitation, g as MaybeWithConsensusMetadata, M as MultimodalInput, aa as NODE_COMPATIBILITY_MATRIX, J as NodeCtx, Q as NodeDef, K as NodeTypeInfo, T as NodeTypeName, N as NormalizedBBox, O as OCRProvider, a1 as OCRProviderOptions, x as OutputNodeConfig, o as OutputWithCitations, f as OutputWithConsensus, Z as PageRangeOptions, p as ParseNodeConfig, Y as ProcessingMode, a3 as ProviderCitation, am as ProviderIdentity, aj as RESERVED_VARIABLES, R as ReasoningConfig, $ as SegmentationResult, S as SplitDocument, q as SplitNodeConfig, z as StepMetric, V as VLMProvider, a2 as VLMProviderOptions, W as ValidationResult, a5 as aggregateMetrics, ah as canStartForEachItemFlow, aq as createIdentity, al as extractErrorMessage, ad as getCompatibleTargets, ac as getNodeTypeInfo, ab as getNodeTypeName, ae as getSuggestedConnections, ag as getValidForEachStarters, ap as isLocalEndpoint, a6 as node, ao as parseProviderString, ak as protectReservedVariables, a7 as runPipeline, an as toProviderString, ai as validateJson, af as validateNodeConnection } from './validation-BQO54qAY.js';
1
+ import { P as ProviderVendor, A as AccessMethod } from './validation-C_RN-Xqr.js';
2
+ export { G as AggregatedMetrics, B as BBox, r as CategorizeNodeConfig, t as ChunkMetadata, v as ChunkNodeConfig, u as ChunkOutput, n as CitationConfig, k as CitationSourceType, w as CombineNodeConfig, W as CompatibilityRule, C as ConsensusConfig, e as ConsensusMetadata, d as ConsensusRunResult, D as DocumentIR, b as DocumentIRExtras, y as EnhancedExtractionSchema, s as ExtractInputMode, E as ExtractNodeConfig, a1 as ExtractedImage, m as FieldCitation, F as FieldVotingDetails, H as FlowContext, a9 as FlowExecutionError, h as FlowInput, i as FlowInputValidation, j as FlowResult, a5 as FlowStepLocation, aa as FlowValidationError, I as IRLine, a as IRPage, Y as JSONSchemaNode, c as LLMJsonProvider, L as LLMProvider, $ as LanguageOptions, l as LineCitation, g as MaybeWithConsensusMetadata, M as MultimodalInput, ab as NODE_COMPATIBILITY_MATRIX, J as NodeCtx, Q as NodeDef, K as NodeTypeInfo, U as NodeTypeName, N as NormalizedBBox, O as OCRProvider, a2 as OCRProviderOptions, x as OutputNodeConfig, o as OutputWithCitations, f as OutputWithConsensus, _ as PageRangeOptions, p as ParseNodeConfig, Z as ProcessingMode, a4 as ProviderCitation, an as ProviderIdentity, ak as RESERVED_VARIABLES, R as ReasoningConfig, a0 as SegmentationResult, S as SplitDocument, q as SplitNodeConfig, z as StepMetric, T as TextResponse, V as VLMProvider, a3 as VLMProviderOptions, X as ValidationResult, a6 as aggregateMetrics, ai as canStartForEachItemFlow, ar as createIdentity, am as extractErrorMessage, ae as getCompatibleTargets, ad as getNodeTypeInfo, ac as getNodeTypeName, af as getSuggestedConnections, ah as getValidForEachStarters, aq as isLocalEndpoint, a7 as node, ap as parseProviderString, al as protectReservedVariables, a8 as runPipeline, ao as toProviderString, aj as validateJson, ag as validateNodeConnection } from './validation-C_RN-Xqr.js';
3
3
  export { getDocumentPageCount, getPDFPageCount, getPageCountMetadata, getTotalPageCount, splitPDFIntoChunks } from './pdf-utils.js';
4
4
 
5
5
  /**
package/dist/index.js CHANGED
@@ -1204,22 +1204,21 @@ function validateFlowInputFormat(input, acceptedFormats) {
1204
1204
 
1205
1205
  // src/pdf-utils.ts
1206
1206
  import { PDFDocument } from "pdf-lib";
1207
- async function getPDFPageCount(dataUrl) {
1208
- const base64Match = dataUrl.match(/^data:application\/pdf;base64,(.+)$/);
1209
- if (!base64Match) {
1210
- throw new Error("Invalid PDF data URL format. Expected: data:application/pdf;base64,{base64data}");
1207
+ function extractPDFBase64(input) {
1208
+ const dataUrlMatch = input.match(/^data:application\/pdf;base64,(.+)$/);
1209
+ if (dataUrlMatch) {
1210
+ return dataUrlMatch[1];
1211
1211
  }
1212
- const base64Data = base64Match[1];
1212
+ return input;
1213
+ }
1214
+ async function getPDFPageCount(input) {
1215
+ const base64Data = extractPDFBase64(input);
1213
1216
  const pdfBytes = base64ToArrayBuffer(base64Data);
1214
1217
  const pdfDoc = await PDFDocument.load(pdfBytes);
1215
1218
  return pdfDoc.getPageCount();
1216
1219
  }
1217
- async function splitPDFIntoChunks(dataUrl, pageRanges) {
1218
- const base64Match = dataUrl.match(/^data:application\/pdf;base64,(.+)$/);
1219
- if (!base64Match) {
1220
- throw new Error("Invalid PDF data URL format. Expected: data:application/pdf;base64,{base64data}");
1221
- }
1222
- const base64Data = base64Match[1];
1220
+ async function splitPDFIntoChunks(input, pageRanges) {
1221
+ const base64Data = extractPDFBase64(input);
1223
1222
  const pdfBytes = base64ToArrayBuffer(base64Data);
1224
1223
  const pdfDoc = await PDFDocument.load(pdfBytes);
1225
1224
  const totalPages = pdfDoc.getPageCount();