@sparkvault/sdk-js 14.1.1 → 14.2.1
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 +10 -0
- package/dist/api-base.d.ts +2 -0
- package/dist/config.d.ts +18 -0
- package/dist/index.cjs +122 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +97 -11
- package/dist/index.mjs +122 -15
- package/dist/index.mjs.map +1 -1
- package/dist/ingots/index.d.ts +6 -4
- package/dist/ingots/types.d.ts +5 -0
- package/dist/products/notify/types.d.ts +16 -5
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/vault-session.d.ts +2 -0
- package/dist/vaults/index.d.ts +16 -3
- package/dist/vaults/types.d.ts +64 -2
- package/package.json +1 -1
package/dist/ingots/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { type ResolvedConfig } from '../config';
|
|
13
13
|
import { HttpClient } from '../http';
|
|
14
|
-
import type { UnsealedVault, Ingot, IngotUpload, UploadEnd, CreatedIngot, IngotDownloadLink, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ResumeUploadOptions, UploadSession, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvitation, IngotAccessLogPage, AccessLogsOptions, HashCheckResponse } from './types';
|
|
14
|
+
import type { UnsealedVault, Ingot, IngotUpload, UploadEnd, CreatedIngot, IngotDownloadLink, DownloadIngotOptions, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ResumeUploadOptions, UploadSession, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvitation, IngotAccessLogPage, AccessLogsOptions, HashCheckResponse } from './types';
|
|
15
15
|
export declare class IngotsModule {
|
|
16
16
|
private readonly config;
|
|
17
17
|
private readonly http;
|
|
@@ -262,6 +262,8 @@ export declare class IngotsModule {
|
|
|
262
262
|
* when you want the URL itself; otherwise prefer {@link download}. The link
|
|
263
263
|
* is single-use: Forge claims it the moment a request arrives, so a retry or
|
|
264
264
|
* a resume needs a link of its own (`fetchDownload`'s `remint`).
|
|
265
|
+
* Automatic display/prefetch should pass `{ countAsActivity: false }` so
|
|
266
|
+
* loading visible content does not extend the vault's inactivity deadline.
|
|
265
267
|
*
|
|
266
268
|
* @example
|
|
267
269
|
* const link = await sv.ingots.createDownloadLink(unsealed, 'ing_abc');
|
|
@@ -269,7 +271,7 @@ export declare class IngotsModule {
|
|
|
269
271
|
* remint: async () => (await sv.ingots.createDownloadLink(unsealed, 'ing_abc')).downloadUrl,
|
|
270
272
|
* });
|
|
271
273
|
*/
|
|
272
|
-
createDownloadLink(vault: UnsealedVault, ingotId: string): Promise<IngotDownloadLink>;
|
|
274
|
+
createDownloadLink(vault: UnsealedVault, ingotId: string, options?: DownloadIngotOptions): Promise<IngotDownloadLink>;
|
|
273
275
|
/**
|
|
274
276
|
* Download an ingot as a Blob (high-level flow).
|
|
275
277
|
*
|
|
@@ -296,7 +298,7 @@ export declare class IngotsModule {
|
|
|
296
298
|
* link.download = ingot.downloadFilename;
|
|
297
299
|
* link.click();
|
|
298
300
|
*/
|
|
299
|
-
download(vault: UnsealedVault, ingotId: string): Promise<Blob>;
|
|
301
|
+
download(vault: UnsealedVault, ingotId: string, options?: DownloadIngotOptions): Promise<Blob>;
|
|
300
302
|
/**
|
|
301
303
|
* Get an ingot's sharing configuration.
|
|
302
304
|
*
|
|
@@ -366,4 +368,4 @@ export { NAME_CONFLICT_POLICIES } from './types';
|
|
|
366
368
|
export { fetchDownload } from './fetch-download';
|
|
367
369
|
export { isReceivedUploadFailure } from '../vaults/upload/api';
|
|
368
370
|
export type { FetchDownloadOptions, FetchedDownload } from './fetch-download';
|
|
369
|
-
export type { NameConflictPolicy, UnsealedVault, Ingot, IngotUpload, UploadEnd, CreatedIngot, IngotDownloadLink, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ResumeUploadOptions, UploadSession, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvite, IngotInvitation, IngotAccessLog, IngotAccessLogPage, AccessLogsOptions, HashCheckResponse, } from './types';
|
|
371
|
+
export type { NameConflictPolicy, UnsealedVault, Ingot, IngotUpload, UploadEnd, CreatedIngot, IngotDownloadLink, DownloadIngotOptions, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ResumeUploadOptions, UploadSession, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvite, IngotInvitation, IngotAccessLog, IngotAccessLogPage, AccessLogsOptions, HashCheckResponse, } from './types';
|
package/dist/ingots/types.d.ts
CHANGED
|
@@ -122,6 +122,11 @@ export interface CreatedIngot {
|
|
|
122
122
|
*/
|
|
123
123
|
created: boolean;
|
|
124
124
|
}
|
|
125
|
+
/** Options shared by download and createDownloadLink. */
|
|
126
|
+
export interface DownloadIngotOptions {
|
|
127
|
+
/** False for automatic display/prefetch: fetching bytes will not extend vault inactivity. */
|
|
128
|
+
countAsActivity?: boolean;
|
|
129
|
+
}
|
|
125
130
|
/** The discrete primitive returned by createDownloadLink. */
|
|
126
131
|
export interface IngotDownloadLink {
|
|
127
132
|
/** Opaque published-content revision; null for legacy content. */
|
|
@@ -178,6 +178,11 @@ export interface NotifyRecipientRef {
|
|
|
178
178
|
export type NotifyRecipient = string | NotifyRecipientRef;
|
|
179
179
|
/** Content to seal into a fresh Spark, one per recipient. */
|
|
180
180
|
export interface NotifySendContent {
|
|
181
|
+
/**
|
|
182
|
+
* Sealed as written. A plaintext send's has its text-direction control
|
|
183
|
+
* characters (U+202A to U+202E, U+2066 to U+2069) removed, so it shows in
|
|
184
|
+
* the order it is written.
|
|
185
|
+
*/
|
|
181
186
|
payload: string;
|
|
182
187
|
/** Defaults to `text/plain`. A plaintext send accepts only `text/plain` or `text/html`. */
|
|
183
188
|
contentType?: string;
|
|
@@ -258,7 +263,11 @@ export interface CreateNotifySendOptions {
|
|
|
258
263
|
* recipients and their handles, title, category, instructions, policy,
|
|
259
264
|
* channels and escalation): one that differs in any of them is refused 400
|
|
260
265
|
* (`serviceCode` `VALIDATION_ERROR`), and the stored send stands. `type` and
|
|
261
|
-
* `historyTtlDays` are not compared: the stored send keeps its own.
|
|
266
|
+
* `historyTtlDays` are not compared: the stored send keeps its own. The send
|
|
267
|
+
* stores the title, instructions and a plaintext payload without their
|
|
268
|
+
* text-direction control characters (U+202A to U+202E, U+2066 to U+2069) and
|
|
269
|
+
* compares a replay's the same way, so one that differs only by them is the
|
|
270
|
+
* same send.
|
|
262
271
|
*/
|
|
263
272
|
sendId?: string;
|
|
264
273
|
/** 1-500 recipients. An ingot send accepts exactly one. */
|
|
@@ -279,9 +288,10 @@ export interface CreateNotifySendOptions {
|
|
|
279
288
|
channels?: Array<'in_app' | 'email' | 'push' | 'web_push'>;
|
|
280
289
|
escalation?: NotifyEscalation;
|
|
281
290
|
/**
|
|
282
|
-
* Channel-agnostic display title (rides the email subject).
|
|
283
|
-
* characters
|
|
284
|
-
*
|
|
291
|
+
* Channel-agnostic display title (rides the email subject). Its text-direction
|
|
292
|
+
* control characters (U+202A to U+202E, U+2066 to U+2069) are removed, and it
|
|
293
|
+
* is cut to 200 characters, never rejected for its length. A title that reads
|
|
294
|
+
* as SparkVault is refused 400 with
|
|
285
295
|
* `details: { field: 'title', reason: 'reserved_name' }`: the notification goes
|
|
286
296
|
* out in your organization's name.
|
|
287
297
|
*/
|
|
@@ -301,7 +311,8 @@ export interface CreateNotifySendOptions {
|
|
|
301
311
|
*/
|
|
302
312
|
type?: string;
|
|
303
313
|
/**
|
|
304
|
-
* NON-SECRET display text (≤500 chars
|
|
314
|
+
* NON-SECRET display text (≤500 chars once its text-direction control
|
|
315
|
+
* characters are removed) shown alongside a sealed send, such as
|
|
305
316
|
* "verify with your passkey to open". It is never the sealed content.
|
|
306
317
|
*/
|
|
307
318
|
instructions?: string;
|