@vates/types 1.2.0 → 1.4.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.
@@ -9,9 +9,16 @@ type WrapperXenApi<T, Type extends string, Fn = {
9
9
  $call: Fn;
10
10
  $callAsync: Fn;
11
11
  $type: Type;
12
+ $snapshot(params: {
13
+ cancelToken?: unknown;
14
+ ignoredVdisTag?: string;
15
+ name_label?: string;
16
+ unplugVusbs?: boolean;
17
+ }): Promise<XenApiVm['$ref']>;
12
18
  $xapi: {
13
19
  call: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
14
20
  callAsync: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
21
+ getField<T extends XenApiRecord, K extends keyof T>(type: Type, ref: T['$ref'], field: K): Promise<T[K]>;
15
22
  };
16
23
  };
17
24
  export interface XenApiSession {
@@ -176,6 +183,10 @@ export interface XenApiPoolUpdate {
176
183
  }
177
184
  type XenApiVmCallMethods = {
178
185
  (method: 'start', start_paused: boolean, force: boolean): Promise<void>;
186
+ (method: 'clean_shutdown'): Promise<void>;
187
+ (method: 'hard_shutdown'): Promise<void>;
188
+ (method: 'clean_reboot'): Promise<void>;
189
+ (method: 'hard_reboot'): Promise<void>;
179
190
  };
180
191
  export interface XenApiVm {
181
192
  $ref: Branded<'VM'>;
@@ -612,6 +623,7 @@ export interface XenApiPif {
612
623
  VLAN_slave_of: XenApiVlan['$ref'][];
613
624
  VLAN: number;
614
625
  }
626
+ export type XenApiPifWrapped = WrapperXenApi<XenApiPif, 'PIF'>;
615
627
  export interface XenApiPifMetrics {
616
628
  $ref: Branded<'PIF_metrics'>;
617
629
  carrier: boolean;
@@ -1130,5 +1142,5 @@ export interface XenApiObserver {
1130
1142
  uuid?: string;
1131
1143
  }
1132
1144
  export type XenApiRecord = XenApiSession | XenApiAuth | XenApiSubject | XenApiRole | XenApiTask | XenApiEvent | XenApiPool | XenApiPoolPatch | XenApiPoolUpdate | XenApiVm | XenApiVmMetrics | XenApiVmGuestMetrics | XenApiVmpp | XenApiVmss | XenApiVmAppliance | XenApiDrTask | XenApiHost | XenApiHostCrashdump | XenApiHostPatch | XenApiHostMetrics | XenApiHostCpu | XenApiNetwork | XenApiVif | XenApiVifMetrics | XenApiPif | XenApiPifMetrics | XenApiBond | XenApiVlan | XenApiSm | XenApiSr | XenApiSrStat | XenApiProbeResult | XenApiLvhd | XenApiVdi | XenApiVbd | XenApiVbdMetrics | XenApiPbd | XenApiCrashdump | XenApiVtpm | XenApiConsole | XenApiUser | XenApiDataSource | XenApiBlob | XenApiMessage | XenApiSecret | XenApiTunnel | XenApiNetworkSriov | XenApiPci | XenApiPgpu | XenApiGpuGroup | XenApiVgpu | XenApiVgpuType | XenApiPvsSite | XenApiPvsServer | XenApiPvsProxy | XenApiPvsCacheStorage | XenApiFeature | XenApiSdnController | XenApiVdiNbdServerInfo | XenApiPusb | XenApiUsbGroup | XenApiVusb | XenApiCluster | XenApiClusterHost | XenApiCertificate | XenApiRepository | XenApiObserver;
1133
- export type WrappedXenApiRecord = XenApiHostWrapped | XenApiPoolWrapped | XenApiSrWrapped | XenApiVbdWrapped | XenApiVdiWrapped | XenApiVgpuWrapped | XenApiVifWrapped | XenApiVmWrapped | XenApiVtpmWrapped;
1145
+ export type WrappedXenApiRecord = XenApiHostWrapped | XenApiPifWrapped | XenApiPoolWrapped | XenApiSrWrapped | XenApiVbdWrapped | XenApiVdiWrapped | XenApiVgpuWrapped | XenApiVifWrapped | XenApiVmWrapped | XenApiVtpmWrapped;
1134
1146
  export {};
package/dist/xo.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Branded, DOMAIN_TYPE, HOST_ALLOWED_OPERATIONS, HOST_POWER_STATE, POOL_ALLOWED_OPERATIONS, STORAGE_OPERATIONS, VDI_OPERATIONS, VDI_TYPE, VIF_LOCKING_MODE, VM_OPERATIONS, VM_POWER_STATE } from './common.mjs';
1
+ import type { Branded, DOMAIN_TYPE, HOST_ALLOWED_OPERATIONS, HOST_POWER_STATE, IP_CONFIGURATION_MODE, IPV6_CONFIGURATION_MODE, NETWORK_OPERATIONS, POOL_ALLOWED_OPERATIONS, PRIMARY_ADDRESS_TYPE, STORAGE_OPERATIONS, VDI_OPERATIONS, VDI_TYPE, VIF_LOCKING_MODE, VM_OPERATIONS, VM_POWER_STATE } from './common.mjs';
2
2
  type BaseXapiXo = {
3
3
  $pool: XoPool['id'];
4
4
  /**
@@ -81,6 +81,13 @@ type BaseXoVm = BaseXapiXo & {
81
81
  videoram?: number;
82
82
  viridian: boolean;
83
83
  virtualizationMode: DOMAIN_TYPE;
84
+ vulnerabilities: {
85
+ xsa468: boolean | {
86
+ reason: string;
87
+ driver?: string;
88
+ version?: string;
89
+ };
90
+ };
84
91
  xenStoreData: Record<string, string>;
85
92
  /**
86
93
  * @deprecated use pvDriversVersion instead
@@ -105,6 +112,8 @@ export type XoAlarm = Omit<XoMessage, '$object' | 'body'> & {
105
112
  export type XoGroup = {
106
113
  id: Branded<'group'>;
107
114
  name: string;
115
+ provider?: string;
116
+ providerGroupId?: string;
108
117
  users: XoUser['id'][];
109
118
  };
110
119
  export type XoHost = BaseXapiXo & {
@@ -200,7 +209,20 @@ export type XoMessage = BaseXapiXo & {
200
209
  type: 'message';
201
210
  };
202
211
  export type XoNetwork = BaseXapiXo & {
212
+ MTU: number;
213
+ PIFs: XoPif['id'][];
214
+ VIFs: XoVif['id'][];
215
+ automatic: boolean;
216
+ bridge: string;
217
+ current_operations: Record<string, NETWORK_OPERATIONS>;
218
+ defaultIsLocked: boolean;
203
219
  id: Branded<'network'>;
220
+ insecureNbd?: boolean;
221
+ name_description: string;
222
+ name_label: string;
223
+ nbd?: boolean;
224
+ other_config: Record<string, string>;
225
+ tags: string[];
204
226
  type: 'network';
205
227
  };
206
228
  export type XoPbd = BaseXapiXo & {
@@ -216,8 +238,33 @@ export type XoPgpu = BaseXapiXo & {
216
238
  type: 'PGPU';
217
239
  };
218
240
  export type XoPif = BaseXapiXo & {
241
+ $host: XoHost['id'];
242
+ $network: XoNetwork['id'];
243
+ attached: boolean;
244
+ bondMaster?: XoPif['id'];
245
+ bondSalves?: XoPif['id'][];
246
+ carrier: boolean;
247
+ device: string;
248
+ deviceName?: string;
249
+ disallowUnplug: boolean;
250
+ dns: string;
251
+ gateway: string;
219
252
  id: Branded<'PIF'>;
253
+ ip: string;
254
+ ipv6: string[];
255
+ ipv6Mode: IPV6_CONFIGURATION_MODE;
256
+ isBondMaster: boolean;
257
+ isBondSlave: boolean;
258
+ mac: string;
259
+ management: boolean;
260
+ mode: IP_CONFIGURATION_MODE;
261
+ mtu: number;
262
+ netmask: string;
263
+ physical: boolean;
264
+ primaryAddressType: PRIMARY_ADDRESS_TYPE;
265
+ speed?: number;
220
266
  type: 'PIF';
267
+ vlan: number;
221
268
  };
222
269
  export type XoPool = BaseXapiXo & {
223
270
  auto_poweron: boolean;
@@ -296,9 +343,9 @@ export type XoUser = {
296
343
  email: string;
297
344
  groups: XoGroup['id'][];
298
345
  id: Branded<'user'>;
299
- name: string;
346
+ name?: string;
300
347
  permission: string;
301
- pw_hash: string;
348
+ pw_hash?: string;
302
349
  preferences: Record<string, string>;
303
350
  };
304
351
  export type XoVbd = BaseXapiXo & {
@@ -401,7 +448,7 @@ export type XoVtpm = BaseXapiXo & {
401
448
  id: Branded<'VTPM'>;
402
449
  type: 'VTPM';
403
450
  };
404
- export type XapiXoRecord = XoAlarm | XoHost | XoMessage | XoNetwork | XoPool | XoSr | XoVbd | XoVdi | XoVdiSnapshot | XoVdiUnmanaged | XoVgpu | XoVif | XoVm | XoVmController | XoVmSnapshot | XoVmTemplate | XoVtpm;
451
+ export type XapiXoRecord = XoAlarm | XoHost | XoMessage | XoNetwork | XoPif | XoPool | XoSr | XoVbd | XoVdi | XoVdiSnapshot | XoVdiUnmanaged | XoVgpu | XoVif | XoVm | XoVmController | XoVmSnapshot | XoVmTemplate | XoVtpm;
405
452
  export type NonXapiXoRecord = XoGroup | XoJob | XoSchedule | XoServer | XoUser;
406
453
  export type XoRecord = XapiXoRecord | NonXapiXoRecord;
407
454
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vates/types",
3
3
  "private": false,
4
- "version": "1.2.0",
4
+ "version": "1.4.0",
5
5
  "main": "./dist/index.mjs",
6
6
  "exports": {
7
7
  ".": {