@arkts/image-manager 0.0.3 → 0.1.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/index.cjs CHANGED
@@ -464,6 +464,21 @@ var ImageBase = class {
464
464
  return new RequestUrlError(error.message, error.code, error);
465
465
  }
466
466
  }
467
+ toJSON() {
468
+ return {
469
+ imageType: this.imageType,
470
+ arch: this.getArch(),
471
+ path: this.getPath(),
472
+ checksum: this.getChecksum(),
473
+ fsPath: this.getFsPath(),
474
+ version: this.getVersion(),
475
+ apiVersion: this.getApiVersion(),
476
+ targetOS: this.getTargetOS(),
477
+ targetVersion: this.getTargetVersion(),
478
+ deviceType: this.getDeviceType(),
479
+ snakecaseDeviceType: this.getSnakecaseDeviceType()
480
+ };
481
+ }
467
482
  };
468
483
 
469
484
  //#endregion
@@ -517,12 +532,8 @@ var LocalImageImpl = class extends ImageBase {
517
532
  }
518
533
  toJSON() {
519
534
  return {
520
- imageType: this.imageType,
521
- path: this.getPath(),
522
- version: this.getVersion(),
523
- apiVersion: this.getApiVersion(),
524
- targetVersion: this.getTargetVersion(),
525
- checksum: this.getChecksum()
535
+ ...super.toJSON(),
536
+ executablePath: this.getExecutablePath()
526
537
  };
527
538
  }
528
539
  };
