@doclo/core 0.2.1 → 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 +2 -2
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/validation-utils.d.ts +1 -1
- package/dist/internal/validation-utils.js.map +1 -1
- package/dist/pdf-utils.d.ts +12 -7
- package/dist/pdf-utils.js +10 -11
- package/dist/pdf-utils.js.map +1 -1
- package/dist/{validation-B8GRTtww.d.ts → validation-C_RN-Xqr.d.ts} +63 -12
- package/dist/validation.d.ts +1 -1
- package/dist/validation.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProviderVendor, A as AccessMethod } from './validation-
|
|
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,
|
|
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
|
-
|
|
1208
|
-
const
|
|
1209
|
-
if (
|
|
1210
|
-
|
|
1207
|
+
function extractPDFBase64(input) {
|
|
1208
|
+
const dataUrlMatch = input.match(/^data:application\/pdf;base64,(.+)$/);
|
|
1209
|
+
if (dataUrlMatch) {
|
|
1210
|
+
return dataUrlMatch[1];
|
|
1211
1211
|
}
|
|
1212
|
-
|
|
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(
|
|
1218
|
-
const
|
|
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();
|