@juspay/neurolink 8.13.1 → 8.13.2
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
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [8.13.2](https://github.com/juspay/neurolink/compare/v8.13.1...v8.13.2) (2025-12-14)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **(sdk):** Replace hardcoded timeouts with class constants ([a34c291](https://github.com/juspay/neurolink/commit/a34c29155e82ef4f498714c031401463351171bd))
|
|
6
|
+
|
|
1
7
|
## [8.13.1](https://github.com/juspay/neurolink/compare/v8.13.0...v8.13.1) (2025-12-13)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
|
@@ -15,6 +15,8 @@ import type { FileInput, FileProcessingResult, FileDetectorOptions } from "../ty
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
export declare class FileDetector {
|
|
18
|
+
static readonly DEFAULT_NETWORK_TIMEOUT = 30000;
|
|
19
|
+
static readonly DEFAULT_HEAD_TIMEOUT = 5000;
|
|
18
20
|
/**
|
|
19
21
|
* Auto-detect file type and process in one call
|
|
20
22
|
*
|
|
@@ -35,6 +35,10 @@ function formatFileSize(bytes) {
|
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
export class FileDetector {
|
|
38
|
+
// FD-017: Replace hardcoded timeouts with constants.
|
|
39
|
+
// These default ensure consistent timeout behavior across all file-detection logic.
|
|
40
|
+
static DEFAULT_NETWORK_TIMEOUT = 30000; // 30 seconds
|
|
41
|
+
static DEFAULT_HEAD_TIMEOUT = 5000; // 5 seconds
|
|
38
42
|
/**
|
|
39
43
|
* Auto-detect file type and process in one call
|
|
40
44
|
*
|
|
@@ -144,7 +148,7 @@ export class FileDetector {
|
|
|
144
148
|
*/
|
|
145
149
|
static async loadFromURL(url, options) {
|
|
146
150
|
const maxSize = options?.maxSize || 10 * 1024 * 1024;
|
|
147
|
-
const timeout = options?.timeout ||
|
|
151
|
+
const timeout = options?.timeout || this.DEFAULT_NETWORK_TIMEOUT;
|
|
148
152
|
const response = await request(url, {
|
|
149
153
|
dispatcher: getGlobalDispatcher().compose(interceptors.redirect({ maxRedirections: 5 })),
|
|
150
154
|
method: "GET",
|
|
@@ -273,8 +277,8 @@ class MimeTypeStrategy {
|
|
|
273
277
|
const response = await request(input, {
|
|
274
278
|
dispatcher: getGlobalDispatcher().compose(interceptors.redirect({ maxRedirections: 5 })),
|
|
275
279
|
method: "HEAD",
|
|
276
|
-
headersTimeout:
|
|
277
|
-
bodyTimeout:
|
|
280
|
+
headersTimeout: FileDetector.DEFAULT_HEAD_TIMEOUT,
|
|
281
|
+
bodyTimeout: FileDetector.DEFAULT_HEAD_TIMEOUT,
|
|
278
282
|
});
|
|
279
283
|
const contentType = response.headers["content-type"] || "";
|
|
280
284
|
const type = this.mimeToFileType(contentType);
|
|
@@ -15,6 +15,8 @@ import type { FileInput, FileProcessingResult, FileDetectorOptions } from "../ty
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
export declare class FileDetector {
|
|
18
|
+
static readonly DEFAULT_NETWORK_TIMEOUT = 30000;
|
|
19
|
+
static readonly DEFAULT_HEAD_TIMEOUT = 5000;
|
|
18
20
|
/**
|
|
19
21
|
* Auto-detect file type and process in one call
|
|
20
22
|
*
|
|
@@ -35,6 +35,10 @@ function formatFileSize(bytes) {
|
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
export class FileDetector {
|
|
38
|
+
// FD-017: Replace hardcoded timeouts with constants.
|
|
39
|
+
// These default ensure consistent timeout behavior across all file-detection logic.
|
|
40
|
+
static DEFAULT_NETWORK_TIMEOUT = 30000; // 30 seconds
|
|
41
|
+
static DEFAULT_HEAD_TIMEOUT = 5000; // 5 seconds
|
|
38
42
|
/**
|
|
39
43
|
* Auto-detect file type and process in one call
|
|
40
44
|
*
|
|
@@ -144,7 +148,7 @@ export class FileDetector {
|
|
|
144
148
|
*/
|
|
145
149
|
static async loadFromURL(url, options) {
|
|
146
150
|
const maxSize = options?.maxSize || 10 * 1024 * 1024;
|
|
147
|
-
const timeout = options?.timeout ||
|
|
151
|
+
const timeout = options?.timeout || this.DEFAULT_NETWORK_TIMEOUT;
|
|
148
152
|
const response = await request(url, {
|
|
149
153
|
dispatcher: getGlobalDispatcher().compose(interceptors.redirect({ maxRedirections: 5 })),
|
|
150
154
|
method: "GET",
|
|
@@ -273,8 +277,8 @@ class MimeTypeStrategy {
|
|
|
273
277
|
const response = await request(input, {
|
|
274
278
|
dispatcher: getGlobalDispatcher().compose(interceptors.redirect({ maxRedirections: 5 })),
|
|
275
279
|
method: "HEAD",
|
|
276
|
-
headersTimeout:
|
|
277
|
-
bodyTimeout:
|
|
280
|
+
headersTimeout: FileDetector.DEFAULT_HEAD_TIMEOUT,
|
|
281
|
+
bodyTimeout: FileDetector.DEFAULT_HEAD_TIMEOUT,
|
|
278
282
|
});
|
|
279
283
|
const contentType = response.headers["content-type"] || "";
|
|
280
284
|
const type = this.mimeToFileType(contentType);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.2",
|
|
4
4
|
"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 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|