matterbridge-webhooks 0.0.3 → 0.0.5-dev-20250703-2d05a0a
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/CHANGELOG.md +40 -0
- package/README.md +2 -1
- package/dist/platform.js +23 -22
- package/npm-shrinkwrap.json +16 -15
- package/package.json +5 -4
- package/CODEOWNERS +0 -1
- package/tsconfig.jest.json +0 -8
- package/tsconfig.production.json +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,46 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
8
8
|
<img src="bmc-button.svg" alt="Buy me a coffee" width="120">
|
|
9
9
|
</a>
|
|
10
10
|
|
|
11
|
+
## [0.0.5] - 2025-07-02
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- [DevContainer]: Added support for the **Matterbridge Plugin Dev Container** with an optimized named volume for `node_modules`.
|
|
16
|
+
- [GitHub]: Added GitHub issue templates for bug reports and feature requests.
|
|
17
|
+
- [ESLint]: Refactored the flat config.
|
|
18
|
+
- [ESLint]: Added the plugins `eslint-plugin-promise`, `eslint-plugin-jsdoc`, and `@vitest/eslint-plugin`.
|
|
19
|
+
- [Jest]: Refactored the flat config.
|
|
20
|
+
- [Vitest]: Added Vitest for TypeScript project testing. It will replace Jest, which does not work correctly with ESM module mocks.
|
|
21
|
+
- [JSDoc]: Added missing JSDoc comments, including `@param` and `@returns` tags.
|
|
22
|
+
- [CodeQL]: Added CodeQL badge in the readme.
|
|
23
|
+
- [Codecov]: Added Codecov badge in the readme.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- [package]: Updated package to Automator v. 2.0.1.
|
|
28
|
+
- [package]: Updated dependencies.
|
|
29
|
+
- [storage]: Bumped `node-storage-manager` to 2.0.0.
|
|
30
|
+
- [logger]: Bumped `node-ansi-logger` to 3.1.1.
|
|
31
|
+
|
|
32
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
33
|
+
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
|
|
34
|
+
</a>
|
|
35
|
+
|
|
36
|
+
## [0.0.4] - 2025-05-05
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- [package]: Updated package.
|
|
41
|
+
- [package]: Updated dependencies.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- [platform]: Fixed bug on unselected webhooks.
|
|
46
|
+
|
|
47
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
48
|
+
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
|
|
49
|
+
</a>
|
|
50
|
+
|
|
11
51
|
## [0.0.3] - 2025-05-01
|
|
12
52
|
|
|
13
53
|
### Added
|
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
6
6
|
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
7
7
|

|
|
8
|
-

