@basmilius/apple-common 0.7.2 → 0.8.1
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/index.d.mts +283 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +11 -10
- package/dist/cli.d.ts +0 -2
- package/dist/connection.d.ts +0 -38
- package/dist/const.d.ts +0 -6
- package/dist/context.d.ts +0 -7
- package/dist/discovery.d.ts +0 -10
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -942
- package/dist/pairing.d.ts +0 -59
- package/dist/reporter.d.ts +0 -22
- package/dist/symbols.d.ts +0 -1
- package/dist/timing.d.ts +0 -7
- package/dist/types.d.ts +0 -120
- package/dist/utils.d.ts +0 -6
package/dist/pairing.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Context } from "./context";
|
|
2
|
-
declare abstract class BasePairing {
|
|
3
|
-
#private;
|
|
4
|
-
get context(): Context;
|
|
5
|
-
constructor(context: Context);
|
|
6
|
-
tlv(buffer: Buffer): Map<number, Buffer>;
|
|
7
|
-
}
|
|
8
|
-
export declare class AccessoryPair extends BasePairing {
|
|
9
|
-
#private;
|
|
10
|
-
constructor(context: Context, requestHandler: RequestHandler);
|
|
11
|
-
start(): Promise<void>;
|
|
12
|
-
pin(askPin: () => Promise<string>): Promise<AccessoryCredentials>;
|
|
13
|
-
transient(): Promise<AccessoryKeys>;
|
|
14
|
-
m1(additionalTlv?: [number, number | Buffer][]): Promise<PairM1>;
|
|
15
|
-
m2(m1: PairM1, pin?: string): Promise<PairM2>;
|
|
16
|
-
m3(m2: PairM2): Promise<PairM3>;
|
|
17
|
-
m4(m3: PairM3): Promise<PairM4>;
|
|
18
|
-
m5(m4: PairM4): Promise<PairM5>;
|
|
19
|
-
m6(m4: PairM4, m5: PairM5): Promise<AccessoryCredentials>;
|
|
20
|
-
}
|
|
21
|
-
export declare class AccessoryVerify extends BasePairing {
|
|
22
|
-
#private;
|
|
23
|
-
constructor(context: Context, requestHandler: RequestHandler);
|
|
24
|
-
start(credentials: AccessoryCredentials): Promise<AccessoryKeys>;
|
|
25
|
-
}
|
|
26
|
-
type RequestHandler = (step: "m1" | "m3" | "m5", data: Buffer) => Promise<Buffer>;
|
|
27
|
-
type PairM1 = {
|
|
28
|
-
readonly publicKey: Buffer;
|
|
29
|
-
readonly salt: Buffer;
|
|
30
|
-
};
|
|
31
|
-
type PairM2 = {
|
|
32
|
-
readonly publicKey: Buffer;
|
|
33
|
-
readonly proof: Buffer;
|
|
34
|
-
};
|
|
35
|
-
type PairM3 = {
|
|
36
|
-
readonly serverProof: Buffer;
|
|
37
|
-
};
|
|
38
|
-
type PairM4 = {
|
|
39
|
-
readonly sharedSecret: Buffer;
|
|
40
|
-
};
|
|
41
|
-
type PairM5 = {
|
|
42
|
-
readonly authTag: Buffer;
|
|
43
|
-
readonly data: Buffer;
|
|
44
|
-
readonly sessionKey: Buffer;
|
|
45
|
-
};
|
|
46
|
-
export type AccessoryCredentials = {
|
|
47
|
-
readonly accessoryIdentifier: string;
|
|
48
|
-
readonly accessoryLongTermPublicKey: Buffer;
|
|
49
|
-
readonly pairingId: Buffer;
|
|
50
|
-
readonly publicKey: Buffer;
|
|
51
|
-
readonly secretKey: Buffer;
|
|
52
|
-
};
|
|
53
|
-
export type AccessoryKeys = {
|
|
54
|
-
readonly pairingId: Buffer;
|
|
55
|
-
readonly sharedSecret: Buffer;
|
|
56
|
-
readonly accessoryToControllerKey: Buffer;
|
|
57
|
-
readonly controllerToAccessoryKey: Buffer;
|
|
58
|
-
};
|
|
59
|
-
export {};
|
package/dist/reporter.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
type DebugGroup = "debug" | "error" | "info" | "net" | "raw" | "warn";
|
|
2
|
-
export declare class Logger {
|
|
3
|
-
#private;
|
|
4
|
-
get id(): string;
|
|
5
|
-
get label(): string;
|
|
6
|
-
constructor(id: string);
|
|
7
|
-
debug(...data: any[]): void;
|
|
8
|
-
error(...data: any[]): void;
|
|
9
|
-
info(...data: any[]): void;
|
|
10
|
-
net(...data: any[]): void;
|
|
11
|
-
raw(...data: any[]): void;
|
|
12
|
-
warn(...data: any[]): void;
|
|
13
|
-
}
|
|
14
|
-
export declare class Reporter {
|
|
15
|
-
#private;
|
|
16
|
-
all(): void;
|
|
17
|
-
disable(group: DebugGroup): void;
|
|
18
|
-
enable(group: DebugGroup): void;
|
|
19
|
-
isEnabled(group: DebugGroup): boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare const reporter: Reporter;
|
|
22
|
-
export {};
|
package/dist/symbols.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ENCRYPTION: unique symbol;
|
package/dist/timing.d.ts
DELETED
package/dist/types.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
export type ConnectionState =
|
|
2
|
-
| 'closing'
|
|
3
|
-
| 'connected'
|
|
4
|
-
| 'connecting'
|
|
5
|
-
| 'disconnected'
|
|
6
|
-
| 'failed';
|
|
7
|
-
|
|
8
|
-
export type EventMap = Record<string, any>;
|
|
9
|
-
|
|
10
|
-
export type DnsRecordClass = 'IN' | 'CS' | 'CH' | 'HS' | 'ANY';
|
|
11
|
-
|
|
12
|
-
export type DnsRecordType =
|
|
13
|
-
| 'A'
|
|
14
|
-
| 'AAAA'
|
|
15
|
-
| 'CNAME'
|
|
16
|
-
| 'MX'
|
|
17
|
-
| 'NS'
|
|
18
|
-
| 'NSEC'
|
|
19
|
-
| 'PTR'
|
|
20
|
-
| 'SOA'
|
|
21
|
-
| 'SRV'
|
|
22
|
-
| 'TXT';
|
|
23
|
-
|
|
24
|
-
export type DnsRecordBase = {
|
|
25
|
-
readonly name: string;
|
|
26
|
-
readonly type: DnsRecordType;
|
|
27
|
-
readonly class: DnsRecordClass;
|
|
28
|
-
readonly flash: boolean;
|
|
29
|
-
readonly ttl: number;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export type DnsRecordA = DnsRecordBase & {
|
|
33
|
-
readonly type: 'A';
|
|
34
|
-
readonly rdata: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type DnsRecordAAAA = DnsRecordBase & {
|
|
38
|
-
readonly type: 'AAAA';
|
|
39
|
-
readonly rdata: string;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type DnsRecordPTR = DnsRecordBase & {
|
|
43
|
-
readonly type: 'PTR';
|
|
44
|
-
readonly rdata: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export type DnsRecordTXT = DnsRecordBase & {
|
|
48
|
-
readonly type: 'TXT';
|
|
49
|
-
readonly rdata: Record<string, string>;
|
|
50
|
-
readonly rdata_buffer: Record<string, Buffer>;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export type DnsRecordSRV = DnsRecordBase & {
|
|
54
|
-
readonly type: 'SRV';
|
|
55
|
-
readonly rdata: {
|
|
56
|
-
readonly priority: number;
|
|
57
|
-
readonly weight: number;
|
|
58
|
-
readonly port: number;
|
|
59
|
-
readonly target: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export type DnsRecordNSEC = DnsRecordBase & {
|
|
64
|
-
readonly type: 'NSEC';
|
|
65
|
-
readonly rdata: string;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export type DnsRecord =
|
|
69
|
-
| DnsRecordA
|
|
70
|
-
| DnsRecordAAAA
|
|
71
|
-
| DnsRecordPTR
|
|
72
|
-
| DnsRecordTXT
|
|
73
|
-
| DnsRecordSRV
|
|
74
|
-
| DnsRecordNSEC;
|
|
75
|
-
|
|
76
|
-
export type DnsPacketHeader = {
|
|
77
|
-
readonly id: number;
|
|
78
|
-
readonly qr: number;
|
|
79
|
-
readonly op: number;
|
|
80
|
-
readonly aa: number;
|
|
81
|
-
readonly tc: number;
|
|
82
|
-
readonly rd: number;
|
|
83
|
-
readonly ra: number;
|
|
84
|
-
readonly z: number;
|
|
85
|
-
readonly ad: number;
|
|
86
|
-
readonly cd: number;
|
|
87
|
-
readonly rc: number;
|
|
88
|
-
readonly questions: number;
|
|
89
|
-
readonly answers: number;
|
|
90
|
-
readonly authorities: number;
|
|
91
|
-
readonly additionals: number;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export type DnsPacket = {
|
|
95
|
-
readonly address: string;
|
|
96
|
-
readonly header: DnsPacketHeader;
|
|
97
|
-
readonly questions: DnsRecord[];
|
|
98
|
-
readonly answers: DnsRecord[];
|
|
99
|
-
readonly authorities: DnsRecord[];
|
|
100
|
-
readonly additionals: DnsRecord[];
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export type Result = {
|
|
104
|
-
readonly fqdn: string;
|
|
105
|
-
readonly address: string;
|
|
106
|
-
readonly modelName: string;
|
|
107
|
-
readonly familyName: string | null;
|
|
108
|
-
readonly service: {
|
|
109
|
-
readonly port: number;
|
|
110
|
-
readonly protocol: 'tcp' | 'udp';
|
|
111
|
-
readonly type: string;
|
|
112
|
-
};
|
|
113
|
-
readonly packet: DnsPacket;
|
|
114
|
-
readonly [key: string]: unknown;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export type DiscoveryResult = {
|
|
118
|
-
readonly id: string;
|
|
119
|
-
readonly txt: Record<string, string>;
|
|
120
|
-
} & Result;
|
package/dist/utils.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function getLocalIP(): string | null;
|
|
2
|
-
export declare function getMacAddress(): string;
|
|
3
|
-
export declare function randomInt32(): number;
|
|
4
|
-
export declare function randomInt64(): bigint;
|
|
5
|
-
export declare function uint16ToBE(value: number): Buffer;
|
|
6
|
-
export declare function uint53ToLE(value: number): Buffer;
|