@matterbridge/core 3.11.2-dev-20261104-98c7a1f → 3.11.2-dev-20261105-a15bb91
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.
|
@@ -37,6 +37,8 @@ export class MatterbridgeServiceAreaServer extends ServiceAreaServer.with(Servic
|
|
|
37
37
|
? { areaId: area.areaId, status: ServiceArea.OperationalStatus.Skipped, totalOperationalTime: area.totalOperationalTime, estimatedTime: area.estimatedTime }
|
|
38
38
|
: area);
|
|
39
39
|
}
|
|
40
|
+
if (response.status === ServiceArea.SkipAreaStatus.Success)
|
|
41
|
+
this.endpoint.emitCommand(ServiceArea, 'skipArea', request, this.context);
|
|
40
42
|
return response;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { WebRtcTransportRequestorServer } from '@matter/node/behaviors/web-rtc-transport-requestor';
|
|
2
2
|
import { WebRtcTransportRequestor } from '@matter/types/clusters/web-rtc-transport-requestor';
|
|
3
3
|
import { protectPrototype } from '../protectPrototypes.js';
|
|
4
|
+
import { MatterbridgeServer } from './matterbridgeServer.js';
|
|
4
5
|
export class MatterbridgeWebRtcTransportRequestorServer extends WebRtcTransportRequestorServer {
|
|
5
6
|
async offer(request) {
|
|
7
|
+
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
8
|
+
device.log.info(`MatterbridgeWebRtcTransportRequestorServer: received an SDP offer for session ${request.webRtcSessionId} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
6
9
|
await super.offer(request);
|
|
7
10
|
this.endpoint.emitCommand(WebRtcTransportRequestor, 'offer', request, this.context);
|
|
8
11
|
}
|
|
9
12
|
async answer(request) {
|
|
13
|
+
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
14
|
+
device.log.info(`MatterbridgeWebRtcTransportRequestorServer: received an SDP answer for session ${request.webRtcSessionId} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
10
15
|
await super.answer(request);
|
|
11
16
|
this.endpoint.emitCommand(WebRtcTransportRequestor, 'answer', request, this.context);
|
|
12
17
|
}
|
|
13
18
|
async iceCandidates(request) {
|
|
19
|
+
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
20
|
+
device.log.info(`MatterbridgeWebRtcTransportRequestorServer: received ${request.iceCandidates.length} ICE candidate(s) for session ${request.webRtcSessionId} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
14
21
|
await super.iceCandidates(request);
|
|
15
22
|
this.endpoint.emitCommand(WebRtcTransportRequestor, 'iceCandidates', request, this.context);
|
|
16
23
|
}
|
|
17
24
|
async end(request) {
|
|
25
|
+
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
26
|
+
device.log.info(`MatterbridgeWebRtcTransportRequestorServer: ending session ${request.webRtcSessionId} with reason ${request.reason} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
18
27
|
await super.end(request);
|
|
19
28
|
this.endpoint.emitCommand(WebRtcTransportRequestor, 'end', request, this.context);
|
|
20
29
|
}
|
package/dist/frontend.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
|
-
import type { ApiClusters, ApiDevice, ApiMatter, ApiPlugin,
|
|
2
|
+
import type { ApiClusters, ApiDevice, ApiMatter, ApiPlugin, BridgeStatus, PluginStatusUpdate, RefreshRequiredChanged, WsMessageBroadcast } from '@matterbridge/types';
|
|
3
3
|
import { LogLevel } from 'node-ansi-logger';
|
|
4
4
|
import type { Matterbridge } from './matterbridge.js';
|
|
5
5
|
interface FrontendEvents {
|
|
@@ -34,7 +34,6 @@ export declare class Frontend extends EventEmitter<FrontendEvents> {
|
|
|
34
34
|
private validateReq;
|
|
35
35
|
start(port?: number): Promise<void>;
|
|
36
36
|
stop(): Promise<void>;
|
|
37
|
-
getApiSettings(): ApiSettings;
|
|
38
37
|
getApiPlugins(): ApiPlugin[];
|
|
39
38
|
getApiDevices(pluginName?: string, extended?: boolean): ApiDevice[];
|
|
40
39
|
getApiCluster(pluginName: string, endpointNumber: number, serialNumber: string, uniqueId: string): ApiClusters | undefined;
|
package/dist/frontend.js
CHANGED
|
@@ -7,11 +7,11 @@ import { CommissioningOptions } from '@matter/types/commissioning';
|
|
|
7
7
|
import { FabricIndex } from '@matter/types/datatype';
|
|
8
8
|
import { BroadcastServer } from '@matterbridge/thread/server';
|
|
9
9
|
import { MATTER_LOGGER_FILE, MATTER_STORAGE_DIR, MATTERBRIDGE_DIAGNOSTIC_FILE, MATTERBRIDGE_HISTORY_FILE, MATTERBRIDGE_LOGGER_FILE, NODE_STORAGE_DIR, plg, } from '@matterbridge/types';
|
|
10
|
-
import {
|
|
10
|
+
import { isBun } from '@matterbridge/utils/bun';
|
|
11
11
|
import { getParameter, hasAnyParameter, hasParameter } from '@matterbridge/utils/cli';
|
|
12
12
|
import { writeDiagnostic } from '@matterbridge/utils/diagnostic';
|
|
13
13
|
import { getErrorMessage, inspectError, logError } from '@matterbridge/utils/error';
|
|
14
|
-
import { formatBytes
|
|
14
|
+
import { formatBytes } from '@matterbridge/utils/format';
|
|
15
15
|
import { logModuleLoaded } from '@matterbridge/utils/loader';
|
|
16
16
|
import { isValidArray, isValidBoolean, isValidNumber, isValidObject, isValidString } from '@matterbridge/utils/validate';
|
|
17
17
|
import { fireAndForget, withTimeout } from '@matterbridge/utils/wait';
|
|
@@ -517,11 +517,17 @@ export class Frontend extends EventEmitter {
|
|
|
517
517
|
};
|
|
518
518
|
res.status(200).json(memoryReport);
|
|
519
519
|
});
|
|
520
|
-
this.expressApp.get('/api/settings', (req, res) => {
|
|
520
|
+
this.expressApp.get('/api/settings', async (req, res) => {
|
|
521
521
|
this.log.debug('The frontend sent /api/settings');
|
|
522
522
|
if (!this.validateReq(req, res))
|
|
523
523
|
return;
|
|
524
|
-
|
|
524
|
+
try {
|
|
525
|
+
res.json((await this.server.fetch({ type: 'matterbridge_apisettings', src: this.server.name, dst: 'matterbridge', params: {} }, this.serverFetchTimeout)).result.data);
|
|
526
|
+
}
|
|
527
|
+
catch (error) {
|
|
528
|
+
logError(this.log, 'Error in /api/settings fetching the settings from matterbridge', error);
|
|
529
|
+
res.status(500).send('Error fetching the settings.');
|
|
530
|
+
}
|
|
525
531
|
});
|
|
526
532
|
this.expressApp.get('/api/plugins', (req, res) => {
|
|
527
533
|
this.log.debug('The frontend sent /api/plugins');
|
|
@@ -918,58 +924,6 @@ export class Frontend extends EventEmitter {
|
|
|
918
924
|
}
|
|
919
925
|
this.log.debug('Frontend stopped successfully');
|
|
920
926
|
}
|
|
921
|
-
getApiSettings() {
|
|
922
|
-
this.matterbridge.systemInformation.totalMemory = formatBytes(os.totalmem());
|
|
923
|
-
this.matterbridge.systemInformation.constrainedMemory = formatBytes(constrainedMemory());
|
|
924
|
-
this.matterbridge.systemInformation.freeMemory = formatBytes(os.freemem());
|
|
925
|
-
this.matterbridge.systemInformation.systemUptime = formatUptime(os.uptime());
|
|
926
|
-
this.matterbridge.systemInformation.processUptime = formatUptime(Math.floor(process.uptime()));
|
|
927
|
-
this.matterbridge.systemInformation.cpuUsage = formatPercent(0);
|
|
928
|
-
this.matterbridge.systemInformation.processCpuUsage = formatPercent(0);
|
|
929
|
-
this.matterbridge.systemInformation.rss = formatBytes(memoryFootprint());
|
|
930
|
-
this.matterbridge.systemInformation.heapTotal = formatBytes(process.memoryUsage().heapTotal);
|
|
931
|
-
this.matterbridge.systemInformation.heapUsed = formatBytes(process.memoryUsage().heapUsed);
|
|
932
|
-
const info = {
|
|
933
|
-
homeDirectory: this.matterbridge.homeDirectory,
|
|
934
|
-
rootDirectory: this.matterbridge.rootDirectory,
|
|
935
|
-
matterbridgeDirectory: this.matterbridge.matterbridgeDirectory,
|
|
936
|
-
matterbridgePluginDirectory: this.matterbridge.matterbridgePluginDirectory,
|
|
937
|
-
matterbridgeCertDirectory: this.matterbridge.matterbridgeCertDirectory,
|
|
938
|
-
globalModulesDirectory: this.matterbridge.globalModulesDirectory,
|
|
939
|
-
matterbridgeVersion: this.matterbridge.matterbridgeVersion,
|
|
940
|
-
matterbridgeLatestVersion: this.matterbridge.matterbridgeLatestVersion,
|
|
941
|
-
matterbridgeDevVersion: this.matterbridge.matterbridgeDevVersion,
|
|
942
|
-
frontendVersion: this.matterbridge.frontendVersion,
|
|
943
|
-
dockerDev: this.matterbridge.dockerDev,
|
|
944
|
-
dockerVersion: this.matterbridge.dockerVersion,
|
|
945
|
-
dockerLatestVersion: this.matterbridge.dockerLatestVersion,
|
|
946
|
-
dockerDevVersion: this.matterbridge.dockerDevVersion,
|
|
947
|
-
bridgeMode: this.matterbridge.bridgeMode,
|
|
948
|
-
restartMode: this.matterbridge.restartMode,
|
|
949
|
-
virtualMode: this.matterbridge.virtualMode,
|
|
950
|
-
bridgeStatus: this.matterbridge.bridgeStatus,
|
|
951
|
-
profile: this.matterbridge.profile,
|
|
952
|
-
loggerLevel: this.matterbridge.logLevel,
|
|
953
|
-
fileLogger: this.matterbridge.fileLogger,
|
|
954
|
-
matterLoggerLevel: this.matterbridge.matterLogLevel,
|
|
955
|
-
matterFileLogger: this.matterbridge.matterFileLogger,
|
|
956
|
-
matterMdnsInterface: this.matterbridge.mdnsInterface,
|
|
957
|
-
matterIpv4Address: this.matterbridge.ipv4Address,
|
|
958
|
-
matterIpv6Address: this.matterbridge.ipv6Address,
|
|
959
|
-
matterPort: this.matterbridge.initialPort || 5540,
|
|
960
|
-
matterDiscriminator: this.matterbridge.initialDiscriminator,
|
|
961
|
-
matterPasscode: this.matterbridge.initialPasscode,
|
|
962
|
-
readOnly: this.matterbridge.readOnly,
|
|
963
|
-
restartRequired: this.matterbridge.restartRequired,
|
|
964
|
-
fixedRestartRequired: this.matterbridge.fixedRestartRequired,
|
|
965
|
-
updateRequired: this.matterbridge.updateRequired,
|
|
966
|
-
startupAt: this.matterbridge.startupAt,
|
|
967
|
-
shutdownAt: this.matterbridge.shutdownAt,
|
|
968
|
-
runningTimes: this.matterbridge.runningTimes,
|
|
969
|
-
runningDays: this.matterbridge.runningDays,
|
|
970
|
-
};
|
|
971
|
-
return { systemInformation: this.matterbridge.systemInformation, matterbridgeInformation: info };
|
|
972
|
-
}
|
|
973
927
|
getApiPlugins() {
|
|
974
928
|
if (this.matterbridge.hasCleanupStarted)
|
|
975
929
|
return [];
|
|
@@ -1448,7 +1402,7 @@ export class Frontend extends EventEmitter {
|
|
|
1448
1402
|
}
|
|
1449
1403
|
else if (data.method === '/api/settings') {
|
|
1450
1404
|
const start = performance.now();
|
|
1451
|
-
const settings = this.
|
|
1405
|
+
const settings = (await this.server.fetch({ type: 'matterbridge_apisettings', src: this.server.name, dst: 'matterbridge', params: {} }, this.serverFetchTimeout)).result.data;
|
|
1452
1406
|
if (this.diagnostic)
|
|
1453
1407
|
writeDiagnostic(`Frontend:${data.sender}`, `getApiSettings() took ${(performance.now() - start).toFixed(2)} ms`);
|
|
1454
1408
|
sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, success: true, response: settings });
|
package/dist/matterbridge.js
CHANGED
|
@@ -297,9 +297,9 @@ export class Matterbridge extends EventEmitter {
|
|
|
297
297
|
matterMdnsInterface: this.mdnsInterface,
|
|
298
298
|
matterIpv4Address: this.ipv4Address,
|
|
299
299
|
matterIpv6Address: this.ipv6Address,
|
|
300
|
-
matterPort: this.
|
|
301
|
-
matterDiscriminator: this.
|
|
302
|
-
matterPasscode: this.
|
|
300
|
+
matterPort: this.initialPort ?? 5540,
|
|
301
|
+
matterDiscriminator: this.initialDiscriminator,
|
|
302
|
+
matterPasscode: this.initialPasscode,
|
|
303
303
|
startupAt: this.startupAt,
|
|
304
304
|
shutdownAt: this.shutdownAt,
|
|
305
305
|
runningTimes: this.runningTimes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.11.2-dev-
|
|
3
|
+
"version": "3.11.2-dev-20261105-a15bb91",
|
|
4
4
|
"description": "Matterbridge core library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
},
|
|
137
137
|
"dependencies": {
|
|
138
138
|
"@matter/main": "0.18.0",
|
|
139
|
-
"@matterbridge/dgram": "3.11.2-dev-
|
|
140
|
-
"@matterbridge/thread": "3.11.2-dev-
|
|
141
|
-
"@matterbridge/types": "3.11.2-dev-
|
|
142
|
-
"@matterbridge/utils": "3.11.2-dev-
|
|
139
|
+
"@matterbridge/dgram": "3.11.2-dev-20261105-a15bb91",
|
|
140
|
+
"@matterbridge/thread": "3.11.2-dev-20261105-a15bb91",
|
|
141
|
+
"@matterbridge/types": "3.11.2-dev-20261105-a15bb91",
|
|
142
|
+
"@matterbridge/utils": "3.11.2-dev-20261105-a15bb91",
|
|
143
143
|
"escape-html": "1.0.3",
|
|
144
144
|
"express": "5.3.0",
|
|
145
145
|
"express-rate-limit": "8.7.2",
|