@vates/types 1.26.0 → 1.28.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/common.d.mts CHANGED
@@ -605,6 +605,8 @@ export type XapiPoolStats = Record<XoHost['id'], XapiHostStats | {
605
605
  }>;
606
606
  export type TrafficRuleProtocol = (typeof TRAFFIC_RULE_PROTOCOLS)[number];
607
607
  export declare const SDN_CONTROLLER_OF_RULES_KEY = "xo:sdn-controller:of-rules";
608
+ export declare const SDN_CONTROLLER_OF_METHOD_KEY = "xo:sdn-controller:of-method";
609
+ export declare const SDN_CONTROLLER_OF_FORMAT_KEY = "xo:sdn-controller:of-format";
608
610
  export declare const TRAFFIC_RULE_PROTOCOLS: readonly ["ARP", "ICMP", "IP", "TCP", "UDP"];
609
611
  export declare const TRAFFIC_RULE_PROTOCOLS_WITH_PORT: readonly TrafficRuleProtocol[];
610
612
  export type TrafficRuleTargetType = XoNetwork['type'] | XoVif['type'];
package/dist/common.mjs CHANGED
@@ -452,5 +452,7 @@ export const SUPPORTED_VDI_FORMAT = {
452
452
  qcow2: 'qcow2',
453
453
  };
454
454
  export const SDN_CONTROLLER_OF_RULES_KEY = 'xo:sdn-controller:of-rules';
455
+ export const SDN_CONTROLLER_OF_METHOD_KEY = 'xo:sdn-controller:of-method';
456
+ export const SDN_CONTROLLER_OF_FORMAT_KEY = 'xo:sdn-controller:of-format';
455
457
  export const TRAFFIC_RULE_PROTOCOLS = ['ARP', 'ICMP', 'IP', 'TCP', 'UDP'];
456
458
  export const TRAFFIC_RULE_PROTOCOLS_WITH_PORT = ['TCP', 'UDP'];
@@ -51,6 +51,14 @@ export interface EditVmProps {
51
51
  virtualizationMode?: 'pv' | 'hvm';
52
52
  xenStoreData?: Record<string, string | null>;
53
53
  }
