appium-ios-remotexpc 0.2.0 → 0.3.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/bonjour/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAGX,eAAO,MAAM,qBAAqB;;CAExB,CAAC;AAEX,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAG9C,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAGX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;CAOlB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Constants for Bonjour discovery
3
+ */
4
+ // Timeout values in milliseconds
5
+ export const BONJOUR_TIMEOUTS = {
6
+ BROWSE_STARTUP: 5000,
7
+ SERVICE_RESOLUTION: 10000,
8
+ DEFAULT_DISCOVERY: 5000,
9
+ };
10
+ // Service types
11
+ export const BONJOUR_SERVICE_TYPES = {
12
+ APPLE_TV_PAIRING: '_remotepairing-manual-pairing._tcp',
13
+ };
14
+ export const BONJOUR_DEFAULT_DOMAIN = 'local';
15
+ // DNS-SD command arguments
16
+ export const DNS_SD_COMMANDS = {
17
+ BROWSE: '-B',
18
+ RESOLVE: '-L',
19
+ };
20
+ // DNS-SD action types
21
+ export const DNS_SD_ACTIONS = {
22
+ ADD: 'Add',
23
+ REMOVE: 'Rmv',
24
+ };
25
+ // DNS-SD output patterns
26
+ export const DNS_SD_PATTERNS = {
27
+ STARTING: '...STARTING...',
28
+ BROWSE_LINE: /^\s*(\d+:\d+:\d+\.\d+)\s+(Add|Rmv)\s+(\d+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(.+)$/,
29
+ REACHABLE: /can be reached at ([^:]+):(\d+) \(interface (\d+)\)/,
30
+ TXT_RECORD: /identifier=([^\s]+).*?authTag=([^\s]+).*?model=([^\s]+).*?name=([^\s]+).*?ver=([^\s]+).*?minVer=([^\s]+)/,
31
+ };
@@ -0,0 +1,13 @@
1
+ import { type AppleTVDevice, BonjourDiscovery } from './bonjour-discovery.js';
2
+ export { BONJOUR_TIMEOUTS, BONJOUR_SERVICE_TYPES, BONJOUR_DEFAULT_DOMAIN, } from './constants.js';
3
+ /**
4
+ * Create a new Bonjour discovery instance
5
+ */
6
+ export declare function createBonjourDiscovery(): BonjourDiscovery;
7
+ /**
8
+ * Discover Apple TV devices using Bonjour with IP address resolution
9
+ * @param timeoutMs - Discovery timeout in milliseconds (default: 5000)
10
+ * @returns Promise that resolves to an array of discovered Apple TV devices with resolved IP addresses
11
+ */
12
+ export declare function discoverAppleTVDevicesWithIP(timeoutMs?: number): Promise<AppleTVDevice[]>;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/bonjour/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,CAEzD;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAChD,SAAS,GAAE,MAAa,GACvB,OAAO,CAAC,aAAa,EAAE,CAAC,CAG1B"}
@@ -0,0 +1,17 @@
1
+ import { BonjourDiscovery } from './bonjour-discovery.js';
2
+ export { BONJOUR_TIMEOUTS, BONJOUR_SERVICE_TYPES, BONJOUR_DEFAULT_DOMAIN, } from './constants.js';
3
+ /**
4
+ * Create a new Bonjour discovery instance
5
+ */
6
+ export function createBonjourDiscovery() {
7
+ return new BonjourDiscovery();
8
+ }
9
+ /**
10
+ * Discover Apple TV devices using Bonjour with IP address resolution
11
+ * @param timeoutMs - Discovery timeout in milliseconds (default: 5000)
12
+ * @returns Promise that resolves to an array of discovered Apple TV devices with resolved IP addresses
13
+ */
14
+ export async function discoverAppleTVDevicesWithIP(timeoutMs = 5000) {
15
+ const discovery = createBonjourDiscovery();
16
+ return discovery.discoverAppleTVDevicesWithIP(timeoutMs);
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-ios-remotexpc",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "main": "build/src/index.js",
5
5
  "types": "build/src/index.d.ts",
6
6
  "type": "module",
@@ -11,7 +11,8 @@
11
11
  }
12
12
  },
13
13
  "engines": {
14
- "node": ">=20 <23"
14
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
15
+ "npm": ">=10"
15
16
  },
16
17
  "scripts": {
17
18
  "clean:build": "rimraf ./build",
@@ -44,21 +45,17 @@
44
45
  },
45
46
  "description": "",
