@matterbridge/core 3.5.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.
- package/LICENSE +202 -0
- package/README.md +22 -0
- package/dist/cli.d.ts +29 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +268 -0
- package/dist/cli.js.map +1 -0
- package/dist/cliEmitter.d.ts +50 -0
- package/dist/cliEmitter.d.ts.map +1 -0
- package/dist/cliEmitter.js +49 -0
- package/dist/cliEmitter.js.map +1 -0
- package/dist/cliHistory.d.ts +48 -0
- package/dist/cliHistory.d.ts.map +1 -0
- package/dist/cliHistory.js +826 -0
- package/dist/cliHistory.js.map +1 -0
- package/dist/clusters/export.d.ts +2 -0
- package/dist/clusters/export.d.ts.map +1 -0
- package/dist/clusters/export.js +3 -0
- package/dist/clusters/export.js.map +1 -0
- package/dist/crypto/attestationDecoder.d.ts +180 -0
- package/dist/crypto/attestationDecoder.d.ts.map +1 -0
- package/dist/crypto/attestationDecoder.js +176 -0
- package/dist/crypto/attestationDecoder.js.map +1 -0
- package/dist/crypto/declarationDecoder.d.ts +72 -0
- package/dist/crypto/declarationDecoder.d.ts.map +1 -0
- package/dist/crypto/declarationDecoder.js +241 -0
- package/dist/crypto/declarationDecoder.js.map +1 -0
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.d.ts +9 -0
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.d.ts.map +1 -0
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.js +120 -0
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.js.map +1 -0
- package/dist/crypto/read-extensions.d.ts +2 -0
- package/dist/crypto/read-extensions.d.ts.map +1 -0
- package/dist/crypto/read-extensions.js +81 -0
- package/dist/crypto/read-extensions.js.map +1 -0
- package/dist/crypto/testData.d.ts +31 -0
- package/dist/crypto/testData.d.ts.map +1 -0
- package/dist/crypto/testData.js +131 -0
- package/dist/crypto/testData.js.map +1 -0
- package/dist/crypto/walk-der.d.ts +2 -0
- package/dist/crypto/walk-der.d.ts.map +1 -0
- package/dist/crypto/walk-der.js +165 -0
- package/dist/crypto/walk-der.js.map +1 -0
- package/dist/deviceManager.d.ts +135 -0
- package/dist/deviceManager.d.ts.map +1 -0
- package/dist/deviceManager.js +270 -0
- package/dist/deviceManager.js.map +1 -0
- package/dist/devices/airConditioner.d.ts +98 -0
- package/dist/devices/airConditioner.d.ts.map +1 -0
- package/dist/devices/airConditioner.js +74 -0
- package/dist/devices/airConditioner.js.map +1 -0
- package/dist/devices/basicVideoPlayer.d.ts +88 -0
- package/dist/devices/basicVideoPlayer.d.ts.map +1 -0
- package/dist/devices/basicVideoPlayer.js +155 -0
- package/dist/devices/basicVideoPlayer.js.map +1 -0
- package/dist/devices/batteryStorage.d.ts +48 -0
- package/dist/devices/batteryStorage.d.ts.map +1 -0
- package/dist/devices/batteryStorage.js +75 -0
- package/dist/devices/batteryStorage.js.map +1 -0
- package/dist/devices/castingVideoPlayer.d.ts +79 -0
- package/dist/devices/castingVideoPlayer.d.ts.map +1 -0
- package/dist/devices/castingVideoPlayer.js +101 -0
- package/dist/devices/castingVideoPlayer.js.map +1 -0
- package/dist/devices/cooktop.d.ts +61 -0
- package/dist/devices/cooktop.d.ts.map +1 -0
- package/dist/devices/cooktop.js +77 -0
- package/dist/devices/cooktop.js.map +1 -0
- package/dist/devices/dishwasher.d.ts +71 -0
- package/dist/devices/dishwasher.d.ts.map +1 -0
- package/dist/devices/dishwasher.js +130 -0
- package/dist/devices/dishwasher.js.map +1 -0
- package/dist/devices/evse.d.ts +76 -0
- package/dist/devices/evse.d.ts.map +1 -0
- package/dist/devices/evse.js +156 -0
- package/dist/devices/evse.js.map +1 -0
- package/dist/devices/export.d.ts +19 -0
- package/dist/devices/export.d.ts.map +1 -0
- package/dist/devices/export.js +23 -0
- package/dist/devices/export.js.map +1 -0
- package/dist/devices/extractorHood.d.ts +46 -0
- package/dist/devices/extractorHood.d.ts.map +1 -0
- package/dist/devices/extractorHood.js +78 -0
- package/dist/devices/extractorHood.js.map +1 -0
- package/dist/devices/heatPump.d.ts +47 -0
- package/dist/devices/heatPump.d.ts.map +1 -0
- package/dist/devices/heatPump.js +84 -0
- package/dist/devices/heatPump.js.map +1 -0
- package/dist/devices/laundryDryer.d.ts +67 -0
- package/dist/devices/laundryDryer.d.ts.map +1 -0
- package/dist/devices/laundryDryer.js +106 -0
- package/dist/devices/laundryDryer.js.map +1 -0
- package/dist/devices/laundryWasher.d.ts +81 -0
- package/dist/devices/laundryWasher.d.ts.map +1 -0
- package/dist/devices/laundryWasher.js +147 -0
- package/dist/devices/laundryWasher.js.map +1 -0
- package/dist/devices/microwaveOven.d.ts +168 -0
- package/dist/devices/microwaveOven.d.ts.map +1 -0
- package/dist/devices/microwaveOven.js +179 -0
- package/dist/devices/microwaveOven.js.map +1 -0
- package/dist/devices/oven.d.ts +105 -0
- package/dist/devices/oven.d.ts.map +1 -0
- package/dist/devices/oven.js +190 -0
- package/dist/devices/oven.js.map +1 -0
- package/dist/devices/refrigerator.d.ts +118 -0
- package/dist/devices/refrigerator.d.ts.map +1 -0
- package/dist/devices/refrigerator.js +186 -0
- package/dist/devices/refrigerator.js.map +1 -0
- package/dist/devices/roboticVacuumCleaner.d.ts +112 -0
- package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
- package/dist/devices/roboticVacuumCleaner.js +268 -0
- package/dist/devices/roboticVacuumCleaner.js.map +1 -0
- package/dist/devices/solarPower.d.ts +40 -0
- package/dist/devices/solarPower.d.ts.map +1 -0
- package/dist/devices/solarPower.js +59 -0
- package/dist/devices/solarPower.js.map +1 -0
- package/dist/devices/speaker.d.ts +87 -0
- package/dist/devices/speaker.d.ts.map +1 -0
- package/dist/devices/speaker.js +120 -0
- package/dist/devices/speaker.js.map +1 -0
- package/dist/devices/temperatureControl.d.ts +166 -0
- package/dist/devices/temperatureControl.d.ts.map +1 -0
- package/dist/devices/temperatureControl.js +78 -0
- package/dist/devices/temperatureControl.js.map +1 -0
- package/dist/devices/waterHeater.d.ts +111 -0
- package/dist/devices/waterHeater.d.ts.map +1 -0
- package/dist/devices/waterHeater.js +166 -0
- package/dist/devices/waterHeater.js.map +1 -0
- package/dist/dgram/export.d.ts +2 -0
- package/dist/dgram/export.d.ts.map +1 -0
- package/dist/dgram/export.js +2 -0
- package/dist/dgram/export.js.map +1 -0
- package/dist/export.d.ts +32 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +39 -0
- package/dist/export.js.map +1 -0
- package/dist/frontend.d.ts +248 -0
- package/dist/frontend.d.ts.map +1 -0
- package/dist/frontend.js +2605 -0
- package/dist/frontend.js.map +1 -0
- package/dist/helpers.d.ts +48 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +161 -0
- package/dist/helpers.js.map +1 -0
- package/dist/jestutils/export.d.ts +2 -0
- package/dist/jestutils/export.d.ts.map +1 -0
- package/dist/jestutils/export.js +2 -0
- package/dist/jestutils/export.js.map +1 -0
- package/dist/jestutils/jestHelpers.d.ts +349 -0
- package/dist/jestutils/jestHelpers.d.ts.map +1 -0
- package/dist/jestutils/jestHelpers.js +980 -0
- package/dist/jestutils/jestHelpers.js.map +1 -0
- package/dist/matter/behaviors.d.ts +2 -0
- package/dist/matter/behaviors.d.ts.map +1 -0
- package/dist/matter/behaviors.js +3 -0
- package/dist/matter/behaviors.js.map +1 -0
- package/dist/matter/clusters.d.ts +2 -0
- package/dist/matter/clusters.d.ts.map +1 -0
- package/dist/matter/clusters.js +3 -0
- package/dist/matter/clusters.js.map +1 -0
- package/dist/matter/devices.d.ts +2 -0
- package/dist/matter/devices.d.ts.map +1 -0
- package/dist/matter/devices.js +3 -0
- package/dist/matter/devices.js.map +1 -0
- package/dist/matter/endpoints.d.ts +2 -0
- package/dist/matter/endpoints.d.ts.map +1 -0
- package/dist/matter/endpoints.js +3 -0
- package/dist/matter/endpoints.js.map +1 -0
- package/dist/matter/export.d.ts +4 -0
- package/dist/matter/export.d.ts.map +1 -0
- package/dist/matter/export.js +5 -0
- package/dist/matter/export.js.map +1 -0
- package/dist/matter/types.d.ts +2 -0
- package/dist/matter/types.d.ts.map +1 -0
- package/dist/matter/types.js +3 -0
- package/dist/matter/types.js.map +1 -0
- package/dist/matterNode.d.ts +341 -0
- package/dist/matterNode.d.ts.map +1 -0
- package/dist/matterNode.js +1329 -0
- package/dist/matterNode.js.map +1 -0
- package/dist/matterbridge.d.ts +544 -0
- package/dist/matterbridge.d.ts.map +1 -0
- package/dist/matterbridge.js +2880 -0
- package/dist/matterbridge.js.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts +49 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.js +80 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
- package/dist/matterbridgeBehaviors.d.ts +2428 -0
- package/dist/matterbridgeBehaviors.d.ts.map +1 -0
- package/dist/matterbridgeBehaviors.js +620 -0
- package/dist/matterbridgeBehaviors.js.map +1 -0
- package/dist/matterbridgeDeviceTypes.d.ts +744 -0
- package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
- package/dist/matterbridgeDeviceTypes.js +1312 -0
- package/dist/matterbridgeDeviceTypes.js.map +1 -0
- package/dist/matterbridgeDynamicPlatform.d.ts +49 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
- package/dist/matterbridgeDynamicPlatform.js +80 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -0
- package/dist/matterbridgeEndpoint.d.ts +1548 -0
- package/dist/matterbridgeEndpoint.d.ts.map +1 -0
- package/dist/matterbridgeEndpoint.js +2883 -0
- package/dist/matterbridgeEndpoint.js.map +1 -0
- package/dist/matterbridgeEndpointHelpers.d.ts +1855 -0
- package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
- package/dist/matterbridgeEndpointHelpers.js +1270 -0
- package/dist/matterbridgeEndpointHelpers.js.map +1 -0
- package/dist/matterbridgeEndpointTypes.d.ts +172 -0
- package/dist/matterbridgeEndpointTypes.d.ts.map +1 -0
- package/dist/matterbridgeEndpointTypes.js +28 -0
- package/dist/matterbridgeEndpointTypes.js.map +1 -0
- package/dist/matterbridgePlatform.d.ts +520 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +921 -0
- package/dist/matterbridgePlatform.js.map +1 -0
- package/dist/mb_coap.d.ts +24 -0
- package/dist/mb_coap.d.ts.map +1 -0
- package/dist/mb_coap.js +89 -0
- package/dist/mb_coap.js.map +1 -0
- package/dist/mb_health.d.ts +77 -0
- package/dist/mb_health.d.ts.map +1 -0
- package/dist/mb_health.js +147 -0
- package/dist/mb_health.js.map +1 -0
- package/dist/mb_mdns.d.ts +24 -0
- package/dist/mb_mdns.d.ts.map +1 -0
- package/dist/mb_mdns.js +285 -0
- package/dist/mb_mdns.js.map +1 -0
- package/dist/pluginManager.d.ts +388 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +1574 -0
- package/dist/pluginManager.js.map +1 -0
- package/dist/spawn.d.ts +33 -0
- package/dist/spawn.d.ts.map +1 -0
- package/dist/spawn.js +165 -0
- package/dist/spawn.js.map +1 -0
- package/dist/utils/export.d.ts +2 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/export.js +2 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/workers/brand.d.ts +25 -0
- package/dist/workers/brand.d.ts.map +1 -0
- package/dist/workers/brand.extend.d.ts +10 -0
- package/dist/workers/brand.extend.d.ts.map +1 -0
- package/dist/workers/brand.extend.js +15 -0
- package/dist/workers/brand.extend.js.map +1 -0
- package/dist/workers/brand.invalid.d.ts +9 -0
- package/dist/workers/brand.invalid.d.ts.map +1 -0
- package/dist/workers/brand.invalid.js +19 -0
- package/dist/workers/brand.invalid.js.map +1 -0
- package/dist/workers/brand.js +67 -0
- package/dist/workers/brand.js.map +1 -0
- package/dist/workers/clusterTypes.d.ts +47 -0
- package/dist/workers/clusterTypes.d.ts.map +1 -0
- package/dist/workers/clusterTypes.js +57 -0
- package/dist/workers/clusterTypes.js.map +1 -0
- package/dist/workers/frontendWorker.d.ts +2 -0
- package/dist/workers/frontendWorker.d.ts.map +1 -0
- package/dist/workers/frontendWorker.js +90 -0
- package/dist/workers/frontendWorker.js.map +1 -0
- package/dist/workers/helloWorld.d.ts +2 -0
- package/dist/workers/helloWorld.d.ts.map +1 -0
- package/dist/workers/helloWorld.js +135 -0
- package/dist/workers/helloWorld.js.map +1 -0
- package/dist/workers/matterWorker.d.ts +2 -0
- package/dist/workers/matterWorker.d.ts.map +1 -0
- package/dist/workers/matterWorker.js +104 -0
- package/dist/workers/matterWorker.js.map +1 -0
- package/dist/workers/matterbridgeWorker.d.ts +2 -0
- package/dist/workers/matterbridgeWorker.d.ts.map +1 -0
- package/dist/workers/matterbridgeWorker.js +75 -0
- package/dist/workers/matterbridgeWorker.js.map +1 -0
- package/dist/workers/messageLab.d.ts +134 -0
- package/dist/workers/messageLab.d.ts.map +1 -0
- package/dist/workers/messageLab.js +129 -0
- package/dist/workers/messageLab.js.map +1 -0
- package/dist/workers/testWorker.d.ts +2 -0
- package/dist/workers/testWorker.d.ts.map +1 -0
- package/dist/workers/testWorker.js +45 -0
- package/dist/workers/testWorker.js.map +1 -0
- package/dist/workers/usage.d.ts +19 -0
- package/dist/workers/usage.d.ts.map +1 -0
- package/dist/workers/usage.js +140 -0
- package/dist/workers/usage.js.map +1 -0
- package/dist/workers/workerManager.d.ts +115 -0
- package/dist/workers/workerManager.d.ts.map +1 -0
- package/dist/workers/workerManager.js +464 -0
- package/dist/workers/workerManager.js.map +1 -0
- package/dist/workers/workerServer.d.ts +126 -0
- package/dist/workers/workerServer.d.ts.map +1 -0
- package/dist/workers/workerServer.js +340 -0
- package/dist/workers/workerServer.js.map +1 -0
- package/dist/workers/workerTypes.d.ts +23 -0
- package/dist/workers/workerTypes.d.ts.map +1 -0
- package/dist/workers/workerTypes.js +3 -0
- package/dist/workers/workerTypes.js.map +1 -0
- package/package.json +120 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# <img src="https://matterbridge.io/assets/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/matterbridge)
|
|
4
|
+
[](https://www.npmjs.com/package/matterbridge)
|
|
5
|
+
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
6
|
+
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
[](https://codecov.io/gh/Luligu/matterbridge)
|
|
10
|
+
[](https://github.com/prettier/prettier)
|
|
11
|
+
[](https://github.com/eslint/eslint)
|
|
12
|
+
[](https://www.typescriptlang.org/)
|
|
13
|
+
[](https://nodejs.org/api/esm.html)
|
|
14
|
+
[](https://matterbridge.io)
|
|
15
|
+
|
|
16
|
+
[](https://www.npmjs.com/package/matter-history)
|
|
17
|
+
[](https://www.npmjs.com/package/node-ansi-logger)
|
|
18
|
+
[](https://www.npmjs.com/package/node-persist-manager)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
Matterbridge internal package (not intended for direct use).
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the CLI entry point of Matterbridge.
|
|
3
|
+
*
|
|
4
|
+
* @file cli.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @created 2023-12-29
|
|
7
|
+
* @version 3.0.0
|
|
8
|
+
* @license Apache-2.0
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
import { Inspector, Tracker } from '@matterbridge/utils';
|
|
25
|
+
import type { Matterbridge } from './matterbridge.js';
|
|
26
|
+
export declare let instance: Matterbridge | undefined;
|
|
27
|
+
export declare const tracker: Tracker;
|
|
28
|
+
export declare const inspector: Inspector;
|
|
29
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAUH,OAAO,EAA4D,SAAS,EAAgB,OAAO,EAAmB,MAAM,qBAAqB,CAAC;AAIlJ,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,IAAI,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;AAC9C,eAAO,MAAM,OAAO,SAAmC,CAAC;AACxD,eAAO,MAAM,SAAS,WAAqC,CAAC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the CLI entry point of Matterbridge.
|
|
3
|
+
*
|
|
4
|
+
* @file cli.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @created 2023-12-29
|
|
7
|
+
* @version 3.0.0
|
|
8
|
+
* @license Apache-2.0
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
/* eslint-disable no-console */
|
|
25
|
+
/* eslint-disable n/no-process-exit */
|
|
26
|
+
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
27
|
+
console.log('\u001B[32mCli loaded.\u001B[40;0m');
|
|
28
|
+
// AnsiLogger module
|
|
29
|
+
import { AnsiLogger } from 'node-ansi-logger';
|
|
30
|
+
// Cli
|
|
31
|
+
import { formatBytes, formatUptime, hasAnyParameter, hasParameter, Inspector, inspectError, Tracker } from '@matterbridge/utils';
|
|
32
|
+
import { cliEmitter } from './cliEmitter.js';
|
|
33
|
+
export let instance;
|
|
34
|
+
export const tracker = new Tracker('Cli', false, false);
|
|
35
|
+
export const inspector = new Inspector('Cli', false, false);
|
|
36
|
+
if (process.argv.includes('--no-ansi') || process.argv.includes('-no-ansi'))
|
|
37
|
+
process.env.NO_COLOR = '1';
|
|
38
|
+
const log = new AnsiLogger({ logName: 'Cli', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: hasParameter('debug') ? "debug" /* LogLevel.DEBUG */ : "info" /* LogLevel.INFO */ });
|
|
39
|
+
/**
|
|
40
|
+
* Starts the CPU and memory tracker.
|
|
41
|
+
*/
|
|
42
|
+
function startCpuMemoryCheck() {
|
|
43
|
+
log.debug(`Cpu memory check starting...`);
|
|
44
|
+
tracker.start();
|
|
45
|
+
tracker.on('uptime', (os, process) => {
|
|
46
|
+
cliEmitter.emit('uptime', formatUptime(Math.floor(os)), formatUptime(Math.floor(process)));
|
|
47
|
+
});
|
|
48
|
+
tracker.on('snapshot', (snapshot) => {
|
|
49
|
+
cliEmitter.emit('memory', formatBytes(snapshot.totalMemory), formatBytes(snapshot.freeMemory), formatBytes(snapshot.rss), formatBytes(snapshot.heapTotal), formatBytes(snapshot.heapUsed), formatBytes(snapshot.external), formatBytes(snapshot.arrayBuffers));
|
|
50
|
+
cliEmitter.emit('cpu', snapshot.osCpu, snapshot.processCpu);
|
|
51
|
+
});
|
|
52
|
+
log.debug(`Cpu memory check started`);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Stops the CPU and memory tracker.
|
|
56
|
+
*/
|
|
57
|
+
function stopCpuMemoryCheck() {
|
|
58
|
+
log.debug(`Cpu memory check stopping...`);
|
|
59
|
+
tracker.stop();
|
|
60
|
+
tracker.removeAllListeners();
|
|
61
|
+
log.debug(`Cpu memory check stopped`);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Starts the inspector for heap sampling.
|
|
65
|
+
* This function is called when the -inspect parameter is passed.
|
|
66
|
+
*/
|
|
67
|
+
async function startInspector() {
|
|
68
|
+
await inspector.start();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Stops the heap sampling and saves the profile.
|
|
72
|
+
* This function is called when the -inspect parameter is passed.
|
|
73
|
+
*/
|
|
74
|
+
async function stopInspector() {
|
|
75
|
+
await inspector.stop();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Takes a heap snapshot
|
|
79
|
+
*/
|
|
80
|
+
async function takeHeapSnapshot() {
|
|
81
|
+
await inspector.takeHeapSnapshot();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Triggers a manual garbage collection.
|
|
85
|
+
* This function is working only if the node process is started with --expose_gc.
|
|
86
|
+
*
|
|
87
|
+
* @remarks To check the effect of the garbage collection, add also --trace_gc or --trace_gc_verbose.
|
|
88
|
+
*/
|
|
89
|
+
function triggerGarbageCollection() {
|
|
90
|
+
inspector.runGarbageCollector();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Registers event handlers for the Matterbridge instance.
|
|
94
|
+
*/
|
|
95
|
+
function registerHandlers() {
|
|
96
|
+
log.debug('Registering event handlers...');
|
|
97
|
+
// istanbul ignore next cause registerHandlers is called only if instance is defined
|
|
98
|
+
if (!instance)
|
|
99
|
+
return;
|
|
100
|
+
instance.on('shutdown', () => shutdown());
|
|
101
|
+
instance.on('restart', () => restart());
|
|
102
|
+
instance.on('update', () => update());
|
|
103
|
+
instance.on('startmemorycheck', () => start());
|
|
104
|
+
instance.on('stopmemorycheck', () => stop());
|
|
105
|
+
instance.on('startinspector', () => startInspector());
|
|
106
|
+
instance.on('stopinspector', () => stopInspector());
|
|
107
|
+
instance.on('takeheapsnapshot', () => takeHeapSnapshot());
|
|
108
|
+
instance.on('triggergarbagecollection', () => triggerGarbageCollection());
|
|
109
|
+
log.debug('Registered event handlers');
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Shuts down the Matterbridge instance and exits the process.
|
|
113
|
+
*/
|
|
114
|
+
async function shutdown() {
|
|
115
|
+
log.debug('Received shutdown event, exiting...');
|
|
116
|
+
if (hasParameter('inspect'))
|
|
117
|
+
await stopInspector();
|
|
118
|
+
stopCpuMemoryCheck();
|
|
119
|
+
cliEmitter.emit('shutdown');
|
|
120
|
+
process.exit(0);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Restarts the Matterbridge instance.
|
|
124
|
+
*/
|
|
125
|
+
async function restart() {
|
|
126
|
+
log.debug('Received restart event, loading...');
|
|
127
|
+
const { Matterbridge } = await import('./matterbridge.js');
|
|
128
|
+
instance = await Matterbridge.loadInstance(true);
|
|
129
|
+
registerHandlers();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Updates the Matterbridge instance.
|
|
133
|
+
*/
|
|
134
|
+
async function update() {
|
|
135
|
+
log.debug('Received update event, updating...');
|
|
136
|
+
// TODO: Implement update logic outside of matterbridge
|
|
137
|
+
const { Matterbridge } = await import('./matterbridge.js');
|
|
138
|
+
instance = await Matterbridge.loadInstance(true);
|
|
139
|
+
registerHandlers();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Starts the CPU and memory check when the -startmemorycheck parameter is passed.
|
|
143
|
+
*/
|
|
144
|
+
function start() {
|
|
145
|
+
log.debug('Received start memory check event');
|
|
146
|
+
startCpuMemoryCheck();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Stops the CPU and memory check when the -stopmemorycheck parameter is passed.
|
|
150
|
+
*/
|
|
151
|
+
function stop() {
|
|
152
|
+
log.debug('Received stop memory check event');
|
|
153
|
+
stopCpuMemoryCheck();
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Main function that initializes the Matterbridge instance and starts the CLI.
|
|
157
|
+
*
|
|
158
|
+
* @remarks
|
|
159
|
+
*
|
|
160
|
+
* Debug parameters:
|
|
161
|
+
*
|
|
162
|
+
* --debug enables debug logging.
|
|
163
|
+
*
|
|
164
|
+
* --verbose enables verbose logging.
|
|
165
|
+
*
|
|
166
|
+
* --loader enables loader logging.
|
|
167
|
+
*
|
|
168
|
+
* --inspect enables the inspector for heap sampling.
|
|
169
|
+
*
|
|
170
|
+
* --snapshotinterval <milliseconds> can be used to set the heap snapshot interval. Default is undefined. Minimum is 30000 ms.
|
|
171
|
+
*/
|
|
172
|
+
async function main() {
|
|
173
|
+
log.debug(`Cli main() started`);
|
|
174
|
+
startCpuMemoryCheck();
|
|
175
|
+
if (hasParameter('inspect'))
|
|
176
|
+
await startInspector();
|
|
177
|
+
log.debug(`***Matterbridge.loadInstance(true) called`);
|
|
178
|
+
const { Matterbridge } = await import('./matterbridge.js');
|
|
179
|
+
instance = await Matterbridge.loadInstance(true);
|
|
180
|
+
log.debug(`***Matterbridge.loadInstance(true) exited`);
|
|
181
|
+
// Check if the instance needs to shut down from parseCommandLine()
|
|
182
|
+
if (!instance || instance.shutdown) {
|
|
183
|
+
shutdown();
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
registerHandlers();
|
|
187
|
+
cliEmitter.emit('ready');
|
|
188
|
+
log.debug(`Cli main() ready`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (hasAnyParameter('help', 'h'))
|
|
192
|
+
help();
|
|
193
|
+
if (hasAnyParameter('version', 'v'))
|
|
194
|
+
await version();
|
|
195
|
+
main().catch((error) => {
|
|
196
|
+
inspectError(log, 'Matterbridge.loadInstance() failed with error', error);
|
|
197
|
+
shutdown();
|
|
198
|
+
});
|
|
199
|
+
/**
|
|
200
|
+
* Displays the version.
|
|
201
|
+
*/
|
|
202
|
+
async function version() {
|
|
203
|
+
// Dynamic JSON import (Node >= 20) with import attributes
|
|
204
|
+
const { default: pkg } = await import('../package.json', { with: { type: 'json' } });
|
|
205
|
+
console.log(`Matterbridge version ${pkg.version}`);
|
|
206
|
+
process.exit(0);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Displays the help.
|
|
210
|
+
*/
|
|
211
|
+
function help() {
|
|
212
|
+
console.log(`
|
|
213
|
+
Usage: matterbridge [options] [command]
|
|
214
|
+
|
|
215
|
+
Commands:
|
|
216
|
+
--help: show the help
|
|
217
|
+
--version: show the version
|
|
218
|
+
--add [plugin path]: register the plugin from the given absolute or relative path
|
|
219
|
+
--add [plugin name]: register the globally installed plugin with the given name
|
|
220
|
+
--remove [plugin path]: remove the plugin from the given absolute or relative path
|
|
221
|
+
--remove [plugin name]: remove the globally installed plugin with the given name
|
|
222
|
+
--enable [plugin path]: enable the plugin from the given absolute or relative path
|
|
223
|
+
--enable [plugin name]: enable the globally installed plugin with the given name
|
|
224
|
+
--disable [plugin path]: disable the plugin from the given absolute or relative path
|
|
225
|
+
--disable [plugin name]: disable the globally installed plugin with the given name
|
|
226
|
+
|
|
227
|
+
Reset Commands:
|
|
228
|
+
--reset: remove the commissioning for Matterbridge (bridge mode and childbridge mode). Shutdown Matterbridge before using it!
|
|
229
|
+
--reset [plugin path]: remove the commissioning for the plugin from the given absolute or relative path (childbridge mode). Shutdown Matterbridge before using it!
|
|
230
|
+
--reset [plugin name]: remove the commissioning for the globally installed plugin (childbridge mode). Shutdown Matterbridge before using it!
|
|
231
|
+
--factoryreset: remove all commissioning information and reset all internal storages. Shutdown Matterbridge before using it!
|
|
232
|
+
|
|
233
|
+
Options:
|
|
234
|
+
--bridge: start Matterbridge in bridge mode
|
|
235
|
+
--childbridge: start Matterbridge in childbridge mode
|
|
236
|
+
--port [port]: start the matter commissioning server on the given port (default 5540)
|
|
237
|
+
--mdnsinterface [name]: set the interface to use for the matter server mdnsInterface (default all interfaces)
|
|
238
|
+
--ipv4address [address]: set the ipv4 interface address to use for the matter server listener (default all addresses)
|
|
239
|
+
--ipv6address [address]: set the ipv6 interface address to use for the matter server listener (default all addresses)
|
|
240
|
+
--frontend [port]: start the frontend on the given port (default 8283)
|
|
241
|
+
--bind [address]: bind the frontend to the given address (default all addresses)
|
|
242
|
+
--logger: set the matterbridge logger level: debug | info | notice | warn | error | fatal (default info)
|
|
243
|
+
--filelogger: enable the matterbridge file logger (matterbridge.log)
|
|
244
|
+
--matterlogger: set the matter.js logger level: debug | info | notice | warn | error | fatal (default info)
|
|
245
|
+
--matterfilelogger: enable the matter.js file logger (matter.log)
|
|
246
|
+
--list: list the registered plugins
|
|
247
|
+
--loginterfaces: log the network interfaces (usefull for finding the name of the interface to use with -mdnsinterface option)
|
|
248
|
+
--logstorage: log the node storage
|
|
249
|
+
--sudo: force the use of sudo to install or update packages if the internal logic fails
|
|
250
|
+
--nosudo: force not to use sudo to install or update packages if the internal logic fails
|
|
251
|
+
--norestore: force not to automatically restore the matterbridge node storage and the matter storage from backup if it is corrupted
|
|
252
|
+
--novirtual: disable the creation of the virtual devices Restart, Update and Reboot Matterbridge
|
|
253
|
+
--ssl: enable SSL for the frontend and the WebSocketServer (the server will use the certificates and switch to https)
|
|
254
|
+
--mtls: enable mTLS for the frontend and the WebSocketServer (both server and client will use and require the certificates and switch to https)
|
|
255
|
+
--vendorId: override the default vendorId 0xfff1
|
|
256
|
+
--vendorName: override the default vendorName "Matterbridge"
|
|
257
|
+
--productId: override the default productId 0x8000
|
|
258
|
+
--productName: override the default productName "Matterbridge aggregator"
|
|
259
|
+
--service: enable the service mode (used in the linux systemctl configuration file and macOS launchctl plist)
|
|
260
|
+
--docker: enable the docker mode (used in the docker image)
|
|
261
|
+
--homedir: override the home directory (default the os homedir)
|
|
262
|
+
--delay [seconds]: set a delay in seconds before starting Matterbridge in the first 5 minutes from a reboot (default 120)
|
|
263
|
+
--fixed_delay [seconds]: set a fixed delay in seconds before starting Matterbridge (default 120)
|
|
264
|
+
--no-ansi: disable ANSI color output in the logs
|
|
265
|
+
`);
|
|
266
|
+
process.exit(0);
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+BAA+B;AAC/B,sCAAsC;AAEtC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IAAE,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAE5H,oBAAoB;AACpB,OAAO,EA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ter.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @created 2025-07-04
|
|
7
|
+
* @version 1.0.2
|
|
8
|
+
* @license Apache-2.0
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
import { EventEmitter } from 'node:events';
|
|
25
|
+
interface CliEvents {
|
|
26
|
+
shutdown: [];
|
|
27
|
+
cpu: [cpuUsage: number, processCpuUsage: number];
|
|
28
|
+
memory: [totalMememory: string, freeMemory: string, rss: string, heapTotal: string, heapUsed: string, external: string, arrayBuffers: string];
|
|
29
|
+
uptime: [systemUptime: string, processUptime: string];
|
|
30
|
+
ready: [];
|
|
31
|
+
}
|
|
32
|
+
export declare const cliEmitter: EventEmitter<CliEvents>;
|
|
33
|
+
export declare let lastOsCpuUsage: number;
|
|
34
|
+
export declare let lastProcessCpuUsage: number;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the last os CPU usage.
|
|
37
|
+
*
|
|
38
|
+
* @param {number} val - The os CPU usage percentage to set.
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
41
|
+
export declare function setLastOsCpuUsage(val: number): void;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the last process CPU usage.
|
|
44
|
+
*
|
|
45
|
+
* @param {number} val - The process CPU usage percentage to set.
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
48
|
+
export declare function setLastProcessCpuUsage(val: number): void;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=cliEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliEmitter.d.ts","sourceRoot":"","sources":["../src/cliEmitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,UAAU,SAAS;IACjB,QAAQ,EAAE,EAAE,CAAC;IACb,GAAG,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAC9I,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IACtD,KAAK,EAAE,EAAE,CAAC;CACX;AAED,eAAO,MAAM,UAAU,yBAAgC,CAAC;AAExD,eAAO,IAAI,cAAc,QAAI,CAAC;AAC9B,eAAO,IAAI,mBAAmB,QAAI,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAExD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the CLI emitter.
|
|
3
|
+
*
|
|
4
|
+
* @file cliEmitter.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @created 2025-07-04
|
|
7
|
+
* @version 1.0.2
|
|
8
|
+
* @license Apache-2.0
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
25
|
+
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
26
|
+
console.log('\u001B[32mCli emitter loaded.\u001B[40;0m');
|
|
27
|
+
import { EventEmitter } from 'node:events';
|
|
28
|
+
export const cliEmitter = new EventEmitter();
|
|
29
|
+
export let lastOsCpuUsage = 0;
|
|
30
|
+
export let lastProcessCpuUsage = 0;
|
|
31
|
+
/**
|
|
32
|
+
* Sets the last os CPU usage.
|
|
33
|
+
*
|
|
34
|
+
* @param {number} val - The os CPU usage percentage to set.
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
export function setLastOsCpuUsage(val) {
|
|
38
|
+
lastOsCpuUsage = val;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Sets the last process CPU usage.
|
|
42
|
+
*
|
|
43
|
+
* @param {number} val - The process CPU usage percentage to set.
|
|
44
|
+
* @returns {void}
|
|
45
|
+
*/
|
|
46
|
+
export function setLastProcessCpuUsage(val) {
|
|
47
|
+
lastProcessCpuUsage = val;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=cliEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliEmitter.js","sourceRoot":"","sources":["../src/cliEmitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,sCAAsC;AACtC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IAAE,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;AAEpI,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAU3C,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,YAAY,EAAa,CAAC;AAExD,MAAM,CAAC,IAAI,cAAc,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,cAAc,GAAG,GAAG,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,mBAAmB,GAAG,GAAG,CAAC;AAC5B,CAAC"}
|