s3db.js 4.1.4 → 4.1.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/dist/s3db.iife.js CHANGED
@@ -893,10 +893,10 @@ ${JSON.stringify(validation, null, 2)}`
893
893
  Bucket: this.config.bucket,
894
894
  Key: this.config.keyPrefix ? path.join(this.config.keyPrefix, key) : key,
895
895
  Metadata: { ...metadata },
896
- Body: body || "",
897
- ContentType: contentType,
898
- ContentEncoding: contentEncoding
896
+ Body: body || Buffer.alloc(0)
899
897
  };
898
+ if (contentType !== void 0) options2.ContentType = contentType;
899
+ if (contentEncoding !== void 0) options2.ContentEncoding = contentEncoding;
900
900
  try {
901
901
  const response = await this.sendCommand(new clientS3.PutObjectCommand(options2));
902
902
  this.emit("putObject", response, options2);
@@ -8492,12 +8492,16 @@ ${JSON.stringify(validation, null, 2)}`
8492
8492
  }
8493
8493
  write(chunk) {
8494
8494
  this.buffer.push(chunk);
8495
- this._maybeWrite();
8495
+ this._maybeWrite().catch((error) => {
8496
+ this.emit("error", error);
8497
+ });
8496
8498
  return true;
8497
8499
  }
8498
8500
  end() {
8499
8501
  this.ended = true;
8500
- this._maybeWrite();
8502
+ this._maybeWrite().catch((error) => {
8503
+ this.emit("error", error);
8504
+ });
8501
8505
  }
8502
8506
  async _maybeWrite() {
8503
8507
  if (this.writing) return;
@@ -8594,7 +8598,7 @@ ${JSON.stringify(validation, null, 2)}`
8594
8598
  return Object.values(sizes).reduce((total, size) => total + size, 0);
8595
8599
  }
8596
8600
 
8597
- const S3_METADATA_LIMIT_BYTES$3 = 2048;
8601
+ const S3_METADATA_LIMIT_BYTES$3 = 2e3;
8598
8602
  async function handleInsert$3({ resource, data, mappedData }) {
8599
8603
  const totalSize = calculateTotalSize(mappedData);
8600
8604
  if (totalSize > S3_METADATA_LIMIT_BYTES$3) {
@@ -8648,7 +8652,7 @@ ${JSON.stringify(validation, null, 2)}`
8648
8652
  handleUpsert: handleUpsert$3
8649
8653
  });
8650
8654
 
8651
- const S3_METADATA_LIMIT_BYTES$2 = 2048;
8655
+ const S3_METADATA_LIMIT_BYTES$2 = 2e3;
8652
8656
  async function handleInsert$2({ resource, data, mappedData }) {
8653
8657
  const totalSize = calculateTotalSize(mappedData);
8654
8658
  if (totalSize > S3_METADATA_LIMIT_BYTES$2) {
@@ -8682,7 +8686,7 @@ ${JSON.stringify(validation, null, 2)}`
8682
8686
  handleUpsert: handleUpsert$2
8683
8687
  });
8684
8688
 
8685
- const S3_METADATA_LIMIT_BYTES$1 = 2048;
8689
+ const S3_METADATA_LIMIT_BYTES$1 = 2e3;
8686
8690
  const TRUNCATE_SUFFIX = "...";
8687
8691
  const TRUNCATE_SUFFIX_BYTES = calculateUTF8Bytes(TRUNCATE_SUFFIX);
8688
8692
  async function handleInsert$1({ resource, data, mappedData }) {
@@ -8740,7 +8744,7 @@ ${JSON.stringify(validation, null, 2)}`
8740
8744
  handleUpsert: handleUpsert$1
8741
8745
  });
8742
8746
 
8743
- const S3_METADATA_LIMIT_BYTES = 2048;
8747
+ const S3_METADATA_LIMIT_BYTES = 2e3;
8744
8748
  const OVERFLOW_FLAG = "$overflow";
8745
8749
  const OVERFLOW_FLAG_VALUE = "true";
8746
8750
  const OVERFLOW_FLAG_BYTES = calculateUTF8Bytes(OVERFLOW_FLAG) + calculateUTF8Bytes(OVERFLOW_FLAG_VALUE);
@@ -9809,7 +9813,7 @@ ${JSON.stringify(validation, null, 2)}`
9809
9813
  this.version = "1";
9810
9814
  this.s3dbVersion = (() => {
9811
9815
  try {
9812
- return true ? "4.1.3" : "latest";
9816
+ return true ? "4.1.4" : "latest";
9813
9817
  } catch (e) {
9814
9818
  return "latest";
9815
9819
  }