@kreuzberg/node 4.4.5 → 4.5.0
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/README.md +16 -15
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +38 -1
- package/dist/types.d.ts +38 -1
- package/dist/types.js.map +1 -1
- package/index.d.ts +121 -10
- package/index.js +52 -52
- package/package.json +11 -11
package/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare class JsWorkerPool {
|
|
|
16
16
|
* * `data_list` - Array of buffers to extract
|
|
17
17
|
* * `mime_types` - Array of MIME types (must match data_list length)
|
|
18
18
|
* * `config` - Optional extraction configuration
|
|
19
|
+
* * `file_configs` - Optional per-item extraction configs (must match data_list length if provided)
|
|
19
20
|
*
|
|
20
21
|
* # Returns
|
|
21
22
|
*
|
|
@@ -40,7 +41,7 @@ export declare class JsWorkerPool {
|
|
|
40
41
|
* );
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
|
-
export declare function batchExtractBytes(dataList: Array<Buffer>, mimeTypes: Array<string>, config?: JsExtractionConfig | undefined | null): Promise<Array<JsExtractionResult>>
|
|
44
|
+
export declare function batchExtractBytes(dataList: Array<Buffer>, mimeTypes: Array<string>, config?: JsExtractionConfig | undefined | null, fileConfigs?: Array<JsFileExtractionConfig | undefined | null> | undefined | null): Promise<Array<JsExtractionResult>>
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* Batch extract from multiple byte arrays (synchronous).
|
|
@@ -53,6 +54,7 @@ export declare function batchExtractBytes(dataList: Array<Buffer>, mimeTypes: Ar
|
|
|
53
54
|
* * `data_list` - Array of buffers to extract
|
|
54
55
|
* * `mime_types` - Array of MIME types (must match data_list length)
|
|
55
56
|
* * `config` - Optional extraction configuration
|
|
57
|
+
* * `file_configs` - Optional per-item extraction configs (must match data_list length if provided)
|
|
56
58
|
*
|
|
57
59
|
* # Returns
|
|
58
60
|
*
|
|
@@ -72,7 +74,7 @@ export declare function batchExtractBytes(dataList: Array<Buffer>, mimeTypes: Ar
|
|
|
72
74
|
* const results = batchExtractBytesSync(buffers, mimeTypes, null);
|
|
73
75
|
* ```
|
|
74
76
|
*/
|
|
75
|
-
export declare function batchExtractBytesSync(dataList: Array<Buffer>, mimeTypes: Array<string>, config?: JsExtractionConfig | undefined | null): Array<JsExtractionResult>
|
|
77
|
+
export declare function batchExtractBytesSync(dataList: Array<Buffer>, mimeTypes: Array<string>, config?: JsExtractionConfig | undefined | null, fileConfigs?: Array<JsFileExtractionConfig | undefined | null> | undefined | null): Array<JsExtractionResult>
|
|
76
78
|
|
|
77
79
|
/**
|
|
78
80
|
* Batch extract from multiple files (asynchronous).
|
|
@@ -84,6 +86,7 @@ export declare function batchExtractBytesSync(dataList: Array<Buffer>, mimeTypes
|
|
|
84
86
|
*
|
|
85
87
|
* * `paths` - Array of file paths to extract
|
|
86
88
|
* * `config` - Optional extraction configuration (applied to all files)
|
|
89
|
+
* * `file_configs` - Optional per-file extraction configs (must match paths length if provided)
|
|
87
90
|
*
|
|
88
91
|
* # Returns
|
|
89
92
|
*
|
|
@@ -99,7 +102,7 @@ export declare function batchExtractBytesSync(dataList: Array<Buffer>, mimeTypes
|
|
|
99
102
|
* console.log(`Processed ${results.length} files`);
|
|
100
103
|
* ```
|
|
101
104
|
*/
|
|
102
|
-
export declare function batchExtractFiles(paths: Array<string>, config?: JsExtractionConfig | undefined | null): Promise<Array<JsExtractionResult>>
|
|
105
|
+
export declare function batchExtractFiles(paths: Array<string>, config?: JsExtractionConfig | undefined | null, fileConfigs?: Array<JsFileExtractionConfig | undefined | null> | undefined | null): Promise<Array<JsExtractionResult>>
|
|
103
106
|
|
|
104
107
|
/**
|
|
105
108
|
* Extract multiple files using worker threads from the pool.
|
|
@@ -135,7 +138,7 @@ export declare function batchExtractFiles(paths: Array<string>, config?: JsExtra
|
|
|
135
138
|
*/
|
|
136
139
|
export declare function batchExtractFilesInWorker(pool: JsWorkerPool, filePaths: Array<string>, config?: JsExtractionConfig | undefined | null): Promise<Array<JsExtractionResult>>
|
|
137
140
|
|
|
138
|
-
export declare function batchExtractFilesSync(paths: Array<string>, config?: JsExtractionConfig | undefined | null): Array<JsExtractionResult>
|
|
141
|
+
export declare function batchExtractFilesSync(paths: Array<string>, config?: JsExtractionConfig | undefined | null, fileConfigs?: Array<JsFileExtractionConfig | undefined | null> | undefined | null): Array<JsExtractionResult>
|
|
139
142
|
|
|
140
143
|
export declare function classifyError(errorMessage: string): ErrorClassification
|
|
141
144
|
|
|
@@ -575,7 +578,7 @@ export declare function extractFile(filePath: string, mimeType?: string | undefi
|
|
|
575
578
|
* console.log(result.content);
|
|
576
579
|
* ```
|
|
577
580
|
*/
|
|
578
|
-
export declare function extractFileInWorker(pool: JsWorkerPool, filePath: string,
|
|
581
|
+
export declare function extractFileInWorker(pool: JsWorkerPool, filePath: string, mimeType?: string | undefined | null, config?: JsExtractionConfig | undefined | null): Promise<JsExtractionResult>
|
|
579
582
|
|
|
580
583
|
export declare function extractFileSync(filePath: string, mimeType?: string | undefined | null, config?: JsExtractionConfig | undefined | null): JsExtractionResult
|
|
581
584
|
|
|
@@ -908,6 +911,19 @@ export declare function getValidTokenReductionLevels(): Array<string>
|
|
|
908
911
|
*/
|
|
909
912
|
export declare function getWorkerPoolStats(pool: JsWorkerPool): WorkerPoolStats
|
|
910
913
|
|
|
914
|
+
/**
|
|
915
|
+
* Hardware acceleration configuration for ONNX Runtime inference.
|
|
916
|
+
*
|
|
917
|
+
* Controls which execution provider (CPU, CoreML, CUDA, TensorRT) is used
|
|
918
|
+
* for layout detection and embedding generation.
|
|
919
|
+
*/
|
|
920
|
+
export interface JsAccelerationConfig {
|
|
921
|
+
/** Execution provider: "auto" (default), "cpu", "coreml", "cuda", "tensorrt". */
|
|
922
|
+
provider?: string
|
|
923
|
+
/** GPU device ID for CUDA/TensorRT. Ignored for CPU/CoreML/Auto. */
|
|
924
|
+
deviceId?: number
|
|
925
|
+
}
|
|
926
|
+
|
|
911
927
|
export interface JsBoundingBox {
|
|
912
928
|
x0: number
|
|
913
929
|
y0: number
|
|
@@ -928,6 +944,14 @@ export interface JsChunkingConfig {
|
|
|
928
944
|
embedding?: JsEmbeddingConfig
|
|
929
945
|
/** Optional preset name for chunking parameters */
|
|
930
946
|
preset?: string
|
|
947
|
+
/** Chunker type: "text" (default) or "markdown" */
|
|
948
|
+
chunkerType?: string
|
|
949
|
+
/** Sizing type: "characters" (default) or "tokenizer" */
|
|
950
|
+
sizingType?: string
|
|
951
|
+
/** HuggingFace model ID for tokenizer sizing (e.g., "Xenova/gpt-4o") */
|
|
952
|
+
sizingModel?: string
|
|
953
|
+
/** Optional cache directory for tokenizer files */
|
|
954
|
+
sizingCacheDir?: string
|
|
931
955
|
}
|
|
932
956
|
|
|
933
957
|
export interface JsChunkMetadata {
|
|
@@ -938,6 +962,13 @@ export interface JsChunkMetadata {
|
|
|
938
962
|
totalChunks: number
|
|
939
963
|
firstPage?: number
|
|
940
964
|
lastPage?: number
|
|
965
|
+
headingContext?: JsHeadingContext
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
/** Concurrency configuration for Node.js bindings. */
|
|
969
|
+
export interface JsConcurrencyConfig {
|
|
970
|
+
/** Maximum number of threads for all internal thread pools. */
|
|
971
|
+
maxThreads?: number
|
|
941
972
|
}
|
|
942
973
|
|
|
943
974
|
export interface JsElement {
|
|
@@ -955,6 +986,16 @@ export interface JsElementMetadata {
|
|
|
955
986
|
additional?: Record<string, string> | undefined
|
|
956
987
|
}
|
|
957
988
|
|
|
989
|
+
/** Email extraction configuration for Node.js bindings. */
|
|
990
|
+
export interface JsEmailConfig {
|
|
991
|
+
/**
|
|
992
|
+
* Windows codepage number for MSG files with no codepage property.
|
|
993
|
+
* Common values: 1250 (Central European), 1251 (Cyrillic), 1252 (Western, default),
|
|
994
|
+
* 1253 (Greek), 1254 (Turkish), 932 (Japanese), 936 (Simplified Chinese).
|
|
995
|
+
*/
|
|
996
|
+
msgFallbackCodepage?: number
|
|
997
|
+
}
|
|
998
|
+
|
|
958
999
|
/** Embedding generation configuration for Node.js bindings. */
|
|
959
1000
|
export interface JsEmbeddingConfig {
|
|
960
1001
|
/** Embedding model configuration */
|
|
@@ -974,15 +1015,14 @@ export interface JsEmbeddingConfig {
|
|
|
974
1015
|
*
|
|
975
1016
|
* This struct represents different embedding model sources:
|
|
976
1017
|
* - `preset`: Use a named preset (e.g., "balanced", "fast", "quality", "multilingual")
|
|
977
|
-
* - `
|
|
978
|
-
* - `custom`: Use a custom ONNX model
|
|
1018
|
+
* - `custom`: Use a custom ONNX model from HuggingFace
|
|
979
1019
|
*/
|
|
980
1020
|
export interface JsEmbeddingModelType {
|
|
981
|
-
/** Type of model: "preset"
|
|
1021
|
+
/** Type of model: "preset" or "custom" */
|
|
982
1022
|
modelType: string
|
|
983
|
-
/** For preset: preset name; for
|
|
1023
|
+
/** For preset: preset name; for custom: HuggingFace model ID */
|
|
984
1024
|
value: string
|
|
985
|
-
/** Number of dimensions (only for
|
|
1025
|
+
/** Number of dimensions (only for custom) */
|
|
986
1026
|
dimensions?: number
|
|
987
1027
|
}
|
|
988
1028
|
|
|
@@ -1029,6 +1069,16 @@ export interface JsExtractionConfig {
|
|
|
1029
1069
|
resultFormat?: string
|
|
1030
1070
|
/** Include document structure in extraction result */
|
|
1031
1071
|
includeDocumentStructure?: boolean
|
|
1072
|
+
/** Layout detection configuration (None = layout detection disabled) */
|
|
1073
|
+
layout?: JsLayoutDetectionConfig
|
|
1074
|
+
/** Email extraction configuration */
|
|
1075
|
+
email?: JsEmailConfig
|
|
1076
|
+
/** Hardware acceleration configuration for ONNX Runtime inference */
|
|
1077
|
+
acceleration?: JsAccelerationConfig
|
|
1078
|
+
/** Security limits to guard against DoS attacks */
|
|
1079
|
+
securityLimits?: JsSecurityLimits
|
|
1080
|
+
/** Concurrency configuration for thread pool control */
|
|
1081
|
+
concurrency?: JsConcurrencyConfig
|
|
1032
1082
|
}
|
|
1033
1083
|
|
|
1034
1084
|
export interface JsExtractionResult {
|
|
@@ -1050,6 +1100,38 @@ export interface JsExtractionResult {
|
|
|
1050
1100
|
annotations?: Array<JsPdfAnnotation>
|
|
1051
1101
|
}
|
|
1052
1102
|
|
|
1103
|
+
export interface JsFileExtractionConfig {
|
|
1104
|
+
enableQualityProcessing?: boolean
|
|
1105
|
+
ocr?: JsOcrConfig
|
|
1106
|
+
forceOcr?: boolean
|
|
1107
|
+
chunking?: JsChunkingConfig
|
|
1108
|
+
images?: JsImageExtractionConfig
|
|
1109
|
+
pdfOptions?: JsPdfConfig
|
|
1110
|
+
tokenReduction?: JsTokenReductionConfig
|
|
1111
|
+
languageDetection?: JsLanguageDetectionConfig
|
|
1112
|
+
postprocessor?: JsPostProcessorConfig
|
|
1113
|
+
keywords?: JsKeywordConfig
|
|
1114
|
+
htmlOptions?: JsHtmlOptions
|
|
1115
|
+
pages?: JsPageConfig
|
|
1116
|
+
/** Output text format: "plain" | "markdown" | "djot" | "html" */
|
|
1117
|
+
outputFormat?: string
|
|
1118
|
+
/** Result structure format: "unified" | "element_based" */
|
|
1119
|
+
resultFormat?: string
|
|
1120
|
+
/** Include document structure in extraction result */
|
|
1121
|
+
includeDocumentStructure?: boolean
|
|
1122
|
+
/** Layout detection configuration (None = layout detection disabled) */
|
|
1123
|
+
layout?: JsLayoutDetectionConfig
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
export interface JsHeadingContext {
|
|
1127
|
+
headings: Array<JsHeadingLevel>
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
export interface JsHeadingLevel {
|
|
1131
|
+
level: number
|
|
1132
|
+
text: string
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1053
1135
|
export interface JsHierarchicalBlock {
|
|
1054
1136
|
text: string
|
|
1055
1137
|
fontSize: number
|
|
@@ -1131,6 +1213,12 @@ export interface JsLanguageDetectionConfig {
|
|
|
1131
1213
|
detectMultiple?: boolean
|
|
1132
1214
|
}
|
|
1133
1215
|
|
|
1216
|
+
export interface JsLayoutDetectionConfig {
|
|
1217
|
+
preset?: string
|
|
1218
|
+
confidenceThreshold?: number
|
|
1219
|
+
applyHeuristics?: boolean
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1134
1222
|
export interface JsOcrConfig {
|
|
1135
1223
|
backend: string
|
|
1136
1224
|
language?: string
|
|
@@ -1194,6 +1282,7 @@ export interface JsPdfConfig {
|
|
|
1194
1282
|
extractAnnotations?: boolean
|
|
1195
1283
|
topMarginFraction?: number
|
|
1196
1284
|
bottomMarginFraction?: number
|
|
1285
|
+
allowSingleColumnTables?: boolean
|
|
1197
1286
|
}
|
|
1198
1287
|
|
|
1199
1288
|
export interface JsPostProcessorConfig {
|
|
@@ -1212,6 +1301,28 @@ export interface JsRakeParams {
|
|
|
1212
1301
|
maxWordsPerPhrase?: number
|
|
1213
1302
|
}
|
|
1214
1303
|
|
|
1304
|
+
/** Security limits to protect against DoS attacks (ZIP bombs, XML entity expansion, etc.). */
|
|
1305
|
+
export interface JsSecurityLimits {
|
|
1306
|
+
/** Maximum uncompressed size for archives in bytes. */
|
|
1307
|
+
maxArchiveSize?: number
|
|
1308
|
+
/** Maximum compression ratio before flagging as potential bomb. */
|
|
1309
|
+
maxCompressionRatio?: number
|
|
1310
|
+
/** Maximum number of files in an archive. */
|
|
1311
|
+
maxFilesInArchive?: number
|
|
1312
|
+
/** Maximum nesting depth for structures. */
|
|
1313
|
+
maxNestingDepth?: number
|
|
1314
|
+
/** Maximum entity/string length. */
|
|
1315
|
+
maxEntityLength?: number
|
|
1316
|
+
/** Maximum content size in bytes. */
|
|
1317
|
+
maxContentSize?: number
|
|
1318
|
+
/** Maximum iterations per operation. */
|
|
1319
|
+
maxIterations?: number
|
|
1320
|
+
/** Maximum XML depth in levels. */
|
|
1321
|
+
maxXmlDepth?: number
|
|
1322
|
+
/** Maximum cells per table. */
|
|
1323
|
+
maxTableCells?: number
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1215
1326
|
export interface JsTable {
|
|
1216
1327
|
cells: Array<Array<string>>
|
|
1217
1328
|
markdown: string
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@kreuzberg/node-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@kreuzberg/node-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '4.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
80
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@kreuzberg/node-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@kreuzberg/node-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '4.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
96
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@kreuzberg/node-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@kreuzberg/node-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '4.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
117
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@kreuzberg/node-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@kreuzberg/node-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '4.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
133
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@kreuzberg/node-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@kreuzberg/node-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '4.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
150
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@kreuzberg/node-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@kreuzberg/node-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '4.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
166
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@kreuzberg/node-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@kreuzberg/node-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '4.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
185
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@kreuzberg/node-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@kreuzberg/node-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '4.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
201
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@kreuzberg/node-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@kreuzberg/node-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '4.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
217
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@kreuzberg/node-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@kreuzberg/node-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '4.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
237
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@kreuzberg/node-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@kreuzberg/node-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '4.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
253
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@kreuzberg/node-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@kreuzberg/node-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '4.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
274
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@kreuzberg/node-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@kreuzberg/node-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '4.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
290
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@kreuzberg/node-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@kreuzberg/node-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '4.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
308
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@kreuzberg/node-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@kreuzberg/node-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '4.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
324
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@kreuzberg/node-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@kreuzberg/node-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '4.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
342
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@kreuzberg/node-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@kreuzberg/node-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '4.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
358
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@kreuzberg/node-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@kreuzberg/node-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '4.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
376
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@kreuzberg/node-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@kreuzberg/node-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '4.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
392
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@kreuzberg/node-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@kreuzberg/node-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '4.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
410
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@kreuzberg/node-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@kreuzberg/node-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '4.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
426
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@kreuzberg/node-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@kreuzberg/node-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '4.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
443
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@kreuzberg/node-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@kreuzberg/node-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '4.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
459
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@kreuzberg/node-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@kreuzberg/node-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '4.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
479
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@kreuzberg/node-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@kreuzberg/node-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '4.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
495
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@kreuzberg/node-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@kreuzberg/node-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '4.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
511
|
+
if (bindingPackageVersion !== '4.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 4.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kreuzberg/node",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "Kreuzberg document intelligence - Node.js native bindings",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Na'aman Hirschfeld",
|
|
7
|
-
"email": "
|
|
7
|
+
"email": "naaman@kreuzberg.dev",
|
|
8
8
|
"url": "https://kreuzberg.dev"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://kreuzberg.dev",
|
|
@@ -108,23 +108,23 @@
|
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@napi-rs/cli": "^3.5.1",
|
|
110
110
|
"@types/archiver": "^7.0.0",
|
|
111
|
-
"@types/node": "^25.
|
|
111
|
+
"@types/node": "^25.5.0",
|
|
112
112
|
"@types/which": "^3.0.4",
|
|
113
|
-
"@vitest/coverage-v8": "^4.0
|
|
113
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
114
114
|
"archiver": "^7.0.1",
|
|
115
|
-
"oxlint": "^1.
|
|
115
|
+
"oxlint": "^1.56.0",
|
|
116
116
|
"tsup": "^8.5.1",
|
|
117
117
|
"typescript": "^5.9.3",
|
|
118
|
-
"vitest": "^4.0
|
|
118
|
+
"vitest": "^4.1.0"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@emnapi/runtime": "1.
|
|
121
|
+
"@emnapi/runtime": "1.9.1",
|
|
122
122
|
"which": "^6.0.1"
|
|
123
123
|
},
|
|
124
124
|
"optionalDependencies": {
|
|
125
|
-
"@kreuzberg/node-darwin-arm64": "4.
|
|
126
|
-
"@kreuzberg/node-linux-arm64-gnu": "4.
|
|
127
|
-
"@kreuzberg/node-linux-x64-gnu": "4.
|
|
128
|
-
"@kreuzberg/node-win32-x64-msvc": "4.
|
|
125
|
+
"@kreuzberg/node-darwin-arm64": "4.5.0",
|
|
126
|
+
"@kreuzberg/node-linux-arm64-gnu": "4.5.0",
|
|
127
|
+
"@kreuzberg/node-linux-x64-gnu": "4.5.0",
|
|
128
|
+
"@kreuzberg/node-win32-x64-msvc": "4.5.0"
|
|
129
129
|
}
|
|
130
130
|
}
|