@vates/types 1.26.0 → 1.27.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.
@@ -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, {
@@ -120,6 +143,7 @@ export interface Xapi {
120
143
  sr?: XoSr['id'];
121
144
  bypassAssert?: boolean;
122
145
  }): Promise<void>;
146
+ joinPool(masterAddress: string, masterUsername: string, masterPassword: string, force?: boolean): Promise<void>;
123
147
  listMissingPatches(host: XoHost['id']): Promise<XcpPatches[] | XsPatches[]>;
124
148
  pool_emergencyShutdown(): Promise<void>;
125
149
  resumeVm(id: XoVm['id']): Promise<void>;
@@ -155,6 +179,7 @@ export interface Xapi {
155
179
  }): Promise<XenApiVdi['$ref']>;
156
180
  SR_reclaimSpace(ref: XenApiSr['$ref']): Promise<void>;
157
181
  editVm(id: XoVm['id'], props: EditVmProps, checkLimits?: (limits: Record<string, number>, vm: XenApiVmWrapped) => Promise<void>): Promise<void>;
182
+ editVif(id: XoVif['id'], props: EditVifProps): Promise<void>;
158
183
  startVm(id: XoVm['id'], opts?: {
159
184
  bypassMacAddressesCheck?: boolean;
160
185
  force?: boolean;
@@ -169,7 +194,7 @@ export interface Xapi {
169
194
  }): Promise<void>;
170
195
  VM_export(vmRef: XenApiVm['$ref'], opts?: {
171
196
  cancelToken?: unknown;
172
- compress?: boolean;
197
+ compress?: boolean | 'zstd' | 'gzip';
173
198
  useSnapshot?: boolean;
174
199
  }): ReturnType<Xapi['getResource']>;
175
200
  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;
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' | '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,7 @@ export type XoApp = {
145
135
  expiration: number;
146
136
  user: XoUser;
147
137
  }>;
148
- checkFeatureAuthorization(featureCode: string): Promise<void>;
138
+ checkFeatureAuthorization(featureCode: FeatureCode): Promise<void>;
149
139
  connectXenServer(id: XoServer['id']): Promise<void>;
150
140
  createAclV2Privilege(privilege: Omit<XoAclBasePrivilege, 'id'>, options?: {
151
141
  force?: boolean;
@@ -167,6 +157,12 @@ export type XoApp = {
167
157
  expiresIn?: string | number;
168
158
  userId: XoUser['id'];
169
159
  }): Promise<XoAuthenticationToken>;
160
+ createRemote(params: {
161
+ name: string;
162
+ options?: string;
163
+ proxy?: XoProxy['id'];
164
+ url: string;
165
+ }): Promise<XoBackupRepository>;
170
166
  createUser(params: {
171
167
  name?: string;
172
168
  password?: string;
@@ -187,6 +183,7 @@ export type XoApp = {
187
183
  providerGroup?: string;
188
184
  }): Promise<XoGroup>;
189
185
  disconnectXenServer(id: XoServer['id']): Promise<void>;
186
+ findEnabledScheduleSequenceFromSchedule(id: XoSchedule['id']): Promise<XoSchedule | undefined>;
190
187
  getAclV2Privilege(id: XoAclBasePrivilege['id']): Promise<XoAclBasePrivilege>;
191
188
  getAclV2Privileges(): Promise<XoAclBasePrivilege[]>;
192
189
  getAclV2RolePrivileges(roleId: XoAclRole['id']): Promise<XoAclBasePrivilege[]>;
@@ -196,13 +193,14 @@ export type XoApp = {
196
193
  getAclV2UserPrivileges(userId: XoUser['id']): Promise<XoAclBasePrivilege[]>;
197
194
  getAllGroups(): Promise<XoGroup[]>;
198
195
  getAllProxies(): Promise<XoProxy[]>;
199
- getAllJobs<T extends AnyXoBackupJob['type']>(type: T): Promise<Extract<AnyXoBackupJob, {
196
+ getAllJobs<T extends AnyXoJob['type']>(type: T): Promise<Extract<AnyXoJob, {
200
197
  type: T;
201
198
  }>[]>;
202
199
  getAllJobs(type?: string): Promise<AnyXoJob[]>;
203
200
  getProxy(id: XoProxy['id']): Promise<XoProxy>;
204
201
  getRemote(id: XoBackupRepository['id']): Promise<XoBackupRepository>;
205
202
  getAllRemotes(): Promise<XoBackupRepository[]>;
203
+ removeRemote(id: XoBackupRepository['id']): Promise<void>;
206
204
  getAllRemotesInfo(): Promise<Record<XoBackupRepository['id'], {
207
205
  size?: number;
208
206
  used?: number;
@@ -297,7 +295,14 @@ export type XoApp = {
297
295
  updateGroup(id: XoGroup['id'], updates: {
298
296
  name?: string;
299
297
  }): void;
300
- getAllXapis(): Record<string, XapiConnection>;
298
+ updateRemote(id: XoBackupRepository['id'], params: {
299
+ enabled?: boolean;
300
+ name?: string;
301
+ options?: string | null;
302
+ proxy?: XoProxy['id'] | null;
303
+ url?: string;
304
+ }): Promise<XoBackupRepository>;
305
+ getAllXapis(): Record<string, Xapi>;
301
306
  getObjects(opts?: {
302
307
  filter?: Record<string, unknown>;
303
308
  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.27.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",