@majikah/majik-message 0.1.1 → 0.1.3

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.
@@ -43,8 +43,8 @@ export interface MajikMessageThreadSummary {
43
43
  id: MajikMessageThreadID;
44
44
  participants: MajikMessagePublicKey[];
45
45
  participant_count: number;
46
- latest_message: MajikMessageMailJSON;
47
- latest_message_timestamp: ISODateString;
46
+ latest_message: MajikMessageMailJSON | null;
47
+ latest_message_timestamp: ISODateString | null;
48
48
  total_messages: number;
49
49
  unread_count: number;
50
50
  has_unread: boolean;
@@ -192,21 +192,17 @@ export class MajikMessageThread {
192
192
  this._userID.trim().length === 0) {
193
193
  throw new ValidationError("userID is required and must be a non-empty string");
194
194
  }
195
- // Validate owner public key
195
+ // Validate owner account ID
196
196
  if (!this._owner ||
197
197
  typeof this._owner !== "string" ||
198
198
  this._owner.trim().length === 0) {
199
- throw new ValidationError("owner public key is required and must be a non-empty string");
199
+ throw new ValidationError("owner account ID is required and must be a non-empty string");
200
200
  }
201
201
  // Validate participants
202
202
  if (!Array.isArray(this._participants) ||
203
203
  this._participants.length === 0) {
204
204
  throw new ValidationError("participants must be a non-empty array");
205
205
  }
206
- // Check if owner's public key is in participants
207
- if (!this._participants.includes(this._owner)) {
208
- throw new ValidationError("Owner public key must be included in participants");
209
- }
210
206
  // Validate timestamp
211
207
  if (!(this._timestamp instanceof Date) ||
212
208
  isNaN(this._timestamp.getTime())) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-message",
3
3
  "type": "module",
4
4
  "description": "Encrypt and decrypt messages on any website or platform. Secure chats with keypairs and seed-based accounts. Open source.",
5
- "version": "0.1.1",
5
+ "version": "0.1.3",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",
@@ -89,7 +89,7 @@
89
89
  "@stablelib/sha256": "^2.0.1",
90
90
  "@stablelib/x25519": "^2.0.1",
91
91
  "@thezelijah/majik-key": "^1.0.5",
92
- "@thezelijah/majik-user": "^1.0.0",
92
+ "@thezelijah/majik-user": "^1.0.5",
93
93
  "ed2curve": "^0.3.0",
94
94
  "fernet": "^0.3.3",
95
95
  "fflate": "^0.8.2",