@sparkvault/sdk-js 17.0.1 → 17.0.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.
- package/README.md +3 -3
- package/dist/api-base.d.ts +2 -2
- package/dist/config.d.ts +1 -1
- package/dist/entropy/index.d.ts +2 -2
- package/dist/entropy/types.d.ts +1 -1
- package/dist/errors.d.ts +3 -3
- package/dist/http.d.ts +1 -1
- package/dist/index.cjs +197 -189
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +150 -150
- package/dist/index.mjs +197 -189
- package/dist/index.mjs.map +1 -1
- package/dist/ingots/index.d.ts +10 -10
- package/dist/ingots/types.d.ts +3 -3
- package/dist/notify/index.d.ts +8 -8
- package/dist/notify/types.d.ts +10 -10
- package/dist/products/identity/api.d.ts +5 -5
- package/dist/products/identity/dialog-launcher.d.ts +2 -2
- package/dist/products/identity/handlers/otp-handler.d.ts +1 -1
- package/dist/products/identity/handlers/passkey-handler.d.ts +4 -4
- package/dist/products/identity/index.d.ts +11 -11
- package/dist/products/identity/renderer.d.ts +10 -10
- package/dist/products/identity/types.d.ts +10 -10
- package/dist/products/identity/utils.d.ts +3 -3
- package/dist/products/identity/views/backup-verify.d.ts +3 -3
- package/dist/products/identity/views/error.d.ts +1 -1
- package/dist/products/identity/views/identity-input.d.ts +1 -1
- package/dist/products/identity/views/method-select.d.ts +1 -1
- package/dist/products/identity/views/origin-not-allowed.d.ts +2 -2
- package/dist/products/identity/views/passkey-auto.d.ts +1 -1
- package/dist/products/identity/views/product-not-configured.d.ts +2 -2
- package/dist/products/identity/views/service-unavailable.d.ts +1 -1
- package/dist/products/index.d.ts +1 -1
- package/dist/products/notify/index.d.ts +21 -21
- package/dist/products/notify/types.d.ts +65 -65
- package/dist/products/structured-ingots/types.d.ts +2 -2
- package/dist/sparks/index.d.ts +1 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/utils/dom.d.ts +3 -3
- package/dist/vaults/index.d.ts +2 -2
- package/dist/vaults/types.d.ts +2 -2
- package/dist/vaults/upload/api.d.ts +14 -14
- package/dist/vaults/upload/renderer.d.ts +1 -1
- package/dist/vaults/upload/styles.d.ts +1 -1
- package/package.json +1 -1
package/dist/utils/dom.d.ts
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function onDomReady(callback: () => void): void;
|
|
12
12
|
/**
|
|
13
|
-
* Attach a click handler to every element matching `selector
|
|
13
|
+
* Attach a click handler to every element matching `selector`: both elements
|
|
14
14
|
* present once the DOM is ready and elements added later (observed via
|
|
15
15
|
* MutationObserver).
|
|
16
16
|
*
|
|
17
17
|
* Each call is fully self-contained: the element bookkeeping lives in this
|
|
18
18
|
* closure, so the returned cleanup removes only the listeners this call
|
|
19
|
-
* registered. Multiple attachments
|
|
20
|
-
* element attached twice
|
|
19
|
+
* registered. Multiple attachments (different selectors, or even the same
|
|
20
|
+
* element attached twice) never interfere with one another.
|
|
21
21
|
*
|
|
22
22
|
* @param selector - CSS selector for elements to attach to
|
|
23
23
|
* @param onClick - Click handler to register on every matching element
|
package/dist/vaults/index.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ export declare class VaultsModule {
|
|
|
101
101
|
*/
|
|
102
102
|
updateResealSettings(vaultId: string, settings: VaultResealSettings): Promise<VaultResealSettingsResult>;
|
|
103
103
|
/**
|
|
104
|
-
* Retain this many previous versions of each file or structured object (0
|
|
104
|
+
* Retain this many previous versions of each file or structured object (0 to 50,
|
|
105
105
|
* default 0). Interactive company administrators only. Applies on each ingot's
|
|
106
106
|
* next successful content change; retained versions count toward storage usage.
|
|
107
107
|
*/
|
|
@@ -143,7 +143,7 @@ export declare class VaultsModule {
|
|
|
143
143
|
* Requires the vault's exact name as confirmation, matched case-sensitively.
|
|
144
144
|
* The name is sent base64(UTF-8) as the `X-Confirm-Name-B64` header so a vault
|
|
145
145
|
* named with any Unicode (emoji, CJK, the U+202F in macOS-style names) is
|
|
146
|
-
* deletable
|
|
146
|
+
* deletable: an HTTP header value cannot carry non-latin1 characters.
|
|
147
147
|
*
|
|
148
148
|
* @example
|
|
149
149
|
* await sv.vaults.delete('vlt_abc', 'My Vault');
|
package/dist/vaults/types.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ export interface VaultSummary extends VaultLifecycle {
|
|
|
122
122
|
ingotCount: number;
|
|
123
123
|
/** Total storage used in bytes */
|
|
124
124
|
storageBytes: number;
|
|
125
|
-
/** Previous versions retained per file or structured object (0
|
|
125
|
+
/** Previous versions retained per file or structured object (0 to 50); absent on older servers. */
|
|
126
126
|
ingotVersionLimit?: number;
|
|
127
127
|
/** @deprecated Use ingotVersionLimit. */
|
|
128
128
|
structuredIngotVersionLimit?: number;
|
|
@@ -131,7 +131,7 @@ export interface VaultSummary extends VaultLifecycle {
|
|
|
131
131
|
}
|
|
132
132
|
/** Options for list. */
|
|
133
133
|
export interface ListVaultsOptions {
|
|
134
|
-
/** Page size (1
|
|
134
|
+
/** Page size (1 to 500; server default 100) */
|
|
135
135
|
limit?: number;
|
|
136
136
|
/** Pagination cursor from a prior page's `nextCursor` */
|
|
137
137
|
cursor?: string;
|
|
@@ -10,7 +10,7 @@ import { SparkVaultError } from '../../errors';
|
|
|
10
10
|
import type { VaultUploadConfig, VaultUploadInfoResponse } from './types';
|
|
11
11
|
/**
|
|
12
12
|
* Error class for upload API errors. Inherits `code` and `statusCode` from
|
|
13
|
-
* SparkVaultError
|
|
13
|
+
* SparkVaultError, with no duplicate `httpStatus` field.
|
|
14
14
|
*
|
|
15
15
|
* A failed transfer request also carries what the transfer policy
|
|
16
16
|
* (`@sparkvault/app-sdk/transfer-retry`) makes of its answer, read where the
|
|
@@ -55,7 +55,7 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
55
55
|
* Vault upload info by vault id, memoized for the life of this client.
|
|
56
56
|
*
|
|
57
57
|
* The client is built once with the SDK and the map dies with the page, so
|
|
58
|
-
* the memo cannot outlive the page it decorates
|
|
58
|
+
* the memo cannot outlive the page it decorates, which is why there is no
|
|
59
59
|
* TTL and no invalidation API to get wrong. It deliberately survives
|
|
60
60
|
* `resetSession()`, alongside the other long-lived per-client state.
|
|
61
61
|
*/
|
|
@@ -67,7 +67,7 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
67
67
|
* retries, a cancel aside; a refused API call it raises with its status is
|
|
68
68
|
* Core's verdict, never a transfer's, so of the policy's reading it carries
|
|
69
69
|
* only the floor Core named (`retryAfterMs`), for whoever acts on the
|
|
70
|
-
* refusal
|
|
70
|
+
* refusal, and Core's final refusal of the upload a call stages is that
|
|
71
71
|
* upload's `upload_refused` ({@link stagingRefusal}).
|
|
72
72
|
*/
|
|
73
73
|
protected makeError(message: string, code: string, statusCode: number, details?: Record<string, unknown>, retryAfterMs?: number | null): UploadApiError;
|
|
@@ -86,13 +86,13 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
86
86
|
/**
|
|
87
87
|
* Get vault upload info (public endpoint), fetched at most once per vault.
|
|
88
88
|
*
|
|
89
|
-
* Every widget interaction
|
|
90
|
-
* an `attach()` handler serves
|
|
89
|
+
* Every widget interaction (`upload()`, `pop()`, `render()`, and each click
|
|
90
|
+
* an `attach()` handler serves) starts by asking for this, and the answer is
|
|
91
91
|
* pure display and geometry: the vault's name, its branding, and the size it
|
|
92
92
|
* advertises. It authorizes nothing. The server re-validates the vault, its
|
|
93
93
|
* upload source, the request origin, and the file size on the POST that
|
|
94
94
|
* actually creates the upload, and that re-validation is the correctness
|
|
95
|
-
* backstop for this whole flow
|
|
95
|
+
* backstop for this whole flow: a memoized answer can never widen what an
|
|
96
96
|
* upload is allowed to do, and the backstop must stay in place.
|
|
97
97
|
*
|
|
98
98
|
* Only a successful answer is kept: a rejection evicts its entry so the next
|
|
@@ -112,7 +112,7 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
112
112
|
/**
|
|
113
113
|
* Upload a file to Forge over the TUS resumable protocol (v1.0.0).
|
|
114
114
|
*
|
|
115
|
-
* The single canonical browser transfer path
|
|
115
|
+
* The single canonical browser transfer path: the upload widget and the
|
|
116
116
|
* authenticated `ingots.upload` flow both go through here (one canonical
|
|
117
117
|
* transfer path). Creates the session, PATCHes chunks sized exactly by the
|
|
118
118
|
* server's `X-Chunk-Size` (Forge fixes the geometry at 50MB, which keeps
|
|
@@ -123,7 +123,7 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
123
123
|
* Every answer is read through the transfer policy
|
|
124
124
|
* (`@sparkvault/app-sdk/transfer-retry`) and every retry spends one budget
|
|
125
125
|
* ({@link TusTransfer}). A chunk that fails in transit is resent only from
|
|
126
|
-
* an offset the server just named
|
|
126
|
+
* an offset the server just named: a 409's own `Upload-Offset` at once,
|
|
127
127
|
* otherwise a HEAD after the backoff ({@link offsetAfterFailure}); a session
|
|
128
128
|
* the server no longer holds throws `session_gone`, which only a new upload
|
|
129
129
|
* recovers from (any code of Core's the server named rides
|
|
@@ -193,7 +193,7 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
193
193
|
*/
|
|
194
194
|
private backOff;
|
|
195
195
|
/**
|
|
196
|
-
* Confirm the server finalized a fully received upload
|
|
196
|
+
* Confirm the server finalized a fully received upload: the one receipt
|
|
197
197
|
* every transfer ends on.
|
|
198
198
|
*
|
|
199
199
|
* The server persists the session's final offset BEFORE it finalizes, so a
|
|
@@ -201,7 +201,7 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
201
201
|
* size while finalization failed or is still running, and reporting that as
|
|
202
202
|
* success would hand the user a stored file whose ingot was never published.
|
|
203
203
|
* The zero-length PATCH at the final offset is the server's finalization
|
|
204
|
-
* re-drive
|
|
204
|
+
* re-drive: it short-circuits to 204 on an already-finalized session, and
|
|
205
205
|
* on a received-but-unfinalized one it answers only after publication.
|
|
206
206
|
*
|
|
207
207
|
* While another request finalizes the receipt answers 409 with
|
|
@@ -234,12 +234,12 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
234
234
|
*/
|
|
235
235
|
private readResumeOffset;
|
|
236
236
|
/**
|
|
237
|
-
* Judge an offset the server named for the upload to resume from
|
|
238
|
-
* or a 409's `Upload-Offset`
|
|
237
|
+
* Judge an offset the server named for the upload to resume from (a HEAD's,
|
|
238
|
+
* or a 409's `Upload-Offset`): the one place a server-reported resume point
|
|
239
239
|
* is judged.
|
|
240
240
|
*
|
|
241
241
|
* Forge commits a chunk before it answers, so a PATCH that died in transit
|
|
242
|
-
* may have landed in full or not at all (never in part
|
|
242
|
+
* may have landed in full or not at all (never in part: the chunk object
|
|
243
243
|
* is written atomically before the offset advances); only the session's own
|
|
244
244
|
* persisted offset knows which, and the client's arithmetic is worthless
|
|
245
245
|
* here.
|
|
@@ -286,7 +286,7 @@ export declare class UploadApi extends SparkVaultApi {
|
|
|
286
286
|
*/
|
|
287
287
|
private patchChunk;
|
|
288
288
|
/**
|
|
289
|
-
* Read the server's persisted upload offset via a TUS HEAD request
|
|
289
|
+
* Read the server's persisted upload offset via a TUS HEAD request: the one
|
|
290
290
|
* place the client asks Forge where a session really stands.
|
|
291
291
|
*
|
|
292
292
|
* @param check - Which caller this read serves; shapes the failure copy.
|
|
@@ -51,7 +51,7 @@ export declare class UploadRenderer {
|
|
|
51
51
|
close(): void;
|
|
52
52
|
/**
|
|
53
53
|
* Cancel the flow: tear everything down and fire the cancel contract
|
|
54
|
-
* exactly once. onCancel and onError are mutually exclusive
|
|
54
|
+
* exactly once. onCancel and onError are mutually exclusive: a deliberate
|
|
55
55
|
* cancellation (user close, programmatic close, or a new upload replacing
|
|
56
56
|
* this renderer) must never surface as an error to the host.
|
|
57
57
|
*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Inject upload widget styles into the document head.
|
|
11
|
-
* Idempotent: the stylesheet is static and shared by every widget instance
|
|
11
|
+
* Idempotent: the stylesheet is static and shared by every widget instance;
|
|
12
12
|
* per-instance behavior (backdrop blur, dark mode) is driven by class toggles.
|
|
13
13
|
*/
|
|
14
14
|
export declare function injectUploadStyles(): void;
|