@juspay/neurolink 9.88.5 → 9.88.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.
- package/CHANGELOG.md +6 -0
- package/dist/browser/neurolink.min.js +208 -208
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +3 -0
- package/dist/lib/core/constants.d.ts +1 -0
- package/dist/lib/core/constants.js +3 -0
- package/dist/lib/utils/pdfProcessor.js +6 -0
- package/dist/utils/pdfProcessor.js +6 -0
- package/package.json +1 -1
package/dist/core/constants.d.ts
CHANGED
package/dist/core/constants.js
CHANGED
|
@@ -217,6 +217,9 @@ export const PDF_LIMITS = {
|
|
|
217
217
|
MAX_SIZE_MB: 20,
|
|
218
218
|
// Default maximum pages for image conversion
|
|
219
219
|
DEFAULT_MAX_PAGES: 20,
|
|
220
|
+
// Upper bound for the render scale factor. Above this, a single page can
|
|
221
|
+
// allocate hundreds of MB; scale <= 0 produces a degenerate viewport.
|
|
222
|
+
MAX_SCALE: 10,
|
|
220
223
|
};
|
|
221
224
|
// Performance and System Limits
|
|
222
225
|
export const SYSTEM_LIMITS = {
|
|
@@ -217,6 +217,9 @@ export const PDF_LIMITS = {
|
|
|
217
217
|
MAX_SIZE_MB: 20,
|
|
218
218
|
// Default maximum pages for image conversion
|
|
219
219
|
DEFAULT_MAX_PAGES: 20,
|
|
220
|
+
// Upper bound for the render scale factor. Above this, a single page can
|
|
221
|
+
// allocate hundreds of MB; scale <= 0 produces a degenerate viewport.
|
|
222
|
+
MAX_SCALE: 10,
|
|
220
223
|
};
|
|
221
224
|
// Performance and System Limits
|
|
222
225
|
export const SYSTEM_LIMITS = {
|
|
@@ -267,6 +267,12 @@ export class PDFProcessor {
|
|
|
267
267
|
if (format !== "png") {
|
|
268
268
|
throw new Error(`Invalid format: "${format}". Only "png" format is currently supported.`);
|
|
269
269
|
}
|
|
270
|
+
// 0b. Validate the render scale. A non-finite or non-positive scale yields a
|
|
271
|
+
// degenerate viewport (blank/zero-dimension render), and an excessive scale
|
|
272
|
+
// can allocate hundreds of MB per page — reject both with a clear message.
|
|
273
|
+
if (!Number.isFinite(scale) || scale <= 0 || scale > PDF_LIMITS.MAX_SCALE) {
|
|
274
|
+
throw new Error(`Invalid scale: ${scale}. Scale must be a finite number greater than 0 and at most ${PDF_LIMITS.MAX_SCALE}.`);
|
|
275
|
+
}
|
|
270
276
|
// 1. Validate buffer is not empty or too small
|
|
271
277
|
if (!pdfBuffer || pdfBuffer.length < 5) {
|
|
272
278
|
throw new Error("Invalid PDF: Buffer is too small or empty. " +
|
|
@@ -267,6 +267,12 @@ export class PDFProcessor {
|
|
|
267
267
|
if (format !== "png") {
|
|
268
268
|
throw new Error(`Invalid format: "${format}". Only "png" format is currently supported.`);
|
|
269
269
|
}
|
|
270
|
+
// 0b. Validate the render scale. A non-finite or non-positive scale yields a
|
|
271
|
+
// degenerate viewport (blank/zero-dimension render), and an excessive scale
|
|
272
|
+
// can allocate hundreds of MB per page — reject both with a clear message.
|
|
273
|
+
if (!Number.isFinite(scale) || scale <= 0 || scale > PDF_LIMITS.MAX_SCALE) {
|
|
274
|
+
throw new Error(`Invalid scale: ${scale}. Scale must be a finite number greater than 0 and at most ${PDF_LIMITS.MAX_SCALE}.`);
|
|
275
|
+
}
|
|
270
276
|
// 1. Validate buffer is not empty or too small
|
|
271
277
|
if (!pdfBuffer || pdfBuffer.length < 5) {
|
|
272
278
|
throw new Error("Invalid PDF: Buffer is too small or empty. " +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.88.
|
|
3
|
+
"version": "9.88.6",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (58+ servers), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
|
|
6
6
|
"author": {
|