@thezelijah/majik-message 1.0.18 → 1.0.20

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.
@@ -1,16 +1,16 @@
1
1
  export declare const IV_LENGTH = 12;
2
2
  export declare function generateRandomBytes(len: number): Uint8Array;
3
3
  export declare function generateEd25519Keypair(): {
4
- edPublic: Uint8Array<ArrayBufferLike>;
5
- edSecret: Uint8Array<ArrayBufferLike>;
6
- xPublic: Uint8Array<ArrayBuffer> | null;
7
- xSecret: Uint8Array<ArrayBuffer> | null;
4
+ edPublic: Uint8Array;
5
+ edSecret: Uint8Array;
6
+ xPublic: Uint8Array | null;
7
+ xSecret: Uint8Array | null;
8
8
  };
9
9
  export declare function deriveEd25519FromSeed(seed32: Uint8Array): {
10
- edPublic: Uint8Array<ArrayBufferLike>;
11
- edSecret: Uint8Array<ArrayBufferLike>;
12
- xPublic: Uint8Array<ArrayBuffer> | null;
13
- xSecret: Uint8Array<ArrayBuffer> | null;
10
+ edPublic: Uint8Array;
11
+ edSecret: Uint8Array;
12
+ xPublic: Uint8Array | null;
13
+ xSecret: Uint8Array | null;
14
14
  };
15
15
  export declare function fingerprintFromPublicRaw(rawPublic: Uint8Array): string;
16
16
  export declare function aesGcmEncrypt(keyBytes: Uint8Array, iv: Uint8Array, plaintext: Uint8Array): Uint8Array;
@@ -87,6 +87,7 @@ export declare class MajikMessageChat {
87
87
  hasUserRead(userPublicKey: MajikMessagePublicKey): boolean;
88
88
  isReadByAll(): boolean;
89
89
  getUnreadRecipients(): string[];
90
+ setTimestamp(date?: Date): void;
90
91
  toJSON(): MajikMessageChatJSON;
91
92
  static fromJSON(json: string | MajikMessageChatJSON): MajikMessageChat;
92
93
  getRedisKey(): RedisKey;
@@ -350,6 +350,9 @@ export class MajikMessageChat {
350
350
  getUnreadRecipients() {
351
351
  return this.recipients.filter((recipient) => !this.read_by.includes(recipient));
352
352
  }
353
+ setTimestamp(date = new Date()) {
354
+ this.timestamp = date.toISOString();
355
+ }
353
356
  // ============= SERIALIZATION =============
354
357
  toJSON() {
355
358
  return {
@@ -1,4 +1,4 @@
1
- import { MajikUser } from "./majik-user/majik-user";
1
+ import { MajikUser } from '@thezelijah/majik-user';
2
2
  import { SerializedMajikContact } from "../../contacts/majik-contact";
3
3
  export interface MajikMessageIdentityJSON {
4
4
  id: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@thezelijah/majik-message",
3
3
  "type": "module",
4
4
  "description": "Encrypt and decrypt messages on any website. Secure chats with keypairs and seed-based accounts. Open source.",
5
- "version": "1.0.18",
5
+ "version": "1.0.20",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",
@@ -84,7 +84,7 @@
84
84
  "@stablelib/random": "^2.0.1",
85
85
  "@stablelib/sha256": "^2.0.1",
86
86
  "@stablelib/x25519": "^2.0.1",
87
- "@thezelijah/majik-message": "^1.0.9",
87
+ "@thezelijah/majik-user": "^1.0.0",
88
88
  "ed2curve": "^0.3.0",
89
89
  "fernet": "^0.3.3",
90
90
  "fflate": "^0.8.2",
@@ -94,7 +94,6 @@
94
94
  "devDependencies": {
95
95
  "@types/ed2curve": "^0.2.4",
96
96
  "@types/fernet": "^0.4.3",
97
- "@types/node": "^25.0.3",
98
- "typescript": "^5.9.3"
97
+ "@types/node": "^25.0.3"
99
98
  }
100
99
  }