@vates/types 1.16.0 → 1.17.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.d.mts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/lib/xen-orchestra-xapi.d.mts +22 -1
- package/dist/xen-api.d.mts +1 -0
- package/dist/xo-app.d.mts +230 -0
- package/dist/xo-app.mjs +1 -0
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { WrappedXenApiRecord, XenApiHost, XenApiNetworkWrapped, XenApiRecord, XenApiSr, XenApiTask, XenApiVdi, XenApiVm, XenApiVmWrapped } from '../xen-api.mjs';
|
|
1
|
+
import { WrappedXenApiRecord, XenApiHost, XenApiNetworkWrapped, XenApiRecord, XenApiSr, XenApiTask, XenApiVbd, XenApiVdi, XenApiVm, XenApiVmWrapped, XenApiVtpm } from '../xen-api.mjs';
|
|
2
|
+
import type { OPAQUE_REF_NULL, VBD_MODE, VBD_TYPE } from '../common.mjs';
|
|
2
3
|
import type { PassThrough, Readable } from 'node:stream';
|
|
3
4
|
import type { XoGpuGroup, XoVgpuType, XoHost, XoNetwork, XoPif, XoSr, XoUser, XoVdi, XoVm, XoVmTemplate } from '../xo.mjs';
|
|
4
5
|
import type { SUPPORTED_VDI_FORMAT } from '../common.mjs';
|
|
@@ -126,9 +127,24 @@ export interface Xapi {
|
|
|
126
127
|
gpuGroup?: XoGpuGroup['id'];
|
|
127
128
|
copyHostBiosStrings?: boolean;
|
|
128
129
|
hvmBootFirmware?: 'uefi' | 'bios';
|
|
130
|
+
secureBoot?: boolean;
|
|
129
131
|
}, checkLimits?: boolean, creatorId?: XoUser['id'], opts?: {
|
|
130
132
|
destroyAllVifs: boolean;
|
|
131
133
|
}): Promise<XenApiVmWrapped>;
|
|
134
|
+
VBD_create(params: {
|
|
135
|
+
bootable?: boolean;
|
|
136
|
+
empty?: boolean;
|
|
137
|
+
mode?: VBD_MODE;
|
|
138
|
+
other_config?: Record<string, string>;
|
|
139
|
+
qos_algorithm_params?: Record<string, string>;
|
|
140
|
+
qos_algorithm_type?: string;
|
|
141
|
+
type?: VBD_TYPE;
|
|
142
|
+
unpluggable?: boolean;
|
|
143
|
+
userdevice?: string;
|
|
144
|
+
VDI: XenApiVdi['$ref'] | OPAQUE_REF_NULL;
|
|
145
|
+
VM: XenApiVm['$ref'];
|
|
146
|
+
}): Promise<XenApiVbd['$ref']>;
|
|
147
|
+
VBD_destroy(vbdRef: XenApiVbd['$ref']): Promise<void>;
|
|
132
148
|
VDI_destroy(vdiRef: XenApiVdi['$ref']): Promise<void>;
|
|
133
149
|
VDI_destroyCloudInitConfig(vdiRef: XenApiVdi['$ref'], opts?: {
|
|
134
150
|
timeLimit?: number;
|
|
@@ -161,4 +177,9 @@ export interface Xapi {
|
|
|
161
177
|
body: Readable;
|
|
162
178
|
}>;
|
|
163
179
|
isHyperThreadingEnabled(hostId: XoHost['id']): Promise<boolean | null>;
|
|
180
|
+
VTPM_create(params: {
|
|
181
|
+
VM: XenApiVm['$ref'];
|
|
182
|
+
is_unique?: boolean;
|
|
183
|
+
contents?: string;
|
|
184
|
+
}): Promise<XenApiVtpm['$ref']>;
|
|
164
185
|
}
|
package/dist/xen-api.d.mts
CHANGED
|
@@ -894,6 +894,7 @@ export interface XenApiMessage {
|
|
|
894
894
|
timestamp: string;
|
|
895
895
|
uuid: string;
|
|
896
896
|
}
|
|
897
|
+
export type XenApiMessageWrapped = WrapperXenApi<XenApiMessage, 'message'>;
|
|
897
898
|
export interface XenApiSecret {
|
|
898
899
|
$ref: Branded<'secret'>;
|
|
899
900
|
other_config: Record<string, string>;
|
|
@@ -0,0 +1,230 @@
|
|
|
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';
|
|
3
|
+
import { VatesTask } from './lib/vates-task.mjs';
|
|
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 } 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
|
+
};
|
|
17
|
+
type XapiRecordByXapiXoRecord = {
|
|
18
|
+
gpuGroup: XenApiGpuGroupWrapped;
|
|
19
|
+
host: XenApiHostWrapped;
|
|
20
|
+
message: XenApiMessageWrapped;
|
|
21
|
+
network: XenApiNetworkWrapped;
|
|
22
|
+
PBD: XenApiPbdWrapped;
|
|
23
|
+
PCI: XenApiPciWrapped;
|
|
24
|
+
PGPU: XenApiPgpuWrapped;
|
|
25
|
+
PIF: XenApiPifWrapped;
|
|
26
|
+
pool: XenApiPoolWrapped;
|
|
27
|
+
SR: XenApiSrWrapped;
|
|
28
|
+
SM: XenApiSmWrapped;
|
|
29
|
+
VBD: XenApiVbdWrapped;
|
|
30
|
+
VDI: XenApiVdiWrapped;
|
|
31
|
+
'VDI-snapshot': XenApiVdiWrapped;
|
|
32
|
+
'VDI-unmanaged': XenApiVdiWrapped;
|
|
33
|
+
vgpu: XenApiVgpuWrapped;
|
|
34
|
+
vgpuType: XenApiVgpuTypeWrapped;
|
|
35
|
+
VIF: XenApiVifWrapped;
|
|
36
|
+
VM: XenApiVmWrapped;
|
|
37
|
+
'VM-controller': XenApiVmWrapped;
|
|
38
|
+
'VM-snapshot': XenApiVmWrapped;
|
|
39
|
+
'VM-template': XenApiVmWrapped;
|
|
40
|
+
VTPM: XenApiVtpmWrapped;
|
|
41
|
+
};
|
|
42
|
+
export type XoApp = {
|
|
43
|
+
config: {
|
|
44
|
+
getOptional(path: string): Record<string, string> | undefined;
|
|
45
|
+
getOptionalDuration(path: string): number | undefined;
|
|
46
|
+
getGuiRoutes(): Promise<{
|
|
47
|
+
default: {
|
|
48
|
+
url: string;
|
|
49
|
+
path: string;
|
|
50
|
+
};
|
|
51
|
+
v5?: {
|
|
52
|
+
url: string;
|
|
53
|
+
path: string;
|
|
54
|
+
};
|
|
55
|
+
v6?: {
|
|
56
|
+
url: string;
|
|
57
|
+
path: string;
|
|
58
|
+
};
|
|
59
|
+
[key: string]: undefined | {
|
|
60
|
+
url: string;
|
|
61
|
+
path: string;
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
objects: EventEmitter & {
|
|
66
|
+
allIndexes: {
|
|
67
|
+
type: {
|
|
68
|
+
getEventEmitterByType(type: XapiXoRecord['type']): EventEmitter;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
tasks: EventEmitter & {
|
|
73
|
+
abort(id: XoTask['id'], reason?: string): Promise<void>;
|
|
74
|
+
clearLogs(): Promise<void>;
|
|
75
|
+
create: (params: {
|
|
76
|
+
name: string;
|
|
77
|
+
objectId?: string;
|
|
78
|
+
type?: string;
|
|
79
|
+
}) => VatesTask;
|
|
80
|
+
deleteLog(id: XoTask['id']): Promise<void>;
|
|
81
|
+
get(id: XoTask['id']): Promise<XoTask>;
|
|
82
|
+
list(opts?: {
|
|
83
|
+
filter?: string | ((obj: XoTask) => boolean);
|
|
84
|
+
limit?: number;
|
|
85
|
+
}): AsyncGenerator<XoTask>;
|
|
86
|
+
watch(id: XoTask['id'], cb: (task: XoTask) => void): Promise<() => void>;
|
|
87
|
+
};
|
|
88
|
+
apiContext: {
|
|
89
|
+
user?: XoUser;
|
|
90
|
+
permission?: XoUser['permission'] | 'none' | null;
|
|
91
|
+
};
|
|
92
|
+
addUserToGroup: (userId: XoUser['id'], groupId: XoGroup['id']) => Promise<void>;
|
|
93
|
+
authenticateUser: (credentials: {
|
|
94
|
+
token?: string;
|
|
95
|
+
username?: string;
|
|
96
|
+
password?: string;
|
|
97
|
+
}, userData?: {
|
|
98
|
+
ip?: string;
|
|
99
|
+
}, opts?: {
|
|
100
|
+
bypassOtp?: boolean;
|
|
101
|
+
}) => Promise<{
|
|
102
|
+
bypassOtp: boolean;
|
|
103
|
+
expiration: number;
|
|
104
|
+
user: XoUser;
|
|
105
|
+
}>;
|
|
106
|
+
checkFeatureAuthorization(featureCode: string): Promise<void>;
|
|
107
|
+
connectXenServer(id: XoServer['id']): Promise<void>;
|
|
108
|
+
createAuthenticationToken(opts: {
|
|
109
|
+
client?: {
|
|
110
|
+
id?: string;
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
};
|
|
113
|
+
description?: string;
|
|
114
|
+
expiresIn?: string | number;
|
|
115
|
+
userId: XoUser['id'];
|
|
116
|
+
}): Promise<XoAuthenticationToken>;
|
|
117
|
+
createUser(params: {
|
|
118
|
+
name?: string;
|
|
119
|
+
password?: string;
|
|
120
|
+
[key: string]: unknown;
|
|
121
|
+
}): Promise<XoUser>;
|
|
122
|
+
deleteGroup(id: XoGroup['id']): Promise<void>;
|
|
123
|
+
deleteUser(id: XoUser['id']): Promise<void>;
|
|
124
|
+
createGroup(params: {
|
|
125
|
+
name: string;
|
|
126
|
+
provider?: string;
|
|
127
|
+
providerGroup?: string;
|
|
128
|
+
}): Promise<XoGroup>;
|
|
129
|
+
disconnectXenServer(id: XoServer['id']): Promise<void>;
|
|
130
|
+
getAllGroups(): Promise<XoGroup[]>;
|
|
131
|
+
getAllProxies(): Promise<XoProxy[]>;
|
|
132
|
+
getAllJobs<T extends AnyXoBackupJob['type']>(type: T): Promise<Extract<AnyXoBackupJob, {
|
|
133
|
+
type: T;
|
|
134
|
+
}>[]>;
|
|
135
|
+
getAllJobs(type?: string): Promise<AnyXoJob[]>;
|
|
136
|
+
getProxy(id: XoProxy['id']): Promise<XoProxy>;
|
|
137
|
+
getRemote(id: XoBackupRepository['id']): Promise<XoBackupRepository>;
|
|
138
|
+
getAllRemotes(): Promise<XoBackupRepository[]>;
|
|
139
|
+
getAllRemotesInfo(): Promise<Record<XoBackupRepository['id'], {
|
|
140
|
+
size?: number;
|
|
141
|
+
used?: number;
|
|
142
|
+
available?: number;
|
|
143
|
+
encryption?: {
|
|
144
|
+
algorithm: string;
|
|
145
|
+
isLegacy: boolean;
|
|
146
|
+
recommanded: string;
|
|
147
|
+
};
|
|
148
|
+
}>>;
|
|
149
|
+
getAllSchedules(): Promise<XoSchedule[]>;
|
|
150
|
+
getAllUsers(): Promise<XoUser[]>;
|
|
151
|
+
getAllXenServers(): Promise<XoServer[]>;
|
|
152
|
+
getAuthenticationTokensForUser(userId: XoUser['id']): Promise<XoAuthenticationToken[]>;
|
|
153
|
+
getBackupNgLogs(): Promise<Record<string, AnyXoLog>>;
|
|
154
|
+
getBackupNgLogs(id: AnyXoLog['id']): Promise<AnyXoLog>;
|
|
155
|
+
getBackupNgLogsSorted(opts: {
|
|
156
|
+
after?: number;
|
|
157
|
+
before?: number;
|
|
158
|
+
filter: (log: AnyXoLog) => boolean;
|
|
159
|
+
limit?: number;
|
|
160
|
+
}): Promise<AnyXoLog[]>;
|
|
161
|
+
getGroup(id: XoGroup['id']): Promise<XoGroup>;
|
|
162
|
+
getHVSupportedVersions: undefined | (() => Promise<{
|
|
163
|
+
[key: XoHost['productBrand']]: string;
|
|
164
|
+
}>);
|
|
165
|
+
getJob<T extends AnyXoJob>(id: T['id']): Promise<T>;
|
|
166
|
+
getObject: <T extends XapiXoRecord>(id: T['id'], type?: T['type'] | T['type'][]) => T;
|
|
167
|
+
getObjectsByType: <T extends XapiXoRecord>(type: T['type'], opts?: {
|
|
168
|
+
filter?: string | ((obj: T) => boolean);
|
|
169
|
+
limit?: number;
|
|
170
|
+
}) => Record<T['id'], T> | undefined;
|
|
171
|
+
getTotalBackupSizeOnRemote(id: XoBackupRepository['id']): Promise<{
|
|
172
|
+
onDisk: number;
|
|
173
|
+
}>;
|
|
174
|
+
getSchedule(id: XoSchedule['id']): Promise<XoSchedule>;
|
|
175
|
+
getUser: (id: XoUser['id']) => Promise<XoUser>;
|
|
176
|
+
getXapi(maybeId: XapiXoRecord['id'] | XapiXoRecord): Xapi;
|
|
177
|
+
getXapiHostStats: (hostId: XoHost['id'], granularity?: XapiStatsGranularity) => Promise<XapiHostStats>;
|
|
178
|
+
getXapiObject: <T extends XapiXoRecord>(maybeId: T['id'] | T, type: T['type'] | T['type'][]) => XapiRecordByXapiXoRecord[T['type']];
|
|
179
|
+
getXapiPoolStats(poolId: XoPool['id'], granularity?: XapiStatsGranularity): Promise<XapiPoolStats>;
|
|
180
|
+
getXapiVmStats: (vmId: XoVm['id'], granularity?: XapiStatsGranularity) => Promise<XapiVmStats>;
|
|
181
|
+
getXenServer(id: XoServer['id']): Promise<XoServer>;
|
|
182
|
+
hasFeatureAuthorization(featureCode: string): Promise<boolean>;
|
|
183
|
+
hasObject<T extends XapiXoRecord>(id: T['id'], type: T['type']): boolean;
|
|
184
|
+
listMetadataBackups(backupRepositoryIds: XoBackupRepository['id'][]): Promise<{
|
|
185
|
+
xo: Record<XoBackupRepository['id'], XoConfigBackupArchive[]>;
|
|
186
|
+
pool: Record<XoBackupRepository['id'], Record<XoPool['id'], XoPoolBackupArchive[]>>;
|
|
187
|
+
}>;
|
|
188
|
+
listVmBackupsNg(backupRepositoryIds: XoBackupRepository['id'][], opts?: {
|
|
189
|
+
_forceRefresh?: boolean;
|
|
190
|
+
vmId: XoVm['id'];
|
|
191
|
+
}): Promise<Record<XoBackupRepository['id'], Record<XoVm['id'], XoVmBackupArchive[]>>>;
|
|
192
|
+
/** Allow to add a new server in the DB (XCP-ng/XenServer) */
|
|
193
|
+
registerXenServer(body: Pick<XoServer, 'host' | 'httpProxy' | 'label' | 'username'> & {
|
|
194
|
+
allowUnauthorized?: XoServer['allowUnauthorized'];
|
|
195
|
+
password: string;
|
|
196
|
+
readOnly?: XoServer['readOnly'];
|
|
197
|
+
}): Promise<XoServer>;
|
|
198
|
+
rollingPoolReboot(pool: XoPool, opts?: {
|
|
199
|
+
parentTask?: VatesTask;
|
|
200
|
+
}): Promise<void>;
|
|
201
|
+
rollingPoolUpdate(pool: XoPool, opts?: {
|
|
202
|
+
rebootVm?: boolean;
|
|
203
|
+
parentTask?: VatesTask;
|
|
204
|
+
}): Promise<void>;
|
|
205
|
+
removeUserFromGroup(userId: XoUser['id'], id: XoGroup['id']): Promise<void>;
|
|
206
|
+
runJob(job: AnyXoJob, schedule: XoSchedule): void;
|
|
207
|
+
runWithApiContext: (user: XoUser | undefined, fn: () => void) => Promise<unknown>;
|
|
208
|
+
/** Remove a server from the DB (XCP-ng/XenServer) */
|
|
209
|
+
unregisterXenServer(id: XoServer['id']): Promise<void>;
|
|
210
|
+
updateUser(id: XoUser['id'], updates: {
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated
|
|
213
|
+
*/
|
|
214
|
+
email?: string;
|
|
215
|
+
authProviders?: Record<string, string>;
|
|
216
|
+
name?: string;
|
|
217
|
+
password?: string;
|
|
218
|
+
permission?: string;
|
|
219
|
+
preferences?: Record<string, string>;
|
|
220
|
+
}): Promise<void>;
|
|
221
|
+
updateGroup(id: XoGroup['id'], updates: {
|
|
222
|
+
name?: string;
|
|
223
|
+
}): void;
|
|
224
|
+
getAllXapis(): Record<string, XapiConnection>;
|
|
225
|
+
getObjects(opts?: {
|
|
226
|
+
filter?: Record<string, unknown>;
|
|
227
|
+
limit?: number;
|
|
228
|
+
}): Record<string, XapiXoRecord>;
|
|
229
|
+
};
|
|
230
|
+
export {};
|
package/dist/xo-app.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vates/types",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.17.0",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"types": "./dist/index.d.mts"
|
|
10
10
|
},
|
|
11
11
|
"./xo": "./dist/xo.d.mts",
|
|
12
|
+
"./xo-app": "./dist/xo-app.d.mts",
|
|
12
13
|
"./xen-api": "./dist/xen-api.d.mts",
|
|
13
14
|
"./common": {
|
|
14
15
|
"default": "./dist/common.mjs",
|