@msssystems/mss-link-sdk 0.2.8 → 0.2.9
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.
|
@@ -2,7 +2,9 @@ import { WasmCryptoEngine } from '../../core/wasm-crypto-engine';
|
|
|
2
2
|
import type { DecryptedMessage } from './message.contracts';
|
|
3
3
|
export declare class MessagesCryptoClient {
|
|
4
4
|
private readonly engine;
|
|
5
|
+
private groupChatIds;
|
|
5
6
|
constructor(engine: WasmCryptoEngine);
|
|
7
|
+
setGroupChatIds(chatIds: string[]): void;
|
|
6
8
|
sendMessage(params: {
|
|
7
9
|
chatId: string;
|
|
8
10
|
targetUserId: string;
|
|
@@ -2,9 +2,13 @@ import { normalizeLocalCryptoError } from '../../errors/decryption-errors';
|
|
|
2
2
|
import { mapLocalSdkMessage } from './message.mapper';
|
|
3
3
|
export class MessagesCryptoClient {
|
|
4
4
|
engine;
|
|
5
|
+
groupChatIds = new Set();
|
|
5
6
|
constructor(engine) {
|
|
6
7
|
this.engine = engine;
|
|
7
8
|
}
|
|
9
|
+
setGroupChatIds(chatIds) {
|
|
10
|
+
this.groupChatIds = new Set(chatIds);
|
|
11
|
+
}
|
|
8
12
|
async sendMessage(params) {
|
|
9
13
|
try {
|
|
10
14
|
await this.engine.ensureReady();
|
|
@@ -33,6 +37,8 @@ export class MessagesCryptoClient {
|
|
|
33
37
|
message.plaintext === '[Ошибка дешифровки]')) {
|
|
34
38
|
if (message.kind === 'SYSTEM')
|
|
35
39
|
continue;
|
|
40
|
+
if (this.groupChatIds.has(message.chatId))
|
|
41
|
+
continue;
|
|
36
42
|
console.warn(`[E2EE] Decryption failed for message ${message.messageId} from ${message.senderId}. Triggering auto-heal...`);
|
|
37
43
|
try {
|
|
38
44
|
await client.healSession(message.chatId, message.senderId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@msssystems/mss-link-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "Official managed application SDK for MSS ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"registry": "https://registry.npmjs.org/"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@msssystems/mss-crypto-wasm": "^0.1.
|
|
56
|
+
"@msssystems/mss-crypto-wasm": "^0.1.23",
|
|
57
57
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
58
58
|
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
59
59
|
"express": "^4.0.0 || ^5.0.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@msssystems/mss-crypto-wasm": "^0.1.
|
|
80
|
+
"@msssystems/mss-crypto-wasm": "^0.1.23",
|
|
81
81
|
"@nestjs/common": "^11.0.1",
|
|
82
82
|
"@nestjs/core": "^11.0.1",
|
|
83
83
|
"@types/express": "^5.0.0",
|
|
@@ -90,8 +90,5 @@
|
|
|
90
90
|
"engines": {
|
|
91
91
|
"node": ">=20.0.0"
|
|
92
92
|
},
|
|
93
|
-
"packageManager": "yarn@4.14.1"
|
|
94
|
-
"dependencies": {
|
|
95
|
-
"repomix": "^1.14.1"
|
|
96
|
-
}
|
|
93
|
+
"packageManager": "yarn@4.14.1"
|
|
97
94
|
}
|