An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(identity-wallet): add recovery override IPC wrappers

- Add RecoveryError type matching Rust RecoveryError enum
- Add SignedRecoveryOp interface matching Rust struct
- Add buildRecoveryOverride TypeScript wrapper
- Add submitRecoveryOverride TypeScript wrapper
- Types use camelCase serialization matching Rust #[serde] directives
- Enables frontend to call recovery override commands

+46
+46
apps/identity-wallet/src/lib/ipc.ts
··· 524 524 */ 525 525 export const checkIdentityStatus = (): Promise<IdentityStatus[]> => 526 526 invoke('check_identity_status'); 527 + 528 + // ── recovery_override ───────────────────────────────────────────────────────── 529 + 530 + /** 531 + * Error returned by recovery override commands. 532 + * Matches RecoveryError enum in recovery.rs with #[serde(tag = "code", rename_all = "SCREAMING_SNAKE_CASE")]. 533 + */ 534 + export type RecoveryError = 535 + | { code: 'RECOVERY_WINDOW_EXPIRED' } 536 + | { code: 'SIGNING_FAILED'; message: string } 537 + | { code: 'PLC_DIRECTORY_ERROR'; message: string } 538 + | { code: 'NETWORK_ERROR'; message: string } 539 + | { code: 'IDENTITY_NOT_FOUND'; message: string } 540 + | { code: 'UNAUTHORIZED_CHANGE_NOT_FOUND' }; 541 + 542 + /** 543 + * Signed recovery operation ready for review and submission. 544 + * Matches SignedRecoveryOp struct in recovery.rs with #[serde(rename_all = "camelCase")]. 545 + */ 546 + export interface SignedRecoveryOp { 547 + /** Human-readable diff of what the recovery operation changes. */ 548 + diff: OpDiff; 549 + /** The signed PLC operation JSON, ready to POST to plc.directory. */ 550 + signedOp: Record<string, unknown>; 551 + } 552 + 553 + /** 554 + * Build a recovery override operation for an unauthorized PLC change. 555 + * 556 + * Fetches the audit log, identifies the fork point, builds a counter-operation 557 + * that restores the pre-unauthorized state, and signs it with the device key. 558 + * 559 + * The built operation is stored in RecoveryState for subsequent submission 560 + * via submitRecoveryOverride(). 561 + */ 562 + export const buildRecoveryOverride = (did: string, operationCid: string): Promise<SignedRecoveryOp> => 563 + invoke('build_recovery_override_cmd', { did, operationCid }); 564 + 565 + /** 566 + * Submit the pending recovery override operation to plc.directory. 567 + * 568 + * Must be called after buildRecoveryOverride() — submits the stored signed 569 + * operation, updates the cached PLC audit log, and returns the updated DID document. 570 + */ 571 + export const submitRecoveryOverride = (did: string): Promise<ClaimResult> => 572 + invoke('submit_recovery_override_cmd', { did });