@sparkvault/sdk 1.11.1 → 1.11.2

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.
@@ -16,7 +16,22 @@ export declare class UploadApiError extends SparkVaultError {
16
16
  export declare class UploadApi {
17
17
  private readonly config;
18
18
  private readonly timeoutMs;
19
+ /** Abort controller for cancelling all pending requests on close */
20
+ private closeController;
19
21
  constructor(config: ResolvedConfig);
22
+ /**
23
+ * Abort all pending requests.
24
+ * Call this when the renderer is closed to prevent orphaned requests.
25
+ */
26
+ abort(): void;
27
+ /**
28
+ * Check if the API has been aborted.
29
+ */
30
+ isAborted(): boolean;
31
+ /**
32
+ * Get the abort signal for external use (e.g., XHR uploads).
33
+ */
34
+ getAbortSignal(): AbortSignal;
20
35
  /**
21
36
  * Get vault upload info (public endpoint).
22
37
  */
@@ -25,6 +25,7 @@ export declare class UploadRenderer {
25
25
  private uploadModal;
26
26
  private isInlineMode;
27
27
  private hybridModalInitialized;
28
+ private activeXhr;
28
29
  constructor(container: UploadContainer, api: UploadApi, options: UploadOptions, callbacks: RendererCallbacks);
29
30
  /**
30
31
  * Start the upload flow.
@@ -32,6 +33,7 @@ export declare class UploadRenderer {
32
33
  start(): Promise<void>;
33
34
  /**
34
35
  * Close the upload flow.
36
+ * Cancels all pending API requests and active uploads to prevent orphaned operations.
35
37
  */
36
38
  close(): void;
37
39
  private handleClose;
@@ -57,7 +59,8 @@ export declare class UploadRenderer {
57
59
  private startUpload;
58
60
  private uploadWithTus;
59
61
  /**
60
- * Upload a single chunk using XMLHttpRequest for progress tracking
62
+ * Upload a single chunk using XMLHttpRequest for progress tracking.
63
+ * Tracks the XHR so it can be cancelled if the renderer is closed.
61
64
  */
62
65
  private uploadChunkWithProgress;
63
66
  private runCeremony;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "description": "SparkVault JavaScript SDK - Identity Verification and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "main": "dist/sparkvault.cjs.js",