@majikah/majik-message 0.3.0 → 0.3.1

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/dist/index.d.ts CHANGED
@@ -17,3 +17,4 @@ export * from "./core/compressor/majik-compressor";
17
17
  export * from "./core/database/thread/majik-message-thread";
18
18
  export * from "./core/database/thread/mail/majik-message-mail";
19
19
  export * from "./core/database/thread/enums";
20
+ export { migrateMajikMessageJSON } from "./core/contacts/majik-contact-migration";
package/dist/index.js CHANGED
@@ -15,3 +15,4 @@ export * from "./core/compressor/majik-compressor";
15
15
  export * from "./core/database/thread/majik-message-thread";
16
16
  export * from "./core/database/thread/mail/majik-message-mail";
17
17
  export * from "./core/database/thread/enums";
18
+ export { migrateMajikMessageJSON } from "./core/contacts/majik-contact-migration";
@@ -15,7 +15,6 @@ import { MajikFile, MajikFileError, } from "@majikah/majik-file";
15
15
  import { MajikSignature, } from "@majikah/majik-signature";
16
16
  import { gzipSync, gunzipSync } from "fflate";
17
17
  import { MajikContactManager } from "./core/contacts/majik-contact-manager";
18
- import { migrateMajikMessageJSON } from "./core/contacts/majik-contact-migration";
19
18
  // ─── MajikMessage ─────────────────────────────────────────────────────────────
20
19
  export class MajikMessage {
21
20
  userProfile = "default";
@@ -2305,11 +2304,11 @@ export class MajikMessage {
2305
2304
  return json;
2306
2305
  }
2307
2306
  static async fromJSON(json) {
2308
- const migratedJSON = migrateMajikMessageJSON(json);
2307
+ // const migratedJSON = migrateMajikMessageJSON(json);
2309
2308
  // ── Step 2: restore MajikContactManager (directory + groups together) ─
2310
- const contactManager = await MajikContactManager.fromJSON(migratedJSON.contacts, KEY_ALGO);
2311
- const envelopeCache = EnvelopeCache.fromJSON(migratedJSON.envelopeCache);
2312
- const instance = new this({ contactManager, envelopeCache }, migratedJSON.id);
2309
+ const contactManager = await MajikContactManager.fromJSON(json.contacts, KEY_ALGO);
2310
+ const envelopeCache = EnvelopeCache.fromJSON(json.envelopeCache);
2311
+ const instance = new this({ contactManager, envelopeCache }, json.id);
2313
2312
  try {
2314
2313
  if (json.ownAccounts && Array.isArray(json.ownAccounts.accounts)) {
2315
2314
  for (const acct of json.ownAccounts.accounts) {
@@ -2396,6 +2395,7 @@ export class MajikMessage {
2396
2395
  if (!saved?.data)
2397
2396
  return;
2398
2397
  const loaded = await loadSavedMajikFileData(saved.data);
2398
+ // Pass raw parsed object — fromJSON handles migration internally
2399
2399
  const restored = await MajikMessage.fromJSON(loaded.j);
2400
2400
  this.id = restored.id;
2401
2401
  this.contacts = restored.contacts;
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.3.0",
5
+ "version": "0.3.1",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",