@sparkvault/sdk 1.0.0 → 1.1.5

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.
@@ -63,7 +63,7 @@ export declare class IdentityApi {
63
63
  * Complete passkey registration
64
64
  */
65
65
  completePasskeyRegister(params: {
66
- email: string;
66
+ session: Record<string, unknown>;
67
67
  credential: PublicKeyCredential;
68
68
  }): Promise<PasskeyVerifyResponse>;
69
69
  /**
@@ -74,7 +74,7 @@ export declare class IdentityApi {
74
74
  * Complete passkey verification
75
75
  */
76
76
  completePasskeyVerify(params: {
77
- email: string;
77
+ session: Record<string, unknown>;
78
78
  credential: PublicKeyCredential;
79
79
  }): Promise<PasskeyVerifyResponse>;
80
80
  /**
@@ -86,7 +86,8 @@ export declare class IdentityApi {
86
86
  */
87
87
  getEnterpriseAuthUrl(provider: string, redirectUri: string, state: string): string;
88
88
  /**
89
- * Send SparkLink email for identity verification
89
+ * Send SparkLink email for identity verification.
90
+ * Includes openerOrigin for postMessage-based completion notification.
90
91
  */
91
92
  sendSparkLink(email: string): Promise<SparkLinkSendResponse>;
92
93
  /**
@@ -24,6 +24,7 @@ export declare class IdentityRenderer {
24
24
  private currentView;
25
25
  private focusTimeoutId;
26
26
  private pollingInterval;
27
+ private messageListener;
27
28
  constructor(container: Container, api: IdentityApi, options: VerifyOptions, callbacks: RendererCallbacks);
28
29
  private get recipient();
29
30
  private get identityType();
@@ -78,11 +79,17 @@ export declare class IdentityRenderer {
78
79
  */
79
80
  private handlePasskeyPromptSkip;
80
81
  /**
81
- * Start polling for SparkLink verification status.
82
+ * Start listening for SparkLink verification completion.
83
+ * Uses postMessage as primary mechanism (instant notification from ceremony page),
84
+ * with polling as fallback for edge cases where postMessage might fail.
82
85
  */
83
86
  private startSparkLinkPolling;
84
87
  /**
85
- * Stop SparkLink polling.
88
+ * Handle successful SparkLink verification (from either postMessage or polling).
89
+ */
90
+ private handleSparkLinkVerified;
91
+ /**
92
+ * Stop SparkLink polling and message listener.
86
93
  */
87
94
  private stopSparkLinkPolling;
88
95
  /**
@@ -127,6 +127,8 @@ export interface PasskeyChallengeResponse {
127
127
  type: 'public-key';
128
128
  }>;
129
129
  timeout: number;
130
+ /** Session object to pass back in complete request */
131
+ session: Record<string, unknown>;
130
132
  }
131
133
  export interface PasskeyVerifyResponse {
132
134
  token: string;
@@ -12,6 +12,10 @@ export declare function createCheckmarkIcon(): SVGSVGElement;
12
12
  * Back arrow (chevron left)
13
13
  */
14
14
  export declare function createBackArrowIcon(): SVGSVGElement;
15
+ /**
16
+ * Resend/refresh icon - circular arrow
17
+ */
18
+ export declare function createResendIcon(): SVGSVGElement;
15
19
  /**
16
20
  * Close (X) icon
17
21
  */
@@ -28,6 +32,10 @@ export declare function createPasskeyIcon(): SVGSVGElement;
28
32
  * Error icon - clean triangle alert
29
33
  */
30
34
  export declare function createErrorIcon(): SVGSVGElement;
35
+ /**
36
+ * Expired icon - grayscale triangle alert for expired states
37
+ */
38
+ export declare function createExpiredIcon(): SVGSVGElement;
31
39
  /**
32
40
  * Method icons
33
41
  */
@@ -11,12 +11,15 @@ export interface SparkLinkWaitingViewProps {
11
11
  onResend: () => void;
12
12
  onFallback: () => void;
13
13
  onBack: () => void;
14
+ onExpired: () => void;
14
15
  }
15
16
  export declare class SparkLinkWaitingView implements View {
16
17
  private readonly props;
17
18
  private expirationTimer;
18
19
  private resendTimer;
19
20
  private countdownElement;
21
+ private countdownSection;
22
+ private waitingSection;
20
23
  private resendButton;
21
24
  private backLink;
22
25
  private fallbackButton;
@@ -28,6 +31,10 @@ export declare class SparkLinkWaitingView implements View {
28
31
  private createBackLink;
29
32
  private formatTime;
30
33
  private startExpirationTimer;
34
+ /**
35
+ * Switch to expired state - static icon, no animation, helpful message
36
+ */
37
+ private showExpiredState;
31
38
  private handleResend;
32
39
  destroy(): void;
33
40
  }
@@ -19,6 +19,7 @@ export declare class TotpVerifyView implements View {
19
19
  private inputElements;
20
20
  private submitButton;
21
21
  private resendButton;
22
+ private timerDisplay;
22
23
  private backLink;
23
24
  private errorContainer;
24
25
  private resendTimer;
@@ -33,7 +34,6 @@ export declare class TotpVerifyView implements View {
33
34
  private readonly inputHandlers;
34
35
  constructor(props: TotpVerifyViewProps);
35
36
  render(): HTMLElement;
36
- private createBackLink;
37
37
  private createInputGroup;
38
38
  private handleInput;
39
39
  private handleKeyDown;