@learncard/sss-key-manager 0.2.4 → 0.2.6

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/src/types.ts CHANGED
@@ -16,6 +16,7 @@ export {
16
16
  type AuthProvider,
17
17
  type RecoveryMethodInfo,
18
18
  type RecoveryResult,
19
+ type RevokeOtherDevicesResult,
19
20
  type IdentityRecoverySession,
20
21
  type ServerKeyStatus,
21
22
  type SssActivationState,
@@ -156,6 +157,18 @@ export class EscrowPinLockedError extends Error {
156
157
  }
157
158
  }
158
159
 
160
+ /**
161
+ * A PIN sign-in released the key, but the released share version is no longer on the
162
+ * server (another device secured the account or recovered meanwhile). Nothing was
163
+ * stored; a revoke is never silently undone.
164
+ */
165
+ export class PinSignInStaleError extends Error {
166
+ constructor() {
167
+ super('Your account changed while signing in. Try again.');
168
+ this.name = 'PinSignInStaleError';
169
+ }
170
+ }
171
+
159
172
  export interface PasskeyRecoveryMethod {
160
173
  type: 'passkey';
161
174
  credentialId?: string;
@@ -180,7 +193,13 @@ export type RecoveryMethod =
180
193
  * SSS-specific recovery input — what the user provides to recover their key.
181
194
  */
182
195
  export type RecoveryInput =
183
- | { method: 'escrow-pin'; pin: string; expectedDid?: string }
196
+ | {
197
+ method: 'escrow-pin';
198
+ pin: string;
199
+ expectedDid?: string;
200
+ /** Verified recovery-email session; set only when no login is bound yet. */
201
+ recoverySessionToken?: string;
202
+ }
184
203
  | {
185
204
  method: 'escrow';
186
205
  holdId: string;