matterbridge 1.2.5 → 1.2.7

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +30 -5
  3. package/TODO.md +0 -4
  4. package/dist/AirQualityCluster.d.ts +2 -13
  5. package/dist/AirQualityCluster.d.ts.map +1 -1
  6. package/dist/AirQualityCluster.js +6 -6
  7. package/dist/AirQualityCluster.js.map +1 -1
  8. package/dist/EveHistoryCluster.d.ts +6 -26
  9. package/dist/EveHistoryCluster.d.ts.map +1 -1
  10. package/dist/EveHistoryCluster.js +6 -14
  11. package/dist/EveHistoryCluster.js.map +1 -1
  12. package/dist/TvocCluster.d.ts +2 -15
  13. package/dist/TvocCluster.d.ts.map +1 -1
  14. package/dist/TvocCluster.js +6 -6
  15. package/dist/TvocCluster.js.map +1 -1
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/matterbridge.d.ts +7 -0
  21. package/dist/matterbridge.d.ts.map +1 -1
  22. package/dist/matterbridge.js +334 -198
  23. package/dist/matterbridge.js.map +1 -1
  24. package/dist/matterbridgeDevice.d.ts +37 -12
  25. package/dist/matterbridgeDevice.d.ts.map +1 -1
  26. package/dist/matterbridgeDevice.js +100 -18
  27. package/dist/matterbridgeDevice.js.map +1 -1
  28. package/dist/utils.d.ts +52 -1
  29. package/dist/utils.d.ts.map +1 -1
  30. package/dist/utils.js +121 -1
  31. package/dist/utils.js.map +1 -1
  32. package/frontend/build/asset-manifest.json +3 -3
  33. package/frontend/build/index.html +1 -1
  34. package/frontend/build/static/js/{main.6b861489.js → main.491fc08f.js} +3 -3
  35. package/frontend/build/static/js/main.491fc08f.js.map +1 -0
  36. package/matterbridge.service +5 -6
  37. package/package.json +2 -2
  38. package/dist/matterbridgeComposed.d.ts +0 -43
  39. package/dist/matterbridgeComposed.d.ts.map +0 -1
  40. package/dist/matterbridgeComposed.js +0 -58
  41. package/dist/matterbridgeComposed.js.map +0 -1
  42. package/frontend/build/static/js/main.6b861489.js.map +0 -1
  43. /package/frontend/build/static/js/{main.6b861489.js.LICENSE.txt → main.491fc08f.js.LICENSE.txt} +0 -0
