@majikah/majik-universal-id-client 0.1.3 → 0.1.4

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.
@@ -718,5 +718,11 @@ export declare class MajikUniversalIdClient extends MajikKeyClient<MajikContact,
718
718
  isAutoLockOnMinimizeEnabled(): Promise<boolean>;
719
719
  autoLockInterval(): Promise<number | undefined>;
720
720
  isOnetimeUnlockEnabled(): Promise<boolean>;
721
+ /**
722
+ * Update the metadata (e.g., label) of an owned account.
723
+ * This updates both the contact directory and the local ownAccounts cache.
724
+ */
725
+ updateOwnAccountMeta(id: string, meta: Partial<MajikContactMeta>): Promise<void>;
726
+ hasOwnIdentity(fingerprint: string): Promise<boolean>;
721
727
  }
722
728
  export {};
@@ -1536,4 +1536,29 @@ export class MajikUniversalIdClient extends MajikKeyClient {
1536
1536
  const appPreferences = await this.stateManager.getUserAppPreferences();
1537
1537
  return appPreferences.security?.key?.onetimeUnlock ?? true;
1538
1538
  }
1539
+ // ==========================================================================
1540
+ // ── ACCOUNT MANAGEMENT (overrides / additions on top of MajikKeyClient) ──
1541
+ // ==========================================================================
1542
+ /**
1543
+ * Update the metadata (e.g., label) of an owned account.
1544
+ * This updates both the contact directory and the local ownAccounts cache.
1545
+ */
1546
+ async updateOwnAccountMeta(id, meta) {
1547
+ if (!this._ownAccounts.has(id)) {
1548
+ throw new Error(`Account not found in own accounts: "${id}"`);
1549
+ }
1550
+ // 1. Update the contact record in the shared directory
1551
+ await this._contacts.updateContactMeta(id, meta);
1552
+ if (meta.label && meta.label.trim()) {
1553
+ await this.keyManager.updateLabel(id, meta.label);
1554
+ }
1555
+ // 2. Fetch the updated contact and sync the local _ownAccounts map
1556
+ const updatedContact = this._contacts.getContact(id);
1557
+ if (updatedContact) {
1558
+ this._ownAccounts.set(id, updatedContact);
1559
+ }
1560
+ }
1561
+ async hasOwnIdentity(fingerprint) {
1562
+ return this.keyManager.has(fingerprint);
1563
+ }
1539
1564
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-universal-id-client",
3
3
  "type": "module",
4
4
  "description": "The core universal identity model for the Majikah ecosystem, featuring hybrid PQC signatures (Ed25519 + ML-DSA), ML-KEM-768 private info encryption, and multi-stage Didit verification graduation.",
5
- "version": "0.1.3",
5
+ "version": "0.1.4",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",