Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hap-nodejs

Package Overview
Dependencies
Maintainers
10
Versions
550
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hap-nodejs - npm Package Compare versions

Comparing version 1.1.1-alpha.7 to 1.1.1-alpha.8

7

dist/lib/Advertiser.d.ts
import type { MDNSServerOptions, ServiceTxt } from '@homebridge/ciao';
import type { InterfaceName, IPAddress } from '@homebridge/ciao/lib/NetworkManager.js';
import type { MessageBus } from 'dbus-ts';
import type { AccessoryInfo } from './model/AccessoryInfo';

@@ -156,4 +155,3 @@ import { EventEmitter } from 'node:events';

private readonly stateChangeHandler;
constructor(accessoryInfo: AccessoryInfo, bus: MessageBus);
static create(accessoryInfo: AccessoryInfo): Promise<AvahiAdvertiser>;
constructor(accessoryInfo: AccessoryInfo);
private createTxt;

@@ -187,4 +185,3 @@ initPort(port: number): void;

private path?;
constructor(accessoryInfo: AccessoryInfo, bus: MessageBus);
static create(accessoryInfo: AccessoryInfo): Promise<ResolvedAdvertiser>;
constructor(accessoryInfo: AccessoryInfo);
private createTxt;

@@ -191,0 +188,0 @@ initPort(port: number): void;

@@ -6,4 +6,4 @@ import assert from 'node:assert';

import { getResponder } from '@homebridge/ciao';
import { systemBus } from '@homebridge/dbus-native';
import bonjour from 'bonjour-hap';
import { systemBus } from 'dbus-ts';
import createDebug from 'debug';

@@ -237,3 +237,2 @@ import { PromiseTimeout } from './util/promise-utils.js';

return new Promise((resolve, reject) => {
debug('dbusInvoke(): Invoking DBus method %s.%s on %s at %s', dbusInterface, member, destination, path);
const command = {

@@ -246,11 +245,9 @@ destination,

};
bus
.invoke(command)
.then((result) => {
debug('dbusInvoke(): DBus method %s.%s on %s at %s succeeded: %o', dbusInterface, member, destination, path, result);
resolve(result);
})
.catch((error) => {
debug('dbusInvoke(): DBus method %s.%s on %s at %s failed: %s', dbusInterface, member, destination, path, error);
reject(new DBusInvokeError(error));
bus.invoke(command, (err, result) => {
if (err) {
reject(new DBusInvokeError(err));
}
else {
resolve(result);
}
});

@@ -292,3 +289,3 @@ });

stateChangeHandler;
constructor(accessoryInfo, bus) {
constructor(accessoryInfo) {
super();

@@ -298,9 +295,5 @@ this.accessoryInfo = accessoryInfo;

debug(`Preparing Advertiser for '${this.accessoryInfo.displayName}' using Avahi backend!`);
this.bus = bus;
this.bus = systemBus();
this.stateChangeHandler = this.handleStateChangedEvent.bind(this);
}
static async create(accessoryInfo) {
const bus = await systemBus();
return new AvahiAdvertiser(accessoryInfo, bus);
}
createTxt() {

@@ -341,3 +334,3 @@ return Object

this.avahiServerInterface = await AvahiAdvertiser.avahiInterface(this.bus, 'Server');
await this.avahiServerInterface.on('StateChanged', this.stateChangeHandler);
this.avahiServerInterface.on('StateChanged', this.stateChangeHandler);
}

@@ -401,3 +394,3 @@ }

if (this.avahiServerInterface) {
await this.avahiServerInterface.removeListener('StateChanged', this.stateChangeHandler);
this.avahiServerInterface.removeListener('StateChanged', this.stateChangeHandler);
this.avahiServerInterface = undefined;

@@ -410,3 +403,3 @@ }

debug('Checking Avahi/DBus availability...');
const bus = await systemBus();
const bus = systemBus();
debug('Avahi/DBus connection established!');

@@ -445,12 +438,12 @@ try {

return new Promise((resolve, reject) => {
const service = bus.getService('org.freedesktop.Avahi');
service
.getInterface('/', `org.freedesktop.Avahi.${dbusInterface}`)
.then((iface) => {
if (!iface) {
reject(new Error('Interface not present!'));
bus
.getService('org.freedesktop.Avahi')
.getInterface('/', `org.freedesktop.Avahi.${dbusInterface}`, (error, iface) => {
if (error || !iface) {
reject(error ?? new Error('Interface not present!'));
}
resolve(iface);
})
.catch(error => reject(error));
else {
resolve(iface);
}
});
});

@@ -476,13 +469,9 @@ }

path;
constructor(accessoryInfo, bus) {
constructor(accessoryInfo) {
super();
this.accessoryInfo = accessoryInfo;
this.setupHash = CiaoAdvertiser.computeSetupHash(accessoryInfo);
this.bus = bus;
this.bus = systemBus();
debug(`Preparing Advertiser for '${this.accessoryInfo.displayName}' using systemd-resolved backend!`);
}
static async create(accessoryInfo) {
const bus = await systemBus();
return new ResolvedAdvertiser(accessoryInfo, bus);
}
createTxt() {

@@ -563,3 +552,3 @@ return Object

static async isAvailable() {
const bus = await systemBus();
const bus = systemBus();
try {

@@ -566,0 +555,0 @@ try {

{
"name": "hap-nodejs",
"type": "module",
"version": "1.1.1-alpha.7",
"version": "1.1.1-alpha.8",
"description": "HAP-NodeJS is a Node.js implementation of HomeKit Accessory Server.",

@@ -59,4 +59,4 @@ "author": "Khaos Tian <khaos.tian@gmail.com> (https://tz.is/)",

"@homebridge/ciao": "^1.3.1",
"@homebridge/dbus-native": "^0.6.0",
"bonjour-hap": "^3.8.0",
"dbus-ts": "^0.0.7",
"debug": "^4.3.6",

@@ -63,0 +63,0 @@ "fast-srp-hap": "^2.0.4",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc