@basmilius/apple-common 0.5.4 → 0.6.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/cli.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- import { type Interface } from "node:readline";
2
- export declare const cli: Interface;
3
1
  export declare function prompt(message: string): Promise<string>;
4
2
  export declare function waitFor(ms: number): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { v4 as uuid } from "uuid";
2
2
  export { Discovery } from "./discovery";
3
- export { prompt, waitFor, cli } from "./cli";
3
+ export { prompt, waitFor } from "./cli";
4
4
  export { Connection, EncryptionAwareConnection, EncryptionState } from "./connection";
5
5
  export { Context } from "./context";
6
6
  export { AIRPLAY_SERVICE, AIRPLAY_TRANSIENT_PIN, COMPANION_LINK_SERVICE, HTTP_TIMEOUT, RAOP_SERVICE } from "./const";
@@ -9,4 +9,5 @@ export { type Logger, type Reporter, reporter } from "./reporter";
9
9
  export { ENCRYPTION } from "./symbols";
10
10
  export { TimingServer } from "./timing";
11
11
  export { getLocalIP, getMacAddress, randomInt32, randomInt64, uint16ToBE, uint53ToLE } from "./utils";
12
+ export type { AudioSource } from "./audioSource";
12
13
  export type { ConnectionState, DiscoveryResult, EventMap } from "./types";
package/dist/index.js CHANGED
@@ -56,12 +56,14 @@ import mdns from "node-dns-sd";
56
56
 
57
57
  // src/cli.ts
58
58
  import { createInterface } from "node:readline";
59
- var cli = createInterface({
60
- input: process.stdin,
61
- output: process.stdout
62
- });
63
59
  async function prompt(message) {
64
- return await new Promise((resolve) => cli.question(`${message}: `, resolve));
60
+ const cli = createInterface({
61
+ input: process.stdin,
62
+ output: process.stdout
63
+ });
64
+ const answer = await new Promise((resolve) => cli.question(`${message}: `, resolve));
65
+ cli.close();
66
+ return answer;
65
67
  }
66
68
  async function waitFor(ms) {
67
69
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -920,7 +922,6 @@ export {
920
922
  prompt,
921
923
  getMacAddress,
922
924
  getLocalIP,
923
- cli,
924
925
  TimingServer,
925
926
  RAOP_SERVICE,
926
927
  HTTP_TIMEOUT,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@basmilius/apple-common",
3
3
  "description": "Common features shared across various apple protocol packages.",
4
- "version": "0.5.4",
4
+ "version": "0.6.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -39,8 +39,8 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@basmilius/apple-encoding": "0.5.4",
43
- "@basmilius/apple-encryption": "0.5.4",
42
+ "@basmilius/apple-encoding": "0.6.0",
43
+ "@basmilius/apple-encryption": "0.6.0",
44
44
  "fast-srp-hap": "^2.0.4",
45
45
  "node-dns-sd": "^1.0.1"
46
46
  },