@indexable/sdk 0.0.4 → 0.2.1
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/npm/linux-x64-gnu/ix-sdk.linux-x64-gnu.node +0 -0
- package/npm/linux-x64-gnu/libix_sdk_ffi.so +0 -0
- package/npm/linux-x64-gnu/package.json +11 -4
- package/package.json +10 -7
- package/src/bindings.ts +174 -0
- package/src/generated/ix_sdk_ffi.ts +4604 -0
- package/src/index.ts +6 -145
- package/src/index.test.ts +0 -165
|
@@ -0,0 +1,4604 @@
|
|
|
1
|
+
// This file was autogenerated by uniffi-bindgen
|
|
2
|
+
// Do not edit manually.
|
|
3
|
+
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
import koffi from 'koffi';
|
|
6
|
+
import { existsSync } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
|
|
10
|
+
// ---- Rust buffer types ----
|
|
11
|
+
|
|
12
|
+
const RustBufferByValue = koffi.struct('RustBuffer', {
|
|
13
|
+
capacity: 'int64',
|
|
14
|
+
len: 'int64',
|
|
15
|
+
data: 'uint8 *',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const ForeignBytesByValue = koffi.struct('ForeignBytes', {
|
|
19
|
+
len: 'int64',
|
|
20
|
+
data: 'const uint8 *',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const RustCallStatus = koffi.struct('RustCallStatus', {
|
|
24
|
+
code: 'int8',
|
|
25
|
+
errorBuf: RustBufferByValue,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// ---- Load native library ----
|
|
29
|
+
|
|
30
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
31
|
+
const __dirname = path.dirname(__filename);
|
|
32
|
+
|
|
33
|
+
function libFileName(): string {
|
|
34
|
+
const libName = 'ix_sdk_ffi';
|
|
35
|
+
if (process.platform === 'darwin') return `lib${libName}.dylib`;
|
|
36
|
+
if (process.platform === 'win32') return `${libName}.dll`;
|
|
37
|
+
return `lib${libName}.so`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function findLibrary(): string {
|
|
41
|
+
const name = libFileName();
|
|
42
|
+
|
|
43
|
+
// 1. Explicit env var override
|
|
44
|
+
const envPath = process.env.UNIFFI_LIB_PATH;
|
|
45
|
+
if (envPath) return envPath;
|
|
46
|
+
|
|
47
|
+
// 2. Adjacent to this file (npm package distribution)
|
|
48
|
+
const adjacent = path.join(__dirname, name);
|
|
49
|
+
if (existsSync(adjacent)) return adjacent;
|
|
50
|
+
|
|
51
|
+
// 3. Package root npm/ platform dir
|
|
52
|
+
const pkgRoot = path.resolve(__dirname, '..', '..');
|
|
53
|
+
const npmDir = path.join(pkgRoot, 'npm', `${process.platform}-${process.arch}`, name);
|
|
54
|
+
if (existsSync(npmDir)) return npmDir;
|
|
55
|
+
const npmDirGnu = path.join(pkgRoot, 'npm', `${process.platform}-${process.arch}-gnu`, name);
|
|
56
|
+
if (existsSync(npmDirGnu)) return npmDirGnu;
|
|
57
|
+
|
|
58
|
+
// 4. Cargo target/release (development)
|
|
59
|
+
const cargoRelease = path.resolve(pkgRoot, '..', '..', 'target', 'release', name);
|
|
60
|
+
if (existsSync(cargoRelease)) return cargoRelease;
|
|
61
|
+
|
|
62
|
+
// 5. Fall back to bare name (let dlopen search LD_LIBRARY_PATH/DYLD_LIBRARY_PATH)
|
|
63
|
+
return name;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const lib = koffi.load(findLibrary());
|
|
67
|
+
|
|
68
|
+
// ---- FFI function registrations ----
|
|
69
|
+
const uniffiIxSdkFfiFnCloneIxsdkclient = lib.func('uniffi_ix_sdk_ffi_fn_clone_ixsdkclient', 'uint64', [
|
|
70
|
+
'uint64',
|
|
71
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
72
|
+
]);
|
|
73
|
+
const uniffiIxSdkFfiFnFreeIxsdkclient = lib.func('uniffi_ix_sdk_ffi_fn_free_ixsdkclient', 'void', [
|
|
74
|
+
'uint64',
|
|
75
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
76
|
+
]);
|
|
77
|
+
const uniffiIxSdkFfiFnConstructorIxsdkclientNew = lib.func('uniffi_ix_sdk_ffi_fn_constructor_ixsdkclient_new', 'uint64', [
|
|
78
|
+
RustBufferByValue,
|
|
79
|
+
RustBufferByValue,
|
|
80
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
81
|
+
]);
|
|
82
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientBillingStatus = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_billing_status', 'uint64', [
|
|
83
|
+
'uint64',
|
|
84
|
+
]);
|
|
85
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateApiToken = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_api_token', 'uint64', [
|
|
86
|
+
'uint64',
|
|
87
|
+
RustBufferByValue,
|
|
88
|
+
]);
|
|
89
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateCheckoutSession = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_checkout_session', 'uint64', [
|
|
90
|
+
'uint64',
|
|
91
|
+
RustBufferByValue,
|
|
92
|
+
]);
|
|
93
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListApiTokens = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_api_tokens', 'uint64', [
|
|
94
|
+
'uint64',
|
|
95
|
+
]);
|
|
96
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientMe = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_me', 'uint64', [
|
|
97
|
+
'uint64',
|
|
98
|
+
]);
|
|
99
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRevokeApiToken = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_revoke_api_token', 'uint64', [
|
|
100
|
+
'uint64',
|
|
101
|
+
RustBufferByValue,
|
|
102
|
+
]);
|
|
103
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientUsageEvents = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_usage_events', 'uint64', [
|
|
104
|
+
'uint64',
|
|
105
|
+
RustBufferByValue,
|
|
106
|
+
RustBufferByValue,
|
|
107
|
+
RustBufferByValue,
|
|
108
|
+
RustBufferByValue,
|
|
109
|
+
'int64',
|
|
110
|
+
]);
|
|
111
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientComputeBySubdomain = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_compute_by_subdomain', 'uint64', [
|
|
112
|
+
'uint64',
|
|
113
|
+
RustBufferByValue,
|
|
114
|
+
]);
|
|
115
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientComputeEnvVars = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_compute_env_vars', 'uint64', [
|
|
116
|
+
'uint64',
|
|
117
|
+
RustBufferByValue,
|
|
118
|
+
]);
|
|
119
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientComputeInstances = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_compute_instances', 'uint64', [
|
|
120
|
+
'uint64',
|
|
121
|
+
RustBufferByValue,
|
|
122
|
+
]);
|
|
123
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateCompute = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_compute', 'uint64', [
|
|
124
|
+
'uint64',
|
|
125
|
+
RustBufferByValue,
|
|
126
|
+
]);
|
|
127
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateComputeAndWait = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_compute_and_wait', 'uint64', [
|
|
128
|
+
'uint64',
|
|
129
|
+
RustBufferByValue,
|
|
130
|
+
]);
|
|
131
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeleteCompute = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_delete_compute', 'uint64', [
|
|
132
|
+
'uint64',
|
|
133
|
+
RustBufferByValue,
|
|
134
|
+
]);
|
|
135
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeleteComputeEnv = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_delete_compute_env', 'uint64', [
|
|
136
|
+
'uint64',
|
|
137
|
+
RustBufferByValue,
|
|
138
|
+
RustBufferByValue,
|
|
139
|
+
]);
|
|
140
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeployCompute = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_deploy_compute', 'uint64', [
|
|
141
|
+
'uint64',
|
|
142
|
+
RustBufferByValue,
|
|
143
|
+
]);
|
|
144
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientExecCompute = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_exec_compute', 'uint64', [
|
|
145
|
+
'uint64',
|
|
146
|
+
RustBufferByValue,
|
|
147
|
+
RustBufferByValue,
|
|
148
|
+
RustBufferByValue,
|
|
149
|
+
]);
|
|
150
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListComputes = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_computes', 'uint64', [
|
|
151
|
+
'uint64',
|
|
152
|
+
]);
|
|
153
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientPauseCompute = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_pause_compute', 'uint64', [
|
|
154
|
+
'uint64',
|
|
155
|
+
RustBufferByValue,
|
|
156
|
+
]);
|
|
157
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientResumeCompute = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_resume_compute', 'uint64', [
|
|
158
|
+
'uint64',
|
|
159
|
+
RustBufferByValue,
|
|
160
|
+
]);
|
|
161
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientSetComputeEnv = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_set_compute_env', 'uint64', [
|
|
162
|
+
'uint64',
|
|
163
|
+
RustBufferByValue,
|
|
164
|
+
RustBufferByValue,
|
|
165
|
+
RustBufferByValue,
|
|
166
|
+
]);
|
|
167
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientShellAttachInfo = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_shell_attach_info', 'uint64', [
|
|
168
|
+
'uint64',
|
|
169
|
+
RustBufferByValue,
|
|
170
|
+
]);
|
|
171
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientUpdateCompute = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_update_compute', 'uint64', [
|
|
172
|
+
'uint64',
|
|
173
|
+
RustBufferByValue,
|
|
174
|
+
]);
|
|
175
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientAddVmToGroup = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_add_vm_to_group', 'uint64', [
|
|
176
|
+
'uint64',
|
|
177
|
+
RustBufferByValue,
|
|
178
|
+
RustBufferByValue,
|
|
179
|
+
]);
|
|
180
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateVmGroup = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_vm_group', 'uint64', [
|
|
181
|
+
'uint64',
|
|
182
|
+
RustBufferByValue,
|
|
183
|
+
]);
|
|
184
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeleteVmGroup = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_delete_vm_group', 'uint64', [
|
|
185
|
+
'uint64',
|
|
186
|
+
RustBufferByValue,
|
|
187
|
+
]);
|
|
188
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListVmGroups = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_vm_groups', 'uint64', [
|
|
189
|
+
'uint64',
|
|
190
|
+
]);
|
|
191
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRemoveVmFromGroup = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_remove_vm_from_group', 'uint64', [
|
|
192
|
+
'uint64',
|
|
193
|
+
RustBufferByValue,
|
|
194
|
+
RustBufferByValue,
|
|
195
|
+
]);
|
|
196
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDescribe = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_describe', 'void', [
|
|
197
|
+
'uint64',
|
|
198
|
+
RustBufferByValue,
|
|
199
|
+
RustBufferByValue,
|
|
200
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
201
|
+
]);
|
|
202
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientExec = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_exec', 'uint64', [
|
|
203
|
+
'uint64',
|
|
204
|
+
RustBufferByValue,
|
|
205
|
+
RustBufferByValue,
|
|
206
|
+
RustBufferByValue,
|
|
207
|
+
]);
|
|
208
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientFilter = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_filter', RustBufferByValue, [
|
|
209
|
+
'uint64',
|
|
210
|
+
RustBufferByValue,
|
|
211
|
+
RustBufferByValue,
|
|
212
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
213
|
+
]);
|
|
214
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientForkAt = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_fork_at', 'uint64', [
|
|
215
|
+
'uint64',
|
|
216
|
+
RustBufferByValue,
|
|
217
|
+
'int64',
|
|
218
|
+
]);
|
|
219
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientForkBranch = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_fork_branch', 'uint64', [
|
|
220
|
+
'uint64',
|
|
221
|
+
RustBufferByValue,
|
|
222
|
+
]);
|
|
223
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientGetFs = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_get_fs', RustBufferByValue, [
|
|
224
|
+
'uint64',
|
|
225
|
+
RustBufferByValue,
|
|
226
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
227
|
+
]);
|
|
228
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientHead = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_head', 'uint64', [
|
|
229
|
+
'uint64',
|
|
230
|
+
RustBufferByValue,
|
|
231
|
+
]);
|
|
232
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListDirAt = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_dir_at', 'uint64', [
|
|
233
|
+
'uint64',
|
|
234
|
+
RustBufferByValue,
|
|
235
|
+
RustBufferByValue,
|
|
236
|
+
'int64',
|
|
237
|
+
]);
|
|
238
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientReadFileAt = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_read_file_at', 'uint64', [
|
|
239
|
+
'uint64',
|
|
240
|
+
RustBufferByValue,
|
|
241
|
+
RustBufferByValue,
|
|
242
|
+
'int64',
|
|
243
|
+
]);
|
|
244
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientSnapshots = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_snapshots', 'uint64', [
|
|
245
|
+
'uint64',
|
|
246
|
+
RustBufferByValue,
|
|
247
|
+
]);
|
|
248
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientSpawn = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_spawn', 'uint64', [
|
|
249
|
+
'uint64',
|
|
250
|
+
RustBufferByValue,
|
|
251
|
+
RustBufferByValue,
|
|
252
|
+
]);
|
|
253
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientSpawnBlocking = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_spawn_blocking', RustBufferByValue, [
|
|
254
|
+
'uint64',
|
|
255
|
+
RustBufferByValue,
|
|
256
|
+
RustBufferByValue,
|
|
257
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
258
|
+
]);
|
|
259
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCancelMigration = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_cancel_migration', 'uint64', [
|
|
260
|
+
'uint64',
|
|
261
|
+
RustBufferByValue,
|
|
262
|
+
]);
|
|
263
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientMigrateVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_migrate_vm', 'uint64', [
|
|
264
|
+
'uint64',
|
|
265
|
+
RustBufferByValue,
|
|
266
|
+
RustBufferByValue,
|
|
267
|
+
]);
|
|
268
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmMigration = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_migration', 'uint64', [
|
|
269
|
+
'uint64',
|
|
270
|
+
RustBufferByValue,
|
|
271
|
+
]);
|
|
272
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientAddMountTarget = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_add_mount_target', 'void', [
|
|
273
|
+
'uint64',
|
|
274
|
+
RustBufferByValue,
|
|
275
|
+
RustBufferByValue,
|
|
276
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
277
|
+
]);
|
|
278
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListMountTargets = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_mount_targets', RustBufferByValue, [
|
|
279
|
+
'uint64',
|
|
280
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
281
|
+
]);
|
|
282
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientMountStatus = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_mount_status', RustBufferByValue, [
|
|
283
|
+
'uint64',
|
|
284
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
285
|
+
]);
|
|
286
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRemoveMountTarget = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_remove_mount_target', 'void', [
|
|
287
|
+
'uint64',
|
|
288
|
+
RustBufferByValue,
|
|
289
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
290
|
+
]);
|
|
291
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientSyncMountTarget = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_sync_mount_target', 'uint64', [
|
|
292
|
+
'uint64',
|
|
293
|
+
RustBufferByValue,
|
|
294
|
+
]);
|
|
295
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreatePreview = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_preview', 'uint64', [
|
|
296
|
+
'uint64',
|
|
297
|
+
RustBufferByValue,
|
|
298
|
+
]);
|
|
299
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListPreviews = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_previews', 'uint64', [
|
|
300
|
+
'uint64',
|
|
301
|
+
]);
|
|
302
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientPreviewStatus = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_preview_status', 'uint64', [
|
|
303
|
+
'uint64',
|
|
304
|
+
RustBufferByValue,
|
|
305
|
+
]);
|
|
306
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientPromotePreview = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_promote_preview', 'uint64', [
|
|
307
|
+
'uint64',
|
|
308
|
+
RustBufferByValue,
|
|
309
|
+
]);
|
|
310
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientStopPreview = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_stop_preview', 'uint64', [
|
|
311
|
+
'uint64',
|
|
312
|
+
RustBufferByValue,
|
|
313
|
+
]);
|
|
314
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListRegions = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_regions', 'uint64', [
|
|
315
|
+
'uint64',
|
|
316
|
+
]);
|
|
317
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCheckpointVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_checkpoint_vm', 'uint64', [
|
|
318
|
+
'uint64',
|
|
319
|
+
RustBufferByValue,
|
|
320
|
+
]);
|
|
321
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_vm', 'uint64', [
|
|
322
|
+
'uint64',
|
|
323
|
+
RustBufferByValue,
|
|
324
|
+
RustBufferByValue,
|
|
325
|
+
RustBufferByValue,
|
|
326
|
+
RustBufferByValue,
|
|
327
|
+
RustBufferByValue,
|
|
328
|
+
RustBufferByValue,
|
|
329
|
+
RustBufferByValue,
|
|
330
|
+
RustBufferByValue,
|
|
331
|
+
]);
|
|
332
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateVmBlocking = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_vm_blocking', RustBufferByValue, [
|
|
333
|
+
'uint64',
|
|
334
|
+
RustBufferByValue,
|
|
335
|
+
RustBufferByValue,
|
|
336
|
+
RustBufferByValue,
|
|
337
|
+
RustBufferByValue,
|
|
338
|
+
RustBufferByValue,
|
|
339
|
+
RustBufferByValue,
|
|
340
|
+
RustBufferByValue,
|
|
341
|
+
RustBufferByValue,
|
|
342
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
343
|
+
]);
|
|
344
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeleteVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_delete_vm', 'uint64', [
|
|
345
|
+
'uint64',
|
|
346
|
+
RustBufferByValue,
|
|
347
|
+
]);
|
|
348
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeleteVmBlocking = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_delete_vm_blocking', 'void', [
|
|
349
|
+
'uint64',
|
|
350
|
+
RustBufferByValue,
|
|
351
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
352
|
+
]);
|
|
353
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeleteVmSecret = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_delete_vm_secret', 'uint64', [
|
|
354
|
+
'uint64',
|
|
355
|
+
RustBufferByValue,
|
|
356
|
+
RustBufferByValue,
|
|
357
|
+
]);
|
|
358
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientExecVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_exec_vm', 'uint64', [
|
|
359
|
+
'uint64',
|
|
360
|
+
RustBufferByValue,
|
|
361
|
+
RustBufferByValue,
|
|
362
|
+
RustBufferByValue,
|
|
363
|
+
]);
|
|
364
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientExecVmBlocking = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_exec_vm_blocking', RustBufferByValue, [
|
|
365
|
+
'uint64',
|
|
366
|
+
RustBufferByValue,
|
|
367
|
+
RustBufferByValue,
|
|
368
|
+
RustBufferByValue,
|
|
369
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
370
|
+
]);
|
|
371
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientForkVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_fork_vm', 'uint64', [
|
|
372
|
+
'uint64',
|
|
373
|
+
RustBufferByValue,
|
|
374
|
+
RustBufferByValue,
|
|
375
|
+
RustBufferByValue,
|
|
376
|
+
]);
|
|
377
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientForkVmAtTimestampMs = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_fork_vm_at_timestamp_ms', 'uint64', [
|
|
378
|
+
'uint64',
|
|
379
|
+
RustBufferByValue,
|
|
380
|
+
'int64',
|
|
381
|
+
RustBufferByValue,
|
|
382
|
+
RustBufferByValue,
|
|
383
|
+
]);
|
|
384
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientGetVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_get_vm', 'uint64', [
|
|
385
|
+
'uint64',
|
|
386
|
+
RustBufferByValue,
|
|
387
|
+
]);
|
|
388
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientGetVmByName = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_get_vm_by_name', 'uint64', [
|
|
389
|
+
'uint64',
|
|
390
|
+
RustBufferByValue,
|
|
391
|
+
]);
|
|
392
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListVmSnapshotBranches = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_vm_snapshot_branches', 'uint64', [
|
|
393
|
+
'uint64',
|
|
394
|
+
RustBufferByValue,
|
|
395
|
+
]);
|
|
396
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListVmSnapshots = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_vm_snapshots', 'uint64', [
|
|
397
|
+
'uint64',
|
|
398
|
+
RustBufferByValue,
|
|
399
|
+
]);
|
|
400
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListVms = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_vms', 'uint64', [
|
|
401
|
+
'uint64',
|
|
402
|
+
RustBufferByValue,
|
|
403
|
+
]);
|
|
404
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientMergeVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_merge_vm', 'uint64', [
|
|
405
|
+
'uint64',
|
|
406
|
+
RustBufferByValue,
|
|
407
|
+
RustBufferByValue,
|
|
408
|
+
RustBufferByValue,
|
|
409
|
+
]);
|
|
410
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientPreviewMergeVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_preview_merge_vm', 'uint64', [
|
|
411
|
+
'uint64',
|
|
412
|
+
RustBufferByValue,
|
|
413
|
+
RustBufferByValue,
|
|
414
|
+
]);
|
|
415
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRedoVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_redo_vm', 'uint64', [
|
|
416
|
+
'uint64',
|
|
417
|
+
RustBufferByValue,
|
|
418
|
+
]);
|
|
419
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRestartVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_restart_vm', 'uint64', [
|
|
420
|
+
'uint64',
|
|
421
|
+
RustBufferByValue,
|
|
422
|
+
]);
|
|
423
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRevertVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_revert_vm', 'uint64', [
|
|
424
|
+
'uint64',
|
|
425
|
+
RustBufferByValue,
|
|
426
|
+
RustBufferByValue,
|
|
427
|
+
]);
|
|
428
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRevertVmToTimestampMs = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_revert_vm_to_timestamp_ms', 'uint64', [
|
|
429
|
+
'uint64',
|
|
430
|
+
RustBufferByValue,
|
|
431
|
+
'int64',
|
|
432
|
+
]);
|
|
433
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientSetVmSecret = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_set_vm_secret', 'uint64', [
|
|
434
|
+
'uint64',
|
|
435
|
+
RustBufferByValue,
|
|
436
|
+
RustBufferByValue,
|
|
437
|
+
RustBufferByValue,
|
|
438
|
+
]);
|
|
439
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientStartVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_start_vm', 'uint64', [
|
|
440
|
+
'uint64',
|
|
441
|
+
RustBufferByValue,
|
|
442
|
+
]);
|
|
443
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientStopVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_stop_vm', 'uint64', [
|
|
444
|
+
'uint64',
|
|
445
|
+
RustBufferByValue,
|
|
446
|
+
]);
|
|
447
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientUndoVm = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_undo_vm', 'uint64', [
|
|
448
|
+
'uint64',
|
|
449
|
+
RustBufferByValue,
|
|
450
|
+
]);
|
|
451
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmAttachInfo = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_attach_info', 'uint64', [
|
|
452
|
+
'uint64',
|
|
453
|
+
RustBufferByValue,
|
|
454
|
+
]);
|
|
455
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmFsList = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_fs_list', 'uint64', [
|
|
456
|
+
'uint64',
|
|
457
|
+
RustBufferByValue,
|
|
458
|
+
RustBufferByValue,
|
|
459
|
+
]);
|
|
460
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmFsListAtTimestampMs = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_fs_list_at_timestamp_ms', 'uint64', [
|
|
461
|
+
'uint64',
|
|
462
|
+
RustBufferByValue,
|
|
463
|
+
RustBufferByValue,
|
|
464
|
+
'int64',
|
|
465
|
+
]);
|
|
466
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmFsRead = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_fs_read', 'uint64', [
|
|
467
|
+
'uint64',
|
|
468
|
+
RustBufferByValue,
|
|
469
|
+
RustBufferByValue,
|
|
470
|
+
]);
|
|
471
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmFsReadAtTimestampMs = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_fs_read_at_timestamp_ms', 'uint64', [
|
|
472
|
+
'uint64',
|
|
473
|
+
RustBufferByValue,
|
|
474
|
+
RustBufferByValue,
|
|
475
|
+
'int64',
|
|
476
|
+
]);
|
|
477
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmFsWrite = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_fs_write', 'uint64', [
|
|
478
|
+
'uint64',
|
|
479
|
+
RustBufferByValue,
|
|
480
|
+
RustBufferByValue,
|
|
481
|
+
RustBufferByValue,
|
|
482
|
+
RustBufferByValue,
|
|
483
|
+
]);
|
|
484
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmLogs = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_logs', 'uint64', [
|
|
485
|
+
'uint64',
|
|
486
|
+
RustBufferByValue,
|
|
487
|
+
'int64',
|
|
488
|
+
RustBufferByValue,
|
|
489
|
+
RustBufferByValue,
|
|
490
|
+
]);
|
|
491
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmMetrics = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_metrics', 'uint64', [
|
|
492
|
+
'uint64',
|
|
493
|
+
RustBufferByValue,
|
|
494
|
+
]);
|
|
495
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVmSecrets = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_vm_secrets', 'uint64', [
|
|
496
|
+
'uint64',
|
|
497
|
+
RustBufferByValue,
|
|
498
|
+
]);
|
|
499
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateSnapshot = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_snapshot', 'uint64', [
|
|
500
|
+
'uint64',
|
|
501
|
+
RustBufferByValue,
|
|
502
|
+
RustBufferByValue,
|
|
503
|
+
]);
|
|
504
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientCreateVolume = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_create_volume', 'uint64', [
|
|
505
|
+
'uint64',
|
|
506
|
+
RustBufferByValue,
|
|
507
|
+
]);
|
|
508
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientDeleteVolume = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_delete_volume', 'uint64', [
|
|
509
|
+
'uint64',
|
|
510
|
+
RustBufferByValue,
|
|
511
|
+
]);
|
|
512
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientForkVolume = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_fork_volume', 'uint64', [
|
|
513
|
+
'uint64',
|
|
514
|
+
RustBufferByValue,
|
|
515
|
+
RustBufferByValue,
|
|
516
|
+
]);
|
|
517
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientListVolumes = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_list_volumes', 'uint64', [
|
|
518
|
+
'uint64',
|
|
519
|
+
]);
|
|
520
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientRestoreToSnapshot = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_restore_to_snapshot', 'uint64', [
|
|
521
|
+
'uint64',
|
|
522
|
+
RustBufferByValue,
|
|
523
|
+
]);
|
|
524
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVolumeById = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_volume_by_id', 'uint64', [
|
|
525
|
+
'uint64',
|
|
526
|
+
RustBufferByValue,
|
|
527
|
+
]);
|
|
528
|
+
const uniffiIxSdkFfiFnMethodIxsdkclientVolumeSnapshots = lib.func('uniffi_ix_sdk_ffi_fn_method_ixsdkclient_volume_snapshots', 'uint64', [
|
|
529
|
+
'uint64',
|
|
530
|
+
RustBufferByValue,
|
|
531
|
+
]);
|
|
532
|
+
const ffiIxSdkFfiRustbufferAlloc = lib.func('ffi_ix_sdk_ffi_rustbuffer_alloc', RustBufferByValue, [
|
|
533
|
+
'uint64',
|
|
534
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
535
|
+
]);
|
|
536
|
+
const ffiIxSdkFfiRustbufferFromBytes = lib.func('ffi_ix_sdk_ffi_rustbuffer_from_bytes', RustBufferByValue, [
|
|
537
|
+
ForeignBytesByValue,
|
|
538
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
539
|
+
]);
|
|
540
|
+
const ffiIxSdkFfiRustbufferFree = lib.func('ffi_ix_sdk_ffi_rustbuffer_free', 'void', [
|
|
541
|
+
RustBufferByValue,
|
|
542
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
543
|
+
]);
|
|
544
|
+
const ffiIxSdkFfiRustbufferReserve = lib.func('ffi_ix_sdk_ffi_rustbuffer_reserve', RustBufferByValue, [
|
|
545
|
+
RustBufferByValue,
|
|
546
|
+
'uint64',
|
|
547
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
548
|
+
]);
|
|
549
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientBillingStatus = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_billing_status', 'uint16', [
|
|
550
|
+
]);
|
|
551
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateApiToken = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_api_token', 'uint16', [
|
|
552
|
+
]);
|
|
553
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateCheckoutSession = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_checkout_session', 'uint16', [
|
|
554
|
+
]);
|
|
555
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListApiTokens = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_api_tokens', 'uint16', [
|
|
556
|
+
]);
|
|
557
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientMe = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_me', 'uint16', [
|
|
558
|
+
]);
|
|
559
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRevokeApiToken = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_revoke_api_token', 'uint16', [
|
|
560
|
+
]);
|
|
561
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientUsageEvents = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_usage_events', 'uint16', [
|
|
562
|
+
]);
|
|
563
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientComputeBySubdomain = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_compute_by_subdomain', 'uint16', [
|
|
564
|
+
]);
|
|
565
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientComputeEnvVars = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_compute_env_vars', 'uint16', [
|
|
566
|
+
]);
|
|
567
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientComputeInstances = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_compute_instances', 'uint16', [
|
|
568
|
+
]);
|
|
569
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateCompute = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_compute', 'uint16', [
|
|
570
|
+
]);
|
|
571
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateComputeAndWait = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_compute_and_wait', 'uint16', [
|
|
572
|
+
]);
|
|
573
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeleteCompute = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_delete_compute', 'uint16', [
|
|
574
|
+
]);
|
|
575
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeleteComputeEnv = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_delete_compute_env', 'uint16', [
|
|
576
|
+
]);
|
|
577
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeployCompute = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_deploy_compute', 'uint16', [
|
|
578
|
+
]);
|
|
579
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientExecCompute = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_exec_compute', 'uint16', [
|
|
580
|
+
]);
|
|
581
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListComputes = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_computes', 'uint16', [
|
|
582
|
+
]);
|
|
583
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientPauseCompute = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_pause_compute', 'uint16', [
|
|
584
|
+
]);
|
|
585
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientResumeCompute = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_resume_compute', 'uint16', [
|
|
586
|
+
]);
|
|
587
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientSetComputeEnv = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_set_compute_env', 'uint16', [
|
|
588
|
+
]);
|
|
589
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientShellAttachInfo = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_shell_attach_info', 'uint16', [
|
|
590
|
+
]);
|
|
591
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientUpdateCompute = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_update_compute', 'uint16', [
|
|
592
|
+
]);
|
|
593
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientAddVmToGroup = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_add_vm_to_group', 'uint16', [
|
|
594
|
+
]);
|
|
595
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateVmGroup = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_vm_group', 'uint16', [
|
|
596
|
+
]);
|
|
597
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeleteVmGroup = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_delete_vm_group', 'uint16', [
|
|
598
|
+
]);
|
|
599
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListVmGroups = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_vm_groups', 'uint16', [
|
|
600
|
+
]);
|
|
601
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRemoveVmFromGroup = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_remove_vm_from_group', 'uint16', [
|
|
602
|
+
]);
|
|
603
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDescribe = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_describe', 'uint16', [
|
|
604
|
+
]);
|
|
605
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientExec = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_exec', 'uint16', [
|
|
606
|
+
]);
|
|
607
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientFilter = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_filter', 'uint16', [
|
|
608
|
+
]);
|
|
609
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientForkAt = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_fork_at', 'uint16', [
|
|
610
|
+
]);
|
|
611
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientForkBranch = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_fork_branch', 'uint16', [
|
|
612
|
+
]);
|
|
613
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientGetFs = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_get_fs', 'uint16', [
|
|
614
|
+
]);
|
|
615
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientHead = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_head', 'uint16', [
|
|
616
|
+
]);
|
|
617
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListDirAt = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_dir_at', 'uint16', [
|
|
618
|
+
]);
|
|
619
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientReadFileAt = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_read_file_at', 'uint16', [
|
|
620
|
+
]);
|
|
621
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientSnapshots = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_snapshots', 'uint16', [
|
|
622
|
+
]);
|
|
623
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientSpawn = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_spawn', 'uint16', [
|
|
624
|
+
]);
|
|
625
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientSpawnBlocking = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_spawn_blocking', 'uint16', [
|
|
626
|
+
]);
|
|
627
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCancelMigration = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_cancel_migration', 'uint16', [
|
|
628
|
+
]);
|
|
629
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientMigrateVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_migrate_vm', 'uint16', [
|
|
630
|
+
]);
|
|
631
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmMigration = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_migration', 'uint16', [
|
|
632
|
+
]);
|
|
633
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientAddMountTarget = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_add_mount_target', 'uint16', [
|
|
634
|
+
]);
|
|
635
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListMountTargets = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_mount_targets', 'uint16', [
|
|
636
|
+
]);
|
|
637
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientMountStatus = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_mount_status', 'uint16', [
|
|
638
|
+
]);
|
|
639
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRemoveMountTarget = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_remove_mount_target', 'uint16', [
|
|
640
|
+
]);
|
|
641
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientSyncMountTarget = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_sync_mount_target', 'uint16', [
|
|
642
|
+
]);
|
|
643
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreatePreview = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_preview', 'uint16', [
|
|
644
|
+
]);
|
|
645
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListPreviews = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_previews', 'uint16', [
|
|
646
|
+
]);
|
|
647
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientPreviewStatus = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_preview_status', 'uint16', [
|
|
648
|
+
]);
|
|
649
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientPromotePreview = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_promote_preview', 'uint16', [
|
|
650
|
+
]);
|
|
651
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientStopPreview = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_stop_preview', 'uint16', [
|
|
652
|
+
]);
|
|
653
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListRegions = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_regions', 'uint16', [
|
|
654
|
+
]);
|
|
655
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCheckpointVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_checkpoint_vm', 'uint16', [
|
|
656
|
+
]);
|
|
657
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_vm', 'uint16', [
|
|
658
|
+
]);
|
|
659
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateVmBlocking = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_vm_blocking', 'uint16', [
|
|
660
|
+
]);
|
|
661
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeleteVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_delete_vm', 'uint16', [
|
|
662
|
+
]);
|
|
663
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeleteVmBlocking = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_delete_vm_blocking', 'uint16', [
|
|
664
|
+
]);
|
|
665
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeleteVmSecret = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_delete_vm_secret', 'uint16', [
|
|
666
|
+
]);
|
|
667
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientExecVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_exec_vm', 'uint16', [
|
|
668
|
+
]);
|
|
669
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientExecVmBlocking = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_exec_vm_blocking', 'uint16', [
|
|
670
|
+
]);
|
|
671
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientForkVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_fork_vm', 'uint16', [
|
|
672
|
+
]);
|
|
673
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientForkVmAtTimestampMs = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_fork_vm_at_timestamp_ms', 'uint16', [
|
|
674
|
+
]);
|
|
675
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientGetVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_get_vm', 'uint16', [
|
|
676
|
+
]);
|
|
677
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientGetVmByName = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_get_vm_by_name', 'uint16', [
|
|
678
|
+
]);
|
|
679
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListVmSnapshotBranches = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_vm_snapshot_branches', 'uint16', [
|
|
680
|
+
]);
|
|
681
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListVmSnapshots = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_vm_snapshots', 'uint16', [
|
|
682
|
+
]);
|
|
683
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListVms = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_vms', 'uint16', [
|
|
684
|
+
]);
|
|
685
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientMergeVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_merge_vm', 'uint16', [
|
|
686
|
+
]);
|
|
687
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientPreviewMergeVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_preview_merge_vm', 'uint16', [
|
|
688
|
+
]);
|
|
689
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRedoVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_redo_vm', 'uint16', [
|
|
690
|
+
]);
|
|
691
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRestartVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_restart_vm', 'uint16', [
|
|
692
|
+
]);
|
|
693
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRevertVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_revert_vm', 'uint16', [
|
|
694
|
+
]);
|
|
695
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRevertVmToTimestampMs = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_revert_vm_to_timestamp_ms', 'uint16', [
|
|
696
|
+
]);
|
|
697
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientSetVmSecret = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_set_vm_secret', 'uint16', [
|
|
698
|
+
]);
|
|
699
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientStartVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_start_vm', 'uint16', [
|
|
700
|
+
]);
|
|
701
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientStopVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_stop_vm', 'uint16', [
|
|
702
|
+
]);
|
|
703
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientUndoVm = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_undo_vm', 'uint16', [
|
|
704
|
+
]);
|
|
705
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmAttachInfo = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_attach_info', 'uint16', [
|
|
706
|
+
]);
|
|
707
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmFsList = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_fs_list', 'uint16', [
|
|
708
|
+
]);
|
|
709
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmFsListAtTimestampMs = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_fs_list_at_timestamp_ms', 'uint16', [
|
|
710
|
+
]);
|
|
711
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmFsRead = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_fs_read', 'uint16', [
|
|
712
|
+
]);
|
|
713
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmFsReadAtTimestampMs = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_fs_read_at_timestamp_ms', 'uint16', [
|
|
714
|
+
]);
|
|
715
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmFsWrite = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_fs_write', 'uint16', [
|
|
716
|
+
]);
|
|
717
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmLogs = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_logs', 'uint16', [
|
|
718
|
+
]);
|
|
719
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmMetrics = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_metrics', 'uint16', [
|
|
720
|
+
]);
|
|
721
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVmSecrets = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_vm_secrets', 'uint16', [
|
|
722
|
+
]);
|
|
723
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateSnapshot = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_snapshot', 'uint16', [
|
|
724
|
+
]);
|
|
725
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientCreateVolume = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_create_volume', 'uint16', [
|
|
726
|
+
]);
|
|
727
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientDeleteVolume = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_delete_volume', 'uint16', [
|
|
728
|
+
]);
|
|
729
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientForkVolume = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_fork_volume', 'uint16', [
|
|
730
|
+
]);
|
|
731
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientListVolumes = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_list_volumes', 'uint16', [
|
|
732
|
+
]);
|
|
733
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientRestoreToSnapshot = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_restore_to_snapshot', 'uint16', [
|
|
734
|
+
]);
|
|
735
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVolumeById = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_volume_by_id', 'uint16', [
|
|
736
|
+
]);
|
|
737
|
+
const uniffiIxSdkFfiChecksumMethodIxsdkclientVolumeSnapshots = lib.func('uniffi_ix_sdk_ffi_checksum_method_ixsdkclient_volume_snapshots', 'uint16', [
|
|
738
|
+
]);
|
|
739
|
+
const uniffiIxSdkFfiChecksumConstructorIxsdkclientNew = lib.func('uniffi_ix_sdk_ffi_checksum_constructor_ixsdkclient_new', 'uint16', [
|
|
740
|
+
]);
|
|
741
|
+
const ffiIxSdkFfiUniffiContractVersion = lib.func('ffi_ix_sdk_ffi_uniffi_contract_version', 'uint32', [
|
|
742
|
+
]);
|
|
743
|
+
// ---- Async FFI function registrations ----
|
|
744
|
+
|
|
745
|
+
const UniffiRustFutureContinuationCallback = koffi.proto('UniffiRustFutureContinuationCallback', 'void', ['uint64', 'int8']);
|
|
746
|
+
const ffiIxSdkFfiRustFuturePollU8 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_u8', 'void', [
|
|
747
|
+
'uint64',
|
|
748
|
+
'void *',
|
|
749
|
+
'uint64',
|
|
750
|
+
]);
|
|
751
|
+
const ffiIxSdkFfiRustFutureCancelU8 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_u8', 'void', [
|
|
752
|
+
'uint64',
|
|
753
|
+
]);
|
|
754
|
+
const ffiIxSdkFfiRustFutureFreeU8 = lib.func('ffi_ix_sdk_ffi_rust_future_free_u8', 'void', [
|
|
755
|
+
'uint64',
|
|
756
|
+
]);
|
|
757
|
+
const ffiIxSdkFfiRustFutureCompleteU8 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_u8', 'uint8', [
|
|
758
|
+
'uint64',
|
|
759
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
760
|
+
]);
|
|
761
|
+
const ffiIxSdkFfiRustFuturePollI8 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_i8', 'void', [
|
|
762
|
+
'uint64',
|
|
763
|
+
'void *',
|
|
764
|
+
'uint64',
|
|
765
|
+
]);
|
|
766
|
+
const ffiIxSdkFfiRustFutureCancelI8 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_i8', 'void', [
|
|
767
|
+
'uint64',
|
|
768
|
+
]);
|
|
769
|
+
const ffiIxSdkFfiRustFutureFreeI8 = lib.func('ffi_ix_sdk_ffi_rust_future_free_i8', 'void', [
|
|
770
|
+
'uint64',
|
|
771
|
+
]);
|
|
772
|
+
const ffiIxSdkFfiRustFutureCompleteI8 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_i8', 'int8', [
|
|
773
|
+
'uint64',
|
|
774
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
775
|
+
]);
|
|
776
|
+
const ffiIxSdkFfiRustFuturePollU16 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_u16', 'void', [
|
|
777
|
+
'uint64',
|
|
778
|
+
'void *',
|
|
779
|
+
'uint64',
|
|
780
|
+
]);
|
|
781
|
+
const ffiIxSdkFfiRustFutureCancelU16 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_u16', 'void', [
|
|
782
|
+
'uint64',
|
|
783
|
+
]);
|
|
784
|
+
const ffiIxSdkFfiRustFutureFreeU16 = lib.func('ffi_ix_sdk_ffi_rust_future_free_u16', 'void', [
|
|
785
|
+
'uint64',
|
|
786
|
+
]);
|
|
787
|
+
const ffiIxSdkFfiRustFutureCompleteU16 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_u16', 'uint16', [
|
|
788
|
+
'uint64',
|
|
789
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
790
|
+
]);
|
|
791
|
+
const ffiIxSdkFfiRustFuturePollI16 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_i16', 'void', [
|
|
792
|
+
'uint64',
|
|
793
|
+
'void *',
|
|
794
|
+
'uint64',
|
|
795
|
+
]);
|
|
796
|
+
const ffiIxSdkFfiRustFutureCancelI16 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_i16', 'void', [
|
|
797
|
+
'uint64',
|
|
798
|
+
]);
|
|
799
|
+
const ffiIxSdkFfiRustFutureFreeI16 = lib.func('ffi_ix_sdk_ffi_rust_future_free_i16', 'void', [
|
|
800
|
+
'uint64',
|
|
801
|
+
]);
|
|
802
|
+
const ffiIxSdkFfiRustFutureCompleteI16 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_i16', 'int16', [
|
|
803
|
+
'uint64',
|
|
804
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
805
|
+
]);
|
|
806
|
+
const ffiIxSdkFfiRustFuturePollU32 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_u32', 'void', [
|
|
807
|
+
'uint64',
|
|
808
|
+
'void *',
|
|
809
|
+
'uint64',
|
|
810
|
+
]);
|
|
811
|
+
const ffiIxSdkFfiRustFutureCancelU32 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_u32', 'void', [
|
|
812
|
+
'uint64',
|
|
813
|
+
]);
|
|
814
|
+
const ffiIxSdkFfiRustFutureFreeU32 = lib.func('ffi_ix_sdk_ffi_rust_future_free_u32', 'void', [
|
|
815
|
+
'uint64',
|
|
816
|
+
]);
|
|
817
|
+
const ffiIxSdkFfiRustFutureCompleteU32 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_u32', 'uint32', [
|
|
818
|
+
'uint64',
|
|
819
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
820
|
+
]);
|
|
821
|
+
const ffiIxSdkFfiRustFuturePollI32 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_i32', 'void', [
|
|
822
|
+
'uint64',
|
|
823
|
+
'void *',
|
|
824
|
+
'uint64',
|
|
825
|
+
]);
|
|
826
|
+
const ffiIxSdkFfiRustFutureCancelI32 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_i32', 'void', [
|
|
827
|
+
'uint64',
|
|
828
|
+
]);
|
|
829
|
+
const ffiIxSdkFfiRustFutureFreeI32 = lib.func('ffi_ix_sdk_ffi_rust_future_free_i32', 'void', [
|
|
830
|
+
'uint64',
|
|
831
|
+
]);
|
|
832
|
+
const ffiIxSdkFfiRustFutureCompleteI32 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_i32', 'int32', [
|
|
833
|
+
'uint64',
|
|
834
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
835
|
+
]);
|
|
836
|
+
const ffiIxSdkFfiRustFuturePollU64 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_u64', 'void', [
|
|
837
|
+
'uint64',
|
|
838
|
+
'void *',
|
|
839
|
+
'uint64',
|
|
840
|
+
]);
|
|
841
|
+
const ffiIxSdkFfiRustFutureCancelU64 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_u64', 'void', [
|
|
842
|
+
'uint64',
|
|
843
|
+
]);
|
|
844
|
+
const ffiIxSdkFfiRustFutureFreeU64 = lib.func('ffi_ix_sdk_ffi_rust_future_free_u64', 'void', [
|
|
845
|
+
'uint64',
|
|
846
|
+
]);
|
|
847
|
+
const ffiIxSdkFfiRustFutureCompleteU64 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_u64', 'uint64', [
|
|
848
|
+
'uint64',
|
|
849
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
850
|
+
]);
|
|
851
|
+
const ffiIxSdkFfiRustFuturePollI64 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_i64', 'void', [
|
|
852
|
+
'uint64',
|
|
853
|
+
'void *',
|
|
854
|
+
'uint64',
|
|
855
|
+
]);
|
|
856
|
+
const ffiIxSdkFfiRustFutureCancelI64 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_i64', 'void', [
|
|
857
|
+
'uint64',
|
|
858
|
+
]);
|
|
859
|
+
const ffiIxSdkFfiRustFutureFreeI64 = lib.func('ffi_ix_sdk_ffi_rust_future_free_i64', 'void', [
|
|
860
|
+
'uint64',
|
|
861
|
+
]);
|
|
862
|
+
const ffiIxSdkFfiRustFutureCompleteI64 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_i64', 'int64', [
|
|
863
|
+
'uint64',
|
|
864
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
865
|
+
]);
|
|
866
|
+
const ffiIxSdkFfiRustFuturePollF32 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_f32', 'void', [
|
|
867
|
+
'uint64',
|
|
868
|
+
'void *',
|
|
869
|
+
'uint64',
|
|
870
|
+
]);
|
|
871
|
+
const ffiIxSdkFfiRustFutureCancelF32 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_f32', 'void', [
|
|
872
|
+
'uint64',
|
|
873
|
+
]);
|
|
874
|
+
const ffiIxSdkFfiRustFutureFreeF32 = lib.func('ffi_ix_sdk_ffi_rust_future_free_f32', 'void', [
|
|
875
|
+
'uint64',
|
|
876
|
+
]);
|
|
877
|
+
const ffiIxSdkFfiRustFutureCompleteF32 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_f32', 'float32', [
|
|
878
|
+
'uint64',
|
|
879
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
880
|
+
]);
|
|
881
|
+
const ffiIxSdkFfiRustFuturePollF64 = lib.func('ffi_ix_sdk_ffi_rust_future_poll_f64', 'void', [
|
|
882
|
+
'uint64',
|
|
883
|
+
'void *',
|
|
884
|
+
'uint64',
|
|
885
|
+
]);
|
|
886
|
+
const ffiIxSdkFfiRustFutureCancelF64 = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_f64', 'void', [
|
|
887
|
+
'uint64',
|
|
888
|
+
]);
|
|
889
|
+
const ffiIxSdkFfiRustFutureFreeF64 = lib.func('ffi_ix_sdk_ffi_rust_future_free_f64', 'void', [
|
|
890
|
+
'uint64',
|
|
891
|
+
]);
|
|
892
|
+
const ffiIxSdkFfiRustFutureCompleteF64 = lib.func('ffi_ix_sdk_ffi_rust_future_complete_f64', 'float64', [
|
|
893
|
+
'uint64',
|
|
894
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
895
|
+
]);
|
|
896
|
+
const ffiIxSdkFfiRustFuturePollRustBuffer = lib.func('ffi_ix_sdk_ffi_rust_future_poll_rust_buffer', 'void', [
|
|
897
|
+
'uint64',
|
|
898
|
+
'void *',
|
|
899
|
+
'uint64',
|
|
900
|
+
]);
|
|
901
|
+
const ffiIxSdkFfiRustFutureCancelRustBuffer = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_rust_buffer', 'void', [
|
|
902
|
+
'uint64',
|
|
903
|
+
]);
|
|
904
|
+
const ffiIxSdkFfiRustFutureFreeRustBuffer = lib.func('ffi_ix_sdk_ffi_rust_future_free_rust_buffer', 'void', [
|
|
905
|
+
'uint64',
|
|
906
|
+
]);
|
|
907
|
+
const ffiIxSdkFfiRustFutureCompleteRustBuffer = lib.func('ffi_ix_sdk_ffi_rust_future_complete_rust_buffer', RustBufferByValue, [
|
|
908
|
+
'uint64',
|
|
909
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
910
|
+
]);
|
|
911
|
+
const ffiIxSdkFfiRustFuturePollVoid = lib.func('ffi_ix_sdk_ffi_rust_future_poll_void', 'void', [
|
|
912
|
+
'uint64',
|
|
913
|
+
'void *',
|
|
914
|
+
'uint64',
|
|
915
|
+
]);
|
|
916
|
+
const ffiIxSdkFfiRustFutureCancelVoid = lib.func('ffi_ix_sdk_ffi_rust_future_cancel_void', 'void', [
|
|
917
|
+
'uint64',
|
|
918
|
+
]);
|
|
919
|
+
const ffiIxSdkFfiRustFutureFreeVoid = lib.func('ffi_ix_sdk_ffi_rust_future_free_void', 'void', [
|
|
920
|
+
'uint64',
|
|
921
|
+
]);
|
|
922
|
+
const ffiIxSdkFfiRustFutureCompleteVoid = lib.func('ffi_ix_sdk_ffi_rust_future_complete_void', 'void', [
|
|
923
|
+
'uint64',
|
|
924
|
+
koffi.out(koffi.pointer(RustCallStatus)),
|
|
925
|
+
]);
|
|
926
|
+
|
|
927
|
+
// ---- Buffer reader/writer ----
|
|
928
|
+
|
|
929
|
+
class BufReader {
|
|
930
|
+
private view: DataView;
|
|
931
|
+
private offset: number;
|
|
932
|
+
|
|
933
|
+
constructor(buffer: ArrayBuffer) {
|
|
934
|
+
this.view = new DataView(buffer);
|
|
935
|
+
this.offset = 0;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
readI8(): number { const v = this.view.getInt8(this.offset); this.offset += 1; return v; }
|
|
939
|
+
readU8(): number { const v = this.view.getUint8(this.offset); this.offset += 1; return v; }
|
|
940
|
+
readI16(): number { const v = this.view.getInt16(this.offset, false); this.offset += 2; return v; }
|
|
941
|
+
readU16(): number { const v = this.view.getUint16(this.offset, false); this.offset += 2; return v; }
|
|
942
|
+
readI32(): number { const v = this.view.getInt32(this.offset, false); this.offset += 4; return v; }
|
|
943
|
+
readU32(): number { const v = this.view.getUint32(this.offset, false); this.offset += 4; return v; }
|
|
944
|
+
readI64(): bigint { const v = this.view.getBigInt64(this.offset, false); this.offset += 8; return v; }
|
|
945
|
+
readU64(): bigint { const v = this.view.getBigUint64(this.offset, false); this.offset += 8; return v; }
|
|
946
|
+
readF32(): number { const v = this.view.getFloat32(this.offset, false); this.offset += 4; return v; }
|
|
947
|
+
readF64(): number { const v = this.view.getFloat64(this.offset, false); this.offset += 8; return v; }
|
|
948
|
+
readBool(): boolean { return this.readU8() !== 0; }
|
|
949
|
+
|
|
950
|
+
readString(): string {
|
|
951
|
+
const len = this.readI32();
|
|
952
|
+
const bytes = new Uint8Array(this.view.buffer, this.offset, len);
|
|
953
|
+
this.offset += len;
|
|
954
|
+
return new TextDecoder().decode(bytes);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
readBytes(): Uint8Array {
|
|
958
|
+
const len = this.readI32();
|
|
959
|
+
const bytes = new Uint8Array(this.view.buffer.slice(this.offset, this.offset + len));
|
|
960
|
+
this.offset += len;
|
|
961
|
+
return bytes;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
hasRemaining(): boolean {
|
|
965
|
+
return this.offset < this.view.byteLength;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
class BufWriter {
|
|
970
|
+
private buf: Uint8Array;
|
|
971
|
+
private view: DataView;
|
|
972
|
+
private offset: number;
|
|
973
|
+
|
|
974
|
+
constructor(initialCapacity: number = 256) {
|
|
975
|
+
this.buf = new Uint8Array(initialCapacity);
|
|
976
|
+
this.view = new DataView(this.buf.buffer);
|
|
977
|
+
this.offset = 0;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
private ensureCapacity(needed: number): void {
|
|
981
|
+
while (this.offset + needed > this.buf.length) {
|
|
982
|
+
const newBuf = new Uint8Array(this.buf.length * 2);
|
|
983
|
+
newBuf.set(this.buf);
|
|
984
|
+
this.buf = newBuf;
|
|
985
|
+
this.view = new DataView(this.buf.buffer);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
writeI8(v: number): void { this.ensureCapacity(1); this.view.setInt8(this.offset, v); this.offset += 1; }
|
|
990
|
+
writeU8(v: number): void { this.ensureCapacity(1); this.view.setUint8(this.offset, v); this.offset += 1; }
|
|
991
|
+
writeI16(v: number): void { this.ensureCapacity(2); this.view.setInt16(this.offset, v, false); this.offset += 2; }
|
|
992
|
+
writeU16(v: number): void { this.ensureCapacity(2); this.view.setUint16(this.offset, v, false); this.offset += 2; }
|
|
993
|
+
writeI32(v: number): void { this.ensureCapacity(4); this.view.setInt32(this.offset, v, false); this.offset += 4; }
|
|
994
|
+
writeU32(v: number): void { this.ensureCapacity(4); this.view.setUint32(this.offset, v, false); this.offset += 4; }
|
|
995
|
+
writeI64(v: bigint): void { this.ensureCapacity(8); this.view.setBigInt64(this.offset, v, false); this.offset += 8; }
|
|
996
|
+
writeU64(v: bigint): void { this.ensureCapacity(8); this.view.setBigUint64(this.offset, v, false); this.offset += 8; }
|
|
997
|
+
writeF32(v: number): void { this.ensureCapacity(4); this.view.setFloat32(this.offset, v, false); this.offset += 4; }
|
|
998
|
+
writeF64(v: number): void { this.ensureCapacity(8); this.view.setFloat64(this.offset, v, false); this.offset += 8; }
|
|
999
|
+
writeBool(v: boolean): void { this.writeU8(v ? 1 : 0); }
|
|
1000
|
+
|
|
1001
|
+
writeString(v: string): void {
|
|
1002
|
+
const encoded = new TextEncoder().encode(v);
|
|
1003
|
+
this.writeI32(encoded.length);
|
|
1004
|
+
this.ensureCapacity(encoded.length);
|
|
1005
|
+
this.buf.set(encoded, this.offset);
|
|
1006
|
+
this.offset += encoded.length;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
writeBytes(v: Uint8Array): void {
|
|
1010
|
+
this.ensureCapacity(v.length);
|
|
1011
|
+
this.buf.set(v, this.offset);
|
|
1012
|
+
this.offset += v.length;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
toArrayBuffer(): ArrayBuffer {
|
|
1016
|
+
return this.buf.buffer.slice(0, this.offset);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// ---- Helpers ----
|
|
1021
|
+
|
|
1022
|
+
const CALL_SUCCESS: number = 0;
|
|
1023
|
+
const CALL_ERROR: number = 1;
|
|
1024
|
+
const CALL_UNEXPECTED_ERROR: number = 2;
|
|
1025
|
+
|
|
1026
|
+
class UniffiError extends Error {
|
|
1027
|
+
constructor(message: string) {
|
|
1028
|
+
super(message);
|
|
1029
|
+
this.name = 'UniffiError';
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
const uniffiCloneHandle = Symbol('uniffiCloneHandle');
|
|
1034
|
+
|
|
1035
|
+
function rustCall<T>(fn: (callStatus: any) => T): T {
|
|
1036
|
+
const callStatus = { code: 0, errorBuf: { capacity: 0, len: 0, data: null } };
|
|
1037
|
+
const result = fn(callStatus);
|
|
1038
|
+
checkCallStatus(callStatus);
|
|
1039
|
+
return result;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function rustCallWithError<T>(errorLifter: (buf: any) => Error, fn: (callStatus: any) => T): T {
|
|
1043
|
+
const callStatus = { code: 0, errorBuf: { capacity: 0, len: 0, data: null } };
|
|
1044
|
+
const result = fn(callStatus);
|
|
1045
|
+
checkCallStatusWithError(callStatus, errorLifter);
|
|
1046
|
+
return result;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
function checkCallStatus(callStatus: any): void {
|
|
1050
|
+
switch (callStatus.code) {
|
|
1051
|
+
case CALL_SUCCESS:
|
|
1052
|
+
return;
|
|
1053
|
+
case CALL_ERROR:
|
|
1054
|
+
if (callStatus.errorBuf.len > 0) {
|
|
1055
|
+
deallocRustBuffer(callStatus.errorBuf);
|
|
1056
|
+
}
|
|
1057
|
+
throw new UniffiError('Unexpected call error');
|
|
1058
|
+
case CALL_UNEXPECTED_ERROR:
|
|
1059
|
+
if (callStatus.errorBuf.len > 0) {
|
|
1060
|
+
const msg = liftString(callStatus.errorBuf);
|
|
1061
|
+
throw new UniffiError(msg);
|
|
1062
|
+
}
|
|
1063
|
+
throw new UniffiError('Rust panic');
|
|
1064
|
+
default:
|
|
1065
|
+
throw new UniffiError(`Unexpected call status code: ${callStatus.code}`);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
function checkCallStatusWithError(callStatus: any, errorLifter: (buf: any) => Error): void {
|
|
1070
|
+
switch (callStatus.code) {
|
|
1071
|
+
case CALL_SUCCESS:
|
|
1072
|
+
return;
|
|
1073
|
+
case CALL_ERROR:
|
|
1074
|
+
throw errorLifter(callStatus.errorBuf);
|
|
1075
|
+
case CALL_UNEXPECTED_ERROR:
|
|
1076
|
+
if (callStatus.errorBuf.len > 0) {
|
|
1077
|
+
const msg = liftString(callStatus.errorBuf);
|
|
1078
|
+
throw new UniffiError(msg);
|
|
1079
|
+
}
|
|
1080
|
+
throw new UniffiError('Rust panic');
|
|
1081
|
+
default:
|
|
1082
|
+
throw new UniffiError(`Unexpected call status code: ${callStatus.code}`);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
function liftString(rustBuf: any): string {
|
|
1087
|
+
if (!rustBuf.data || rustBuf.len === 0) return '';
|
|
1088
|
+
const buf = koffi.decode(rustBuf.data, 'uint8', rustBuf.len);
|
|
1089
|
+
const result = new TextDecoder().decode(new Uint8Array(buf));
|
|
1090
|
+
deallocRustBuffer(rustBuf);
|
|
1091
|
+
return result;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
function lowerString(value: string): any {
|
|
1095
|
+
const encoded = new TextEncoder().encode(value);
|
|
1096
|
+
const foreignBytes = { len: encoded.length, data: encoded };
|
|
1097
|
+
return rustCall((cs: any) => rustBufferFromBytes(foreignBytes, cs));
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
function liftBytes(rustBuf: any): Uint8Array {
|
|
1101
|
+
if (!rustBuf.data || rustBuf.len === 0) return new Uint8Array(0);
|
|
1102
|
+
const buf = koffi.decode(rustBuf.data, 'uint8', rustBuf.len);
|
|
1103
|
+
const result = new Uint8Array(buf);
|
|
1104
|
+
deallocRustBuffer(rustBuf);
|
|
1105
|
+
return result;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
function lowerBytes(value: Uint8Array): any {
|
|
1109
|
+
const foreignBytes = { len: value.length, data: value };
|
|
1110
|
+
return rustCall((cs: any) => rustBufferFromBytes(foreignBytes, cs));
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
function liftFromBuffer<T>(rustBuf: any, readFn: (reader: BufReader) => T): T {
|
|
1114
|
+
if (!rustBuf.data || rustBuf.len === 0) {
|
|
1115
|
+
throw new UniffiError('Empty buffer');
|
|
1116
|
+
}
|
|
1117
|
+
const bytes = koffi.decode(rustBuf.data, 'uint8', rustBuf.len);
|
|
1118
|
+
const reader = new BufReader(new Uint8Array(bytes).buffer);
|
|
1119
|
+
const value = readFn(reader);
|
|
1120
|
+
deallocRustBuffer(rustBuf);
|
|
1121
|
+
return value;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
function lowerIntoBuffer<T>(value: T, writeFn: (writer: BufWriter, value: T) => void, _: boolean): any {
|
|
1125
|
+
const writer = new BufWriter();
|
|
1126
|
+
writeFn(writer, value);
|
|
1127
|
+
const bytes = new Uint8Array(writer.toArrayBuffer());
|
|
1128
|
+
const foreignBytes = { len: bytes.length, data: bytes };
|
|
1129
|
+
return rustCall((cs: any) => rustBufferFromBytes(foreignBytes, cs));
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
function readSequence<T>(reader: BufReader, readItem: (r: BufReader) => T): T[] {
|
|
1133
|
+
const len = reader.readI32();
|
|
1134
|
+
const result: T[] = [];
|
|
1135
|
+
for (let i = 0; i < len; i++) {
|
|
1136
|
+
result.push(readItem(reader));
|
|
1137
|
+
}
|
|
1138
|
+
return result;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
function readMap<K, V>(reader: BufReader, readKey: (r: BufReader) => K, readValue: (r: BufReader) => V): Map<K, V> {
|
|
1142
|
+
const len = reader.readI32();
|
|
1143
|
+
const result = new Map<K, V>();
|
|
1144
|
+
for (let i = 0; i < len; i++) {
|
|
1145
|
+
const key = readKey(reader);
|
|
1146
|
+
const value = readValue(reader);
|
|
1147
|
+
result.set(key, value);
|
|
1148
|
+
}
|
|
1149
|
+
return result;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
function writeSequence<T>(writer: BufWriter, value: T[], writeItem: (w: BufWriter, v: T) => void): void {
|
|
1153
|
+
writer.writeI32(value.length);
|
|
1154
|
+
for (const item of value) {
|
|
1155
|
+
writeItem(writer, item);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
function writeMap<K, V>(writer: BufWriter, value: Map<K, V>, writeKey: (w: BufWriter, k: K) => void, writeValue: (w: BufWriter, v: V) => void): void {
|
|
1160
|
+
writer.writeI32(value.size);
|
|
1161
|
+
for (const [k, v] of value) {
|
|
1162
|
+
writeKey(writer, k);
|
|
1163
|
+
writeValue(writer, v);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
function readTimestamp(reader: BufReader): Date {
|
|
1168
|
+
const seconds = reader.readI64();
|
|
1169
|
+
const nanos = reader.readU32();
|
|
1170
|
+
return new Date(Number(seconds) * 1000 + nanos / 1_000_000);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
function writeTimestamp(writer: BufWriter, value: Date): void {
|
|
1174
|
+
const ms = value.getTime();
|
|
1175
|
+
const seconds = BigInt(Math.floor(ms / 1000));
|
|
1176
|
+
const nanos = (ms % 1000) * 1_000_000;
|
|
1177
|
+
writer.writeI64(seconds);
|
|
1178
|
+
writer.writeU32(nanos);
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
export interface UniffiDuration {
|
|
1182
|
+
seconds: bigint;
|
|
1183
|
+
nanos: number;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
function readDuration(reader: BufReader): UniffiDuration {
|
|
1187
|
+
return { seconds: reader.readU64(), nanos: reader.readU32() };
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
function writeDuration(writer: BufWriter, value: UniffiDuration): void {
|
|
1191
|
+
writer.writeU64(value.seconds);
|
|
1192
|
+
writer.writeU32(value.nanos);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
// RustBuffer alloc/free FFI functions
|
|
1196
|
+
const rustBufferFromBytes = lib.func('ffi_ix_sdk_ffi_rustbuffer_from_bytes', RustBufferByValue, [ForeignBytesByValue, koffi.out(koffi.pointer(RustCallStatus))]);
|
|
1197
|
+
const rustBufferFree = lib.func('ffi_ix_sdk_ffi_rustbuffer_free', 'void', [RustBufferByValue, koffi.out(koffi.pointer(RustCallStatus))]);
|
|
1198
|
+
|
|
1199
|
+
function deallocRustBuffer(buf: any): void {
|
|
1200
|
+
if (buf.data && buf.len > 0) {
|
|
1201
|
+
rustCall((cs: any) => rustBufferFree(buf, cs));
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
// ---- Async runtime ----
|
|
1205
|
+
|
|
1206
|
+
const UNIFFI_RUST_FUTURE_POLL_READY = 0;
|
|
1207
|
+
const UNIFFI_RUST_FUTURE_POLL_WAKE = 1;
|
|
1208
|
+
|
|
1209
|
+
let nextContinuationHandle = BigInt(1);
|
|
1210
|
+
const continuationMap = new Map<bigint, (pollResult: number) => void>();
|
|
1211
|
+
|
|
1212
|
+
const uniffiContinuationCallback = koffi.register(
|
|
1213
|
+
(handle: bigint | number, pollResult: number) => {
|
|
1214
|
+
const key = typeof handle === 'bigint' ? handle : BigInt(handle);
|
|
1215
|
+
const resolve = continuationMap.get(key);
|
|
1216
|
+
if (resolve) {
|
|
1217
|
+
continuationMap.delete(key);
|
|
1218
|
+
resolve(pollResult);
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
koffi.pointer(UniffiRustFutureContinuationCallback),
|
|
1222
|
+
);
|
|
1223
|
+
|
|
1224
|
+
async function uniffiRustCallAsync<F, T>(
|
|
1225
|
+
rustFutureFunc: () => bigint,
|
|
1226
|
+
pollFunc: (handle: bigint, cb: any, cbData: bigint) => void,
|
|
1227
|
+
completeFunc: (handle: bigint, cs: any) => F,
|
|
1228
|
+
freeFunc: (handle: bigint) => void,
|
|
1229
|
+
liftFunc: (result: F) => T,
|
|
1230
|
+
errorHandler: ((buf: any) => Error) | null,
|
|
1231
|
+
): Promise<T> {
|
|
1232
|
+
const rustFuture = rustFutureFunc();
|
|
1233
|
+
try {
|
|
1234
|
+
let pollResult: number;
|
|
1235
|
+
do {
|
|
1236
|
+
pollResult = await new Promise<number>((resolve) => {
|
|
1237
|
+
const cbHandle = nextContinuationHandle++;
|
|
1238
|
+
continuationMap.set(cbHandle, resolve);
|
|
1239
|
+
pollFunc(rustFuture, uniffiContinuationCallback, cbHandle);
|
|
1240
|
+
});
|
|
1241
|
+
} while (pollResult !== UNIFFI_RUST_FUTURE_POLL_READY);
|
|
1242
|
+
|
|
1243
|
+
if (errorHandler) {
|
|
1244
|
+
const result = rustCallWithError(errorHandler, (cs: any) => completeFunc(rustFuture, cs));
|
|
1245
|
+
return liftFunc(result);
|
|
1246
|
+
} else {
|
|
1247
|
+
const result = rustCall((cs: any) => completeFunc(rustFuture, cs));
|
|
1248
|
+
return liftFunc(result);
|
|
1249
|
+
}
|
|
1250
|
+
} finally {
|
|
1251
|
+
freeFunc(rustFuture);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
// ---- Record types ----
|
|
1256
|
+
|
|
1257
|
+
export interface FfiApiToken {
|
|
1258
|
+
id: string;
|
|
1259
|
+
name: string;
|
|
1260
|
+
tokenPrefix: string | null;
|
|
1261
|
+
creditLimit: bigint | null;
|
|
1262
|
+
rateLimitPerMinute: bigint | null;
|
|
1263
|
+
creditsConsumed: bigint;
|
|
1264
|
+
creditsRemaining: bigint | null;
|
|
1265
|
+
scopes: string[];
|
|
1266
|
+
expiresAt: string | null;
|
|
1267
|
+
lastUsedAt: string | null;
|
|
1268
|
+
revokedAt: string | null;
|
|
1269
|
+
createdAt: string;
|
|
1270
|
+
childTokens: FfiApiToken[];
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
function readFfiApiToken(reader: BufReader): FfiApiToken {
|
|
1274
|
+
return {
|
|
1275
|
+
id: reader.readString(),
|
|
1276
|
+
name: reader.readString(),
|
|
1277
|
+
tokenPrefix: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1278
|
+
creditLimit: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1279
|
+
rateLimitPerMinute: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1280
|
+
creditsConsumed: reader.readI64(),
|
|
1281
|
+
creditsRemaining: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1282
|
+
scopes: readSequence(reader, (r) => r.readString()),
|
|
1283
|
+
expiresAt: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1284
|
+
lastUsedAt: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1285
|
+
revokedAt: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1286
|
+
createdAt: reader.readString(),
|
|
1287
|
+
childTokens: readSequence(reader, (r) => readFfiApiToken(r)),
|
|
1288
|
+
};
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
function writeFfiApiToken(writer: BufWriter, value: FfiApiToken): void {
|
|
1292
|
+
writer.writeString(value.id);
|
|
1293
|
+
writer.writeString(value.name);
|
|
1294
|
+
if (value.tokenPrefix === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.tokenPrefix) };
|
|
1295
|
+
if (value.creditLimit === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.creditLimit) };
|
|
1296
|
+
if (value.rateLimitPerMinute === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.rateLimitPerMinute) };
|
|
1297
|
+
writer.writeI64(value.creditsConsumed);
|
|
1298
|
+
if (value.creditsRemaining === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.creditsRemaining) };
|
|
1299
|
+
writeSequence(writer, value.scopes, (w, v) => w.writeString(v));
|
|
1300
|
+
if (value.expiresAt === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.expiresAt) };
|
|
1301
|
+
if (value.lastUsedAt === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.lastUsedAt) };
|
|
1302
|
+
if (value.revokedAt === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.revokedAt) };
|
|
1303
|
+
writer.writeString(value.createdAt);
|
|
1304
|
+
writeSequence(writer, value.childTokens, (w, v) => writeFfiApiToken(w, v));
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export interface FfiBillingStatus {
|
|
1308
|
+
balance: bigint;
|
|
1309
|
+
monthlyCredits: bigint;
|
|
1310
|
+
totalGranted: bigint;
|
|
1311
|
+
totalConsumed: bigint;
|
|
1312
|
+
plan: string;
|
|
1313
|
+
periodEnd: string;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
function readFfiBillingStatus(reader: BufReader): FfiBillingStatus {
|
|
1317
|
+
return {
|
|
1318
|
+
balance: reader.readI64(),
|
|
1319
|
+
monthlyCredits: reader.readI64(),
|
|
1320
|
+
totalGranted: reader.readI64(),
|
|
1321
|
+
totalConsumed: reader.readI64(),
|
|
1322
|
+
plan: reader.readString(),
|
|
1323
|
+
periodEnd: reader.readString(),
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
function writeFfiBillingStatus(writer: BufWriter, value: FfiBillingStatus): void {
|
|
1328
|
+
writer.writeI64(value.balance);
|
|
1329
|
+
writer.writeI64(value.monthlyCredits);
|
|
1330
|
+
writer.writeI64(value.totalGranted);
|
|
1331
|
+
writer.writeI64(value.totalConsumed);
|
|
1332
|
+
writer.writeString(value.plan);
|
|
1333
|
+
writer.writeString(value.periodEnd);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
export interface FfiCheckoutSession {
|
|
1337
|
+
url: string;
|
|
1338
|
+
sessionId: string;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
function readFfiCheckoutSession(reader: BufReader): FfiCheckoutSession {
|
|
1342
|
+
return {
|
|
1343
|
+
url: reader.readString(),
|
|
1344
|
+
sessionId: reader.readString(),
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
function writeFfiCheckoutSession(writer: BufWriter, value: FfiCheckoutSession): void {
|
|
1349
|
+
writer.writeString(value.url);
|
|
1350
|
+
writer.writeString(value.sessionId);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
export interface FfiCreateApiTokenInput {
|
|
1354
|
+
name: string;
|
|
1355
|
+
scopes: string[];
|
|
1356
|
+
creditLimit: bigint | null;
|
|
1357
|
+
rateLimitPerMinute: bigint | null;
|
|
1358
|
+
expiresAt: string | null;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
function readFfiCreateApiTokenInput(reader: BufReader): FfiCreateApiTokenInput {
|
|
1362
|
+
return {
|
|
1363
|
+
name: reader.readString(),
|
|
1364
|
+
scopes: readSequence(reader, (r) => r.readString()),
|
|
1365
|
+
creditLimit: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1366
|
+
rateLimitPerMinute: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1367
|
+
expiresAt: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
function writeFfiCreateApiTokenInput(writer: BufWriter, value: FfiCreateApiTokenInput): void {
|
|
1372
|
+
writer.writeString(value.name);
|
|
1373
|
+
writeSequence(writer, value.scopes, (w, v) => w.writeString(v));
|
|
1374
|
+
if (value.creditLimit === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.creditLimit) };
|
|
1375
|
+
if (value.rateLimitPerMinute === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.rateLimitPerMinute) };
|
|
1376
|
+
if (value.expiresAt === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.expiresAt) };
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
export interface FfiCreateApiTokenResult {
|
|
1380
|
+
token: FfiApiToken;
|
|
1381
|
+
tokenValue: string;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
function readFfiCreateApiTokenResult(reader: BufReader): FfiCreateApiTokenResult {
|
|
1385
|
+
return {
|
|
1386
|
+
token: readFfiApiToken(reader),
|
|
1387
|
+
tokenValue: reader.readString(),
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
function writeFfiCreateApiTokenResult(writer: BufWriter, value: FfiCreateApiTokenResult): void {
|
|
1392
|
+
writeFfiApiToken(writer, value.token);
|
|
1393
|
+
writer.writeString(value.tokenValue);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
export interface FfiCreateCheckoutSessionInput {
|
|
1397
|
+
plan: string;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
function readFfiCreateCheckoutSessionInput(reader: BufReader): FfiCreateCheckoutSessionInput {
|
|
1401
|
+
return {
|
|
1402
|
+
plan: reader.readString(),
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
function writeFfiCreateCheckoutSessionInput(writer: BufWriter, value: FfiCreateCheckoutSessionInput): void {
|
|
1407
|
+
writer.writeString(value.plan);
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
export interface FfiUsageEvent {
|
|
1411
|
+
id: string;
|
|
1412
|
+
tokenId: string;
|
|
1413
|
+
creditPoolId: string;
|
|
1414
|
+
resourceType: string;
|
|
1415
|
+
quantity: bigint;
|
|
1416
|
+
unit: string;
|
|
1417
|
+
creditsCharged: bigint;
|
|
1418
|
+
resourceId: string | null;
|
|
1419
|
+
resourceName: string | null;
|
|
1420
|
+
createdAt: string;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
function readFfiUsageEvent(reader: BufReader): FfiUsageEvent {
|
|
1424
|
+
return {
|
|
1425
|
+
id: reader.readString(),
|
|
1426
|
+
tokenId: reader.readString(),
|
|
1427
|
+
creditPoolId: reader.readString(),
|
|
1428
|
+
resourceType: reader.readString(),
|
|
1429
|
+
quantity: reader.readI64(),
|
|
1430
|
+
unit: reader.readString(),
|
|
1431
|
+
creditsCharged: reader.readI64(),
|
|
1432
|
+
resourceId: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1433
|
+
resourceName: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1434
|
+
createdAt: reader.readString(),
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
function writeFfiUsageEvent(writer: BufWriter, value: FfiUsageEvent): void {
|
|
1439
|
+
writer.writeString(value.id);
|
|
1440
|
+
writer.writeString(value.tokenId);
|
|
1441
|
+
writer.writeString(value.creditPoolId);
|
|
1442
|
+
writer.writeString(value.resourceType);
|
|
1443
|
+
writer.writeI64(value.quantity);
|
|
1444
|
+
writer.writeString(value.unit);
|
|
1445
|
+
writer.writeI64(value.creditsCharged);
|
|
1446
|
+
if (value.resourceId === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.resourceId) };
|
|
1447
|
+
if (value.resourceName === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.resourceName) };
|
|
1448
|
+
writer.writeString(value.createdAt);
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
export interface FfiCompute {
|
|
1452
|
+
id: string;
|
|
1453
|
+
name: string;
|
|
1454
|
+
subdomain: string | null;
|
|
1455
|
+
status: FfiComputeStatus;
|
|
1456
|
+
imageRef: string | null;
|
|
1457
|
+
imageSource: FfiImageSource;
|
|
1458
|
+
exposedPorts: bigint[];
|
|
1459
|
+
cpuCores: bigint;
|
|
1460
|
+
memoryMib: bigint;
|
|
1461
|
+
ephemeral: boolean;
|
|
1462
|
+
enableSnapshots: boolean;
|
|
1463
|
+
idleTimeoutSecs: bigint;
|
|
1464
|
+
enableIpv4: boolean;
|
|
1465
|
+
egressProxy: boolean;
|
|
1466
|
+
createdAt: string;
|
|
1467
|
+
updatedAt: string;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
function readFfiCompute(reader: BufReader): FfiCompute {
|
|
1471
|
+
return {
|
|
1472
|
+
id: reader.readString(),
|
|
1473
|
+
name: reader.readString(),
|
|
1474
|
+
subdomain: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1475
|
+
status: readFfiComputeStatus(reader),
|
|
1476
|
+
imageRef: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1477
|
+
imageSource: readFfiImageSource(reader),
|
|
1478
|
+
exposedPorts: readSequence(reader, (r) => r.readI64()),
|
|
1479
|
+
cpuCores: reader.readI64(),
|
|
1480
|
+
memoryMib: reader.readI64(),
|
|
1481
|
+
ephemeral: reader.readBool(),
|
|
1482
|
+
enableSnapshots: reader.readBool(),
|
|
1483
|
+
idleTimeoutSecs: reader.readI64(),
|
|
1484
|
+
enableIpv4: reader.readBool(),
|
|
1485
|
+
egressProxy: reader.readBool(),
|
|
1486
|
+
createdAt: reader.readString(),
|
|
1487
|
+
updatedAt: reader.readString(),
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
function writeFfiCompute(writer: BufWriter, value: FfiCompute): void {
|
|
1492
|
+
writer.writeString(value.id);
|
|
1493
|
+
writer.writeString(value.name);
|
|
1494
|
+
if (value.subdomain === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.subdomain) };
|
|
1495
|
+
writeFfiComputeStatus(writer, value.status);
|
|
1496
|
+
if (value.imageRef === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.imageRef) };
|
|
1497
|
+
writeFfiImageSource(writer, value.imageSource);
|
|
1498
|
+
writeSequence(writer, value.exposedPorts, (w, v) => w.writeI64(v));
|
|
1499
|
+
writer.writeI64(value.cpuCores);
|
|
1500
|
+
writer.writeI64(value.memoryMib);
|
|
1501
|
+
writer.writeBool(value.ephemeral);
|
|
1502
|
+
writer.writeBool(value.enableSnapshots);
|
|
1503
|
+
writer.writeI64(value.idleTimeoutSecs);
|
|
1504
|
+
writer.writeBool(value.enableIpv4);
|
|
1505
|
+
writer.writeBool(value.egressProxy);
|
|
1506
|
+
writer.writeString(value.createdAt);
|
|
1507
|
+
writer.writeString(value.updatedAt);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
export interface FfiComputeInstance {
|
|
1511
|
+
id: string;
|
|
1512
|
+
name: string;
|
|
1513
|
+
status: FfiVmStatus;
|
|
1514
|
+
ipv6: string;
|
|
1515
|
+
ipv4: string | null;
|
|
1516
|
+
maxMemoryMib: bigint;
|
|
1517
|
+
maxCpuCores: bigint;
|
|
1518
|
+
startedAt: string | null;
|
|
1519
|
+
stoppedAt: string | null;
|
|
1520
|
+
failureReason: string | null;
|
|
1521
|
+
createdAt: string;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
function readFfiComputeInstance(reader: BufReader): FfiComputeInstance {
|
|
1525
|
+
return {
|
|
1526
|
+
id: reader.readString(),
|
|
1527
|
+
name: reader.readString(),
|
|
1528
|
+
status: readFfiVmStatus(reader),
|
|
1529
|
+
ipv6: reader.readString(),
|
|
1530
|
+
ipv4: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1531
|
+
maxMemoryMib: reader.readI64(),
|
|
1532
|
+
maxCpuCores: reader.readI64(),
|
|
1533
|
+
startedAt: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1534
|
+
stoppedAt: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1535
|
+
failureReason: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1536
|
+
createdAt: reader.readString(),
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
function writeFfiComputeInstance(writer: BufWriter, value: FfiComputeInstance): void {
|
|
1541
|
+
writer.writeString(value.id);
|
|
1542
|
+
writer.writeString(value.name);
|
|
1543
|
+
writeFfiVmStatus(writer, value.status);
|
|
1544
|
+
writer.writeString(value.ipv6);
|
|
1545
|
+
if (value.ipv4 === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.ipv4) };
|
|
1546
|
+
writer.writeI64(value.maxMemoryMib);
|
|
1547
|
+
writer.writeI64(value.maxCpuCores);
|
|
1548
|
+
if (value.startedAt === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.startedAt) };
|
|
1549
|
+
if (value.stoppedAt === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.stoppedAt) };
|
|
1550
|
+
if (value.failureReason === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.failureReason) };
|
|
1551
|
+
writer.writeString(value.createdAt);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
export interface FfiComputeWithInstances {
|
|
1555
|
+
compute: FfiCompute;
|
|
1556
|
+
instances: FfiComputeInstance[];
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
function readFfiComputeWithInstances(reader: BufReader): FfiComputeWithInstances {
|
|
1560
|
+
return {
|
|
1561
|
+
compute: readFfiCompute(reader),
|
|
1562
|
+
instances: readSequence(reader, (r) => readFfiComputeInstance(r)),
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
function writeFfiComputeWithInstances(writer: BufWriter, value: FfiComputeWithInstances): void {
|
|
1567
|
+
writeFfiCompute(writer, value.compute);
|
|
1568
|
+
writeSequence(writer, value.instances, (w, v) => writeFfiComputeInstance(w, v));
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
export interface FfiCreateComputeInput {
|
|
1572
|
+
name: string | null;
|
|
1573
|
+
subdomain: string | null;
|
|
1574
|
+
exposedPorts: bigint[];
|
|
1575
|
+
cpuCores: bigint;
|
|
1576
|
+
memoryMib: bigint;
|
|
1577
|
+
idleTimeoutSecs: bigint;
|
|
1578
|
+
enableSnapshots: boolean;
|
|
1579
|
+
enableIpv4: boolean;
|
|
1580
|
+
ephemeral: boolean;
|
|
1581
|
+
imageRef: string;
|
|
1582
|
+
healthCheckPath: string | null;
|
|
1583
|
+
healthCheckIntervalSecs: bigint;
|
|
1584
|
+
healthCheckTimeoutSecs: bigint;
|
|
1585
|
+
region: string | null;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
function readFfiCreateComputeInput(reader: BufReader): FfiCreateComputeInput {
|
|
1589
|
+
return {
|
|
1590
|
+
name: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1591
|
+
subdomain: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1592
|
+
exposedPorts: readSequence(reader, (r) => r.readI64()),
|
|
1593
|
+
cpuCores: reader.readI64(),
|
|
1594
|
+
memoryMib: reader.readI64(),
|
|
1595
|
+
idleTimeoutSecs: reader.readI64(),
|
|
1596
|
+
enableSnapshots: reader.readBool(),
|
|
1597
|
+
enableIpv4: reader.readBool(),
|
|
1598
|
+
ephemeral: reader.readBool(),
|
|
1599
|
+
imageRef: reader.readString(),
|
|
1600
|
+
healthCheckPath: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1601
|
+
healthCheckIntervalSecs: reader.readI64(),
|
|
1602
|
+
healthCheckTimeoutSecs: reader.readI64(),
|
|
1603
|
+
region: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
function writeFfiCreateComputeInput(writer: BufWriter, value: FfiCreateComputeInput): void {
|
|
1608
|
+
if (value.name === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.name) };
|
|
1609
|
+
if (value.subdomain === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.subdomain) };
|
|
1610
|
+
writeSequence(writer, value.exposedPorts, (w, v) => w.writeI64(v));
|
|
1611
|
+
writer.writeI64(value.cpuCores);
|
|
1612
|
+
writer.writeI64(value.memoryMib);
|
|
1613
|
+
writer.writeI64(value.idleTimeoutSecs);
|
|
1614
|
+
writer.writeBool(value.enableSnapshots);
|
|
1615
|
+
writer.writeBool(value.enableIpv4);
|
|
1616
|
+
writer.writeBool(value.ephemeral);
|
|
1617
|
+
writer.writeString(value.imageRef);
|
|
1618
|
+
if (value.healthCheckPath === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.healthCheckPath) };
|
|
1619
|
+
writer.writeI64(value.healthCheckIntervalSecs);
|
|
1620
|
+
writer.writeI64(value.healthCheckTimeoutSecs);
|
|
1621
|
+
if (value.region === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.region) };
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
export interface FfiEnvVar {
|
|
1625
|
+
id: string;
|
|
1626
|
+
name: string;
|
|
1627
|
+
value: string;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
function readFfiEnvVar(reader: BufReader): FfiEnvVar {
|
|
1631
|
+
return {
|
|
1632
|
+
id: reader.readString(),
|
|
1633
|
+
name: reader.readString(),
|
|
1634
|
+
value: reader.readString(),
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
function writeFfiEnvVar(writer: BufWriter, value: FfiEnvVar): void {
|
|
1639
|
+
writer.writeString(value.id);
|
|
1640
|
+
writer.writeString(value.name);
|
|
1641
|
+
writer.writeString(value.value);
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
export interface FfiExecResult {
|
|
1645
|
+
exitCode: bigint;
|
|
1646
|
+
stdout: string;
|
|
1647
|
+
stderr: string;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
function readFfiExecResult(reader: BufReader): FfiExecResult {
|
|
1651
|
+
return {
|
|
1652
|
+
exitCode: reader.readI64(),
|
|
1653
|
+
stdout: reader.readString(),
|
|
1654
|
+
stderr: reader.readString(),
|
|
1655
|
+
};
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
function writeFfiExecResult(writer: BufWriter, value: FfiExecResult): void {
|
|
1659
|
+
writer.writeI64(value.exitCode);
|
|
1660
|
+
writer.writeString(value.stdout);
|
|
1661
|
+
writer.writeString(value.stderr);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
export interface FfiShellAttachInfo {
|
|
1665
|
+
computeId: string;
|
|
1666
|
+
computeName: string;
|
|
1667
|
+
computeSubdomain: string | null;
|
|
1668
|
+
computeStatus: FfiComputeStatus;
|
|
1669
|
+
instance: FfiShellAttachInstance | null;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
function readFfiShellAttachInfo(reader: BufReader): FfiShellAttachInfo {
|
|
1673
|
+
return {
|
|
1674
|
+
computeId: reader.readString(),
|
|
1675
|
+
computeName: reader.readString(),
|
|
1676
|
+
computeSubdomain: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1677
|
+
computeStatus: readFfiComputeStatus(reader),
|
|
1678
|
+
instance: (reader.readU8() === 0 ? null : readFfiShellAttachInstance(reader)),
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
function writeFfiShellAttachInfo(writer: BufWriter, value: FfiShellAttachInfo): void {
|
|
1683
|
+
writer.writeString(value.computeId);
|
|
1684
|
+
writer.writeString(value.computeName);
|
|
1685
|
+
if (value.computeSubdomain === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.computeSubdomain) };
|
|
1686
|
+
writeFfiComputeStatus(writer, value.computeStatus);
|
|
1687
|
+
if (value.instance === null) { writer.writeU8(0); } else { writer.writeU8(1); writeFfiShellAttachInstance(writer, value.instance) };
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
export interface FfiShellAttachInstance {
|
|
1691
|
+
vmId: string;
|
|
1692
|
+
attachToken: string | null;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
function readFfiShellAttachInstance(reader: BufReader): FfiShellAttachInstance {
|
|
1696
|
+
return {
|
|
1697
|
+
vmId: reader.readString(),
|
|
1698
|
+
attachToken: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
function writeFfiShellAttachInstance(writer: BufWriter, value: FfiShellAttachInstance): void {
|
|
1703
|
+
writer.writeString(value.vmId);
|
|
1704
|
+
if (value.attachToken === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.attachToken) };
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
export interface FfiUpdateComputeInput {
|
|
1708
|
+
computeId: string;
|
|
1709
|
+
name: string | null;
|
|
1710
|
+
subdomain: string | null;
|
|
1711
|
+
exposedPorts: bigint[] | null;
|
|
1712
|
+
cpuCores: bigint | null;
|
|
1713
|
+
memoryMib: bigint | null;
|
|
1714
|
+
idleTimeoutSecs: bigint | null;
|
|
1715
|
+
enableSnapshots: boolean | null;
|
|
1716
|
+
enableIpv4: boolean | null;
|
|
1717
|
+
ephemeral: boolean | null;
|
|
1718
|
+
imageRef: string | null;
|
|
1719
|
+
healthCheckPath: string | null;
|
|
1720
|
+
healthCheckIntervalSecs: bigint | null;
|
|
1721
|
+
healthCheckTimeoutSecs: bigint | null;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
function readFfiUpdateComputeInput(reader: BufReader): FfiUpdateComputeInput {
|
|
1725
|
+
return {
|
|
1726
|
+
computeId: reader.readString(),
|
|
1727
|
+
name: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1728
|
+
subdomain: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1729
|
+
exposedPorts: (reader.readU8() === 0 ? null : readSequence(reader, (r) => r.readI64())),
|
|
1730
|
+
cpuCores: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1731
|
+
memoryMib: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1732
|
+
idleTimeoutSecs: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1733
|
+
enableSnapshots: (reader.readU8() === 0 ? null : reader.readBool()),
|
|
1734
|
+
enableIpv4: (reader.readU8() === 0 ? null : reader.readBool()),
|
|
1735
|
+
ephemeral: (reader.readU8() === 0 ? null : reader.readBool()),
|
|
1736
|
+
imageRef: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1737
|
+
healthCheckPath: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1738
|
+
healthCheckIntervalSecs: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1739
|
+
healthCheckTimeoutSecs: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
function writeFfiUpdateComputeInput(writer: BufWriter, value: FfiUpdateComputeInput): void {
|
|
1744
|
+
writer.writeString(value.computeId);
|
|
1745
|
+
if (value.name === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.name) };
|
|
1746
|
+
if (value.subdomain === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.subdomain) };
|
|
1747
|
+
if (value.exposedPorts === null) { writer.writeU8(0); } else { writer.writeU8(1); writeSequence(writer, value.exposedPorts, (w, v) => w.writeI64(v)) };
|
|
1748
|
+
if (value.cpuCores === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.cpuCores) };
|
|
1749
|
+
if (value.memoryMib === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.memoryMib) };
|
|
1750
|
+
if (value.idleTimeoutSecs === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.idleTimeoutSecs) };
|
|
1751
|
+
if (value.enableSnapshots === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeBool(value.enableSnapshots) };
|
|
1752
|
+
if (value.enableIpv4 === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeBool(value.enableIpv4) };
|
|
1753
|
+
if (value.ephemeral === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeBool(value.ephemeral) };
|
|
1754
|
+
if (value.imageRef === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.imageRef) };
|
|
1755
|
+
if (value.healthCheckPath === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.healthCheckPath) };
|
|
1756
|
+
if (value.healthCheckIntervalSecs === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.healthCheckIntervalSecs) };
|
|
1757
|
+
if (value.healthCheckTimeoutSecs === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.healthCheckTimeoutSecs) };
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
export interface FfiCreateVmGroupInput {
|
|
1761
|
+
name: string;
|
|
1762
|
+
description: string | null;
|
|
1763
|
+
isPublic: boolean | null;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
function readFfiCreateVmGroupInput(reader: BufReader): FfiCreateVmGroupInput {
|
|
1767
|
+
return {
|
|
1768
|
+
name: reader.readString(),
|
|
1769
|
+
description: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1770
|
+
isPublic: (reader.readU8() === 0 ? null : reader.readBool()),
|
|
1771
|
+
};
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
function writeFfiCreateVmGroupInput(writer: BufWriter, value: FfiCreateVmGroupInput): void {
|
|
1775
|
+
writer.writeString(value.name);
|
|
1776
|
+
if (value.description === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.description) };
|
|
1777
|
+
if (value.isPublic === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeBool(value.isPublic) };
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
export interface FfiVmGroup {
|
|
1781
|
+
id: string;
|
|
1782
|
+
name: string;
|
|
1783
|
+
description: string | null;
|
|
1784
|
+
isPublic: boolean;
|
|
1785
|
+
clusterId: bigint;
|
|
1786
|
+
createdAt: string;
|
|
1787
|
+
updatedAt: string;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
function readFfiVmGroup(reader: BufReader): FfiVmGroup {
|
|
1791
|
+
return {
|
|
1792
|
+
id: reader.readString(),
|
|
1793
|
+
name: reader.readString(),
|
|
1794
|
+
description: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1795
|
+
isPublic: reader.readBool(),
|
|
1796
|
+
clusterId: reader.readI64(),
|
|
1797
|
+
createdAt: reader.readString(),
|
|
1798
|
+
updatedAt: reader.readString(),
|
|
1799
|
+
};
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
function writeFfiVmGroup(writer: BufWriter, value: FfiVmGroup): void {
|
|
1803
|
+
writer.writeString(value.id);
|
|
1804
|
+
writer.writeString(value.name);
|
|
1805
|
+
if (value.description === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.description) };
|
|
1806
|
+
writer.writeBool(value.isPublic);
|
|
1807
|
+
writer.writeI64(value.clusterId);
|
|
1808
|
+
writer.writeString(value.createdAt);
|
|
1809
|
+
writer.writeString(value.updatedAt);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
export interface FfiDirEntry {
|
|
1813
|
+
name: string;
|
|
1814
|
+
size: number;
|
|
1815
|
+
isDir: boolean;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
function readFfiDirEntry(reader: BufReader): FfiDirEntry {
|
|
1819
|
+
return {
|
|
1820
|
+
name: reader.readString(),
|
|
1821
|
+
size: reader.readF64(),
|
|
1822
|
+
isDir: reader.readBool(),
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
function writeFfiDirEntry(writer: BufWriter, value: FfiDirEntry): void {
|
|
1827
|
+
writer.writeString(value.name);
|
|
1828
|
+
writer.writeF64(value.size);
|
|
1829
|
+
writer.writeBool(value.isDir);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
export interface FfiProc {
|
|
1833
|
+
exitCode: number;
|
|
1834
|
+
stdout: string;
|
|
1835
|
+
stderr: string;
|
|
1836
|
+
pre: string;
|
|
1837
|
+
post: string;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
function readFfiProc(reader: BufReader): FfiProc {
|
|
1841
|
+
return {
|
|
1842
|
+
exitCode: reader.readI32(),
|
|
1843
|
+
stdout: reader.readString(),
|
|
1844
|
+
stderr: reader.readString(),
|
|
1845
|
+
pre: reader.readString(),
|
|
1846
|
+
post: reader.readString(),
|
|
1847
|
+
};
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
function writeFfiProc(writer: BufWriter, value: FfiProc): void {
|
|
1851
|
+
writer.writeI32(value.exitCode);
|
|
1852
|
+
writer.writeString(value.stdout);
|
|
1853
|
+
writer.writeString(value.stderr);
|
|
1854
|
+
writer.writeString(value.pre);
|
|
1855
|
+
writer.writeString(value.post);
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
export interface FfiSpawnOptions {
|
|
1859
|
+
name: string | null;
|
|
1860
|
+
memoryMib: bigint | null;
|
|
1861
|
+
cpuCores: bigint | null;
|
|
1862
|
+
ipv4: boolean | null;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
function readFfiSpawnOptions(reader: BufReader): FfiSpawnOptions {
|
|
1866
|
+
return {
|
|
1867
|
+
name: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1868
|
+
memoryMib: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1869
|
+
cpuCores: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
1870
|
+
ipv4: (reader.readU8() === 0 ? null : reader.readBool()),
|
|
1871
|
+
};
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
function writeFfiSpawnOptions(writer: BufWriter, value: FfiSpawnOptions): void {
|
|
1875
|
+
if (value.name === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.name) };
|
|
1876
|
+
if (value.memoryMib === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.memoryMib) };
|
|
1877
|
+
if (value.cpuCores === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.cpuCores) };
|
|
1878
|
+
if (value.ipv4 === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeBool(value.ipv4) };
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
export interface FfiMountConfig {
|
|
1882
|
+
cacheDir: string;
|
|
1883
|
+
cacheMaxBytes: bigint;
|
|
1884
|
+
manifestDir: string;
|
|
1885
|
+
targetsPath: string;
|
|
1886
|
+
walDir: string;
|
|
1887
|
+
pageStoreDir: string;
|
|
1888
|
+
memoryMaxBytes: bigint;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
function readFfiMountConfig(reader: BufReader): FfiMountConfig {
|
|
1892
|
+
return {
|
|
1893
|
+
cacheDir: reader.readString(),
|
|
1894
|
+
cacheMaxBytes: reader.readU64(),
|
|
1895
|
+
manifestDir: reader.readString(),
|
|
1896
|
+
targetsPath: reader.readString(),
|
|
1897
|
+
walDir: reader.readString(),
|
|
1898
|
+
pageStoreDir: reader.readString(),
|
|
1899
|
+
memoryMaxBytes: reader.readU64(),
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
function writeFfiMountConfig(writer: BufWriter, value: FfiMountConfig): void {
|
|
1904
|
+
writer.writeString(value.cacheDir);
|
|
1905
|
+
writer.writeU64(value.cacheMaxBytes);
|
|
1906
|
+
writer.writeString(value.manifestDir);
|
|
1907
|
+
writer.writeString(value.targetsPath);
|
|
1908
|
+
writer.writeString(value.walDir);
|
|
1909
|
+
writer.writeString(value.pageStoreDir);
|
|
1910
|
+
writer.writeU64(value.memoryMaxBytes);
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
export interface FfiMountStatus {
|
|
1914
|
+
config: FfiMountConfig;
|
|
1915
|
+
targets: FfiMountTarget[];
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
function readFfiMountStatus(reader: BufReader): FfiMountStatus {
|
|
1919
|
+
return {
|
|
1920
|
+
config: readFfiMountConfig(reader),
|
|
1921
|
+
targets: readSequence(reader, (r) => readFfiMountTarget(r)),
|
|
1922
|
+
};
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
function writeFfiMountStatus(writer: BufWriter, value: FfiMountStatus): void {
|
|
1926
|
+
writeFfiMountConfig(writer, value.config);
|
|
1927
|
+
writeSequence(writer, value.targets, (w, v) => writeFfiMountTarget(w, v));
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
export interface FfiMountTarget {
|
|
1931
|
+
name: string;
|
|
1932
|
+
computeId: string;
|
|
1933
|
+
manifestHash: string | null;
|
|
1934
|
+
lastSyncedNs: bigint;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
function readFfiMountTarget(reader: BufReader): FfiMountTarget {
|
|
1938
|
+
return {
|
|
1939
|
+
name: reader.readString(),
|
|
1940
|
+
computeId: reader.readString(),
|
|
1941
|
+
manifestHash: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1942
|
+
lastSyncedNs: reader.readU64(),
|
|
1943
|
+
};
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
function writeFfiMountTarget(writer: BufWriter, value: FfiMountTarget): void {
|
|
1947
|
+
writer.writeString(value.name);
|
|
1948
|
+
writer.writeString(value.computeId);
|
|
1949
|
+
if (value.manifestHash === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.manifestHash) };
|
|
1950
|
+
writer.writeU64(value.lastSyncedNs);
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
export interface FfiSyncResult {
|
|
1954
|
+
targetName: string;
|
|
1955
|
+
hash: string;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
function readFfiSyncResult(reader: BufReader): FfiSyncResult {
|
|
1959
|
+
return {
|
|
1960
|
+
targetName: reader.readString(),
|
|
1961
|
+
hash: reader.readString(),
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
function writeFfiSyncResult(writer: BufWriter, value: FfiSyncResult): void {
|
|
1966
|
+
writer.writeString(value.targetName);
|
|
1967
|
+
writer.writeString(value.hash);
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
export interface FfiCreatePreviewInput {
|
|
1971
|
+
imageTag: string | null;
|
|
1972
|
+
forkVolumes: boolean | null;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
function readFfiCreatePreviewInput(reader: BufReader): FfiCreatePreviewInput {
|
|
1976
|
+
return {
|
|
1977
|
+
imageTag: (reader.readU8() === 0 ? null : reader.readString()),
|
|
1978
|
+
forkVolumes: (reader.readU8() === 0 ? null : reader.readBool()),
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
function writeFfiCreatePreviewInput(writer: BufWriter, value: FfiCreatePreviewInput): void {
|
|
1983
|
+
if (value.imageTag === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.imageTag) };
|
|
1984
|
+
if (value.forkVolumes === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeBool(value.forkVolumes) };
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
export interface FfiPreview {
|
|
1988
|
+
id: string;
|
|
1989
|
+
imageTag: string;
|
|
1990
|
+
status: string;
|
|
1991
|
+
createdAt: string;
|
|
1992
|
+
serviceCount: bigint;
|
|
1993
|
+
healthyCount: bigint;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
function readFfiPreview(reader: BufReader): FfiPreview {
|
|
1997
|
+
return {
|
|
1998
|
+
id: reader.readString(),
|
|
1999
|
+
imageTag: reader.readString(),
|
|
2000
|
+
status: reader.readString(),
|
|
2001
|
+
createdAt: reader.readString(),
|
|
2002
|
+
serviceCount: reader.readI64(),
|
|
2003
|
+
healthyCount: reader.readI64(),
|
|
2004
|
+
};
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
function writeFfiPreview(writer: BufWriter, value: FfiPreview): void {
|
|
2008
|
+
writer.writeString(value.id);
|
|
2009
|
+
writer.writeString(value.imageTag);
|
|
2010
|
+
writer.writeString(value.status);
|
|
2011
|
+
writer.writeString(value.createdAt);
|
|
2012
|
+
writer.writeI64(value.serviceCount);
|
|
2013
|
+
writer.writeI64(value.healthyCount);
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
export interface FfiPreviewDetail {
|
|
2017
|
+
id: string;
|
|
2018
|
+
imageTag: string;
|
|
2019
|
+
status: string;
|
|
2020
|
+
createdAt: string;
|
|
2021
|
+
services: FfiPreviewService[];
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
function readFfiPreviewDetail(reader: BufReader): FfiPreviewDetail {
|
|
2025
|
+
return {
|
|
2026
|
+
id: reader.readString(),
|
|
2027
|
+
imageTag: reader.readString(),
|
|
2028
|
+
status: reader.readString(),
|
|
2029
|
+
createdAt: reader.readString(),
|
|
2030
|
+
services: readSequence(reader, (r) => readFfiPreviewService(r)),
|
|
2031
|
+
};
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
function writeFfiPreviewDetail(writer: BufWriter, value: FfiPreviewDetail): void {
|
|
2035
|
+
writer.writeString(value.id);
|
|
2036
|
+
writer.writeString(value.imageTag);
|
|
2037
|
+
writer.writeString(value.status);
|
|
2038
|
+
writer.writeString(value.createdAt);
|
|
2039
|
+
writeSequence(writer, value.services, (w, v) => writeFfiPreviewService(w, v));
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
export interface FfiPreviewService {
|
|
2043
|
+
serviceName: string;
|
|
2044
|
+
status: string;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
function readFfiPreviewService(reader: BufReader): FfiPreviewService {
|
|
2048
|
+
return {
|
|
2049
|
+
serviceName: reader.readString(),
|
|
2050
|
+
status: reader.readString(),
|
|
2051
|
+
};
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
function writeFfiPreviewService(writer: BufWriter, value: FfiPreviewService): void {
|
|
2055
|
+
writer.writeString(value.serviceName);
|
|
2056
|
+
writer.writeString(value.status);
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
export interface FfiRegion {
|
|
2060
|
+
id: string;
|
|
2061
|
+
slug: string;
|
|
2062
|
+
displayName: string;
|
|
2063
|
+
status: string;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
function readFfiRegion(reader: BufReader): FfiRegion {
|
|
2067
|
+
return {
|
|
2068
|
+
id: reader.readString(),
|
|
2069
|
+
slug: reader.readString(),
|
|
2070
|
+
displayName: reader.readString(),
|
|
2071
|
+
status: reader.readString(),
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
function writeFfiRegion(writer: BufWriter, value: FfiRegion): void {
|
|
2076
|
+
writer.writeString(value.id);
|
|
2077
|
+
writer.writeString(value.slug);
|
|
2078
|
+
writer.writeString(value.displayName);
|
|
2079
|
+
writer.writeString(value.status);
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
export interface FfiUser {
|
|
2083
|
+
id: string;
|
|
2084
|
+
username: string;
|
|
2085
|
+
displayName: string | null;
|
|
2086
|
+
email: string;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
function readFfiUser(reader: BufReader): FfiUser {
|
|
2090
|
+
return {
|
|
2091
|
+
id: reader.readString(),
|
|
2092
|
+
username: reader.readString(),
|
|
2093
|
+
displayName: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2094
|
+
email: reader.readString(),
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
function writeFfiUser(writer: BufWriter, value: FfiUser): void {
|
|
2099
|
+
writer.writeString(value.id);
|
|
2100
|
+
writer.writeString(value.username);
|
|
2101
|
+
if (value.displayName === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.displayName) };
|
|
2102
|
+
writer.writeString(value.email);
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
export interface FfiVm {
|
|
2106
|
+
id: string;
|
|
2107
|
+
name: string;
|
|
2108
|
+
image: string;
|
|
2109
|
+
status: FfiVmStatus;
|
|
2110
|
+
ipv6: string;
|
|
2111
|
+
ipv4: string | null;
|
|
2112
|
+
subdomain: string | null;
|
|
2113
|
+
maxMemoryMib: bigint;
|
|
2114
|
+
maxCpuCores: bigint;
|
|
2115
|
+
ephemeral: boolean;
|
|
2116
|
+
forkParentVmId: string | null;
|
|
2117
|
+
forkBaseLsnNs: string | null;
|
|
2118
|
+
createdAt: string;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
function readFfiVm(reader: BufReader): FfiVm {
|
|
2122
|
+
return {
|
|
2123
|
+
id: reader.readString(),
|
|
2124
|
+
name: reader.readString(),
|
|
2125
|
+
image: reader.readString(),
|
|
2126
|
+
status: readFfiVmStatus(reader),
|
|
2127
|
+
ipv6: reader.readString(),
|
|
2128
|
+
ipv4: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2129
|
+
subdomain: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2130
|
+
maxMemoryMib: reader.readI64(),
|
|
2131
|
+
maxCpuCores: reader.readI64(),
|
|
2132
|
+
ephemeral: reader.readBool(),
|
|
2133
|
+
forkParentVmId: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2134
|
+
forkBaseLsnNs: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2135
|
+
createdAt: reader.readString(),
|
|
2136
|
+
};
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
function writeFfiVm(writer: BufWriter, value: FfiVm): void {
|
|
2140
|
+
writer.writeString(value.id);
|
|
2141
|
+
writer.writeString(value.name);
|
|
2142
|
+
writer.writeString(value.image);
|
|
2143
|
+
writeFfiVmStatus(writer, value.status);
|
|
2144
|
+
writer.writeString(value.ipv6);
|
|
2145
|
+
if (value.ipv4 === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.ipv4) };
|
|
2146
|
+
if (value.subdomain === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.subdomain) };
|
|
2147
|
+
writer.writeI64(value.maxMemoryMib);
|
|
2148
|
+
writer.writeI64(value.maxCpuCores);
|
|
2149
|
+
writer.writeBool(value.ephemeral);
|
|
2150
|
+
if (value.forkParentVmId === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.forkParentVmId) };
|
|
2151
|
+
if (value.forkBaseLsnNs === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.forkBaseLsnNs) };
|
|
2152
|
+
writer.writeString(value.createdAt);
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
export interface FfiCreateVmResult {
|
|
2156
|
+
id: string;
|
|
2157
|
+
name: string;
|
|
2158
|
+
status: FfiVmStatus;
|
|
2159
|
+
image: string;
|
|
2160
|
+
ipv6: string;
|
|
2161
|
+
ipv4: string | null;
|
|
2162
|
+
subdomain: string | null;
|
|
2163
|
+
maxMemoryMib: bigint;
|
|
2164
|
+
maxCpuCores: bigint;
|
|
2165
|
+
ephemeral: boolean;
|
|
2166
|
+
createdAt: string;
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
function readFfiCreateVmResult(reader: BufReader): FfiCreateVmResult {
|
|
2170
|
+
return {
|
|
2171
|
+
id: reader.readString(),
|
|
2172
|
+
name: reader.readString(),
|
|
2173
|
+
status: readFfiVmStatus(reader),
|
|
2174
|
+
image: reader.readString(),
|
|
2175
|
+
ipv6: reader.readString(),
|
|
2176
|
+
ipv4: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2177
|
+
subdomain: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2178
|
+
maxMemoryMib: reader.readI64(),
|
|
2179
|
+
maxCpuCores: reader.readI64(),
|
|
2180
|
+
ephemeral: reader.readBool(),
|
|
2181
|
+
createdAt: reader.readString(),
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
function writeFfiCreateVmResult(writer: BufWriter, value: FfiCreateVmResult): void {
|
|
2186
|
+
writer.writeString(value.id);
|
|
2187
|
+
writer.writeString(value.name);
|
|
2188
|
+
writeFfiVmStatus(writer, value.status);
|
|
2189
|
+
writer.writeString(value.image);
|
|
2190
|
+
writer.writeString(value.ipv6);
|
|
2191
|
+
if (value.ipv4 === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.ipv4) };
|
|
2192
|
+
if (value.subdomain === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.subdomain) };
|
|
2193
|
+
writer.writeI64(value.maxMemoryMib);
|
|
2194
|
+
writer.writeI64(value.maxCpuCores);
|
|
2195
|
+
writer.writeBool(value.ephemeral);
|
|
2196
|
+
writer.writeString(value.createdAt);
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
export interface FfiVmAttachInfo {
|
|
2200
|
+
vmId: string;
|
|
2201
|
+
attachToken: string | null;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
function readFfiVmAttachInfo(reader: BufReader): FfiVmAttachInfo {
|
|
2205
|
+
return {
|
|
2206
|
+
vmId: reader.readString(),
|
|
2207
|
+
attachToken: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
function writeFfiVmAttachInfo(writer: BufWriter, value: FfiVmAttachInfo): void {
|
|
2212
|
+
writer.writeString(value.vmId);
|
|
2213
|
+
if (value.attachToken === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.attachToken) };
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
export interface FfiVmLogEntry {
|
|
2217
|
+
timestamp: string;
|
|
2218
|
+
stream: string;
|
|
2219
|
+
message: string;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
function readFfiVmLogEntry(reader: BufReader): FfiVmLogEntry {
|
|
2223
|
+
return {
|
|
2224
|
+
timestamp: reader.readString(),
|
|
2225
|
+
stream: reader.readString(),
|
|
2226
|
+
message: reader.readString(),
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
function writeFfiVmLogEntry(writer: BufWriter, value: FfiVmLogEntry): void {
|
|
2231
|
+
writer.writeString(value.timestamp);
|
|
2232
|
+
writer.writeString(value.stream);
|
|
2233
|
+
writer.writeString(value.message);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
export interface FfiVmMetrics {
|
|
2237
|
+
vmId: string;
|
|
2238
|
+
cpuPercent: number;
|
|
2239
|
+
memoryPercent: number;
|
|
2240
|
+
networkRxBytes: bigint;
|
|
2241
|
+
networkTxBytes: bigint;
|
|
2242
|
+
uptimeSecs: bigint;
|
|
2243
|
+
collectedAt: string;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
function readFfiVmMetrics(reader: BufReader): FfiVmMetrics {
|
|
2247
|
+
return {
|
|
2248
|
+
vmId: reader.readString(),
|
|
2249
|
+
cpuPercent: reader.readF64(),
|
|
2250
|
+
memoryPercent: reader.readF64(),
|
|
2251
|
+
networkRxBytes: reader.readI64(),
|
|
2252
|
+
networkTxBytes: reader.readI64(),
|
|
2253
|
+
uptimeSecs: reader.readI64(),
|
|
2254
|
+
collectedAt: reader.readString(),
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
function writeFfiVmMetrics(writer: BufWriter, value: FfiVmMetrics): void {
|
|
2259
|
+
writer.writeString(value.vmId);
|
|
2260
|
+
writer.writeF64(value.cpuPercent);
|
|
2261
|
+
writer.writeF64(value.memoryPercent);
|
|
2262
|
+
writer.writeI64(value.networkRxBytes);
|
|
2263
|
+
writer.writeI64(value.networkTxBytes);
|
|
2264
|
+
writer.writeI64(value.uptimeSecs);
|
|
2265
|
+
writer.writeString(value.collectedAt);
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
export interface FfiVmMigration {
|
|
2269
|
+
migrationId: string;
|
|
2270
|
+
vmId: string;
|
|
2271
|
+
sourceNodeId: string;
|
|
2272
|
+
targetNodeId: string;
|
|
2273
|
+
phase: FfiMigrationPhase;
|
|
2274
|
+
actualPauseUs: bigint | null;
|
|
2275
|
+
bytesTransferred: bigint | null;
|
|
2276
|
+
failureReason: string | null;
|
|
2277
|
+
createdAt: string;
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
function readFfiVmMigration(reader: BufReader): FfiVmMigration {
|
|
2281
|
+
return {
|
|
2282
|
+
migrationId: reader.readString(),
|
|
2283
|
+
vmId: reader.readString(),
|
|
2284
|
+
sourceNodeId: reader.readString(),
|
|
2285
|
+
targetNodeId: reader.readString(),
|
|
2286
|
+
phase: readFfiMigrationPhase(reader),
|
|
2287
|
+
actualPauseUs: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
2288
|
+
bytesTransferred: (reader.readU8() === 0 ? null : reader.readI64()),
|
|
2289
|
+
failureReason: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2290
|
+
createdAt: reader.readString(),
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
function writeFfiVmMigration(writer: BufWriter, value: FfiVmMigration): void {
|
|
2295
|
+
writer.writeString(value.migrationId);
|
|
2296
|
+
writer.writeString(value.vmId);
|
|
2297
|
+
writer.writeString(value.sourceNodeId);
|
|
2298
|
+
writer.writeString(value.targetNodeId);
|
|
2299
|
+
writeFfiMigrationPhase(writer, value.phase);
|
|
2300
|
+
if (value.actualPauseUs === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.actualPauseUs) };
|
|
2301
|
+
if (value.bytesTransferred === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeI64(value.bytesTransferred) };
|
|
2302
|
+
if (value.failureReason === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.failureReason) };
|
|
2303
|
+
writer.writeString(value.createdAt);
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
export interface FfiVmSecret {
|
|
2307
|
+
id: string;
|
|
2308
|
+
name: string;
|
|
2309
|
+
injectAs: FfiSecretInjection;
|
|
2310
|
+
createdAt: string;
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
function readFfiVmSecret(reader: BufReader): FfiVmSecret {
|
|
2314
|
+
return {
|
|
2315
|
+
id: reader.readString(),
|
|
2316
|
+
name: reader.readString(),
|
|
2317
|
+
injectAs: readFfiSecretInjection(reader),
|
|
2318
|
+
createdAt: reader.readString(),
|
|
2319
|
+
};
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
function writeFfiVmSecret(writer: BufWriter, value: FfiVmSecret): void {
|
|
2323
|
+
writer.writeString(value.id);
|
|
2324
|
+
writer.writeString(value.name);
|
|
2325
|
+
writeFfiSecretInjection(writer, value.injectAs);
|
|
2326
|
+
writer.writeString(value.createdAt);
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
export interface FfiForkVmResult {
|
|
2330
|
+
vmId: string;
|
|
2331
|
+
vmName: string;
|
|
2332
|
+
vmStatus: FfiVmStatus;
|
|
2333
|
+
forkBaseLsnNs: string;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
function readFfiForkVmResult(reader: BufReader): FfiForkVmResult {
|
|
2337
|
+
return {
|
|
2338
|
+
vmId: reader.readString(),
|
|
2339
|
+
vmName: reader.readString(),
|
|
2340
|
+
vmStatus: readFfiVmStatus(reader),
|
|
2341
|
+
forkBaseLsnNs: reader.readString(),
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
function writeFfiForkVmResult(writer: BufWriter, value: FfiForkVmResult): void {
|
|
2346
|
+
writer.writeString(value.vmId);
|
|
2347
|
+
writer.writeString(value.vmName);
|
|
2348
|
+
writeFfiVmStatus(writer, value.vmStatus);
|
|
2349
|
+
writer.writeString(value.forkBaseLsnNs);
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
export interface FfiFsEntry {
|
|
2353
|
+
name: string;
|
|
2354
|
+
size: string;
|
|
2355
|
+
mode: bigint;
|
|
2356
|
+
mtimeNs: string;
|
|
2357
|
+
isDir: boolean;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
function readFfiFsEntry(reader: BufReader): FfiFsEntry {
|
|
2361
|
+
return {
|
|
2362
|
+
name: reader.readString(),
|
|
2363
|
+
size: reader.readString(),
|
|
2364
|
+
mode: reader.readI64(),
|
|
2365
|
+
mtimeNs: reader.readString(),
|
|
2366
|
+
isDir: reader.readBool(),
|
|
2367
|
+
};
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
function writeFfiFsEntry(writer: BufWriter, value: FfiFsEntry): void {
|
|
2371
|
+
writer.writeString(value.name);
|
|
2372
|
+
writer.writeString(value.size);
|
|
2373
|
+
writer.writeI64(value.mode);
|
|
2374
|
+
writer.writeString(value.mtimeNs);
|
|
2375
|
+
writer.writeBool(value.isDir);
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
export interface FfiFsReadResult {
|
|
2379
|
+
path: string;
|
|
2380
|
+
text: string;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
function readFfiFsReadResult(reader: BufReader): FfiFsReadResult {
|
|
2384
|
+
return {
|
|
2385
|
+
path: reader.readString(),
|
|
2386
|
+
text: reader.readString(),
|
|
2387
|
+
};
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
function writeFfiFsReadResult(writer: BufWriter, value: FfiFsReadResult): void {
|
|
2391
|
+
writer.writeString(value.path);
|
|
2392
|
+
writer.writeString(value.text);
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
export interface FfiFsWriteResult {
|
|
2396
|
+
bytesWritten: bigint;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
function readFfiFsWriteResult(reader: BufReader): FfiFsWriteResult {
|
|
2400
|
+
return {
|
|
2401
|
+
bytesWritten: reader.readI64(),
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
function writeFfiFsWriteResult(writer: BufWriter, value: FfiFsWriteResult): void {
|
|
2406
|
+
writer.writeI64(value.bytesWritten);
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
export interface FfiMergePreview {
|
|
2410
|
+
totalOps: bigint;
|
|
2411
|
+
disjointPaths: string[];
|
|
2412
|
+
conflictPaths: string[];
|
|
2413
|
+
astMergeablePaths: string[];
|
|
2414
|
+
lineMergeablePaths: string[];
|
|
2415
|
+
contentConflictPaths: string[];
|
|
2416
|
+
skippedPaths: string[];
|
|
2417
|
+
dataViolationPaths: string[];
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
function readFfiMergePreview(reader: BufReader): FfiMergePreview {
|
|
2421
|
+
return {
|
|
2422
|
+
totalOps: reader.readI64(),
|
|
2423
|
+
disjointPaths: readSequence(reader, (r) => r.readString()),
|
|
2424
|
+
conflictPaths: readSequence(reader, (r) => r.readString()),
|
|
2425
|
+
astMergeablePaths: readSequence(reader, (r) => r.readString()),
|
|
2426
|
+
lineMergeablePaths: readSequence(reader, (r) => r.readString()),
|
|
2427
|
+
contentConflictPaths: readSequence(reader, (r) => r.readString()),
|
|
2428
|
+
skippedPaths: readSequence(reader, (r) => r.readString()),
|
|
2429
|
+
dataViolationPaths: readSequence(reader, (r) => r.readString()),
|
|
2430
|
+
};
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
function writeFfiMergePreview(writer: BufWriter, value: FfiMergePreview): void {
|
|
2434
|
+
writer.writeI64(value.totalOps);
|
|
2435
|
+
writeSequence(writer, value.disjointPaths, (w, v) => w.writeString(v));
|
|
2436
|
+
writeSequence(writer, value.conflictPaths, (w, v) => w.writeString(v));
|
|
2437
|
+
writeSequence(writer, value.astMergeablePaths, (w, v) => w.writeString(v));
|
|
2438
|
+
writeSequence(writer, value.lineMergeablePaths, (w, v) => w.writeString(v));
|
|
2439
|
+
writeSequence(writer, value.contentConflictPaths, (w, v) => w.writeString(v));
|
|
2440
|
+
writeSequence(writer, value.skippedPaths, (w, v) => w.writeString(v));
|
|
2441
|
+
writeSequence(writer, value.dataViolationPaths, (w, v) => w.writeString(v));
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
export interface FfiMergeVmResult {
|
|
2445
|
+
appliedOps: bigint;
|
|
2446
|
+
appliedPaths: string[];
|
|
2447
|
+
autoMergedPaths: string[];
|
|
2448
|
+
autoResolvedPaths: string[];
|
|
2449
|
+
conflictPaths: string[];
|
|
2450
|
+
astMergedPaths: string[];
|
|
2451
|
+
lineMergedPaths: string[];
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
function readFfiMergeVmResult(reader: BufReader): FfiMergeVmResult {
|
|
2455
|
+
return {
|
|
2456
|
+
appliedOps: reader.readI64(),
|
|
2457
|
+
appliedPaths: readSequence(reader, (r) => r.readString()),
|
|
2458
|
+
autoMergedPaths: readSequence(reader, (r) => r.readString()),
|
|
2459
|
+
autoResolvedPaths: readSequence(reader, (r) => r.readString()),
|
|
2460
|
+
conflictPaths: readSequence(reader, (r) => r.readString()),
|
|
2461
|
+
astMergedPaths: readSequence(reader, (r) => r.readString()),
|
|
2462
|
+
lineMergedPaths: readSequence(reader, (r) => r.readString()),
|
|
2463
|
+
};
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
function writeFfiMergeVmResult(writer: BufWriter, value: FfiMergeVmResult): void {
|
|
2467
|
+
writer.writeI64(value.appliedOps);
|
|
2468
|
+
writeSequence(writer, value.appliedPaths, (w, v) => w.writeString(v));
|
|
2469
|
+
writeSequence(writer, value.autoMergedPaths, (w, v) => w.writeString(v));
|
|
2470
|
+
writeSequence(writer, value.autoResolvedPaths, (w, v) => w.writeString(v));
|
|
2471
|
+
writeSequence(writer, value.conflictPaths, (w, v) => w.writeString(v));
|
|
2472
|
+
writeSequence(writer, value.astMergedPaths, (w, v) => w.writeString(v));
|
|
2473
|
+
writeSequence(writer, value.lineMergedPaths, (w, v) => w.writeString(v));
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
export interface FfiRevertVmResult {
|
|
2477
|
+
vmId: string;
|
|
2478
|
+
effectiveLsnNs: string;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
function readFfiRevertVmResult(reader: BufReader): FfiRevertVmResult {
|
|
2482
|
+
return {
|
|
2483
|
+
vmId: reader.readString(),
|
|
2484
|
+
effectiveLsnNs: reader.readString(),
|
|
2485
|
+
};
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
function writeFfiRevertVmResult(writer: BufWriter, value: FfiRevertVmResult): void {
|
|
2489
|
+
writer.writeString(value.vmId);
|
|
2490
|
+
writer.writeString(value.effectiveLsnNs);
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
export interface FfiUndoRedoResult {
|
|
2494
|
+
vmId: string;
|
|
2495
|
+
changed: boolean;
|
|
2496
|
+
effectiveLsnNs: string;
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
function readFfiUndoRedoResult(reader: BufReader): FfiUndoRedoResult {
|
|
2500
|
+
return {
|
|
2501
|
+
vmId: reader.readString(),
|
|
2502
|
+
changed: reader.readBool(),
|
|
2503
|
+
effectiveLsnNs: reader.readString(),
|
|
2504
|
+
};
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
function writeFfiUndoRedoResult(writer: BufWriter, value: FfiUndoRedoResult): void {
|
|
2508
|
+
writer.writeString(value.vmId);
|
|
2509
|
+
writer.writeBool(value.changed);
|
|
2510
|
+
writer.writeString(value.effectiveLsnNs);
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
export interface FfiVmSnapshot {
|
|
2514
|
+
id: string;
|
|
2515
|
+
vmId: string;
|
|
2516
|
+
parentId: string | null;
|
|
2517
|
+
status: FfiSnapshotStatus;
|
|
2518
|
+
memoryMib: bigint;
|
|
2519
|
+
manifestKey: string | null;
|
|
2520
|
+
createdAtMillis: bigint;
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
function readFfiVmSnapshot(reader: BufReader): FfiVmSnapshot {
|
|
2524
|
+
return {
|
|
2525
|
+
id: reader.readString(),
|
|
2526
|
+
vmId: reader.readString(),
|
|
2527
|
+
parentId: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2528
|
+
status: readFfiSnapshotStatus(reader),
|
|
2529
|
+
memoryMib: reader.readI64(),
|
|
2530
|
+
manifestKey: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2531
|
+
createdAtMillis: reader.readI64(),
|
|
2532
|
+
};
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
function writeFfiVmSnapshot(writer: BufWriter, value: FfiVmSnapshot): void {
|
|
2536
|
+
writer.writeString(value.id);
|
|
2537
|
+
writer.writeString(value.vmId);
|
|
2538
|
+
if (value.parentId === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.parentId) };
|
|
2539
|
+
writeFfiSnapshotStatus(writer, value.status);
|
|
2540
|
+
writer.writeI64(value.memoryMib);
|
|
2541
|
+
if (value.manifestKey === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.manifestKey) };
|
|
2542
|
+
writer.writeI64(value.createdAtMillis);
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
export interface FfiVmSnapshotBranch {
|
|
2546
|
+
id: string;
|
|
2547
|
+
vmId: string;
|
|
2548
|
+
name: string;
|
|
2549
|
+
tipId: string;
|
|
2550
|
+
createdAtMillis: bigint;
|
|
2551
|
+
updatedAtMillis: bigint;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
function readFfiVmSnapshotBranch(reader: BufReader): FfiVmSnapshotBranch {
|
|
2555
|
+
return {
|
|
2556
|
+
id: reader.readString(),
|
|
2557
|
+
vmId: reader.readString(),
|
|
2558
|
+
name: reader.readString(),
|
|
2559
|
+
tipId: reader.readString(),
|
|
2560
|
+
createdAtMillis: reader.readI64(),
|
|
2561
|
+
updatedAtMillis: reader.readI64(),
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
function writeFfiVmSnapshotBranch(writer: BufWriter, value: FfiVmSnapshotBranch): void {
|
|
2566
|
+
writer.writeString(value.id);
|
|
2567
|
+
writer.writeString(value.vmId);
|
|
2568
|
+
writer.writeString(value.name);
|
|
2569
|
+
writer.writeString(value.tipId);
|
|
2570
|
+
writer.writeI64(value.createdAtMillis);
|
|
2571
|
+
writer.writeI64(value.updatedAtMillis);
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
export interface FfiCreateVolumeInput {
|
|
2575
|
+
name: string;
|
|
2576
|
+
vmId: string | null;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
function readFfiCreateVolumeInput(reader: BufReader): FfiCreateVolumeInput {
|
|
2580
|
+
return {
|
|
2581
|
+
name: reader.readString(),
|
|
2582
|
+
vmId: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
function writeFfiCreateVolumeInput(writer: BufWriter, value: FfiCreateVolumeInput): void {
|
|
2587
|
+
writer.writeString(value.name);
|
|
2588
|
+
if (value.vmId === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.vmId) };
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
export interface FfiForkVolumeInput {
|
|
2592
|
+
sourceVolumeId: string;
|
|
2593
|
+
name: string;
|
|
2594
|
+
vmId: string | null;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
function readFfiForkVolumeInput(reader: BufReader): FfiForkVolumeInput {
|
|
2598
|
+
return {
|
|
2599
|
+
sourceVolumeId: reader.readString(),
|
|
2600
|
+
name: reader.readString(),
|
|
2601
|
+
vmId: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2602
|
+
};
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
function writeFfiForkVolumeInput(writer: BufWriter, value: FfiForkVolumeInput): void {
|
|
2606
|
+
writer.writeString(value.sourceVolumeId);
|
|
2607
|
+
writer.writeString(value.name);
|
|
2608
|
+
if (value.vmId === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.vmId) };
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
export interface FfiVolume {
|
|
2612
|
+
id: string;
|
|
2613
|
+
name: string;
|
|
2614
|
+
vmId: string | null;
|
|
2615
|
+
currentManifestTimestamp: string | null;
|
|
2616
|
+
sizeBytes: bigint;
|
|
2617
|
+
createdAt: string;
|
|
2618
|
+
updatedAt: string;
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
function readFfiVolume(reader: BufReader): FfiVolume {
|
|
2622
|
+
return {
|
|
2623
|
+
id: reader.readString(),
|
|
2624
|
+
name: reader.readString(),
|
|
2625
|
+
vmId: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2626
|
+
currentManifestTimestamp: (reader.readU8() === 0 ? null : reader.readString()),
|
|
2627
|
+
sizeBytes: reader.readI64(),
|
|
2628
|
+
createdAt: reader.readString(),
|
|
2629
|
+
updatedAt: reader.readString(),
|
|
2630
|
+
};
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
function writeFfiVolume(writer: BufWriter, value: FfiVolume): void {
|
|
2634
|
+
writer.writeString(value.id);
|
|
2635
|
+
writer.writeString(value.name);
|
|
2636
|
+
if (value.vmId === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.vmId) };
|
|
2637
|
+
if (value.currentManifestTimestamp === null) { writer.writeU8(0); } else { writer.writeU8(1); writer.writeString(value.currentManifestTimestamp) };
|
|
2638
|
+
writer.writeI64(value.sizeBytes);
|
|
2639
|
+
writer.writeString(value.createdAt);
|
|
2640
|
+
writer.writeString(value.updatedAt);
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
export interface FfiVolumeSnapshot {
|
|
2644
|
+
id: string;
|
|
2645
|
+
volumeId: string;
|
|
2646
|
+
name: string;
|
|
2647
|
+
manifestTimestamp: string;
|
|
2648
|
+
createdAt: string;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
function readFfiVolumeSnapshot(reader: BufReader): FfiVolumeSnapshot {
|
|
2652
|
+
return {
|
|
2653
|
+
id: reader.readString(),
|
|
2654
|
+
volumeId: reader.readString(),
|
|
2655
|
+
name: reader.readString(),
|
|
2656
|
+
manifestTimestamp: reader.readString(),
|
|
2657
|
+
createdAt: reader.readString(),
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
function writeFfiVolumeSnapshot(writer: BufWriter, value: FfiVolumeSnapshot): void {
|
|
2662
|
+
writer.writeString(value.id);
|
|
2663
|
+
writer.writeString(value.volumeId);
|
|
2664
|
+
writer.writeString(value.name);
|
|
2665
|
+
writer.writeString(value.manifestTimestamp);
|
|
2666
|
+
writer.writeString(value.createdAt);
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
// ---- Enum types ----
|
|
2670
|
+
export interface FfiMountErrorTargetNotFound {
|
|
2671
|
+
tag: 'TargetNotFound';
|
|
2672
|
+
name: string;
|
|
2673
|
+
}
|
|
2674
|
+
export interface FfiMountErrorTargetExists {
|
|
2675
|
+
tag: 'TargetExists';
|
|
2676
|
+
name: string;
|
|
2677
|
+
}
|
|
2678
|
+
export interface FfiMountErrorRegistry {
|
|
2679
|
+
tag: 'Registry';
|
|
2680
|
+
msg: string;
|
|
2681
|
+
}
|
|
2682
|
+
export interface FfiMountErrorArchived {
|
|
2683
|
+
tag: 'Archived';
|
|
2684
|
+
msg: string;
|
|
2685
|
+
}
|
|
2686
|
+
export interface FfiMountErrorIo {
|
|
2687
|
+
tag: 'Io';
|
|
2688
|
+
msg: string;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
export type FfiMountError =
|
|
2692
|
+
| FfiMountErrorTargetNotFound
|
|
2693
|
+
| FfiMountErrorTargetExists
|
|
2694
|
+
| FfiMountErrorRegistry
|
|
2695
|
+
| FfiMountErrorArchived
|
|
2696
|
+
| FfiMountErrorIo;
|
|
2697
|
+
|
|
2698
|
+
function readFfiMountError(reader: BufReader): FfiMountError {
|
|
2699
|
+
const variant = reader.readI32();
|
|
2700
|
+
switch (variant) {
|
|
2701
|
+
case 1:
|
|
2702
|
+
return {
|
|
2703
|
+
tag: 'TargetNotFound' as const,
|
|
2704
|
+
name: reader.readString(),
|
|
2705
|
+
};
|
|
2706
|
+
case 2:
|
|
2707
|
+
return {
|
|
2708
|
+
tag: 'TargetExists' as const,
|
|
2709
|
+
name: reader.readString(),
|
|
2710
|
+
};
|
|
2711
|
+
case 3:
|
|
2712
|
+
return {
|
|
2713
|
+
tag: 'Registry' as const,
|
|
2714
|
+
msg: reader.readString(),
|
|
2715
|
+
};
|
|
2716
|
+
case 4:
|
|
2717
|
+
return {
|
|
2718
|
+
tag: 'Archived' as const,
|
|
2719
|
+
msg: reader.readString(),
|
|
2720
|
+
};
|
|
2721
|
+
case 5:
|
|
2722
|
+
return {
|
|
2723
|
+
tag: 'Io' as const,
|
|
2724
|
+
msg: reader.readString(),
|
|
2725
|
+
};
|
|
2726
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
function writeFfiMountError(writer: BufWriter, value: FfiMountError): void {
|
|
2731
|
+
switch (value.tag) {
|
|
2732
|
+
case 'TargetNotFound':
|
|
2733
|
+
writer.writeI32(1);
|
|
2734
|
+
writer.writeString(value.name);
|
|
2735
|
+
break;
|
|
2736
|
+
case 'TargetExists':
|
|
2737
|
+
writer.writeI32(2);
|
|
2738
|
+
writer.writeString(value.name);
|
|
2739
|
+
break;
|
|
2740
|
+
case 'Registry':
|
|
2741
|
+
writer.writeI32(3);
|
|
2742
|
+
writer.writeString(value.msg);
|
|
2743
|
+
break;
|
|
2744
|
+
case 'Archived':
|
|
2745
|
+
writer.writeI32(4);
|
|
2746
|
+
writer.writeString(value.msg);
|
|
2747
|
+
break;
|
|
2748
|
+
case 'Io':
|
|
2749
|
+
writer.writeI32(5);
|
|
2750
|
+
writer.writeString(value.msg);
|
|
2751
|
+
break;
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
export interface FfiSdkErrorPaymentRequired {
|
|
2755
|
+
tag: 'PaymentRequired';
|
|
2756
|
+
}
|
|
2757
|
+
export interface FfiSdkErrorUnauthorized {
|
|
2758
|
+
tag: 'Unauthorized';
|
|
2759
|
+
reason: string;
|
|
2760
|
+
}
|
|
2761
|
+
export interface FfiSdkErrorConnectionFailed {
|
|
2762
|
+
tag: 'ConnectionFailed';
|
|
2763
|
+
reason: string;
|
|
2764
|
+
}
|
|
2765
|
+
export interface FfiSdkErrorNotFound {
|
|
2766
|
+
tag: 'NotFound';
|
|
2767
|
+
kind: string;
|
|
2768
|
+
identifier: string;
|
|
2769
|
+
}
|
|
2770
|
+
export interface FfiSdkErrorError {
|
|
2771
|
+
tag: 'Error';
|
|
2772
|
+
summary: string;
|
|
2773
|
+
}
|
|
2774
|
+
export interface FfiSdkErrorHttpError {
|
|
2775
|
+
tag: 'HttpError';
|
|
2776
|
+
status: number;
|
|
2777
|
+
body: string;
|
|
2778
|
+
}
|
|
2779
|
+
export interface FfiSdkErrorRequestFailed {
|
|
2780
|
+
tag: 'RequestFailed';
|
|
2781
|
+
msg: string;
|
|
2782
|
+
}
|
|
2783
|
+
export interface FfiSdkErrorParseError {
|
|
2784
|
+
tag: 'ParseError';
|
|
2785
|
+
msg: string;
|
|
2786
|
+
}
|
|
2787
|
+
export interface FfiSdkErrorNoData {
|
|
2788
|
+
tag: 'NoData';
|
|
2789
|
+
}
|
|
2790
|
+
export interface FfiSdkErrorCapacityExhausted {
|
|
2791
|
+
tag: 'CapacityExhausted';
|
|
2792
|
+
message: string;
|
|
2793
|
+
}
|
|
2794
|
+
export interface FfiSdkErrorInternal {
|
|
2795
|
+
tag: 'Internal';
|
|
2796
|
+
msg: string;
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
export type FfiSdkError =
|
|
2800
|
+
| FfiSdkErrorPaymentRequired
|
|
2801
|
+
| FfiSdkErrorUnauthorized
|
|
2802
|
+
| FfiSdkErrorConnectionFailed
|
|
2803
|
+
| FfiSdkErrorNotFound
|
|
2804
|
+
| FfiSdkErrorError
|
|
2805
|
+
| FfiSdkErrorHttpError
|
|
2806
|
+
| FfiSdkErrorRequestFailed
|
|
2807
|
+
| FfiSdkErrorParseError
|
|
2808
|
+
| FfiSdkErrorNoData
|
|
2809
|
+
| FfiSdkErrorCapacityExhausted
|
|
2810
|
+
| FfiSdkErrorInternal;
|
|
2811
|
+
|
|
2812
|
+
function readFfiSdkError(reader: BufReader): FfiSdkError {
|
|
2813
|
+
const variant = reader.readI32();
|
|
2814
|
+
switch (variant) {
|
|
2815
|
+
case 1:
|
|
2816
|
+
return {
|
|
2817
|
+
tag: 'PaymentRequired' as const,
|
|
2818
|
+
};
|
|
2819
|
+
case 2:
|
|
2820
|
+
return {
|
|
2821
|
+
tag: 'Unauthorized' as const,
|
|
2822
|
+
reason: reader.readString(),
|
|
2823
|
+
};
|
|
2824
|
+
case 3:
|
|
2825
|
+
return {
|
|
2826
|
+
tag: 'ConnectionFailed' as const,
|
|
2827
|
+
reason: reader.readString(),
|
|
2828
|
+
};
|
|
2829
|
+
case 4:
|
|
2830
|
+
return {
|
|
2831
|
+
tag: 'NotFound' as const,
|
|
2832
|
+
kind: reader.readString(),
|
|
2833
|
+
identifier: reader.readString(),
|
|
2834
|
+
};
|
|
2835
|
+
case 5:
|
|
2836
|
+
return {
|
|
2837
|
+
tag: 'Error' as const,
|
|
2838
|
+
summary: reader.readString(),
|
|
2839
|
+
};
|
|
2840
|
+
case 6:
|
|
2841
|
+
return {
|
|
2842
|
+
tag: 'HttpError' as const,
|
|
2843
|
+
status: reader.readU16(),
|
|
2844
|
+
body: reader.readString(),
|
|
2845
|
+
};
|
|
2846
|
+
case 7:
|
|
2847
|
+
return {
|
|
2848
|
+
tag: 'RequestFailed' as const,
|
|
2849
|
+
msg: reader.readString(),
|
|
2850
|
+
};
|
|
2851
|
+
case 8:
|
|
2852
|
+
return {
|
|
2853
|
+
tag: 'ParseError' as const,
|
|
2854
|
+
msg: reader.readString(),
|
|
2855
|
+
};
|
|
2856
|
+
case 9:
|
|
2857
|
+
return {
|
|
2858
|
+
tag: 'NoData' as const,
|
|
2859
|
+
};
|
|
2860
|
+
case 10:
|
|
2861
|
+
return {
|
|
2862
|
+
tag: 'CapacityExhausted' as const,
|
|
2863
|
+
message: reader.readString(),
|
|
2864
|
+
};
|
|
2865
|
+
case 11:
|
|
2866
|
+
return {
|
|
2867
|
+
tag: 'Internal' as const,
|
|
2868
|
+
msg: reader.readString(),
|
|
2869
|
+
};
|
|
2870
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
function writeFfiSdkError(writer: BufWriter, value: FfiSdkError): void {
|
|
2875
|
+
switch (value.tag) {
|
|
2876
|
+
case 'PaymentRequired':
|
|
2877
|
+
writer.writeI32(1);
|
|
2878
|
+
break;
|
|
2879
|
+
case 'Unauthorized':
|
|
2880
|
+
writer.writeI32(2);
|
|
2881
|
+
writer.writeString(value.reason);
|
|
2882
|
+
break;
|
|
2883
|
+
case 'ConnectionFailed':
|
|
2884
|
+
writer.writeI32(3);
|
|
2885
|
+
writer.writeString(value.reason);
|
|
2886
|
+
break;
|
|
2887
|
+
case 'NotFound':
|
|
2888
|
+
writer.writeI32(4);
|
|
2889
|
+
writer.writeString(value.kind);
|
|
2890
|
+
writer.writeString(value.identifier);
|
|
2891
|
+
break;
|
|
2892
|
+
case 'Error':
|
|
2893
|
+
writer.writeI32(5);
|
|
2894
|
+
writer.writeString(value.summary);
|
|
2895
|
+
break;
|
|
2896
|
+
case 'HttpError':
|
|
2897
|
+
writer.writeI32(6);
|
|
2898
|
+
writer.writeU16(value.status);
|
|
2899
|
+
writer.writeString(value.body);
|
|
2900
|
+
break;
|
|
2901
|
+
case 'RequestFailed':
|
|
2902
|
+
writer.writeI32(7);
|
|
2903
|
+
writer.writeString(value.msg);
|
|
2904
|
+
break;
|
|
2905
|
+
case 'ParseError':
|
|
2906
|
+
writer.writeI32(8);
|
|
2907
|
+
writer.writeString(value.msg);
|
|
2908
|
+
break;
|
|
2909
|
+
case 'NoData':
|
|
2910
|
+
writer.writeI32(9);
|
|
2911
|
+
break;
|
|
2912
|
+
case 'CapacityExhausted':
|
|
2913
|
+
writer.writeI32(10);
|
|
2914
|
+
writer.writeString(value.message);
|
|
2915
|
+
break;
|
|
2916
|
+
case 'Internal':
|
|
2917
|
+
writer.writeI32(11);
|
|
2918
|
+
writer.writeString(value.msg);
|
|
2919
|
+
break;
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
export enum FfiComputeStatus {
|
|
2924
|
+
Creating = 1,
|
|
2925
|
+
Deploying = 2,
|
|
2926
|
+
Running = 3,
|
|
2927
|
+
Idle = 4,
|
|
2928
|
+
Stopped = 5,
|
|
2929
|
+
Failed = 6,
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
function readFfiComputeStatus(reader: BufReader): FfiComputeStatus {
|
|
2933
|
+
const variant = reader.readI32();
|
|
2934
|
+
switch (variant) {
|
|
2935
|
+
case 1: return FfiComputeStatus.Creating;
|
|
2936
|
+
case 2: return FfiComputeStatus.Deploying;
|
|
2937
|
+
case 3: return FfiComputeStatus.Running;
|
|
2938
|
+
case 4: return FfiComputeStatus.Idle;
|
|
2939
|
+
case 5: return FfiComputeStatus.Stopped;
|
|
2940
|
+
case 6: return FfiComputeStatus.Failed;
|
|
2941
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
function writeFfiComputeStatus(writer: BufWriter, value: FfiComputeStatus): void {
|
|
2946
|
+
writer.writeI32(value);
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
export enum FfiImageSource {
|
|
2950
|
+
External = 1,
|
|
2951
|
+
System = 2,
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
function readFfiImageSource(reader: BufReader): FfiImageSource {
|
|
2955
|
+
const variant = reader.readI32();
|
|
2956
|
+
switch (variant) {
|
|
2957
|
+
case 1: return FfiImageSource.External;
|
|
2958
|
+
case 2: return FfiImageSource.System;
|
|
2959
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2963
|
+
function writeFfiImageSource(writer: BufWriter, value: FfiImageSource): void {
|
|
2964
|
+
writer.writeI32(value);
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
export enum FfiMigrationPhase {
|
|
2968
|
+
Planning = 1,
|
|
2969
|
+
CapturingSource = 2,
|
|
2970
|
+
SourceCaptured = 3,
|
|
2971
|
+
PreparingTarget = 4,
|
|
2972
|
+
RestoringTarget = 5,
|
|
2973
|
+
TargetReady = 6,
|
|
2974
|
+
DrainingSource = 7,
|
|
2975
|
+
CuttingOver = 8,
|
|
2976
|
+
VmResumed = 9,
|
|
2977
|
+
Committed = 10,
|
|
2978
|
+
CleaningUp = 11,
|
|
2979
|
+
Completed = 12,
|
|
2980
|
+
Failed = 13,
|
|
2981
|
+
Cancelled = 14,
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
function readFfiMigrationPhase(reader: BufReader): FfiMigrationPhase {
|
|
2985
|
+
const variant = reader.readI32();
|
|
2986
|
+
switch (variant) {
|
|
2987
|
+
case 1: return FfiMigrationPhase.Planning;
|
|
2988
|
+
case 2: return FfiMigrationPhase.CapturingSource;
|
|
2989
|
+
case 3: return FfiMigrationPhase.SourceCaptured;
|
|
2990
|
+
case 4: return FfiMigrationPhase.PreparingTarget;
|
|
2991
|
+
case 5: return FfiMigrationPhase.RestoringTarget;
|
|
2992
|
+
case 6: return FfiMigrationPhase.TargetReady;
|
|
2993
|
+
case 7: return FfiMigrationPhase.DrainingSource;
|
|
2994
|
+
case 8: return FfiMigrationPhase.CuttingOver;
|
|
2995
|
+
case 9: return FfiMigrationPhase.VmResumed;
|
|
2996
|
+
case 10: return FfiMigrationPhase.Committed;
|
|
2997
|
+
case 11: return FfiMigrationPhase.CleaningUp;
|
|
2998
|
+
case 12: return FfiMigrationPhase.Completed;
|
|
2999
|
+
case 13: return FfiMigrationPhase.Failed;
|
|
3000
|
+
case 14: return FfiMigrationPhase.Cancelled;
|
|
3001
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
function writeFfiMigrationPhase(writer: BufWriter, value: FfiMigrationPhase): void {
|
|
3006
|
+
writer.writeI32(value);
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
export enum FfiSecretInjection {
|
|
3010
|
+
Env = 1,
|
|
3011
|
+
File = 2,
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
function readFfiSecretInjection(reader: BufReader): FfiSecretInjection {
|
|
3015
|
+
const variant = reader.readI32();
|
|
3016
|
+
switch (variant) {
|
|
3017
|
+
case 1: return FfiSecretInjection.Env;
|
|
3018
|
+
case 2: return FfiSecretInjection.File;
|
|
3019
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
function writeFfiSecretInjection(writer: BufWriter, value: FfiSecretInjection): void {
|
|
3024
|
+
writer.writeI32(value);
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
export enum FfiSnapshotStatus {
|
|
3028
|
+
Capturing = 1,
|
|
3029
|
+
Ready = 2,
|
|
3030
|
+
Failed = 3,
|
|
3031
|
+
}
|
|
3032
|
+
|
|
3033
|
+
function readFfiSnapshotStatus(reader: BufReader): FfiSnapshotStatus {
|
|
3034
|
+
const variant = reader.readI32();
|
|
3035
|
+
switch (variant) {
|
|
3036
|
+
case 1: return FfiSnapshotStatus.Capturing;
|
|
3037
|
+
case 2: return FfiSnapshotStatus.Ready;
|
|
3038
|
+
case 3: return FfiSnapshotStatus.Failed;
|
|
3039
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
function writeFfiSnapshotStatus(writer: BufWriter, value: FfiSnapshotStatus): void {
|
|
3044
|
+
writer.writeI32(value);
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
export enum FfiVmStatus {
|
|
3048
|
+
Creating = 1,
|
|
3049
|
+
Pending = 2,
|
|
3050
|
+
Starting = 3,
|
|
3051
|
+
Running = 4,
|
|
3052
|
+
Migrating = 5,
|
|
3053
|
+
Checkpointing = 6,
|
|
3054
|
+
Sleeping = 7,
|
|
3055
|
+
Waking = 8,
|
|
3056
|
+
Stopping = 9,
|
|
3057
|
+
Stopped = 10,
|
|
3058
|
+
Failed = 11,
|
|
3059
|
+
Deleted = 12,
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
function readFfiVmStatus(reader: BufReader): FfiVmStatus {
|
|
3063
|
+
const variant = reader.readI32();
|
|
3064
|
+
switch (variant) {
|
|
3065
|
+
case 1: return FfiVmStatus.Creating;
|
|
3066
|
+
case 2: return FfiVmStatus.Pending;
|
|
3067
|
+
case 3: return FfiVmStatus.Starting;
|
|
3068
|
+
case 4: return FfiVmStatus.Running;
|
|
3069
|
+
case 5: return FfiVmStatus.Migrating;
|
|
3070
|
+
case 6: return FfiVmStatus.Checkpointing;
|
|
3071
|
+
case 7: return FfiVmStatus.Sleeping;
|
|
3072
|
+
case 8: return FfiVmStatus.Waking;
|
|
3073
|
+
case 9: return FfiVmStatus.Stopping;
|
|
3074
|
+
case 10: return FfiVmStatus.Stopped;
|
|
3075
|
+
case 11: return FfiVmStatus.Failed;
|
|
3076
|
+
case 12: return FfiVmStatus.Deleted;
|
|
3077
|
+
default: throw new UniffiError(`Unexpected enum variant: ${variant}`);
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
function writeFfiVmStatus(writer: BufWriter, value: FfiVmStatus): void {
|
|
3082
|
+
writer.writeI32(value);
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
// ---- Error types ----
|
|
3086
|
+
|
|
3087
|
+
export class FfiMountErrorError extends Error {
|
|
3088
|
+
readonly variant: FfiMountError;
|
|
3089
|
+
|
|
3090
|
+
constructor(variant: FfiMountError) {
|
|
3091
|
+
super("FfiMountError: " + variant.tag);
|
|
3092
|
+
this.name = 'FfiMountErrorError';
|
|
3093
|
+
this.variant = variant;
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
function liftFfiMountErrorError(rustBuf: any): FfiMountErrorError {
|
|
3098
|
+
const variant = liftFromBuffer(rustBuf, (r) => readFfiMountError(r));
|
|
3099
|
+
return new FfiMountErrorError(variant);
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
export class FfiSdkErrorError extends Error {
|
|
3103
|
+
readonly variant: FfiSdkError;
|
|
3104
|
+
|
|
3105
|
+
constructor(variant: FfiSdkError) {
|
|
3106
|
+
super("FfiSdkError: " + variant.tag);
|
|
3107
|
+
this.name = 'FfiSdkErrorError';
|
|
3108
|
+
this.variant = variant;
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3112
|
+
function liftFfiSdkErrorError(rustBuf: any): FfiSdkErrorError {
|
|
3113
|
+
const variant = liftFromBuffer(rustBuf, (r) => readFfiSdkError(r));
|
|
3114
|
+
return new FfiSdkErrorError(variant);
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
// ---- Object types ----
|
|
3118
|
+
|
|
3119
|
+
export class IxSdkClient {
|
|
3120
|
+
private readonly handle: bigint;
|
|
3121
|
+
|
|
3122
|
+
/** @internal */
|
|
3123
|
+
constructor(handle: bigint) {
|
|
3124
|
+
this.handle = handle;
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
[uniffiCloneHandle](): bigint {
|
|
3128
|
+
return rustCall((cs: any) => uniffiIxSdkFfiFnCloneIxsdkclient(this.handle, cs));
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
/** Release this object's handle. */
|
|
3132
|
+
close(): void {
|
|
3133
|
+
rustCall((cs: any) => uniffiIxSdkFfiFnFreeIxsdkclient(this.handle, cs));
|
|
3134
|
+
}
|
|
3135
|
+
static create(
|
|
3136
|
+
server: string,
|
|
3137
|
+
token: string
|
|
3138
|
+
): IxSdkClient {
|
|
3139
|
+
const handle = rustCallWithError(
|
|
3140
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3141
|
+
(cs: any) => uniffiIxSdkFfiFnConstructorIxsdkclientNew(
|
|
3142
|
+
lowerString(server),
|
|
3143
|
+
lowerString(token),
|
|
3144
|
+
cs
|
|
3145
|
+
)
|
|
3146
|
+
);
|
|
3147
|
+
return new IxSdkClient(BigInt(handle));
|
|
3148
|
+
}
|
|
3149
|
+
async billingStatus(
|
|
3150
|
+
): Promise<FfiBillingStatus> {
|
|
3151
|
+
return await uniffiRustCallAsync(
|
|
3152
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientBillingStatus(this.handle,
|
|
3153
|
+
),
|
|
3154
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3155
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3156
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3157
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiBillingStatus(r)),
|
|
3158
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3159
|
+
);
|
|
3160
|
+
}
|
|
3161
|
+
async createApiToken(
|
|
3162
|
+
input: FfiCreateApiTokenInput
|
|
3163
|
+
): Promise<FfiCreateApiTokenResult> {
|
|
3164
|
+
return await uniffiRustCallAsync(
|
|
3165
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateApiToken(this.handle,
|
|
3166
|
+
lowerIntoBuffer(input, (w, v) => writeFfiCreateApiTokenInput(w, v), false),
|
|
3167
|
+
),
|
|
3168
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3169
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3170
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3171
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiCreateApiTokenResult(r)),
|
|
3172
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3173
|
+
);
|
|
3174
|
+
}
|
|
3175
|
+
async createCheckoutSession(
|
|
3176
|
+
input: FfiCreateCheckoutSessionInput
|
|
3177
|
+
): Promise<FfiCheckoutSession> {
|
|
3178
|
+
return await uniffiRustCallAsync(
|
|
3179
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateCheckoutSession(this.handle,
|
|
3180
|
+
lowerIntoBuffer(input, (w, v) => writeFfiCreateCheckoutSessionInput(w, v), false),
|
|
3181
|
+
),
|
|
3182
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3183
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3184
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3185
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiCheckoutSession(r)),
|
|
3186
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3187
|
+
);
|
|
3188
|
+
}
|
|
3189
|
+
async listApiTokens(
|
|
3190
|
+
): Promise<FfiApiToken[]> {
|
|
3191
|
+
return await uniffiRustCallAsync(
|
|
3192
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListApiTokens(this.handle,
|
|
3193
|
+
),
|
|
3194
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3195
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3196
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3197
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiApiToken(r))),
|
|
3198
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3199
|
+
);
|
|
3200
|
+
}
|
|
3201
|
+
async me(
|
|
3202
|
+
): Promise<FfiUser> {
|
|
3203
|
+
return await uniffiRustCallAsync(
|
|
3204
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientMe(this.handle,
|
|
3205
|
+
),
|
|
3206
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3207
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3208
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3209
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiUser(r)),
|
|
3210
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3211
|
+
);
|
|
3212
|
+
}
|
|
3213
|
+
async revokeApiToken(
|
|
3214
|
+
tokenId: string
|
|
3215
|
+
): Promise<void> {
|
|
3216
|
+
return await uniffiRustCallAsync(
|
|
3217
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientRevokeApiToken(this.handle,
|
|
3218
|
+
lowerString(tokenId),
|
|
3219
|
+
),
|
|
3220
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3221
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3222
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3223
|
+
(_: any) => {},
|
|
3224
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3225
|
+
);
|
|
3226
|
+
}
|
|
3227
|
+
async usageEvents(
|
|
3228
|
+
tokenId: string,
|
|
3229
|
+
since: string | null,
|
|
3230
|
+
until: string | null,
|
|
3231
|
+
resourceType: string | null,
|
|
3232
|
+
limit: bigint
|
|
3233
|
+
): Promise<FfiUsageEvent[]> {
|
|
3234
|
+
return await uniffiRustCallAsync(
|
|
3235
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientUsageEvents(this.handle,
|
|
3236
|
+
lowerString(tokenId),
|
|
3237
|
+
lowerIntoBuffer(since, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3238
|
+
lowerIntoBuffer(until, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3239
|
+
lowerIntoBuffer(resourceType, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3240
|
+
limit,
|
|
3241
|
+
),
|
|
3242
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3243
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3244
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3245
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiUsageEvent(r))),
|
|
3246
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3247
|
+
);
|
|
3248
|
+
}
|
|
3249
|
+
async computeBySubdomain(
|
|
3250
|
+
subdomain: string
|
|
3251
|
+
): Promise<FfiCompute> {
|
|
3252
|
+
return await uniffiRustCallAsync(
|
|
3253
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientComputeBySubdomain(this.handle,
|
|
3254
|
+
lowerString(subdomain),
|
|
3255
|
+
),
|
|
3256
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3257
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3258
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3259
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiCompute(r)),
|
|
3260
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3261
|
+
);
|
|
3262
|
+
}
|
|
3263
|
+
async computeEnvVars(
|
|
3264
|
+
computeId: string
|
|
3265
|
+
): Promise<FfiEnvVar[]> {
|
|
3266
|
+
return await uniffiRustCallAsync(
|
|
3267
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientComputeEnvVars(this.handle,
|
|
3268
|
+
lowerString(computeId),
|
|
3269
|
+
),
|
|
3270
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3271
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3272
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3273
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiEnvVar(r))),
|
|
3274
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3275
|
+
);
|
|
3276
|
+
}
|
|
3277
|
+
async computeInstances(
|
|
3278
|
+
computeId: string
|
|
3279
|
+
): Promise<FfiComputeInstance[]> {
|
|
3280
|
+
return await uniffiRustCallAsync(
|
|
3281
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientComputeInstances(this.handle,
|
|
3282
|
+
lowerString(computeId),
|
|
3283
|
+
),
|
|
3284
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3285
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3286
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3287
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiComputeInstance(r))),
|
|
3288
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3289
|
+
);
|
|
3290
|
+
}
|
|
3291
|
+
async createCompute(
|
|
3292
|
+
input: FfiCreateComputeInput
|
|
3293
|
+
): Promise<FfiCompute> {
|
|
3294
|
+
return await uniffiRustCallAsync(
|
|
3295
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateCompute(this.handle,
|
|
3296
|
+
lowerIntoBuffer(input, (w, v) => writeFfiCreateComputeInput(w, v), false),
|
|
3297
|
+
),
|
|
3298
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3299
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3300
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3301
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiCompute(r)),
|
|
3302
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3303
|
+
);
|
|
3304
|
+
}
|
|
3305
|
+
async createComputeAndWait(
|
|
3306
|
+
input: FfiCreateComputeInput
|
|
3307
|
+
): Promise<FfiComputeWithInstances> {
|
|
3308
|
+
return await uniffiRustCallAsync(
|
|
3309
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateComputeAndWait(this.handle,
|
|
3310
|
+
lowerIntoBuffer(input, (w, v) => writeFfiCreateComputeInput(w, v), false),
|
|
3311
|
+
),
|
|
3312
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3313
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3314
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3315
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiComputeWithInstances(r)),
|
|
3316
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3317
|
+
);
|
|
3318
|
+
}
|
|
3319
|
+
async deleteCompute(
|
|
3320
|
+
computeId: string
|
|
3321
|
+
): Promise<void> {
|
|
3322
|
+
return await uniffiRustCallAsync(
|
|
3323
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientDeleteCompute(this.handle,
|
|
3324
|
+
lowerString(computeId),
|
|
3325
|
+
),
|
|
3326
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3327
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3328
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3329
|
+
(_: any) => {},
|
|
3330
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3331
|
+
);
|
|
3332
|
+
}
|
|
3333
|
+
async deleteComputeEnv(
|
|
3334
|
+
computeId: string,
|
|
3335
|
+
key: string
|
|
3336
|
+
): Promise<void> {
|
|
3337
|
+
return await uniffiRustCallAsync(
|
|
3338
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientDeleteComputeEnv(this.handle,
|
|
3339
|
+
lowerString(computeId),
|
|
3340
|
+
lowerString(key),
|
|
3341
|
+
),
|
|
3342
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3343
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3344
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3345
|
+
(_: any) => {},
|
|
3346
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3347
|
+
);
|
|
3348
|
+
}
|
|
3349
|
+
async deployCompute(
|
|
3350
|
+
computeId: string
|
|
3351
|
+
): Promise<void> {
|
|
3352
|
+
return await uniffiRustCallAsync(
|
|
3353
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientDeployCompute(this.handle,
|
|
3354
|
+
lowerString(computeId),
|
|
3355
|
+
),
|
|
3356
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3357
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3358
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3359
|
+
(_: any) => {},
|
|
3360
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3361
|
+
);
|
|
3362
|
+
}
|
|
3363
|
+
async execCompute(
|
|
3364
|
+
computeId: string,
|
|
3365
|
+
command: string[],
|
|
3366
|
+
workingDir: string | null
|
|
3367
|
+
): Promise<FfiExecResult> {
|
|
3368
|
+
return await uniffiRustCallAsync(
|
|
3369
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientExecCompute(this.handle,
|
|
3370
|
+
lowerString(computeId),
|
|
3371
|
+
lowerIntoBuffer(command, (w, v) => { w.writeI32(v.length); for (const item of v) { w.writeString(item) } }, false),
|
|
3372
|
+
lowerIntoBuffer(workingDir, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3373
|
+
),
|
|
3374
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3375
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3376
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3377
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiExecResult(r)),
|
|
3378
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3379
|
+
);
|
|
3380
|
+
}
|
|
3381
|
+
async listComputes(
|
|
3382
|
+
): Promise<FfiCompute[]> {
|
|
3383
|
+
return await uniffiRustCallAsync(
|
|
3384
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListComputes(this.handle,
|
|
3385
|
+
),
|
|
3386
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3387
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3388
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3389
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiCompute(r))),
|
|
3390
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3391
|
+
);
|
|
3392
|
+
}
|
|
3393
|
+
async pauseCompute(
|
|
3394
|
+
computeId: string
|
|
3395
|
+
): Promise<void> {
|
|
3396
|
+
return await uniffiRustCallAsync(
|
|
3397
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientPauseCompute(this.handle,
|
|
3398
|
+
lowerString(computeId),
|
|
3399
|
+
),
|
|
3400
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3401
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3402
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3403
|
+
(_: any) => {},
|
|
3404
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3405
|
+
);
|
|
3406
|
+
}
|
|
3407
|
+
async resumeCompute(
|
|
3408
|
+
computeId: string
|
|
3409
|
+
): Promise<void> {
|
|
3410
|
+
return await uniffiRustCallAsync(
|
|
3411
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientResumeCompute(this.handle,
|
|
3412
|
+
lowerString(computeId),
|
|
3413
|
+
),
|
|
3414
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3415
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3416
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3417
|
+
(_: any) => {},
|
|
3418
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3419
|
+
);
|
|
3420
|
+
}
|
|
3421
|
+
async setComputeEnv(
|
|
3422
|
+
computeId: string,
|
|
3423
|
+
key: string,
|
|
3424
|
+
value: string
|
|
3425
|
+
): Promise<void> {
|
|
3426
|
+
return await uniffiRustCallAsync(
|
|
3427
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientSetComputeEnv(this.handle,
|
|
3428
|
+
lowerString(computeId),
|
|
3429
|
+
lowerString(key),
|
|
3430
|
+
lowerString(value),
|
|
3431
|
+
),
|
|
3432
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3433
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3434
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3435
|
+
(_: any) => {},
|
|
3436
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3437
|
+
);
|
|
3438
|
+
}
|
|
3439
|
+
async shellAttachInfo(
|
|
3440
|
+
computeId: string
|
|
3441
|
+
): Promise<FfiShellAttachInfo> {
|
|
3442
|
+
return await uniffiRustCallAsync(
|
|
3443
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientShellAttachInfo(this.handle,
|
|
3444
|
+
lowerString(computeId),
|
|
3445
|
+
),
|
|
3446
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3447
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3448
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3449
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiShellAttachInfo(r)),
|
|
3450
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3451
|
+
);
|
|
3452
|
+
}
|
|
3453
|
+
async updateCompute(
|
|
3454
|
+
input: FfiUpdateComputeInput
|
|
3455
|
+
): Promise<FfiCompute> {
|
|
3456
|
+
return await uniffiRustCallAsync(
|
|
3457
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientUpdateCompute(this.handle,
|
|
3458
|
+
lowerIntoBuffer(input, (w, v) => writeFfiUpdateComputeInput(w, v), false),
|
|
3459
|
+
),
|
|
3460
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3461
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3462
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3463
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiCompute(r)),
|
|
3464
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3465
|
+
);
|
|
3466
|
+
}
|
|
3467
|
+
async addVmToGroup(
|
|
3468
|
+
groupId: string,
|
|
3469
|
+
vmId: string
|
|
3470
|
+
): Promise<void> {
|
|
3471
|
+
return await uniffiRustCallAsync(
|
|
3472
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientAddVmToGroup(this.handle,
|
|
3473
|
+
lowerString(groupId),
|
|
3474
|
+
lowerString(vmId),
|
|
3475
|
+
),
|
|
3476
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3477
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3478
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3479
|
+
(_: any) => {},
|
|
3480
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3481
|
+
);
|
|
3482
|
+
}
|
|
3483
|
+
async createVmGroup(
|
|
3484
|
+
input: FfiCreateVmGroupInput
|
|
3485
|
+
): Promise<FfiVmGroup> {
|
|
3486
|
+
return await uniffiRustCallAsync(
|
|
3487
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateVmGroup(this.handle,
|
|
3488
|
+
lowerIntoBuffer(input, (w, v) => writeFfiCreateVmGroupInput(w, v), false),
|
|
3489
|
+
),
|
|
3490
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3491
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3492
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3493
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVmGroup(r)),
|
|
3494
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3495
|
+
);
|
|
3496
|
+
}
|
|
3497
|
+
async deleteVmGroup(
|
|
3498
|
+
groupId: string
|
|
3499
|
+
): Promise<void> {
|
|
3500
|
+
return await uniffiRustCallAsync(
|
|
3501
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientDeleteVmGroup(this.handle,
|
|
3502
|
+
lowerString(groupId),
|
|
3503
|
+
),
|
|
3504
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3505
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3506
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3507
|
+
(_: any) => {},
|
|
3508
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3509
|
+
);
|
|
3510
|
+
}
|
|
3511
|
+
async listVmGroups(
|
|
3512
|
+
): Promise<FfiVmGroup[]> {
|
|
3513
|
+
return await uniffiRustCallAsync(
|
|
3514
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListVmGroups(this.handle,
|
|
3515
|
+
),
|
|
3516
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3517
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3518
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3519
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVmGroup(r))),
|
|
3520
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3521
|
+
);
|
|
3522
|
+
}
|
|
3523
|
+
async removeVmFromGroup(
|
|
3524
|
+
groupId: string,
|
|
3525
|
+
vmId: string
|
|
3526
|
+
): Promise<void> {
|
|
3527
|
+
return await uniffiRustCallAsync(
|
|
3528
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientRemoveVmFromGroup(this.handle,
|
|
3529
|
+
lowerString(groupId),
|
|
3530
|
+
lowerString(vmId),
|
|
3531
|
+
),
|
|
3532
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3533
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3534
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3535
|
+
(_: any) => {},
|
|
3536
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3537
|
+
);
|
|
3538
|
+
}
|
|
3539
|
+
describe(
|
|
3540
|
+
entity: string,
|
|
3541
|
+
text: string
|
|
3542
|
+
): void {
|
|
3543
|
+
rustCallWithError(
|
|
3544
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3545
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientDescribe(this.handle,
|
|
3546
|
+
lowerString(entity),
|
|
3547
|
+
lowerString(text),
|
|
3548
|
+
cs
|
|
3549
|
+
)
|
|
3550
|
+
);
|
|
3551
|
+
}
|
|
3552
|
+
async exec(
|
|
3553
|
+
branch: string,
|
|
3554
|
+
cmd: string,
|
|
3555
|
+
cwd: string | null
|
|
3556
|
+
): Promise<FfiProc> {
|
|
3557
|
+
return await uniffiRustCallAsync(
|
|
3558
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientExec(this.handle,
|
|
3559
|
+
lowerString(branch),
|
|
3560
|
+
lowerString(cmd),
|
|
3561
|
+
lowerIntoBuffer(cwd, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3562
|
+
),
|
|
3563
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3564
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3565
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3566
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiProc(r)),
|
|
3567
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3568
|
+
);
|
|
3569
|
+
}
|
|
3570
|
+
filter(
|
|
3571
|
+
fs: string,
|
|
3572
|
+
globs: string[]
|
|
3573
|
+
): string {
|
|
3574
|
+
const result = rustCallWithError(
|
|
3575
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3576
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientFilter(this.handle,
|
|
3577
|
+
lowerString(fs),
|
|
3578
|
+
lowerIntoBuffer(globs, (w, v) => { w.writeI32(v.length); for (const item of v) { w.writeString(item) } }, false),
|
|
3579
|
+
cs
|
|
3580
|
+
)
|
|
3581
|
+
);
|
|
3582
|
+
return liftString(result);
|
|
3583
|
+
}
|
|
3584
|
+
async forkAt(
|
|
3585
|
+
branch: string,
|
|
3586
|
+
timestampMs: bigint
|
|
3587
|
+
): Promise<string> {
|
|
3588
|
+
return await uniffiRustCallAsync(
|
|
3589
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientForkAt(this.handle,
|
|
3590
|
+
lowerString(branch),
|
|
3591
|
+
timestampMs,
|
|
3592
|
+
),
|
|
3593
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3594
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3595
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3596
|
+
(result: any) => liftString(result),
|
|
3597
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3598
|
+
);
|
|
3599
|
+
}
|
|
3600
|
+
async forkBranch(
|
|
3601
|
+
branch: string
|
|
3602
|
+
): Promise<string> {
|
|
3603
|
+
return await uniffiRustCallAsync(
|
|
3604
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientForkBranch(this.handle,
|
|
3605
|
+
lowerString(branch),
|
|
3606
|
+
),
|
|
3607
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3608
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3609
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3610
|
+
(result: any) => liftString(result),
|
|
3611
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3612
|
+
);
|
|
3613
|
+
}
|
|
3614
|
+
getFs(
|
|
3615
|
+
commit: string
|
|
3616
|
+
): string {
|
|
3617
|
+
const result = rustCallWithError(
|
|
3618
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3619
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientGetFs(this.handle,
|
|
3620
|
+
lowerString(commit),
|
|
3621
|
+
cs
|
|
3622
|
+
)
|
|
3623
|
+
);
|
|
3624
|
+
return liftString(result);
|
|
3625
|
+
}
|
|
3626
|
+
async head(
|
|
3627
|
+
branch: string
|
|
3628
|
+
): Promise<string> {
|
|
3629
|
+
return await uniffiRustCallAsync(
|
|
3630
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientHead(this.handle,
|
|
3631
|
+
lowerString(branch),
|
|
3632
|
+
),
|
|
3633
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3634
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3635
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3636
|
+
(result: any) => liftString(result),
|
|
3637
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3638
|
+
);
|
|
3639
|
+
}
|
|
3640
|
+
async listDirAt(
|
|
3641
|
+
branch: string,
|
|
3642
|
+
path: string,
|
|
3643
|
+
timestampMs: bigint
|
|
3644
|
+
): Promise<FfiDirEntry[]> {
|
|
3645
|
+
return await uniffiRustCallAsync(
|
|
3646
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListDirAt(this.handle,
|
|
3647
|
+
lowerString(branch),
|
|
3648
|
+
lowerString(path),
|
|
3649
|
+
timestampMs,
|
|
3650
|
+
),
|
|
3651
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3652
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3653
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3654
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiDirEntry(r))),
|
|
3655
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3656
|
+
);
|
|
3657
|
+
}
|
|
3658
|
+
async readFileAt(
|
|
3659
|
+
branch: string,
|
|
3660
|
+
path: string,
|
|
3661
|
+
timestampMs: bigint
|
|
3662
|
+
): Promise<string> {
|
|
3663
|
+
return await uniffiRustCallAsync(
|
|
3664
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientReadFileAt(this.handle,
|
|
3665
|
+
lowerString(branch),
|
|
3666
|
+
lowerString(path),
|
|
3667
|
+
timestampMs,
|
|
3668
|
+
),
|
|
3669
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3670
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3671
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3672
|
+
(result: any) => liftString(result),
|
|
3673
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3674
|
+
);
|
|
3675
|
+
}
|
|
3676
|
+
async snapshots(
|
|
3677
|
+
branch: string
|
|
3678
|
+
): Promise<string[]> {
|
|
3679
|
+
return await uniffiRustCallAsync(
|
|
3680
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientSnapshots(this.handle,
|
|
3681
|
+
lowerString(branch),
|
|
3682
|
+
),
|
|
3683
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3684
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3685
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3686
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => r.readString())),
|
|
3687
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3688
|
+
);
|
|
3689
|
+
}
|
|
3690
|
+
async spawn(
|
|
3691
|
+
image: string,
|
|
3692
|
+
options: FfiSpawnOptions | null
|
|
3693
|
+
): Promise<string> {
|
|
3694
|
+
if (process.platform === 'linux') {
|
|
3695
|
+
return this.spawnBlocking(image, options);
|
|
3696
|
+
}
|
|
3697
|
+
return await uniffiRustCallAsync(
|
|
3698
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientSpawn(this.handle,
|
|
3699
|
+
lowerString(image),
|
|
3700
|
+
lowerIntoBuffer(options, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); writeFfiSpawnOptions(w, v) } }, false),
|
|
3701
|
+
),
|
|
3702
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3703
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3704
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3705
|
+
(result: any) => liftString(result),
|
|
3706
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3707
|
+
);
|
|
3708
|
+
}
|
|
3709
|
+
spawnBlocking(
|
|
3710
|
+
image: string,
|
|
3711
|
+
options: FfiSpawnOptions | null
|
|
3712
|
+
): string {
|
|
3713
|
+
const result = rustCallWithError(
|
|
3714
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3715
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientSpawnBlocking(this.handle,
|
|
3716
|
+
lowerString(image),
|
|
3717
|
+
lowerIntoBuffer(options, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); writeFfiSpawnOptions(w, v) } }, false),
|
|
3718
|
+
cs
|
|
3719
|
+
)
|
|
3720
|
+
);
|
|
3721
|
+
return liftString(result);
|
|
3722
|
+
}
|
|
3723
|
+
async cancelMigration(
|
|
3724
|
+
migrationId: string
|
|
3725
|
+
): Promise<void> {
|
|
3726
|
+
return await uniffiRustCallAsync(
|
|
3727
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCancelMigration(this.handle,
|
|
3728
|
+
lowerString(migrationId),
|
|
3729
|
+
),
|
|
3730
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3731
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3732
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3733
|
+
(_: any) => {},
|
|
3734
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3735
|
+
);
|
|
3736
|
+
}
|
|
3737
|
+
async migrateVm(
|
|
3738
|
+
vmId: string,
|
|
3739
|
+
targetNodeId: string | null
|
|
3740
|
+
): Promise<string> {
|
|
3741
|
+
return await uniffiRustCallAsync(
|
|
3742
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientMigrateVm(this.handle,
|
|
3743
|
+
lowerString(vmId),
|
|
3744
|
+
lowerIntoBuffer(targetNodeId, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3745
|
+
),
|
|
3746
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3747
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3748
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3749
|
+
(result: any) => liftString(result),
|
|
3750
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3751
|
+
);
|
|
3752
|
+
}
|
|
3753
|
+
async vmMigration(
|
|
3754
|
+
vmId: string
|
|
3755
|
+
): Promise<FfiVmMigration> {
|
|
3756
|
+
return await uniffiRustCallAsync(
|
|
3757
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmMigration(this.handle,
|
|
3758
|
+
lowerString(vmId),
|
|
3759
|
+
),
|
|
3760
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3761
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3762
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3763
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVmMigration(r)),
|
|
3764
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3765
|
+
);
|
|
3766
|
+
}
|
|
3767
|
+
addMountTarget(
|
|
3768
|
+
name: string,
|
|
3769
|
+
computeId: string
|
|
3770
|
+
): void {
|
|
3771
|
+
rustCallWithError(
|
|
3772
|
+
(buf: any) => liftFfiMountErrorError(buf),
|
|
3773
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientAddMountTarget(this.handle,
|
|
3774
|
+
lowerString(name),
|
|
3775
|
+
lowerString(computeId),
|
|
3776
|
+
cs
|
|
3777
|
+
)
|
|
3778
|
+
);
|
|
3779
|
+
}
|
|
3780
|
+
listMountTargets(
|
|
3781
|
+
): FfiMountTarget[] {
|
|
3782
|
+
const result = rustCallWithError(
|
|
3783
|
+
(buf: any) => liftFfiMountErrorError(buf),
|
|
3784
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientListMountTargets(this.handle,
|
|
3785
|
+
cs
|
|
3786
|
+
)
|
|
3787
|
+
);
|
|
3788
|
+
return liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiMountTarget(r)));
|
|
3789
|
+
}
|
|
3790
|
+
mountStatus(
|
|
3791
|
+
): FfiMountStatus {
|
|
3792
|
+
const result = rustCallWithError(
|
|
3793
|
+
(buf: any) => liftFfiMountErrorError(buf),
|
|
3794
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientMountStatus(this.handle,
|
|
3795
|
+
cs
|
|
3796
|
+
)
|
|
3797
|
+
);
|
|
3798
|
+
return liftFromBuffer(result, (r) => readFfiMountStatus(r));
|
|
3799
|
+
}
|
|
3800
|
+
removeMountTarget(
|
|
3801
|
+
name: string
|
|
3802
|
+
): void {
|
|
3803
|
+
rustCallWithError(
|
|
3804
|
+
(buf: any) => liftFfiMountErrorError(buf),
|
|
3805
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientRemoveMountTarget(this.handle,
|
|
3806
|
+
lowerString(name),
|
|
3807
|
+
cs
|
|
3808
|
+
)
|
|
3809
|
+
);
|
|
3810
|
+
}
|
|
3811
|
+
async syncMountTarget(
|
|
3812
|
+
name: string
|
|
3813
|
+
): Promise<FfiSyncResult> {
|
|
3814
|
+
return await uniffiRustCallAsync(
|
|
3815
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientSyncMountTarget(this.handle,
|
|
3816
|
+
lowerString(name),
|
|
3817
|
+
),
|
|
3818
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3819
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3820
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3821
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiSyncResult(r)),
|
|
3822
|
+
(buf: any) => liftFfiMountErrorError(buf),
|
|
3823
|
+
);
|
|
3824
|
+
}
|
|
3825
|
+
async createPreview(
|
|
3826
|
+
input: FfiCreatePreviewInput
|
|
3827
|
+
): Promise<FfiPreviewDetail> {
|
|
3828
|
+
return await uniffiRustCallAsync(
|
|
3829
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreatePreview(this.handle,
|
|
3830
|
+
lowerIntoBuffer(input, (w, v) => writeFfiCreatePreviewInput(w, v), false),
|
|
3831
|
+
),
|
|
3832
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3833
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3834
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3835
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiPreviewDetail(r)),
|
|
3836
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3837
|
+
);
|
|
3838
|
+
}
|
|
3839
|
+
async listPreviews(
|
|
3840
|
+
): Promise<FfiPreview[]> {
|
|
3841
|
+
return await uniffiRustCallAsync(
|
|
3842
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListPreviews(this.handle,
|
|
3843
|
+
),
|
|
3844
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3845
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3846
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3847
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiPreview(r))),
|
|
3848
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3849
|
+
);
|
|
3850
|
+
}
|
|
3851
|
+
async previewStatus(
|
|
3852
|
+
previewId: string
|
|
3853
|
+
): Promise<FfiPreviewDetail> {
|
|
3854
|
+
return await uniffiRustCallAsync(
|
|
3855
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientPreviewStatus(this.handle,
|
|
3856
|
+
lowerString(previewId),
|
|
3857
|
+
),
|
|
3858
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3859
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3860
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3861
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiPreviewDetail(r)),
|
|
3862
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3863
|
+
);
|
|
3864
|
+
}
|
|
3865
|
+
async promotePreview(
|
|
3866
|
+
previewId: string
|
|
3867
|
+
): Promise<void> {
|
|
3868
|
+
return await uniffiRustCallAsync(
|
|
3869
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientPromotePreview(this.handle,
|
|
3870
|
+
lowerString(previewId),
|
|
3871
|
+
),
|
|
3872
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3873
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3874
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3875
|
+
(_: any) => {},
|
|
3876
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3877
|
+
);
|
|
3878
|
+
}
|
|
3879
|
+
async stopPreview(
|
|
3880
|
+
previewId: string
|
|
3881
|
+
): Promise<void> {
|
|
3882
|
+
return await uniffiRustCallAsync(
|
|
3883
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientStopPreview(this.handle,
|
|
3884
|
+
lowerString(previewId),
|
|
3885
|
+
),
|
|
3886
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3887
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3888
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3889
|
+
(_: any) => {},
|
|
3890
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3891
|
+
);
|
|
3892
|
+
}
|
|
3893
|
+
async listRegions(
|
|
3894
|
+
): Promise<FfiRegion[]> {
|
|
3895
|
+
return await uniffiRustCallAsync(
|
|
3896
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListRegions(this.handle,
|
|
3897
|
+
),
|
|
3898
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3899
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3900
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3901
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiRegion(r))),
|
|
3902
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3903
|
+
);
|
|
3904
|
+
}
|
|
3905
|
+
async checkpointVm(
|
|
3906
|
+
vmId: string
|
|
3907
|
+
): Promise<void> {
|
|
3908
|
+
return await uniffiRustCallAsync(
|
|
3909
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCheckpointVm(this.handle,
|
|
3910
|
+
lowerString(vmId),
|
|
3911
|
+
),
|
|
3912
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3913
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3914
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3915
|
+
(_: any) => {},
|
|
3916
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3917
|
+
);
|
|
3918
|
+
}
|
|
3919
|
+
async createVm(
|
|
3920
|
+
id: string | null,
|
|
3921
|
+
image: string,
|
|
3922
|
+
name: string | null,
|
|
3923
|
+
maxMemoryMib: bigint | null,
|
|
3924
|
+
maxCpuCores: bigint | null,
|
|
3925
|
+
enableIpv4: boolean | null,
|
|
3926
|
+
waitUntilReady: boolean | null,
|
|
3927
|
+
region: string | null
|
|
3928
|
+
): Promise<FfiCreateVmResult> {
|
|
3929
|
+
if (process.platform === 'linux') {
|
|
3930
|
+
return this.createVmBlocking(id, image, name, maxMemoryMib, maxCpuCores, enableIpv4, waitUntilReady, region);
|
|
3931
|
+
}
|
|
3932
|
+
return await uniffiRustCallAsync(
|
|
3933
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateVm(this.handle,
|
|
3934
|
+
lowerIntoBuffer(id, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3935
|
+
lowerString(image),
|
|
3936
|
+
lowerIntoBuffer(name, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3937
|
+
lowerIntoBuffer(maxMemoryMib, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeI64(v) } }, false),
|
|
3938
|
+
lowerIntoBuffer(maxCpuCores, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeI64(v) } }, false),
|
|
3939
|
+
lowerIntoBuffer(enableIpv4, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeBool(v) } }, false),
|
|
3940
|
+
lowerIntoBuffer(waitUntilReady, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeBool(v) } }, false),
|
|
3941
|
+
lowerIntoBuffer(region, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3942
|
+
),
|
|
3943
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
3944
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
3945
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
3946
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiCreateVmResult(r)),
|
|
3947
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3948
|
+
);
|
|
3949
|
+
}
|
|
3950
|
+
createVmBlocking(
|
|
3951
|
+
id: string | null,
|
|
3952
|
+
image: string,
|
|
3953
|
+
name: string | null,
|
|
3954
|
+
maxMemoryMib: bigint | null,
|
|
3955
|
+
maxCpuCores: bigint | null,
|
|
3956
|
+
enableIpv4: boolean | null,
|
|
3957
|
+
waitUntilReady: boolean | null,
|
|
3958
|
+
region: string | null
|
|
3959
|
+
): FfiCreateVmResult {
|
|
3960
|
+
const result = rustCallWithError(
|
|
3961
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3962
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientCreateVmBlocking(this.handle,
|
|
3963
|
+
lowerIntoBuffer(id, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3964
|
+
lowerString(image),
|
|
3965
|
+
lowerIntoBuffer(name, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3966
|
+
lowerIntoBuffer(maxMemoryMib, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeI64(v) } }, false),
|
|
3967
|
+
lowerIntoBuffer(maxCpuCores, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeI64(v) } }, false),
|
|
3968
|
+
lowerIntoBuffer(enableIpv4, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeBool(v) } }, false),
|
|
3969
|
+
lowerIntoBuffer(waitUntilReady, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeBool(v) } }, false),
|
|
3970
|
+
lowerIntoBuffer(region, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
3971
|
+
cs
|
|
3972
|
+
)
|
|
3973
|
+
);
|
|
3974
|
+
return liftFromBuffer(result, (r) => readFfiCreateVmResult(r));
|
|
3975
|
+
}
|
|
3976
|
+
async deleteVm(
|
|
3977
|
+
vmId: string
|
|
3978
|
+
): Promise<void> {
|
|
3979
|
+
if (process.platform === 'linux') {
|
|
3980
|
+
return this.deleteVmBlocking(vmId);
|
|
3981
|
+
}
|
|
3982
|
+
return await uniffiRustCallAsync(
|
|
3983
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientDeleteVm(this.handle,
|
|
3984
|
+
lowerString(vmId),
|
|
3985
|
+
),
|
|
3986
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
3987
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
3988
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
3989
|
+
(_: any) => {},
|
|
3990
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3991
|
+
);
|
|
3992
|
+
}
|
|
3993
|
+
deleteVmBlocking(
|
|
3994
|
+
vmId: string
|
|
3995
|
+
): void {
|
|
3996
|
+
rustCallWithError(
|
|
3997
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
3998
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientDeleteVmBlocking(this.handle,
|
|
3999
|
+
lowerString(vmId),
|
|
4000
|
+
cs
|
|
4001
|
+
)
|
|
4002
|
+
);
|
|
4003
|
+
}
|
|
4004
|
+
async deleteVmSecret(
|
|
4005
|
+
vmId: string,
|
|
4006
|
+
key: string
|
|
4007
|
+
): Promise<void> {
|
|
4008
|
+
return await uniffiRustCallAsync(
|
|
4009
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientDeleteVmSecret(this.handle,
|
|
4010
|
+
lowerString(vmId),
|
|
4011
|
+
lowerString(key),
|
|
4012
|
+
),
|
|
4013
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
4014
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
4015
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
4016
|
+
(_: any) => {},
|
|
4017
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4018
|
+
);
|
|
4019
|
+
}
|
|
4020
|
+
async execVm(
|
|
4021
|
+
vmId: string,
|
|
4022
|
+
command: string[],
|
|
4023
|
+
workingDir: string | null
|
|
4024
|
+
): Promise<FfiExecResult> {
|
|
4025
|
+
if (process.platform === 'linux') {
|
|
4026
|
+
return this.execVmBlocking(vmId, command, workingDir);
|
|
4027
|
+
}
|
|
4028
|
+
return await uniffiRustCallAsync(
|
|
4029
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientExecVm(this.handle,
|
|
4030
|
+
lowerString(vmId),
|
|
4031
|
+
lowerIntoBuffer(command, (w, v) => { w.writeI32(v.length); for (const item of v) { w.writeString(item) } }, false),
|
|
4032
|
+
lowerIntoBuffer(workingDir, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4033
|
+
),
|
|
4034
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4035
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4036
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4037
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiExecResult(r)),
|
|
4038
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4039
|
+
);
|
|
4040
|
+
}
|
|
4041
|
+
execVmBlocking(
|
|
4042
|
+
vmId: string,
|
|
4043
|
+
command: string[],
|
|
4044
|
+
workingDir: string | null
|
|
4045
|
+
): FfiExecResult {
|
|
4046
|
+
const result = rustCallWithError(
|
|
4047
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4048
|
+
(cs: any) => uniffiIxSdkFfiFnMethodIxsdkclientExecVmBlocking(this.handle,
|
|
4049
|
+
lowerString(vmId),
|
|
4050
|
+
lowerIntoBuffer(command, (w, v) => { w.writeI32(v.length); for (const item of v) { w.writeString(item) } }, false),
|
|
4051
|
+
lowerIntoBuffer(workingDir, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4052
|
+
cs
|
|
4053
|
+
)
|
|
4054
|
+
);
|
|
4055
|
+
return liftFromBuffer(result, (r) => readFfiExecResult(r));
|
|
4056
|
+
}
|
|
4057
|
+
async forkVm(
|
|
4058
|
+
vmId: string,
|
|
4059
|
+
name: string | null,
|
|
4060
|
+
waitUntilReady: boolean | null
|
|
4061
|
+
): Promise<FfiForkVmResult> {
|
|
4062
|
+
return await uniffiRustCallAsync(
|
|
4063
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientForkVm(this.handle,
|
|
4064
|
+
lowerString(vmId),
|
|
4065
|
+
lowerIntoBuffer(name, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4066
|
+
lowerIntoBuffer(waitUntilReady, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeBool(v) } }, false),
|
|
4067
|
+
),
|
|
4068
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4069
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4070
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4071
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiForkVmResult(r)),
|
|
4072
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4073
|
+
);
|
|
4074
|
+
}
|
|
4075
|
+
async forkVmAtTimestampMs(
|
|
4076
|
+
vmId: string,
|
|
4077
|
+
timestampMs: bigint,
|
|
4078
|
+
name: string | null,
|
|
4079
|
+
waitUntilReady: boolean | null
|
|
4080
|
+
): Promise<FfiForkVmResult> {
|
|
4081
|
+
return await uniffiRustCallAsync(
|
|
4082
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientForkVmAtTimestampMs(this.handle,
|
|
4083
|
+
lowerString(vmId),
|
|
4084
|
+
timestampMs,
|
|
4085
|
+
lowerIntoBuffer(name, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4086
|
+
lowerIntoBuffer(waitUntilReady, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeBool(v) } }, false),
|
|
4087
|
+
),
|
|
4088
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4089
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4090
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4091
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiForkVmResult(r)),
|
|
4092
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4093
|
+
);
|
|
4094
|
+
}
|
|
4095
|
+
async getVm(
|
|
4096
|
+
vmId: string
|
|
4097
|
+
): Promise<FfiVm> {
|
|
4098
|
+
return await uniffiRustCallAsync(
|
|
4099
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientGetVm(this.handle,
|
|
4100
|
+
lowerString(vmId),
|
|
4101
|
+
),
|
|
4102
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4103
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4104
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4105
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVm(r)),
|
|
4106
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4107
|
+
);
|
|
4108
|
+
}
|
|
4109
|
+
async getVmByName(
|
|
4110
|
+
name: string
|
|
4111
|
+
): Promise<FfiVm> {
|
|
4112
|
+
return await uniffiRustCallAsync(
|
|
4113
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientGetVmByName(this.handle,
|
|
4114
|
+
lowerString(name),
|
|
4115
|
+
),
|
|
4116
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4117
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4118
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4119
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVm(r)),
|
|
4120
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4121
|
+
);
|
|
4122
|
+
}
|
|
4123
|
+
async listVmSnapshotBranches(
|
|
4124
|
+
vmId: string
|
|
4125
|
+
): Promise<FfiVmSnapshotBranch[]> {
|
|
4126
|
+
return await uniffiRustCallAsync(
|
|
4127
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListVmSnapshotBranches(this.handle,
|
|
4128
|
+
lowerString(vmId),
|
|
4129
|
+
),
|
|
4130
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4131
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4132
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4133
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVmSnapshotBranch(r))),
|
|
4134
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4135
|
+
);
|
|
4136
|
+
}
|
|
4137
|
+
async listVmSnapshots(
|
|
4138
|
+
vmId: string
|
|
4139
|
+
): Promise<FfiVmSnapshot[]> {
|
|
4140
|
+
return await uniffiRustCallAsync(
|
|
4141
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListVmSnapshots(this.handle,
|
|
4142
|
+
lowerString(vmId),
|
|
4143
|
+
),
|
|
4144
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4145
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4146
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4147
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVmSnapshot(r))),
|
|
4148
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4149
|
+
);
|
|
4150
|
+
}
|
|
4151
|
+
async listVms(
|
|
4152
|
+
status: FfiVmStatus | null
|
|
4153
|
+
): Promise<FfiVm[]> {
|
|
4154
|
+
return await uniffiRustCallAsync(
|
|
4155
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListVms(this.handle,
|
|
4156
|
+
lowerIntoBuffer(status, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); writeFfiVmStatus(w, v) } }, false),
|
|
4157
|
+
),
|
|
4158
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4159
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4160
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4161
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVm(r))),
|
|
4162
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4163
|
+
);
|
|
4164
|
+
}
|
|
4165
|
+
async mergeVm(
|
|
4166
|
+
targetVmId: string,
|
|
4167
|
+
sourceVmId: string,
|
|
4168
|
+
resolutionStrategy: string | null
|
|
4169
|
+
): Promise<FfiMergeVmResult> {
|
|
4170
|
+
return await uniffiRustCallAsync(
|
|
4171
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientMergeVm(this.handle,
|
|
4172
|
+
lowerString(targetVmId),
|
|
4173
|
+
lowerString(sourceVmId),
|
|
4174
|
+
lowerIntoBuffer(resolutionStrategy, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4175
|
+
),
|
|
4176
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4177
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4178
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4179
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiMergeVmResult(r)),
|
|
4180
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4181
|
+
);
|
|
4182
|
+
}
|
|
4183
|
+
async previewMergeVm(
|
|
4184
|
+
targetVmId: string,
|
|
4185
|
+
sourceVmId: string
|
|
4186
|
+
): Promise<FfiMergePreview> {
|
|
4187
|
+
return await uniffiRustCallAsync(
|
|
4188
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientPreviewMergeVm(this.handle,
|
|
4189
|
+
lowerString(targetVmId),
|
|
4190
|
+
lowerString(sourceVmId),
|
|
4191
|
+
),
|
|
4192
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4193
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4194
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4195
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiMergePreview(r)),
|
|
4196
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4197
|
+
);
|
|
4198
|
+
}
|
|
4199
|
+
async redoVm(
|
|
4200
|
+
vmId: string
|
|
4201
|
+
): Promise<FfiUndoRedoResult> {
|
|
4202
|
+
return await uniffiRustCallAsync(
|
|
4203
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientRedoVm(this.handle,
|
|
4204
|
+
lowerString(vmId),
|
|
4205
|
+
),
|
|
4206
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4207
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4208
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4209
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiUndoRedoResult(r)),
|
|
4210
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4211
|
+
);
|
|
4212
|
+
}
|
|
4213
|
+
async restartVm(
|
|
4214
|
+
vmId: string
|
|
4215
|
+
): Promise<void> {
|
|
4216
|
+
return await uniffiRustCallAsync(
|
|
4217
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientRestartVm(this.handle,
|
|
4218
|
+
lowerString(vmId),
|
|
4219
|
+
),
|
|
4220
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
4221
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
4222
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
4223
|
+
(_: any) => {},
|
|
4224
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4225
|
+
);
|
|
4226
|
+
}
|
|
4227
|
+
async revertVm(
|
|
4228
|
+
vmId: string,
|
|
4229
|
+
timestampNs: string
|
|
4230
|
+
): Promise<FfiRevertVmResult> {
|
|
4231
|
+
return await uniffiRustCallAsync(
|
|
4232
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientRevertVm(this.handle,
|
|
4233
|
+
lowerString(vmId),
|
|
4234
|
+
lowerString(timestampNs),
|
|
4235
|
+
),
|
|
4236
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4237
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4238
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4239
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiRevertVmResult(r)),
|
|
4240
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4241
|
+
);
|
|
4242
|
+
}
|
|
4243
|
+
async revertVmToTimestampMs(
|
|
4244
|
+
vmId: string,
|
|
4245
|
+
timestampMs: bigint
|
|
4246
|
+
): Promise<FfiRevertVmResult> {
|
|
4247
|
+
return await uniffiRustCallAsync(
|
|
4248
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientRevertVmToTimestampMs(this.handle,
|
|
4249
|
+
lowerString(vmId),
|
|
4250
|
+
timestampMs,
|
|
4251
|
+
),
|
|
4252
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4253
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4254
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4255
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiRevertVmResult(r)),
|
|
4256
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4257
|
+
);
|
|
4258
|
+
}
|
|
4259
|
+
async setVmSecret(
|
|
4260
|
+
vmId: string,
|
|
4261
|
+
key: string,
|
|
4262
|
+
value: string
|
|
4263
|
+
): Promise<void> {
|
|
4264
|
+
return await uniffiRustCallAsync(
|
|
4265
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientSetVmSecret(this.handle,
|
|
4266
|
+
lowerString(vmId),
|
|
4267
|
+
lowerString(key),
|
|
4268
|
+
lowerString(value),
|
|
4269
|
+
),
|
|
4270
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
4271
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
4272
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
4273
|
+
(_: any) => {},
|
|
4274
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4275
|
+
);
|
|
4276
|
+
}
|
|
4277
|
+
async startVm(
|
|
4278
|
+
vmId: string
|
|
4279
|
+
): Promise<void> {
|
|
4280
|
+
return await uniffiRustCallAsync(
|
|
4281
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientStartVm(this.handle,
|
|
4282
|
+
lowerString(vmId),
|
|
4283
|
+
),
|
|
4284
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
4285
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
4286
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
4287
|
+
(_: any) => {},
|
|
4288
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4289
|
+
);
|
|
4290
|
+
}
|
|
4291
|
+
async stopVm(
|
|
4292
|
+
vmId: string
|
|
4293
|
+
): Promise<void> {
|
|
4294
|
+
return await uniffiRustCallAsync(
|
|
4295
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientStopVm(this.handle,
|
|
4296
|
+
lowerString(vmId),
|
|
4297
|
+
),
|
|
4298
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
4299
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
4300
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
4301
|
+
(_: any) => {},
|
|
4302
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4303
|
+
);
|
|
4304
|
+
}
|
|
4305
|
+
async undoVm(
|
|
4306
|
+
vmId: string
|
|
4307
|
+
): Promise<FfiUndoRedoResult> {
|
|
4308
|
+
return await uniffiRustCallAsync(
|
|
4309
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientUndoVm(this.handle,
|
|
4310
|
+
lowerString(vmId),
|
|
4311
|
+
),
|
|
4312
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4313
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4314
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4315
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiUndoRedoResult(r)),
|
|
4316
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4317
|
+
);
|
|
4318
|
+
}
|
|
4319
|
+
async vmAttachInfo(
|
|
4320
|
+
vmId: string
|
|
4321
|
+
): Promise<FfiVmAttachInfo> {
|
|
4322
|
+
return await uniffiRustCallAsync(
|
|
4323
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmAttachInfo(this.handle,
|
|
4324
|
+
lowerString(vmId),
|
|
4325
|
+
),
|
|
4326
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4327
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4328
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4329
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVmAttachInfo(r)),
|
|
4330
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4331
|
+
);
|
|
4332
|
+
}
|
|
4333
|
+
async vmFsList(
|
|
4334
|
+
vmId: string,
|
|
4335
|
+
path: string
|
|
4336
|
+
): Promise<FfiFsEntry[]> {
|
|
4337
|
+
return await uniffiRustCallAsync(
|
|
4338
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmFsList(this.handle,
|
|
4339
|
+
lowerString(vmId),
|
|
4340
|
+
lowerString(path),
|
|
4341
|
+
),
|
|
4342
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4343
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4344
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4345
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiFsEntry(r))),
|
|
4346
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4347
|
+
);
|
|
4348
|
+
}
|
|
4349
|
+
async vmFsListAtTimestampMs(
|
|
4350
|
+
vmId: string,
|
|
4351
|
+
path: string,
|
|
4352
|
+
timestampMs: bigint
|
|
4353
|
+
): Promise<FfiFsEntry[]> {
|
|
4354
|
+
return await uniffiRustCallAsync(
|
|
4355
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmFsListAtTimestampMs(this.handle,
|
|
4356
|
+
lowerString(vmId),
|
|
4357
|
+
lowerString(path),
|
|
4358
|
+
timestampMs,
|
|
4359
|
+
),
|
|
4360
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4361
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4362
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4363
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiFsEntry(r))),
|
|
4364
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4365
|
+
);
|
|
4366
|
+
}
|
|
4367
|
+
async vmFsRead(
|
|
4368
|
+
vmId: string,
|
|
4369
|
+
path: string
|
|
4370
|
+
): Promise<FfiFsReadResult> {
|
|
4371
|
+
return await uniffiRustCallAsync(
|
|
4372
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmFsRead(this.handle,
|
|
4373
|
+
lowerString(vmId),
|
|
4374
|
+
lowerString(path),
|
|
4375
|
+
),
|
|
4376
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4377
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4378
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4379
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiFsReadResult(r)),
|
|
4380
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4381
|
+
);
|
|
4382
|
+
}
|
|
4383
|
+
async vmFsReadAtTimestampMs(
|
|
4384
|
+
vmId: string,
|
|
4385
|
+
path: string,
|
|
4386
|
+
timestampMs: bigint
|
|
4387
|
+
): Promise<FfiFsReadResult> {
|
|
4388
|
+
return await uniffiRustCallAsync(
|
|
4389
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmFsReadAtTimestampMs(this.handle,
|
|
4390
|
+
lowerString(vmId),
|
|
4391
|
+
lowerString(path),
|
|
4392
|
+
timestampMs,
|
|
4393
|
+
),
|
|
4394
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4395
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4396
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4397
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiFsReadResult(r)),
|
|
4398
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4399
|
+
);
|
|
4400
|
+
}
|
|
4401
|
+
async vmFsWrite(
|
|
4402
|
+
vmId: string,
|
|
4403
|
+
path: string,
|
|
4404
|
+
text: string,
|
|
4405
|
+
mode: bigint | null
|
|
4406
|
+
): Promise<FfiFsWriteResult> {
|
|
4407
|
+
return await uniffiRustCallAsync(
|
|
4408
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmFsWrite(this.handle,
|
|
4409
|
+
lowerString(vmId),
|
|
4410
|
+
lowerString(path),
|
|
4411
|
+
lowerString(text),
|
|
4412
|
+
lowerIntoBuffer(mode, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeI64(v) } }, false),
|
|
4413
|
+
),
|
|
4414
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4415
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4416
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4417
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiFsWriteResult(r)),
|
|
4418
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4419
|
+
);
|
|
4420
|
+
}
|
|
4421
|
+
async vmLogs(
|
|
4422
|
+
vmId: string,
|
|
4423
|
+
limit: bigint,
|
|
4424
|
+
since: string | null,
|
|
4425
|
+
stream: string | null
|
|
4426
|
+
): Promise<FfiVmLogEntry[]> {
|
|
4427
|
+
return await uniffiRustCallAsync(
|
|
4428
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmLogs(this.handle,
|
|
4429
|
+
lowerString(vmId),
|
|
4430
|
+
limit,
|
|
4431
|
+
lowerIntoBuffer(since, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4432
|
+
lowerIntoBuffer(stream, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4433
|
+
),
|
|
4434
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4435
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4436
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4437
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVmLogEntry(r))),
|
|
4438
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4439
|
+
);
|
|
4440
|
+
}
|
|
4441
|
+
async vmMetrics(
|
|
4442
|
+
vmId: string
|
|
4443
|
+
): Promise<FfiVmMetrics> {
|
|
4444
|
+
return await uniffiRustCallAsync(
|
|
4445
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmMetrics(this.handle,
|
|
4446
|
+
lowerString(vmId),
|
|
4447
|
+
),
|
|
4448
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4449
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4450
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4451
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVmMetrics(r)),
|
|
4452
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4453
|
+
);
|
|
4454
|
+
}
|
|
4455
|
+
async vmSecrets(
|
|
4456
|
+
vmId: string
|
|
4457
|
+
): Promise<FfiVmSecret[]> {
|
|
4458
|
+
return await uniffiRustCallAsync(
|
|
4459
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVmSecrets(this.handle,
|
|
4460
|
+
lowerString(vmId),
|
|
4461
|
+
),
|
|
4462
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4463
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4464
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4465
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVmSecret(r))),
|
|
4466
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4467
|
+
);
|
|
4468
|
+
}
|
|
4469
|
+
async createSnapshot(
|
|
4470
|
+
volumeId: string,
|
|
4471
|
+
description: string | null
|
|
4472
|
+
): Promise<FfiVolumeSnapshot> {
|
|
4473
|
+
return await uniffiRustCallAsync(
|
|
4474
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateSnapshot(this.handle,
|
|
4475
|
+
lowerString(volumeId),
|
|
4476
|
+
lowerIntoBuffer(description, (w, v) => { if (v === null) { w.writeU8(0); } else { w.writeU8(1); w.writeString(v) } }, false),
|
|
4477
|
+
),
|
|
4478
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4479
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4480
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4481
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVolumeSnapshot(r)),
|
|
4482
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4483
|
+
);
|
|
4484
|
+
}
|
|
4485
|
+
async createVolume(
|
|
4486
|
+
input: FfiCreateVolumeInput
|
|
4487
|
+
): Promise<FfiVolume> {
|
|
4488
|
+
return await uniffiRustCallAsync(
|
|
4489
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientCreateVolume(this.handle,
|
|
4490
|
+
lowerIntoBuffer(input, (w, v) => writeFfiCreateVolumeInput(w, v), false),
|
|
4491
|
+
),
|
|
4492
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4493
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4494
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4495
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVolume(r)),
|
|
4496
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4497
|
+
);
|
|
4498
|
+
}
|
|
4499
|
+
async deleteVolume(
|
|
4500
|
+
volumeId: string
|
|
4501
|
+
): Promise<void> {
|
|
4502
|
+
return await uniffiRustCallAsync(
|
|
4503
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientDeleteVolume(this.handle,
|
|
4504
|
+
lowerString(volumeId),
|
|
4505
|
+
),
|
|
4506
|
+
ffiIxSdkFfiRustFuturePollVoid,
|
|
4507
|
+
ffiIxSdkFfiRustFutureCompleteVoid,
|
|
4508
|
+
ffiIxSdkFfiRustFutureFreeVoid,
|
|
4509
|
+
(_: any) => {},
|
|
4510
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4511
|
+
);
|
|
4512
|
+
}
|
|
4513
|
+
async forkVolume(
|
|
4514
|
+
volumeId: string,
|
|
4515
|
+
input: FfiForkVolumeInput
|
|
4516
|
+
): Promise<FfiVolume> {
|
|
4517
|
+
return await uniffiRustCallAsync(
|
|
4518
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientForkVolume(this.handle,
|
|
4519
|
+
lowerString(volumeId),
|
|
4520
|
+
lowerIntoBuffer(input, (w, v) => writeFfiForkVolumeInput(w, v), false),
|
|
4521
|
+
),
|
|
4522
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4523
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4524
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4525
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVolume(r)),
|
|
4526
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4527
|
+
);
|
|
4528
|
+
}
|
|
4529
|
+
async listVolumes(
|
|
4530
|
+
): Promise<FfiVolume[]> {
|
|
4531
|
+
return await uniffiRustCallAsync(
|
|
4532
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientListVolumes(this.handle,
|
|
4533
|
+
),
|
|
4534
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4535
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4536
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4537
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVolume(r))),
|
|
4538
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4539
|
+
);
|
|
4540
|
+
}
|
|
4541
|
+
async restoreToSnapshot(
|
|
4542
|
+
snapshotId: string
|
|
4543
|
+
): Promise<FfiVolume> {
|
|
4544
|
+
return await uniffiRustCallAsync(
|
|
4545
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientRestoreToSnapshot(this.handle,
|
|
4546
|
+
lowerString(snapshotId),
|
|
4547
|
+
),
|
|
4548
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4549
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4550
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4551
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVolume(r)),
|
|
4552
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4553
|
+
);
|
|
4554
|
+
}
|
|
4555
|
+
async volumeById(
|
|
4556
|
+
id: string
|
|
4557
|
+
): Promise<FfiVolume> {
|
|
4558
|
+
return await uniffiRustCallAsync(
|
|
4559
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVolumeById(this.handle,
|
|
4560
|
+
lowerString(id),
|
|
4561
|
+
),
|
|
4562
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4563
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4564
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4565
|
+
(result: any) => liftFromBuffer(result, (r) => readFfiVolume(r)),
|
|
4566
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4567
|
+
);
|
|
4568
|
+
}
|
|
4569
|
+
async volumeSnapshots(
|
|
4570
|
+
volumeId: string
|
|
4571
|
+
): Promise<FfiVolumeSnapshot[]> {
|
|
4572
|
+
return await uniffiRustCallAsync(
|
|
4573
|
+
() => uniffiIxSdkFfiFnMethodIxsdkclientVolumeSnapshots(this.handle,
|
|
4574
|
+
lowerString(volumeId),
|
|
4575
|
+
),
|
|
4576
|
+
ffiIxSdkFfiRustFuturePollRustBuffer,
|
|
4577
|
+
ffiIxSdkFfiRustFutureCompleteRustBuffer,
|
|
4578
|
+
ffiIxSdkFfiRustFutureFreeRustBuffer,
|
|
4579
|
+
(result: any) => liftFromBuffer(result, (r) => readSequence(r, (r) => readFfiVolumeSnapshot(r))),
|
|
4580
|
+
(buf: any) => liftFfiSdkErrorError(buf),
|
|
4581
|
+
);
|
|
4582
|
+
}
|
|
4583
|
+
}
|
|
4584
|
+
|
|
4585
|
+
function readTypeIxSdkClient(reader: BufReader): IxSdkClient {
|
|
4586
|
+
const handle = reader.readU64();
|
|
4587
|
+
return new IxSdkClient(handle);
|
|
4588
|
+
}
|
|
4589
|
+
|
|
4590
|
+
function writeTypeIxSdkClient(writer: BufWriter, value: IxSdkClient): void {
|
|
4591
|
+
writer.writeU64(value[uniffiCloneHandle]());
|
|
4592
|
+
}
|
|
4593
|
+
|
|
4594
|
+
// ---- Top-level functions ----
|
|
4595
|
+
|
|
4596
|
+
// ---- Contract version check ----
|
|
4597
|
+
|
|
4598
|
+
const bindingsContractVersion = 30;
|
|
4599
|
+
const scaffoldingContractVersion = rustCall((cs: any) => ffiIxSdkFfiUniffiContractVersion(cs));
|
|
4600
|
+
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
4601
|
+
throw new UniffiError(
|
|
4602
|
+
`UniFFI contract version mismatch: bindings=${bindingsContractVersion}, scaffolding=${scaffoldingContractVersion}`
|
|
4603
|
+
);
|
|
4604
|
+
}
|