@sparkvault/sdk-js 11.2.3 → 11.2.4

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
@@ -16524,8 +16524,14 @@ class IngotsModule {
16524
16524
  * and a link that is not a Forge decrypt URL on an allowed host, is final.
16525
16525
  *
16526
16526
  * @example
16527
+ * const ingot = await sv.ingots.get(unsealed, 'ing_abc');
16527
16528
  * const blob = await sv.ingots.download(unsealed, 'ing_abc');
16528
- * const url = URL.createObjectURL(blob);
16529
+ * // Saved under the name Forge would send, as opaque bytes, which no
16530
+ * // browser renames by a type (see Ingot.downloadFilename).
16531
+ * const link = document.createElement('a');
16532
+ * link.href = URL.createObjectURL(new Blob([blob], { type: 'application/octet-stream' }));
16533
+ * link.download = ingot.downloadFilename;
16534
+ * link.click();
16529
16535
  */
16530
16536
  async download(vault, ingotId) {
16531
16537
  const mint = async () => (await this.createDownloadLink(vault, ingotId)).downloadUrl;
@@ -16704,6 +16710,7 @@ function mapIngot(wire) {
16704
16710
  return {
16705
16711
  id: wire.ingot_id,
16706
16712
  name: wire.name,
16713
+ downloadFilename: wire.download_filename,
16707
16714
  contentType: wire.content_type,
16708
16715
  size: wire.size_bytes,
16709
16716
  status: wire.status ?? 'active',
@@ -16795,6 +16802,7 @@ class SparksModule {
16795
16802
  createdAt: data.created_at,
16796
16803
  burnedAt: data.burned_at,
16797
16804
  filename: data.filename,
16805
+ downloadFilename: data.download_filename,
16798
16806
  };
16799
16807
  }
16800
16808
  /**
@@ -17436,7 +17444,7 @@ class SparkVault {
17436
17444
  }
17437
17445
  /** Get the SDK version */
17438
17446
  static get version() {
17439
- return '11.2.3';
17447
+ return '11.2.4';
17440
17448
  }
17441
17449
  }
17442
17450
  if (typeof window !== 'undefined') {