46
47
  "devDependencies": {
47
- "@appium/eslint-config-appium-ts": "^1.0.4",
48
- "@appium/tsconfig": "^0.3.5",
49
- "@eslint/js": "^9.23.0",
48
+ "@appium/eslint-config-appium-ts": "^2.0.0-rc.1",
49
+ "@appium/tsconfig": "^1.0.0-rc.1",
50
50
  "@semantic-release/changelog": "^6.0.3",
51
51
  "@semantic-release/git": "^10.0.1",
52
52
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
53
53
  "@types/chai": "^5.2.1",
54
54
  "@types/chai-as-promised": "^8.0.2",
55
55
  "@types/mocha": "^10.0.10",
56
- "appium": "^2.17.1",
57
56
  "chai": "^5.2.0",
58
57
  "chai-as-promised": "^8.0.1",
59
58
  "conventional-changelog-conventionalcommits": "^8.0.0",
60
- "eslint": "^9.23.0",
61
- "eslint-config-prettier": "^10.1.2",
62
59
  "eslint-plugin-unicorn": "^58.0.0",
63
60
  "mocha": "^11.1.0",
64
61
  "prettier": "^3.5.3",
@@ -66,12 +63,11 @@
66
63
  "semantic-release": "^24.0.0",
67
64
  "ts-node": "^10.9.2",
68
65
  "tsx": "^4.7.0",
69
- "typescript": "^5.2.2",
70
- "typescript-eslint": "^8.29.0"
66
+ "typescript": "^5.2.2"
71
67
  },
72
68
  "dependencies": {
73
- "@appium/strongbox": "^0.x",
74
- "@appium/support": "^6.1.0",
69
+ "@appium/strongbox": "^1.0.0-rc.1",
70
+ "@appium/support": "^7.0.0-rc.1",
75
71
  "@types/node": "^24.0.10",
76
72
  "@xmldom/xmldom": "^0.9.8",
77
73
  "npm-run-all2": "^7.0.2",
@@ -0,0 +1,48 @@
1
+ import { hostname } from 'node:os';
2
+
3
+ import { Opack2 } from '../encryption/index.js';
4
+ import type { AppleTVDeviceInfo } from '../types.js';
5
+
6
+ type OpackSerialized = Buffer;
7
+
8
+ const DEFAULT_ALT_IRK = Buffer.from([
9
+ 0xe9, 0xe8, 0x2d, 0xc0, 0x6a, 0x49, 0x79, 0x6b, 0x56, 0x6f, 0x54, 0x00, 0x19,
10
+ 0xb1, 0xc7, 0x7b,
11
+ ]);
12
+ const DEFAULT_BT_ADDR = '11:22:33:44:55:66';
13
+ const DEFAULT_MAC_BUFFER = Buffer.from([0x11, 0x22, 0x33, 0x44, 0x55, 0x66]);
14
+ const DEFAULT_PAIRING_SERIAL = 'AAAAAAAAAAAA';
15
+
16
+ /**
17
+ * Creates a standardized Apple TV device information object with default values
18
+ * and the specified identifier as the account ID.
19
+ *
20
+ * @param identifier - Unique identifier to use as the account ID
21
+ * @returns Complete Apple TV device information object
22
+ */
23
+ export function createAppleTVDeviceInfo(identifier: string): AppleTVDeviceInfo {
24
+ return {
25
+ altIRK: DEFAULT_ALT_IRK,
26
+ btAddr: DEFAULT_BT_ADDR,
27
+ mac: DEFAULT_MAC_BUFFER,
28
+ remotePairingSerialNumber: DEFAULT_PAIRING_SERIAL,
29
+ accountID: identifier,
30
+ model: 'computer-model',
31
+ name: hostname(),
32
+ };
33
+ }
34
+
35
+ /**
36
+ * Encodes Apple TV device information into a binary buffer using Opack2 serialization.
37
+ * This creates the device info object and immediately serializes it for transmission.
38
+ *
39
+ * @param identifier - Unique identifier to use as the account ID
40
+ * @returns Serialized device information as a Buffer
41
+ */
42
+ export function encodeAppleTVDeviceInfo(identifier: string): OpackSerialized {
43
+ const deviceInfo = createAppleTVDeviceInfo(identifier);
44
+
45
+ // Cast to SerializableValue to ensure type compatibility with Opack2.dumps
46
+ // The AppleTVDeviceInfo structure is compatible with OPACK2 serialization
47
+ return Opack2.dumps(deviceInfo as Record<string, any>);
48
+ }
@@ -0,0 +1,19 @@
1
+ // Core exports
2
+ export type {
3
+ AppleTVDeviceInfo,
4
+ PairingKeys,
5
+ PairingResult,
6
+ PairingConfig,
7
+ TLV8Item,
8
+ PairingDataComponentTypeValue,
9
+ Opack2Value,
10
+ Opack2Array,
11
+ Opack2Dictionary,
12
+ } from './types.js';
13
+ export * from './errors.js';
14
+ export * from './constants.js';
15
+ export * from './utils/index.js';
16
+ export * from './deviceInfo/index.js';
17
+ export * from './encryption/index.js';
18
+ export * from './tlv/index.js';
19
+ export * from './srp/index.js';