@juspay/neurolink 9.55.5 → 9.55.6
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.
|
@@ -31,10 +31,26 @@
|
|
|
31
31
|
* }
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
import * as mammoth from "mammoth";
|
|
35
34
|
import { BaseFileProcessor } from "../base/BaseFileProcessor.js";
|
|
36
35
|
import { SIZE_LIMITS } from "../config/index.js";
|
|
37
36
|
import { FileErrorCode } from "../errors/index.js";
|
|
37
|
+
let _mammoth = null;
|
|
38
|
+
async function loadMammoth() {
|
|
39
|
+
if (_mammoth) {
|
|
40
|
+
return _mammoth;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
_mammoth = await import(/* @vite-ignore */ "mammoth");
|
|
44
|
+
return _mammoth;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
const e = err instanceof Error ? err : null;
|
|
48
|
+
if (e?.code === "ERR_MODULE_NOT_FOUND" && e.message.includes("mammoth")) {
|
|
49
|
+
throw new Error('Word document processing requires the "mammoth" package. Install it with:\n pnpm add mammoth', { cause: err });
|
|
50
|
+
}
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
38
54
|
// Re-export for consumers who import from this module
|
|
39
55
|
// Import for local use
|
|
40
56
|
// =============================================================================
|
|
@@ -223,6 +239,7 @@ export class WordProcessor extends BaseFileProcessor {
|
|
|
223
239
|
let htmlContent = "";
|
|
224
240
|
const warnings = [];
|
|
225
241
|
try {
|
|
242
|
+
const mammoth = await loadMammoth();
|
|
226
243
|
// Extract plain text
|
|
227
244
|
const textResult = await mammoth.extractRawText({ buffer });
|
|
228
245
|
textContent = textResult.value;
|
|
@@ -31,10 +31,26 @@
|
|
|
31
31
|
* }
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
import * as mammoth from "mammoth";
|
|
35
34
|
import { BaseFileProcessor } from "../base/BaseFileProcessor.js";
|
|
36
35
|
import { SIZE_LIMITS } from "../config/index.js";
|
|
37
36
|
import { FileErrorCode } from "../errors/index.js";
|
|
37
|
+
let _mammoth = null;
|
|
38
|
+
async function loadMammoth() {
|
|
39
|
+
if (_mammoth) {
|
|
40
|
+
return _mammoth;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
_mammoth = await import(/* @vite-ignore */ "mammoth");
|
|
44
|
+
return _mammoth;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
const e = err instanceof Error ? err : null;
|
|
48
|
+
if (e?.code === "ERR_MODULE_NOT_FOUND" && e.message.includes("mammoth")) {
|
|
49
|
+
throw new Error('Word document processing requires the "mammoth" package. Install it with:\n pnpm add mammoth', { cause: err });
|
|
50
|
+
}
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
38
54
|
// Re-export for consumers who import from this module
|
|
39
55
|
// Import for local use
|
|
40
56
|
// =============================================================================
|
|
@@ -223,6 +239,7 @@ export class WordProcessor extends BaseFileProcessor {
|
|
|
223
239
|
let htmlContent = "";
|
|
224
240
|
const warnings = [];
|
|
225
241
|
try {
|
|
242
|
+
const mammoth = await loadMammoth();
|
|
226
243
|
// Extract plain text
|
|
227
244
|
const textResult = await mammoth.extractRawText({ buffer });
|
|
228
245
|
textContent = textResult.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.55.
|
|
3
|
+
"version": "9.55.6",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
6
6
|
"author": {
|
|
@@ -236,7 +236,6 @@
|
|
|
236
236
|
"inquirer": "^13.3.0",
|
|
237
237
|
"jose": "^6.1.3",
|
|
238
238
|
"json-schema-to-zod": "^2.7.0",
|
|
239
|
-
"mammoth": "^1.11.0",
|
|
240
239
|
"mediabunny": "^1.40.1",
|
|
241
240
|
"music-metadata": "^11.11.2",
|
|
242
241
|
"nanoid": "^5.1.5",
|
|
@@ -273,6 +272,7 @@
|
|
|
273
272
|
"@picovoice/cobra-node": "^3.0.2",
|
|
274
273
|
"bullmq": "^5.52.2",
|
|
275
274
|
"exceljs": "^4.4.0",
|
|
275
|
+
"mammoth": "^1.11.0",
|
|
276
276
|
"pdf-parse": "^2.4.5",
|
|
277
277
|
"pdf-to-img": "^5.0.0",
|
|
278
278
|
"@fastify/cors": "^11.2.0",
|