package/dist/utils.js CHANGED
@@ -1,4 +1,124 @@
1
- export {};
1
+ /**
2
+ * This file contains the deepEqual function.
3
+ *
4
+ * @file utils.ts
5
+ * @author Luca Liguori
6
+ * @date 2024-02-17
7
+ * @version 1.0.1
8
+ *
9
+ * Copyright 2024 Luca Liguori.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License. *
22
+ */
23
+ /**
24
+ * Performs a deep comparison between two values to determine if they are equivalent.
25
+ * This comparison includes primitive types, arrays, and objects, allowing for optional
26
+ * exclusion of specific properties from the comparison in objects.
27
+ *
28
+ * @param {any} a The first value to compare.
29
+ * @param {any} b The second value to compare.
30
+ * @param {string[]} [excludeProperties=[]] An array of property names to exclude from the comparison in objects.
31
+ * @returns {boolean} True if the values are deeply equal, excluding any specified properties; otherwise, false.
32
+ *
33
+ * Note: This function utilizes recursion for deep comparison of nested structures and includes a debugging
34
+ * mechanism that can be toggled on or off for detailed comparison logging. It is important to ensure that
35
+ * objects do not contain circular references when enabling debug logging to avoid infinite loops.
36
+ *
37
+ * Example usage:
38
+ * ```
39
+ * const obj1 = { a: 1, b: { c: 2 } };
40
+ * const obj2 = { a: 1, b: { c: 2 } };
41
+ * console.log(deepEqual(obj1, obj2)); // true
42
+ *
43
+ * const arr1 = [1, 2, [3, 4]];
44
+ * const arr2 = [1, 2, [3, 4]];
45
+ * console.log(deepEqual(arr1, arr2)); // true
46
+ *
47
+ * const obj3 = { a: 1, b: { c: 2, d: 3 } };
48
+ * const obj4 = { a: 1, b: { c: 2 } };
49
+ * console.log(deepEqual(obj3, obj4, ['d'])); // true, excluding property 'd' from comparison
50
+ * ```
51
+ */
52
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
+ export function deepEqual(a, b, excludeProperties = []) {
54
+ // Toggle debugging on or off easily
55
+ const debug = false;
56
+ // Helper function for conditional logging
57
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
+ const debugLog = (...messages) => {
59
+ if (debug) {
60
+ // eslint-disable-next-line no-console
61
+ console.log(...messages);
62
+ }
63
+ };
64
+ // If both are the same instance, return true (handles primitives and same object references)
65
+ if (a === b) {
66
+ return true;
67
+ }
68
+ // If types are different, return false
69
+ if (typeof a !== typeof b) {
70
+ debugLog(`deepEqual false for typeof a: ${typeof a} typeof b: ${typeof b}`);
71
+ return false;
72
+ }
73
+ // If one of them is null (and we know they are not equal from the first check), return false
74
+ // eslint-disable-next-line eqeqeq
75
+ if (a == null || b == null) {
76
+ debugLog('deepEqual false for ==null');
77
+ return false;
78
+ }
79
+ // Handle Arrays
80
+ if (Array.isArray(a) && Array.isArray(b)) {
81
+ if (a.length !== b.length) {
82
+ debugLog(`deepEqual false for array a.length(${a.length}) !== b.length(${b.length})`);
83
+ return false;
84
+ }
85
+ for (let i = 0; i < a.length; i++) {
86
+ if (!deepEqual(a[i], b[i], excludeProperties)) {
87
+ debugLog('deepEqual false for array !deepEqual(a[i], b[i])');
88
+ debugLog(`- aProps.length(${a[i]}):`, a[i]);
89
+ debugLog(`- bProps.length(${b[i]}):`, b[i]);
90
+ return false;
91
+ }
92
+ }
93
+ return true;
94
+ }
95
+ // Handle Objects (and exclude null, functions, and arrays)
96
+ if (typeof a === 'object' && typeof b === 'object') {
97
+ const aProps = Object.getOwnPropertyNames(a).filter((prop) => !excludeProperties.includes(prop));
98
+ const bProps = Object.getOwnPropertyNames(b).filter((prop) => !excludeProperties.includes(prop));
99
+ // If their property lengths are different, they're different objects
100
+ if (aProps.length !== bProps.length) {
101
+ debugLog(`deepEqual false for aProps.length(${aProps.length}) !== bProps.length(${bProps.length})`);
102
+ debugLog(`- aProps.length(${aProps.length}):`, aProps);
103
+ debugLog(`- bProps.length(${bProps.length}):`, bProps);
104
+ return false;
105
+ }
106
+ // Check each property in 'a' to see if it's in 'b' and if it's equal (deep check)
107
+ for (const prop of aProps) {
108
+ if (!Object.prototype.hasOwnProperty.call(b, prop)) {
109
+ debugLog(`deepEqual false for !b.hasOwnProperty(${prop})`);
110
+ return false;
111
+ }
112
+ if (!deepEqual(a[prop], b[prop], excludeProperties)) {
113
+ debugLog(`deepEqual false for !deepEqual(a[${prop}], b[${prop}])` /*, a[prop], b[prop]*/);
114
+ return false;
115
+ }
116
+ }
117
+ return true;
118
+ }
119
+ // If none of the above, the objects are not equal
120
+ return false;
121
+ }
2
122
  // Http server use with:
3
123
  /*
4
124
  Invoke-WebRequest -Uri "http://localhost:3030/LogAggregator"
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,wBAAwB;AACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BE"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CAAC,CAAM,EAAE,CAAM,EAAE,oBAA8B,EAAE;IACxE,oCAAoC;IACpC,MAAM,KAAK,GAAG,KAAK,CAAC;IAEpB,0CAA0C;IAC1C,8DAA8D;IAC9D,MAAM,QAAQ,GAAG,CAAC,GAAG,QAAe,EAAE,EAAE;QACtC,IA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YACD,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC,EAAE,CAAC;gBACpD,QAAQ,CAAC,oCAAoC,IAAI,QAAQ,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;gBAC1F,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,kDAAkD;IAClD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,wBAAwB;AACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BE"}
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "/static/css/main.61f6cf42.css",
4
- "main.js": "/static/js/main.6b861489.js",
4
+ "main.js": "/static/js/main.491fc08f.js",
5
5
  "static/js/453.d855a71b.chunk.js": "/static/js/453.d855a71b.chunk.js",
6
6
  "index.html": "/index.html",
7
7
  "main.61f6cf42.css.map": "/static/css/main.61f6cf42.css.map",
8
- "main.6b861489.js.map": "/static/js/main.6b861489.js.map",
8
+ "main.491fc08f.js.map": "/static/js/main.491fc08f.js.map",
9
9
  "453.d855a71b.chunk.js.map": "/static/js/453.d855a71b.chunk.js.map"
10
10
  },
11
11
  "entrypoints": [
12
12
  "static/css/main.61f6cf42.css",
13
- "static/js/main.6b861489.js"
13
+ "static/js/main.491fc08f.js"
14
14
  ]
15
15
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.6b861489.js"></script><link href="/static/css/main.61f6cf42.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.491fc08f.js"></script><link href="/static/css/main.61f6cf42.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>