@sparkvault/sdk-js 17.0.1 → 18.0.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 +8 -8
- 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 +255 -229
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +153 -161
- package/dist/index.mjs +255 -229
- 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/help-desk/client.d.ts +0 -4
- package/dist/products/help-desk/kb-types.d.ts +1 -2
- package/dist/products/help-desk/types.d.ts +1 -5
- package/dist/products/help-desk/widget-identity.d.ts +2 -2
- 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/ingots/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Uploads and downloads run over the single canonical Forge TUS transfer path
|
|
9
9
|
* (shared with the public upload widget), with server-side finalization and
|
|
10
|
-
* download-host allowlisting enforced
|
|
10
|
+
* download-host allowlisting enforced, with no per-size branching.
|
|
11
11
|
*/
|
|
12
12
|
import { type ResolvedConfig } from '../config';
|
|
13
13
|
import { HttpClient } from '../http';
|
|
@@ -68,16 +68,16 @@ export declare class IngotsModule {
|
|
|
68
68
|
*/
|
|
69
69
|
endUpload(vault: UnsealedVault, upload: Pick<IngotUpload, 'id' | 'created' | 'uploadId'>): Promise<UploadEnd>;
|
|
70
70
|
/**
|
|
71
|
-
* Send a file's bytes to an upload session
|
|
72
|
-
* {@link createUpload} returned
|
|
71
|
+
* Send a file's bytes to an upload session (the `uploadUrl` a
|
|
72
|
+
* {@link createUpload} returned) over the resumable transfer every SDK
|
|
73
73
|
* upload uses. Resolves only once the server confirms the ingot is
|
|
74
74
|
* published, so a resolved promise never stands for a stored file whose
|
|
75
75
|
* ingot never went live.
|
|
76
76
|
*
|
|
77
77
|
* Transient failures are retried inside the transfer; a session the server
|
|
78
78
|
* no longer holds (it expired, was cancelled, or its ingot was removed)
|
|
79
|
-
* rejects with code `session_gone`, and only a new upload session
|
|
80
|
-
* {@link createUpload}, or {@link upload} again
|
|
79
|
+
* rejects with code `session_gone`, and only a new upload session (a new
|
|
80
|
+
* {@link createUpload}, or {@link upload} again) can store the file. An
|
|
81
81
|
* upload the server refused (the account's storage pool cannot take it, a
|
|
82
82
|
* later upload replaced it, or its vault is scheduled for deletion: a 409
|
|
83
83
|
* `VAULT_DELETION_SCHEDULED`, whose session the server keeps until the
|
|
@@ -153,9 +153,9 @@ export declare class IngotsModule {
|
|
|
153
153
|
*
|
|
154
154
|
* Creates the upload session, streams the file to Forge over TUS, then
|
|
155
155
|
* confirms the server finalized the upload before resolving. A file the
|
|
156
|
-
* server refused
|
|
156
|
+
* server refused (another upload of it superseded this one, at its create
|
|
157
157
|
* or while it streamed, the storage pool cannot take it, or its vault is
|
|
158
|
-
* scheduled for deletion (a 409 `VAULT_DELETION_SCHEDULED`)
|
|
158
|
+
* scheduled for deletion (a 409 `VAULT_DELETION_SCHEDULED`)) rejects with
|
|
159
159
|
* code `upload_refused`, as {@link sendUpload} does. An upload that rejects
|
|
160
160
|
* any way but one the server received whole ({@link isReceivedUploadFailure}:
|
|
161
161
|
* the server publishes or ends that one on its own) is given up: the end of
|
|
@@ -349,7 +349,7 @@ export declare class IngotsModule {
|
|
|
349
349
|
*/
|
|
350
350
|
revokeInvite(vault: UnsealedVault, ingotId: string, inviteId: string): Promise<void>;
|
|
351
351
|
/**
|
|
352
|
-
* Batch content-HMAC existence check
|
|
352
|
+
* Batch content-HMAC existence check: the pre-upload dedup handshake.
|
|
353
353
|
* Returns which of the supplied vault-keyed HMACs already exist on active
|
|
354
354
|
* ingots in the vault, so callers can skip transferring those bytes.
|
|
355
355
|
*
|
|
@@ -366,14 +366,14 @@ export declare class IngotsModule {
|
|
|
366
366
|
getAccessLogs(vault: UnsealedVault, ingotId: string, options?: AccessLogsOptions): Promise<IngotAccessLogPage>;
|
|
367
367
|
/**
|
|
368
368
|
* Request a Forge upload session for a new ingot.
|
|
369
|
-
* Shared by createUpload and upload
|
|
369
|
+
* Shared by createUpload and upload: the single ingot-create path.
|
|
370
370
|
*/
|
|
371
371
|
private requestUploadSession;
|
|
372
372
|
/**
|
|
373
373
|
* Run the canonical TUS transfer for a created/replaced ingot.
|
|
374
374
|
*
|
|
375
375
|
* The transfer resolves only once the server has confirmed finalization, so
|
|
376
|
-
* the ingot this returns is always a published one
|
|
376
|
+
* the ingot this returns is always a published one, never a stored file
|
|
377
377
|
* whose ingot never went active.
|
|
378
378
|
*/
|
|
379
379
|
private transferAndFinalize;
|
package/dist/ingots/types.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export interface Ingot {
|
|
|
72
72
|
/** Object identity and publication together; absent on older servers. */
|
|
73
73
|
revision?: string;
|
|
74
74
|
}
|
|
75
|
-
/** The discrete primitive returned by createUpload
|
|
75
|
+
/** The discrete primitive returned by createUpload: a Forge TUS session. */
|
|
76
76
|
export interface IngotUpload {
|
|
77
77
|
/** Ingot ID */
|
|
78
78
|
id: string;
|
|
@@ -460,7 +460,7 @@ export interface HashCheckMatch {
|
|
|
460
460
|
export interface HashCheckResponse {
|
|
461
461
|
found: HashCheckMatch[];
|
|
462
462
|
}
|
|
463
|
-
/** PUT /ingots/:id
|
|
463
|
+
/** PUT /ingots/:id: a replace stages new content onto the caller's existing ingot. */
|
|
464
464
|
export interface ReplaceIngotResponse {
|
|
465
465
|
ingot_id: string;
|
|
466
466
|
name: string;
|
|
@@ -471,7 +471,7 @@ export interface ReplaceIngotResponse {
|
|
|
471
471
|
expires_at: number;
|
|
472
472
|
}
|
|
473
473
|
/**
|
|
474
|
-
* POST /ingots
|
|
474
|
+
* POST /ingots: `created` says whether the name was minted or its holder
|
|
475
475
|
* staged onto, and `upload_id` names the upload the create staged.
|
|
476
476
|
*/
|
|
477
477
|
export interface CreateIngotResponse extends ReplaceIngotResponse {
|
package/dist/notify/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Web Push registration. It is
|
|
9
9
|
* not a tenant's inbox for its own end users: a tenant reads its recipients'
|
|
10
10
|
* feeds with `sv.products.notify.getInbox`. The recipient is ALWAYS derived
|
|
11
|
-
* from the session on the server
|
|
11
|
+
* from the session on the server: no method takes a `recipient_id`, and any
|
|
12
12
|
* account/recipient a caller might try to supply is ignored. This mirrors
|
|
13
13
|
* `@sparkvault/sdk-mobile`'s notify client; device push registration is
|
|
14
14
|
* intentionally omitted (Expo-only on mobile).
|
|
@@ -19,7 +19,7 @@ export declare class NotifyModule {
|
|
|
19
19
|
private readonly http;
|
|
20
20
|
constructor(http: HttpClient);
|
|
21
21
|
/**
|
|
22
|
-
* The caller's own inbox feed (newest first). Follow `cursor` to page
|
|
22
|
+
* The caller's own inbox feed (newest first). Follow `cursor` to page: a
|
|
23
23
|
* page can come back short of `limit` yet still carry a non-null cursor.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
@@ -28,7 +28,7 @@ export declare class NotifyModule {
|
|
|
28
28
|
getInbox(options?: ListNotificationsOptions): Promise<ListNotificationsResponse>;
|
|
29
29
|
/**
|
|
30
30
|
* Bounded unseen badge count for the caller's own inbox. `capped` true means
|
|
31
|
-
* the true count is at/beyond the ceiling
|
|
31
|
+
* the true count is at/beyond the ceiling: render "N+".
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* const { unread_count, capped } = await sv.notify.getUnreadCount();
|
|
@@ -37,7 +37,7 @@ export declare class NotifyModule {
|
|
|
37
37
|
/**
|
|
38
38
|
* Apply a terminal display state to one of the caller's own rows (idempotent).
|
|
39
39
|
* `createdAt` MUST be the row's own `created_at` (round-tripped from the list
|
|
40
|
-
* row)
|
|
40
|
+
* row); the id alone cannot address the row.
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* await sv.notify.markState('ntf_abc', { createdAt: row.created_at, state: 'read' });
|
|
@@ -45,7 +45,7 @@ export declare class NotifyModule {
|
|
|
45
45
|
markState(notificationId: string, options: MarkNotificationStateOptions): Promise<MarkNotificationStateResponse>;
|
|
46
46
|
/**
|
|
47
47
|
* Bulk-mark ONE bounded page of the caller's inbox and return the server's
|
|
48
|
-
* payload verbatim. `cursor` comes back non-null while rows remain
|
|
48
|
+
* payload verbatim. `cursor` comes back non-null while rows remain: thread it
|
|
49
49
|
* into the next call. `archived` is per-row only (no GSI to page over), so the
|
|
50
50
|
* bulk states are `seen` and `read`.
|
|
51
51
|
*
|
|
@@ -62,10 +62,10 @@ export declare class NotifyModule {
|
|
|
62
62
|
* clears the unseen marker too, so the badge zeroes with it. Idempotent.
|
|
63
63
|
*
|
|
64
64
|
* `complete` is false when the loop stopped at the page bound with rows still
|
|
65
|
-
* unmarked
|
|
65
|
+
* unmarked: an inbox deeper than the bound finishes on a second call. Without
|
|
66
66
|
* it a truncated drain looks exactly like a finished one.
|
|
67
67
|
*
|
|
68
|
-
* An error mid-drain propagates
|
|
68
|
+
* An error mid-drain propagates: the pages already marked stay marked, and a
|
|
69
69
|
* re-run picks up the remainder.
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
@@ -80,7 +80,7 @@ export declare class NotifyModule {
|
|
|
80
80
|
isWebPushSupported(): boolean;
|
|
81
81
|
/**
|
|
82
82
|
* The platform VAPID public key for `pushManager.subscribe()`. `configured`
|
|
83
|
-
* is false until the server-side VAPID keypair is provisioned
|
|
83
|
+
* is false until the server-side VAPID keypair is provisioned: hide the
|
|
84
84
|
* enable-notifications affordance while false.
|
|
85
85
|
*/
|
|
86
86
|
getWebPushKey(): Promise<WebPushKeyResponse>;
|
package/dist/notify/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* sender-side feed (`sv.products.notify.getInbox`) returns the same row without
|
|
9
9
|
* `from`, since it reads one sending account's inbox. A row carries
|
|
10
10
|
* its cleartext part (`title`, and for a cleartext send a short `body`) natively;
|
|
11
|
-
* a SECURE send's content is never carried here
|
|
11
|
+
* a SECURE send's content is never carried here: it lives behind the SparkLink
|
|
12
12
|
* `sparklink_code`. Keeping the wire shape verbatim is the single source of truth
|
|
13
13
|
* shared with `@sparkvault/sdk-mobile` and the first-party console, so do not
|
|
14
14
|
* "camelCase" these rows. Only the input option `createdAt` is camelCase for call
|
|
@@ -39,7 +39,7 @@ export type NotificationSender = {
|
|
|
39
39
|
* sender reading its own inbox is who sent every row in it. The `title` (and,
|
|
40
40
|
* for a cleartext send, the short `body`) is the NON-sensitive cleartext part,
|
|
41
41
|
* shown natively. A SECURE send's content lives behind the SparkLink
|
|
42
|
-
* (`sparklink_code`) and is never carried here
|
|
42
|
+
* (`sparklink_code`) and is never carried here; open the pointer to reveal it.
|
|
43
43
|
* Timestamps are epoch SECONDS.
|
|
44
44
|
*/
|
|
45
45
|
export interface NotifyInboxRow {
|
|
@@ -52,7 +52,7 @@ export interface NotifyInboxRow {
|
|
|
52
52
|
/**
|
|
53
53
|
* The row's visible cleartext line, shown natively: a plaintext send's inline
|
|
54
54
|
* body, or a SEALED send's non-secret `instructions`. A sealed row can and
|
|
55
|
-
* normally should carry one
|
|
55
|
+
* normally should carry one: it is the readable line above the reveal. Never
|
|
56
56
|
* the sealed content itself. Absent when the sender set neither.
|
|
57
57
|
*/
|
|
58
58
|
body?: string;
|
|
@@ -62,7 +62,7 @@ export interface NotifyInboxRow {
|
|
|
62
62
|
read_at: number | null;
|
|
63
63
|
archived_at: number | null;
|
|
64
64
|
/**
|
|
65
|
-
* The grant to open. Present only while a live reveal stands behind it
|
|
65
|
+
* The grant to open. Present only while a live reveal stands behind it, meaning a
|
|
66
66
|
* SEALED (secure) send whose grant still opens: not yet opened (on a send that
|
|
67
67
|
* asks for an answer, not yet answered), not expired, not gone and not
|
|
68
68
|
* recalled. A cleartext send delivers its content inline in the channel and
|
|
@@ -84,7 +84,7 @@ export interface NotifyInboxRow {
|
|
|
84
84
|
*/
|
|
85
85
|
sealed: boolean;
|
|
86
86
|
/**
|
|
87
|
-
* True only when there is a secure part left to reveal
|
|
87
|
+
* True only when there is a secure part left to reveal, exactly when
|
|
88
88
|
* `sparklink_code` is present. `false` does NOT mean "cleartext row": a
|
|
89
89
|
* `sealed` row whose reveal no longer opens (opened, answered, expired or
|
|
90
90
|
* gone) is unlocked too, and so is a recalled one, with nothing behind it.
|
|
@@ -118,7 +118,7 @@ export interface ListNotificationsResponse {
|
|
|
118
118
|
/**
|
|
119
119
|
* Next-page cursor, or null on the last page. A page can be SHORT of `limit`
|
|
120
120
|
* yet still carry a non-null cursor (the state/sender filter is applied after
|
|
121
|
-
* the key query)
|
|
121
|
+
* the key query), so follow the cursor; never treat a short page as the end.
|
|
122
122
|
*/
|
|
123
123
|
cursor: string | null;
|
|
124
124
|
}
|
|
@@ -138,7 +138,7 @@ export interface MarkNotificationStateResponse {
|
|
|
138
138
|
updated_at: number;
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
|
-
* States a BULK drain can apply. `archived` is per-row only
|
|
141
|
+
* States a BULK drain can apply. `archived` is per-row only: it has no GSI for
|
|
142
142
|
* the server to page over, so the bulk endpoint rejects it.
|
|
143
143
|
*/
|
|
144
144
|
export type NotificationBulkMarkState = 'seen' | 'read';
|
|
@@ -148,7 +148,7 @@ export interface MarkAllNotificationsStateOptions {
|
|
|
148
148
|
cursor?: string;
|
|
149
149
|
}
|
|
150
150
|
export interface MarkAllNotificationsStateResponse {
|
|
151
|
-
/** Rows marked by THIS page
|
|
151
|
+
/** Rows marked by THIS page; the server marks one bounded page per call. */
|
|
152
152
|
updated: number;
|
|
153
153
|
/** Cursor for the next page, or null once the inbox is drained. */
|
|
154
154
|
cursor: string | null;
|
|
@@ -158,7 +158,7 @@ export interface MarkAllReadResult {
|
|
|
158
158
|
updated: number;
|
|
159
159
|
/**
|
|
160
160
|
* True when the drain reached the end of the inbox (the server returned a null
|
|
161
|
-
* cursor). False when it stopped at the page bound with rows still unmarked
|
|
161
|
+
* cursor). False when it stopped at the page bound with rows still unmarked:
|
|
162
162
|
* call again to continue. Without this a truncated drain is indistinguishable
|
|
163
163
|
* from a completed one.
|
|
164
164
|
*/
|
|
@@ -166,7 +166,7 @@ export interface MarkAllReadResult {
|
|
|
166
166
|
}
|
|
167
167
|
/** The platform VAPID public key needed for pushManager.subscribe(). */
|
|
168
168
|
export interface WebPushKeyResponse {
|
|
169
|
-
/** False until the VAPID keypair is provisioned server-side
|
|
169
|
+
/** False until the VAPID keypair is provisioned server-side: hide the UI. */
|
|
170
170
|
configured: boolean;
|
|
171
171
|
/** base64url VAPID application server key, or null when not configured. */
|
|
172
172
|
vapid_public_key: string | null;
|
|
@@ -125,10 +125,6 @@ export declare class HelpDeskClient {
|
|
|
125
125
|
}): Promise<HelpDeskSession>;
|
|
126
126
|
startPin(email: string): Promise<HelpDeskPinChallenge>;
|
|
127
127
|
verifyPin(options: HelpDeskVerifyPinOptions): Promise<HelpDeskSession>;
|
|
128
|
-
/** Identity completion still requires a server-approved desk portal origin. */
|
|
129
|
-
completeIdentity(options: {
|
|
130
|
-
token: string;
|
|
131
|
-
}): Promise<HelpDeskSession>;
|
|
132
128
|
/** Uninstalled result: the owning form/controller decides when the new requester becomes current. */
|
|
133
129
|
signInWidgetIdentity(options?: HelpDeskWidgetIdentityOptions): Promise<HelpDeskWidgetIdentitySession>;
|
|
134
130
|
/**
|
|
@@ -54,7 +54,6 @@ export interface KbMediaHydration {
|
|
|
54
54
|
}
|
|
55
55
|
export interface KbUnlockOptions {
|
|
56
56
|
password?: string;
|
|
57
|
-
|
|
58
|
-
/** Opaque auth.sv proof, issued through the built-in SDK Identity handoff. */
|
|
57
|
+
/** The Help Desk sign-in's opaque employee-gate proof (`identity_grant.token` of signInWidgetIdentity's answer). */
|
|
59
58
|
identity_grant?: string;
|
|
60
59
|
}
|
|
@@ -77,11 +77,7 @@ export interface HelpDeskDesk {
|
|
|
77
77
|
logo_dark_url: string | null;
|
|
78
78
|
icon_url?: string | null;
|
|
79
79
|
};
|
|
80
|
-
auth_mode: 'email_pin' | '
|
|
81
|
-
identity: {
|
|
82
|
-
issuer_account_id: string;
|
|
83
|
-
client_id: string;
|
|
84
|
-
} | null;
|
|
80
|
+
auth_mode: 'email_pin' | 'external_sso' | 'external_unavailable';
|
|
85
81
|
external_identity?: HelpDeskExternalIdentity | null;
|
|
86
82
|
customer_can_mark_resolved: boolean;
|
|
87
83
|
/** Optional plain-text note shown only after a request is confirmed sent. */
|
|
@@ -4,14 +4,14 @@ export interface HelpDeskWidgetIdentityOptions {
|
|
|
4
4
|
givenName?: string;
|
|
5
5
|
familyName?: string;
|
|
6
6
|
selectAccount?: boolean;
|
|
7
|
-
/** The current employee gate's company
|
|
7
|
+
/** The current employee gate's company, whose membership Core checks for the person this sign-in proves. */
|
|
8
8
|
employeeCompanyId?: string;
|
|
9
9
|
signal?: AbortSignal;
|
|
10
10
|
}
|
|
11
11
|
export interface HelpDeskWidgetIdentityChallenge {
|
|
12
12
|
challenge_id: string;
|
|
13
13
|
verifier: string;
|
|
14
|
-
/** Private to this window, like the verifier: handed only to the
|
|
14
|
+
/** Private to this window, like the verifier: handed only to the sign-in window it opened, which Core requires it from. */
|
|
15
15
|
state: string;
|
|
16
16
|
sign_in_url: string;
|
|
17
17
|
expires_at: number;
|
|
@@ -59,7 +59,7 @@ export declare class IdentityApi extends SparkVaultApi {
|
|
|
59
59
|
drawSigninReference(): Promise<string>;
|
|
60
60
|
/**
|
|
61
61
|
* Check whether the SVID resolved from an email or phone has registered
|
|
62
|
-
* passkeys (`has_passkey`; cross-tenant
|
|
62
|
+
* passkeys (`has_passkey`; cross-tenant, single global RP), for a
|
|
63
63
|
* verification that admits passkeys.
|
|
64
64
|
*/
|
|
65
65
|
checkPasskey(identity: string, identityType?: 'email' | 'phone', authContext?: AuthContext): Promise<{
|
|
@@ -67,7 +67,7 @@ export declare class IdentityApi extends SparkVaultApi {
|
|
|
67
67
|
}>;
|
|
68
68
|
/**
|
|
69
69
|
* Redeem a one-time sign-in code (with its PKCE verifier) for the sign-in
|
|
70
|
-
* result
|
|
70
|
+
* result: the shared return leg for `flow: 'redirect'` and the silent SSO
|
|
71
71
|
* self-heal. The code arrives in the URL fragment after the hosted page
|
|
72
72
|
* navigates back; it is single-use, 60s-lived, and bound to this page's
|
|
73
73
|
* origin server-side.
|
|
@@ -152,7 +152,7 @@ export declare class IdentityApi extends SparkVaultApi {
|
|
|
152
152
|
}): Promise<BackupVerifyResponse>;
|
|
153
153
|
/**
|
|
154
154
|
* Skip a post-login recommendation, suppressing it server-side for 30 days.
|
|
155
|
-
* Authorized by the login's verification token. Best-effort
|
|
155
|
+
* Authorized by the login's verification token. Best-effort: a failure here
|
|
156
156
|
* must not block completing the login.
|
|
157
157
|
*/
|
|
158
158
|
dismissRecommendation(params: {
|
|
@@ -195,7 +195,7 @@ export declare class IdentityApi extends SparkVaultApi {
|
|
|
195
195
|
*/
|
|
196
196
|
sendSparkLink(email: string, connectionId: string, authContext?: AuthContext, signinRef?: string | null, identityTypes?: readonly SigninIdentityType[] | null): Promise<SparkLinkSendResponse>;
|
|
197
197
|
/**
|
|
198
|
-
* Claim the SparkLink click's result by kindling
|
|
198
|
+
* Claim the SparkLink click's result by kindling, the WebSocket-loss
|
|
199
199
|
* fallback. The SDK calls this when its socket was suspended with the tab and
|
|
200
200
|
* it refocuses. Returns what the click produced (a completed login, or its
|
|
201
201
|
* second-factor challenge), or null while still pending (not yet clicked) or
|
|
@@ -221,7 +221,7 @@ export declare function verifySessionParam(authContext?: AuthContext): {
|
|
|
221
221
|
* Read a SparkLink result event. The WebSocket push and the kindling reclaim
|
|
222
222
|
* carry the same server-built event, so this is the one reader for both.
|
|
223
223
|
* Returns null for anything that is not a usable result: a still-pending
|
|
224
|
-
* reclaim, or an event missing what its type requires
|
|
224
|
+
* reclaim, or an event missing what its type requires, such as a challenge without a
|
|
225
225
|
* ticket, or a completed login with neither a token (default flow) nor the
|
|
226
226
|
* redirect that continues it (OIDC hosted login).
|
|
227
227
|
*/
|
|
@@ -37,7 +37,7 @@ interface LauncherCallbacks {
|
|
|
37
37
|
/**
|
|
38
38
|
* The opener OBSERVED the popup end with no result (window closed, or it
|
|
39
39
|
* never opened) while the retry alert keeps the flow alive. There is no lost
|
|
40
|
-
* result to self-heal, so the owner retires its pending sign-in marker
|
|
40
|
+
* result to self-heal, so the owner retires its pending sign-in marker;
|
|
41
41
|
* without this, a reload while the alert is up fires a spurious recovery
|
|
42
42
|
* bounce. Deliberately NOT onCancel: the flow is unsettled, retry may follow.
|
|
43
43
|
*/
|
|
@@ -50,7 +50,7 @@ interface LauncherCallbacks {
|
|
|
50
50
|
*/
|
|
51
51
|
drawSigninReference: () => void;
|
|
52
52
|
/**
|
|
53
|
-
* The popup's handle was severed (COOP)
|
|
53
|
+
* The popup's handle was severed (COOP): postMessage can never deliver, so
|
|
54
54
|
* a retry popup is futile. The owner should switch this tab to the redirect
|
|
55
55
|
* flow; resolve `true` when the navigation started (this page is unloading),
|
|
56
56
|
* `false` when it did not: the return leg could not be armed (e.g. no
|
|
@@ -39,7 +39,7 @@ export interface OtpVerifyResult {
|
|
|
39
39
|
/** Machine-readable API error code (e.g. 'identity_locked'). */
|
|
40
40
|
errorCode?: string;
|
|
41
41
|
/**
|
|
42
|
-
* Set when the code was correct but the account has 2FA enabled
|
|
42
|
+
* Set when the code was correct but the account has 2FA enabled: the login
|
|
43
43
|
* is not complete until a second factor is submitted against this ticket.
|
|
44
44
|
*/
|
|
45
45
|
secondFactor?: {
|
|
@@ -60,7 +60,7 @@ export declare class PasskeyHandler {
|
|
|
60
60
|
* Verify user with an existing passkey.
|
|
61
61
|
*
|
|
62
62
|
* On the Identity origin (the hosted widget / hosted login) the ceremony runs
|
|
63
|
-
* inline
|
|
63
|
+
* inline: same-origin with the RP id, one tap, no popup. On a third-party
|
|
64
64
|
* origin the rpId would not match the document, so it falls back to the popup
|
|
65
65
|
* served from the Identity origin. (Verification, unlike registration, is
|
|
66
66
|
* supported in cross-origin iframes, so the embedded widget uses the inline
|
|
@@ -69,14 +69,14 @@ export declare class PasskeyHandler {
|
|
|
69
69
|
verify(signal?: AbortSignal): Promise<PasskeyResult>;
|
|
70
70
|
/**
|
|
71
71
|
* True when the SDK is running ON the Identity origin and the browser exposes
|
|
72
|
-
* WebAuthn
|
|
72
|
+
* WebAuthn, the only place an inline ceremony's rpId matches the document.
|
|
73
73
|
*/
|
|
74
74
|
private canRunCeremonyInline;
|
|
75
75
|
/**
|
|
76
76
|
* True when the discoverable ceremony may be fired WITHOUT a user gesture:
|
|
77
77
|
* the flow is running on the Identity origin (the inline ceremony needs no
|
|
78
|
-
* popup, so no gesture) AND this browser carries the passkey-hint cookie
|
|
79
|
-
* a passkey login has completed here before. First visits never see an
|
|
78
|
+
* popup, so no gesture) AND this browser carries the passkey-hint cookie
|
|
79
|
+
* (a passkey login has completed here before). First visits never see an
|
|
80
80
|
* unprompted system sheet.
|
|
81
81
|
*/
|
|
82
82
|
canAutoVerify(): boolean;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import type { ResolvedConfig } from '../../config';
|
|
15
15
|
import type { VerifyResult, SignInOptions, SignInResult, SigninIdentityType, TokenClaims, AttachOptions, PortalUrlOptions, RedirectResultOptions, RenderOptions } from './types';
|
|
16
16
|
/**
|
|
17
|
-
* Whether `handleRedirectResult()` has anything to do on this load
|
|
17
|
+
* Whether `handleRedirectResult()` has anything to do on this load: a returned
|
|
18
18
|
* sign-in fragment to consume, or a pending sign-in to self-heal. Public + side
|
|
19
19
|
* effect-free (peeks, never consumes) so a host that defers SDK init for
|
|
20
20
|
* performance can cheaply decide whether to boot the SDK on a given page load,
|
|
@@ -30,7 +30,7 @@ export declare class IdentityModule {
|
|
|
30
30
|
private pendingSignIn;
|
|
31
31
|
constructor(config: ResolvedConfig);
|
|
32
32
|
/**
|
|
33
|
-
* Build a deep link into the person's auth.sv Identity portal
|
|
33
|
+
* Build a deep link into the person's auth.sv Identity portal, where they
|
|
34
34
|
* manage their verified identity, passkeys, sessions, and connected sites
|
|
35
35
|
* across every SparkVault-integrated site. Send a signed-in user here to
|
|
36
36
|
* self-serve;
|
|
@@ -52,7 +52,7 @@ export declare class IdentityModule {
|
|
|
52
52
|
* SSO hub session on the Identity origin),
|
|
53
53
|
* the browser surfaces a "Continue as …" prompt with no popup, redirect, or
|
|
54
54
|
* typing. Requires a registered `clientId` in the SDK config and a browser
|
|
55
|
-
* with FedCM support
|
|
55
|
+
* with FedCM support: callers should feature-detect with
|
|
56
56
|
* `IdentityModule.isFedcmAvailable()` and fall back to `signIn()` otherwise.
|
|
57
57
|
*
|
|
58
58
|
* @returns the verified result, or `null` when the browser has no FedCM
|
|
@@ -85,7 +85,7 @@ export declare class IdentityModule {
|
|
|
85
85
|
* This is the single programmatic entry point; `attach()` binds it to element
|
|
86
86
|
* clicks. The popup runs the flow top-level on the Identity origin (so
|
|
87
87
|
* login's `__Host-` hub cookie is a first-party write and cross-domain SSO
|
|
88
|
-
* works) and posts the result back
|
|
88
|
+
* works) and posts the result back; the promise resolves with it.
|
|
89
89
|
*
|
|
90
90
|
* Resilience: pair this with `handleRedirectResult()` on page load. If the
|
|
91
91
|
* popup's result is ever lost (a mobile browser discards the backgrounded
|
|
@@ -150,17 +150,17 @@ export declare class IdentityModule {
|
|
|
150
150
|
*/
|
|
151
151
|
decodeToken(token: string): TokenClaims;
|
|
152
152
|
/**
|
|
153
|
-
* Complete a sign-in on page load
|
|
153
|
+
* Complete a sign-in on page load: the return leg of `signIn()`. Call once
|
|
154
154
|
* on every page load; it resolves `null` when there is nothing to do.
|
|
155
155
|
*
|
|
156
156
|
* It handles two cases:
|
|
157
|
-
* 1. A one-time code is in the URL fragment (`#sv_code=…`)
|
|
157
|
+
* 1. A one-time code is in the URL fragment (`#sv_code=…`): the popup's
|
|
158
158
|
* result was lost and self-heal navigated here, or `flow: 'redirect'`
|
|
159
159
|
* returned. Redeem it server-side and hand the full result to
|
|
160
160
|
* `onSuccess` (and resolve with it).
|
|
161
161
|
* 2. A sign-in was in flight but never delivered (a mobile browser
|
|
162
162
|
* discarded the backgrounded opener tab, killing the popup's
|
|
163
|
-
* postMessage)
|
|
163
|
+
* postMessage): silently re-mint from the SSO session the popup signed
|
|
164
164
|
* in or chose, by navigating this tab through the silent SSO endpoint
|
|
165
165
|
* and straight back with a code (case 1 on return). The bounce names
|
|
166
166
|
* the sign-in's reference, and the endpoint mints only when the
|
|
@@ -168,7 +168,7 @@ export declare class IdentityModule {
|
|
|
168
168
|
* such session (a sign-in that opened none, such as one through the
|
|
169
169
|
* account's own identity provider) it comes back logged-out, no oracle.
|
|
170
170
|
*
|
|
171
|
-
* The code is one-time, PKCE-bound, and origin-locked
|
|
171
|
+
* The code is one-time, PKCE-bound, and origin-locked, never the token. The
|
|
172
172
|
* host must still verify `result.token` server-side via the Identity JWKS.
|
|
173
173
|
*
|
|
174
174
|
* @example Call on page load; sign-in clicks stay unchanged.
|
|
@@ -183,7 +183,7 @@ export declare class IdentityModule {
|
|
|
183
183
|
* Silently re-mint the sign-in result from the SSO session the popup signed
|
|
184
184
|
* in or chose. Navigates this tab through the silent SSO endpoint
|
|
185
185
|
* (a top-level GET, so the `SameSite=Lax` hub cookie rides along) which,
|
|
186
|
-
* PKCE-bound, returns a one-time code in the fragment
|
|
186
|
+
* PKCE-bound, returns a one-time code in the fragment, handled by case 1 on
|
|
187
187
|
* return. No-op (stays put) if session storage or WebCrypto is unavailable,
|
|
188
188
|
* so a degraded environment simply never recovers rather than erroring. The
|
|
189
189
|
* bounce's PKCE verifier and state are a draw from the Identity origin
|
|
@@ -262,7 +262,7 @@ export declare class IdentityModule {
|
|
|
262
262
|
* Whether the preloaded config has already settled as a *permanent* failure
|
|
263
263
|
* the popup can't surface (origin not allowed, or product not configured).
|
|
264
264
|
* Used to skip the launcher and show the error dialog in-page immediately.
|
|
265
|
-
* Returns false
|
|
265
|
+
* Returns false (proceed to the launcher) when config is not preloaded,
|
|
266
266
|
* still in flight (raced against a short timeout so the common path is never
|
|
267
267
|
* delayed), resolved, or failed only transiently (the launcher surfaces a
|
|
268
268
|
* transient failure in its own dialog).
|
|
@@ -289,7 +289,7 @@ export declare class IdentityModule {
|
|
|
289
289
|
*
|
|
290
290
|
* @internal Used only by the SparkVault-hosted sign-in popup and hosted login
|
|
291
291
|
* page (which own their chrome and pass `renderMode: 'local'`). Customer
|
|
292
|
-
* integrations have no inline mode
|
|
292
|
+
* integrations have no inline mode; use `signIn()` / `attach()`.
|
|
293
293
|
*/
|
|
294
294
|
render(options: RenderOptions): Promise<VerifyResult>;
|
|
295
295
|
}
|
|
@@ -50,7 +50,7 @@ export declare class IdentityRenderer {
|
|
|
50
50
|
* Seed the verification identity from the render options, deriving the
|
|
51
51
|
* channel (email vs phone) from the value itself rather than trusting which
|
|
52
52
|
* option field carried it. The hosted login forwards a simple-mode identity
|
|
53
|
-
* hint
|
|
53
|
+
* hint (which may be a phone number) as `email`; keying off the value keeps
|
|
54
54
|
* the method list AND the OTP delivery target aligned with the real channel
|
|
55
55
|
* instead of falling back to the email methods. Normalizes to E.164 /
|
|
56
56
|
* lowercased email so the code goes to the canonical identifier.
|
|
@@ -58,7 +58,7 @@ export declare class IdentityRenderer {
|
|
|
58
58
|
private applyInitialIdentity;
|
|
59
59
|
/**
|
|
60
60
|
* True when the identifier is fixed by the flow and the person must prove
|
|
61
|
-
* that exact identity
|
|
61
|
+
* that exact identity: the invite / simple-redirect case. There is no
|
|
62
62
|
* identifier-entry step to return to, so the picker must not offer a
|
|
63
63
|
* "change identity" back link that would let them verify a different
|
|
64
64
|
* identifier than the one they were invited as.
|
|
@@ -88,8 +88,8 @@ export declare class IdentityRenderer {
|
|
|
88
88
|
* would otherwise escape. In the default embedded/dialog mode that escape is
|
|
89
89
|
* exactly the "closes silently" failure: the host's `onError` runs, the
|
|
90
90
|
* embedding page tears the iframe down, and the user is left with no message.
|
|
91
|
-
* Render the error in the SparkVault dialog
|
|
92
|
-
* in-flow error already behaves
|
|
91
|
+
* Render the error in the SparkVault dialog, consistent with how every
|
|
92
|
+
* in-flow error already behaves, so the dialog stays open and the user can
|
|
93
93
|
* retry or close it (→ onCancel).
|
|
94
94
|
*/
|
|
95
95
|
showStartupError(error: unknown): void;
|
|
@@ -97,7 +97,7 @@ export declare class IdentityRenderer {
|
|
|
97
97
|
* Map a config-fetch error to the appropriate terminal view.
|
|
98
98
|
*
|
|
99
99
|
* Two failures are permanent developer-misconfigurations, not transient
|
|
100
|
-
* outages, so they get dedicated terminal screens (no "Try Again"
|
|
100
|
+
* outages, so they get dedicated terminal screens (no "Try Again", since retrying
|
|
101
101
|
* can never clear them) instead of the generic service-unavailable view:
|
|
102
102
|
* - `product_not_configured`: the account has not configured Identity.
|
|
103
103
|
* - `ORIGIN_NOT_ALLOWED`: this site's domain is not on the account's
|
|
@@ -204,7 +204,7 @@ export declare class IdentityRenderer {
|
|
|
204
204
|
* Fired on open for returning browsers and from the identifier form's
|
|
205
205
|
* "Sign in with a passkey" shortcut. Anything short of a terminal outcome
|
|
206
206
|
* (dismissed sheet, no credential on the device, transient failure) falls
|
|
207
|
-
* back to the identifier form with no error banner
|
|
207
|
+
* back to the identifier form with no error banner: the person simply
|
|
208
208
|
* lands where a first-time visitor starts.
|
|
209
209
|
*/
|
|
210
210
|
private launchDiscoverableVerify;
|
|
@@ -332,7 +332,7 @@ export declare class IdentityRenderer {
|
|
|
332
332
|
private handlePasskeyRegistrationSkip;
|
|
333
333
|
/**
|
|
334
334
|
* Leave for the social provider. The renderer runs on the Identity origin's
|
|
335
|
-
* sign-in page, and the round trip returns to that same page
|
|
335
|
+
* sign-in page, and the round trip returns to that same page, query intact,
|
|
336
336
|
* because the query carries the destination the page was opened for (the
|
|
337
337
|
* popup's `origin`, or the redirect mode's handoff parameters), which the
|
|
338
338
|
* page re-gates before releasing the result. The state stored here is what
|
|
@@ -403,7 +403,7 @@ export declare class IdentityRenderer {
|
|
|
403
403
|
* The server returns an ordered `recommendations` list (passkey upsell,
|
|
404
404
|
* backup verification, …); this walks it, rendering the step views the SDK
|
|
405
405
|
* supports and finalizing when the queue drains. A redirect target skips the
|
|
406
|
-
* pipeline. A future nudge is one new recommendation type + view case
|
|
406
|
+
* pipeline. A future nudge is one new recommendation type + view case, no
|
|
407
407
|
* primary-login handler changes.
|
|
408
408
|
*/
|
|
409
409
|
private runPostLogin;
|
|
@@ -477,7 +477,7 @@ export declare class IdentityRenderer {
|
|
|
477
477
|
*
|
|
478
478
|
* A completed login runs the post-login pipeline, which hands the host the
|
|
479
479
|
* full result (including any redirect URL) before attempting top-level
|
|
480
|
-
* navigation
|
|
480
|
+
* navigation: the host page is the source of truth for what happens next;
|
|
481
481
|
* the SDK's window.location.href call is a fallback for hosts that delegate
|
|
482
482
|
* navigation entirely to the SDK. A login held at the second-factor gate
|
|
483
483
|
* opens the two-factor view, exactly as after an emailed code.
|
|
@@ -499,7 +499,7 @@ export declare class IdentityRenderer {
|
|
|
499
499
|
* is suspended (mobile: the user leaves to the mail app). On refocus, if the
|
|
500
500
|
* socket is no longer open, reclaim the click's result once by kindling. A
|
|
501
501
|
* single ~2s retry covers returning before the server finished writing it.
|
|
502
|
-
* Deliberately NOT a polling loop
|
|
502
|
+
* Deliberately NOT a polling loop: it fires only on refocus, and only when
|
|
503
503
|
* the socket is actually gone.
|
|
504
504
|
*/
|
|
505
505
|
private armSparkLinkRefocusClaim;
|