@@ -532,12 +543,7 @@ var LocalImageImpl = class extends ImageBase {
532
543
  var RemoteImageImpl = class extends ImageBase {
533
544
  imageType = "remote";
534
545
  toJSON() {
535
- return {
536
- imageType: this.imageType,
537
- path: this.getPath(),
538
- apiVersion: this.getApiVersion(),
539
- checksum: this.getChecksum()
540
- };
546
+ return super.toJSON();
541
547
  }
542
548
  };
543
549
 
@@ -671,12 +677,6 @@ function createDeployedImageConfig(productConfigItem) {
671
677
 
672
678
  //#endregion
673
679
  exports.DevModel = DevModel;
674
- Object.defineProperty(exports, 'ProductConfig', {
675
- enumerable: true,
676
- get: function () {
677
- return ProductConfig;
678
- }
679
- });
680
680
  exports.RequestUrlError = RequestUrlError;
681
681
  exports.createDeployedImageConfig = createDeployedImageConfig;
682
682
  exports.createImageManager = createImageManager;
package/dist/index.d.cts CHANGED
@@ -21,13 +21,9 @@ interface LocalImage extends BaseImage, Stringifiable<LocalImage.Stringifiable>
21
21
  stop(deployer: ImageDeployer): Promise<node_child_process0.ChildProcess>;
22
22
  }
23
23
  declare namespace LocalImage {
24
- interface Stringifiable {
24
+ interface Stringifiable extends Omit<BaseImage.Stringifiable, 'imageType'> {
25
25
  imageType: 'local';
26
- path: string;
27
- version: string;
28
- apiVersion: string;
29
- targetVersion: string;
30
- checksum: string;
26
+ executablePath: string;
31
27
  }
32
28
  }
33
29
  //#endregion
@@ -36,11 +32,8 @@ interface RemoteImage extends BaseImage, Stringifiable<RemoteImage.Stringifiable
36
32
  imageType: 'remote';
37
33
  }
38
34
  declare namespace RemoteImage {
39
- interface Stringifiable {
35
+ interface Stringifiable extends Omit<BaseImage.Stringifiable, 'imageType'> {
40
36
  imageType: 'remote';
41
- path: string;
42
- apiVersion: string;
43
- checksum: string;
44
37
  }
45
38
  }
46
39
  //#endregion
@@ -216,6 +209,21 @@ interface BaseImage {
216
209
  isDownloaded(): Promise<boolean>;
217
210
  createDownloader(signal?: AbortSignal): Promise<ImageDownloader<this> | RequestUrlError>;
218
211
  }
212
+ declare namespace BaseImage {
213
+ interface Stringifiable {
214
+ imageType: ImageType;
215
+ arch: 'arm' | 'x86' | (string & {});
216
+ path: string;
217
+ checksum: string;
218
+ fsPath: string;
219
+ version: string;
220
+ apiVersion: string;
221
+ targetOS: string;
222
+ targetVersion: string;
223
+ deviceType: DeviceType | (string & {});
224
+ snakecaseDeviceType: SnakecaseDeviceType | (string & {});
225
+ }
226
+ }
219
227
  type Image = LocalImage | RemoteImage;
220
228
  type ImageType = 'local' | 'remote';
221
229
  //#endregion
@@ -261,4 +269,4 @@ interface ImageDeployer {
261
269
  deploy(symlinkImage?: boolean): Promise<void | Error>;
262
270
  }
263
271
  //#endregion
264
- export { Arch, DeployedDevModel, DeployedImageConfig, DeployedImageConfigWithProductName, DeployedImageOptions, DevModel, DeviceType, FullDeployedImageOptions, Image, ImageDeployer, type ImageManager, type ImageManagerOptions, ImageType, LocalImage, OS, PascalCaseDeviceType, ProductConfig, RemoteImage, RequestUrlError, SnakecaseDeviceType, Stringifiable, createDeployedImageConfig, createImageManager };
272
+ export { Arch, DeployedDevModel, DeployedImageConfig, DeployedImageConfigWithProductName, DeployedImageOptions, DevModel, DeviceType, FullDeployedImageOptions, Image, ImageDeployer, type ImageManager, type ImageManagerOptions, ImageType, LocalImage, OS, PascalCaseDeviceType, type ProductConfig, RemoteImage, RequestUrlError, SnakecaseDeviceType, Stringifiable, createDeployedImageConfig, createImageManager };
package/dist/index.d.mts CHANGED
@@ -21,13 +21,9 @@ interface LocalImage extends BaseImage, Stringifiable<LocalImage.Stringifiable>
21
21
  stop(deployer: ImageDeployer): Promise<node_child_process0.ChildProcess>;
22
22
  }
23
23
  declare namespace LocalImage {
24
- interface Stringifiable {
24
+ interface Stringifiable extends Omit<BaseImage.Stringifiable, 'imageType'> {
25
25
  imageType: 'local';
26
- path: string;
27
- version: string;
28
- apiVersion: string;
29
- targetVersion: string;
30
- checksum: string;
26
+ executablePath: string;
31
27
  }
32
28
  }
33
29
  //#endregion
@@ -36,11 +32,8 @@ interface RemoteImage extends BaseImage, Stringifiable<RemoteImage.Stringifiable
36
32
  imageType: 'remote';
37
33
  }
38
34
  declare namespace RemoteImage {
39
- interface Stringifiable {
35
+ interface Stringifiable extends Omit<BaseImage.Stringifiable, 'imageType'> {
40
36
  imageType: 'remote';
41
- path: string;
42
- apiVersion: string;
43
- checksum: string;
44
37
  }
45
38
  }
46
39
  //#endregion
@@ -216,6 +209,21 @@ interface BaseImage {
216
209
  isDownloaded(): Promise<boolean>;
217
210
  createDownloader(signal?: AbortSignal): Promise<ImageDownloader<this> | RequestUrlError>;
218
211
  }
212
+ declare namespace BaseImage {
213
+ interface Stringifiable {
214
+ imageType: ImageType;
215
+ arch: 'arm' | 'x86' | (string & {});
216
+ path: string;
217
+ checksum: string;
218
+ fsPath: string;
219
+ version: string;
220
+ apiVersion: string;
221
+ targetOS: string;
222
+ targetVersion: string;
223
+ deviceType: DeviceType | (string & {});
224
+ snakecaseDeviceType: SnakecaseDeviceType | (string & {});
225
+ }
226
+ }
219
227
  type Image = LocalImage | RemoteImage;
220
228
  type ImageType = 'local' | 'remote';
221
229
  //#endregion
@@ -261,4 +269,4 @@ interface ImageDeployer {
261
269
  deploy(symlinkImage?: boolean): Promise<void | Error>;
262
270
  }
263
271
  //#endregion
264
- export { Arch, DeployedDevModel, DeployedImageConfig, DeployedImageConfigWithProductName, DeployedImageOptions, DevModel, DeviceType, FullDeployedImageOptions, type Image, type ImageDeployer, type ImageManager, type ImageManagerOptions, type ImageType, type LocalImage, OS, PascalCaseDeviceType, ProductConfig, type RemoteImage, RequestUrlError, SnakecaseDeviceType, Stringifiable, createDeployedImageConfig, createImageManager };
272
+ export { Arch, DeployedDevModel, DeployedImageConfig, DeployedImageConfigWithProductName, DeployedImageOptions, DevModel, DeviceType, FullDeployedImageOptions, type Image, type ImageDeployer, type ImageManager, type ImageManagerOptions, type ImageType, type LocalImage, OS, PascalCaseDeviceType, type ProductConfig, type RemoteImage, RequestUrlError, SnakecaseDeviceType, Stringifiable, createDeployedImageConfig, createImageManager };
package/dist/index.mjs CHANGED
@@ -432,6 +432,21 @@ var ImageBase = class {
432
432
  return new RequestUrlError(error.message, error.code, error);
433
433
  }
434
434
  }
435
+ toJSON() {
436
+ return {
437
+ imageType: this.imageType,
438
+ arch: this.getArch(),
439
+ path: this.getPath(),
440
+ checksum: this.getChecksum(),
441
+ fsPath: this.getFsPath(),
442
+ version: this.getVersion(),
443
+ apiVersion: this.getApiVersion(),
444
+ targetOS: this.getTargetOS(),
445
+ targetVersion: this.getTargetVersion(),
446
+ deviceType: this.getDeviceType(),
447
+ snakecaseDeviceType: this.getSnakecaseDeviceType()
448
+ };
449
+ }
435
450
  };
