appium-ios-remotexpc 0.24.2 → 0.25.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/CHANGELOG.md +12 -0
- package/build/src/lib/logger.d.ts +2 -1
- package/build/src/lib/logger.d.ts.map +1 -1
- package/build/src/lib/logger.js +1 -0
- package/build/src/services/ios/afc/index.d.ts +9 -5
- package/build/src/services/ios/afc/index.d.ts.map +1 -1
- package/build/src/services/ios/afc/index.js +8 -2
- package/package.json +1 -1
- package/src/lib/logger.ts +2 -1
- package/src/services/ios/afc/index.ts +17 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [0.25.0](https://github.com/appium/appium-ios-remotexpc/compare/v0.24.3...v0.25.0) (2026-01-07)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **afc:** invoke callback for dirs too ([#128](https://github.com/appium/appium-ios-remotexpc/issues/128)) ([d2e2a0f](https://github.com/appium/appium-ios-remotexpc/commit/d2e2a0f6664c6a3519050a7b45ea34495d2a13b9))
|
|
6
|
+
|
|
7
|
+
## [0.24.3](https://github.com/appium/appium-ios-remotexpc/compare/v0.24.2...v0.24.3) (2026-01-07)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* **logger:** fix eslint error ([#129](https://github.com/appium/appium-ios-remotexpc/issues/129)) ([e5ebfbb](https://github.com/appium/appium-ios-remotexpc/commit/e5ebfbb690cc2257f4d661d14dfca6bbb3bfb304))
|
|
12
|
+
|
|
1
13
|
## [0.24.2](https://github.com/appium/appium-ios-remotexpc/compare/v0.24.1...v0.24.2) (2026-01-06)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAIpD"}
|
package/build/src/lib/logger.js
CHANGED
|
@@ -3,15 +3,19 @@ import { Readable, Writable } from 'node:stream';
|
|
|
3
3
|
import { AFC_FOPEN_TEXTUAL_MODES } from './constants.js';
|
|
4
4
|
import { AfcFileMode } from './enums.js';
|
|
5
5
|
/**
|
|
6
|
-
* Callback invoked for each file successfully pulled from the device.
|
|
6
|
+
* Callback invoked for each file or directory successfully pulled from the device.
|
|
7
7
|
*
|
|
8
|
-
* @param remotePath - The remote file path on the device
|
|
9
|
-
* @param localPath - The local file path where it was saved
|
|
8
|
+
* @param remotePath - The remote file or directory path on the device
|
|
9
|
+
* @param localPath - The local file or directory path where it was saved
|
|
10
|
+
* @param isDirectory - True if the path is a directory, false if it is a file
|
|
10
11
|
*
|
|
11
12
|
* @remarks
|
|
12
13
|
* If the callback throws an error, the pull operation will be aborted immediately.
|
|
14
|
+
*
|
|
15
|
+
* The `isDirectory` parameter allows callback consumers to distinguish between files
|
|
16
|
+
* and directories.
|
|
13
17
|
*/
|
|
14
|
-
export type PullRecursiveCallback = (remotePath: string, localPath: string) => unknown | Promise<unknown>;
|
|
18
|
+
export type PullRecursiveCallback = (remotePath: string, localPath: string, isDirectory: boolean) => unknown | Promise<unknown>;
|
|
15
19
|
/** Options for the pull method. */
|
|
16
20
|
export interface PullOptions {
|
|
17
21
|
/**
|
|
@@ -26,7 +30,7 @@ export interface PullOptions {
|
|
|
26
30
|
* @default true
|
|
27
31
|
*/
|
|
28
32
|
overwrite?: boolean;
|
|
29
|
-
/** Callback invoked for each pulled file. */
|
|
33
|
+
/** Callback invoked for each pulled file or directory. */
|
|
30
34
|
callback?: PullRecursiveCallback;
|
|
31
35
|
}
|
|
32
36
|
export interface StatInfo {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/ios/afc/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmBjD,OAAO,EAAE,uBAAuB,EAAyB,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAa,MAAM,YAAY,CAAC;AAO9D
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/ios/afc/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmBjD,OAAO,EAAE,uBAAuB,EAAyB,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAa,MAAM,YAAY,CAAC;AAO9D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,KACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,IAAI,CAAC;IACf,YAAY,EAAE,IAAI,CAAC;IACnB,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AAC;IAoBnE;;OAEG;IACH,KAAK,IAAI,IAAI;IAUb;;;;;OAKG;YACW,SAAS;IAuBvB;;;;;;OAMG;YACW,sBAAsB;IAuFpC;;OAEG;YACW,iBAAiB;IAS/B;;OAEG;YACW,gBAAgB;IAY9B;;;OAGG;YACW,QAAQ;YAcR,YAAY;YAYZ,SAAS;YAST,QAAQ;IAMtB;;;;OAIG;YACW,YAAY;CA2B3B;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -241,7 +241,7 @@ export class AfcService {
|
|
|
241
241
|
}
|
|
242
242
|
await this._pullFile(remoteFilePath, localFilePath);
|
|
243
243
|
if (callback) {
|
|
244
|
-
await callback(remoteFilePath, localFilePath);
|
|
244
|
+
await callback(remoteFilePath, localFilePath, false);
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
const isDir = await this.isdir(remoteSrc);
|
|
@@ -449,11 +449,17 @@ export class AfcService {
|
|
|
449
449
|
if (!dirCreated) {
|
|
450
450
|
await fsp.mkdir(localDirPath, { recursive: true });
|
|
451
451
|
dirCreated = true;
|
|
452
|
+
if (callback) {
|
|
453
|
+
await callback(remoteSrcDir, localDirPath, true);
|
|
454
|
+
}
|
|
452
455
|
}
|
|
453
456
|
};
|
|
454
457
|
// For root directory (empty relativePath), always create it
|
|
455
458
|
if (!relativePath) {
|
|
456
459
|
await fsp.mkdir(localDirPath, { recursive: true });
|
|
460
|
+
if (callback) {
|
|
461
|
+
await callback(remoteSrcDir, localDirPath, true);
|
|
462
|
+
}
|
|
457
463
|
}
|
|
458
464
|
for (const entry of await this.listdir(remoteSrcDir)) {
|
|
459
465
|
const entryPath = path.posix.join(remoteSrcDir, entry);
|
|
@@ -474,7 +480,7 @@ export class AfcService {
|
|
|
474
480
|
}
|
|
475
481
|
await this._pullFile(entryPath, targetPath);
|
|
476
482
|
if (callback) {
|
|
477
|
-
await callback(entryPath, targetPath);
|
|
483
|
+
await callback(entryPath, targetPath, false);
|
|
478
484
|
}
|
|
479
485
|
}
|
|
480
486
|
}
|
package/package.json
CHANGED
package/src/lib/logger.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { logger } from '@appium/support';
|
|
2
|
+
import { type AppiumLogger } from '@appium/types';
|
|
2
3
|
|
|
3
4
|
const LOG_LEVEL = (process.env.APPIUM_IOS_REMOTEXPC_LOG_LEVEL || 'info') as any;
|
|
4
5
|
|
|
5
|
-
export function getLogger(name: string) {
|
|
6
|
+
export function getLogger(name: string): AppiumLogger {
|
|
6
7
|
const log = logger.getLogger(name);
|
|
7
8
|
log.level = LOG_LEVEL;
|
|
8
9
|
return log;
|
|
@@ -31,17 +31,22 @@ const log = getLogger('AfcService');
|
|
|
31
31
|
const NON_LISTABLE_ENTRIES = ['', '.', '..'];
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Callback invoked for each file successfully pulled from the device.
|
|
34
|
+
* Callback invoked for each file or directory successfully pulled from the device.
|
|
35
35
|
*
|
|
36
|
-
* @param remotePath - The remote file path on the device
|
|
37
|
-
* @param localPath - The local file path where it was saved
|
|
36
|
+
* @param remotePath - The remote file or directory path on the device
|
|
37
|
+
* @param localPath - The local file or directory path where it was saved
|
|
38
|
+
* @param isDirectory - True if the path is a directory, false if it is a file
|
|
38
39
|
*
|
|
39
40
|
* @remarks
|
|
40
41
|
* If the callback throws an error, the pull operation will be aborted immediately.
|
|
42
|
+
*
|
|
43
|
+
* The `isDirectory` parameter allows callback consumers to distinguish between files
|
|
44
|
+
* and directories.
|
|
41
45
|
*/
|
|
42
46
|
export type PullRecursiveCallback = (
|
|
43
47
|
remotePath: string,
|
|
44
48
|
localPath: string,
|
|
49
|
+
isDirectory: boolean,
|
|
45
50
|
) => unknown | Promise<unknown>;
|
|
46
51
|
|
|
47
52
|
/** Options for the pull method. */
|
|
@@ -58,7 +63,7 @@ export interface PullOptions {
|
|
|
58
63
|
* @default true
|
|
59
64
|
*/
|
|
60
65
|
overwrite?: boolean;
|
|
61
|
-
/** Callback invoked for each pulled file. */
|
|
66
|
+
/** Callback invoked for each pulled file or directory. */
|
|
62
67
|
callback?: PullRecursiveCallback;
|
|
63
68
|
}
|
|
64
69
|
|
|
@@ -379,7 +384,7 @@ export class AfcService {
|
|
|
379
384
|
await this._pullFile(remoteFilePath, localFilePath);
|
|
380
385
|
|
|
381
386
|
if (callback) {
|
|
382
|
-
await callback(remoteFilePath, localFilePath);
|
|
387
|
+
await callback(remoteFilePath, localFilePath, false);
|
|
383
388
|
}
|
|
384
389
|
};
|
|
385
390
|
|
|
@@ -627,11 +632,17 @@ export class AfcService {
|
|
|
627
632
|
if (!dirCreated) {
|
|
628
633
|
await fsp.mkdir(localDirPath, { recursive: true });
|
|
629
634
|
dirCreated = true;
|
|
635
|
+
if (callback) {
|
|
636
|
+
await callback(remoteSrcDir, localDirPath, true);
|
|
637
|
+
}
|
|
630
638
|
}
|
|
631
639
|
};
|
|
632
640
|
// For root directory (empty relativePath), always create it
|
|
633
641
|
if (!relativePath) {
|
|
634
642
|
await fsp.mkdir(localDirPath, { recursive: true });
|
|
643
|
+
if (callback) {
|
|
644
|
+
await callback(remoteSrcDir, localDirPath, true);
|
|
645
|
+
}
|
|
635
646
|
}
|
|
636
647
|
|
|
637
648
|
for (const entry of await this.listdir(remoteSrcDir)) {
|
|
@@ -662,7 +673,7 @@ export class AfcService {
|
|
|
662
673
|
await this._pullFile(entryPath, targetPath);
|
|
663
674
|
|
|
664
675
|
if (callback) {
|
|
665
|
-
await callback(entryPath, targetPath);
|
|
676
|
+
await callback(entryPath, targetPath, false);
|
|
666
677
|
}
|
|
667
678
|
}
|
|
668
679
|
}
|