|
|
9
|
+
[](https://codecov.io/gh/Luligu/mmatterbridge-webhooks)
|
|
9
10
|
|
|
10
11
|
[](https://www.npmjs.com/package/matterbridge)
|
|
11
12
|
[](https://www.npmjs.com/package/matter-history)
|
package/dist/platform.js
CHANGED
|
@@ -17,30 +17,29 @@ export class Platform extends MatterbridgeDynamicPlatform {
|
|
|
17
17
|
this.log.info('onStart called with reason:', reason ?? 'none');
|
|
18
18
|
await this.ready;
|
|
19
19
|
await this.clearSelect();
|
|
20
|
-
let i =
|
|
20
|
+
let i = 0;
|
|
21
21
|
for (const webhookName in this.webhooks) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
22
|
+
this.log.debug(`Loading webhook ${++i} ${webhookName} with method ${this.webhooks[webhookName].method} and url ${this.webhooks[webhookName].httpUrl}`);
|
|
23
|
+
const webhook = this.webhooks[webhookName];
|
|
24
|
+
this.setSelectDevice('webhook' + i, webhookName, undefined, 'hub');
|
|
25
|
+
if (!this.validateDevice(['webhook' + i, webhookName], true))
|
|
26
|
+
continue;
|
|
27
|
+
this.log.info(`Registering device: ${webhookName} with method ${webhook.method} and url ${webhook.httpUrl}`);
|
|
28
|
+
const device = new MatterbridgeEndpoint([this.config.deviceType === 'Outlet' ? onOffOutlet : this.config.deviceType === 'Light' ? onOffLight : onOffSwitch, bridgedNode], { uniqueStorageKey: webhookName }, this.config.debug)
|
|
29
|
+
.createDefaultBridgedDeviceBasicInformationClusterServer(webhookName, 'webhook' + i++, this.matterbridge.aggregatorVendorId, 'Matterbridge', 'Matterbridge Webhook', 0, this.config.version)
|
|
30
|
+
.createOnOffClusterServer(false)
|
|
31
|
+
.addRequiredClusterServers()
|
|
32
|
+
.addCommandHandler('on', async () => {
|
|
33
|
+
this.log.info(`Webhook ${webhookName} triggered.`);
|
|
34
|
+
await device.setAttribute('onOff', 'onOff', false, device.log);
|
|
35
|
+
fetch(webhook.httpUrl, webhook.method)
|
|
36
|
+
.then(() => this.log.notice(`Webhook ${webhookName} successful!`))
|
|
37
|
+
.catch((err) => {
|
|
38
|
+
this.log.error(`Webhook ${webhookName} failed: ${err instanceof Error ? err.message : err}`);
|
|
40
39
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
});
|
|
41
|
+
await this.registerDevice(device);
|
|
42
|
+
this.bridgedDevices.set(webhookName, device);
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
async onConfigure() {
|
|
@@ -69,6 +68,7 @@ export class Platform extends MatterbridgeDynamicPlatform {
|
|
|
69
68
|
fetch(webhook.httpUrl, webhook.method)
|
|
70
69
|
.then(() => {
|
|
71
70
|
this.log.notice(`Webhook test ${webhookName} successful!`);
|
|
71
|
+
return;
|
|
72
72
|
})
|
|
73
73
|
.catch((err) => {
|
|
74
74
|
this.log.error(`Webhook test ${webhookName} failed: ${err instanceof Error ? err.message : err}`);
|
|
@@ -86,6 +86,7 @@ export class Platform extends MatterbridgeDynamicPlatform {
|
|
|
86
86
|
fetch(webhook.httpUrl, webhook.method)
|
|
87
87
|
.then(() => {
|
|
88
88
|
this.log.notice(`Webhook test ${webhookName} successful!`);
|
|
89
|
+
return;
|
|
89
90
|
})
|
|
90
91
|
.catch((err) => {
|
|
91
92
|
this.log.error(`Webhook test ${webhookName} failed: ${err instanceof Error ? err.message : err}`);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-webhooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5-dev-20250703-2d05a0a",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-webhooks",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.5-dev-20250703-2d05a0a",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"node-ansi-logger": "
|
|
13
|
-
"node-persist-manager": "
|
|
12
|
+
"node-ansi-logger": "3.1.1",
|
|
13
|
+
"node-persist-manager": "2.0.0"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0"
|
|
16
|
+
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
17
17
|
},
|
|
18
18
|
"funding": {
|
|
19
19
|
"type": "buymeacoffee",
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"node_modules/node-ansi-logger": {
|
|
24
|
-
"version": "3.
|
|
25
|
-
"resolved": "https://registry.npmjs.org/node-ansi-logger/-/node-ansi-logger-3.
|
|
26
|
-
"integrity": "sha512-
|
|
27
|
-
"
|
|
24
|
+
"version": "3.1.1",
|
|
25
|
+
"resolved": "https://registry.npmjs.org/node-ansi-logger/-/node-ansi-logger-3.1.1.tgz",
|
|
26
|
+
"integrity": "sha512-tFeCSxwiRg5XaNda5nC27alzraZP76nLtUk1JDZqb9byhW4WYaSGL7/lmxFHEI16gypQDMEYljuF+wcG+cPPHw==",
|
|
27
|
+
"hasShrinkwrap": true,
|
|
28
|
+
"license": "Apache-2.0",
|
|
28
29
|
"engines": {
|
|
29
|
-
"node": ">=18.0.0"
|
|
30
|
+
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
30
31
|
},
|
|
31
32
|
"funding": {
|
|
32
33
|
"type": "buymeacoffee",
|
|
@@ -46,15 +47,15 @@
|
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
49
|
"node_modules/node-persist-manager": {
|
|
49
|
-
"version": "
|
|
50
|
-
"resolved": "https://registry.npmjs.org/node-persist-manager/-/node-persist-manager-
|
|
51
|
-
"integrity": "sha512-
|
|
50
|
+
"version": "2.0.0",
|
|
51
|
+
"resolved": "https://registry.npmjs.org/node-persist-manager/-/node-persist-manager-2.0.0.tgz",
|
|
52
|
+
"integrity": "sha512-jpgOqCCn4ZEnIr4WcvqkyyGmmLJarV6aUyBlDQdG1G84X9UUmOmI1W2OZtc9K0z375CYWhjtGEXaY7GXNiEOfA==",
|
|
52
53
|
"license": "MIT",
|
|
53
54
|
"dependencies": {
|
|
54
|
-
"node-persist": "
|
|
55
|
+
"node-persist": "4.0.4"
|
|
55
56
|
},
|
|
56
57
|
"engines": {
|
|
57
|
-
"node": ">=18.0.0"
|
|
58
|
+
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
58
59
|
},
|
|
59
60
|
"funding": {
|
|
60
61
|
"type": "buymeacoffee",
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-webhooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5-dev-20250703-2d05a0a",
|
|
4
4
|
"description": "Matterbridge webhooks plugin",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
+
"homepage": "https://www.npmjs.com/package/matterbridge-webhooks",
|
|
7
8
|
"type": "module",
|
|
8
9
|
"main": "dist/index.js",
|
|
9
10
|
"repository": {
|
|
@@ -42,10 +43,10 @@
|
|
|
42
43
|
"ewelink"
|
|
43
44
|
],
|
|
44
45
|
"engines": {
|
|
45
|
-
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0"
|
|
46
|
+
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"node-ansi-logger": "
|
|
49
|
-
"node-persist-manager": "
|
|
49
|
+
"node-ansi-logger": "3.1.1",
|
|
50
|
+
"node-persist-manager": "2.0.0"
|
|
50
51
|
}
|
|
51
52
|
}
|
package/CODEOWNERS
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@Luligu
|
package/tsconfig.jest.json
DELETED
package/tsconfig.production.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"incremental": false,
|
|
5
|
-
"composite": false,
|
|
6
|
-
"declaration": false,
|
|
7
|
-
"declarationMap": false,
|
|
8
|
-
"sourceMap": false,
|
|
9
|
-
"removeComments": true
|
|
10
|
-
},
|
|
11
|
-
"include": ["src/**/*.ts"],
|
|
12
|
-
"exclude": ["**/*.spec.ts", "**/*.test.ts", "**/__test__/*"]
|
|
13
|
-
}
|