@nextlyhq/storage-s3 0.0.2-alpha.69 → 0.0.2-alpha.70
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.cjs +27 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +27 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -641,6 +641,26 @@ var NextlyError = class NextlyError extends Error {
|
|
|
641
641
|
return NextlyError.isCode(err, "RATE_LIMITED");
|
|
642
642
|
}
|
|
643
643
|
};
|
|
644
|
+
// ../nextly/dist/validate-external-url-uHUKFZGh.mjs
|
|
645
|
+
/** Default response body cap: reject anything larger before buffering it all. */
|
|
646
|
+
/**
|
|
647
|
+
* How many bytes a bounded external read may buffer, absent a caller's own cap.
|
|
648
|
+
*
|
|
649
|
+
* Exported for the same reason as the deadline below: an adapter that never
|
|
650
|
+
* touches `safeFetch` still owes callers this default, and restating the number
|
|
651
|
+
* gives the tree two that drift.
|
|
652
|
+
*/
|
|
653
|
+
const DEFAULT_MAX_RESPONSE_BYTES = 10485760;
|
|
654
|
+
/** Default overall deadline covering DNS + connect + TLS + response. */
|
|
655
|
+
/**
|
|
656
|
+
* How long a bounded external read may take, absent a caller's own limit.
|
|
657
|
+
*
|
|
658
|
+
* Exported so a caller that must begin the clock EARLIER — a storage adapter
|
|
659
|
+
* bounding a metadata lookup as well as the fetch that follows — uses this
|
|
660
|
+
* number rather than restating it. Two spellings of one default agree today and
|
|
661
|
+
* drift the first time either is tuned.
|
|
662
|
+
*/
|
|
663
|
+
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
644
664
|
// ../nextly/dist/storage/read-errors.mjs
|
|
645
665
|
/**
|
|
646
666
|
* The one way the storage layer says a read exceeded the caller's cap.
|
|
@@ -687,6 +707,11 @@ var StorageReadTooLargeError = class extends NextlyError {
|
|
|
687
707
|
this.size = size;
|
|
688
708
|
}
|
|
689
709
|
};
|
|
710
|
+
// ../nextly/dist/storage/fetch-stored-bytes.mjs
|
|
711
|
+
/** The deadline a stored read runs under when the caller names none. */
|
|
712
|
+
const DEFAULT_READ_TIMEOUT_MS = DEFAULT_TIMEOUT_MS;
|
|
713
|
+
/** The byte cap a stored read runs under when the caller names none. */
|
|
714
|
+
const DEFAULT_READ_MAX_BYTES = DEFAULT_MAX_RESPONSE_BYTES;
|
|
690
715
|
/**
|
|
691
716
|
* The bounds a read actually runs under, defaults filled in.
|
|
692
717
|
*
|
|
@@ -702,8 +727,8 @@ var StorageReadTooLargeError = class extends NextlyError {
|
|
|
702
727
|
*/
|
|
703
728
|
function resolveReadBounds(options) {
|
|
704
729
|
return {
|
|
705
|
-
maxBytes: options?.maxBytes ??
|
|
706
|
-
timeoutMs: options?.timeoutMs ??
|
|
730
|
+
maxBytes: options?.maxBytes ?? DEFAULT_READ_MAX_BYTES,
|
|
731
|
+
timeoutMs: options?.timeoutMs ?? DEFAULT_READ_TIMEOUT_MS
|
|
707
732
|
};
|
|
708
733
|
}
|
|
709
734
|
// src/adapter.ts
|