@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/identity/api.d.ts
CHANGED
|
@@ -11,7 +11,10 @@ export declare class IdentityApi {
|
|
|
11
11
|
private readonly timeoutMs;
|
|
12
12
|
/** Cached config promise - allows preloading and deduplication */
|
|
13
13
|
private configCache;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Abort controller for cancelling all pending requests on close.
|
|
16
|
+
* Replaced by resetSession() at the start of every user-facing session.
|
|
17
|
+
*/
|
|
15
18
|
private closeController;
|
|
16
19
|
constructor(config: ResolvedConfig, timeoutMs?: number);
|
|
17
20
|
/**
|
|
@@ -23,6 +26,14 @@ export declare class IdentityApi {
|
|
|
23
26
|
* Check if the API has been aborted.
|
|
24
27
|
*/
|
|
25
28
|
isAborted(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Reset the session lifecycle by swapping in a fresh AbortController.
|
|
31
|
+
* The Module calls this at the start of every user-facing session so a
|
|
32
|
+
* previously-closed session can never leak its aborted state into the
|
|
33
|
+
* next one. The config cache is intentionally preserved across sessions
|
|
34
|
+
* so preloadConfig() keeps making modal opens instant.
|
|
35
|
+
*/
|
|
36
|
+
resetSession(): void;
|
|
26
37
|
private get baseUrl();
|
|
27
38
|
private request;
|
|
28
39
|
/**
|
package/dist/sparkvault.cjs.js
CHANGED
|
@@ -643,7 +643,10 @@ class IdentityApi {
|
|
|
643
643
|
constructor(config, timeoutMs = DEFAULT_TIMEOUT_MS$1) {
|
|
644
644
|
/** Cached config promise - allows preloading and deduplication */
|
|
645
645
|
this.configCache = null;
|
|
646
|
-
/**
|
|
646
|
+
/**
|
|
647
|
+
* Abort controller for cancelling all pending requests on close.
|
|
648
|
+
* Replaced by resetSession() at the start of every user-facing session.
|
|
649
|
+
*/
|
|
647
650
|
this.closeController = new AbortController();
|
|
648
651
|
this.config = config;
|
|
649
652
|
this.timeoutMs = timeoutMs;
|
|
@@ -661,6 +664,16 @@ class IdentityApi {
|
|
|
661
664
|
isAborted() {
|
|
662
665
|
return this.closeController.signal.aborted;
|
|
663
666
|
}
|
|
667
|
+
/**
|
|
668
|
+
* Reset the session lifecycle by swapping in a fresh AbortController.
|
|
669
|
+
* The Module calls this at the start of every user-facing session so a
|
|
670
|
+
* previously-closed session can never leak its aborted state into the
|
|
671
|
+
* next one. The config cache is intentionally preserved across sessions
|
|
672
|
+
* so preloadConfig() keeps making modal opens instant.
|
|
673
|
+
*/
|
|
674
|
+
resetSession() {
|
|
675
|
+
this.closeController = new AbortController();
|
|
676
|
+
}
|
|
664
677
|
get baseUrl() {
|
|
665
678
|
return `${this.config.identityBaseUrl}/${this.config.accountId}`;
|
|
666
679
|
}
|
|
@@ -6310,6 +6323,10 @@ class IdentityModule {
|
|
|
6310
6323
|
if (this.renderer) {
|
|
6311
6324
|
this.renderer.close();
|
|
6312
6325
|
}
|
|
6326
|
+
// Reset session lifecycle before every modal open. Without this, the
|
|
6327
|
+
// AbortController aborted on close() would short-circuit the next
|
|
6328
|
+
// session's first request as "Request cancelled".
|
|
6329
|
+
this.api.resetSession();
|
|
6313
6330
|
const isInline = !!options.target;
|
|
6314
6331
|
const container = isInline
|
|
6315
6332
|
? this.createInlineContainer(options.target)
|
|
@@ -6549,7 +6566,10 @@ function isInitiateUploadResponse(data) {
|
|
|
6549
6566
|
}
|
|
6550
6567
|
class UploadApi {
|
|
6551
6568
|
constructor(config) {
|
|
6552
|
-
/**
|
|
6569
|
+
/**
|
|
6570
|
+
* Abort controller for cancelling all pending requests on close.
|
|
6571
|
+
* Replaced by resetSession() at the start of every user-facing session.
|
|
6572
|
+
*/
|
|
6553
6573
|
this.closeController = new AbortController();
|
|
6554
6574
|
this.config = config;
|
|
6555
6575
|
this.timeoutMs = config.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
@@ -6573,6 +6593,15 @@ class UploadApi {
|
|
|
6573
6593
|
getAbortSignal() {
|
|
6574
6594
|
return this.closeController.signal;
|
|
6575
6595
|
}
|
|
6596
|
+
/**
|
|
6597
|
+
* Reset the session lifecycle by swapping in a fresh AbortController.
|
|
6598
|
+
* The Module calls this at the start of every user-facing session so a
|
|
6599
|
+
* previously-closed session can never leak its aborted state into the
|
|
6600
|
+
* next one. (Long-lived caches on `this` are intentionally preserved.)
|
|
6601
|
+
*/
|
|
6602
|
+
resetSession() {
|
|
6603
|
+
this.closeController = new AbortController();
|
|
6604
|
+
}
|
|
6576
6605
|
/**
|
|
6577
6606
|
* Get vault upload info (public endpoint).
|
|
6578
6607
|
*/
|
|
@@ -9374,6 +9403,7 @@ class VaultUploadModule {
|
|
|
9374
9403
|
this.renderer = null;
|
|
9375
9404
|
this.attachedElements = new Map();
|
|
9376
9405
|
this.config = config;
|
|
9406
|
+
this.api = new UploadApi(config);
|
|
9377
9407
|
}
|
|
9378
9408
|
/**
|
|
9379
9409
|
* Upload a file to a vault.
|
|
@@ -9408,12 +9438,12 @@ class VaultUploadModule {
|
|
|
9408
9438
|
...options,
|
|
9409
9439
|
backdropBlur: options.backdropBlur ?? this.config.backdropBlur,
|
|
9410
9440
|
};
|
|
9411
|
-
//
|
|
9412
|
-
//
|
|
9413
|
-
//
|
|
9414
|
-
|
|
9441
|
+
// Reset session lifecycle before every modal open. Without this, the
|
|
9442
|
+
// AbortController aborted on close() would short-circuit the next
|
|
9443
|
+
// session's first request as "Request cancelled".
|
|
9444
|
+
this.api.resetSession();
|
|
9415
9445
|
return new Promise((resolve, reject) => {
|
|
9416
|
-
this.renderer = new UploadRenderer(container, api, mergedOptions, {
|
|
9446
|
+
this.renderer = new UploadRenderer(container, this.api, mergedOptions, {
|
|
9417
9447
|
onSuccess: (result) => {
|
|
9418
9448
|
options.onSuccess?.(result);
|
|
9419
9449
|
resolve(result);
|