wolfronix-sdk 2.4.0 → 2.4.1
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.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.global.js +55 -0
- package/dist/index.js +4 -6
- package/dist/index.mjs +4 -6
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -18800,7 +18800,7 @@ var Wolfronix = class {
|
|
|
18800
18800
|
for (let attempt = 1; attempt <= this.config.retries; attempt++) {
|
|
18801
18801
|
try {
|
|
18802
18802
|
const controller = new AbortController();
|
|
18803
|
-
const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
|
|
18803
|
+
const timeoutId = formData ? null : setTimeout(() => controller.abort(), this.config.timeout);
|
|
18804
18804
|
const fetchOptions = {
|
|
18805
18805
|
method,
|
|
18806
18806
|
headers,
|
|
@@ -18821,7 +18821,7 @@ var Wolfronix = class {
|
|
|
18821
18821
|
fetchOptions.body = JSON.stringify(body);
|
|
18822
18822
|
}
|
|
18823
18823
|
const response = await fetch(url, fetchOptions);
|
|
18824
|
-
clearTimeout(timeoutId);
|
|
18824
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
18825
18825
|
if (!response.ok) {
|
|
18826
18826
|
const errorBody = await response.json().catch(() => ({}));
|
|
18827
18827
|
if (response.status === 401) {
|
|
@@ -19027,10 +19027,8 @@ var Wolfronix = class {
|
|
|
19027
19027
|
formData
|
|
19028
19028
|
});
|
|
19029
19029
|
return {
|
|
19030
|
-
|
|
19031
|
-
file_id: String(response.file_id)
|
|
19032
|
-
file_size: response.file_size,
|
|
19033
|
-
enc_time_ms: response.enc_time_ms
|
|
19030
|
+
...response,
|
|
19031
|
+
file_id: String(response.file_id)
|
|
19034
19032
|
};
|
|
19035
19033
|
}
|
|
19036
19034
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -350,7 +350,7 @@ var Wolfronix = class {
|
|
|
350
350
|
for (let attempt = 1; attempt <= this.config.retries; attempt++) {
|
|
351
351
|
try {
|
|
352
352
|
const controller = new AbortController();
|
|
353
|
-
const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
|
|
353
|
+
const timeoutId = formData ? null : setTimeout(() => controller.abort(), this.config.timeout);
|
|
354
354
|
const fetchOptions = {
|
|
355
355
|
method,
|
|
356
356
|
headers,
|
|
@@ -371,7 +371,7 @@ var Wolfronix = class {
|
|
|
371
371
|
fetchOptions.body = JSON.stringify(body);
|
|
372
372
|
}
|
|
373
373
|
const response = await fetch(url, fetchOptions);
|
|
374
|
-
clearTimeout(timeoutId);
|
|
374
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
375
375
|
if (!response.ok) {
|
|
376
376
|
const errorBody = await response.json().catch(() => ({}));
|
|
377
377
|
if (response.status === 401) {
|
|
@@ -577,10 +577,8 @@ var Wolfronix = class {
|
|
|
577
577
|
formData
|
|
578
578
|
});
|
|
579
579
|
return {
|
|
580
|
-
|
|
581
|
-
file_id: String(response.file_id)
|
|
582
|
-
file_size: response.file_size,
|
|
583
|
-
enc_time_ms: response.enc_time_ms
|
|
580
|
+
...response,
|
|
581
|
+
file_id: String(response.file_id)
|
|
584
582
|
};
|
|
585
583
|
}
|
|
586
584
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wolfronix-sdk",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Official Wolfronix SDK for JavaScript/TypeScript - Zero-knowledge encryption made simple",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"LICENSE"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
21
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --clean && npm run build:browser",
|
|
22
|
+
"build:browser": "tsup src/index.ts --format iife --global-name WolfronixSDK --outDir dist --no-dts --minify",
|
|
22
23
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
23
24
|
"test": "vitest",
|
|
24
25
|
"test:coverage": "vitest --coverage",
|