@sparkvault/sdk-js 11.1.10 → 11.1.12
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 +1 -1
- package/dist/http.d.ts +1 -39
- package/dist/index.cjs +26 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -60
- package/dist/index.mjs +26 -141
- package/dist/index.mjs.map +1 -1
- package/dist/ingots/index.d.ts +3 -4
- package/dist/ingots/types.d.ts +5 -15
- package/dist/logger.d.ts +0 -8
- package/dist/products/identity/api.d.ts +8 -13
- package/dist/products/identity/container.d.ts +0 -4
- package/dist/products/identity/handlers/passkey-handler.d.ts +1 -1
- package/dist/products/identity/index.d.ts +1 -1
- package/dist/products/identity/inline-container.d.ts +0 -4
- package/dist/products/identity/modal.d.ts +0 -5
- package/dist/products/identity/types.d.ts +3 -9
- package/dist/products/identity/views/passkey-prompt.d.ts +3 -2
- package/dist/products/index.d.ts +1 -1
- package/dist/products/notify/types.d.ts +5 -1
- package/dist/sparks/types.d.ts +4 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/ui/modal-shell.d.ts +0 -2
- package/dist/vaults/types.d.ts +0 -2
- package/dist/vaults/upload/container.d.ts +0 -4
- package/dist/vaults/upload/inline-container.d.ts +0 -4
- package/dist/vaults/upload/modal.d.ts +0 -4
- 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, CreatedIngot, IngotDownloadLink, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvite,
|
|
14
|
+
import type { UnsealedVault, Ingot, IngotUpload, CreatedIngot, IngotDownloadLink, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvite, IngotAccessLogPage, AccessLogsOptions, HashCheckResponse } from './types';
|
|
15
15
|
export declare class IngotsModule {
|
|
16
16
|
private readonly config;
|
|
17
17
|
private readonly http;
|
|
@@ -194,9 +194,8 @@ export declare class IngotsModule {
|
|
|
194
194
|
*
|
|
195
195
|
* @example
|
|
196
196
|
* await sv.ingots.addInvite(unsealed, 'ing_abc', 'user@example.com');
|
|
197
|
-
* await sv.ingots.addInvite(unsealed, 'ing_abc', 'user@example.com', { expiresInSeconds: 86400 });
|
|
198
197
|
*/
|
|
199
|
-
addInvite(vault: UnsealedVault, ingotId: string, identity: string
|
|
198
|
+
addInvite(vault: UnsealedVault, ingotId: string, identity: string): Promise<IngotInvite>;
|
|
200
199
|
/**
|
|
201
200
|
* Revoke an ingot sharing invite.
|
|
202
201
|
*
|
|
@@ -240,4 +239,4 @@ export declare class IngotsModule {
|
|
|
240
239
|
export { NAME_CONFLICT_POLICIES } from './types';
|
|
241
240
|
export { fetchDownload } from './fetch-download';
|
|
242
241
|
export type { FetchDownloadOptions, FetchedDownload } from './fetch-download';
|
|
243
|
-
export type { NameConflictPolicy, UnsealedVault, Ingot, IngotUpload, CreatedIngot, IngotDownloadLink, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvite,
|
|
242
|
+
export type { NameConflictPolicy, UnsealedVault, Ingot, IngotUpload, CreatedIngot, IngotDownloadLink, CreateUploadOptions, UploadIngotOptions, SendUploadOptions, ReplaceIngotOptions, ListIngotsOptions, ListContentsOptions, FolderContents, SearchIngotsOptions, IngotPage, IngotSharingConfig, UpdateIngotSharingOptions, IngotInvite, IngotAccessLog, IngotAccessLogPage, AccessLogsOptions, HashCheckResponse, } from './types';
|
package/dist/ingots/types.d.ts
CHANGED
|
@@ -241,11 +241,6 @@ export interface UpdateIngotSharingOptions {
|
|
|
241
241
|
/** Visibility mode */
|
|
242
242
|
visibility?: 'invite_only' | 'authenticated' | 'public';
|
|
243
243
|
}
|
|
244
|
-
/** Options for addInvite. */
|
|
245
|
-
export interface AddInviteOptions {
|
|
246
|
-
/** Invite lifetime in seconds. Omit to inherit the link's existing expiry. */
|
|
247
|
-
expiresInSeconds?: number;
|
|
248
|
-
}
|
|
249
244
|
/** A sharing invite on an ingot. */
|
|
250
245
|
export interface IngotInvite {
|
|
251
246
|
/** Invite ID */
|
|
@@ -253,7 +248,7 @@ export interface IngotInvite {
|
|
|
253
248
|
/** Invited identity (email/phone) */
|
|
254
249
|
identity: string;
|
|
255
250
|
/** Identity type */
|
|
256
|
-
identityType:
|
|
251
|
+
identityType: 'email' | 'phone';
|
|
257
252
|
}
|
|
258
253
|
/**
|
|
259
254
|
* An ingot access-log entry: a download that delivered the file, a SparkLink
|
|
@@ -354,16 +349,11 @@ export interface DownloadIngotResponse {
|
|
|
354
349
|
export interface IngotSharingConfigResponse {
|
|
355
350
|
shared: boolean;
|
|
356
351
|
visibility?: 'invite_only' | 'authenticated' | 'public';
|
|
357
|
-
invites?:
|
|
358
|
-
id?: string;
|
|
359
|
-
invite_id?: string;
|
|
360
|
-
identity: string;
|
|
361
|
-
identity_type?: string;
|
|
362
|
-
}[];
|
|
352
|
+
invites?: IngotInviteResponse[];
|
|
363
353
|
}
|
|
354
|
+
/** An invite as the sharing answers carry it (apps/api/src/ingots/sharing.js). */
|
|
364
355
|
export interface IngotInviteResponse {
|
|
365
|
-
|
|
366
|
-
invite_id?: string;
|
|
356
|
+
invite_id: string;
|
|
367
357
|
identity: string;
|
|
368
|
-
identity_type
|
|
358
|
+
identity_type: 'email' | 'phone';
|
|
369
359
|
}
|
package/dist/logger.d.ts
CHANGED
|
@@ -29,12 +29,4 @@ export declare const logger: {
|
|
|
29
29
|
* Error level - always logged regardless of debug mode
|
|
30
30
|
*/
|
|
31
31
|
error: (message: string, ...args: unknown[]) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Group related logs together (only in debug mode)
|
|
34
|
-
*/
|
|
35
|
-
group: (label: string) => void;
|
|
36
|
-
/**
|
|
37
|
-
* End a log group
|
|
38
|
-
*/
|
|
39
|
-
groupEnd: () => void;
|
|
40
32
|
};
|
|
@@ -62,7 +62,13 @@ export declare class IdentityApi extends SparkVaultApi {
|
|
|
62
62
|
*/
|
|
63
63
|
redeemHandoffCode(code: string, codeVerifier: string): Promise<RedeemHandoffResponse>;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* The auth context a code or magic-link send carries: only its OIDC
|
|
66
|
+
* `auth_request_id`. Simple mode is read where a login completes
|
|
67
|
+
* (verifyOtp, completePasskeyVerify), never by a send.
|
|
68
|
+
*/
|
|
69
|
+
private buildAuthRequestParam;
|
|
70
|
+
/**
|
|
71
|
+
* Build auth context params for the completing requests (OIDC/simple mode).
|
|
66
72
|
* Converts AuthContext to snake_case params expected by backend.
|
|
67
73
|
*/
|
|
68
74
|
private buildAuthContextParams;
|
|
@@ -93,24 +99,13 @@ export declare class IdentityApi extends SparkVaultApi {
|
|
|
93
99
|
ticket: string;
|
|
94
100
|
code: string;
|
|
95
101
|
}): Promise<SecondFactorVerifyResponse>;
|
|
96
|
-
/**
|
|
97
|
-
* Start passkey registration from a freshly verified identifier.
|
|
98
|
-
*/
|
|
99
|
-
startPasskeyRegister(identity: string, identityType?: 'email' | 'phone', registrationToken?: string): Promise<PasskeyChallengeResponse>;
|
|
100
|
-
/**
|
|
101
|
-
* Complete passkey registration
|
|
102
|
-
*/
|
|
103
|
-
completePasskeyRegister(params: {
|
|
104
|
-
session: Record<string, unknown>;
|
|
105
|
-
credential: PublicKeyCredential;
|
|
106
|
-
}): Promise<PasskeyVerifyResponse>;
|
|
107
102
|
/**
|
|
108
103
|
* Start passkey verification. An optional identifier scopes the ceremony to
|
|
109
104
|
* that person's credentials (`allowCredentials`) so the authenticator offers
|
|
110
105
|
* only the matching passkey; omit it for a discoverable ceremony. Completion
|
|
111
106
|
* always routes via the credential userHandle, so scoping is purely a hint.
|
|
112
107
|
*/
|
|
113
|
-
startPasskeyVerify(identity?: string, identityType?: 'email' | 'phone'
|
|
108
|
+
startPasskeyVerify(identity?: string, identityType?: 'email' | 'phone'): Promise<PasskeyChallengeResponse>;
|
|
114
109
|
/**
|
|
115
110
|
* Complete passkey verification
|
|
116
111
|
*/
|
|
@@ -22,10 +22,6 @@ export interface Container {
|
|
|
22
22
|
* Update branding after SDK config loads.
|
|
23
23
|
*/
|
|
24
24
|
updateBranding(branding: SdkConfigBranding): void;
|
|
25
|
-
/**
|
|
26
|
-
* Update backdrop blur setting (may be no-op for inline container).
|
|
27
|
-
*/
|
|
28
|
-
updateBackdropBlur(enabled: boolean): void;
|
|
29
25
|
/**
|
|
30
26
|
* Switch to minimal chrome mode for full-bleed views (e.g. terminal error
|
|
31
27
|
* screens). Hides the header (so customer branding doesn't appear on
|
|
@@ -21,7 +21,7 @@ export interface PasskeyResult {
|
|
|
21
21
|
success: boolean;
|
|
22
22
|
result?: VerifyResult;
|
|
23
23
|
error?: string;
|
|
24
|
-
errorType?: 'cancelled' | 'not_found' | '
|
|
24
|
+
errorType?: 'cancelled' | 'not_found' | 'popup_blocked' | 'unknown';
|
|
25
25
|
/**
|
|
26
26
|
* Machine-readable API error code (e.g. 'identity_locked',
|
|
27
27
|
* 'identity_trial_exhausted'). Forwarded unchanged from the inline ceremony
|
|
@@ -251,4 +251,4 @@ export declare class IdentityModule {
|
|
|
251
251
|
target: string | HTMLElement;
|
|
252
252
|
}): Promise<VerifyResult>;
|
|
253
253
|
}
|
|
254
|
-
export type { SignInOptions, SignInResult, AttachOptions, VerifyResult, VerifyOptions, TokenClaims,
|
|
254
|
+
export type { SignInOptions, SignInResult, AttachOptions, VerifyResult, VerifyOptions, TokenClaims, } from './types';
|
|
@@ -33,10 +33,6 @@ export declare class InlineContainer implements Container {
|
|
|
33
33
|
* Re-theme the stylesheet once the SDK config loads.
|
|
34
34
|
*/
|
|
35
35
|
updateBranding(branding: SdkConfigBranding): void;
|
|
36
|
-
/**
|
|
37
|
-
* Update backdrop blur setting (no-op for inline container).
|
|
38
|
-
*/
|
|
39
|
-
updateBackdropBlur(_enabled: boolean): void;
|
|
40
36
|
/**
|
|
41
37
|
* Minimal-chrome toggle (no-op for inline container).
|
|
42
38
|
* Inline containers don't own page-level chrome to hide.
|
|
@@ -33,11 +33,6 @@ export declare class ModalContainer implements Container {
|
|
|
33
33
|
* the body view can render edge-to-edge as its own full-dialog design.
|
|
34
34
|
*/
|
|
35
35
|
setMinimalChrome(enabled: boolean): void;
|
|
36
|
-
/**
|
|
37
|
-
* Update the backdrop blur setting with the resolved value (client
|
|
38
|
-
* override > server config > default).
|
|
39
|
-
*/
|
|
40
|
-
updateBackdropBlur(enabled: boolean): void;
|
|
41
36
|
private createHeader;
|
|
42
37
|
private handleClose;
|
|
43
38
|
/**
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Identity Module Types
|
|
3
3
|
*/
|
|
4
|
-
export type AuthMethod = 'passkey' | 'otp_email' | 'otp_sms' | 'otp_voice' | 'sparklink' | 'social_google' | 'social_apple' | 'social_microsoft' | 'social_github' | 'social_facebook' | 'social_linkedin';
|
|
5
|
-
export type Theme = 'light' | 'dark';
|
|
6
4
|
export type VerifiedIdentityType = 'email' | 'phone' | 'social';
|
|
7
5
|
/**
|
|
8
6
|
* Auth context for OIDC or simple redirect flows.
|
|
@@ -202,8 +200,6 @@ export interface SdkConfigBranding {
|
|
|
202
200
|
companyName: string;
|
|
203
201
|
logoLight: string | null;
|
|
204
202
|
logoDark: string | null;
|
|
205
|
-
/** Backdrop blur setting (default: true) */
|
|
206
|
-
backdrop_blur?: boolean;
|
|
207
203
|
/** Theme mode from server config */
|
|
208
204
|
themeMode?: 'light' | 'dark';
|
|
209
205
|
}
|
|
@@ -294,19 +290,17 @@ export interface BackupVerifyResponse {
|
|
|
294
290
|
/**
|
|
295
291
|
* WebAuthn credential descriptor. Scopes an authentication ceremony to a
|
|
296
292
|
* specific person's passkeys (`allowCredentials`) so the authenticator offers
|
|
297
|
-
* only the matching credential. `id` is base64url-encoded.
|
|
293
|
+
* only the matching credential. `id` is base64url-encoded. The server names
|
|
294
|
+
* no `transports`: scoping runs before authentication, and a transport list
|
|
295
|
+
* would hand an unauthenticated probe a device fingerprint.
|
|
298
296
|
*/
|
|
299
297
|
export interface PasskeyCredentialDescriptor {
|
|
300
298
|
type: 'public-key';
|
|
301
299
|
id: string;
|
|
302
|
-
transports?: AuthenticatorTransport[];
|
|
303
300
|
}
|
|
304
301
|
export interface PasskeyChallengeResponse {
|
|
305
302
|
challenge: string;
|
|
306
303
|
rpId: string;
|
|
307
|
-
rpName: string;
|
|
308
|
-
userId?: string;
|
|
309
|
-
userName?: string;
|
|
310
304
|
timeout: number;
|
|
311
305
|
/**
|
|
312
306
|
* Present only for an identifier-scoped ceremony: restricts the authenticator
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Passkey Registration Prompt View
|
|
3
3
|
*
|
|
4
|
-
* Shown after
|
|
5
|
-
* Includes benefits list and skip option
|
|
4
|
+
* Shown after a login whose recommendations name a passkey, to encourage the
|
|
5
|
+
* person to add one. Includes a benefits list and a skip option, which the
|
|
6
|
+
* server suppresses for 30 days (POST /recommendations/dismiss).
|
|
6
7
|
*/
|
|
7
8
|
import type { View } from './base';
|
|
8
9
|
export interface PasskeyPromptViewProps {
|
package/dist/products/index.d.ts
CHANGED
|
@@ -26,5 +26,5 @@ export declare class ProductsModule {
|
|
|
26
26
|
}
|
|
27
27
|
export { IdentityModule } from './identity';
|
|
28
28
|
export { NotifyProductModule, NOTIFY_PRESETS, buildNotifyPresetSend } from './notify';
|
|
29
|
-
export type { VerifyOptions, AttachOptions, VerifyResult, TokenClaims,
|
|
29
|
+
export type { VerifyOptions, AttachOptions, VerifyResult, TokenClaims, } from './identity';
|
|
30
30
|
export type { NotifyChannel, NotifyDeliveryMode, NotifyVerificationLevel, NotifyInteraction, NotifyPresetCategory, NotifyCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyPreset, NotifyRecipient, NotifyRecipientRef, NotifySendContent, NotifyIngotRef, NotifySendPolicy, NotifyEscalation, CreateNotifySendOptions, NotifySendResult, NotifyInboxView, NotifyInboxMarkState, NotifyInboxBulkMarkState, NotifyInboxRow, ListNotifyInboxOptions, ListNotifyInboxResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, NotifySendStatus, NotifySendStatusRecipient, NotifySendStatusCounts, NotifySendState, NotifySendSummary, ListNotifySendsOptions, ListNotifySendsResponse, NotifyRecallMode, RecallNotifySendOptions, RecallNotifySendResponse, NotifyReceipt, NotifyReceiptEventType, NotifySendReceipt, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, NotifySendReceiptsResponse, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigHistory, NotifyConfigSecurity, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigPatch, NotifyConfigOverrides, NotifyConfigResponse, } from './notify';
|
|
@@ -83,7 +83,11 @@ export interface NotifySendContent {
|
|
|
83
83
|
/** Defaults to `text/plain`. A plaintext send accepts only `text/plain` or `text/html`. */
|
|
84
84
|
contentType?: string;
|
|
85
85
|
filename?: string;
|
|
86
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Sealed-content lifetime: a whole number of minutes from 1 to 1440 (24h).
|
|
88
|
+
* Defaults to 1440. A fraction is refused with a `ValidationError`. The grant
|
|
89
|
+
* never outlives the content it points at.
|
|
90
|
+
*/
|
|
87
91
|
ttlMinutes?: number;
|
|
88
92
|
}
|
|
89
93
|
/**
|
package/dist/sparks/types.d.ts
CHANGED
|
@@ -90,7 +90,10 @@ export interface CreateSparkOptions {
|
|
|
90
90
|
payload: string;
|
|
91
91
|
/** Content type (MIME). Defaults to text/plain. */
|
|
92
92
|
contentType?: string;
|
|
93
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Time-to-live: a whole number of minutes from 1 to 1440 (24h). Defaults to
|
|
95
|
+
* 1440. A fraction is refused with a `ValidationError`.
|
|
96
|
+
*/
|
|
94
97
|
ttlMinutes?: number;
|
|
95
98
|
/** Join an existing kindling family by ID */
|
|
96
99
|
kindling?: string;
|