@sparkvault/sdk-js 11.2.2 → 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
@@ -11425,10 +11425,15 @@ class ProductsModule {
11425
11425
  /** The prefix that marks a DVAK token apart from a Vault Master Key. */
11426
11426
  const DVAK_TOKEN_PREFIX = 'dvak_';
11427
11427
 
11428
- /** The shortest and longest Vault Master Key, in characters. */
11428
+ /**
11429
+ * The shortest and longest string, in characters, accepted as a Vault Master
11430
+ * Key. Every VMK is one Core minted, the Base62 of 18 random bytes (Core's
11431
+ * vault create, apps/api/src/vaults/create.js): 144 bits in at most 25
11432
+ * characters.
11433
+ */
11429
11434
  const VAULT_MASTER_KEY_LENGTH = Object.freeze({ min: 12, max: 32 });
11430
11435
 
11431
- /** A Vault Master Key: 12 to 32 ASCII letters and digits. */
11436
+ /** What a presented Vault Master Key must be: 12 to 32 ASCII letters and digits. */
11432
11437
  new RegExp(
11433
11438
  `^[A-Za-z0-9]{${VAULT_MASTER_KEY_LENGTH.min},${VAULT_MASTER_KEY_LENGTH.max}}$`
11434
11439
  );
@@ -16519,8 +16524,14 @@ class IngotsModule {
16519
16524
  * and a link that is not a Forge decrypt URL on an allowed host, is final.
16520
16525
  *
16521
16526
  * @example
16527
+ * const ingot = await sv.ingots.get(unsealed, 'ing_abc');
16522
16528
  * const blob = await sv.ingots.download(unsealed, 'ing_abc');
16523
- * 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();
16524
16535
  */
16525
16536
  async download(vault, ingotId) {
16526
16537
  const mint = async () => (await this.createDownloadLink(vault, ingotId)).downloadUrl;
@@ -16699,6 +16710,7 @@ function mapIngot(wire) {
16699
16710
  return {
16700
16711
  id: wire.ingot_id,
16701
16712
  name: wire.name,
16713
+ downloadFilename: wire.download_filename,
16702
16714
  contentType: wire.content_type,
16703
16715
  size: wire.size_bytes,
16704
16716
  status: wire.status ?? 'active',
@@ -16790,6 +16802,7 @@ class SparksModule {
16790
16802
  createdAt: data.created_at,
16791
16803
  burnedAt: data.burned_at,
16792
16804
  filename: data.filename,
16805
+ downloadFilename: data.download_filename,
16793
16806
  };
16794
16807
  }
16795
16808
  /**
@@ -17431,7 +17444,7 @@ class SparkVault {
17431
17444
  }
17432
17445
  /** Get the SDK version */
17433
17446
  static get version() {
17434
- return '11.2.2';
17447
+ return '11.2.4';
17435
17448
  }
17436
17449
  }
17437
17450
  if (typeof window !== 'undefined') {