@basmilius/apple-devices 0.0.44 → 0.0.45

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.
@@ -10,7 +10,7 @@ type EventMap = {
10
10
  readonly sendCommandResult: [Proto.SendCommandResultMessage];
11
11
  readonly setArtwork: [Proto.SetArtworkMessage];
12
12
  readonly setDefaultSupportedCommands: [Proto.SetDefaultSupportedCommandsMessage];
13
- readonly setNowPlayingClient: [string | null];
13
+ readonly setNowPlayingClient: [Proto.SetNowPlayingClientMessage];
14
14
  readonly setNowPlayingPlayer: [Proto.SetNowPlayingPlayerMessage];
15
15
  readonly setState: [Proto.SetStateMessage];
16
16
  readonly updateClient: [Proto.UpdateClientMessage];
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var p=2000,n=Symbol("com.basmilius.airplay:protocol"),a=Symbol("com.basmilius.airplay:subscribe"),r=Symbol("com.basmilius.airplay:unsubscribe");import{EventEmitter as f}from"node:events";import{AirPlay as k}from"@basmilius/apple-airplay";import{debug as S}from"@basmilius/apple-common";import{EventEmitter as w}from"node:events";import{Proto as v}from"@basmilius/apple-airplay";class c{get bundleIdentifier(){return this.#t}get displayName(){return this.#i}get playbackQueue(){return this.#o}get playbackState(){return this.#s}get playbackStateTimestamp(){return this.#e}get supportedCommands(){return this.#a}#t;#i;#o=null;#s;#e;#a=[];constructor(t,e){this.#t=t,this.#i=e,this.#s=v.PlaybackState_Enum.Unknown,this.#a=[]}isCommandSupported(t){return this.#a.some((e)=>e.command===t)}setPlaybackQueue(t){this.#o=t}setPlaybackState(t,e){this.#s=t,this.#e=e}setSupportedCommands(t){this.#a=t}}class y extends w{get#t(){return this.#i.dataStream}get#i(){return this.#s[n]}get clients(){return this.#o}get nowPlayingClient(){return this.#e?this.#o[this.#e]??null:null}get volume(){return this.#a}get volumeAvailable(){return this.#r}get volumeCapabilities(){return this.#n}#o={};#s;#e;#a;#r;#n;constructor(t){super();this.#s=t,this.#e=null,this.#a=0,this.onDeviceInfo=this.onDeviceInfo.bind(this),this.onOriginClientProperties=this.onOriginClientProperties.bind(this),this.onPlayerClientProperties=this.onPlayerClientProperties.bind(this),this.onSendCommandResult=this.onSendCommandResult.bind(this),this.onSetArtwork=this.onSetArtwork.bind(this),this.onSetDefaultSupportedCommands=this.onSetDefaultSupportedCommands.bind(this),this.onSetNowPlayingClient=this.onSetNowPlayingClient.bind(this),this.onSetNowPlayingPlayer=this.onSetNowPlayingPlayer.bind(this),this.onSetState=this.onSetState.bind(this),this.onUpdateClient=this.onUpdateClient.bind(this),this.onUpdateContentItem=this.onUpdateContentItem.bind(this),this.onUpdateContentItemArtwork=this.onUpdateContentItemArtwork.bind(this),this.onUpdatePlayer=this.onUpdatePlayer.bind(this),this.onUpdateOutputDevice=this.onUpdateOutputDevice.bind(this),this.onVolumeControlAvailability=this.onVolumeControlAvailability.bind(this),this.onVolumeControlCapabilitiesDidChange=this.onVolumeControlCapabilitiesDidChange.bind(this),this.onVolumeDidChange=this.onVolumeDidChange.bind(this)}async[a](){this.#t.on("deviceInfo",this.onDeviceInfo),this.#t.on("originClientProperties",this.onOriginClientProperties),this.#t.on("playerClientProperties",this.onPlayerClientProperties),this.#t.on("sendCommandResult",this.onSendCommandResult),this.#t.on("setArtwork",this.onSetArtwork),this.#t.on("setDefaultSupportedCommands",this.onSetDefaultSupportedCommands),this.#t.on("setNowPlayingClient",this.onSetNowPlayingClient),this.#t.on("setNowPlayingPlayer",this.onSetNowPlayingPlayer),this.#t.on("setState",this.onSetState),this.#t.on("updateClient",this.onUpdateClient),this.#t.on("updateContentItem",this.onUpdateContentItem),this.#t.on("updateContentItemArtwork",this.onUpdateContentItemArtwork),this.#t.on("updatePlayer",this.onUpdatePlayer),this.#t.on("updateOutputDevice",this.onUpdateOutputDevice),this.#t.on("volumeControlAvailability",this.onVolumeControlAvailability),this.#t.on("volumeControlCapabilitiesDidChange",this.onVolumeControlCapabilitiesDidChange),this.#t.on("volumeDidChange",this.onVolumeDidChange)}async[r](){this.#t.off("deviceInfo",this.onDeviceInfo),this.#t.off("originClientProperties",this.onOriginClientProperties),this.#t.off("playerClientProperties",this.onPlayerClientProperties),this.#t.off("sendCommandResult",this.onSendCommandResult),this.#t.off("setArtwork",this.onSetArtwork),this.#t.off("setDefaultSupportedCommands",this.onSetDefaultSupportedCommands),this.#t.off("setNowPlayingClient",this.onSetNowPlayingClient),this.#t.off("setNowPlayingPlayer",this.onSetNowPlayingPlayer),this.#t.off("setState",this.onSetState),this.#t.off("updateClient",this.onUpdateClient),this.#t.off("updateContentItem",this.onUpdateContentItem),this.#t.off("updateContentItemArtwork",this.onUpdateContentItemArtwork),this.#t.off("updatePlayer",this.onUpdatePlayer),this.#t.off("updateOutputDevice",this.onUpdateOutputDevice),this.#t.off("volumeControlAvailability",this.onVolumeControlAvailability),this.#t.off("volumeControlCapabilitiesDidChange",this.onVolumeControlCapabilitiesDidChange),this.#t.off("volumeDidChange",this.onVolumeDidChange)}async onDeviceInfo(t){this.emit("deviceInfo",t)}async onOriginClientProperties(t){this.emit("originClientProperties",t)}async onPlayerClientProperties(t){this.emit("playerClientProperties",t)}async onSendCommandResult(t){this.emit("sendCommandResult",t)}async onSetArtwork(t){this.emit("setArtwork",t)}async onSetDefaultSupportedCommands(t){this.emit("setDefaultSupportedCommands",t)}async onSetNowPlayingClient(t){this.#e=t.client?.bundleIdentifier??null,this.emit("setNowPlayingClient",this.#e)}async onSetNowPlayingPlayer(t){this.emit("setNowPlayingPlayer",t)}async onSetState(t){let e=this.#c(t.playerPath.client.bundleIdentifier,t.displayName);if(t.playbackState)e.setPlaybackState(t.playbackState,t.playbackStateTimestamp);if(t.supportedCommands)e.setSupportedCommands(t.supportedCommands.supportedCommands);if(t.playbackQueue)e.setPlaybackQueue(t.playbackQueue);this.emit("setState",t)}async onUpdateContentItem(t){this.emit("updateContentItem",t)}async onUpdateContentItemArtwork(t){this.emit("updateContentItemArtwork",t)}async onUpdatePlayer(t){this.emit("updatePlayer",t)}async onUpdateClient(t){this.#c(t.client.bundleIdentifier,t.client.displayName),this.emit("clients",this.#o)}async onUpdateOutputDevice(t){this.emit("updateOutputDevice",t)}async onVolumeControlAvailability(t){this.#r=t.volumeControlAvailable,this.#n=t.volumeCapabilities,this.emit("volumeControlAvailability",t.volumeControlAvailable,t.volumeCapabilities)}async onVolumeControlCapabilitiesDidChange(t){this.#r=t.capabilities.volumeControlAvailable,this.#n=t.capabilities.volumeCapabilities,this.emit("volumeControlCapabilitiesDidChange",t.capabilities.volumeControlAvailable,t.capabilities.volumeCapabilities)}async onVolumeDidChange(t){this.#a=t.volume,this.emit("volumeDidChange",t.volume)}#c(t,e){if(t in this.#o)return this.#o[t];else{let i=new c(t,e);return this.#o[t]=i,this.emit("clients",this.#o),i}}}class s extends f{get[n](){return this.#n}get#t(){return this.#n.dataStream}get isConnected(){return this.#n?.rtsp?.isConnected??!1}get state(){return this.#i}#i;#o;#s=!1;#e;#a;#r;#n;constructor(t){super();this.#e=t,this.#i=new y(this)}async connect(){if(this.#s=!1,this.#n=new k(this.#e),await this.#n.connect(),this.#o)this.#r=await this.#n.verify.start(this.#o);else await this.#n.pairing.start(),this.#r=await this.#n.pairing.transient();this.#n.rtsp.on("close",async()=>this.#u()),await this.#l(),this.emit("connected")}async disconnect(){this.#s=!0,clearInterval(this.#a),await this.#p(),await this.#n.disconnect(),this.emit("disconnected",!1)}async requestPlaybackQueue(t){await this.#t.exchange(this.#t.messages.playbackQueueRequest(0,t))}async sendButtonEvent(t,e,i){await this.#t.exchange(this.#t.messages.sendButtonEvent(t,e,i))}async sendCommand(t,e){await this.#t.exchange(this.#t.messages.sendCommand(t,e))}async setVolume(t){await this.#t.exchange(this.#t.messages.setVolume(t))}async setCredentials(t){this.#o=t}async setDiscoveryResult(t){this.#e=t}async#c(){try{await this.#n.feedback()}catch(t){S("Feedback error",t)}}async#u(){if(this.#s)return;this.emit("disconnected",!0)}async#l(){let t=this.#r;await this.#n.rtsp.enableEncryption(t.accessoryToControllerKey,t.controllerToAccessoryKey),await this.#n.setupEventStream(t.pairingId,t.sharedSecret),await this.#n.setupDataStream(t.sharedSecret),await this.#m(),this.#a=setInterval(async()=>await this.#c(),p);let e=this.#e.packet.additionals.find((i)=>("rdata"in i)&&typeof i.rdata==="object"&&("gid"in i.rdata))?.rdata.gid;if(e)await this.#t.exchange(this.#t.messages.configureConnection(e));await this.#t.exchange(this.#t.messages.deviceInfo(t.pairingId)),this.#t.on("deviceInfo",async()=>{await this.#t.exchange(this.#t.messages.setConnectionState()),await this.#t.exchange(this.#t.messages.clientUpdatesConfig())})}async#m(){await this.#i[a]()}async#p(){await this.#i[r]()}}var u=Symbol("com.basmilius.companion-link:protocol");import{EventEmitter as A}from"node:events";import{CompanionLink as x}from"@basmilius/apple-companion-link";import{debug as d}from"@basmilius/apple-common";class m extends A{get[u](){return this.#e}get isConnected(){return this.#e?.socket?.isConnected??!1}#t;#i=!1;#o;#s;#e;constructor(t){super();this.#o=t,this.onSystemStatus=this.onSystemStatus.bind(this),this.onTVSystemStatus=this.onTVSystemStatus.bind(this)}async connect(){if(!this.#t)throw Error("Credentials are required to connect to a Companion Link device.");this.#i=!1,this.#e=new x(this.#o),await this.#e.connect(),this.#s=await this.#e.verify.start(this.#t),this.#e.socket.on("close",async()=>this.#a()),await this.#r(),this.emit("connected")}async disconnect(){this.#i=!0,await this.#c(),await this.#e.disconnect(),this.emit("disconnected",!1)}async setCredentials(t){this.#t=t}async setDiscoveryResult(t){this.#o=t}async getAttentionState(){return await this.#e.api.getAttentionState()}async getLaunchableApps(){return await this.#e.api.getLaunchableApps()}async getUserAccounts(){return await this.#e.api.getUserAccounts()}async launchApp(t){await this.#e.api.launchApp(t)}async launchUrl(t){await this.#e.api.launchUrl(t)}async mediaControlCommand(t,e){await this.#e.api.mediaControlCommand(t,e)}async pressButton(t,e,i){await this.#e.api.pressButton(t,e,i)}async switchUserAccount(t){await this.#e.api.switchUserAccount(t)}async#a(){if(this.#i)return;this.emit("disconnected",!0)}async#r(){let t=this.#s;await this.#e.socket.enableEncryption(t.accessoryToControllerKey,t.controllerToAccessoryKey),await this.#e.api._systemInfo(this.#t.pairingId),await this.#e.api._touchStart(),await this.#e.api._sessionStart(),await this.#e.api._tvrcSessionStart(),await this.#e.api._unsubscribe("_iMC"),await this.#n()}async#n(){await this.#e.api._subscribe("SystemStatus",this.onSystemStatus),await this.#e.api._subscribe("TVSystemStatus",this.onTVSystemStatus);let t=await this.getAttentionState();this.emit("power",t==="awake"||t==="screensaver")}async#c(){await this.#e.api._unsubscribe("SystemStatus",this.onSystemStatus),await this.#e.api._unsubscribe("TVSystemStatus",this.onTVSystemStatus)}async onSystemStatus(t){d("System Status",t),this.emit("power",t.state===2||t.state===3)}async onTVSystemStatus(t){d("TV System Status",t),this.emit("power",t.state===2||t.state===3)}}import{EventEmitter as T}from"node:events";import{Proto as h}from"@basmilius/apple-airplay";class P extends T{get airplay(){return this.#t}get companionLink(){return this.#i}get bundleIdentifier(){return this.#t.state.nowPlayingClient?.bundleIdentifier??null}get displayName(){return this.#t.state.nowPlayingClient?.displayName??null}get isConnected(){return this.#t.isConnected&&this.#i.isConnected}get playbackQueue(){return this.#t.state.nowPlayingClient?.playbackQueue??null}get playbackState(){return this.#t.state.nowPlayingClient?.playbackState??h.PlaybackState_Enum.Unknown}get playbackStateTimestamp(){return this.#t.state.nowPlayingClient?.playbackStateTimestamp??-1}#t;#i;#o=!1;constructor(t,e){super();this.#t=new s(t),this.#i=new m(e),this.#t.on("connected",()=>this.#s()),this.#t.on("disconnected",(i)=>this.#e(i)),this.#i.on("connected",()=>this.#s()),this.#i.on("disconnected",(i)=>this.#e(i))}async connect(t){await this.#t.setCredentials(t),await this.#i.setCredentials(t),await this.#t.connect(),await this.#i.connect(),this.#o=!1}async disconnect(){await this.#t.disconnect(),await this.#i.disconnect()}async turnOff(){await this.#i.pressButton("Sleep")}async turnOn(){await this.#i.pressButton("Wake")}async pause(){await this.#i.mediaControlCommand("Pause")}async playPause(){await this.#i.pressButton("PlayPause")}async play(){await this.#i.mediaControlCommand("Play")}async stop(){await this.#t.sendCommand(h.Command.Stop)}async next(){await this.#i.mediaControlCommand("NextTrack")}async previous(){await this.#i.mediaControlCommand("PreviousTrack")}async volumeDown(){await this.#i.pressButton("VolumeDown")}async volumeMute(){await this.#i.pressButton("PageUp")}async volumeUp(){await this.#i.pressButton("VolumeUp")}async getCommandInfo(t){let e=this.#t.state.nowPlayingClient;if(!e)return null;return e.supportedCommands.find((i)=>i.command===t)??null}async isCommandSupported(t){let e=this.#t.state.nowPlayingClient;if(!e)return!1;return e.isCommandSupported(t)}async#s(){if(!this.#t.isConnected||!this.#i.isConnected)return;this.emit("connected")}async#e(t){if(this.#o)return;this.#o=!0,await this.disconnect(),this.emit("disconnected",t)}}import{EventEmitter as E}from"node:events";import{Proto as o}from"@basmilius/apple-airplay";class l extends E{get airplay(){return this.#t}get bundleIdentifier(){return this.#t.state.nowPlayingClient?.bundleIdentifier??null}get displayName(){return this.#t.state.nowPlayingClient?.displayName??null}get isConnected(){return this.#t.isConnected}get playbackQueue(){return this.#t.state.nowPlayingClient?.playbackQueue??null}get playbackState(){return this.#t.state.nowPlayingClient?.playbackState??o.PlaybackState_Enum.Unknown}get playbackStateTimestamp(){return this.#t.state.nowPlayingClient?.playbackStateTimestamp??-1}get volume(){return this.#t.state.volume??0}#t;#i=!1;constructor(t){super();this.#t=new s(t),this.#t.on("connected",()=>this.#o()),this.#t.on("disconnected",(e)=>this.#s(e))}async connect(){await this.#t.connect(),this.#i=!1}async disconnect(){await this.#t.disconnect()}async pause(){await this.#t.sendCommand(o.Command.Pause)}async playPause(){await this.#t.sendCommand(o.Command.TogglePlayPause)}async play(){await this.#t.sendCommand(o.Command.Play)}async stop(){await this.#t.sendCommand(o.Command.Stop)}async next(){await this.#t.sendCommand(o.Command.NextInContext)}async previous(){await this.#t.sendCommand(o.Command.PreviousInContext)}async setVolume(t){await this.#t.setVolume(t)}async getCommandInfo(t){let e=this.#t.state.nowPlayingClient;if(!e)return null;return e.supportedCommands.find((i)=>i.command===t)??null}async isCommandSupported(t){let e=this.#t.state.nowPlayingClient;if(!e)return!1;return e.isCommandSupported(t)}async#o(){this.emit("connected")}async#s(t){if(this.#i)return;this.#i=!0,await this.disconnect(),this.emit("disconnected",t)}}class C extends l{}class b extends l{}export{b as HomePodMini,C as HomePod,u as COMPANION_LINK,P as AppleTV,n as AIRPLAY};
1
+ var y=2000,n=Symbol("com.basmilius.airplay:protocol"),a=Symbol("com.basmilius.airplay:subscribe"),r=Symbol("com.basmilius.airplay:unsubscribe");import{EventEmitter as f}from"node:events";import{AirPlay as k}from"@basmilius/apple-airplay";import{debug as S}from"@basmilius/apple-common";import{EventEmitter as w}from"node:events";import{Proto as v}from"@basmilius/apple-airplay";class c{get bundleIdentifier(){return this.#t}get displayName(){return this.#e}get playbackQueue(){return this.#o}get playbackState(){return this.#s}get playbackStateTimestamp(){return this.#i}get supportedCommands(){return this.#a}#t;#e;#o=null;#s;#i;#a=[];constructor(t,i){this.#t=t,this.#e=i,this.#s=v.PlaybackState_Enum.Unknown,this.#a=[]}isCommandSupported(t){return this.#a.some((i)=>i.command===t)}setPlaybackQueue(t){this.#o=t}setPlaybackState(t,i){this.#s=t,this.#i=i}setSupportedCommands(t){this.#a=t}}class d extends w{get#t(){return this.#e.dataStream}get#e(){return this.#s[n]}get clients(){return this.#o}get nowPlayingClient(){return this.#i?this.#o[this.#i]??null:null}get volume(){return this.#a}get volumeAvailable(){return this.#r}get volumeCapabilities(){return this.#n}#o={};#s;#i;#a;#r;#n;constructor(t){super();this.#s=t,this.#i=null,this.#a=0,this.onDeviceInfo=this.onDeviceInfo.bind(this),this.onOriginClientProperties=this.onOriginClientProperties.bind(this),this.onPlayerClientProperties=this.onPlayerClientProperties.bind(this),this.onSendCommandResult=this.onSendCommandResult.bind(this),this.onSetArtwork=this.onSetArtwork.bind(this),this.onSetDefaultSupportedCommands=this.onSetDefaultSupportedCommands.bind(this),this.onSetNowPlayingClient=this.onSetNowPlayingClient.bind(this),this.onSetNowPlayingPlayer=this.onSetNowPlayingPlayer.bind(this),this.onSetState=this.onSetState.bind(this),this.onUpdateClient=this.onUpdateClient.bind(this),this.onUpdateContentItem=this.onUpdateContentItem.bind(this),this.onUpdateContentItemArtwork=this.onUpdateContentItemArtwork.bind(this),this.onUpdatePlayer=this.onUpdatePlayer.bind(this),this.onUpdateOutputDevice=this.onUpdateOutputDevice.bind(this),this.onVolumeControlAvailability=this.onVolumeControlAvailability.bind(this),this.onVolumeControlCapabilitiesDidChange=this.onVolumeControlCapabilitiesDidChange.bind(this),this.onVolumeDidChange=this.onVolumeDidChange.bind(this)}async[a](){this.#t.on("deviceInfo",this.onDeviceInfo),this.#t.on("originClientProperties",this.onOriginClientProperties),this.#t.on("playerClientProperties",this.onPlayerClientProperties),this.#t.on("sendCommandResult",this.onSendCommandResult),this.#t.on("setArtwork",this.onSetArtwork),this.#t.on("setDefaultSupportedCommands",this.onSetDefaultSupportedCommands),this.#t.on("setNowPlayingClient",this.onSetNowPlayingClient),this.#t.on("setNowPlayingPlayer",this.onSetNowPlayingPlayer),this.#t.on("setState",this.onSetState),this.#t.on("updateClient",this.onUpdateClient),this.#t.on("updateContentItem",this.onUpdateContentItem),this.#t.on("updateContentItemArtwork",this.onUpdateContentItemArtwork),this.#t.on("updatePlayer",this.onUpdatePlayer),this.#t.on("updateOutputDevice",this.onUpdateOutputDevice),this.#t.on("volumeControlAvailability",this.onVolumeControlAvailability),this.#t.on("volumeControlCapabilitiesDidChange",this.onVolumeControlCapabilitiesDidChange),this.#t.on("volumeDidChange",this.onVolumeDidChange)}async[r](){this.#t.off("deviceInfo",this.onDeviceInfo),this.#t.off("originClientProperties",this.onOriginClientProperties),this.#t.off("playerClientProperties",this.onPlayerClientProperties),this.#t.off("sendCommandResult",this.onSendCommandResult),this.#t.off("setArtwork",this.onSetArtwork),this.#t.off("setDefaultSupportedCommands",this.onSetDefaultSupportedCommands),this.#t.off("setNowPlayingClient",this.onSetNowPlayingClient),this.#t.off("setNowPlayingPlayer",this.onSetNowPlayingPlayer),this.#t.off("setState",this.onSetState),this.#t.off("updateClient",this.onUpdateClient),this.#t.off("updateContentItem",this.onUpdateContentItem),this.#t.off("updateContentItemArtwork",this.onUpdateContentItemArtwork),this.#t.off("updatePlayer",this.onUpdatePlayer),this.#t.off("updateOutputDevice",this.onUpdateOutputDevice),this.#t.off("volumeControlAvailability",this.onVolumeControlAvailability),this.#t.off("volumeControlCapabilitiesDidChange",this.onVolumeControlCapabilitiesDidChange),this.#t.off("volumeDidChange",this.onVolumeDidChange)}async onDeviceInfo(t){this.emit("deviceInfo",t)}async onOriginClientProperties(t){this.emit("originClientProperties",t)}async onPlayerClientProperties(t){this.emit("playerClientProperties",t)}async onSendCommandResult(t){this.emit("sendCommandResult",t)}async onSetArtwork(t){this.emit("setArtwork",t)}async onSetDefaultSupportedCommands(t){this.emit("setDefaultSupportedCommands",t)}async onSetNowPlayingClient(t){this.#i=t.client?.bundleIdentifier??null,this.emit("setNowPlayingClient",t)}async onSetNowPlayingPlayer(t){this.emit("setNowPlayingPlayer",t)}async onSetState(t){let i=this.#c(t.playerPath.client.bundleIdentifier,t.displayName);if(t.playbackState)i.setPlaybackState(t.playbackState,t.playbackStateTimestamp);if(t.supportedCommands)i.setSupportedCommands(t.supportedCommands.supportedCommands);if(t.playbackQueue)i.setPlaybackQueue(t.playbackQueue);this.emit("setState",t)}async onUpdateContentItem(t){this.emit("updateContentItem",t)}async onUpdateContentItemArtwork(t){this.emit("updateContentItemArtwork",t)}async onUpdatePlayer(t){this.emit("updatePlayer",t)}async onUpdateClient(t){this.#c(t.client.bundleIdentifier,t.client.displayName),this.emit("clients",this.#o)}async onUpdateOutputDevice(t){this.emit("updateOutputDevice",t)}async onVolumeControlAvailability(t){this.#r=t.volumeControlAvailable,this.#n=t.volumeCapabilities,this.emit("volumeControlAvailability",t.volumeControlAvailable,t.volumeCapabilities)}async onVolumeControlCapabilitiesDidChange(t){this.#r=t.capabilities.volumeControlAvailable,this.#n=t.capabilities.volumeCapabilities,this.emit("volumeControlCapabilitiesDidChange",t.capabilities.volumeControlAvailable,t.capabilities.volumeCapabilities)}async onVolumeDidChange(t){this.#a=t.volume,this.emit("volumeDidChange",t.volume)}#c(t,i){if(t in this.#o)return this.#o[t];else{let e=new c(t,i);return this.#o[t]=e,this.emit("clients",this.#o),e}}}class s extends f{get[n](){return this.#n}get#t(){return this.#n.dataStream}get isConnected(){return this.#n?.rtsp?.isConnected??!1}get state(){return this.#e}#e;#o;#s=!1;#i;#a;#r;#n;constructor(t){super();this.#i=t,this.#e=new d(this)}async connect(){if(this.#s=!1,this.#n=new k(this.#i),await this.#n.connect(),this.#o)this.#r=await this.#n.verify.start(this.#o);else await this.#n.pairing.start(),this.#r=await this.#n.pairing.transient();this.#n.rtsp.on("close",async()=>this.#u()),await this.#l(),this.emit("connected")}async disconnect(){this.#s=!0,clearInterval(this.#a),await this.#p(),await this.#n.disconnect(),this.emit("disconnected",!1)}async requestPlaybackQueue(t){await this.#t.exchange(this.#t.messages.playbackQueueRequest(0,t))}async sendButtonEvent(t,i,e){await this.#t.exchange(this.#t.messages.sendButtonEvent(t,i,e))}async sendCommand(t,i){await this.#t.exchange(this.#t.messages.sendCommand(t,i))}async setVolume(t){await this.#t.exchange(this.#t.messages.setVolume(t))}async setCredentials(t){this.#o=t}async setDiscoveryResult(t){this.#i=t}async#c(){try{await this.#n.feedback()}catch(t){S("Feedback error",t)}}async#u(){if(this.#s)return;this.emit("disconnected",!0)}async#l(){let t=this.#r;await this.#n.rtsp.enableEncryption(t.accessoryToControllerKey,t.controllerToAccessoryKey),await this.#n.setupEventStream(t.pairingId,t.sharedSecret),await this.#n.setupDataStream(t.sharedSecret),await this.#m(),this.#a=setInterval(async()=>await this.#c(),y);let i=this.#i.packet.additionals.find((e)=>("rdata"in e)&&typeof e.rdata==="object"&&("gid"in e.rdata))?.rdata.gid;if(i)await this.#t.exchange(this.#t.messages.configureConnection(i));await this.#t.exchange(this.#t.messages.deviceInfo(t.pairingId)),this.#t.on("deviceInfo",async()=>{await this.#t.exchange(this.#t.messages.setConnectionState()),await this.#t.exchange(this.#t.messages.clientUpdatesConfig())})}async#m(){await this.#e[a]()}async#p(){await this.#e[r]()}}var u=Symbol("com.basmilius.companion-link:protocol");import{EventEmitter as A}from"node:events";import{CompanionLink as x}from"@basmilius/apple-companion-link";import{debug as m}from"@basmilius/apple-common";class p extends A{get[u](){return this.#i}get isConnected(){return this.#i?.socket?.isConnected??!1}#t;#e=!1;#o;#s;#i;constructor(t){super();this.#o=t,this.onSystemStatus=this.onSystemStatus.bind(this),this.onTVSystemStatus=this.onTVSystemStatus.bind(this)}async connect(){if(!this.#t)throw Error("Credentials are required to connect to a Companion Link device.");this.#e=!1,this.#i=new x(this.#o),this.#i.socket.on("close",async()=>this.#a()),this.#i.socket.on("error",async(t)=>this.#r(t)),await this.#i.connect(),this.#s=await this.#i.verify.start(this.#t),await this.#n(),this.emit("connected")}async disconnect(){this.#e=!0,await this.#u(),await this.#i.disconnect(),this.emit("disconnected",!1)}async setCredentials(t){this.#t=t}async setDiscoveryResult(t){this.#o=t}async getAttentionState(){return await this.#i.api.getAttentionState()}async getLaunchableApps(){return await this.#i.api.getLaunchableApps()}async getUserAccounts(){return await this.#i.api.getUserAccounts()}async launchApp(t){await this.#i.api.launchApp(t)}async launchUrl(t){await this.#i.api.launchUrl(t)}async mediaControlCommand(t,i){await this.#i.api.mediaControlCommand(t,i)}async pressButton(t,i,e){await this.#i.api.pressButton(t,i,e)}async switchUserAccount(t){await this.#i.api.switchUserAccount(t)}async#a(){if(this.#e)return;this.emit("disconnected",!0)}async#r(t){m("Companion Link error",t);try{await this.disconnect()}catch(i){}this.emit("disconnected",!0)}async#n(){let t=this.#s;await this.#i.socket.enableEncryption(t.accessoryToControllerKey,t.controllerToAccessoryKey),await this.#i.api._systemInfo(this.#t.pairingId),await this.#i.api._touchStart(),await this.#i.api._sessionStart(),await this.#i.api._tvrcSessionStart(),await this.#i.api._unsubscribe("_iMC"),await this.#c()}async#c(){await this.#i.api._subscribe("SystemStatus",this.onSystemStatus),await this.#i.api._subscribe("TVSystemStatus",this.onTVSystemStatus);let t=await this.getAttentionState();this.emit("power",t==="awake"||t==="screensaver")}async#u(){await this.#i.api._unsubscribe("SystemStatus",this.onSystemStatus),await this.#i.api._unsubscribe("TVSystemStatus",this.onTVSystemStatus)}async onSystemStatus(t){m("System Status",t),this.emit("power",t.state===2||t.state===3)}async onTVSystemStatus(t){m("TV System Status",t),this.emit("power",t.state===2||t.state===3)}}import{EventEmitter as E}from"node:events";import{Proto as h}from"@basmilius/apple-airplay";class P extends E{get airplay(){return this.#t}get companionLink(){return this.#e}get bundleIdentifier(){return this.#t.state.nowPlayingClient?.bundleIdentifier??null}get displayName(){return this.#t.state.nowPlayingClient?.displayName??null}get isConnected(){return this.#t.isConnected&&this.#e.isConnected}get playbackQueue(){return this.#t.state.nowPlayingClient?.playbackQueue??null}get playbackState(){return this.#t.state.nowPlayingClient?.playbackState??h.PlaybackState_Enum.Unknown}get playbackStateTimestamp(){return this.#t.state.nowPlayingClient?.playbackStateTimestamp??-1}#t;#e;#o=!1;constructor(t,i){super();this.#t=new s(t),this.#e=new p(i),this.#t.on("connected",()=>this.#s()),this.#t.on("disconnected",(e)=>this.#i(e)),this.#e.on("connected",()=>this.#s()),this.#e.on("disconnected",(e)=>this.#i(e))}async connect(t){await this.#t.setCredentials(t),await this.#e.setCredentials(t),await this.#t.connect(),await this.#e.connect(),this.#o=!1}async disconnect(){await this.#t.disconnect(),await this.#e.disconnect()}async turnOff(){await this.#e.pressButton("Sleep")}async turnOn(){await this.#e.pressButton("Wake")}async pause(){await this.#e.mediaControlCommand("Pause")}async playPause(){await this.#e.pressButton("PlayPause")}async play(){await this.#e.mediaControlCommand("Play")}async stop(){await this.#t.sendCommand(h.Command.Stop)}async next(){await this.#e.mediaControlCommand("NextTrack")}async previous(){await this.#e.mediaControlCommand("PreviousTrack")}async volumeDown(){await this.#e.pressButton("VolumeDown")}async volumeMute(){await this.#e.pressButton("PageUp")}async volumeUp(){await this.#e.pressButton("VolumeUp")}async getCommandInfo(t){let i=this.#t.state.nowPlayingClient;if(!i)return null;return i.supportedCommands.find((e)=>e.command===t)??null}async isCommandSupported(t){let i=this.#t.state.nowPlayingClient;if(!i)return!1;return i.isCommandSupported(t)}async#s(){if(!this.#t.isConnected||!this.#e.isConnected)return;this.emit("connected")}async#i(t){if(this.#o)return;this.#o=!0,await this.disconnect(),this.emit("disconnected",t)}}import{EventEmitter as T}from"node:events";import{Proto as o}from"@basmilius/apple-airplay";class l extends T{get airplay(){return this.#t}get bundleIdentifier(){return this.#t.state.nowPlayingClient?.bundleIdentifier??null}get displayName(){return this.#t.state.nowPlayingClient?.displayName??null}get isConnected(){return this.#t.isConnected}get playbackQueue(){return this.#t.state.nowPlayingClient?.playbackQueue??null}get playbackState(){return this.#t.state.nowPlayingClient?.playbackState??o.PlaybackState_Enum.Unknown}get playbackStateTimestamp(){return this.#t.state.nowPlayingClient?.playbackStateTimestamp??-1}get volume(){return this.#t.state.volume??0}#t;#e=!1;constructor(t){super();this.#t=new s(t),this.#t.on("connected",()=>this.#o()),this.#t.on("disconnected",(i)=>this.#s(i))}async connect(){await this.#t.connect(),this.#e=!1}async disconnect(){await this.#t.disconnect()}async pause(){await this.#t.sendCommand(o.Command.Pause)}async playPause(){await this.#t.sendCommand(o.Command.TogglePlayPause)}async play(){await this.#t.sendCommand(o.Command.Play)}async stop(){await this.#t.sendCommand(o.Command.Stop)}async next(){await this.#t.sendCommand(o.Command.NextInContext)}async previous(){await this.#t.sendCommand(o.Command.PreviousInContext)}async setVolume(t){await this.#t.setVolume(t)}async getCommandInfo(t){let i=this.#t.state.nowPlayingClient;if(!i)return null;return i.supportedCommands.find((e)=>e.command===t)??null}async isCommandSupported(t){let i=this.#t.state.nowPlayingClient;if(!i)return!1;return i.isCommandSupported(t)}async#o(){this.emit("connected")}async#s(t){if(this.#e)return;this.#e=!0,await this.disconnect(),this.emit("disconnected",t)}}class C extends l{}class b extends l{}export{b as HomePodMini,C as HomePod,u as COMPANION_LINK,P as AppleTV,n as AIRPLAY};
2
2
 
3
- //# debugId=3056F49800171C3F64756E2164756E21
3
+ //# debugId=7CBDAA32E87B6E1964756E2164756E21
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -4,16 +4,16 @@
4
4
  "sourcesContent": [
5
5
  "export const FEEDBACK_INTERVAL = 2000;\n\nexport const PROTOCOL = Symbol('com.basmilius.airplay:protocol');\nexport const STATE_SUBSCRIBE_SYMBOL = Symbol('com.basmilius.airplay:subscribe');\nexport const STATE_UNSUBSCRIBE_SYMBOL = Symbol('com.basmilius.airplay:unsubscribe');\n",
6
6
  "import { EventEmitter } from 'node:events';\nimport { AirPlay, type AirPlayDataStream, Proto } from '@basmilius/apple-airplay';\nimport { type AccessoryCredentials, type AccessoryKeys, debug, type DiscoveryResult } from '@basmilius/apple-common';\nimport { FEEDBACK_INTERVAL, PROTOCOL, STATE_SUBSCRIBE_SYMBOL, STATE_UNSUBSCRIBE_SYMBOL } from './const';\nimport State from './state';\n\ntype EventMap = {\n connected: [];\n disconnected: [unexpected: boolean];\n};\n\nexport default class extends EventEmitter<EventMap> {\n get [PROTOCOL](): AirPlay {\n return this.#protocol;\n }\n\n get #dataStream(): AirPlayDataStream {\n return this.#protocol.dataStream;\n }\n\n get isConnected(): boolean {\n return this.#protocol?.rtsp?.isConnected ?? false;\n }\n\n get state(): State {\n return this.#state;\n }\n\n readonly #state: State;\n #credentials?: AccessoryCredentials;\n #disconnect: boolean = false;\n #discoveryResult: DiscoveryResult;\n #feedbackInterval: NodeJS.Timeout;\n #keys: AccessoryKeys;\n #protocol!: AirPlay;\n\n constructor(discoveryResult: DiscoveryResult) {\n super();\n\n this.#discoveryResult = discoveryResult;\n this.#state = new State(this);\n }\n\n async connect(): Promise<void> {\n this.#disconnect = false;\n this.#protocol = new AirPlay(this.#discoveryResult);\n\n await this.#protocol.connect();\n\n if (this.#credentials) {\n this.#keys = await this.#protocol.verify.start(this.#credentials);\n } else {\n await this.#protocol.pairing.start();\n this.#keys = await this.#protocol.pairing.transient();\n }\n\n this.#protocol.rtsp.on('close', async () => this.#onClose());\n\n await this.#setup();\n\n this.emit('connected');\n }\n\n async disconnect(): Promise<void> {\n this.#disconnect = true;\n\n clearInterval(this.#feedbackInterval);\n\n await this.#unsubscribe();\n await this.#protocol.disconnect();\n\n this.emit('disconnected', false);\n }\n\n async requestPlaybackQueue(length: number): Promise<void> {\n await this.#dataStream.exchange(this.#dataStream.messages.playbackQueueRequest(0, length));\n }\n\n async sendButtonEvent(usagePage: number, usage: number, buttonDown: boolean): Promise<void> {\n await this.#dataStream.exchange(this.#dataStream.messages.sendButtonEvent(usagePage, usage, buttonDown));\n }\n\n async sendCommand(command: Proto.Command, options?: Proto.CommandOptions): Promise<void> {\n await this.#dataStream.exchange(this.#dataStream.messages.sendCommand(command, options));\n }\n\n async setVolume(volume: number): Promise<void> {\n await this.#dataStream.exchange(this.#dataStream.messages.setVolume(volume));\n }\n\n async setCredentials(credentials: AccessoryCredentials): Promise<void> {\n this.#credentials = credentials;\n }\n\n async setDiscoveryResult(discoveryResult: DiscoveryResult): Promise<void> {\n this.#discoveryResult = discoveryResult;\n }\n\n async #feedback(): Promise<void> {\n try {\n await this.#protocol.feedback();\n } catch (err) {\n debug('Feedback error', err);\n }\n }\n\n async #onClose(): Promise<void> {\n if (this.#disconnect) {\n return;\n }\n\n this.emit('disconnected', true);\n }\n\n async #setup(): Promise<void> {\n const keys = this.#keys;\n\n await this.#protocol.rtsp.enableEncryption(\n keys.accessoryToControllerKey,\n keys.controllerToAccessoryKey\n );\n\n await this.#protocol.setupEventStream(keys.pairingId, keys.sharedSecret);\n await this.#protocol.setupDataStream(keys.sharedSecret);\n await this.#subscribe();\n\n this.#feedbackInterval = setInterval(async () => await this.#feedback(), FEEDBACK_INTERVAL);\n\n const gid = this.#discoveryResult.packet.additionals.find(a => 'rdata' in a && typeof a['rdata'] === 'object' && 'gid' in a['rdata'])?.['rdata']['gid'] as string;\n\n if (gid) {\n await this.#dataStream.exchange(this.#dataStream.messages.configureConnection(gid));\n }\n\n await this.#dataStream.exchange(this.#dataStream.messages.deviceInfo(keys.pairingId));\n\n this.#dataStream.on('deviceInfo', async () => {\n await this.#dataStream.exchange(this.#dataStream.messages.setConnectionState());\n await this.#dataStream.exchange(this.#dataStream.messages.clientUpdatesConfig());\n });\n }\n\n async #subscribe(): Promise<void> {\n await this.#state[STATE_SUBSCRIBE_SYMBOL]();\n }\n\n async #unsubscribe(): Promise<void> {\n await this.#state[STATE_UNSUBSCRIBE_SYMBOL]();\n }\n}\n",
7
- "import { EventEmitter } from 'node:events';\nimport type { AirPlay, AirPlayDataStream, Proto } from '@basmilius/apple-airplay';\nimport { PROTOCOL, STATE_SUBSCRIBE_SYMBOL, STATE_UNSUBSCRIBE_SYMBOL } from './const';\nimport Client from './client';\nimport type Device from './device';\n\ntype EventMap = {\n readonly clients: [Record<string, Client>];\n readonly deviceInfo: [Proto.DeviceInfoMessage];\n readonly originClientProperties: [Proto.OriginClientPropertiesMessage];\n readonly playerClientProperties: [Proto.PlayerClientPropertiesMessage];\n readonly sendCommandResult: [Proto.SendCommandResultMessage];\n readonly setArtwork: [Proto.SetArtworkMessage];\n readonly setDefaultSupportedCommands: [Proto.SetDefaultSupportedCommandsMessage];\n readonly setNowPlayingClient: [string | null];\n readonly setNowPlayingPlayer: [Proto.SetNowPlayingPlayerMessage];\n readonly setState: [Proto.SetStateMessage];\n readonly updateClient: [Proto.UpdateClientMessage];\n readonly updateContentItem: [Proto.UpdateContentItemMessage];\n readonly updateContentItemArtwork: [Proto.UpdateContentItemArtworkMessage];\n readonly updatePlayer: [Proto.UpdatePlayerMessage];\n readonly updateOutputDevice: [Proto.UpdateOutputDeviceMessage];\n readonly volumeControlAvailability: [boolean, Proto.VolumeCapabilities_Enum];\n readonly volumeControlCapabilitiesDidChange: [boolean, Proto.VolumeCapabilities_Enum];\n readonly volumeDidChange: [number];\n};\n\nexport default class extends EventEmitter<EventMap> {\n get #dataStream(): AirPlayDataStream {\n return this.#protocol.dataStream;\n }\n\n get #protocol(): AirPlay {\n return this.#device[PROTOCOL];\n }\n\n get clients(): Record<string, Client> {\n return this.#clients;\n }\n\n get nowPlayingClient(): Client | null {\n return this.#nowPlayingClientBundleIdentifier ? this.#clients[this.#nowPlayingClientBundleIdentifier] ?? null : null;\n }\n\n get volume(): number {\n return this.#volume;\n }\n\n get volumeAvailable(): boolean {\n return this.#volumeAvailable;\n }\n\n get volumeCapabilities(): Proto.VolumeCapabilities_Enum {\n return this.#volumeCapabilities;\n }\n\n readonly #clients: Record<string, Client> = {};\n readonly #device: Device;\n #nowPlayingClientBundleIdentifier: string;\n #volume: number;\n #volumeAvailable: boolean;\n #volumeCapabilities: Proto.VolumeCapabilities_Enum;\n\n constructor(device: Device) {\n super();\n\n this.#device = device;\n this.#nowPlayingClientBundleIdentifier = null;\n this.#volume = 0;\n\n this.onDeviceInfo = this.onDeviceInfo.bind(this);\n this.onOriginClientProperties = this.onOriginClientProperties.bind(this);\n this.onPlayerClientProperties = this.onPlayerClientProperties.bind(this);\n this.onSendCommandResult = this.onSendCommandResult.bind(this);\n this.onSetArtwork = this.onSetArtwork.bind(this);\n this.onSetDefaultSupportedCommands = this.onSetDefaultSupportedCommands.bind(this);\n this.onSetNowPlayingClient = this.onSetNowPlayingClient.bind(this);\n this.onSetNowPlayingPlayer = this.onSetNowPlayingPlayer.bind(this);\n this.onSetState = this.onSetState.bind(this);\n this.onUpdateClient = this.onUpdateClient.bind(this);\n this.onUpdateContentItem = this.onUpdateContentItem.bind(this);\n this.onUpdateContentItemArtwork = this.onUpdateContentItemArtwork.bind(this);\n this.onUpdatePlayer = this.onUpdatePlayer.bind(this);\n this.onUpdateOutputDevice = this.onUpdateOutputDevice.bind(this);\n this.onVolumeControlAvailability = this.onVolumeControlAvailability.bind(this);\n this.onVolumeControlCapabilitiesDidChange = this.onVolumeControlCapabilitiesDidChange.bind(this);\n this.onVolumeDidChange = this.onVolumeDidChange.bind(this);\n }\n\n async [STATE_SUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.on('deviceInfo', this.onDeviceInfo);\n this.#dataStream.on('originClientProperties', this.onOriginClientProperties);\n this.#dataStream.on('playerClientProperties', this.onPlayerClientProperties);\n this.#dataStream.on('sendCommandResult', this.onSendCommandResult);\n this.#dataStream.on('setArtwork', this.onSetArtwork);\n this.#dataStream.on('setDefaultSupportedCommands', this.onSetDefaultSupportedCommands);\n this.#dataStream.on('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.on('setNowPlayingPlayer', this.onSetNowPlayingPlayer);\n this.#dataStream.on('setState', this.onSetState);\n this.#dataStream.on('updateClient', this.onUpdateClient);\n this.#dataStream.on('updateContentItem', this.onUpdateContentItem);\n this.#dataStream.on('updateContentItemArtwork', this.onUpdateContentItemArtwork);\n this.#dataStream.on('updatePlayer', this.onUpdatePlayer);\n this.#dataStream.on('updateOutputDevice', this.onUpdateOutputDevice);\n this.#dataStream.on('volumeControlAvailability', this.onVolumeControlAvailability);\n this.#dataStream.on('volumeControlCapabilitiesDidChange', this.onVolumeControlCapabilitiesDidChange);\n this.#dataStream.on('volumeDidChange', this.onVolumeDidChange);\n }\n\n async [STATE_UNSUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.off('deviceInfo', this.onDeviceInfo);\n this.#dataStream.off('originClientProperties', this.onOriginClientProperties);\n this.#dataStream.off('playerClientProperties', this.onPlayerClientProperties);\n this.#dataStream.off('sendCommandResult', this.onSendCommandResult);\n this.#dataStream.off('setArtwork', this.onSetArtwork);\n this.#dataStream.off('setDefaultSupportedCommands', this.onSetDefaultSupportedCommands);\n this.#dataStream.off('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.off('setNowPlayingPlayer', this.onSetNowPlayingPlayer);\n this.#dataStream.off('setState', this.onSetState);\n this.#dataStream.off('updateClient', this.onUpdateClient);\n this.#dataStream.off('updateContentItem', this.onUpdateContentItem);\n this.#dataStream.off('updateContentItemArtwork', this.onUpdateContentItemArtwork);\n this.#dataStream.off('updatePlayer', this.onUpdatePlayer);\n this.#dataStream.off('updateOutputDevice', this.onUpdateOutputDevice);\n this.#dataStream.off('volumeControlAvailability', this.onVolumeControlAvailability);\n this.#dataStream.off('volumeControlCapabilitiesDidChange', this.onVolumeControlCapabilitiesDidChange);\n this.#dataStream.off('volumeDidChange', this.onVolumeDidChange);\n }\n\n async onDeviceInfo(message: Proto.DeviceInfoMessage): Promise<void> {\n this.emit('deviceInfo', message);\n }\n\n async onOriginClientProperties(message: Proto.OriginClientPropertiesMessage): Promise<void> {\n this.emit('originClientProperties', message);\n }\n\n async onPlayerClientProperties(message: Proto.PlayerClientPropertiesMessage): Promise<void> {\n this.emit('playerClientProperties', message);\n }\n\n async onSendCommandResult(message: Proto.SendCommandResultMessage): Promise<void> {\n this.emit('sendCommandResult', message);\n }\n\n async onSetArtwork(message: Proto.SetArtworkMessage): Promise<void> {\n this.emit('setArtwork', message);\n }\n\n async onSetDefaultSupportedCommands(message: Proto.SetDefaultSupportedCommandsMessage): Promise<void> {\n this.emit('setDefaultSupportedCommands', message);\n }\n\n async onSetNowPlayingClient(message: Proto.SetNowPlayingClientMessage): Promise<void> {\n this.#nowPlayingClientBundleIdentifier = message.client?.bundleIdentifier ?? null;\n\n this.emit('setNowPlayingClient', this.#nowPlayingClientBundleIdentifier);\n }\n\n async onSetNowPlayingPlayer(message: Proto.SetNowPlayingPlayerMessage): Promise<void> {\n this.emit('setNowPlayingPlayer', message);\n }\n\n async onSetState(message: Proto.SetStateMessage): Promise<void> {\n const client = this.#client(message.playerPath.client.bundleIdentifier, message.displayName);\n\n if (message.playbackState) {\n client.setPlaybackState(message.playbackState, message.playbackStateTimestamp);\n }\n\n if (message.supportedCommands) {\n client.setSupportedCommands(message.supportedCommands.supportedCommands);\n }\n\n if (message.playbackQueue) {\n client.setPlaybackQueue(message.playbackQueue);\n }\n\n this.emit('setState', message);\n }\n\n async onUpdateContentItem(message: Proto.UpdateContentItemMessage): Promise<void> {\n this.emit('updateContentItem', message);\n }\n\n async onUpdateContentItemArtwork(message: Proto.UpdateContentItemArtworkMessage): Promise<void> {\n this.emit('updateContentItemArtwork', message);\n }\n\n async onUpdatePlayer(message: Proto.UpdatePlayerMessage): Promise<void> {\n this.emit('updatePlayer', message);\n }\n\n async onUpdateClient(message: Proto.UpdateClientMessage): Promise<void> {\n this.#client(message.client.bundleIdentifier, message.client.displayName);\n\n this.emit('clients', this.#clients);\n }\n\n async onUpdateOutputDevice(message: Proto.UpdateOutputDeviceMessage): Promise<void> {\n this.emit('updateOutputDevice', message);\n }\n\n async onVolumeControlAvailability(message: Proto.VolumeControlAvailabilityMessage): Promise<void> {\n this.#volumeAvailable = message.volumeControlAvailable;\n this.#volumeCapabilities = message.volumeCapabilities;\n\n this.emit('volumeControlAvailability', message.volumeControlAvailable, message.volumeCapabilities);\n }\n\n async onVolumeControlCapabilitiesDidChange(message: Proto.VolumeControlCapabilitiesDidChangeMessage): Promise<void> {\n this.#volumeAvailable = message.capabilities.volumeControlAvailable;\n this.#volumeCapabilities = message.capabilities.volumeCapabilities;\n\n this.emit('volumeControlCapabilitiesDidChange', message.capabilities.volumeControlAvailable, message.capabilities.volumeCapabilities);\n }\n\n async onVolumeDidChange(message: Proto.VolumeDidChangeMessage): Promise<void> {\n this.#volume = message.volume;\n\n this.emit('volumeDidChange', message.volume);\n }\n\n #client(bundleIdentifier: string, displayName: string): Client {\n if (bundleIdentifier in this.#clients) {\n return this.#clients[bundleIdentifier];\n } else {\n const client = new Client(bundleIdentifier, displayName);\n this.#clients[bundleIdentifier] = client;\n\n this.emit('clients', this.#clients);\n\n return client;\n }\n }\n}\n",
7
+ "import { EventEmitter } from 'node:events';\nimport type { AirPlay, AirPlayDataStream, Proto } from '@basmilius/apple-airplay';\nimport { PROTOCOL, STATE_SUBSCRIBE_SYMBOL, STATE_UNSUBSCRIBE_SYMBOL } from './const';\nimport Client from './client';\nimport type Device from './device';\n\ntype EventMap = {\n readonly clients: [Record<string, Client>];\n readonly deviceInfo: [Proto.DeviceInfoMessage];\n readonly originClientProperties: [Proto.OriginClientPropertiesMessage];\n readonly playerClientProperties: [Proto.PlayerClientPropertiesMessage];\n readonly sendCommandResult: [Proto.SendCommandResultMessage];\n readonly setArtwork: [Proto.SetArtworkMessage];\n readonly setDefaultSupportedCommands: [Proto.SetDefaultSupportedCommandsMessage];\n readonly setNowPlayingClient: [Proto.SetNowPlayingClientMessage];\n readonly setNowPlayingPlayer: [Proto.SetNowPlayingPlayerMessage];\n readonly setState: [Proto.SetStateMessage];\n readonly updateClient: [Proto.UpdateClientMessage];\n readonly updateContentItem: [Proto.UpdateContentItemMessage];\n readonly updateContentItemArtwork: [Proto.UpdateContentItemArtworkMessage];\n readonly updatePlayer: [Proto.UpdatePlayerMessage];\n readonly updateOutputDevice: [Proto.UpdateOutputDeviceMessage];\n readonly volumeControlAvailability: [boolean, Proto.VolumeCapabilities_Enum];\n readonly volumeControlCapabilitiesDidChange: [boolean, Proto.VolumeCapabilities_Enum];\n readonly volumeDidChange: [number];\n};\n\nexport default class extends EventEmitter<EventMap> {\n get #dataStream(): AirPlayDataStream {\n return this.#protocol.dataStream;\n }\n\n get #protocol(): AirPlay {\n return this.#device[PROTOCOL];\n }\n\n get clients(): Record<string, Client> {\n return this.#clients;\n }\n\n get nowPlayingClient(): Client | null {\n return this.#nowPlayingClientBundleIdentifier ? this.#clients[this.#nowPlayingClientBundleIdentifier] ?? null : null;\n }\n\n get volume(): number {\n return this.#volume;\n }\n\n get volumeAvailable(): boolean {\n return this.#volumeAvailable;\n }\n\n get volumeCapabilities(): Proto.VolumeCapabilities_Enum {\n return this.#volumeCapabilities;\n }\n\n readonly #clients: Record<string, Client> = {};\n readonly #device: Device;\n #nowPlayingClientBundleIdentifier: string;\n #volume: number;\n #volumeAvailable: boolean;\n #volumeCapabilities: Proto.VolumeCapabilities_Enum;\n\n constructor(device: Device) {\n super();\n\n this.#device = device;\n this.#nowPlayingClientBundleIdentifier = null;\n this.#volume = 0;\n\n this.onDeviceInfo = this.onDeviceInfo.bind(this);\n this.onOriginClientProperties = this.onOriginClientProperties.bind(this);\n this.onPlayerClientProperties = this.onPlayerClientProperties.bind(this);\n this.onSendCommandResult = this.onSendCommandResult.bind(this);\n this.onSetArtwork = this.onSetArtwork.bind(this);\n this.onSetDefaultSupportedCommands = this.onSetDefaultSupportedCommands.bind(this);\n this.onSetNowPlayingClient = this.onSetNowPlayingClient.bind(this);\n this.onSetNowPlayingPlayer = this.onSetNowPlayingPlayer.bind(this);\n this.onSetState = this.onSetState.bind(this);\n this.onUpdateClient = this.onUpdateClient.bind(this);\n this.onUpdateContentItem = this.onUpdateContentItem.bind(this);\n this.onUpdateContentItemArtwork = this.onUpdateContentItemArtwork.bind(this);\n this.onUpdatePlayer = this.onUpdatePlayer.bind(this);\n this.onUpdateOutputDevice = this.onUpdateOutputDevice.bind(this);\n this.onVolumeControlAvailability = this.onVolumeControlAvailability.bind(this);\n this.onVolumeControlCapabilitiesDidChange = this.onVolumeControlCapabilitiesDidChange.bind(this);\n this.onVolumeDidChange = this.onVolumeDidChange.bind(this);\n }\n\n async [STATE_SUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.on('deviceInfo', this.onDeviceInfo);\n this.#dataStream.on('originClientProperties', this.onOriginClientProperties);\n this.#dataStream.on('playerClientProperties', this.onPlayerClientProperties);\n this.#dataStream.on('sendCommandResult', this.onSendCommandResult);\n this.#dataStream.on('setArtwork', this.onSetArtwork);\n this.#dataStream.on('setDefaultSupportedCommands', this.onSetDefaultSupportedCommands);\n this.#dataStream.on('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.on('setNowPlayingPlayer', this.onSetNowPlayingPlayer);\n this.#dataStream.on('setState', this.onSetState);\n this.#dataStream.on('updateClient', this.onUpdateClient);\n this.#dataStream.on('updateContentItem', this.onUpdateContentItem);\n this.#dataStream.on('updateContentItemArtwork', this.onUpdateContentItemArtwork);\n this.#dataStream.on('updatePlayer', this.onUpdatePlayer);\n this.#dataStream.on('updateOutputDevice', this.onUpdateOutputDevice);\n this.#dataStream.on('volumeControlAvailability', this.onVolumeControlAvailability);\n this.#dataStream.on('volumeControlCapabilitiesDidChange', this.onVolumeControlCapabilitiesDidChange);\n this.#dataStream.on('volumeDidChange', this.onVolumeDidChange);\n }\n\n async [STATE_UNSUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.off('deviceInfo', this.onDeviceInfo);\n this.#dataStream.off('originClientProperties', this.onOriginClientProperties);\n this.#dataStream.off('playerClientProperties', this.onPlayerClientProperties);\n this.#dataStream.off('sendCommandResult', this.onSendCommandResult);\n this.#dataStream.off('setArtwork', this.onSetArtwork);\n this.#dataStream.off('setDefaultSupportedCommands', this.onSetDefaultSupportedCommands);\n this.#dataStream.off('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.off('setNowPlayingPlayer', this.onSetNowPlayingPlayer);\n this.#dataStream.off('setState', this.onSetState);\n this.#dataStream.off('updateClient', this.onUpdateClient);\n this.#dataStream.off('updateContentItem', this.onUpdateContentItem);\n this.#dataStream.off('updateContentItemArtwork', this.onUpdateContentItemArtwork);\n this.#dataStream.off('updatePlayer', this.onUpdatePlayer);\n this.#dataStream.off('updateOutputDevice', this.onUpdateOutputDevice);\n this.#dataStream.off('volumeControlAvailability', this.onVolumeControlAvailability);\n this.#dataStream.off('volumeControlCapabilitiesDidChange', this.onVolumeControlCapabilitiesDidChange);\n this.#dataStream.off('volumeDidChange', this.onVolumeDidChange);\n }\n\n async onDeviceInfo(message: Proto.DeviceInfoMessage): Promise<void> {\n this.emit('deviceInfo', message);\n }\n\n async onOriginClientProperties(message: Proto.OriginClientPropertiesMessage): Promise<void> {\n this.emit('originClientProperties', message);\n }\n\n async onPlayerClientProperties(message: Proto.PlayerClientPropertiesMessage): Promise<void> {\n this.emit('playerClientProperties', message);\n }\n\n async onSendCommandResult(message: Proto.SendCommandResultMessage): Promise<void> {\n this.emit('sendCommandResult', message);\n }\n\n async onSetArtwork(message: Proto.SetArtworkMessage): Promise<void> {\n this.emit('setArtwork', message);\n }\n\n async onSetDefaultSupportedCommands(message: Proto.SetDefaultSupportedCommandsMessage): Promise<void> {\n this.emit('setDefaultSupportedCommands', message);\n }\n\n async onSetNowPlayingClient(message: Proto.SetNowPlayingClientMessage): Promise<void> {\n this.#nowPlayingClientBundleIdentifier = message.client?.bundleIdentifier ?? null;\n\n this.emit('setNowPlayingClient', message);\n }\n\n async onSetNowPlayingPlayer(message: Proto.SetNowPlayingPlayerMessage): Promise<void> {\n this.emit('setNowPlayingPlayer', message);\n }\n\n async onSetState(message: Proto.SetStateMessage): Promise<void> {\n const client = this.#client(message.playerPath.client.bundleIdentifier, message.displayName);\n\n if (message.playbackState) {\n client.setPlaybackState(message.playbackState, message.playbackStateTimestamp);\n }\n\n if (message.supportedCommands) {\n client.setSupportedCommands(message.supportedCommands.supportedCommands);\n }\n\n if (message.playbackQueue) {\n client.setPlaybackQueue(message.playbackQueue);\n }\n\n this.emit('setState', message);\n }\n\n async onUpdateContentItem(message: Proto.UpdateContentItemMessage): Promise<void> {\n this.emit('updateContentItem', message);\n }\n\n async onUpdateContentItemArtwork(message: Proto.UpdateContentItemArtworkMessage): Promise<void> {\n this.emit('updateContentItemArtwork', message);\n }\n\n async onUpdatePlayer(message: Proto.UpdatePlayerMessage): Promise<void> {\n this.emit('updatePlayer', message);\n }\n\n async onUpdateClient(message: Proto.UpdateClientMessage): Promise<void> {\n this.#client(message.client.bundleIdentifier, message.client.displayName);\n\n this.emit('clients', this.#clients);\n }\n\n async onUpdateOutputDevice(message: Proto.UpdateOutputDeviceMessage): Promise<void> {\n this.emit('updateOutputDevice', message);\n }\n\n async onVolumeControlAvailability(message: Proto.VolumeControlAvailabilityMessage): Promise<void> {\n this.#volumeAvailable = message.volumeControlAvailable;\n this.#volumeCapabilities = message.volumeCapabilities;\n\n this.emit('volumeControlAvailability', message.volumeControlAvailable, message.volumeCapabilities);\n }\n\n async onVolumeControlCapabilitiesDidChange(message: Proto.VolumeControlCapabilitiesDidChangeMessage): Promise<void> {\n this.#volumeAvailable = message.capabilities.volumeControlAvailable;\n this.#volumeCapabilities = message.capabilities.volumeCapabilities;\n\n this.emit('volumeControlCapabilitiesDidChange', message.capabilities.volumeControlAvailable, message.capabilities.volumeCapabilities);\n }\n\n async onVolumeDidChange(message: Proto.VolumeDidChangeMessage): Promise<void> {\n this.#volume = message.volume;\n\n this.emit('volumeDidChange', message.volume);\n }\n\n #client(bundleIdentifier: string, displayName: string): Client {\n if (bundleIdentifier in this.#clients) {\n return this.#clients[bundleIdentifier];\n } else {\n const client = new Client(bundleIdentifier, displayName);\n this.#clients[bundleIdentifier] = client;\n\n this.emit('clients', this.#clients);\n\n return client;\n }\n }\n}\n",
8
8
  "import { Proto } from '@basmilius/apple-airplay';\n\nexport default class Client {\n get bundleIdentifier(): string {\n return this.#bundleIdentifier;\n }\n\n get displayName(): string {\n return this.#displayName;\n }\n\n get playbackQueue(): Proto.PlaybackQueue | null {\n return this.#playbackQueue;\n }\n\n get playbackState(): Proto.PlaybackState_Enum {\n return this.#playbackState;\n }\n\n get playbackStateTimestamp(): number {\n return this.#playbackStateTimestamp;\n }\n\n get supportedCommands(): Proto.CommandInfo[] {\n return this.#supportedCommands;\n }\n\n readonly #bundleIdentifier: string;\n readonly #displayName: string;\n #playbackQueue: Proto.PlaybackQueue | null = null;\n #playbackState: Proto.PlaybackState_Enum;\n #playbackStateTimestamp: number;\n #supportedCommands: Proto.CommandInfo[] = [];\n\n constructor(bundleIdentifier: string, displayName: string) {\n this.#bundleIdentifier = bundleIdentifier;\n this.#displayName = displayName;\n this.#playbackState = Proto.PlaybackState_Enum.Unknown;\n this.#supportedCommands = [];\n }\n\n isCommandSupported(command: Proto.Command): boolean {\n return this.#supportedCommands.some(c => c.command === command);\n }\n\n setPlaybackQueue(playbackQueue: Proto.PlaybackQueue): void {\n this.#playbackQueue = playbackQueue;\n }\n\n setPlaybackState(playbackState: Proto.PlaybackState_Enum, playbackStateTimestamp: number): void {\n this.#playbackState = playbackState;\n this.#playbackStateTimestamp = playbackStateTimestamp;\n }\n\n setSupportedCommands(supportedCommands: Proto.CommandInfo[]): void {\n this.#supportedCommands = supportedCommands;\n }\n}\n",
9
9
  "export const PROTOCOL = Symbol('com.basmilius.companion-link:protocol');\n",
10
- "import { EventEmitter } from 'node:events';\nimport { CompanionLink, type CompanionLinkApi } from '@basmilius/apple-companion-link';\nimport { type AccessoryCredentials, type AccessoryKeys, debug, type DiscoveryResult } from '@basmilius/apple-common';\nimport { PROTOCOL } from './const';\n\ntype EventMap = {\n connected: [];\n disconnected: [unexpected: boolean];\n power: [boolean];\n};\n\ntype CLAPI = typeof CompanionLinkApi.prototype;\n\nexport type ButtonPressType = Parameters<CLAPI['pressButton']>[1];\nexport type HidCommand = Parameters<CLAPI['pressButton']>[0];\nexport type MediaControlCommand = Parameters<CLAPI['mediaControlCommand']>[0];\n\nexport default class extends EventEmitter<EventMap> {\n get [PROTOCOL](): CompanionLink {\n return this.#protocol;\n }\n\n get isConnected(): boolean {\n return this.#protocol?.socket?.isConnected ?? false;\n }\n\n #credentials?: AccessoryCredentials;\n #disconnect: boolean = false;\n #discoveryResult: DiscoveryResult;\n #keys: AccessoryKeys;\n #protocol!: CompanionLink;\n\n constructor(discoveryResult: DiscoveryResult) {\n super();\n\n this.#discoveryResult = discoveryResult;\n\n this.onSystemStatus = this.onSystemStatus.bind(this);\n this.onTVSystemStatus = this.onTVSystemStatus.bind(this);\n }\n\n async connect(): Promise<void> {\n if (!this.#credentials) {\n throw new Error('Credentials are required to connect to a Companion Link device.');\n }\n\n this.#disconnect = false;\n this.#protocol = new CompanionLink(this.#discoveryResult);\n\n await this.#protocol.connect();\n this.#keys = await this.#protocol.verify.start(this.#credentials);\n\n this.#protocol.socket.on('close', async () => this.#onClose());\n\n await this.#setup();\n\n this.emit('connected');\n }\n\n async disconnect(): Promise<void> {\n this.#disconnect = true;\n\n await this.#unsubscribe();\n await this.#protocol.disconnect();\n\n this.emit('disconnected', false);\n }\n\n async setCredentials(credentials: AccessoryCredentials): Promise<void> {\n this.#credentials = credentials;\n }\n\n async setDiscoveryResult(discoveryResult: DiscoveryResult): Promise<void> {\n this.#discoveryResult = discoveryResult;\n }\n\n async getAttentionState(): ReturnType<CLAPI['getAttentionState']> {\n return await this.#protocol.api.getAttentionState();\n }\n\n async getLaunchableApps(): ReturnType<CLAPI['getLaunchableApps']> {\n return await this.#protocol.api.getLaunchableApps();\n }\n\n async getUserAccounts(): ReturnType<CLAPI['getUserAccounts']> {\n return await this.#protocol.api.getUserAccounts();\n }\n\n async launchApp(bundleId: string): Promise<void> {\n await this.#protocol.api.launchApp(bundleId);\n }\n\n async launchUrl(url: string): Promise<void> {\n await this.#protocol.api.launchUrl(url);\n }\n\n async mediaControlCommand(command: MediaControlCommand, content?: object): Promise<void> {\n await this.#protocol.api.mediaControlCommand(command, content);\n }\n\n async pressButton(command: HidCommand, type?: ButtonPressType, holdDelayMs?: number): Promise<void> {\n await this.#protocol.api.pressButton(command, type, holdDelayMs);\n }\n\n async switchUserAccount(accountId: string): Promise<void> {\n await this.#protocol.api.switchUserAccount(accountId);\n }\n\n async #onClose(): Promise<void> {\n if (this.#disconnect) {\n return;\n }\n\n this.emit('disconnected', true);\n }\n\n async #setup(): Promise<void> {\n const keys = this.#keys;\n\n await this.#protocol.socket.enableEncryption(\n keys.accessoryToControllerKey,\n keys.controllerToAccessoryKey\n );\n\n await this.#protocol.api._systemInfo(this.#credentials.pairingId);\n await this.#protocol.api._touchStart();\n await this.#protocol.api._sessionStart();\n await this.#protocol.api._tvrcSessionStart();\n await this.#protocol.api._unsubscribe('_iMC');\n\n await this.#subscribe();\n }\n\n async #subscribe(): Promise<void> {\n await this.#protocol.api._subscribe('SystemStatus', this.onSystemStatus);\n await this.#protocol.api._subscribe('TVSystemStatus', this.onTVSystemStatus);\n\n const state = await this.getAttentionState();\n this.emit('power', state === 'awake' || state === 'screensaver');\n }\n\n async #unsubscribe(): Promise<void> {\n await this.#protocol.api._unsubscribe('SystemStatus', this.onSystemStatus);\n await this.#protocol.api._unsubscribe('TVSystemStatus', this.onTVSystemStatus);\n }\n\n async onSystemStatus(data: { readonly state: number; }): Promise<void> {\n debug('System Status', data);\n this.emit('power', data.state === 0x02 || data.state === 0x03);\n }\n\n async onTVSystemStatus(data: { readonly state: number; }): Promise<void> {\n debug('TV System Status', data);\n this.emit('power', data.state === 0x02 || data.state === 0x03);\n }\n}\n",
10
+ "import { EventEmitter } from 'node:events';\nimport { CompanionLink, type CompanionLinkApi } from '@basmilius/apple-companion-link';\nimport { type AccessoryCredentials, type AccessoryKeys, debug, type DiscoveryResult } from '@basmilius/apple-common';\nimport { PROTOCOL } from './const';\n\ntype EventMap = {\n connected: [];\n disconnected: [unexpected: boolean];\n power: [boolean];\n};\n\ntype CLAPI = typeof CompanionLinkApi.prototype;\n\nexport type ButtonPressType = Parameters<CLAPI['pressButton']>[1];\nexport type HidCommand = Parameters<CLAPI['pressButton']>[0];\nexport type MediaControlCommand = Parameters<CLAPI['mediaControlCommand']>[0];\n\nexport default class extends EventEmitter<EventMap> {\n get [PROTOCOL](): CompanionLink {\n return this.#protocol;\n }\n\n get isConnected(): boolean {\n return this.#protocol?.socket?.isConnected ?? false;\n }\n\n #credentials?: AccessoryCredentials;\n #disconnect: boolean = false;\n #discoveryResult: DiscoveryResult;\n #keys: AccessoryKeys;\n #protocol!: CompanionLink;\n\n constructor(discoveryResult: DiscoveryResult) {\n super();\n\n this.#discoveryResult = discoveryResult;\n\n this.onSystemStatus = this.onSystemStatus.bind(this);\n this.onTVSystemStatus = this.onTVSystemStatus.bind(this);\n }\n\n async connect(): Promise<void> {\n if (!this.#credentials) {\n throw new Error('Credentials are required to connect to a Companion Link device.');\n }\n\n this.#disconnect = false;\n this.#protocol = new CompanionLink(this.#discoveryResult);\n this.#protocol.socket.on('close', async () => this.#onClose());\n this.#protocol.socket.on('error', async (err: Error) => this.#onError(err));\n\n await this.#protocol.connect();\n this.#keys = await this.#protocol.verify.start(this.#credentials);\n\n await this.#setup();\n\n this.emit('connected');\n }\n\n async disconnect(): Promise<void> {\n this.#disconnect = true;\n\n await this.#unsubscribe();\n await this.#protocol.disconnect();\n\n this.emit('disconnected', false);\n }\n\n async setCredentials(credentials: AccessoryCredentials): Promise<void> {\n this.#credentials = credentials;\n }\n\n async setDiscoveryResult(discoveryResult: DiscoveryResult): Promise<void> {\n this.#discoveryResult = discoveryResult;\n }\n\n async getAttentionState(): ReturnType<CLAPI['getAttentionState']> {\n return await this.#protocol.api.getAttentionState();\n }\n\n async getLaunchableApps(): ReturnType<CLAPI['getLaunchableApps']> {\n return await this.#protocol.api.getLaunchableApps();\n }\n\n async getUserAccounts(): ReturnType<CLAPI['getUserAccounts']> {\n return await this.#protocol.api.getUserAccounts();\n }\n\n async launchApp(bundleId: string): Promise<void> {\n await this.#protocol.api.launchApp(bundleId);\n }\n\n async launchUrl(url: string): Promise<void> {\n await this.#protocol.api.launchUrl(url);\n }\n\n async mediaControlCommand(command: MediaControlCommand, content?: object): Promise<void> {\n await this.#protocol.api.mediaControlCommand(command, content);\n }\n\n async pressButton(command: HidCommand, type?: ButtonPressType, holdDelayMs?: number): Promise<void> {\n await this.#protocol.api.pressButton(command, type, holdDelayMs);\n }\n\n async switchUserAccount(accountId: string): Promise<void> {\n await this.#protocol.api.switchUserAccount(accountId);\n }\n\n async #onClose(): Promise<void> {\n if (this.#disconnect) {\n return;\n }\n\n this.emit('disconnected', true);\n }\n\n async #onError(err: Error): Promise<void> {\n debug('Companion Link error', err);\n\n try {\n await this.disconnect();\n } catch (_) {\n }\n\n this.emit('disconnected', true);\n }\n\n async #setup(): Promise<void> {\n const keys = this.#keys;\n\n await this.#protocol.socket.enableEncryption(\n keys.accessoryToControllerKey,\n keys.controllerToAccessoryKey\n );\n\n await this.#protocol.api._systemInfo(this.#credentials.pairingId);\n await this.#protocol.api._touchStart();\n await this.#protocol.api._sessionStart();\n await this.#protocol.api._tvrcSessionStart();\n await this.#protocol.api._unsubscribe('_iMC');\n\n await this.#subscribe();\n }\n\n async #subscribe(): Promise<void> {\n await this.#protocol.api._subscribe('SystemStatus', this.onSystemStatus);\n await this.#protocol.api._subscribe('TVSystemStatus', this.onTVSystemStatus);\n\n const state = await this.getAttentionState();\n this.emit('power', state === 'awake' || state === 'screensaver');\n }\n\n async #unsubscribe(): Promise<void> {\n await this.#protocol.api._unsubscribe('SystemStatus', this.onSystemStatus);\n await this.#protocol.api._unsubscribe('TVSystemStatus', this.onTVSystemStatus);\n }\n\n async onSystemStatus(data: { readonly state: number; }): Promise<void> {\n debug('System Status', data);\n this.emit('power', data.state === 0x02 || data.state === 0x03);\n }\n\n async onTVSystemStatus(data: { readonly state: number; }): Promise<void> {\n debug('TV System Status', data);\n this.emit('power', data.state === 0x02 || data.state === 0x03);\n }\n}\n",
11
11
  "import { EventEmitter } from 'node:events';\nimport { Proto } from '@basmilius/apple-airplay';\nimport type { AccessoryCredentials, DiscoveryResult } from '@basmilius/apple-common';\nimport { AirPlayDevice } from '../airplay';\nimport { CompanionLinkDevice } from '../companion-link';\n\ntype EventMap = {\n connected: [];\n disconnected: [unexpected: boolean];\n};\n\nexport default class extends EventEmitter<EventMap> {\n get airplay(): AirPlayDevice {\n return this.#airplay;\n }\n\n get companionLink(): CompanionLinkDevice {\n return this.#companionLink;\n }\n\n get bundleIdentifier(): string | null {\n return this.#airplay.state.nowPlayingClient?.bundleIdentifier ?? null;\n }\n\n get displayName(): string | null {\n return this.#airplay.state.nowPlayingClient?.displayName ?? null;\n }\n\n get isConnected(): boolean {\n return this.#airplay.isConnected && this.#companionLink.isConnected;\n }\n\n get playbackQueue(): Proto.PlaybackQueue | null {\n return this.#airplay.state.nowPlayingClient?.playbackQueue ?? null;\n }\n\n get playbackState(): Proto.PlaybackState_Enum {\n return this.#airplay.state.nowPlayingClient?.playbackState ?? Proto.PlaybackState_Enum.Unknown;\n }\n\n get playbackStateTimestamp(): number {\n return this.#airplay.state.nowPlayingClient?.playbackStateTimestamp ?? -1;\n }\n\n readonly #airplay: AirPlayDevice;\n readonly #companionLink: CompanionLinkDevice;\n #disconnect: boolean = false;\n\n constructor(airplayDiscoveryResult: DiscoveryResult, companionLinkDiscoveryResult: DiscoveryResult) {\n super();\n\n this.#airplay = new AirPlayDevice(airplayDiscoveryResult);\n this.#companionLink = new CompanionLinkDevice(companionLinkDiscoveryResult);\n\n this.#airplay.on('connected', () => this.#onConnected());\n this.#airplay.on('disconnected', unexpected => this.#onDisconnected(unexpected));\n this.#companionLink.on('connected', () => this.#onConnected());\n this.#companionLink.on('disconnected', unexpected => this.#onDisconnected(unexpected));\n }\n\n async connect(credentials: AccessoryCredentials): Promise<void> {\n await this.#airplay.setCredentials(credentials);\n await this.#companionLink.setCredentials(credentials);\n\n await this.#airplay.connect();\n await this.#companionLink.connect();\n\n this.#disconnect = false;\n }\n\n async disconnect(): Promise<void> {\n await this.#airplay.disconnect();\n await this.#companionLink.disconnect();\n }\n\n async turnOff(): Promise<void> {\n await this.#companionLink.pressButton('Sleep');\n }\n\n async turnOn(): Promise<void> {\n await this.#companionLink.pressButton('Wake');\n }\n\n async pause(): Promise<void> {\n await this.#companionLink.mediaControlCommand('Pause');\n }\n\n async playPause(): Promise<void> {\n await this.#companionLink.pressButton('PlayPause');\n }\n\n async play(): Promise<void> {\n await this.#companionLink.mediaControlCommand('Play');\n }\n\n async stop(): Promise<void> {\n await this.#airplay.sendCommand(Proto.Command.Stop);\n }\n\n async next(): Promise<void> {\n await this.#companionLink.mediaControlCommand('NextTrack');\n }\n\n async previous(): Promise<void> {\n await this.#companionLink.mediaControlCommand('PreviousTrack');\n }\n\n async volumeDown(): Promise<void> {\n await this.#companionLink.pressButton('VolumeDown');\n }\n\n async volumeMute(): Promise<void> {\n await this.#companionLink.pressButton('PageUp');\n }\n\n async volumeUp(): Promise<void> {\n await this.#companionLink.pressButton('VolumeUp');\n }\n\n async getCommandInfo(command: Proto.Command): Promise<Proto.CommandInfo | null> {\n const client = this.#airplay.state.nowPlayingClient;\n\n if (!client) {\n return null;\n }\n\n return client.supportedCommands.find(c => c.command === command) ?? null;\n }\n\n async isCommandSupported(command: Proto.Command): Promise<boolean> {\n const client = this.#airplay.state.nowPlayingClient;\n\n if (!client) {\n return false;\n }\n\n return client.isCommandSupported(command);\n }\n\n async #onConnected(): Promise<void> {\n if (!this.#airplay.isConnected || !this.#companionLink.isConnected) {\n return;\n }\n\n this.emit('connected');\n }\n\n async #onDisconnected(unexpected: boolean): Promise<void> {\n if (this.#disconnect) {\n return;\n }\n\n this.#disconnect = true;\n\n await this.disconnect();\n this.emit('disconnected', unexpected);\n }\n}\n",
12
12
  "import { EventEmitter } from 'node:events';\nimport { Proto } from '@basmilius/apple-airplay';\nimport type { DiscoveryResult } from '@basmilius/apple-common';\nimport { AirPlayDevice } from '../airplay';\n\ntype EventMap = {\n connected: [];\n disconnected: [unexpected: boolean];\n};\n\nexport default abstract class extends EventEmitter<EventMap> {\n get airplay(): AirPlayDevice {\n return this.#airplay;\n }\n\n get bundleIdentifier(): string | null {\n return this.#airplay.state.nowPlayingClient?.bundleIdentifier ?? null;\n }\n\n get displayName(): string | null {\n return this.#airplay.state.nowPlayingClient?.displayName ?? null;\n }\n\n get isConnected(): boolean {\n return this.#airplay.isConnected;\n }\n\n get playbackQueue(): Proto.PlaybackQueue | null {\n return this.#airplay.state.nowPlayingClient?.playbackQueue ?? null;\n }\n\n get playbackState(): Proto.PlaybackState_Enum {\n return this.#airplay.state.nowPlayingClient?.playbackState ?? Proto.PlaybackState_Enum.Unknown;\n }\n\n get playbackStateTimestamp(): number {\n return this.#airplay.state.nowPlayingClient?.playbackStateTimestamp ?? -1;\n }\n\n get volume(): number {\n return this.#airplay.state.volume ?? 0;\n }\n\n readonly #airplay: AirPlayDevice;\n #disconnect: boolean = false;\n\n constructor(discoveryResult: DiscoveryResult) {\n super();\n\n this.#airplay = new AirPlayDevice(discoveryResult);\n this.#airplay.on('connected', () => this.#onConnected());\n this.#airplay.on('disconnected', unexpected => this.#onDisconnected(unexpected));\n }\n\n async connect(): Promise<void> {\n await this.#airplay.connect();\n this.#disconnect = false;\n }\n\n async disconnect(): Promise<void> {\n await this.#airplay.disconnect();\n }\n\n async pause(): Promise<void> {\n await this.#airplay.sendCommand(Proto.Command.Pause);\n }\n\n async playPause(): Promise<void> {\n await this.#airplay.sendCommand(Proto.Command.TogglePlayPause);\n }\n\n async play(): Promise<void> {\n await this.#airplay.sendCommand(Proto.Command.Play);\n }\n\n async stop(): Promise<void> {\n await this.#airplay.sendCommand(Proto.Command.Stop);\n }\n\n async next(): Promise<void> {\n await this.#airplay.sendCommand(Proto.Command.NextInContext);\n }\n\n async previous(): Promise<void> {\n await this.#airplay.sendCommand(Proto.Command.PreviousInContext);\n }\n\n async setVolume(volume: number): Promise<void> {\n await this.#airplay.setVolume(volume);\n }\n\n async getCommandInfo(command: Proto.Command): Promise<Proto.CommandInfo | null> {\n const client = this.#airplay.state.nowPlayingClient;\n\n if (!client) {\n return null;\n }\n\n return client.supportedCommands.find(c => c.command === command) ?? null;\n }\n\n async isCommandSupported(command: Proto.Command): Promise<boolean> {\n const client = this.#airplay.state.nowPlayingClient;\n\n if (!client) {\n return false;\n }\n\n return client.isCommandSupported(command);\n }\n\n async #onConnected(): Promise<void> {\n this.emit('connected');\n }\n\n async #onDisconnected(unexpected: boolean): Promise<void> {\n if (this.#disconnect) {\n return;\n }\n\n this.#disconnect = true;\n\n await this.disconnect();\n this.emit('disconnected', unexpected);\n }\n}\n",
13
13
  "import HomePodBase from './homepod-base';\n\nexport default class extends HomePodBase {}\n",
14
14
  "import HomePodBase from './homepod-base';\n\nexport default class extends HomePodBase {}\n"
15
15
  ],
16
- "mappings": "AAAO,IAAM,EAAoB,KAEpB,EAAW,OAAO,gCAAgC,EAClD,EAAyB,OAAO,iCAAiC,EACjE,EAA2B,OAAO,mCAAmC,ECJ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A0C,CAC/D,IAAM,EAAS,KAAK,GAAS,MAAM,iBAEnC,GAAI,CAAC,EACD,MAAO,GAGX,OAAO,EAAO,mBAAmB,CAAO,OAGtC,EAAY,EAAkB,CAChC,KAAK,KAAK,WAAW,OAGnB,EAAe,CAAC,EAAoC,CACtD,GAAI,KAAK,GACL,OAGJ,KAAK,GAAc,GAEnB,MAAM,KAAK,WAAW,EACtB,KAAK,KAAK,eAAgB,CAAU,EAE5C,CC3HA,MAAO,UAAsB,CAAY,CAAC,CCA1C,MAAO,UAAsB,CAAY,CAAC",
17
+ "debugId": "7CBDAA32E87B6E1964756E2164756E21",
18
18
  "names": []
19
19
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@basmilius/apple-devices",
3
3
  "description": "Exposes various Apple devices to connect with either AirPlay or Companion Link.",
4
- "version": "0.0.44",
4
+ "version": "0.0.45",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -43,9 +43,9 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@basmilius/apple-airplay": "0.0.44",
47
- "@basmilius/apple-common": "0.0.44",
48
- "@basmilius/apple-companion-link": "0.0.44"
46
+ "@basmilius/apple-airplay": "0.0.45",
47
+ "@basmilius/apple-common": "0.0.45",
48
+ "@basmilius/apple-companion-link": "0.0.45"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@basmilius/tools": "^2.13.0",