@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 +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/dist/ingots/index.d.ts +7 -1
- package/dist/ingots/types.d.ts +17 -0
- package/dist/sparks/types.d.ts +17 -0
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2278,6 +2278,22 @@ interface Ingot {
|
|
|
2278
2278
|
id: string;
|
|
2279
2279
|
/** Ingot name */
|
|
2280
2280
|
name: string;
|
|
2281
|
+
/**
|
|
2282
|
+
* The name a download of the ingot saves under, as Forge names it: `name`,
|
|
2283
|
+
* kept as it is when the first word of the extension it shows (up to an
|
|
2284
|
+
* ASCII space, in any case) is one the MIME registry knows or holds a
|
|
2285
|
+
* character none of the registry's extensions is spelled with, which may
|
|
2286
|
+
* draw as one, and otherwise completed with the first extension the
|
|
2287
|
+
* registry lists for `contentType`, never one a saved copy must never open
|
|
2288
|
+
* as. Save a copy under it, handed to a browser as
|
|
2289
|
+
* `application/octet-stream` unless `contentType` is a raster image, audio,
|
|
2290
|
+
* video or PDF format (never SVG, a playlist or a stream redirector): a
|
|
2291
|
+
* browser renames a saved copy by the type it is handed (Chrome saves
|
|
2292
|
+
* `Invoice` typed `application/x-msdownload` as `Invoice.exe`), and
|
|
2293
|
+
* completes or replaces no extension of a copy handed as
|
|
2294
|
+
* `application/octet-stream`.
|
|
2295
|
+
*/
|
|
2296
|
+
downloadFilename: string;
|
|
2281
2297
|
/** Content type (MIME) */
|
|
2282
2298
|
contentType: string;
|
|
2283
2299
|
/** Size in bytes */
|
|
@@ -2851,8 +2867,14 @@ declare class IngotsModule {
|
|
|
2851
2867
|
* and a link that is not a Forge decrypt URL on an allowed host, is final.
|
|
2852
2868
|
*
|
|
2853
2869
|
* @example
|
|
2870
|
+
* const ingot = await sv.ingots.get(unsealed, 'ing_abc');
|
|
2854
2871
|
* const blob = await sv.ingots.download(unsealed, 'ing_abc');
|
|
2855
|
-
*
|
|
2872
|
+
* // Saved under the name Forge would send, as opaque bytes, which no
|
|
2873
|
+
* // browser renames by a type (see Ingot.downloadFilename).
|
|
2874
|
+
* const link = document.createElement('a');
|
|
2875
|
+
* link.href = URL.createObjectURL(new Blob([blob], { type: 'application/octet-stream' }));
|
|
2876
|
+
* link.download = ingot.downloadFilename;
|
|
2877
|
+
* link.click();
|
|
2856
2878
|
*/
|
|
2857
2879
|
download(vault: UnsealedVault, ingotId: string): Promise<Blob>;
|
|
2858
2880
|
/**
|
|
@@ -3042,6 +3064,22 @@ interface Spark {
|
|
|
3042
3064
|
burnedAt: number;
|
|
3043
3065
|
/** Optional file name (for file payloads) */
|
|
3044
3066
|
filename?: string;
|
|
3067
|
+
/**
|
|
3068
|
+
* The name the payload saves under: `filename`, or `download` for a spark
|
|
3069
|
+
* with none, kept as it is when the first word of the extension it shows
|
|
3070
|
+
* (up to an ASCII space, in any case) is one the MIME registry knows or
|
|
3071
|
+
* holds a character none of the registry's extensions is spelled with,
|
|
3072
|
+
* which may draw as one, and otherwise completed with the first extension
|
|
3073
|
+
* the registry lists for `contentType`, never one a saved copy must never
|
|
3074
|
+
* open as. Save a copy under it, handed to a browser as
|
|
3075
|
+
* `application/octet-stream` unless `contentType` is a raster image, audio,
|
|
3076
|
+
* video or PDF format (never SVG, a playlist or a stream redirector): a
|
|
3077
|
+
* browser renames a saved copy by the type it is handed (Chrome saves
|
|
3078
|
+
* `Invoice` typed `application/x-msdownload` as `Invoice.exe`), and
|
|
3079
|
+
* completes or replaces no extension of a copy handed as
|
|
3080
|
+
* `application/octet-stream`.
|
|
3081
|
+
*/
|
|
3082
|
+
downloadFilename: string;
|
|
3045
3083
|
}
|
|
3046
3084
|
/** A newly created spark. */
|
|
3047
3085
|
interface CreatedSpark {
|
package/dist/index.mjs
CHANGED
|
@@ -16520,8 +16520,14 @@ class IngotsModule {
|
|
|
16520
16520
|
* and a link that is not a Forge decrypt URL on an allowed host, is final.
|
|
16521
16521
|
*
|
|
16522
16522
|
* @example
|
|
16523
|
+
* const ingot = await sv.ingots.get(unsealed, 'ing_abc');
|
|
16523
16524
|
* const blob = await sv.ingots.download(unsealed, 'ing_abc');
|
|
16524
|
-
*
|
|
16525
|
+
* // Saved under the name Forge would send, as opaque bytes, which no
|
|
16526
|
+
* // browser renames by a type (see Ingot.downloadFilename).
|
|
16527
|
+
* const link = document.createElement('a');
|
|
16528
|
+
* link.href = URL.createObjectURL(new Blob([blob], { type: 'application/octet-stream' }));
|
|
16529
|
+
* link.download = ingot.downloadFilename;
|
|
16530
|
+
* link.click();
|
|
16525
16531
|
*/
|
|
16526
16532
|
async download(vault, ingotId) {
|
|
16527
16533
|
const mint = async () => (await this.createDownloadLink(vault, ingotId)).downloadUrl;
|
|
@@ -16700,6 +16706,7 @@ function mapIngot(wire) {
|
|
|
16700
16706
|
return {
|
|
16701
16707
|
id: wire.ingot_id,
|
|
16702
16708
|
name: wire.name,
|
|
16709
|
+
downloadFilename: wire.download_filename,
|
|
16703
16710
|
contentType: wire.content_type,
|
|
16704
16711
|
size: wire.size_bytes,
|
|
16705
16712
|
status: wire.status ?? 'active',
|
|
@@ -16791,6 +16798,7 @@ class SparksModule {
|
|
|
16791
16798
|
createdAt: data.created_at,
|
|
16792
16799
|
burnedAt: data.burned_at,
|
|
16793
16800
|
filename: data.filename,
|
|
16801
|
+
downloadFilename: data.download_filename,
|
|
16794
16802
|
};
|
|
16795
16803
|
}
|
|
16796
16804
|
/**
|
|
@@ -17432,7 +17440,7 @@ class SparkVault {
|
|
|
17432
17440
|
}
|
|
17433
17441
|
/** Get the SDK version */
|
|
17434
17442
|
static get version() {
|
|
17435
|
-
return '11.2.
|
|
17443
|
+
return '11.2.4';
|
|
17436
17444
|
}
|
|
17437
17445
|
}
|
|
17438
17446
|
if (typeof window !== 'undefined') {
|