@majikah/majik-message 0.2.20 → 0.2.21

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.
@@ -104,7 +104,8 @@ export declare class MajikMessage {
104
104
  updatePassphrase(currentPassphrase: string, newPassphrase: string, id?: string): Promise<void>;
105
105
  getContactByID(id: string): MajikContact | null;
106
106
  hasContact(id: string): boolean;
107
- getContactByPublicKey(publicKeyBase64: string): Promise<MajikContact | null>;
107
+ hasContactByPublicKeyBase64(publicKey: MajikMessagePublicKey): Promise<boolean>;
108
+ getContactByPublicKey(publicKeyBase64: MajikMessagePublicKey): Promise<MajikContact | null>;
108
109
  exportContactAsJSON(contactId: string): Promise<string | null>;
109
110
  exportContactAsString(contactId: string): Promise<string | null>;
110
111
  importContactFromJSON(jsonStr: string): Promise<MAJIK_API_RESPONSE>;
@@ -305,6 +305,11 @@ export class MajikMessage {
305
305
  throw new Error("Invalid contact ID");
306
306
  return this.contactDirectory.hasContact(id);
307
307
  }
308
+ async hasContactByPublicKeyBase64(publicKey) {
309
+ if (!publicKey?.trim())
310
+ throw new Error("Invalid contact public key");
311
+ return await this.contactDirectory.hasContactByPublicKeyBase64(publicKey);
312
+ }
308
313
  async getContactByPublicKey(publicKeyBase64) {
309
314
  if (!publicKeyBase64?.trim())
310
315
  throw new Error("Invalid public key");
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-message",
3
3
  "type": "module",
4
4
  "description": "Post-quantum end-to-end encryption with ML-KEM-768. Seed phrase–based accounts. Auto-expiring messages. Offline-ready. Exportable encrypted messages. Tamper-proof threads with blockchain-like integrity. Quantum-resistant messaging.",
5
- "version": "0.2.20",
5
+ "version": "0.2.21",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",