@basmilius/apple-airplay 0.1.3 → 0.2.0
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/dist/baseStream.d.ts +12 -0
- package/dist/{rtsp.d.ts → controlStream.d.ts} +5 -4
- package/dist/dataStream.d.ts +8 -6
- package/dist/dataStreamMessages.d.ts +16 -16
- package/dist/eventStream.d.ts +5 -4
- package/dist/index.d.ts +6 -7
- package/dist/index.js +809 -921
- package/dist/pairing.d.ts +11 -4
- package/dist/protocol.d.ts +12 -11
- package/dist/utils.d.ts +11 -18
- package/package.json +3 -3
- package/dist/stream.d.ts +0 -13
- package/dist/types.d.ts +0 -11
- package/dist/verify.d.ts +0 -9
package/dist/pairing.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { type AccessoryCredentials, type AccessoryKeys, AccessoryPair } from "@basmilius/apple-common";
|
|
1
|
+
import { type AccessoryCredentials, type AccessoryKeys, AccessoryPair, AccessoryVerify } from "@basmilius/apple-common";
|
|
2
|
+
import type ControlStream from "./controlStream";
|
|
2
3
|
import type Protocol from "./protocol";
|
|
3
|
-
|
|
4
|
-
export default class AirPlayPairing {
|
|
4
|
+
export declare class Pairing {
|
|
5
5
|
#private;
|
|
6
|
+
get controlStream(): ControlStream;
|
|
6
7
|
get internal(): AccessoryPair;
|
|
7
|
-
get rtsp(): RTSP;
|
|
8
8
|
constructor(protocol: Protocol);
|
|
9
9
|
start(): Promise<void>;
|
|
10
10
|
pin(askPin: () => Promise<string>): Promise<AccessoryCredentials>;
|
|
11
11
|
pinStart(): Promise<void>;
|
|
12
12
|
transient(): Promise<AccessoryKeys>;
|
|
13
13
|
}
|
|
14
|
+
export declare class Verify {
|
|
15
|
+
#private;
|
|
16
|
+
get controlStream(): ControlStream;
|
|
17
|
+
get internal(): AccessoryVerify;
|
|
18
|
+
constructor(protocol: Protocol);
|
|
19
|
+
start(credentials: AccessoryCredentials): Promise<AccessoryKeys>;
|
|
20
|
+
}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { type DiscoveryResult, TimingServer } from "@basmilius/apple-common";
|
|
1
|
+
import { Context, type DiscoveryResult, type TimingServer } from "@basmilius/apple-common";
|
|
2
|
+
import { Pairing, Verify } from "./pairing";
|
|
3
|
+
import ControlStream from "./controlStream";
|
|
2
4
|
import DataStream from "./dataStream";
|
|
3
5
|
import EventStream from "./eventStream";
|
|
4
|
-
|
|
5
|
-
import RTSP from "./rtsp";
|
|
6
|
-
import Verify from "./verify";
|
|
7
|
-
export default class AirPlay {
|
|
6
|
+
export default class Protocol {
|
|
8
7
|
#private;
|
|
9
|
-
get
|
|
8
|
+
get context(): Context;
|
|
9
|
+
get controlStream(): ControlStream;
|
|
10
10
|
get dataStream(): DataStream | undefined;
|
|
11
|
+
get discoveryResult(): DiscoveryResult;
|
|
11
12
|
get eventStream(): EventStream | undefined;
|
|
12
13
|
get pairing(): Pairing;
|
|
13
|
-
get rtsp(): RTSP;
|
|
14
14
|
get sessionUUID(): string;
|
|
15
15
|
get verify(): Verify;
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(deviceId: string, discoveryResult: DiscoveryResult);
|
|
17
17
|
connect(): Promise<void>;
|
|
18
|
+
destroy(): Promise<void>;
|
|
18
19
|
disconnect(): Promise<void>;
|
|
19
20
|
feedback(): Promise<void>;
|
|
20
|
-
setupDataStream(sharedSecret: Buffer, onBeforeConnect?: () =>
|
|
21
|
-
setupEventStream(
|
|
22
|
-
|
|
21
|
+
setupDataStream(sharedSecret: Buffer, onBeforeConnect?: () => void): Promise<void>;
|
|
22
|
+
setupEventStream(sharedSecret: Buffer, pairingId: Buffer): Promise<void>;
|
|
23
|
+
useTimingServer(timingServer: TimingServer): void;
|
|
23
24
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly requestLength: number;
|
|
13
|
-
};
|
|
14
|
-
type HttpResponse = {
|
|
15
|
-
readonly response: Response;
|
|
16
|
-
readonly responseLength: number;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
1
|
+
import * as Proto from "./proto";
|
|
2
|
+
export declare function generateActiveRemoteId(): string;
|
|
3
|
+
export declare function generateDacpId(): string;
|
|
4
|
+
export declare function generateSessionId(): string;
|
|
5
|
+
export declare function nonce(counter: number): Buffer;
|
|
6
|
+
export declare function buildHeader(totalSize: number, seqno: bigint): Buffer;
|
|
7
|
+
export declare function buildReply(seqno: bigint): Buffer;
|
|
8
|
+
export declare function encodeVarint(value: number): Uint8Array;
|
|
9
|
+
export declare function parseHeaderSeqno(header: Buffer): bigint;
|
|
10
|
+
export declare function parseMessages(content: Buffer): Proto.ProtocolMessage[];
|
|
11
|
+
export declare function readVariant(buf: Buffer, offset?: number): [number, number];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basmilius/apple-airplay",
|
|
3
3
|
"description": "Implementation of Apple's AirPlay2 in Node.js.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@basmilius/apple-common": "0.
|
|
45
|
-
"@basmilius/apple-encoding": "0.
|
|
44
|
+
"@basmilius/apple-common": "0.2.0",
|
|
45
|
+
"@basmilius/apple-encoding": "0.2.0",
|
|
46
46
|
"@bufbuild/protobuf": "^2.11.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
package/dist/stream.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EncryptionAwareConnection } from "@basmilius/apple-common";
|
|
2
|
-
type EventMap = {
|
|
3
|
-
close: [];
|
|
4
|
-
connect: [];
|
|
5
|
-
error: [Error];
|
|
6
|
-
timeout: [];
|
|
7
|
-
};
|
|
8
|
-
export default class AirPlayStream<TEventMap extends Record<string, any>> extends EncryptionAwareConnection<EventMap & TEventMap> {
|
|
9
|
-
#private;
|
|
10
|
-
decrypt(data: Buffer): Promise<Buffer>;
|
|
11
|
-
encrypt(data: Buffer): Promise<Buffer>;
|
|
12
|
-
nonce(counter: number): Buffer;
|
|
13
|
-
}
|
package/dist/types.d.ts
DELETED
package/dist/verify.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type AccessoryCredentials, type AccessoryKeys } from "@basmilius/apple-common";
|
|
2
|
-
import type Protocol from "./protocol";
|
|
3
|
-
import type RTSP from "./rtsp";
|
|
4
|
-
export default class AirPlayVerify {
|
|
5
|
-
#private;
|
|
6
|
-
get rtsp(): RTSP;
|
|
7
|
-
constructor(protocol: Protocol);
|
|
8
|
-
start(credentials: AccessoryCredentials): Promise<AccessoryKeys>;
|
|
9
|
-
}
|