@sparkvault/sdk-js 19.0.0 → 19.1.0
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 +26 -4
- package/dist/npm/chunks/index-BnP-2w0t.cjs +13025 -0
- package/dist/npm/chunks/index-BnP-2w0t.cjs.map +1 -0
- package/dist/npm/chunks/index-CgR08uMG.mjs +12960 -0
- package/dist/npm/chunks/index-CgR08uMG.mjs.map +1 -0
- package/dist/npm/identity.cjs +23 -0
- package/dist/npm/identity.cjs.map +1 -0
- package/dist/npm/identity.mjs +12 -0
- package/dist/npm/identity.mjs.map +1 -0
- package/dist/{index.cjs → npm/index.cjs} +799 -13755
- package/dist/npm/index.cjs.map +1 -0
- package/dist/{index.mjs → npm/index.mjs} +200 -13155
- package/dist/npm/index.mjs.map +1 -0
- package/dist/sparkvault-identity.js +2 -0
- package/dist/sparkvault-identity.js.map +1 -0
- package/dist/sparkvault.js +1 -1
- package/dist/types/identity.d.ts +8 -0
- package/dist/{index.d.ts → types/index.d.ts} +4 -790
- package/dist/types/shared/errors-C-gjmGBs.d.ts +800 -0
- package/package.json +20 -9
- package/dist/api-base.d.ts +0 -116
- package/dist/auto-init.d.ts +0 -32
- package/dist/config.d.ts +0 -79
- package/dist/entropy/index.d.ts +0 -35
- package/dist/entropy/types.d.ts +0 -32
- package/dist/errors.d.ts +0 -146
- package/dist/folders/index.d.ts +0 -102
- package/dist/folders/types.d.ts +0 -91
- package/dist/health.d.ts +0 -18
- package/dist/http.d.ts +0 -46
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/ingots/fetch-download.d.ts +0 -78
- package/dist/ingots/history.d.ts +0 -4
- package/dist/ingots/index.d.ts +0 -388
- package/dist/ingots/revision.d.ts +0 -4
- package/dist/ingots/types.d.ts +0 -556
- package/dist/logger.d.ts +0 -32
- package/dist/notify/index.d.ts +0 -154
- package/dist/notify/types.d.ts +0 -232
- package/dist/products/help-desk/client.d.ts +0 -198
- package/dist/products/help-desk/desk-id.d.ts +0 -2
- package/dist/products/help-desk/form-draft.d.ts +0 -37
- package/dist/products/help-desk/form-types.d.ts +0 -123
- package/dist/products/help-desk/form.d.ts +0 -83
- package/dist/products/help-desk/index.d.ts +0 -47
- package/dist/products/help-desk/kb-client.d.ts +0 -48
- package/dist/products/help-desk/kb-types.d.ts +0 -59
- package/dist/products/help-desk/modal.d.ts +0 -8
- package/dist/products/help-desk/styles.d.ts +0 -9
- package/dist/products/help-desk/support-analytics-types.d.ts +0 -32
- package/dist/products/help-desk/support-analytics.d.ts +0 -3
- package/dist/products/help-desk/support-brand.d.ts +0 -49
- package/dist/products/help-desk/support-controller.d.ts +0 -4
- package/dist/products/help-desk/support-history.d.ts +0 -38
- package/dist/products/help-desk/support-launcher.d.ts +0 -12
- package/dist/products/help-desk/support-styles.d.ts +0 -14
- package/dist/products/help-desk/support-types.d.ts +0 -66
- package/dist/products/help-desk/support-view.d.ts +0 -173
- package/dist/products/help-desk/types.d.ts +0 -285
- package/dist/products/help-desk/widget-identity.d.ts +0 -32
- package/dist/products/identity/api.d.ts +0 -237
- package/dist/products/identity/container.d.ts +0 -44
- package/dist/products/identity/dialog-launcher.d.ts +0 -133
- package/dist/products/identity/federation-flow.d.ts +0 -31
- package/dist/products/identity/handlers/otp-handler.d.ts +0 -69
- package/dist/products/identity/handlers/passkey-handler.d.ts +0 -105
- package/dist/products/identity/handlers/sparklink-handler.d.ts +0 -34
- package/dist/products/identity/index.d.ts +0 -296
- package/dist/products/identity/inline-container.d.ts +0 -53
- package/dist/products/identity/methods.d.ts +0 -19
- package/dist/products/identity/modal.d.ts +0 -51
- package/dist/products/identity/pending-signin.d.ts +0 -102
- package/dist/products/identity/popup-launcher.d.ts +0 -73
- package/dist/products/identity/renderer.d.ts +0 -525
- package/dist/products/identity/state.d.ts +0 -84
- package/dist/products/identity/styles.d.ts +0 -31
- package/dist/products/identity/types.d.ts +0 -561
- package/dist/products/identity/utils/cooldown-timer.d.ts +0 -73
- package/dist/products/identity/utils.d.ts +0 -85
- package/dist/products/identity/views/backup-verify.d.ts +0 -42
- package/dist/products/identity/views/base.d.ts +0 -51
- package/dist/products/identity/views/error.d.ts +0 -65
- package/dist/products/identity/views/icons.d.ts +0 -41
- package/dist/products/identity/views/identity-input.d.ts +0 -80
- package/dist/products/identity/views/index.d.ts +0 -20
- package/dist/products/identity/views/loading.d.ts +0 -23
- package/dist/products/identity/views/method-button.d.ts +0 -14
- package/dist/products/identity/views/method-select.d.ts +0 -42
- package/dist/products/identity/views/origin-not-allowed.d.ts +0 -25
- package/dist/products/identity/views/otp-verify.d.ts +0 -58
- package/dist/products/identity/views/passkey-auto.d.ts +0 -22
- package/dist/products/identity/views/passkey-prompt.d.ts +0 -25
- package/dist/products/identity/views/passkey.d.ts +0 -38
- package/dist/products/identity/views/product-not-configured.d.ts +0 -21
- package/dist/products/identity/views/service-unavailable.d.ts +0 -21
- package/dist/products/identity/views/sms-consent.d.ts +0 -16
- package/dist/products/identity/views/sparklink-waiting.d.ts +0 -40
- package/dist/products/identity/views/two-factor.d.ts +0 -37
- package/dist/products/index.d.ts +0 -51
- package/dist/products/messaging/index.d.ts +0 -38
- package/dist/products/messaging/types.d.ts +0 -162
- package/dist/products/notify/index.d.ts +0 -436
- package/dist/products/notify/project-types.d.ts +0 -44
- package/dist/products/notify/projects.d.ts +0 -15
- package/dist/products/notify/types.d.ts +0 -1327
- package/dist/products/structured-ingots/index.d.ts +0 -31
- package/dist/products/structured-ingots/types-client.d.ts +0 -19
- package/dist/products/structured-ingots/types.d.ts +0 -293
- package/dist/products/structured-ingots/validation.d.ts +0 -25
- package/dist/request-path.d.ts +0 -44
- package/dist/sparks/index.d.ts +0 -91
- package/dist/sparks/types.d.ts +0 -304
- package/dist/ui/chrome.d.ts +0 -16
- package/dist/ui/ds-tokens.d.ts +0 -59
- package/dist/ui/inline-shell.d.ts +0 -19
- package/dist/ui/live-region.d.ts +0 -15
- package/dist/ui/modal-shell.d.ts +0 -67
- package/dist/ui/target.d.ts +0 -6
- package/dist/utils/dom.d.ts +0 -26
- package/dist/vault-session.d.ts +0 -2
- package/dist/vaults/index.d.ts +0 -254
- package/dist/vaults/types.d.ts +0 -368
- package/dist/vaults/upload/api.d.ts +0 -310
- package/dist/vaults/upload/chrome.d.ts +0 -21
- package/dist/vaults/upload/container.d.ts +0 -37
- package/dist/vaults/upload/index.d.ts +0 -76
- package/dist/vaults/upload/inline-container.d.ts +0 -41
- package/dist/vaults/upload/modal.d.ts +0 -55
- package/dist/vaults/upload/renderer.d.ts +0 -150
- package/dist/vaults/upload/styles.d.ts +0 -14
- package/dist/vaults/upload/types.d.ts +0 -220
package/dist/ingots/types.d.ts
DELETED
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ingots Module Types
|
|
3
|
-
*
|
|
4
|
-
* Ingot operations run against an unsealed vault: every call carries the
|
|
5
|
-
* vault's short-lived Vault Access Token (VAT) via the `X-Vault-Access-Token`
|
|
6
|
-
* header. Public domain objects are camelCase; wire shapes (snake_case) stay
|
|
7
|
-
* private to the module.
|
|
8
|
-
*/
|
|
9
|
-
import type { UnsealedVault } from '../vaults/types';
|
|
10
|
-
import type { Folder, FolderBreadcrumbItem, FolderWire } from '../folders/types';
|
|
11
|
-
export type { UnsealedVault };
|
|
12
|
-
/**
|
|
13
|
-
* What the server does when a create's name is already held in the target
|
|
14
|
-
* folder (case-insensitive). The server decides on the holder it read before
|
|
15
|
-
* writing anything, so a caller that must not replace content says so here:
|
|
16
|
-
* - `upsert` (the server default): the upload replaces the holder's content.
|
|
17
|
-
* - `complete_pending`: a holder whose own upload never finalized is completed
|
|
18
|
-
* (`created: false`); a published holder is refused with a 409 CONFLICT whose
|
|
19
|
-
* `details.reason` is `'NAME_HELD'`, and is left untouched. The details
|
|
20
|
-
* describe the holder (`ingot_id`, `status`, `size_bytes`) unless another
|
|
21
|
-
* app manages it or another request claimed the name first, when they carry
|
|
22
|
-
* the reason alone.
|
|
23
|
-
* - `refuse`: any holder, its upload finished or not, is refused with that
|
|
24
|
-
* same 409 and left untouched; the create only ever mints.
|
|
25
|
-
* - `new_name`: the holder is never touched; the ingot is minted under the
|
|
26
|
-
* first free numbered name the server picks ("report (2).pdf"), returned as
|
|
27
|
-
* the result's `name`.
|
|
28
|
-
*/
|
|
29
|
-
export declare const NAME_CONFLICT_POLICIES: readonly ["upsert", "complete_pending", "refuse", "new_name"];
|
|
30
|
-
export type NameConflictPolicy = (typeof NAME_CONFLICT_POLICIES)[number];
|
|
31
|
-
/** Ingot metadata as returned by list/get/contents. */
|
|
32
|
-
export interface Ingot {
|
|
33
|
-
/** Ingot ID */
|
|
34
|
-
id: string;
|
|
35
|
-
/** Ingot name */
|
|
36
|
-
name: string;
|
|
37
|
-
/**
|
|
38
|
-
* The name a download of the ingot saves under, as Forge names it: `name`,
|
|
39
|
-
* kept as it is when the first word of the extension it shows (up to an
|
|
40
|
-
* ASCII space, in any case) is one the MIME registry knows or holds a
|
|
41
|
-
* character none of the registry's extensions is spelled with, which may
|
|
42
|
-
* draw as one, and otherwise completed with the extension `contentType`'s
|
|
43
|
-
* files are named with (the first the registry lists for it, or, for the
|
|
44
|
-
* few types whose first is not the one desktops name their files with, the
|
|
45
|
-
* one they do: `.mp3` for `audio/mpeg`, `.mov` for `video/quicktime`), never
|
|
46
|
-
* one a saved copy must never open as. Save a copy under it, handed to a
|
|
47
|
-
* browser as `application/octet-stream` unless `contentType` is a raster
|
|
48
|
-
* image, audio, video or PDF format (never SVG, a playlist or a stream
|
|
49
|
-
* redirector): a browser renames a saved copy by the type it is handed
|
|
50
|
-
* (Chrome saves `Invoice` typed `application/x-msdownload` as
|
|
51
|
-
* `Invoice.exe`), and completes or replaces no extension of a copy handed
|
|
52
|
-
* as `application/octet-stream`.
|
|
53
|
-
*/
|
|
54
|
-
downloadFilename: string;
|
|
55
|
-
/** Content type (MIME) */
|
|
56
|
-
contentType: string;
|
|
57
|
-
/** Size in bytes */
|
|
58
|
-
size: number;
|
|
59
|
-
/** Lifecycle status: `uploading` until Forge activates the upload, then `active` */
|
|
60
|
-
status: 'uploading' | 'active';
|
|
61
|
-
/** Creation timestamp (Unix seconds) */
|
|
62
|
-
createdAt: number;
|
|
63
|
-
/** Containing folder ID, or null at the vault root */
|
|
64
|
-
folderId: string | null;
|
|
65
|
-
/**
|
|
66
|
-
* Client-computed, vault-keyed HMAC of the plaintext (43-char base64url),
|
|
67
|
-
* or null when the uploader did not supply one.
|
|
68
|
-
*/
|
|
69
|
-
contentHmac: string | null;
|
|
70
|
-
/** Opaque published-content revision; null for legacy/unpublished content. */
|
|
71
|
-
contentVersion: string | null;
|
|
72
|
-
/** Object identity and publication together; absent on older servers. */
|
|
73
|
-
revision?: string;
|
|
74
|
-
}
|
|
75
|
-
/** The discrete primitive returned by createUpload: a Forge TUS session. */
|
|
76
|
-
export interface IngotUpload {
|
|
77
|
-
/** Ingot ID */
|
|
78
|
-
id: string;
|
|
79
|
-
/** The name the ingot is stored under: the server's numbered name under `new_name`. */
|
|
80
|
-
name: string;
|
|
81
|
-
/** Content type (MIME) */
|
|
82
|
-
contentType: string;
|
|
83
|
-
/** Size in bytes */
|
|
84
|
-
size: number;
|
|
85
|
-
/** Forge upload URL carrying the ISTK (upload session token) */
|
|
86
|
-
uploadUrl: string;
|
|
87
|
-
/** Upload session expiry (Unix seconds) */
|
|
88
|
-
expiresAt: number;
|
|
89
|
-
/**
|
|
90
|
-
* Whether the server minted this ingot (true) or staged the upload onto the
|
|
91
|
-
* ingot already holding the name (false, as `onNameConflict` allowed).
|
|
92
|
-
*/
|
|
93
|
-
created: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* The upload the create staged onto the ingot (Core's `upload_id`): the id
|
|
96
|
-
* Forge keys the upload's session by, and the `contentVersion` the ingot
|
|
97
|
-
* reads once the upload publishes. Giving the upload up ends it with the
|
|
98
|
-
* file the create made through this id (`endUpload`). Null when the server
|
|
99
|
-
* named none.
|
|
100
|
-
*/
|
|
101
|
-
uploadId: string | null;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* What became of a given-up upload's file (`endUpload`): `deleted`, the vault
|
|
105
|
-
* holds it no longer (this end deleted it, or it was already gone); `kept`,
|
|
106
|
-
* this end deleted nothing, and a read of it by id (`get`) shows the file as
|
|
107
|
-
* it is now.
|
|
108
|
-
*/
|
|
109
|
-
export type UploadEnd = 'deleted' | 'kept';
|
|
110
|
-
/** A finalized ingot, returned by the high-level upload/replace flows. */
|
|
111
|
-
export interface CreatedIngot {
|
|
112
|
-
/** Ingot ID */
|
|
113
|
-
id: string;
|
|
114
|
-
/** The name the ingot is stored under: the server's numbered name under `new_name`. */
|
|
115
|
-
name: string;
|
|
116
|
-
/** Content type (MIME) */
|
|
117
|
-
contentType: string;
|
|
118
|
-
/** Size in bytes */
|
|
119
|
-
size: number;
|
|
120
|
-
/**
|
|
121
|
-
* Whether the upload minted this ingot (true) or replaced the content of an
|
|
122
|
-
* existing one (false): a same-name upload the name-conflict policy staged
|
|
123
|
-
* onto its holder, or any `replace`.
|
|
124
|
-
*/
|
|
125
|
-
created: boolean;
|
|
126
|
-
}
|
|
127
|
-
/** Options shared by download and createDownloadLink. */
|
|
128
|
-
export interface DownloadIngotOptions {
|
|
129
|
-
/** False for automatic display/prefetch: fetching bytes will not extend vault inactivity. */
|
|
130
|
-
countAsActivity?: boolean;
|
|
131
|
-
}
|
|
132
|
-
/** The discrete primitive returned by createDownloadLink. */
|
|
133
|
-
export interface IngotDownloadLink {
|
|
134
|
-
/** Opaque published-content revision; null for legacy content. */
|
|
135
|
-
contentVersion: string | null;
|
|
136
|
-
/** Revision observed when the link was minted, not necessarily the bytes it later serves. */
|
|
137
|
-
revision?: string;
|
|
138
|
-
/** Short-lived signed Forge download URL */
|
|
139
|
-
downloadUrl: string;
|
|
140
|
-
/** Ingot ID */
|
|
141
|
-
id: string;
|
|
142
|
-
/** Ingot name */
|
|
143
|
-
name: string;
|
|
144
|
-
/** Size in bytes */
|
|
145
|
-
size: number;
|
|
146
|
-
/** Content type (MIME) */
|
|
147
|
-
contentType: string;
|
|
148
|
-
}
|
|
149
|
-
/** Downloaded bytes and the revision they belong to, for guarded read-modify-write. */
|
|
150
|
-
export interface IngotDownload {
|
|
151
|
-
blob: Blob;
|
|
152
|
-
revision: string;
|
|
153
|
-
}
|
|
154
|
-
/** One retained publication; current content is not included in version history. */
|
|
155
|
-
export interface IngotVersion {
|
|
156
|
-
versionId: string;
|
|
157
|
-
publishedAt: number;
|
|
158
|
-
sizeBytes: number;
|
|
159
|
-
/** Absent for publications retained before MIME metadata was recorded. */
|
|
160
|
-
contentType?: string;
|
|
161
|
-
}
|
|
162
|
-
export interface IngotHistory {
|
|
163
|
-
id: string;
|
|
164
|
-
/** Maximum previous versions retained on the next successful content change. */
|
|
165
|
-
versionLimit: number;
|
|
166
|
-
/** Retained publications, newest first. */
|
|
167
|
-
versions: IngotVersion[];
|
|
168
|
-
}
|
|
169
|
-
/** A one-use download link bound to a retained publication. */
|
|
170
|
-
export interface IngotVersionDownloadLink {
|
|
171
|
-
id: string;
|
|
172
|
-
downloadUrl: string;
|
|
173
|
-
size: number;
|
|
174
|
-
contentVersion: string;
|
|
175
|
-
revision?: string;
|
|
176
|
-
expiresAt: number;
|
|
177
|
-
name?: string;
|
|
178
|
-
contentType?: string;
|
|
179
|
-
}
|
|
180
|
-
export interface DeleteIngotOptions {
|
|
181
|
-
/** Delete only this object publication. Omitted preserves unconditional deletion. */
|
|
182
|
-
expectedRevision?: string;
|
|
183
|
-
}
|
|
184
|
-
/** Options for the createUpload primitive. */
|
|
185
|
-
export interface CreateUploadOptions {
|
|
186
|
-
/** Unsealed vault the ingot belongs to */
|
|
187
|
-
vault: UnsealedVault;
|
|
188
|
-
/** Ingot name */
|
|
189
|
-
name: string;
|
|
190
|
-
/** Content type (MIME) */
|
|
191
|
-
contentType: string;
|
|
192
|
-
/** Declared upload size in bytes */
|
|
193
|
-
sizeBytes: number;
|
|
194
|
-
/** Slash-delimited folder path (find-or-created from root). */
|
|
195
|
-
folder?: string;
|
|
196
|
-
/** Existing folder ID to upload into. Mutually exclusive with `folder`. */
|
|
197
|
-
folderId?: string;
|
|
198
|
-
/** Vault-keyed plaintext HMAC (43-char base64url) to store on the ingot. */
|
|
199
|
-
contentHmac?: string;
|
|
200
|
-
/** What a name already held in the target folder does; omitted means the server's `upsert`. */
|
|
201
|
-
onNameConflict?: NameConflictPolicy;
|
|
202
|
-
}
|
|
203
|
-
/** Options for the high-level upload flow. */
|
|
204
|
-
export interface UploadIngotOptions {
|
|
205
|
-
/** File or Blob to upload */
|
|
206
|
-
file: File | Blob;
|
|
207
|
-
/** Optional name (defaults to file name) */
|
|
208
|
-
name?: string;
|
|
209
|
-
/**
|
|
210
|
-
* Content type (the file's own `type` if not provided). A file of no type is
|
|
211
|
-
* sent with none, and Core stores the type the registry lists for the name's
|
|
212
|
-
* extension, else `application/octet-stream`.
|
|
213
|
-
*/
|
|
214
|
-
contentType?: string;
|
|
215
|
-
/** Slash-delimited folder path (find-or-created from root). */
|
|
216
|
-
folder?: string;
|
|
217
|
-
/** Existing folder ID to upload into. Mutually exclusive with `folder`. */
|
|
218
|
-
folderId?: string;
|
|
219
|
-
/** Vault-keyed plaintext HMAC (43-char base64url) to store on the ingot. */
|
|
220
|
-
contentHmac?: string;
|
|
221
|
-
/** What a name already held in the target folder does; omitted means the server's `upsert`. */
|
|
222
|
-
onNameConflict?: NameConflictPolicy;
|
|
223
|
-
/** Progress callback for the Forge/TUS transfer */
|
|
224
|
-
onProgress?: (bytesUploaded: number, bytesTotal: number) => void;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* The upload session a file's bytes go to, which `sendUpload` hands over once
|
|
228
|
-
* Forge opens it (`onSessionCreated`): what `resumeUpload` continues the
|
|
229
|
-
* upload in. Its URL addresses the upload itself (a request to it can end the
|
|
230
|
-
* upload), so keep it in memory, never in a log or a URL a person shares.
|
|
231
|
-
*/
|
|
232
|
-
export interface UploadSession {
|
|
233
|
-
/** The session's URL on Forge. */
|
|
234
|
-
readonly sessionUrl: string;
|
|
235
|
-
}
|
|
236
|
-
/** Options for sendUpload. */
|
|
237
|
-
export interface SendUploadOptions {
|
|
238
|
-
/** Cancels the transfer. */
|
|
239
|
-
signal?: AbortSignal;
|
|
240
|
-
/** Bytes sent so far and the file size; never runs backwards. */
|
|
241
|
-
onProgress?: (bytesUploaded: number, bytesTotal: number) => void;
|
|
242
|
-
/**
|
|
243
|
-
* Hands over the upload's session once Forge opens it, before the first
|
|
244
|
-
* byte is sent, so the caller can `resumeUpload` the upload in it later:
|
|
245
|
-
* after `upload_received_publishing`, to learn whether the server published
|
|
246
|
-
* it, or after a failure, to send only the bytes the server lacks. A throw
|
|
247
|
-
* here ends the transfer with that error.
|
|
248
|
-
*/
|
|
249
|
-
onSessionCreated?: (session: UploadSession) => void;
|
|
250
|
-
}
|
|
251
|
-
/** Options for resumeUpload. */
|
|
252
|
-
export type ResumeUploadOptions = Omit<SendUploadOptions, 'onSessionCreated'>;
|
|
253
|
-
/** Options for replacing an existing ingot's content. */
|
|
254
|
-
export interface ReplaceIngotOptions {
|
|
255
|
-
/** File or Blob to upload as the new content */
|
|
256
|
-
file: File | Blob;
|
|
257
|
-
/** Replace only the object publication read; stale or recreated targets return 412. */
|
|
258
|
-
expectedRevision?: string;
|
|
259
|
-
/** Optional new name (defaults to file name) */
|
|
260
|
-
name?: string;
|
|
261
|
-
/** Vault-keyed plaintext HMAC (43-char base64url) for the NEW content. */
|
|
262
|
-
contentHmac?: string;
|
|
263
|
-
/**
|
|
264
|
-
* Content type (the file's own `type` if not provided). A file of no type
|
|
265
|
-
* keeps the type the ingot stores, which Core reads from the name by its
|
|
266
|
-
* extension only when it is `application/octet-stream` or unparsable.
|
|
267
|
-
*/
|
|
268
|
-
contentType?: string;
|
|
269
|
-
/** Progress callback for the Forge/TUS transfer */
|
|
270
|
-
onProgress?: (bytesUploaded: number, bytesTotal: number) => void;
|
|
271
|
-
}
|
|
272
|
-
/** Options for list. */
|
|
273
|
-
export interface ListIngotsOptions {
|
|
274
|
-
/** Page size */
|
|
275
|
-
limit?: number;
|
|
276
|
-
/** Pagination cursor */
|
|
277
|
-
cursor?: string;
|
|
278
|
-
/**
|
|
279
|
-
* Sort field (name | size | content_type | created | access_count): it
|
|
280
|
-
* orders only the page answered, never the list across pages
|
|
281
|
-
*/
|
|
282
|
-
sortBy?: string;
|
|
283
|
-
/** Sort direction of the page */
|
|
284
|
-
sortOrder?: 'asc' | 'desc';
|
|
285
|
-
}
|
|
286
|
-
/** Options for listContents. */
|
|
287
|
-
export interface ListContentsOptions {
|
|
288
|
-
/** Folder to list (null/omitted lists the vault root) */
|
|
289
|
-
folderId?: string | null;
|
|
290
|
-
/** Most children on one page (1-500; server default 100) */
|
|
291
|
-
limit?: number;
|
|
292
|
-
/** A prior page's `nextPageToken`, for the same folder and order */
|
|
293
|
-
pageToken?: string;
|
|
294
|
-
/** Ingot creation order; `desc` (newest first) by default */
|
|
295
|
-
sortOrder?: 'asc' | 'desc';
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* One page of a folder's listing. The folder's children run as one sequence
|
|
299
|
-
* across its pages: every direct subfolder first, in a stable order that is
|
|
300
|
-
* not by name, then every ingot directly in the folder in creation order
|
|
301
|
-
* (newest first under `desc`). A page holds at most `limit` children in all,
|
|
302
|
-
* so one page can hold the last subfolders and the first ingots, and a page
|
|
303
|
-
* can hold fewer than `limit`, even none, and still not be the last: follow
|
|
304
|
-
* `nextPageToken`, never the count. Ordering by name, size or type is the
|
|
305
|
-
* caller's, over the children it holds.
|
|
306
|
-
*/
|
|
307
|
-
export interface FolderContents {
|
|
308
|
-
/** The folder listed, on every page; null at the vault root */
|
|
309
|
-
folder: {
|
|
310
|
-
id: string;
|
|
311
|
-
name: string;
|
|
312
|
-
parentId: string | null;
|
|
313
|
-
} | null;
|
|
314
|
-
/** Root → … → the folder listed, on every page */
|
|
315
|
-
breadcrumb: FolderBreadcrumbItem[];
|
|
316
|
-
/** This page's subfolders */
|
|
317
|
-
folders: Folder[];
|
|
318
|
-
/** This page's ingots */
|
|
319
|
-
ingots: Ingot[];
|
|
320
|
-
/** The next page's `pageToken`; null on the last page */
|
|
321
|
-
nextPageToken: string | null;
|
|
322
|
-
}
|
|
323
|
-
/** Options for search. */
|
|
324
|
-
export interface SearchIngotsOptions {
|
|
325
|
-
/**
|
|
326
|
-
* A part of the ingot's file name, matched ignoring letter case, accents
|
|
327
|
-
* and Unicode compatibility forms (`resume` matches `Résumé.pdf`, `strasse`
|
|
328
|
-
* matches `Straße.txt`); a whole name matches too. Results come in creation
|
|
329
|
-
* order, newest first unless `sortOrder` is `asc`, and a page can hold none
|
|
330
|
-
* while `nextCursor` is set: follow it. Text no name can hold is refused
|
|
331
|
-
* (400).
|
|
332
|
-
*/
|
|
333
|
-
q?: string;
|
|
334
|
-
/**
|
|
335
|
-
* The MIME type to match, in lowercase: a family (`image`, `video`,
|
|
336
|
-
* `audio`, `text`, `application`, ...), which every type under it matches,
|
|
337
|
-
* or an exact type (`application/pdf`), which matches that type whatever
|
|
338
|
-
* its parameters. A well-formed value no ingot carries matches none; the
|
|
339
|
-
* server refuses a value that is neither.
|
|
340
|
-
*/
|
|
341
|
-
fileType?: string;
|
|
342
|
-
/** Scope the search to one folder (whole vault when omitted) */
|
|
343
|
-
folderId?: string;
|
|
344
|
-
/** Minimum size in bytes */
|
|
345
|
-
minSize?: number;
|
|
346
|
-
/** Maximum size in bytes */
|
|
347
|
-
maxSize?: number;
|
|
348
|
-
/** Page size */
|
|
349
|
-
limit?: number;
|
|
350
|
-
/** Pagination cursor */
|
|
351
|
-
cursor?: string;
|
|
352
|
-
/** Sort direction */
|
|
353
|
-
sortOrder?: 'asc' | 'desc';
|
|
354
|
-
}
|
|
355
|
-
/** A page of ingots. */
|
|
356
|
-
export interface IngotPage {
|
|
357
|
-
/** Ingots on this page */
|
|
358
|
-
ingots: Ingot[];
|
|
359
|
-
/** Cursor for the next page, when more results exist */
|
|
360
|
-
nextCursor?: string;
|
|
361
|
-
}
|
|
362
|
-
/** Ingot sharing configuration. */
|
|
363
|
-
export interface IngotSharingConfig {
|
|
364
|
-
/** Whether the ingot is shared */
|
|
365
|
-
shared: boolean;
|
|
366
|
-
/** Visibility mode */
|
|
367
|
-
visibility?: 'invite_only' | 'authenticated' | 'public';
|
|
368
|
-
/** The share's permanent files.sv URL, the link its recipients open; null while the ingot is not shared */
|
|
369
|
-
publicUrl: string | null;
|
|
370
|
-
/** The share's link code (the URL's last segment); null while the ingot is not shared */
|
|
371
|
-
linkCode: string | null;
|
|
372
|
-
/** Whether the vault's public file sharing is on */
|
|
373
|
-
sharingEnabled: boolean;
|
|
374
|
-
/** Whether the vault makes every ingot public, which pins this one to public */
|
|
375
|
-
vaultAllIngotsPublic: boolean;
|
|
376
|
-
/** The vault's share recipient session length, in seconds */
|
|
377
|
-
sessionLengthSeconds: number;
|
|
378
|
-
/** Active invites */
|
|
379
|
-
invites?: IngotInvite[];
|
|
380
|
-
}
|
|
381
|
-
/** Options for updateSharingConfig. */
|
|
382
|
-
export interface UpdateIngotSharingOptions {
|
|
383
|
-
/** Whether the ingot is shared */
|
|
384
|
-
shared?: boolean;
|
|
385
|
-
/** Visibility mode */
|
|
386
|
-
visibility?: 'invite_only' | 'authenticated' | 'public';
|
|
387
|
-
}
|
|
388
|
-
/** A sharing invite on an ingot. */
|
|
389
|
-
export interface IngotInvite {
|
|
390
|
-
/** Invite ID */
|
|
391
|
-
id: string;
|
|
392
|
-
/** Invited identity (email/phone) */
|
|
393
|
-
identity: string;
|
|
394
|
-
/** Identity type */
|
|
395
|
-
identityType: 'email' | 'phone';
|
|
396
|
-
/** When this identity was invited (Unix seconds) */
|
|
397
|
-
invitedAt: number;
|
|
398
|
-
}
|
|
399
|
-
/** An invitation addInvite made or resent. */
|
|
400
|
-
export interface IngotInvitation extends IngotInvite {
|
|
401
|
-
/** The URL this invitee was sent: the share's files.sv URL, with their own token when the share invites several */
|
|
402
|
-
shareUrl: string;
|
|
403
|
-
/** Whether the invitation was delivered by email or text */
|
|
404
|
-
delivered: boolean;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* An ingot access-log entry: a download that delivered the file, a SparkLink
|
|
408
|
-
* open of it included. The server records an access as the download that
|
|
409
|
-
* delivered it, so `download` is the one action.
|
|
410
|
-
*/
|
|
411
|
-
export interface IngotAccessLog {
|
|
412
|
-
/**
|
|
413
|
-
* The entry's time (Unix seconds) as a string. The server issues no entry id,
|
|
414
|
-
* so entries in the same second share it.
|
|
415
|
-
*/
|
|
416
|
-
id: string;
|
|
417
|
-
/** What the access was */
|
|
418
|
-
action: 'download';
|
|
419
|
-
/** Who accessed: a member's email, an API key's name, or a SparkLink visitor's identity */
|
|
420
|
-
identity: string;
|
|
421
|
-
/** Source IP address */
|
|
422
|
-
ipAddress: string;
|
|
423
|
-
/** Client user agent */
|
|
424
|
-
userAgent: string;
|
|
425
|
-
/** Event timestamp (Unix seconds) */
|
|
426
|
-
timestamp: number;
|
|
427
|
-
}
|
|
428
|
-
/** A page of access logs. */
|
|
429
|
-
export interface IngotAccessLogPage {
|
|
430
|
-
/** Log entries on this page */
|
|
431
|
-
logs: IngotAccessLog[];
|
|
432
|
-
/** Cursor for the next page, when more results exist */
|
|
433
|
-
nextCursor?: string;
|
|
434
|
-
}
|
|
435
|
-
/** Options for getAccessLogs. */
|
|
436
|
-
export interface AccessLogsOptions {
|
|
437
|
-
/** Page size */
|
|
438
|
-
limit?: number;
|
|
439
|
-
/** Pagination cursor */
|
|
440
|
-
cursor?: string;
|
|
441
|
-
}
|
|
442
|
-
export interface IngotWire {
|
|
443
|
-
ingot_id: string;
|
|
444
|
-
name: string;
|
|
445
|
-
download_filename: string;
|
|
446
|
-
content_type: string;
|
|
447
|
-
size_bytes: number;
|
|
448
|
-
status?: Ingot['status'];
|
|
449
|
-
created_at?: number;
|
|
450
|
-
folder_id?: string | null;
|
|
451
|
-
content_hmac?: string | null;
|
|
452
|
-
content_version?: string | null;
|
|
453
|
-
revision?: string;
|
|
454
|
-
}
|
|
455
|
-
/** One hash-check hit: this HMAC exists on an active ingot in the vault. */
|
|
456
|
-
export interface HashCheckMatch {
|
|
457
|
-
content_hmac: string;
|
|
458
|
-
ingot_id: string;
|
|
459
|
-
}
|
|
460
|
-
export interface HashCheckResponse {
|
|
461
|
-
found: HashCheckMatch[];
|
|
462
|
-
}
|
|
463
|
-
/** PUT /ingots/:id: a replace stages new content onto the caller's existing ingot. */
|
|
464
|
-
export interface ReplaceIngotResponse {
|
|
465
|
-
ingot_id: string;
|
|
466
|
-
name: string;
|
|
467
|
-
content_type: string;
|
|
468
|
-
size_bytes: number;
|
|
469
|
-
status: 'uploading';
|
|
470
|
-
forge_url: string;
|
|
471
|
-
expires_at: number;
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* POST /ingots: `created` says whether the name was minted or its holder
|
|
475
|
-
* staged onto, and `upload_id` names the upload the create staged.
|
|
476
|
-
*/
|
|
477
|
-
export interface CreateIngotResponse extends ReplaceIngotResponse {
|
|
478
|
-
created: boolean;
|
|
479
|
-
upload_id?: string;
|
|
480
|
-
}
|
|
481
|
-
export interface ListIngotsResponse {
|
|
482
|
-
ingots: IngotWire[];
|
|
483
|
-
count?: number;
|
|
484
|
-
next_cursor?: string;
|
|
485
|
-
}
|
|
486
|
-
/** GET /vaults/:id/contents: one page */
|
|
487
|
-
export interface ListContentsResponse {
|
|
488
|
-
folder: {
|
|
489
|
-
folder_id: string;
|
|
490
|
-
name: string;
|
|
491
|
-
parent_id: string | null;
|
|
492
|
-
} | null;
|
|
493
|
-
breadcrumb?: {
|
|
494
|
-
folder_id: string | null;
|
|
495
|
-
name: string;
|
|
496
|
-
}[];
|
|
497
|
-
folders?: FolderWire[];
|
|
498
|
-
ingots?: IngotWire[];
|
|
499
|
-
/** Null on the last page; read as null when absent, so a page without it ends the walk instead of looping. */
|
|
500
|
-
next_page_token?: string | null;
|
|
501
|
-
}
|
|
502
|
-
export interface DownloadIngotResponse {
|
|
503
|
-
content_version?: string | null;
|
|
504
|
-
revision?: string;
|
|
505
|
-
download_url: string;
|
|
506
|
-
ingot_id: string;
|
|
507
|
-
name: string;
|
|
508
|
-
size_bytes: number;
|
|
509
|
-
content_type: string;
|
|
510
|
-
}
|
|
511
|
-
export interface IngotHistoryResponse {
|
|
512
|
-
ingot_id: string;
|
|
513
|
-
version_limit: number;
|
|
514
|
-
versions: Array<{
|
|
515
|
-
version_id: string;
|
|
516
|
-
published_at: number;
|
|
517
|
-
size_bytes: number;
|
|
518
|
-
content_type?: string;
|
|
519
|
-
}>;
|
|
520
|
-
}
|
|
521
|
-
export interface IngotVersionDownloadResponse {
|
|
522
|
-
ingot_id: string;
|
|
523
|
-
download_url: string;
|
|
524
|
-
size_bytes: number;
|
|
525
|
-
content_version: string;
|
|
526
|
-
revision?: string;
|
|
527
|
-
expires_at: number;
|
|
528
|
-
name?: string;
|
|
529
|
-
content_type?: string;
|
|
530
|
-
}
|
|
531
|
-
/** A sharing answer (apps/api/src/ingots/sharing.js formatSharingConfig). */
|
|
532
|
-
export interface IngotSharingConfigResponse {
|
|
533
|
-
ingot_id: string;
|
|
534
|
-
vault_id: string;
|
|
535
|
-
sharing_enabled: boolean;
|
|
536
|
-
shared: boolean;
|
|
537
|
-
visibility?: 'invite_only' | 'authenticated' | 'public' | null;
|
|
538
|
-
public_url: string | null;
|
|
539
|
-
link_code: string | null;
|
|
540
|
-
vault_all_ingots_public: boolean;
|
|
541
|
-
session_length_seconds: number;
|
|
542
|
-
invites?: IngotInviteResponse[];
|
|
543
|
-
}
|
|
544
|
-
/** An invite as the sharing answers carry it (apps/api/src/ingots/sharing.js). */
|
|
545
|
-
export interface IngotInviteResponse {
|
|
546
|
-
invite_id: string;
|
|
547
|
-
identity: string;
|
|
548
|
-
identity_type: 'email' | 'phone';
|
|
549
|
-
expires_at: null;
|
|
550
|
-
created_at: number;
|
|
551
|
-
}
|
|
552
|
-
/** An invite answer (apps/api/src/ingots/sharing.js inviteIdentity). */
|
|
553
|
-
export interface IngotInvitationResponse extends IngotInviteResponse {
|
|
554
|
-
share_url: string;
|
|
555
|
-
delivered: boolean;
|
|
556
|
-
}
|
package/dist/logger.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SparkVault Debug Logger
|
|
3
|
-
*
|
|
4
|
-
* Conditional logging that respects debug mode setting.
|
|
5
|
-
* When debug is enabled, logs detailed information to console.
|
|
6
|
-
* When disabled (default), only fatal errors are logged.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Enable or disable debug logging
|
|
10
|
-
*/
|
|
11
|
-
export declare function setDebugMode(enabled: boolean): void;
|
|
12
|
-
/**
|
|
13
|
-
* Logger object for convenient access
|
|
14
|
-
*/
|
|
15
|
-
export declare const logger: {
|
|
16
|
-
/**
|
|
17
|
-
* Debug level - verbose details for troubleshooting
|
|
18
|
-
*/
|
|
19
|
-
debug: (message: string, ...args: unknown[]) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Info level - general information
|
|
22
|
-
*/
|
|
23
|
-
info: (message: string, ...args: unknown[]) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Warn level - warnings that don't prevent operation
|
|
26
|
-
*/
|
|
27
|
-
warn: (message: string, ...args: unknown[]) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Error level - always logged regardless of debug mode
|
|
30
|
-
*/
|
|
31
|
-
error: (message: string, ...args: unknown[]) => void;
|
|
32
|
-
};
|