@qawolf/run-globals-ios 0.0.18 → 0.0.19

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.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -16
  3. package/dist/apple-pay.d.ts +16 -0
  4. package/dist/apple-pay.d.ts.map +1 -0
  5. package/dist/apple-pay.js +17 -0
  6. package/dist/apple-pay.js.map +1 -0
  7. package/dist/audio.d.ts +2 -2
  8. package/dist/audio.d.ts.map +1 -1
  9. package/dist/audio.js +13 -8
  10. package/dist/audio.js.map +1 -1
  11. package/dist/barcode.d.ts +8 -8
  12. package/dist/barcode.d.ts.map +1 -1
  13. package/dist/barcode.js +3 -1
  14. package/dist/barcode.js.map +1 -1
  15. package/dist/beacon.d.ts +4 -4
  16. package/dist/beacon.d.ts.map +1 -1
  17. package/dist/beacon.js +2 -3
  18. package/dist/beacon.js.map +1 -1
  19. package/dist/configuration-profile.d.ts +1 -1
  20. package/dist/configuration-profile.d.ts.map +1 -1
  21. package/dist/configuration-profile.js +4 -2
  22. package/dist/configuration-profile.js.map +1 -1
  23. package/dist/gateway.d.ts +110 -110
  24. package/dist/gateway.d.ts.map +1 -1
  25. package/dist/gateway.js +78 -74
  26. package/dist/gateway.js.map +1 -1
  27. package/dist/index.d.ts +12 -11
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +13 -9
  30. package/dist/index.js.map +1 -1
  31. package/dist/injectionHelpers.d.ts +1 -1
  32. package/dist/injectionHelpers.d.ts.map +1 -1
  33. package/dist/injectionHelpers.js +11 -4
  34. package/dist/injectionHelpers.js.map +1 -1
  35. package/dist/media.d.ts +6 -6
  36. package/dist/media.d.ts.map +1 -1
  37. package/dist/media.js +4 -6
  38. package/dist/media.js.map +1 -1
  39. package/dist/photo.d.ts +15 -15
  40. package/dist/photo.d.ts.map +1 -1
  41. package/dist/photo.js +18 -18
  42. package/dist/photo.js.map +1 -1
  43. package/dist/typings.d.ts +292 -278
  44. package/dist/webview.d.ts.map +1 -1
  45. package/dist/webview.js.map +1 -1
  46. package/package.json +36 -39
package/dist/typings.d.ts CHANGED
@@ -3,6 +3,20 @@
3
3
  import { Browser } from 'webdriverio';
4
4
  import { z } from 'zod';
5
5
 