54
+ /** Properties accepted by {@link Xapi.editVif}. */
55
+ export interface EditVifProps {
56
+ ipv4Allowed?: string[];
57
+ ipv6Allowed?: string[];
58
+ lockingMode?: VIF_LOCKING_MODE;
59
+ rateLimit?: number | null;
60
+ txChecksumming?: boolean;
61
+ }
54
62
  export type XcpPatches = {
55
63
  changelog?: {
56
64
  author: string;
@@ -80,6 +88,21 @@ export type XsPatches = {
80
88
  uuid?: string;
81
89
  };
82
90
  export interface Xapi {
91
+ status: string;
92
+ pool?: {
93
+ uuid: string;
94
+ };
95
+ sessionId: string;
96
+ _auth: {
97
+ user: string;
98
+ password: string;
99
+ };
100
+ _url: {
101
+ protocol: string;
102
+ hostname: string;
103
+ hostnameRaw: string;
104
+ port?: string;
105
+ };
83
106
  call: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
84
107
  callAsync: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
85
108
  barrier<T extends XenApiRecord>(ref: T['$ref']): Promise<Extract<WrappedXenApiRecord, {
@@ -112,6 +135,9 @@ export interface Xapi {
112
135
  deleteVif(vifId: XoVif['id']): Promise<void>;
113
136
  disconnectVif(vifId: XoVif['id']): Promise<void>;
114
137
  exportVmOva(vmRef: XenApiVm['$ref']): Promise<PassThrough>;
138
+ emergencyShutdownHost(hostId: XoHost['id']): Promise<void>;
139
+ ejectHostFromPool(hostId: XoHost['id']): Promise<void>;
140
+ host_smartReboot(hostRef: XenApiHost['$ref'], bypassBlockedSuspend?: boolean, bypassCurrentVmCheck?: boolean): Promise<void>;
115
141
  migrateVm(vmId: XoVm['id'], hostXapi: Xapi, hostId: XoHost['id'], opts?: {
116
142
  force?: boolean;
117
143
  mapVdisSrs?: Record<XoVdi['id'], XoSr['id']>;
@@ -120,6 +146,7 @@ export interface Xapi {
120
146
  sr?: XoSr['id'];
121
147
  bypassAssert?: boolean;
122
148
  }): Promise<void>;
149
+ joinPool(masterAddress: string, masterUsername: string, masterPassword: string, force?: boolean): Promise<void>;
123
150
  listMissingPatches(host: XoHost['id']): Promise<XcpPatches[] | XsPatches[]>;
124
151
  pool_emergencyShutdown(): Promise<void>;
125
152
  resumeVm(id: XoVm['id']): Promise<void>;
@@ -140,6 +167,13 @@ export interface Xapi {
140
167
  vm: XenApiVmWrapped;
141
168
  }>;
142
169
  forgetSr(id: XoSr['id']): Promise<void>;
170
+ forgetHost(hostId: XoHost['id']): Promise<void>;
171
+ powerOnHost(hostId: XoHost['id']): Promise<void>;
172
+ rebootHost(hostId: XoHost['id'], force?: boolean): Promise<void>;
173
+ shutdownHost(hostId: XoHost['id'], opts?: {
174
+ force?: boolean;
175
+ bypassEvacuate?: boolean;
176
+ }): Promise<void>;
143
177
  SR_importVdi(ref: XenApiSr['$ref'], stream: Readable, opts?: {
144
178
  format?: SUPPORTED_VDI_FORMAT;
145
179
  name_description?: XoVdi['name_description'];
@@ -155,6 +189,7 @@ export interface Xapi {
155
189
  }): Promise<XenApiVdi['$ref']>;
156
190
  SR_reclaimSpace(ref: XenApiSr['$ref']): Promise<void>;
157
191
  editVm(id: XoVm['id'], props: EditVmProps, checkLimits?: (limits: Record<string, number>, vm: XenApiVmWrapped) => Promise<void>): Promise<void>;
192
+ editVif(id: XoVif['id'], props: EditVifProps): Promise<void>;
158
193
  startVm(id: XoVm['id'], opts?: {
159
194
  bypassMacAddressesCheck?: boolean;
160
195
  force?: boolean;
@@ -169,7 +204,7 @@ export interface Xapi {
169
204
  }): Promise<void>;
170
205
  VM_export(vmRef: XenApiVm['$ref'], opts?: {
171
206
  cancelToken?: unknown;
172
- compress?: boolean;
207
+ compress?: boolean | 'zstd' | 'gzip';
173
208
  useSnapshot?: boolean;
174
209
  }): ReturnType<Xapi['getResource']>;
175
210
  VM_import(stream: Readable, srRef?: XenApiSr['$ref'], onVmCreation?: null | ((vm: XenApiVm) => unknown)): Promise<XenApiVm['$ref']>;
@@ -115,6 +115,7 @@ export interface XenApiPool {
115
115
  ha_host_failures_to_tolerate: number;
116
116
  ha_overcommitted: boolean;
117
117
  ha_plan_exists_for: number;
118
+ ha_reboot_vm_on_internal_shutdown?: boolean;
118
119
  ha_statefiles: string[];
119
120
  health_check_config: Record<string, string>;
120
121
  igmp_snooping_enabled?: boolean;
@@ -483,7 +484,9 @@ export interface XenApiHost {
483
484
  uuid: string;
484
485
  virtual_hardware_platform_versions: number[];
485
486
  }
486
- export type XenApiHostWrapped = WrapperXenApi<XenApiHost, 'host', XenApiHostCallMethods>;
487
+ export interface XenApiHostWrapped extends WrapperXenApi<XenApiHost, 'host', XenApiHostCallMethods> {
488
+ $restartAgent(): Promise<void>;
489
+ }
487
490
  export interface XenApiHostCrashdump {
488
491
  $ref: Branded<'host_crashdump'>;
489
492
  host: XenApiHost['$ref'];
package/dist/xo-app.d.mts CHANGED
@@ -1,19 +1,8 @@
1
1
  import { EventEmitter } from 'node:stream';
2
- import type { AnyXoBackupJob, AnyXoJob, AnyXoLog, XapiXoRecord, XoAuthenticationToken, XoBackupRepository, XoConfigBackupArchive, XoGroup, XoHost, XoPool, XoPoolBackupArchive, XoProxy, XoSchedule, XoServer, XoTask, XoUser, XoVm, XoVmBackupArchive } from './xo.mjs';
2
+ import type { AnyXoJob, AnyXoLog, XapiXoRecord, XoAuthenticationToken, XoBackupRepository, XoConfigBackupArchive, XoGroup, XoHost, XoPool, XoPoolBackupArchive, XoProxy, XoSchedule, XoServer, XoTask, XoUser, XoVif, XoVm, XoVmBackupArchive } from './xo.mjs';
3
3
  import { VatesTask } from './lib/vates-task.mjs';
4
4
  import { Xapi, XapiHostStats, XapiPoolStats, XapiStatsGranularity, XapiVmStats, XenApiGpuGroupWrapped, XenApiHostWrapped, XenApiMessageWrapped, XenApiNetworkWrapped, XenApiPbdWrapped, XenApiPciWrapped, XenApiPgpuWrapped, XenApiPifWrapped, XenApiPoolWrapped, XenApiSmWrapped, XenApiSrWrapped, XenApiVbdWrapped, XenApiVdiWrapped, XenApiVgpuTypeWrapped, XenApiVgpuWrapped, XenApiVifWrapped, XenApiVmWrapped, XenApiVtpmWrapped, XoAclBasePrivilege, XoAclRole, XoGroupRole, XoUserRole } from './index.mjs';
5
- export type XapiConnection = Xapi & {
6
- status: string;
7
- pool?: {
8
- uuid: string;
9
- };
10
- sessionId: string;
11
- _url?: {
12
- protocol: string;
13
- hostname: string;
14
- port?: string;
15
- };
16
- };
5
+ type FeatureCode = 'BACKUP.DELTA' | 'BACKUP.DELTA_REPLICATION' | 'BACKUP.FULL' | 'BACKUP.HEALTHCHECK' | 'BACKUP.METADATA' | 'BACKUP.MIRROR' | 'BACKUP.WITH_RAM' | 'BACKUP.SMART_BACKUP' | 'BACKUP.S3' | 'DOCKER' | 'EXPORT.XVA' | 'LIST_MISSING_PATCHES' | 'POOL_EMERGENCY_SHUTDOWN' | 'RBAC' | 'ROLLING_POOL_UPDATE' | 'ROLLING_POOL_REBOOT' | 'SMART_REBOOT' | 'WARM_MIGRATION' | 'PLUGIN.OPENMETRICS';
17
6
  type XapiRecordByXapiXoRecord = {
18
7
  gpuGroup: XenApiGpuGroupWrapped;
19
8
  host: XenApiHostWrapped;
@@ -124,6 +113,7 @@ export type XoApp = {
124
113
  user?: XoUser;
125
114
  permission?: XoUser['permission'] | 'none' | null;
126
115
  };
116
+ allocIpAddresses(vifId: XoVif['id'], addAddresses?: string[], removeAddresses?: string[]): Promise<void>;
127
117
  addAclV2GroupRole(groupId: XoGroup['id'], roleId: XoAclRole['id']): Promise<XoGroupRole>;
128
118
  addAclV2UserRole(userId: XoUser['id'], roleId: XoAclRole['id']): Promise<XoUserRole>;
129
119
  addUserToGroup: (userId: XoUser['id'], groupId: XoGroup['id']) => Promise<void>;
@@ -145,7 +135,8 @@ export type XoApp = {
145
135
  expiration: number;
146
136
  user: XoUser;
147
137
  }>;
148
- checkFeatureAuthorization(featureCode: string): Promise<void>;
138
+ backupGuard(poolId: XoPool['id']): Promise<void>;
139
+ checkFeatureAuthorization(featureCode: FeatureCode): Promise<void>;
149
140
  connectXenServer(id: XoServer['id']): Promise<void>;
150
141
  createAclV2Privilege(privilege: Omit<XoAclBasePrivilege, 'id'>, options?: {
151
142
  force?: boolean;
@@ -167,6 +158,12 @@ export type XoApp = {
167
158
  expiresIn?: string | number;
168
159
  userId: XoUser['id'];
169
160
  }): Promise<XoAuthenticationToken>;
161
+ createRemote(params: {
162
+ name: string;
163
+ options?: string;
164
+ proxy?: XoProxy['id'];
165
+ url: string;
166
+ }): Promise<XoBackupRepository>;
170
167
  createUser(params: {
171
168
  name?: string;
172
169
  password?: string;
@@ -181,12 +178,14 @@ export type XoApp = {
181
178
  }): Promise<boolean>;
182
179
  deleteGroup(id: XoGroup['id']): Promise<void>;
183
180
  deleteUser(id: XoUser['id']): Promise<void>;
181
+ detachHostFromPool(hostId: XoHost['id']): Promise<void>;
184
182
  createGroup(params: {
185
183
  name: string;
186
184
  provider?: string;
187
185
  providerGroup?: string;
188
186
  }): Promise<XoGroup>;
189
187
  disconnectXenServer(id: XoServer['id']): Promise<void>;
188
+ findEnabledScheduleSequenceFromSchedule(id: XoSchedule['id']): Promise<XoSchedule | undefined>;
190
189
  getAclV2Privilege(id: XoAclBasePrivilege['id']): Promise<XoAclBasePrivilege>;
191
190
  getAclV2Privileges(): Promise<XoAclBasePrivilege[]>;
192
191
  getAclV2RolePrivileges(roleId: XoAclRole['id']): Promise<XoAclBasePrivilege[]>;
@@ -196,13 +195,14 @@ export type XoApp = {
196
195
  getAclV2UserPrivileges(userId: XoUser['id']): Promise<XoAclBasePrivilege[]>;
197
196
  getAllGroups(): Promise<XoGroup[]>;
198
197
  getAllProxies(): Promise<XoProxy[]>;
199
- getAllJobs<T extends AnyXoBackupJob['type']>(type: T): Promise<Extract<AnyXoBackupJob, {
198
+ getAllJobs<T extends AnyXoJob['type']>(type: T): Promise<Extract<AnyXoJob, {
200
199
  type: T;
201
200
  }>[]>;
202
201
  getAllJobs(type?: string): Promise<AnyXoJob[]>;
203
202
  getProxy(id: XoProxy['id']): Promise<XoProxy>;
204
203
  getRemote(id: XoBackupRepository['id']): Promise<XoBackupRepository>;
205
204
  getAllRemotes(): Promise<XoBackupRepository[]>;
205
+ removeRemote(id: XoBackupRepository['id']): Promise<void>;
206
206
  getAllRemotesInfo(): Promise<Record<XoBackupRepository['id'], {
207
207
  size?: number;
208
208
  used?: number;
@@ -256,6 +256,9 @@ export type XoApp = {
256
256
  _forceRefresh?: boolean;
257
257
  vmId: XoVm['id'];
258
258
  }): Promise<Record<XoBackupRepository['id'], Record<XoVm['id'], XoVmBackupArchive[]>>>;
259
+ pingRemote(id: XoBackupRepository['id']): Promise<{
260
+ success: true;
261
+ }>;
259
262
  /** Allow to add a new server in the DB (XCP-ng/XenServer) */
260
263
  registerXenServer(body: Pick<XoServer, 'host' | 'httpProxy' | 'label' | 'username'> & {
261
264
  allowUnauthorized?: XoServer['allowUnauthorized'];
@@ -274,6 +277,16 @@ export type XoApp = {
274
277
  removeUserFromGroup(userId: XoUser['id'], id: XoGroup['id']): Promise<void>;
275
278
  runJob(job: AnyXoJob, schedule: XoSchedule): void;
276
279
  runWithApiContext: (user: XoUser | undefined, fn: () => void) => Promise<unknown>;
280
+ testRemote(id: XoBackupRepository['id']): Promise<{
281
+ success: true;
282
+ readRate: number;
283
+ writeRate: number;
284
+ } | {
285
+ success: false;
286
+ step: string;
287
+ file: string;
288
+ error: unknown;
289
+ }>;
277
290
  /** Remove a server from the DB (XCP-ng/XenServer) */
278
291
  unregisterXenServer(id: XoServer['id']): Promise<void>;
279
292
  updateUser(id: XoUser['id'], updates: {
@@ -297,7 +310,14 @@ export type XoApp = {
297
310
  updateGroup(id: XoGroup['id'], updates: {
298
311
  name?: string;
299
312
  }): void;
300
- getAllXapis(): Record<string, XapiConnection>;
313
+ updateRemote(id: XoBackupRepository['id'], params: {
314
+ enabled?: boolean;
315
+ name?: string;
316
+ options?: string | null;
317
+ proxy?: XoProxy['id'] | null;
318
+ url?: string;
319
+ }): Promise<XoBackupRepository>;
320
+ getAllXapis(): Record<string, Xapi>;
301
321
  getObjects(opts?: {
302
322
  filter?: Record<string, unknown>;
303
323
  limit?: number;
package/dist/xo.d.mts CHANGED
@@ -400,6 +400,7 @@ export type XoPool = BaseXapiXo & {
400
400
  current_operations: Record<string, POOL_ALLOWED_OPERATIONS>;
401
401
  default_SR?: XoSr['id'];
402
402
  HA_enabled: boolean;
403
+ haRebootVmOnInternalShutdown: boolean;
403
404
  haSrs: XoSr['id'][];
404
405
  id: Branded<'pool'>;
405
406
  master: XoHost['id'];
@@ -541,6 +542,18 @@ export type XoMirrorBackupJob = BaseXoJob & {
541
542
  };
542
543
  export type XoJob = BaseXoJob & {
543
544
  type: 'call';
545
+ method: string;
546
+ paramsVector?: {
547
+ type: string;
548
+ items: {
549
+ type?: string;
550
+ values?: {
551
+ schedules?: XoSchedule['id'][];
552
+ [key: string]: unknown;
553
+ }[];
554
+ [key: string]: unknown;
555
+ }[];
556
+ };
544
557
  };
545
558
  export type XoSchedule = {
546
559
  cron: string;
@@ -773,7 +786,7 @@ export type XoVtpm = BaseXapiXo & {
773
786
  type: 'VTPM';
774
787
  };
775
788
  export type XapiXoRecord = XoAlarm | XoGpuGroup | XoHost | XoMessage | XoNetwork | XoPbd | XoPci | XoPgpu | XoPif | XoPool | XoSr | XoVbd | XoVdi | XoVdiSnapshot | XoVdiUnmanaged | XoVgpu | XoVgpuType | XoVif | XoVm | XoVmController | XoVmSnapshot | XoVmTemplate | XoVtpm | XoSm;
776
- export type NonXapiXoRecord<TActionsByResource extends XoAclSupportedActionsByResource = never, TResource extends string = never> = AnyXoBackupArchive | AnyXoJob | AnyXoLog | XoGroup | XoProxy | XoGroup | XoProxy | XoJob | XoBackupRepository | XoSchedule | XoServer | XoTask | XoUser | XoAclRole | XoAclPrivilege<TActionsByResource, TResource>;
789
+ export type NonXapiXoRecord<TActionsByResource extends XoAclSupportedActionsByResource = never, TResource extends string = never> = AnyXoBackupArchive | AnyXoJob | AnyXoLog | XoGroup | XoProxy | XoJob | XoBackupRepository | XoSchedule | XoServer | XoTask | XoUser | XoAclRole | XoAclPrivilege<TActionsByResource, TResource>;
777
790
  export type XoRecord<TActionsByResource extends XoAclSupportedActionsByResource = never, TResource extends string = never> = XapiXoRecord | NonXapiXoRecord<TActionsByResource, TResource>;
778
791
  export type AnyXoVm = XoVm | XoVmSnapshot | XoVmTemplate | XoVmController;
779
792
  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.26.0",
4
+ "version": "1.28.0",
5
5
  "main": "./dist/index.mjs",
6
6
  "exports": {
7
7
  ".": {
@@ -32,7 +32,7 @@
32
32
  "devDependencies": {
33
33
  "@eslint/js": "^9.19.0",
34
34
  "typescript": "~5.6.3",
35
- "typescript-eslint": "^8.23.0"
35
+ "typescript-eslint": "^8.61.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsc",