@basmilius/apple-devices 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/airplay/client.d.ts +15 -0
- package/dist/airplay/const.d.ts +4 -0
- package/dist/airplay/device.d.ts +10 -0
- package/dist/airplay/index.d.ts +1 -0
- package/dist/airplay/state.d.ts +19 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +16 -0
- package/dist/model/homepod-base.d.ts +8 -0
- package/dist/model/homepod-mini.d.ts +2 -0
- package/dist/model/homepod.d.ts +2 -0
- package/dist/model/index.d.ts +2 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.js +4 -0
- package/dist/test.js.map +17 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 Bas Milius
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Proto } from "@basmilius/apple-airplay";
|
|
2
|
+
export default class Client {
|
|
3
|
+
#private;
|
|
4
|
+
get bundleIdentifier(): string;
|
|
5
|
+
get displayName(): string;
|
|
6
|
+
get playbackQueue(): Proto.PlaybackQueue | null;
|
|
7
|
+
get playbackState(): Proto.PlaybackState_Enum;
|
|
8
|
+
get playbackStateTimestamp(): number;
|
|
9
|
+
get supportedCommands(): Proto.CommandInfo[];
|
|
10
|
+
constructor(bundleIdentifier: string, displayName: string);
|
|
11
|
+
isCommandSupported(command: Proto.Command): boolean;
|
|
12
|
+
setPlaybackQueue(playbackQueue: Proto.PlaybackQueue): void;
|
|
13
|
+
setPlaybackState(playbackState: Proto.PlaybackState_Enum, playbackStateTimestamp: number): void;
|
|
14
|
+
setSupportedCommands(supportedCommands: Proto.CommandInfo[]): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
import type { DiscoveryResult } from "@basmilius/apple-common";
|
|
3
|
+
import State from "./state";
|
|
4
|
+
export default class extends EventEmitter {
|
|
5
|
+
#private;
|
|
6
|
+
get state(): State;
|
|
7
|
+
constructor(discoveryResult: DiscoveryResult);
|
|
8
|
+
connect(): Promise<void>;
|
|
9
|
+
disconnect(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AirPlayDevice } from "./device";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
import type { Proto } from "@basmilius/apple-airplay";
|
|
3
|
+
import Client from "./client";
|
|
4
|
+
import type Device from "./device";
|
|
5
|
+
type EventMap = {
|
|
6
|
+
readonly clients: [Record<string, Client>];
|
|
7
|
+
readonly nowPlayingClient: [string | null];
|
|
8
|
+
readonly setState: [Proto.SetStateMessage];
|
|
9
|
+
};
|
|
10
|
+
export default class extends EventEmitter<EventMap> {
|
|
11
|
+
#private;
|
|
12
|
+
get clients(): Record<string, Client>;
|
|
13
|
+
get nowPlayingClient(): Client | null;
|
|
14
|
+
get nowPlayingClientBundleIdentifier(): string | null;
|
|
15
|
+
constructor(device: Device);
|
|
16
|
+
onSetNowPlayingClient(message: Proto.SetNowPlayingClientMessage): Promise<void>;
|
|
17
|
+
onSetState(message: Proto.SetStateMessage): Promise<void>;
|
|
18
|
+
onUpdateClient(message: Proto.UpdateClientMessage): Promise<void>;
|
|
19
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{EventEmitter as i}from"node:events";import{AirPlay as A}from"@basmilius/apple-airplay";var y=2000,t=Symbol("com.basmilius.airplay:protocol"),u=Symbol("com.basmilius.airplay-state:subscribe"),p=Symbol("com.basmilius.airplay-state:unsubscribe");import{EventEmitter as c}from"node:events";import{Proto as x}from"@basmilius/apple-airplay";class P{get bundleIdentifier(){return this.#o}get displayName(){return this.#r}get playbackQueue(){return this.#t}get playbackState(){return this.#p}get playbackStateTimestamp(){return this.#u}get supportedCommands(){return this.#P}#o;#r;#t=null;#p;#u;#P=[];constructor(o,r){this.#o=o,this.#r=r,this.#p=x.PlaybackState_Enum.Unknown,this.#P=[]}isCommandSupported(o){return this.#P.some((r)=>r.command===o)}setPlaybackQueue(o){this.#t=o}setPlaybackState(o,r){this.#p=o,this.#u=r}setSupportedCommands(o){this.#P=o}}class a extends c{get#o(){return this.#r.dataStream}get#r(){return this.#p[t]}get clients(){return this.#t}get nowPlayingClient(){return this.#u?this.#t[this.#u]??null:null}get nowPlayingClientBundleIdentifier(){return this.#u}#t={};#p;#u;constructor(o){super();this.#p=o,this.#u=null,this.onSetNowPlayingClient=this.onSetNowPlayingClient.bind(this),this.onSetState=this.onSetState.bind(this),this.onUpdateClient=this.onUpdateClient.bind(this)}async[u](){this.#o.on("setNowPlayingClient",this.onSetNowPlayingClient),this.#o.on("setState",this.onSetState),this.#o.on("updateClient",this.onUpdateClient)}async[p](){this.#o.off("setNowPlayingClient",this.onSetNowPlayingClient),this.#o.off("setState",this.onSetState),this.#o.off("updateClient",this.onUpdateClient)}async onSetNowPlayingClient(o){this.#u=o.client.bundleIdentifier??null,this.emit("nowPlayingClient",this.#u)}async onSetState(o){let r=this.#P(o.playerPath.client.bundleIdentifier,o.displayName);if(o.playbackState)r.setPlaybackState(o.playbackState,o.playbackStateTimestamp);if(o.supportedCommands)r.setSupportedCommands(o.supportedCommands.supportedCommands);if(o.playbackQueue)r.setPlaybackQueue(o.playbackQueue);this.emit("setState",o)}async onUpdateClient(o){this.#P(o.client.bundleIdentifier,o.client.displayName),this.emit("clients",this.#t)}#P(o,r){if(o in this.#t)return this.#t[o];else{let h=new P(o,r);return this.#t[o]=h,this.emit("clients",this.#t),h}}}class b extends i{get[t](){return this.#r}get#o(){return this.#r.dataStream}get state(){return this.#t}#r;#t;#p;#u;constructor(o){super();this.#r=new A(o),this.#t=new a(this)}async connect(){await this.#r.connect(),await this.#r.pairing.start(),this.#u=await this.#r.pairing.transient(),await this.#P()}async disconnect(){clearInterval(this.#p),await this.#b(),await this.#r.disconnect()}async#P(){let o=this.#u;if(!o)throw Error("No encryption keys available. Please pair the device first.");await this.#r.rtsp.enableEncryption(o.accessoryToControllerKey,o.controllerToAccessoryKey),await this.#r.setupEventStream(o.pairingId,o.sharedSecret),await this.#r.setupDataStream(o.sharedSecret),this.#p=setInterval(()=>this.#r.feedback(),y),await this.#o.exchange(this.#o.messages.deviceInfo(o.pairingId)),this.#o.on("deviceInfo",async()=>{await this.#o.exchange(this.#o.messages.setConnectionState()),await this.#o.exchange(this.#o.messages.clientUpdatesConfig()),await this.#m()})}async#m(){await this.#t[u]()}async#b(){await this.#t[p]()}}class m{get airplay(){return this.#o}#o;constructor(o){this.#o=new b(o)}async connect(){await this.#o.connect()}}class _ extends m{}class f extends m{}export{f as HomePodMini,_ as HomePod,b as AirPlayDevice};
|
|
2
|
+
|
|
3
|
+
//# debugId=E166A25FF0861F6D64756E2164756E21
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/airplay/device.ts", "../src/airplay/const.ts", "../src/airplay/state.ts", "../src/airplay/client.ts", "../src/model/homepod-base.ts", "../src/model/homepod.ts", "../src/model/homepod-mini.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { EventEmitter } from 'node:events';\nimport { AirPlay, type AirPlayDataStream } from '@basmilius/apple-airplay';\nimport type { AccessoryKeys, DiscoveryResult } from '@basmilius/apple-common';\nimport { AIRPLAY_FEEDBACK_INTERVAL, AIRPLAY_PROTOCOL, AIRPLAY_STATE_SUBSCRIBE_SYMBOL, AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL } from './const';\nimport State from './state';\n\nexport default class extends EventEmitter {\n get [AIRPLAY_PROTOCOL](): AirPlay {\n return this.#protocol;\n }\n\n get #dataStream(): AirPlayDataStream {\n return this.#protocol.dataStream;\n }\n\n get state(): State {\n return this.#state;\n }\n\n readonly #protocol: AirPlay;\n readonly #state: State;\n #feedbackInterval: NodeJS.Timeout;\n #keys: AccessoryKeys;\n\n constructor(discoveryResult: DiscoveryResult) {\n super();\n\n this.#protocol = new AirPlay(discoveryResult);\n this.#state = new State(this);\n }\n\n async connect(): Promise<void> {\n await this.#protocol.connect();\n\n await this.#protocol.pairing.start();\n this.#keys = await this.#protocol.pairing.transient();\n\n await this.#setup();\n }\n\n async disconnect(): Promise<void> {\n clearInterval(this.#feedbackInterval);\n\n await this.#unsubscribe();\n await this.#protocol.disconnect();\n }\n\n async #setup(): Promise<void> {\n const keys = this.#keys;\n\n if (!keys) {\n throw new Error('No encryption keys available. Please pair the device first.');\n }\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\n this.#feedbackInterval = setInterval(() => this.#protocol.feedback(), AIRPLAY_FEEDBACK_INTERVAL);\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 await this.#subscribe();\n });\n }\n\n async #subscribe(): Promise<void> {\n await this.#state[AIRPLAY_STATE_SUBSCRIBE_SYMBOL]();\n }\n\n async #unsubscribe(): Promise<void> {\n await this.#state[AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL]();\n }\n}\n",
|
|
6
|
+
"export const AIRPLAY_FEEDBACK_INTERVAL = 2000;\n\nexport const AIRPLAY_PROTOCOL = Symbol('com.basmilius.airplay:protocol');\nexport const AIRPLAY_STATE_SUBSCRIBE_SYMBOL = Symbol('com.basmilius.airplay-state:subscribe');\nexport const AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL = Symbol('com.basmilius.airplay-state:unsubscribe');\n",
|
|
7
|
+
"import { EventEmitter } from 'node:events';\nimport type { AirPlay, AirPlayDataStream, Proto } from '@basmilius/apple-airplay';\nimport { AIRPLAY_PROTOCOL, AIRPLAY_STATE_SUBSCRIBE_SYMBOL, AIRPLAY_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 nowPlayingClient: [string | null];\n readonly setState: [Proto.SetStateMessage];\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[AIRPLAY_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 nowPlayingClientBundleIdentifier(): string | null {\n return this.#nowPlayingClientBundleIdentifier;\n }\n\n readonly #clients: Record<string, Client> = {};\n readonly #device: Device;\n #nowPlayingClientBundleIdentifier: string;\n\n constructor(device: Device) {\n super();\n\n this.#device = device;\n this.#nowPlayingClientBundleIdentifier = null;\n\n this.onSetNowPlayingClient = this.onSetNowPlayingClient.bind(this);\n this.onSetState = this.onSetState.bind(this);\n this.onUpdateClient = this.onUpdateClient.bind(this);\n }\n\n async [AIRPLAY_STATE_SUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.on('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.on('setState', this.onSetState);\n this.#dataStream.on('updateClient', this.onUpdateClient);\n }\n\n async [AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.off('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.off('setState', this.onSetState);\n this.#dataStream.off('updateClient', this.onUpdateClient);\n }\n\n async onSetNowPlayingClient(message: Proto.SetNowPlayingClientMessage): Promise<void> {\n this.#nowPlayingClientBundleIdentifier = message.client.bundleIdentifier ?? null;\n\n this.emit('nowPlayingClient', this.#nowPlayingClientBundleIdentifier);\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 onUpdateClient(message: Proto.UpdateClientMessage): Promise<void> {\n this.#client(message.client.bundleIdentifier, message.client.displayName);\n this.emit('clients', this.#clients);\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
|
+
"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
|
+
"import type { DiscoveryResult } from '@basmilius/apple-common';\nimport { AirPlayDevice } from '@/airplay';\n\nexport default abstract class {\n get airplay(): AirPlayDevice {\n return this.#airplay;\n }\n\n readonly #airplay: AirPlayDevice;\n\n constructor(discoveryResult: DiscoveryResult) {\n this.#airplay = new AirPlayDevice(discoveryResult);\n }\n\n async connect(): Promise<void> {\n await this.#airplay.connect();\n }\n}\n",
|
|
10
|
+
"import HomePodBase from './homepod-base';\n\nexport default class extends HomePodBase {}\n",
|
|
11
|
+
"import HomePodBase from './homepod-base';\n\nexport default class extends HomePodBase {}\n"
|
|
12
|
+
],
|
|
13
|
+
"mappings": "AAAA,uBAAS,oBACT,kBAAS,iCCDF,IAAM,EAA4B,KAE5B,EAAmB,OAAO,gCAAgC,EAC1D,EAAiC,OAAO,uCAAuC,EAC/E,EAAmC,OAAO,yCAAyC,ECJhG,uBAAS,oBCAT,gBAAS,iCAET,MAAqB,CAAO,IACpB,iBAAgB,EAAW,CAC3B,OAAO,KAAK,MAGZ,YAAW,EAAW,CACtB,OAAO,KAAK,MAGZ,cAAa,EAA+B,CAC5C,OAAO,KAAK,MAGZ,cAAa,EAA6B,CAC1C,OAAO,KAAK,MAGZ,uBAAsB,EAAW,CACjC,OAAO,KAAK,MAGZ,kBAAiB,EAAwB,CACzC,OAAO,KAAK,GAGP,GACA,GACT,GAA6C,KAC7C,GACA,GACA,GAA0C,CAAC,EAE3C,WAAW,CAAC,EAA0B,EAAqB,CACvD,KAAK,GAAoB,EACzB,KAAK,GAAe,EACpB,KAAK,GAAiB,EAAM,mBAAmB,QAC/C,KAAK,GAAqB,CAAC,EAG/B,kBAAkB,CAAC,EAAiC,CAChD,OAAO,KAAK,GAAmB,KAAK,KAAK,EAAE,UAAY,CAAO,EAGlE,gBAAgB,CAAC,EAA0C,CACvD,KAAK,GAAiB,EAG1B,gBAAgB,CAAC,EAAyC,EAAsC,CAC5F,KAAK,GAAiB,EACtB,KAAK,GAA0B,EAGnC,oBAAoB,CAAC,EAA8C,CAC/D,KAAK,GAAqB,EAElC,CD7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M,KAAK,GAAY,SAAS,KAAK,GAAY,SAAS,WAAW,EAAK,SAAS,CAAC,EAEpF,KAAK,GAAY,GAAG,aAAc,SAAY,CAC1C,MAAM,KAAK,GAAY,SAAS,KAAK,GAAY,SAAS,mBAAmB,CAAC,EAC9E,MAAM,KAAK,GAAY,SAAS,KAAK,GAAY,SAAS,oBAAoB,CAAC,EAC/E,MAAM,KAAK,GAAW,EACzB,OAGC,EAAU,EAAkB,CAC9B,MAAM,KAAK,GAAO,GAAgC,OAGhD,EAAY,EAAkB,CAChC,MAAM,KAAK,GAAO,GAAkC,EAE5D,CI7EA,MAAO,CAAuB,IACtB,QAAO,EAAkB,CACzB,OAAO,KAAK,GAGP,GAET,WAAW,CAAC,EAAkC,CAC1C,KAAK,GAAW,IAAI,EAAc,CAAe,OAG/C,QAAO,EAAkB,CAC3B,MAAM,KAAK,GAAS,QAAQ,EAEpC,CCfA,MAAO,UAAsB,CAAY,CAAC,CCA1C,MAAO,UAAsB,CAAY,CAAC",
|
|
14
|
+
"debugId": "E166A25FF0861F6D64756E2164756E21",
|
|
15
|
+
"names": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DiscoveryResult } from "@basmilius/apple-common";
|
|
2
|
+
import { AirPlayDevice } from "@/airplay";
|
|
3
|
+
export default abstract class {
|
|
4
|
+
#private;
|
|
5
|
+
get airplay(): AirPlayDevice;
|
|
6
|
+
constructor(discoveryResult: DiscoveryResult);
|
|
7
|
+
connect(): Promise<void>;
|
|
8
|
+
}
|
package/dist/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/test.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Proto as a}from"@basmilius/apple-airplay";import{Discovery as _}from"@basmilius/apple-common";import{EventEmitter as k}from"node:events";import{AirPlay as h}from"@basmilius/apple-airplay";var y=2000,r=Symbol("com.basmilius.airplay:protocol"),c=Symbol("com.basmilius.airplay-state:subscribe"),m=Symbol("com.basmilius.airplay-state:unsubscribe");import{EventEmitter as b}from"node:events";import{Proto as s}from"@basmilius/apple-airplay";class i{get bundleIdentifier(){return this.#t}get displayName(){return this.#o}get playbackQueue(){return this.#a}get playbackState(){return this.#c}get playbackStateTimestamp(){return this.#r}get supportedCommands(){return this.#m}#t;#o;#a=null;#c;#r;#m=[];constructor(t,o){this.#t=t,this.#o=o,this.#c=s.PlaybackState_Enum.Unknown,this.#m=[]}isCommandSupported(t){return this.#m.some((o)=>o.command===t)}setPlaybackQueue(t){this.#a=t}setPlaybackState(t,o){this.#c=t,this.#r=o}setSupportedCommands(t){this.#m=t}}class P extends b{get#t(){return this.#o.dataStream}get#o(){return this.#c[r]}get clients(){return this.#a}get nowPlayingClient(){return this.#r?this.#a[this.#r]??null:null}get nowPlayingClientBundleIdentifier(){return this.#r}#a={};#c;#r;constructor(t){super();this.#c=t,this.#r=null,this.onSetNowPlayingClient=this.onSetNowPlayingClient.bind(this),this.onSetState=this.onSetState.bind(this),this.onUpdateClient=this.onUpdateClient.bind(this)}async[c](){this.#t.on("setNowPlayingClient",this.onSetNowPlayingClient),this.#t.on("setState",this.onSetState),this.#t.on("updateClient",this.onUpdateClient)}async[m](){this.#t.off("setNowPlayingClient",this.onSetNowPlayingClient),this.#t.off("setState",this.onSetState),this.#t.off("updateClient",this.onUpdateClient)}async onSetNowPlayingClient(t){this.#r=t.client.bundleIdentifier??null,this.emit("nowPlayingClient",this.#r)}async onSetState(t){let o=this.#m(t.playerPath.client.bundleIdentifier,t.displayName);if(t.playbackState)o.setPlaybackState(t.playbackState,t.playbackStateTimestamp);if(t.supportedCommands)o.setSupportedCommands(t.supportedCommands.supportedCommands);if(t.playbackQueue)o.setPlaybackQueue(t.playbackQueue);this.emit("setState",t)}async onUpdateClient(t){this.#m(t.client.bundleIdentifier,t.client.displayName),this.emit("clients",this.#a)}#m(t,o){if(t in this.#a)return this.#a[t];else{let e=new i(t,o);return this.#a[t]=e,this.emit("clients",this.#a),e}}}class n extends k{get[r](){return this.#o}get#t(){return this.#o.dataStream}get state(){return this.#a}#o;#a;#c;#r;constructor(t){super();this.#o=new h(t),this.#a=new P(this)}async connect(){await this.#o.connect(),await this.#o.pairing.start(),this.#r=await this.#o.pairing.transient(),await this.#m()}async disconnect(){clearInterval(this.#c),await this.#l(),await this.#o.disconnect()}async#m(){let t=this.#r;if(!t)throw Error("No encryption keys available. Please pair the device first.");await this.#o.rtsp.enableEncryption(t.accessoryToControllerKey,t.controllerToAccessoryKey),await this.#o.setupEventStream(t.pairingId,t.sharedSecret),await this.#o.setupDataStream(t.sharedSecret),this.#c=setInterval(()=>this.#o.feedback(),y),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()),await this.#i()})}async#i(){await this.#a[c]()}async#l(){await this.#a[m]()}}class l{get airplay(){return this.#t}#t;constructor(t){this.#t=new n(t)}async connect(){await this.#t.connect()}}class S extends l{}class u extends l{}var d=_.airplay(),x=await d.findUntil("Slaapkamer HomePod._airplay._tcp.local"),p=new u(x);await p.connect();p.airplay.state.on("setState",()=>{let t=p.airplay.state.nowPlayingClient;if(!t){console.log("No app playing.");return}let o=t.playbackQueue?.contentItems?.[0]??null;if(!o){console.log(`No item in queue of ${t.bundleIdentifier} (${t.displayName}).`);return}switch(t.playbackState){case a.PlaybackState_Enum.Unknown:console.log("Unknown client state.");break;case a.PlaybackState_Enum.Playing:console.log(`Now playing: ${o.metadata.title} (${o.metadata.trackArtistName})`);break;case a.PlaybackState_Enum.Paused:console.log(`Now paused: ${o.metadata.title} (${o.metadata.trackArtistName})`);break;case a.PlaybackState_Enum.Stopped:console.log(`Now stopped: ${o.metadata.title} (${o.metadata.trackArtistName})`);break;case a.PlaybackState_Enum.Interrupted:console.log(`Now interrupted: ${o.metadata.title} (${o.metadata.trackArtistName})`);break;case a.PlaybackState_Enum.Seeking:console.log(`Seeking: ${o.metadata.title} (${o.metadata.trackArtistName})`);break}});
|
|
2
|
+
|
|
3
|
+
//# debugId=74DD791944E7A4C464756E2164756E21
|
|
4
|
+
//# sourceMappingURL=test.js.map
|
package/dist/test.js.map
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/test.ts", "../src/airplay/device.ts", "../src/airplay/const.ts", "../src/airplay/state.ts", "../src/airplay/client.ts", "../src/model/homepod-base.ts", "../src/model/homepod.ts", "../src/model/homepod-mini.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { Proto } from '@basmilius/apple-airplay';\nimport { Discovery } from '@basmilius/apple-common';\nimport { HomePodMini } from '@/model';\n\nconst discovery = Discovery.airplay();\nconst discoveryResult = await discovery.findUntil('Slaapkamer HomePod._airplay._tcp.local');\n\nconst device = new HomePodMini(discoveryResult);\nawait device.connect();\n\ndevice.airplay.state.on('setState', () => {\n const client = device.airplay.state.nowPlayingClient;\n\n if (!client) {\n console.log('No app playing.');\n return;\n }\n\n const item = client.playbackQueue?.contentItems?.[0] ?? null;\n\n if (!item) {\n console.log(`No item in queue of ${client.bundleIdentifier} (${client.displayName}).`);\n return;\n }\n\n switch (client.playbackState) {\n case Proto.PlaybackState_Enum.Unknown:\n console.log('Unknown client state.');\n break;\n\n case Proto.PlaybackState_Enum.Playing:\n console.log(`Now playing: ${item.metadata.title} (${item.metadata.trackArtistName})`);\n break;\n\n case Proto.PlaybackState_Enum.Paused:\n console.log(`Now paused: ${item.metadata.title} (${item.metadata.trackArtistName})`);\n break;\n\n case Proto.PlaybackState_Enum.Stopped:\n console.log(`Now stopped: ${item.metadata.title} (${item.metadata.trackArtistName})`);\n break;\n\n case Proto.PlaybackState_Enum.Interrupted:\n console.log(`Now interrupted: ${item.metadata.title} (${item.metadata.trackArtistName})`);\n break;\n\n case Proto.PlaybackState_Enum.Seeking:\n console.log(`Seeking: ${item.metadata.title} (${item.metadata.trackArtistName})`);\n break;\n }\n});\n",
|
|
6
|
+
"import { EventEmitter } from 'node:events';\nimport { AirPlay, type AirPlayDataStream } from '@basmilius/apple-airplay';\nimport type { AccessoryKeys, DiscoveryResult } from '@basmilius/apple-common';\nimport { AIRPLAY_FEEDBACK_INTERVAL, AIRPLAY_PROTOCOL, AIRPLAY_STATE_SUBSCRIBE_SYMBOL, AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL } from './const';\nimport State from './state';\n\nexport default class extends EventEmitter {\n get [AIRPLAY_PROTOCOL](): AirPlay {\n return this.#protocol;\n }\n\n get #dataStream(): AirPlayDataStream {\n return this.#protocol.dataStream;\n }\n\n get state(): State {\n return this.#state;\n }\n\n readonly #protocol: AirPlay;\n readonly #state: State;\n #feedbackInterval: NodeJS.Timeout;\n #keys: AccessoryKeys;\n\n constructor(discoveryResult: DiscoveryResult) {\n super();\n\n this.#protocol = new AirPlay(discoveryResult);\n this.#state = new State(this);\n }\n\n async connect(): Promise<void> {\n await this.#protocol.connect();\n\n await this.#protocol.pairing.start();\n this.#keys = await this.#protocol.pairing.transient();\n\n await this.#setup();\n }\n\n async disconnect(): Promise<void> {\n clearInterval(this.#feedbackInterval);\n\n await this.#unsubscribe();\n await this.#protocol.disconnect();\n }\n\n async #setup(): Promise<void> {\n const keys = this.#keys;\n\n if (!keys) {\n throw new Error('No encryption keys available. Please pair the device first.');\n }\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\n this.#feedbackInterval = setInterval(() => this.#protocol.feedback(), AIRPLAY_FEEDBACK_INTERVAL);\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 await this.#subscribe();\n });\n }\n\n async #subscribe(): Promise<void> {\n await this.#state[AIRPLAY_STATE_SUBSCRIBE_SYMBOL]();\n }\n\n async #unsubscribe(): Promise<void> {\n await this.#state[AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL]();\n }\n}\n",
|
|
7
|
+
"export const AIRPLAY_FEEDBACK_INTERVAL = 2000;\n\nexport const AIRPLAY_PROTOCOL = Symbol('com.basmilius.airplay:protocol');\nexport const AIRPLAY_STATE_SUBSCRIBE_SYMBOL = Symbol('com.basmilius.airplay-state:subscribe');\nexport const AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL = Symbol('com.basmilius.airplay-state:unsubscribe');\n",
|
|
8
|
+
"import { EventEmitter } from 'node:events';\nimport type { AirPlay, AirPlayDataStream, Proto } from '@basmilius/apple-airplay';\nimport { AIRPLAY_PROTOCOL, AIRPLAY_STATE_SUBSCRIBE_SYMBOL, AIRPLAY_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 nowPlayingClient: [string | null];\n readonly setState: [Proto.SetStateMessage];\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[AIRPLAY_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 nowPlayingClientBundleIdentifier(): string | null {\n return this.#nowPlayingClientBundleIdentifier;\n }\n\n readonly #clients: Record<string, Client> = {};\n readonly #device: Device;\n #nowPlayingClientBundleIdentifier: string;\n\n constructor(device: Device) {\n super();\n\n this.#device = device;\n this.#nowPlayingClientBundleIdentifier = null;\n\n this.onSetNowPlayingClient = this.onSetNowPlayingClient.bind(this);\n this.onSetState = this.onSetState.bind(this);\n this.onUpdateClient = this.onUpdateClient.bind(this);\n }\n\n async [AIRPLAY_STATE_SUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.on('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.on('setState', this.onSetState);\n this.#dataStream.on('updateClient', this.onUpdateClient);\n }\n\n async [AIRPLAY_STATE_UNSUBSCRIBE_SYMBOL](): Promise<void> {\n this.#dataStream.off('setNowPlayingClient', this.onSetNowPlayingClient);\n this.#dataStream.off('setState', this.onSetState);\n this.#dataStream.off('updateClient', this.onUpdateClient);\n }\n\n async onSetNowPlayingClient(message: Proto.SetNowPlayingClientMessage): Promise<void> {\n this.#nowPlayingClientBundleIdentifier = message.client.bundleIdentifier ?? null;\n\n this.emit('nowPlayingClient', this.#nowPlayingClientBundleIdentifier);\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 onUpdateClient(message: Proto.UpdateClientMessage): Promise<void> {\n this.#client(message.client.bundleIdentifier, message.client.displayName);\n this.emit('clients', this.#clients);\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",
|
|
9
|
+
"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",
|
|
10
|
+
"import type { DiscoveryResult } from '@basmilius/apple-common';\nimport { AirPlayDevice } from '@/airplay';\n\nexport default abstract class {\n get airplay(): AirPlayDevice {\n return this.#airplay;\n }\n\n readonly #airplay: AirPlayDevice;\n\n constructor(discoveryResult: DiscoveryResult) {\n this.#airplay = new AirPlayDevice(discoveryResult);\n }\n\n async connect(): Promise<void> {\n await this.#airplay.connect();\n }\n}\n",
|
|
11
|
+
"import HomePodBase from './homepod-base';\n\nexport default class extends HomePodBase {}\n",
|
|
12
|
+
"import HomePodBase from './homepod-base';\n\nexport default class extends HomePodBase {}\n"
|
|
13
|
+
],
|
|
14
|
+
"mappings": "AAAA,gBAAS,iCACT,oBAAS,gCCDT,uBAAS,oBACT,kBAAS,i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names": []
|
|
17
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@basmilius/apple-devices",
|
|
3
|
+
"description": "Exposes various Apple devices to connect with either AirPlay or Companion Link.",
|
|
4
|
+
"version": "0.0.21",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Bas Milius",
|
|
9
|
+
"email": "bas@mili.us",
|
|
10
|
+
"url": "https://bas.dev"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"apple",
|
|
14
|
+
"airplay",
|
|
15
|
+
"companion link",
|
|
16
|
+
"tv",
|
|
17
|
+
"apple tv",
|
|
18
|
+
"homekit",
|
|
19
|
+
"homepod",
|
|
20
|
+
"homepod mini"
|
|
21
|
+
],
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"provenance": true
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "bun -b build.ts",
|
|
32
|
+
"watch:test": "bun --watch src/test.ts"
|
|
33
|
+
},
|
|
34
|
+
"main": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"typings": "./dist/index.d.ts",
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"default": "./dist/index.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@basmilius/apple-airplay": "0.0.21",
|
|
46
|
+
"@basmilius/apple-common": "0.0.21",
|
|
47
|
+
"@basmilius/apple-companion-link": "0.0.21"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@basmilius/tools": "^2.13.0",
|
|
51
|
+
"@types/bun": "^1.3.1"
|
|
52
|
+
}
|
|
53
|
+
}
|