6
+ /**
7
+ * Confirms a pending Apple Pay payment on a Face ID device via AssistiveTouch.
8
+ *
9
+ * Preconditions:
10
+ * - The Apple Pay sheet is already visible with the correct card selected
11
+ * (it shows "Confirm with AssistiveTouch").
12
+ * - AssistiveTouch is enabled on the device.
13
+ *
14
+ * This delegates to the native WDA command, which drives the AssistiveTouch
15
+ * menu (nubbit → Device → More → Confirm Pay) and enters the device passcode.
16
+ * No card details are needed here — the sheet/card are already on screen and
17
+ * the passcode is the device's known PIN.
18
+ */
19
+ export declare function confirmApplePay(driver: Browser): Promise<void>;
6
20
  declare const SpeakerRecordingSessionSchema: z.ZodObject<{
7
21
  id: z.ZodString;
8
22
  status: z.ZodString;
@@ -12,17 +26,17 @@ declare const SpeakerRecordingSessionSchema: z.ZodObject<{
12
26
  */
13
27
  export type SpeakerRecordingSession = z.input<typeof SpeakerRecordingSessionSchema>;
14
28
  declare const SpeakerRecordingFileSchema: z.ZodObject<{
29
+ duration: z.ZodOptional<z.ZodNumber>;
15
30
  filename: z.ZodString;
16
31
  fingerprint: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
17
- duration: z.ZodOptional<z.ZodNumber>;
18
32
  }, z.core.$strip>;
19
33
  /**
20
34
  * Represents a recorded audio file with optional fingerprint data
21
35
  */
22
36
  export type SpeakerRecordingFile = z.input<typeof SpeakerRecordingFileSchema>;
23
37
  declare const AudioFingerprintSchema: z.ZodObject<{
24
- fingerprint: z.ZodArray<z.ZodNumber>;
25
38
  duration: z.ZodNumber;
39
+ fingerprint: z.ZodArray<z.ZodNumber>;
26
40
  }, z.core.$strip>;
27
41
  /**
28
42
  * Represents the audio fingerprint calculation result
@@ -89,108 +103,108 @@ export declare function downloadSpeakerRecording(driver: Browser, filename: stri
89
103
  * ```
90
104
  */
91
105
  export declare function calculateAudioFingerprint(driver: Browser, audioData: Buffer | string): Promise<AudioFingerprint>;
92
- declare const PhotoAssetSchema: z.ZodObject<{
93
- localIdentifier: z.ZodString;
94
- mediaType: z.ZodString;
95
- mediaSubtype: z.ZodString;
96
- creationDate: z.ZodString;
97
- modificationDate: z.ZodString;
98
- pixelWidth: z.ZodNumber;
99
- pixelHeight: z.ZodNumber;
100
- duration: z.ZodNumber;
101
- isFavorite: z.ZodBoolean;
102
- isHidden: z.ZodBoolean;
103
- }, z.core.$strip>;
104
- /**
105
- * Represents a photo or video asset in the Photos library
106
- */
107
- export type PhotoAsset = z.input<typeof PhotoAssetSchema>;
108
- declare const SavePhotoResultSchema: z.ZodObject<{
109
- success: z.ZodBoolean;
110
- message: z.ZodOptional<z.ZodString>;
111
- }, z.core.$strip>;
112
- /**
113
- * Result of saving a photo to the Photos library
114
- */
115
- export type SavePhotoResult = z.input<typeof SavePhotoResultSchema>;
116
- declare const ListPhotosResultSchema: z.ZodObject<{
117
- success: z.ZodBoolean;
118
- assets: z.ZodArray<z.ZodObject<{
119
- localIdentifier: z.ZodString;
120
- mediaType: z.ZodString;
121
- mediaSubtype: z.ZodString;
122
- creationDate: z.ZodString;
123
- modificationDate: z.ZodString;
124
- pixelWidth: z.ZodNumber;
125
- pixelHeight: z.ZodNumber;
126
- duration: z.ZodNumber;
127
- isFavorite: z.ZodBoolean;
128
- isHidden: z.ZodBoolean;
129
- }, z.core.$strip>>;
130
- totalCount: z.ZodNumber;
131
- }, z.core.$strip>;
132
106
  /**
133
- * Result of listing photos from the Photos library
134
- */
135
- export type ListPhotosResult = z.input<typeof ListPhotosResultSchema>;
136
- declare const DeletePhotosResultSchema: z.ZodObject<{
137
- success: z.ZodBoolean;
138
- deletedCount: z.ZodNumber;
139
- message: z.ZodOptional<z.ZodString>;
140
- }, z.core.$strip>;
141
- /**
142
- * Result of deleting all photos from the Photos library
107
+ * Configuration for a barcode or QR code to inject.
143
108
  */
144
- export type DeletePhotosResult = z.input<typeof DeletePhotosResultSchema>;
109
+ export type BarcodeConfig = {
110
+ /** Normalized bounds (0.0-1.0) for the detected barcode position */
111
+ bounds?: {
112
+ height: number;
113
+ width: number;
114
+ x: number;
115
+ y: number;
116
+ };
117
+ /** Corner points (0.0-1.0) for the detected barcode shape */
118
+ corners?: {
119
+ x: number;
120
+ y: number;
121
+ }[];
122
+ /**
123
+ * Raw binary payload exposed via `AVMetadataMachineReadableCodeObject.rawValue`
124
+ * (iOS 13+). Accepts a Buffer or a base64-encoded string. When omitted, the
125
+ * injector defaults to the UTF-8 encoding of `value`.
126
+ */
127
+ rawValue?: Buffer | string;
128
+ /** AVMetadataObjectType constant. Default: "org.iso.QRCode" */
129
+ type?: string;
130
+ /** The barcode/QR code value to inject */
131
+ value: string;
132
+ };
145
133
  /**
146
- * Save an image file from the filesystem to the device Photos library.
147
- * This function handles the entire workflow:
148
- * 1. Reads the file from the filesystem
149
- * 2. Pushes it to the device's app container
150
- * 3. Saves it to Photos library via the iOS agent
151
- * 4. Cleans up the temporary file from the device
134
+ * Inject a barcode or QR code detection into the app's AVCaptureMetadataOutput.
152
135
  *
153
- * @param driver - The WebDriverIO browser instance
154
- * @param filePath - Absolute path to the file on the filesystem
155
- * @returns Promise resolving to the save operation result
156
- * @example
157
- * ```typescript
158
- * const result = await ios.savePhoto(driver, '/Users/me/photo.jpg');
159
- * if (result.success) {
160
- * console.log('Photo saved to library');
161
- * }
162
- * ```
163
- */
164
- export declare function savePhoto(driver: Browser, filePath: string): Promise<SavePhotoResult>;
165
- /**
166
- * List all photos and videos from the Photos library.
167
- * Returns full protocol response with success status, assets array, and total count.
136
+ * The injected barcode(s) will be delivered to the app's metadata output delegate
137
+ * as if they were scanned by the camera. The config file is auto-consumed by the
138
+ * injection system after delivery.
168
139
  *
169
140
  * @param driver - The WebDriverIO browser instance
170
- * @returns Promise resolving to list result with assets and count
141
+ * @param bundleId - Bundle ID of the target app
142
+ * @param barcodes - Single barcode config or array of configs
143
+ * @returns Cleanup function that removes the injection config
144
+ *
171
145
  * @example
172
146
  * ```typescript
173
- * const result = await ios.listPhotos(driver);
174
- * console.log(`Found ${result.totalCount} photos in library`);
175
- * result.assets.forEach(asset => {
176
- * console.log(`${asset.mediaType}: ${asset.localIdentifier}`);
147
+ * // Inject a QR code
148
+ * const cleanup = await ios.injectBarcode(driver, "com.example.app", {
149
+ * value: "https://example.com",
177
150
  * });
151
+ *
152
+ * // Inject multiple barcodes
153
+ * const cleanup = await ios.injectBarcode(driver, "com.example.app", [
154
+ * { type: "org.iso.QRCode", value: "https://example.com" },
155
+ * { type: "org.gs1.EAN-13", value: "1234567890123" },
156
+ * ]);
157
+ *
158
+ * await cleanup();
178
159
  * ```
179
160
  */
180
- export declare function listPhotos(driver: Browser): Promise<ListPhotosResult>;
161
+ export declare function injectBarcode(driver: Browser, bundleId: string, barcodes: BarcodeConfig | BarcodeConfig[]): Promise<() => Promise<void>>;
181
162
  /**
182
- * Delete all photos and videos from the Photos library.
183
- * This is useful for cleaning up test data between test runs.
163
+ * Configuration for iBeacon injection.
164
+ */
165
+ export type BeaconConfig = {
166
+ /**
167
+ * Beacons to simulate in this region. When omitted or empty, only the
168
+ * `.region` file is pushed — the app receives a region-entry callback but
169
+ * no ranging callbacks.
170
+ */
171
+ beacons?: {
172
+ major: number | string;
173
+ minor: number | string;
174
+ }[];
175
+ /** Beacon region UUID */
176
+ uuid: string;
177
+ };
178
+ /**
179
+ * Inject iBeacon detections into the app's CLLocationManager.
180
+ *
181
+ * Always pushes the `{uuid}.region` file, which triggers
182
+ * `locationManager(_:didEnterRegion:)`. When `beacons` is provided, also
183
+ * pushes `{uuid}.beacon` so the app receives
184
+ * `locationManager(_:didRangeBeacons:inRegion:)` callbacks.
184
185
  *
185
186
  * @param driver - The WebDriverIO browser instance
186
- * @returns Promise resolving to delete result with count and message
187
+ * @param bundleId - Bundle ID of the target app
188
+ * @param config - Beacon configuration with UUID and (optional) beacon list
189
+ * @returns Cleanup function that removes the injection config files
190
+ *
187
191
  * @example
188
192
  * ```typescript
189
- * const result = await ios.deleteAllPhotos(driver);
190
- * console.log(`Deleted ${result.deletedCount} photos`);
193
+ * // Region entry + ranging
194
+ * const cleanup = await ios.injectBeacon(driver, "com.example.app", {
195
+ * uuid: "8613BEAD-5465-4515-8F9C-AEEA717484C9",
196
+ * beacons: [{ major: 1, minor: 7 }],
197
+ * });
198
+ *
199
+ * // Region entry only (no ranging)
200
+ * const cleanup = await ios.injectBeacon(driver, "com.example.app", {
201
+ * uuid: "e62c96fd-014a-454f-9b41-32245d802bb3",
202
+ * });
203
+ *
204
+ * await cleanup();
191
205
  * ```
192
206
  */
193
- export declare function deleteAllPhotos(driver: Browser): Promise<DeletePhotosResult>;
207
+ export declare function injectBeacon(driver: Browser, bundleId: string, config: BeaconConfig): Promise<() => Promise<void>>;
194
208
  declare const ConfigurationProfileOptionsSchema: z.ZodObject<{
195
209
  profileString: z.ZodString;
196
210
  }, z.core.$strip>;
@@ -228,43 +242,43 @@ declare const TunnelStatusSchema: z.ZodEnum<{
228
242
  }>;
229
243
  export type TunnelStatus = z.infer<typeof TunnelStatusSchema>;
230
244
  declare const TunnelStateSchema: z.ZodObject<{
245
+ error: z.ZodOptional<z.ZodString>;
246
+ interface: z.ZodOptional<z.ZodString>;
231
247
  status: z.ZodEnum<{
232
248
  down: "down";
233
249
  starting: "starting";
234
250
  up: "up";
235
251
  error: "error";
236
252
  }>;
237
- interface: z.ZodOptional<z.ZodString>;
238
- error: z.ZodOptional<z.ZodString>;
239
253
  }, z.core.$strip>;
240
254
  export type TunnelState = z.infer<typeof TunnelStateSchema>;
241
255
  declare const TunnelStatusMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
256
+ error: z.ZodOptional<z.ZodString>;
257
+ interface: z.ZodOptional<z.ZodString>;
242
258
  status: z.ZodEnum<{
243
259
  down: "down";
244
260
  starting: "starting";
245
261
  up: "up";
246
262
  error: "error";
247
263
  }>;
248
- interface: z.ZodOptional<z.ZodString>;
249
- error: z.ZodOptional<z.ZodString>;
250
264
  }, z.core.$strip>>;
251
265
  export type TunnelStatusMap = z.infer<typeof TunnelStatusMapSchema>;
252
266
  declare const HttpProxyTunnelSchema: z.ZodObject<{
253
- type: z.ZodLiteral<"http-proxy">;
254
267
  host: z.ZodString;
268
+ password: z.ZodOptional<z.ZodString>;
255
269
  port: z.ZodNumber;
270
+ type: z.ZodLiteral<"http-proxy">;
256
271
  username: z.ZodOptional<z.ZodString>;
257
- password: z.ZodOptional<z.ZodString>;
258
272
  }, z.core.$strip>;
259
273
  export type HttpProxyTunnel = z.infer<typeof HttpProxyTunnelSchema>;
260
274
  declare const WireGuardTunnelSchema: z.ZodObject<{
261
- type: z.ZodLiteral<"wireguard">;
262
275
  configPath: z.ZodString;
276
+ type: z.ZodLiteral<"wireguard">;
263
277
  }, z.core.$strip>;
264
278
  export type WireGuardTunnel = z.infer<typeof WireGuardTunnelSchema>;
265
279
  declare const OpenVPNTunnelSchema: z.ZodObject<{
266
- type: z.ZodLiteral<"openvpn">;
267
280
  configPath: z.ZodString;
281
+ type: z.ZodLiteral<"openvpn">;
268
282
  }, z.core.$strip>;
269
283
  export type OpenVPNTunnel = z.infer<typeof OpenVPNTunnelSchema>;
270
284
  declare const TunnelConfigSchema: z.ZodUnion<readonly [
@@ -272,72 +286,72 @@ declare const TunnelConfigSchema: z.ZodUnion<readonly [
272
286
  type: z.ZodLiteral<"direct">;
273
287
  }, z.core.$strip>,
274
288
  z.ZodObject<{
275
- type: z.ZodLiteral<"http-proxy">;
276
289
  host: z.ZodString;
290
+ password: z.ZodOptional<z.ZodString>;
277
291
  port: z.ZodNumber;
292
+ type: z.ZodLiteral<"http-proxy">;
278
293
  username: z.ZodOptional<z.ZodString>;
279
- password: z.ZodOptional<z.ZodString>;
280
294
  }, z.core.$strip>,
281
295
  z.ZodObject<{
282
- type: z.ZodLiteral<"wireguard">;
283
296
  configPath: z.ZodString;
297
+ type: z.ZodLiteral<"wireguard">;
284
298
  }, z.core.$strip>,
285
299
  z.ZodObject<{
286
- type: z.ZodLiteral<"openvpn">;
287
300
  configPath: z.ZodString;
301
+ type: z.ZodLiteral<"openvpn">;
288
302
  }, z.core.$strip>,
289
303
  z.ZodObject<{
290
- type: z.ZodLiteral<"relay">;
291
- host: z.ZodString;
292
- port: z.ZodNumber;
293
- username: z.ZodString;
294
- password: z.ZodString;
295
304
  dialer: z.ZodOptional<z.ZodEnum<{
296
305
  tls: "tls";
297
306
  tcp: "tcp";
298
307
  }>>;
308
+ host: z.ZodString;
309
+ password: z.ZodString;
310
+ port: z.ZodNumber;
299
311
  secure: z.ZodOptional<z.ZodBoolean>;
312
+ type: z.ZodLiteral<"relay">;
313
+ username: z.ZodString;
300
314
  }, z.core.$strip>
301
315
  ]>;
302
316
  export type TunnelConfig = z.infer<typeof TunnelConfigSchema>;
303
317
  declare const RouteTrafficConfigSchema: z.ZodObject<{
304
318
  apps: z.ZodArray<z.ZodString>;
305
319
  domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
320
+ inspect: z.ZodOptional<z.ZodBoolean>;
321
+ socksHost: z.ZodOptional<z.ZodString>;
322
+ socksPort: z.ZodOptional<z.ZodNumber>;
306
323
  tunnel: z.ZodUnion<readonly [
307
324
  z.ZodObject<{
308
325
  type: z.ZodLiteral<"direct">;
309
326
  }, z.core.$strip>,
310
327
  z.ZodObject<{
311
- type: z.ZodLiteral<"http-proxy">;
312
328
  host: z.ZodString;
329
+ password: z.ZodOptional<z.ZodString>;
313
330
  port: z.ZodNumber;
331
+ type: z.ZodLiteral<"http-proxy">;
314
332
  username: z.ZodOptional<z.ZodString>;
315
- password: z.ZodOptional<z.ZodString>;
316
333
  }, z.core.$strip>,
317
334
  z.ZodObject<{
318
- type: z.ZodLiteral<"wireguard">;
319
335
  configPath: z.ZodString;
336
+ type: z.ZodLiteral<"wireguard">;
320
337
  }, z.core.$strip>,
321
338
  z.ZodObject<{
322
- type: z.ZodLiteral<"openvpn">;
323
339
  configPath: z.ZodString;
340
+ type: z.ZodLiteral<"openvpn">;
324
341
  }, z.core.$strip>,
325
342
  z.ZodObject<{
326
- type: z.ZodLiteral<"relay">;
327
- host: z.ZodString;
328
- port: z.ZodNumber;
329
- username: z.ZodString;
330
- password: z.ZodString;
331
343
  dialer: z.ZodOptional<z.ZodEnum<{
332
344
  tls: "tls";
333
345
  tcp: "tcp";
334
346
  }>>;
347
+ host: z.ZodString;
348
+ password: z.ZodString;
349
+ port: z.ZodNumber;
335
350
  secure: z.ZodOptional<z.ZodBoolean>;
351
+ type: z.ZodLiteral<"relay">;
352
+ username: z.ZodString;
336
353
  }, z.core.$strip>
337
354
  ]>;
338
- socksHost: z.ZodOptional<z.ZodString>;
339
- socksPort: z.ZodOptional<z.ZodNumber>;
340
- inspect: z.ZodOptional<z.ZodBoolean>;
341
355
  }, z.core.$strip>;
342
356
  export type RouteTrafficConfig = z.infer<typeof RouteTrafficConfigSchema>;
343
357
  declare const NetworkStatusSchema: z.ZodObject<{
@@ -348,95 +362,95 @@ declare const NetworkStatusSchema: z.ZodObject<{
348
362
  openvpn: "openvpn";
349
363
  relay: "relay";
350
364
  }>;
351
- tunnels: z.ZodRecord<z.ZodString, z.ZodObject<{
352
- status: z.ZodEnum<{
353
- down: "down";
354
- starting: "starting";
355
- up: "up";
356
- error: "error";
357
- }>;
358
- interface: z.ZodOptional<z.ZodString>;
359
- error: z.ZodOptional<z.ZodString>;
360
- }, z.core.$strip>>;
365
+ routedApps: z.ZodArray<z.ZodString>;
366
+ routedDomains: z.ZodArray<z.ZodString>;
361
367
  routingTables: z.ZodOptional<z.ZodObject<{
362
368
  activeTable: z.ZodString;
363
369
  tables: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
364
370
  }, z.core.$strip>>;
365
371
  traffic: z.ZodOptional<z.ZodObject<{
366
- routes: z.ZodRecord<z.ZodString, z.ZodObject<{
367
- packets: z.ZodNumber;
368
- bytes: z.ZodNumber;
369
- }, z.core.$strip>>;
370
372
  interfaces: z.ZodRecord<z.ZodString, z.ZodObject<{
371
- rxPackets: z.ZodNumber;
372
- txPackets: z.ZodNumber;
373
373
  rxBytes: z.ZodNumber;
374
+ rxPackets: z.ZodNumber;
374
375
  txBytes: z.ZodNumber;
376
+ txPackets: z.ZodNumber;
377
+ }, z.core.$strip>>;
378
+ routes: z.ZodRecord<z.ZodString, z.ZodObject<{
379
+ bytes: z.ZodNumber;
380
+ packets: z.ZodNumber;
375
381
  }, z.core.$strip>>;
376
382
  }, z.core.$strip>>;
383
+ tunnels: z.ZodRecord<z.ZodString, z.ZodObject<{
384
+ error: z.ZodOptional<z.ZodString>;
385
+ interface: z.ZodOptional<z.ZodString>;
386
+ status: z.ZodEnum<{
387
+ down: "down";
388
+ starting: "starting";
389
+ up: "up";
390
+ error: "error";
391
+ }>;
392
+ }, z.core.$strip>>;
377
393
  vpnApp: z.ZodObject<{
378
394
  bundleId: z.ZodString;
379
395
  installed: z.ZodBoolean;
380
396
  pid: z.ZodOptional<z.ZodNumber>;
381
397
  }, z.core.$strip>;
382
- routedApps: z.ZodArray<z.ZodString>;
383
- routedDomains: z.ZodArray<z.ZodString>;
384
398
  }, z.core.$strip>;
385
399
  export type NetworkStatus = z.infer<typeof NetworkStatusSchema>;
386
400
  export declare const NetworkConditionConfigSchema: z.ZodObject<{
387
401
  bandwidthKbps: z.ZodOptional<z.ZodNumber>;
388
- latencyMs: z.ZodOptional<z.ZodNumber>;
389
402
  jitterMs: z.ZodOptional<z.ZodNumber>;
403
+ latencyMs: z.ZodOptional<z.ZodNumber>;
390
404
  packetLossPercent: z.ZodOptional<z.ZodNumber>;
391
405
  }, z.core.$strip>;
392
406
  export type NetworkConditionConfig = z.infer<typeof NetworkConditionConfigSchema>;
393
407
  /** 2G EDGE: ~240 Kbps, 300ms latency, high jitter */
394
408
  export declare const NETWORK_2G_EDGE: {
395
409
  readonly bandwidthKbps: 240;
396
- readonly latencyMs: 300;
397
410
  readonly jitterMs: 100;
411
+ readonly latencyMs: 300;
398
412
  readonly packetLossPercent: 1.5;
399
413
  };
400
414
  /** 3G: ~1.8 Mbps, 100ms latency */
401
415
  export declare const NETWORK_3G: {
402
416
  readonly bandwidthKbps: 1800;
403
- readonly latencyMs: 100;
404
417
  readonly jitterMs: 30;
418
+ readonly latencyMs: 100;
405
419
  readonly packetLossPercent: 0.5;
406
420
  };
407
421
  /** 4G LTE: ~12 Mbps, 30ms latency */
408
422
  export declare const NETWORK_4G_LTE: {
409
423
  readonly bandwidthKbps: 12000;
410
- readonly latencyMs: 30;
411
424
  readonly jitterMs: 10;
425
+ readonly latencyMs: 30;
412
426
  readonly packetLossPercent: 0.1;
413
427
  };
414
428
  /** 5G: ~100 Mbps, 10ms latency */
415
429
  export declare const NETWORK_5G: {
416
430
  readonly bandwidthKbps: 100000;
417
- readonly latencyMs: 10;
418
431
  readonly jitterMs: 3;
432
+ readonly latencyMs: 10;
419
433
  readonly packetLossPercent: 0.01;
420
434
  };
421
435
  /** Satellite: ~5 Mbps, 600ms latency */
422
436
  export declare const NETWORK_SATELLITE: {
423
437
  readonly bandwidthKbps: 5000;
424
- readonly latencyMs: 600;
425
438
  readonly jitterMs: 50;
439
+ readonly latencyMs: 600;
426
440
  readonly packetLossPercent: 1;
427
441
  };
428
442
  /** Congested WiFi: ~2 Mbps, 50ms latency, high jitter and packet loss */
429
443
  export declare const NETWORK_WIFI_CONGESTED: {
430
444
  readonly bandwidthKbps: 2000;
431
- readonly latencyMs: 50;
432
445
  readonly jitterMs: 40;
446
+ readonly latencyMs: 50;
433
447
  readonly packetLossPercent: 3;
434
448
  };
435
449
  /** Very bad network: ~100 Kbps, 500ms latency, extreme jitter and packet loss */
436
450
  export declare const NETWORK_VERY_BAD: {
437
451
  readonly bandwidthKbps: 100;
438
- readonly latencyMs: 500;
439
452
  readonly jitterMs: 200;
453
+ readonly latencyMs: 500;
440
454
  readonly packetLossPercent: 10;
441
455
  };
442
456
  /** Offline: 100% packet loss — drops all packets to simulate no connectivity */
@@ -444,13 +458,13 @@ export declare const NETWORK_OFFLINE: {
444
458
  readonly packetLossPercent: 100;
445
459
  };
446
460
  export declare const NetworkConditionStatusSchema: z.ZodObject<{
447
- enabled: z.ZodBoolean;
448
461
  config: z.ZodOptional<z.ZodObject<{
449
462
  bandwidthKbps: z.ZodOptional<z.ZodNumber>;
450
- latencyMs: z.ZodOptional<z.ZodNumber>;
451
463
  jitterMs: z.ZodOptional<z.ZodNumber>;
464
+ latencyMs: z.ZodOptional<z.ZodNumber>;
452
465
  packetLossPercent: z.ZodOptional<z.ZodNumber>;
453
466
  }, z.core.$strip>>;
467
+ enabled: z.ZodBoolean;
454
468
  interface: z.ZodOptional<z.ZodString>;
455
469
  }, z.core.$strip>;
456
470
  export type NetworkConditionStatus = z.infer<typeof NetworkConditionStatusSchema>;
@@ -463,67 +477,67 @@ export type NetworkConditionStatus = z.infer<typeof NetworkConditionStatusSchema
463
477
  */
464
478
  export declare function getNetworkStatus(): Promise<NetworkStatus>;
465
479
  /** A recorded network entry from GOST MITM inspection */
466
- export interface RecordedEntry {
467
- service: string;
468
- network: string;
469
- remote?: string;
470
- local?: string;
480
+ export type RecordedEntry = {
481
+ dns?: {
482
+ answer: string;
483
+ cached: boolean;
484
+ class: string;
485
+ id: number;
486
+ name: string;
487
+ question: string;
488
+ type: string;
489
+ };
490
+ duration: number;
471
491
  host?: string;
472
- proto?: string;
473
492
  http?: {
474
493
  host: string;
475
494
  method: string;
476
495
  proto: string;
477
- scheme: string;
478
- uri: string;
479
- statusCode: number;
480
496
  request?: {
497
+ body: string | null;
481
498
  contentLength: number;
482
499
  header: Record<string, string[]>;
483
- body: string | null;
484
500
  };
485
501
  response?: {
502
+ body: string | null;
486
503
  contentLength: number;
487
504
  header: Record<string, string[]>;
488
- body: string | null;
489
505
  };
506
+ scheme: string;
507
+ statusCode: number;
508
+ uri: string;
509
+ };
510
+ local?: string;
511
+ network: string;
512
+ proto?: string;
513
+ remote?: string;
514
+ service: string;
515
+ sid: string;
516
+ time: string;
517
+ tls?: {
518
+ cipherSuite: string;
519
+ proto?: string;
520
+ serverName: string;
521
+ version: string;
490
522
  };
491
523
  websocket?: {
492
- from: string;
493
524
  fin: boolean;
494
- rsv1: boolean;
495
- rsv2: boolean;
496
- rsv3: boolean;
497
- opcode: number;
525
+ from: string;
526
+ length: number;
498
527
  masked: boolean;
499
528
  maskKey: number;
500
- length: number;
529
+ opcode: number;
501
530
  payload: string;
531
+ rsv1: boolean;
532
+ rsv2: boolean;
533
+ rsv3: boolean;
502
534
  };
503
- tls?: {
504
- serverName: string;
505
- cipherSuite: string;
506
- version: string;
507
- proto?: string;
508
- };
509
- dns?: {
510
- id: number;
511
- name: string;
512
- class: string;
513
- type: string;
514
- question: string;
515
- answer: string;
516
- cached: boolean;
517
- };
518
- sid: string;
519
- time: string;
520
- duration: number;
521
- }
535
+ };
522
536
  type NetworkLogHandler = (entry: RecordedEntry) => void;
523
- export interface NetworkLogSubscription {
524
- on(handler: NetworkLogHandler): void;
537
+ export type NetworkLogSubscription = {
525
538
  close(): void;
526
- }
539
+ on(handler: NetworkLogHandler): void;
540
+ };
527
541
  /**
528
542
  * Subscribe to real-time network entries streamed via SSE from the
529
543
  * Appium plugin. Requires `routeTraffic()` to have been called first
@@ -569,82 +583,26 @@ export declare function simulateNetworkCondition(config: NetworkConditionConfig)
569
583
  * Get the current network condition status.
570
584
  */
571
585
  export declare function getNetworkCondition(): Promise<NetworkConditionStatus>;
572
- /**
573
- * Configuration for a barcode or QR code to inject.
574
- */
575
- export interface BarcodeConfig {
576
- /** AVMetadataObjectType constant. Default: "org.iso.QRCode" */
577
- type?: string;
578
- /** The barcode/QR code value to inject */
579
- value: string;
580
- /** Normalized bounds (0.0-1.0) for the detected barcode position */
581
- bounds?: {
582
- x: number;
583
- y: number;
584
- width: number;
585
- height: number;
586
- };
587
- /** Corner points (0.0-1.0) for the detected barcode shape */
588
- corners?: {
589
- x: number;
590
- y: number;
591
- }[];
592
- /**
593
- * Raw binary payload exposed via `AVMetadataMachineReadableCodeObject.rawValue`
594
- * (iOS 13+). Accepts a Buffer or a base64-encoded string. When omitted, the
595
- * injector defaults to the UTF-8 encoding of `value`.
596
- */
597
- rawValue?: Buffer | string;
598
- }
599
- /**
600
- * Inject a barcode or QR code detection into the app's AVCaptureMetadataOutput.
601
- *
602
- * The injected barcode(s) will be delivered to the app's metadata output delegate
603
- * as if they were scanned by the camera. The config file is auto-consumed by the
604
- * injection system after delivery.
605
- *
606
- * @param driver - The WebDriverIO browser instance
607
- * @param bundleId - Bundle ID of the target app
608
- * @param barcodes - Single barcode config or array of configs
609
- * @returns Cleanup function that removes the injection config
610
- *
611
- * @example
612
- * ```typescript
613
- * // Inject a QR code
614
- * const cleanup = await ios.injectBarcode(driver, "com.example.app", {
615
- * value: "https://example.com",
616
- * });
617
- *
618
- * // Inject multiple barcodes
619
- * const cleanup = await ios.injectBarcode(driver, "com.example.app", [
620
- * { type: "org.iso.QRCode", value: "https://example.com" },
621
- * { type: "org.gs1.EAN-13", value: "1234567890123" },
622
- * ]);
623
- *
624
- * await cleanup();
625
- * ```
626
- */
627
- export declare function injectBarcode(driver: Browser, bundleId: string, barcodes: BarcodeConfig | BarcodeConfig[]): Promise<() => Promise<void>>;
628
586
  /**
629
587
  * Source configuration for camera/video feed injection.
630
588
  */
631
- export interface CameraSource {
589
+ export type CameraSource = {
632
590
  /** File path, URL, or data URI for the media to inject */
633
591
  data: string;
634
- /** Media type. Default: inferred from file extension */
635
- type?: "image" | "video";
636
592
  /** Delay in seconds before injection starts */
637
593
  delaySeconds?: number;
638
- }
594
+ /** Media type. Default: inferred from file extension */
595
+ type?: "image" | "video";
596
+ };
639
597
  /**
640
598
  * Source configuration for microphone/audio injection.
641
599
  */
642
- export interface AudioSource {
600
+ export type AudioSource = {
643
601
  /** File path, URL, or data URI for the audio to inject */
644
602
  data: string;
645
603
  /** Delay in seconds before injection starts */
646
604
  delaySeconds?: number;
647
- }
605
+ };
648
606
  /**
649
607
  * Inject a camera/video feed into the app's AVCaptureSession.
650
608
  *
@@ -702,52 +660,108 @@ export declare function injectCamera(driver: Browser, bundleId: string, source:
702
660
  * ```
703
661
  */
704
662
  export declare function injectAudio(driver: Browser, bundleId: string, source: AudioSource): Promise<() => Promise<void>>;
663
+ declare const PhotoAssetSchema: z.ZodObject<{
664
+ creationDate: z.ZodString;
665
+ duration: z.ZodNumber;
666
+ isFavorite: z.ZodBoolean;
667
+ isHidden: z.ZodBoolean;
668
+ localIdentifier: z.ZodString;
669
+ mediaSubtype: z.ZodString;
670
+ mediaType: z.ZodString;
671
+ modificationDate: z.ZodString;
672
+ pixelHeight: z.ZodNumber;
673
+ pixelWidth: z.ZodNumber;
674
+ }, z.core.$strip>;
705
675
  /**
706
- * Configuration for iBeacon injection.
676
+ * Represents a photo or video asset in the Photos library
707
677
  */
708
- export interface BeaconConfig {
709
- /** Beacon region UUID */
710
- uuid: string;
711
- /**
712
- * Beacons to simulate in this region. When omitted or empty, only the
713
- * `.region` file is pushed — the app receives a region-entry callback but
714
- * no ranging callbacks.
715
- */
716
- beacons?: {
717
- major: number | string;
718
- minor: number | string;
719
- }[];
720
- }
678
+ export type PhotoAsset = z.input<typeof PhotoAssetSchema>;
679
+ declare const SavePhotoResultSchema: z.ZodObject<{
680
+ message: z.ZodOptional<z.ZodString>;
681
+ success: z.ZodBoolean;
682
+ }, z.core.$strip>;
721
683
  /**
722
- * Inject iBeacon detections into the app's CLLocationManager.
723
- *
724
- * Always pushes the `{uuid}.region` file, which triggers
725
- * `locationManager(_:didEnterRegion:)`. When `beacons` is provided, also
726
- * pushes `{uuid}.beacon` so the app receives
727
- * `locationManager(_:didRangeBeacons:inRegion:)` callbacks.
684
+ * Result of saving a photo to the Photos library
685
+ */
686
+ export type SavePhotoResult = z.input<typeof SavePhotoResultSchema>;
687
+ declare const ListPhotosResultSchema: z.ZodObject<{
688
+ assets: z.ZodArray<z.ZodObject<{
689
+ creationDate: z.ZodString;
690
+ duration: z.ZodNumber;
691
+ isFavorite: z.ZodBoolean;
692
+ isHidden: z.ZodBoolean;
693
+ localIdentifier: z.ZodString;
694
+ mediaSubtype: z.ZodString;
695
+ mediaType: z.ZodString;
696
+ modificationDate: z.ZodString;
697
+ pixelHeight: z.ZodNumber;
698
+ pixelWidth: z.ZodNumber;
699
+ }, z.core.$strip>>;
700
+ success: z.ZodBoolean;
701
+ totalCount: z.ZodNumber;
702
+ }, z.core.$strip>;
703
+ /**
704
+ * Result of listing photos from the Photos library
705
+ */
706
+ export type ListPhotosResult = z.input<typeof ListPhotosResultSchema>;
707
+ declare const DeletePhotosResultSchema: z.ZodObject<{
708
+ deletedCount: z.ZodNumber;
709
+ message: z.ZodOptional<z.ZodString>;
710
+ success: z.ZodBoolean;
711
+ }, z.core.$strip>;
712
+ /**
713
+ * Result of deleting all photos from the Photos library
714
+ */
715
+ export type DeletePhotosResult = z.input<typeof DeletePhotosResultSchema>;
716
+ /**
717
+ * Save an image file from the filesystem to the device Photos library.
718
+ * This function handles the entire workflow:
719
+ * 1. Reads the file from the filesystem
720
+ * 2. Pushes it to the device's app container
721
+ * 3. Saves it to Photos library via the iOS agent
722
+ * 4. Cleans up the temporary file from the device
728
723
  *
729
724
  * @param driver - The WebDriverIO browser instance
730
- * @param bundleId - Bundle ID of the target app
731
- * @param config - Beacon configuration with UUID and (optional) beacon list
732
- * @returns Cleanup function that removes the injection config files
733
- *
725
+ * @param filePath - Absolute path to the file on the filesystem
726
+ * @returns Promise resolving to the save operation result
734
727
  * @example
735
728
  * ```typescript
736
- * // Region entry + ranging
737
- * const cleanup = await ios.injectBeacon(driver, "com.example.app", {
738
- * uuid: "8613BEAD-5465-4515-8F9C-AEEA717484C9",
739
- * beacons: [{ major: 1, minor: 7 }],
740
- * });
729
+ * const result = await ios.savePhoto(driver, '/Users/me/photo.jpg');
730
+ * if (result.success) {
731
+ * console.log('Photo saved to library');
732
+ * }
733
+ * ```
734
+ */
735
+ export declare function savePhoto(driver: Browser, filePath: string): Promise<SavePhotoResult>;
736
+ /**
737
+ * List all photos and videos from the Photos library.
738
+ * Returns full protocol response with success status, assets array, and total count.
741
739
  *
742
- * // Region entry only (no ranging)
743
- * const cleanup = await ios.injectBeacon(driver, "com.example.app", {
744
- * uuid: "e62c96fd-014a-454f-9b41-32245d802bb3",
740
+ * @param driver - The WebDriverIO browser instance
741
+ * @returns Promise resolving to list result with assets and count
742
+ * @example
743
+ * ```typescript
744
+ * const result = await ios.listPhotos(driver);
745
+ * console.log(`Found ${result.totalCount} photos in library`);
746
+ * result.assets.forEach(asset => {
747
+ * console.log(`${asset.mediaType}: ${asset.localIdentifier}`);
745
748
  * });
749
+ * ```
750
+ */
751
+ export declare function listPhotos(driver: Browser): Promise<ListPhotosResult>;
752
+ /**
753
+ * Delete all photos and videos from the Photos library.
754
+ * This is useful for cleaning up test data between test runs.
746
755
  *
747
- * await cleanup();
756
+ * @param driver - The WebDriverIO browser instance
757
+ * @returns Promise resolving to delete result with count and message
758
+ * @example
759
+ * ```typescript
760
+ * const result = await ios.deleteAllPhotos(driver);
761
+ * console.log(`Deleted ${result.deletedCount} photos`);
748
762
  * ```
749
763
  */
750
- export declare function injectBeacon(driver: Browser, bundleId: string, config: BeaconConfig): Promise<() => Promise<void>>;
764
+ export declare function deleteAllPhotos(driver: Browser): Promise<DeletePhotosResult>;
751
765
  /**
752
766
  * Toggle WebView debugging (Safari Web Inspector) for all WKWebViews in the app.
753
767
  *