@vates/types 1.9.0 → 1.11.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.
@@ -1,5 +1,18 @@
1
1
  import { Branded } from '../common.mjs';
2
- export type Task = {
3
- id: Branded<'task'>;
4
- run: <T>(fn: () => T) => Promise<T>;
5
- };
2
+ export interface VatesTask {
3
+ _abortController: AbortController;
4
+ _onProgress(data?: unknown): void;
5
+ id: Branded<'vates-task'>;
6
+ status: 'failure' | 'pending' | 'success';
7
+ abort(reason?: unknown): void;
8
+ failure(error?: unknown): void;
9
+ info(message: string, data: unknown): void;
10
+ run<T>(fn: () => T | (() => Promise<T>)): Promise<T>;
11
+ runInside<T>(fn: () => T | (() => Promise<T>)): Promise<T>;
12
+ set(name: string, value: unknown): void;
13
+ start(): void;
14
+ success(result?: unknown): void;
15
+ warning(message: string, data: unknown): void;
16
+ wrap<T>(fn: () => T | (() => Promise<T>)): Promise<T>;
17
+ wrapInside<T>(fn: () => T | (() => Promise<T>)): Promise<T>;
18
+ }
@@ -127,4 +127,5 @@ export interface Xapi {
127
127
  }): Promise<{
128
128
  body: Readable;
129
129
  }>;
130
+ isHyperThreadingEnabled(hostId: XoHost['id']): Promise<boolean | null>;
130
131
  }
@@ -791,7 +791,7 @@ export interface XenApiVbd {
791
791
  unpluggable: boolean;
792
792
  userdevice: string;
793
793
  uuid: string;
794
- VDI: XenApiVdi['$ref'];
794
+ VDI: XenApiVdi['$ref'] | OPAQUE_REF_NULL;
795
795
  VM: XenApiVm['$ref'];
796
796
  }
797
797
  export type XenApiVbdWrapped = WrapperXenApi<XenApiVbd, 'VBD'>;
package/dist/xo.d.mts CHANGED
@@ -447,6 +447,33 @@ export type XoSm = BaseXapiXo & {
447
447
  supported_image_formats: string[];
448
448
  type: 'SM';
449
449
  };
450
+ export type XoTask = {
451
+ abortionRequestedAt?: number;
452
+ end?: number;
453
+ id: Branded<'task'>;
454
+ infos?: {
455
+ data: unknown;
456
+ message: string;
457
+ }[];
458
+ properties: {
459
+ method?: string;
460
+ name?: string;
461
+ objectId?: string;
462
+ params?: Record<string, unknown>;
463
+ type?: string;
464
+ userId?: string;
465
+ [key: string]: unknown | undefined;
466
+ };
467
+ result: Record<string, unknown>;
468
+ start: number;
469
+ status: 'failure' | 'interrupted' | 'pending' | 'success';
470
+ tasks?: XoTask[];
471
+ updatedAt?: number;
472
+ warning?: {
473
+ data: unknown;
474
+ message: string;
475
+ }[];
476
+ };
450
477
  export type XoUser = {
451
478
  authProviders?: Record<string, string>;
452
479
  email: string;
@@ -466,7 +493,7 @@ export type XoVbd = BaseXapiXo & {
466
493
  position: string;
467
494
  read_only: boolean;
468
495
  type: 'VBD';
469
- VDI: AnyXoVdi['id'];
496
+ VDI?: XoVdi['id'] | XoVdiSnapshot['id'];
470
497
  VM: AnyXoVm['id'];
471
498
  };
472
499
  type BaseXoVdi = BaseXapiXo & {
@@ -496,9 +523,13 @@ export type XoVdiSnapshot = BaseXoVdi & {
496
523
  $snapshot_of?: XoVdi['id'];
497
524
  type: 'VDI-snapshot';
498
525
  };
499
- export type XoVdiUnmanaged = BaseXoVdi & {
526
+ export type XoVdiUnmanaged = Omit<BaseXoVdi, '$VBDs'> & {
500
527
  id: Branded<'VDI-unmanaged'>;
501
528
  type: 'VDI-unmanaged';
529
+ /**
530
+ * Unmanaged VDI have no VBDs
531
+ */
532
+ $VBDs: never[];
502
533
  };
503
534
  export type XoVgpu = BaseXapiXo & {
504
535
  id: Branded<'VGPU'>;
@@ -570,7 +601,7 @@ export type XoVtpm = BaseXapiXo & {
570
601
  type: 'VTPM';
571
602
  };
572
603
  export type XapiXoRecord = XoAlarm | XoGpuGroup | XoHost | XoMessage | XoNetwork | XoPci | XoPgpu | XoPif | XoPool | XoSr | XoVbd | XoVdi | XoVdiSnapshot | XoVdiUnmanaged | XoVgpu | XoVgpuType | XoVif | XoVm | XoVmController | XoVmSnapshot | XoVmTemplate | XoVtpm | XoSm;
573
- export type NonXapiXoRecord = XoGroup | XoProxy | XoJob | XoBackupRepository | XoSchedule | XoServer | XoUser;
604
+ export type NonXapiXoRecord = XoGroup | XoProxy | XoJob | XoBackupRepository | XoSchedule | XoServer | XoTask | XoUser;
574
605
  export type XoRecord = XapiXoRecord | NonXapiXoRecord;
575
606
  export type AnyXoVm = XoVm | XoVmSnapshot | XoVmTemplate | XoVmController;
576
607
  export type AnyXoVdi = XoVdi | XoVdiSnapshot | XoVdiUnmanaged;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vates/types",
3
3
  "private": false,
4
- "version": "1.9.0",
4
+ "version": "1.11.0",
5
5
  "main": "./dist/index.mjs",
6
6
  "exports": {
7
7
  ".": {