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