@majikah/majik-message 0.3.0 → 0.3.2
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 +3 -0
- package/dist/index.js +3 -0
- package/dist/majik-message.js +8 -5
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./majik-message";
|
|
2
2
|
export type * from "./core/types";
|
|
3
|
+
export * from "./core/contacts/majik-contact-manager";
|
|
3
4
|
export * from "./core/contacts/majik-contact-directory";
|
|
5
|
+
export * from "./core/contacts/majik-contact-groups";
|
|
4
6
|
export * from "./core/crypto/constants";
|
|
5
7
|
export * from "./core/crypto/crypto-provider";
|
|
6
8
|
export * from "./core/crypto/encryption-engine";
|
|
@@ -17,3 +19,4 @@ export * from "./core/compressor/majik-compressor";
|
|
|
17
19
|
export * from "./core/database/thread/majik-message-thread";
|
|
18
20
|
export * from "./core/database/thread/mail/majik-message-mail";
|
|
19
21
|
export * from "./core/database/thread/enums";
|
|
22
|
+
export { migrateMajikMessageJSON } from "./core/contacts/majik-contact-migration";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./majik-message";
|
|
2
|
+
export * from "./core/contacts/majik-contact-manager";
|
|
2
3
|
export * from "./core/contacts/majik-contact-directory";
|
|
4
|
+
export * from "./core/contacts/majik-contact-groups";
|
|
3
5
|
export * from "./core/crypto/constants";
|
|
4
6
|
export * from "./core/crypto/crypto-provider";
|
|
5
7
|
export * from "./core/crypto/encryption-engine";
|
|
@@ -15,3 +17,4 @@ export * from "./core/compressor/majik-compressor";
|
|
|
15
17
|
export * from "./core/database/thread/majik-message-thread";
|
|
16
18
|
export * from "./core/database/thread/mail/majik-message-mail";
|
|
17
19
|
export * from "./core/database/thread/enums";
|
|
20
|
+
export { migrateMajikMessageJSON } from "./core/contacts/majik-contact-migration";
|
package/dist/majik-message.js
CHANGED
|
@@ -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";
|
|
@@ -42,8 +41,11 @@ export class MajikMessage {
|
|
|
42
41
|
"error",
|
|
43
42
|
"new-account",
|
|
44
43
|
"new-contact",
|
|
44
|
+
"new-contact-group",
|
|
45
45
|
"removed-account",
|
|
46
46
|
"removed-contact",
|
|
47
|
+
"removed-contact-group",
|
|
48
|
+
"contact-group-change",
|
|
47
49
|
"active-account-change",
|
|
48
50
|
];
|
|
49
51
|
events.forEach((e) => this.listeners.set(e, []));
|
|
@@ -2305,11 +2307,11 @@ export class MajikMessage {
|
|
|
2305
2307
|
return json;
|
|
2306
2308
|
}
|
|
2307
2309
|
static async fromJSON(json) {
|
|
2308
|
-
const migratedJSON = migrateMajikMessageJSON(json);
|
|
2310
|
+
// const migratedJSON = migrateMajikMessageJSON(json);
|
|
2309
2311
|
// ── Step 2: restore MajikContactManager (directory + groups together) ─
|
|
2310
|
-
const contactManager = await MajikContactManager.fromJSON(
|
|
2311
|
-
const envelopeCache = EnvelopeCache.fromJSON(
|
|
2312
|
-
const instance = new this({ contactManager, envelopeCache },
|
|
2312
|
+
const contactManager = await MajikContactManager.fromJSON(json.contacts, KEY_ALGO);
|
|
2313
|
+
const envelopeCache = EnvelopeCache.fromJSON(json.envelopeCache);
|
|
2314
|
+
const instance = new this({ contactManager, envelopeCache }, json.id);
|
|
2313
2315
|
try {
|
|
2314
2316
|
if (json.ownAccounts && Array.isArray(json.ownAccounts.accounts)) {
|
|
2315
2317
|
for (const acct of json.ownAccounts.accounts) {
|
|
@@ -2396,6 +2398,7 @@ export class MajikMessage {
|
|
|
2396
2398
|
if (!saved?.data)
|
|
2397
2399
|
return;
|
|
2398
2400
|
const loaded = await loadSavedMajikFileData(saved.data);
|
|
2401
|
+
// Pass raw parsed object — fromJSON handles migration internally
|
|
2399
2402
|
const restored = await MajikMessage.fromJSON(loaded.j);
|
|
2400
2403
|
this.id = restored.id;
|
|
2401
2404
|
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.
|
|
5
|
+
"version": "0.3.2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Zelijah",
|
|
8
8
|
"main": "./dist/index.js",
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@bokuweb/zstd-wasm": "^0.0.27",
|
|
83
|
-
"@majikah/majik-contact": "^0.0.
|
|
83
|
+
"@majikah/majik-contact": "^0.0.3",
|
|
84
84
|
"@majikah/majik-envelope": "^0.0.1",
|
|
85
|
-
"@majikah/majik-file": "^0.1.
|
|
86
|
-
"@majikah/majik-key": "^0.2.
|
|
87
|
-
"@majikah/majik-signature": "^0.0.
|
|
85
|
+
"@majikah/majik-file": "^0.1.2",
|
|
86
|
+
"@majikah/majik-key": "^0.2.6",
|
|
87
|
+
"@majikah/majik-signature": "^0.0.17",
|
|
88
88
|
"@noble/hashes": "^2.0.1",
|
|
89
89
|
"@noble/post-quantum": "^0.5.4",
|
|
90
90
|
"@scure/bip39": "^1.6.0",
|