@sparkvault/sdk 1.23.8 → 1.23.9
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/identity/api.d.ts +12 -1
- package/dist/sparkvault.cjs.js +37 -7
- package/dist/sparkvault.cjs.js.map +1 -1
- package/dist/sparkvault.esm.js +37 -7
- package/dist/sparkvault.esm.js.map +1 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/vaults/upload/api.d.ts +11 -1
- package/dist/vaults/upload/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/sparkvault.esm.js
CHANGED
|
@@ -639,7 +639,10 @@ class IdentityApi {
|
|
|
639
639
|
constructor(config, timeoutMs = DEFAULT_TIMEOUT_MS$1) {
|
|
640
640
|
/** Cached config promise - allows preloading and deduplication */
|
|
641
641
|
this.configCache = null;
|
|
642
|
-
/**
|
|
642
|
+
/**
|
|
643
|
+
* Abort controller for cancelling all pending requests on close.
|
|
644
|
+
* Replaced by resetSession() at the start of every user-facing session.
|
|
645
|
+
*/
|
|
643
646
|
this.closeController = new AbortController();
|
|
644
647
|
this.config = config;
|
|
645
648
|
this.timeoutMs = timeoutMs;
|
|
@@ -657,6 +660,16 @@ class IdentityApi {
|
|
|
657
660
|
isAborted() {
|
|
658
661
|
return this.closeController.signal.aborted;
|
|
659
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* Reset the session lifecycle by swapping in a fresh AbortController.
|
|
665
|
+
* The Module calls this at the start of every user-facing session so a
|
|
666
|
+
* previously-closed session can never leak its aborted state into the
|
|
667
|
+
* next one. The config cache is intentionally preserved across sessions
|
|
668
|
+
* so preloadConfig() keeps making modal opens instant.
|
|
669
|
+
*/
|
|
670
|
+
resetSession() {
|
|
671
|
+
this.closeController = new AbortController();
|
|
672
|
+
}
|
|
660
673
|
get baseUrl() {
|
|
661
674
|
return `${this.config.identityBaseUrl}/${this.config.accountId}`;
|
|
662
675
|
}
|
|
@@ -6306,6 +6319,10 @@ class IdentityModule {
|
|
|
6306
6319
|
if (this.renderer) {
|
|
6307
6320
|
this.renderer.close();
|
|
6308
6321
|
}
|
|
6322
|
+
// Reset session lifecycle before every modal open. Without this, the
|
|
6323
|
+
// AbortController aborted on close() would short-circuit the next
|
|
6324
|
+
// session's first request as "Request cancelled".
|
|
6325
|
+
this.api.resetSession();
|
|
6309
6326
|
const isInline = !!options.target;
|
|
6310
6327
|
const container = isInline
|
|
6311
6328
|
? this.createInlineContainer(options.target)
|
|
@@ -6545,7 +6562,10 @@ function isInitiateUploadResponse(data) {
|
|
|
6545
6562
|
}
|
|
6546
6563
|
class UploadApi {
|
|
6547
6564
|
constructor(config) {
|
|
6548
|
-
/**
|
|
6565
|
+
/**
|
|
6566
|
+
* Abort controller for cancelling all pending requests on close.
|
|
6567
|
+
* Replaced by resetSession() at the start of every user-facing session.
|
|
6568
|
+
*/
|
|
6549
6569
|
this.closeController = new AbortController();
|
|
6550
6570
|
this.config = config;
|
|
6551
6571
|
this.timeoutMs = config.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
@@ -6569,6 +6589,15 @@ class UploadApi {
|
|
|
6569
6589
|
getAbortSignal() {
|
|
6570
6590
|
return this.closeController.signal;
|
|
6571
6591
|
}
|
|
6592
|
+
/**
|
|
6593
|
+
* Reset the session lifecycle by swapping in a fresh AbortController.
|
|
6594
|
+
* The Module calls this at the start of every user-facing session so a
|
|
6595
|
+
* previously-closed session can never leak its aborted state into the
|
|
6596
|
+
* next one. (Long-lived caches on `this` are intentionally preserved.)
|
|
6597
|
+
*/
|
|
6598
|
+
resetSession() {
|
|
6599
|
+
this.closeController = new AbortController();
|
|
6600
|
+
}
|
|
6572
6601
|
/**
|
|
6573
6602
|
* Get vault upload info (public endpoint).
|
|
6574
6603
|
*/
|
|
@@ -9370,6 +9399,7 @@ class VaultUploadModule {
|
|
|
9370
9399
|
this.renderer = null;
|
|
9371
9400
|
this.attachedElements = new Map();
|
|
9372
9401
|
this.config = config;
|
|
9402
|
+
this.api = new UploadApi(config);
|
|
9373
9403
|
}
|
|
9374
9404
|
/**
|
|
9375
9405
|
* Upload a file to a vault.
|
|
@@ -9404,12 +9434,12 @@ class VaultUploadModule {
|
|
|
9404
9434
|
...options,
|
|
9405
9435
|
backdropBlur: options.backdropBlur ?? this.config.backdropBlur,
|
|
9406
9436
|
};
|
|
9407
|
-
//
|
|
9408
|
-
//
|
|
9409
|
-
//
|
|
9410
|
-
|
|
9437
|
+
// Reset session lifecycle before every modal open. Without this, the
|
|
9438
|
+
// AbortController aborted on close() would short-circuit the next
|
|
9439
|
+
// session's first request as "Request cancelled".
|
|
9440
|
+
this.api.resetSession();
|
|
9411
9441
|
return new Promise((resolve, reject) => {
|
|
9412
|
-
this.renderer = new UploadRenderer(container, api, mergedOptions, {
|
|
9442
|
+
this.renderer = new UploadRenderer(container, this.api, mergedOptions, {
|
|
9413
9443
|
onSuccess: (result) => {
|
|
9414
9444
|
options.onSuccess?.(result);
|
|
9415
9445
|
resolve(result);
|