@sparkvault/sdk-js 9.2.2 → 9.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.
@@ -16,6 +16,15 @@ export declare class UploadApiError extends SparkVaultError {
16
16
  }
17
17
  export declare class UploadApi extends SparkVaultApi {
18
18
  private readonly config;
19
+ /**
20
+ * Vault upload info by vault id, memoized for the life of this client.
21
+ *
22
+ * The client is built once with the SDK and the map dies with the page, so
23
+ * the memo cannot outlive the page it decorates — which is why there is no
24
+ * TTL and no invalidation API to get wrong. It deliberately survives
25
+ * `resetSession()`, alongside the other long-lived per-client state.
26
+ */
27
+ private readonly vaultInfoMemo;
19
28
  constructor(config: ResolvedConfig);
20
29
  protected makeError(message: string, code: string, statusCode: number, details?: Record<string, unknown>): UploadApiError;
21
30
  /**
@@ -23,9 +32,23 @@ export declare class UploadApi extends SparkVaultApi {
23
32
  */
24
33
  private request;
25
34
  /**
26
- * Get vault upload info (public endpoint).
35
+ * Get vault upload info (public endpoint), fetched at most once per vault.
36
+ *
37
+ * Every widget interaction — `upload()`, `pop()`, `render()`, and each click
38
+ * an `attach()` handler serves — starts by asking for this, and the answer is
39
+ * pure display and geometry: the vault's name, its branding, and the size it
40
+ * advertises. It authorizes nothing. The server re-validates the vault, its
41
+ * upload source, the request origin, and the file size on the POST that
42
+ * actually creates the upload, and that re-validation is the correctness
43
+ * backstop for this whole flow — a memoized answer can never widen what an
44
+ * upload is allowed to do, and the backstop must stay in place.
45
+ *
46
+ * Only a successful answer is kept: a rejection evicts its entry so the next
47
+ * open retries against the server, and an entry whose request was aborted by
48
+ * a closing widget is never handed to the widget that replaces it.
27
49
  */
28
50
  getVaultUploadInfo(vaultId: string): Promise<VaultUploadConfig>;
51
+ private fetchVaultUploadInfo;
29
52
  /**
30
53
  * Initiate an upload to get Forge URL and ingot ID.
31
54
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk-js",
3
- "version": "9.2.2",
3
+ "version": "9.2.4",
4
4
  "description": "SparkVault JavaScript SDK - Identity Verification and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "exports": {