@sparkvault/sdk-js 2.0.2 → 2.0.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/identity/api.d.ts +11 -1
- package/dist/identity/handlers/totp-handler.d.ts +8 -0
- package/dist/identity/renderer.d.ts +1 -0
- package/dist/identity/types.d.ts +26 -0
- package/dist/identity/views/index.d.ts +1 -0
- package/dist/identity/views/two-factor.d.ts +37 -0
- package/dist/sparkvault.cjs.js +327 -1
- package/dist/sparkvault.cjs.js.map +1 -1
- package/dist/sparkvault.esm.js +327 -1
- 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 +28 -0
- package/package.json +1 -1
|
@@ -33,4 +33,32 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
33
33
|
forgeUrl: string;
|
|
34
34
|
ingotId: string;
|
|
35
35
|
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Confirm the upload was finalized SERVER-SIDE before reporting success.
|
|
38
|
+
*
|
|
39
|
+
* The TUS PATCH loop trusts a server-provided `Upload-Offset`; a buggy or
|
|
40
|
+
* malicious Forge could return an inflated offset before every chunk was
|
|
41
|
+
* actually committed and encrypted. This re-reads the server's own
|
|
42
|
+
* persisted offset via a TUS HEAD (which Forge only advances on a real S3
|
|
43
|
+
* commit) and requires it to reach the declared total — the web equivalent
|
|
44
|
+
* of the mobile SDK's `verifyIngotActive` (status === 'active') guarantee.
|
|
45
|
+
*
|
|
46
|
+
* Polls because the final chunk's commit and the offset write can lag the
|
|
47
|
+
* PATCH acknowledgement by a moment. Throws on a non-2xx HEAD, on a session
|
|
48
|
+
* that never reaches the expected offset within the poll budget, or on a
|
|
49
|
+
* cancelled session — never reports a half-finished upload as done.
|
|
50
|
+
*
|
|
51
|
+
* @param uploadUrl - The TUS session URL (Forge `Location`, ISTK-bound).
|
|
52
|
+
* @param expectedOffset - The declared total upload size in bytes.
|
|
53
|
+
*/
|
|
54
|
+
verifyUploadFinalized(uploadUrl: string, expectedOffset: number): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Read the server's persisted upload offset via a TUS HEAD request.
|
|
57
|
+
*
|
|
58
|
+
* Uses raw `fetch` rather than the JSON envelope helper: TUS responses
|
|
59
|
+
* carry an empty body and surface state in the `Upload-Offset` header.
|
|
60
|
+
* Honors the session abort signal and request timeout like every other
|
|
61
|
+
* client call.
|
|
62
|
+
*/
|
|
63
|
+
private headUploadOffset;
|
|
36
64
|
}
|