436
451
 
437
452
  //#endregion
@@ -485,12 +500,8 @@ var LocalImageImpl = class extends ImageBase {
485
500
  }
486
501
  toJSON() {
487
502
  return {
488
- imageType: this.imageType,
489
- path: this.getPath(),
490
- version: this.getVersion(),
491
- apiVersion: this.getApiVersion(),
492
- targetVersion: this.getTargetVersion(),
493
- checksum: this.getChecksum()
503
+ ...super.toJSON(),
504
+ executablePath: this.getExecutablePath()
494
505
  };
495
506
  }
496
507
  };
@@ -500,12 +511,7 @@ var LocalImageImpl = class extends ImageBase {
500
511
  var RemoteImageImpl = class extends ImageBase {
501
512
  imageType = "remote";
502
513
  toJSON() {
503
- return {
504
- imageType: this.imageType,
505
- path: this.getPath(),
506
- apiVersion: this.getApiVersion(),
507
- checksum: this.getChecksum()
508
- };
514
+ return super.toJSON();
509
515
  }
510
516
  };
511
517
 
@@ -638,4 +644,4 @@ function createDeployedImageConfig(productConfigItem) {
638
644
  }
639
645
 
640
646
  //#endregion
641
- export { DevModel, ProductConfig, RequestUrlError, createDeployedImageConfig, createImageManager };
647
+ export { DevModel, RequestUrlError, createDeployedImageConfig, createImageManager };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arkts/image-manager",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.1.0",
5
5
  "description": "OpenHarmony/HarmonyOS qemu image manager.",
6
6
  "author": "Naily Zero <zero@naily.cc> (https://naily.cc)",
7
7
  "license": "MIT",