diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fb4613..cc999aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to `@homebridge/ciao` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/). -## BETA +## v1.2.0 (2024-04-10) ### Changed diff --git a/docs/classes/CiaoService.html b/docs/classes/CiaoService.html index f4cdc04..a8b591f 100644 --- a/docs/classes/CiaoService.html +++ b/docs/classes/CiaoService.html @@ -1,4 +1,4 @@ -CiaoService | @homebridge/ciao - v1.1.8

The CiaoService class represents a service which can be advertised on the network.

+CiaoService | @homebridge/ciao - v1.2.0

The CiaoService class represents a service which can be advertised on the network.

A service is identified by its fully qualified domain name (FQDN), which consist of the service name, the service type, the protocol and the service domain (.local by default).

The service defines a hostname and a port where the advertised service can be reached.

@@ -7,7 +7,7 @@

A CiaoService class is always bound to a Responder and can be created using the Responder.createService method in the Responder class. Once the instance is created, advertise can be called to announce the service on the network.

-

Hierarchy

  • EventEmitter
    • CiaoService

Methods

Hierarchy

  • EventEmitter
    • CiaoService

Methods

advertise destroy end getFQDN @@ -29,24 +29,24 @@
  • Prober could not find a unique service name while trying for a minute (timeout)
  • One of the announcement packets could not be sent successfully
  • -

    Returns Promise<void>

    • This method must be called if you want to free the memory used by this service. +

      Returns Promise<void>

    • This method must be called if you want to free the memory used by this service. The service instance is not usable anymore after this call.

      If the service is still announced, the service will first be removed from the network by calling end.

      -

      Returns Promise<void>

    • This method will remove the advertisement for the service on all connected network interfaces. +

      Returns Promise<void>

    • This method will remove the advertisement for the service on all connected network interfaces. If the service is still in the Probing state, probing will simply be cancelled.

      Returns Promise<void>

      Promise will resolve once the last goodbye packet was sent out

      -
    • Returns string

      The fully qualified domain name of the service, used to identify the service.

      -
    • Returns string

      The current hostname of the service.

      -
    • Returns undefined | string[]

      Array of subtype pointers (undefined if no subtypes are specified).

      -
    • Returns number

      The port the service is advertising for. +

    • Returns string

      The fully qualified domain name of the service, used to identify the service.

      +
    • Returns string

      The current hostname of the service.

      +
    • Returns undefined | string[]

      Array of subtype pointers (undefined if no subtypes are specified).

      +
    • Returns number

      The port the service is advertising for. {@code -1} is returned when the port is not yet set.

      -
    • Returns string

      The service type pointer.

      -
    • Sets or updates the port of the service. +

    • Returns string

      The service type pointer.

      +
    • Sets or updates the port of the service. A new port number can only be set when the service is still UNANNOUNCED. Otherwise, an assertion error will be thrown.

      Parameters

      • port: number

        The new port number.

        -

      Returns void

    • Sets or updates the txt of the service.

      +

    Returns void

    • Sets or updates the txt of the service.

      Parameters

      • txt: ServiceTxt

        The updated txt record.

      • silent: boolean = false

        If set to true no announcement is sent for the updated record.

        -

      Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/docs/classes/Responder.html b/docs/classes/Responder.html index f8a5be4..e1504eb 100644 --- a/docs/classes/Responder.html +++ b/docs/classes/Responder.html @@ -1,17 +1,17 @@ -Responder | @homebridge/ciao - v1.1.8

    A Responder instance represents a running MDNSServer and a set of advertised services.

    +Responder | @homebridge/ciao - v1.2.0

    A Responder instance represents a running MDNSServer and a set of advertised services.

    It will handle any service related operations, like advertising, sending goodbye packets or sending record updates. It handles answering questions arriving at the multicast address.

    -

    Implements

    • PacketHandler

    Methods

    Implements

    • PacketHandler

    Methods

    • Creates a new CiaoService instance and links it to this Responder instance.

      Parameters

      • options: ServiceOptions

        Defines all information about the service which should be created.

      Returns CiaoService

      The newly created CiaoService instance can be used to advertise and manage the created service.

      -
    • This method should be called when you want to unpublish all service exposed by this Responder. +

    • This method should be called when you want to unpublish all service exposed by this Responder. This method SHOULD be called before the node application exists, so any host on the network is informed of the shutdown of this machine. Calling the shutdown method is mandatory for a clean termination (sending goodbye packets).

      The shutdown method must only be called ONCE.

      Returns Promise<void>

      The Promise resolves once all goodbye packets were sent (or immediately if any other users have a reference to this Responder instance).

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/enums/Protocol.html b/docs/enums/Protocol.html index f9f1c17..faece89 100644 --- a/docs/enums/Protocol.html +++ b/docs/enums/Protocol.html @@ -1,7 +1,7 @@ -Protocol | @homebridge/ciao - v1.1.8

    Enumeration ProtocolConst

    Defines the transport protocol of a service.

    +Protocol | @homebridge/ciao - v1.2.0

    Enumeration ProtocolConst

    Defines the transport protocol of a service.

    As of RFC 6763 7. TCP must be used for any applications using tcp. For applications using any other transport protocol UDP must be used. This applies to all other transport protocols like SCTP, DCCP, RTMFP, etc

    -

    Enumeration Members

    TCP +

    Enumeration Members

    Enumeration Members

    TCP: "tcp"
    UDP: "udp"
    \ No newline at end of file +

    Enumeration Members

    TCP: "tcp"
    UDP: "udp"
    \ No newline at end of file diff --git a/docs/enums/ServiceEvent.html b/docs/enums/ServiceEvent.html index 72bb8be..40ed2d6 100644 --- a/docs/enums/ServiceEvent.html +++ b/docs/enums/ServiceEvent.html @@ -1,5 +1,5 @@ -ServiceEvent | @homebridge/ciao - v1.1.8

    Enumeration ServiceEventConst

    Events thrown by a CiaoService

    -

    Enumeration Members

    HOSTNAME_CHANGED +ServiceEvent | @homebridge/ciao - v1.2.0

    Enumeration ServiceEventConst

    Events thrown by a CiaoService

    +

    Enumeration Members

    Enumeration Members

    HOSTNAME_CHANGED: "hostname-change"

    Event is called when the Prober identifies that the hostname for the service is already used and thus resolve the name conflict by adjusting the hostname (e.g. adding '(2)' to the hostname). @@ -7,8 +7,8 @@ from the service name if not supplied. If you supply a custom hostname (not automatically derived from the service name) you must hook up a listener to this event in order for the hostname to be persisted.

    -
    NAME_CHANGED: "name-change"

    Event is called when the Prober identifies that the name for the service is already used +

    NAME_CHANGED: "name-change"

    Event is called when the Prober identifies that the name for the service is already used and thus resolve the name conflict by adjusting the name (e.g. adding '(2)' to the name). This change must be persisted and thus a listener must hook up to this event in order for the name to be persisted.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/enums/ServiceType.html b/docs/enums/ServiceType.html index ec4b94e..80caf7e 100644 --- a/docs/enums/ServiceType.html +++ b/docs/enums/ServiceType.html @@ -1,7 +1,7 @@ -ServiceType | @homebridge/ciao - v1.1.8

    Enumeration ServiceTypeConst

    This enum defines some commonly used service types. +ServiceType | @homebridge/ciao - v1.2.0

    Enumeration ServiceTypeConst

    This enum defines some commonly used service types. This is also referred to as service name (as of RFC 6763). A service name must not be longer than 15 characters (RFC 6763 7.2).

    -

    Enumeration Members

    Enumeration Members

    Enumeration Members

    AIRDROP: "airdrop"
    AIRPLAY: "airplay"
    AIRPORT: "airport"
    COMPANION_LINK: "companion-link"
    DACP: "dacp"
    DNS_SD: "dns-sd"
    HAP: "hap"
    HOMEKIT: "homekit"
    HTTP: "http"
    HTTP_ALT: "http_alt"
    IPP: "ipp"
    IPPS: "ipps"
    PRINTER: "printer"
    RAOP: "raop"
    TOUCH_ABLE: "touch-able"
    scanner: "scanner"
    \ No newline at end of file +

    Enumeration Members

    AIRDROP: "airdrop"
    AIRPLAY: "airplay"
    AIRPORT: "airport"
    COMPANION_LINK: "companion-link"
    DACP: "dacp"
    DNS_SD: "dns-sd"
    HAP: "hap"
    HOMEKIT: "homekit"
    HTTP: "http"
    HTTP_ALT: "http_alt"
    IPP: "ipp"
    IPPS: "ipps"
    PRINTER: "printer"
    RAOP: "raop"
    TOUCH_ABLE: "touch-able"
    scanner: "scanner"
    \ No newline at end of file diff --git a/docs/functions/getResponder.html b/docs/functions/getResponder.html index 3076b2e..3d802df 100644 --- a/docs/functions/getResponder.html +++ b/docs/functions/getResponder.html @@ -1,6 +1,6 @@ -getResponder | @homebridge/ciao - v1.1.8

    Function getResponder

    • This method is used to get a responder for the provided (optional) set of options.

      +getResponder | @homebridge/ciao - v1.2.0

      Function getResponder

      • This method is used to get a responder for the provided (optional) set of options.

        Ciao tries to create as few Responder instances as possible. Thus, it will share the same Responder instance for the same set of options.

        Parameters

        • Optional options: ResponderOptions

          If specified, the options will be passed to the underlying mdns server.

        Returns Responder

        A Responder instance for the given options. Might be shared with others using the same options.

        -
      \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index bc80b7f..a4b1dfe 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -@homebridge/ciao - v1.1.8

    @homebridge/ciao - v1.1.8

    +@homebridge/ciao - v1.2.0

    @homebridge/ciao - v1.2.0

    @@ -85,4 +85,4 @@ system (like mDNSResponder on macOS or avahi on most linux based systems).
    The one downside with the mdns library is that running it on Windows is not really straight forward. Generally we experienced with homebridge that many users run into problems when trying to install mdns. Thus bonjour-hap and then ciao was created to provide a much easier to set up system.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/MDNSServerOptions.html b/docs/interfaces/MDNSServerOptions.html index a049e81..e25d3c3 100644 --- a/docs/interfaces/MDNSServerOptions.html +++ b/docs/interfaces/MDNSServerOptions.html @@ -1,12 +1,12 @@ -MDNSServerOptions | @homebridge/ciao - v1.1.8

    Interface MDNSServerOptions

    Defines the options passed to the underlying mdns server.

    -
    interface MDNSServerOptions {
        disableIpv6?: boolean;
        interface?: string | string[];
    }

    Properties

    disableIpv6? +MDNSServerOptions | @homebridge/ciao - v1.2.0

    Interface MDNSServerOptions

    Defines the options passed to the underlying mdns server.

    +
    interface MDNSServerOptions {
        disableIpv6?: boolean;
        interface?: string | string[];
    }

    Properties

    disableIpv6?: boolean

    If specified, the mdns server will not include any ipv6 address records and not bind any udp6 sockets. This is handy if you want to "bind" on 0.0.0.0 only.

    -
    interface?: string | string[]

    If specified, the mdns server will only listen on the specified interfaces (allowlist). +

    interface?: string | string[]

    If specified, the mdns server will only listen on the specified interfaces (allowlist). It can be supplied as a string (representing a single interface) or as an array of strings to define multiple interfaces. The interface can be defined by specifying the interface name (like 'en0') or by specifying an ip address.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/ServiceOptions.html b/docs/interfaces/ServiceOptions.html index bbbd3c1..37b006e 100644 --- a/docs/interfaces/ServiceOptions.html +++ b/docs/interfaces/ServiceOptions.html @@ -1,5 +1,5 @@ -ServiceOptions | @homebridge/ciao - v1.1.8

    Interface ServiceOptions

    Service options supplied when creating a new ciao service.

    -
    interface ServiceOptions {
        disabledIpv6?: boolean;
        domain?: string;
        hostname?: string;
        name: string;
        port?: number;
        protocol?: Protocol;
        restrictedAddresses?: string[];
        subtypes?: string[];
        txt?: ServiceTxt;
        type: string;
    }

    Properties

    disabledIpv6? +ServiceOptions | @homebridge/ciao - v1.2.0

    Interface ServiceOptions

    Service options supplied when creating a new ciao service.

    +
    interface ServiceOptions {
        disabledIpv6?: boolean;
        domain?: string;
        hostname?: string;
        name: string;
        port?: number;
        protocol?: Protocol;
        restrictedAddresses?: string[];
        subtypes?: string[];
        txt?: ServiceTxt;
        type: string;
    }

    Properties

    disabledIpv6? domain? hostname? name @@ -12,16 +12,16 @@

    Properties

    disabledIpv6?: boolean

    The service won't advertise ipv6 address records. This can be used to simulate binding on 0.0.0.0. May be combined with restrictedAddresses.

    -
    domain?: string

    Adds ability to set custom domain. Will default to "local". +

    domain?: string

    Adds ability to set custom domain. Will default to "local". The domain will also be automatically appended to the hostname.

    -
    hostname?: string

    Defines a hostname under which the service can be reached. +

    hostname?: string

    Defines a hostname under which the service can be reached. The specified hostname must not include the TLD. If undefined the service name will be used as default.

    -
    name: string

    Instance name of the service

    -
    port?: number

    Port of the service. +

    name: string

    Instance name of the service

    +
    port?: number

    Port of the service. If not supplied it must be set later via updatePort BEFORE advertising the service.

    -
    protocol?: Protocol

    The protocol the service uses. Default is TCP.

    -
    restrictedAddresses?: string[]

    If defined it restricts the service to be advertised on the specified +

    protocol?: Protocol

    The protocol the service uses. Default is TCP.

    +
    restrictedAddresses?: string[]

    If defined it restricts the service to be advertised on the specified ip addresses or interface names.

    If an interface name is specified, ANY address on that given interface will be advertised (if an IP address of the given interface is also given in the array, it will be overridden). @@ -30,8 +30,8 @@ If an ip address is given, the ip address must be valid at the time of service creation.

    If the service is set to advertise on a given interface, though the MDNSServer is configured to ignore this interface, the service won't be advertised on the interface.

    -
    subtypes?: string[]

    Optional array of subtypes of the service. +

    subtypes?: string[]

    Optional array of subtypes of the service. Refer to ServiceType for some known examples.

    -

    If defined, a txt record will be published with the given service.

    -
    type: string

    Type of the service.

    -
    \ No newline at end of file +

    If defined, a txt record will be published with the given service.

    +
    type: string

    Type of the service.

    +
    \ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index ccffd6e..6798393 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,4 +1,4 @@ -@homebridge/ciao - v1.1.8

    @homebridge/ciao - v1.1.8

    Index

    Enumerations

    Protocol +@homebridge/ciao - v1.2.0

    @homebridge/ciao - v1.2.0

    Index

    Enumerations

    Classes

    CiaoService @@ -9,4 +9,4 @@ ServiceTxt

    Variables

    Functions

    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/ResponderOptions.html b/docs/types/ResponderOptions.html index 4bd262d..bfc5d68 100644 --- a/docs/types/ResponderOptions.html +++ b/docs/types/ResponderOptions.html @@ -1 +1 @@ -ResponderOptions | @homebridge/ciao - v1.1.8

    Type alias ResponderOptions

    ResponderOptions: {} & MDNSServerOptions

    Type declaration

      \ No newline at end of file +ResponderOptions | @homebridge/ciao - v1.2.0

      Type alias ResponderOptions

      ResponderOptions: {} & MDNSServerOptions

      Type declaration

        \ No newline at end of file diff --git a/docs/types/ServiceTxt.html b/docs/types/ServiceTxt.html index 73973bf..6ce06f8 100644 --- a/docs/types/ServiceTxt.html +++ b/docs/types/ServiceTxt.html @@ -1,3 +1,3 @@ -ServiceTxt | @homebridge/ciao - v1.1.8

        Type alias ServiceTxt

        ServiceTxt: Record<string, any>

        A service txt consist of multiple key=value pairs, +ServiceTxt | @homebridge/ciao - v1.2.0

        Type alias ServiceTxt

        ServiceTxt: Record<string, any>

        A service txt consist of multiple key=value pairs, which get advertised on the network.

        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/variables/default.html b/docs/variables/default.html index f76c6d2..83a0ced 100644 --- a/docs/variables/default.html +++ b/docs/variables/default.html @@ -1,6 +1,6 @@ -default | @homebridge/ciao - v1.1.8

        Variable default

        default: {
            getResponder: ((options?) => Responder);
        }

        Type declaration

        • getResponder: ((options?) => Responder)
            • (options?): Responder
            • This method is used to get a responder for the provided (optional) set of options.

              +default | @homebridge/ciao - v1.2.0

              Variable default

              default: {
                  getResponder: ((options?) => Responder);
              }

              Type declaration

              • getResponder: ((options?) => Responder)
                  • (options?): Responder
                  • This method is used to get a responder for the provided (optional) set of options.

                    Ciao tries to create as few Responder instances as possible. Thus, it will share the same Responder instance for the same set of options.

                    Parameters

                    • Optional options: ResponderOptions

                      If specified, the options will be passed to the underlying mdns server.

                    Returns Responder

                    A Responder instance for the given options. Might be shared with others using the same options.

                    -
              \ No newline at end of file +
        \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 61b4bc1..4e6637f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@homebridge/ciao", - "version": "1.1.8", + "version": "1.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@homebridge/ciao", - "version": "1.1.8", + "version": "1.2.0", "license": "MIT", "dependencies": { "debug": "^4.3.4", diff --git a/package.json b/package.json index 5170f6a..adf0458 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@homebridge/ciao", - "version": "1.1.8", + "version": "1.2.0", "description": "ciao is a RFC 6763 compliant dns-sd library, advertising on multicast dns (RFC 6762) implemented in plain Typescript/JavaScript", "main": "lib/index.js", "types": "lib/index.d.ts",