@phala/cloud 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/apps/check_app_cvms_is_allowed.d.ts +324 -75
- package/dist/actions/apps/check_app_is_allowed.d.ts +16 -16
- package/dist/actions/apps/create_app_instance.d.ts +33 -24
- package/dist/actions/apps/get_app_attestation.d.ts +82 -32
- package/dist/actions/apps/get_app_device_allowlist.d.ts +281 -11
- package/dist/actions/apps/get_app_filter_options.d.ts +2 -2
- package/dist/actions/apps/get_app_list.d.ts +2 -2
- package/dist/actions/cvms/check_cvm_is_allowed.d.ts +142 -74
- package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +12 -12
- package/dist/actions/cvms/commit_cvm_provision.d.ts +424 -277
- package/dist/actions/cvms/commit_cvm_update.d.ts +2 -2
- package/dist/actions/cvms/confirm_cvm_patch.d.ts +2 -2
- package/dist/actions/cvms/delete_cvm.d.ts +2 -2
- package/dist/actions/cvms/get_available_os_images.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_attestation.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_compose_file.d.ts +338 -10
- package/dist/actions/cvms/get_cvm_containers_stats.d.ts +10 -10
- package/dist/actions/cvms/get_cvm_docker_compose.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_info.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_list.d.ts +4 -4
- package/dist/actions/cvms/get_cvm_network.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_state.d.ts +6 -6
- package/dist/actions/cvms/get_cvm_stats.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_status_batch.d.ts +6 -6
- package/dist/actions/cvms/get_cvm_user_config.d.ts +2 -2
- package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +93 -0
- package/dist/actions/cvms/patch_cvm.d.ts +18 -18
- package/dist/actions/cvms/provision_cvm.d.ts +243 -225
- package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +254 -38
- package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +130 -43
- package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +294 -110
- package/dist/actions/cvms/replicate_cvm.d.ts +7 -72
- package/dist/actions/cvms/restart_cvm.d.ts +7 -72
- package/dist/actions/cvms/shutdown_cvm.d.ts +9 -72
- package/dist/actions/cvms/start_cvm.d.ts +7 -72
- package/dist/actions/cvms/stop_cvm.d.ts +7 -72
- package/dist/actions/cvms/update_cvm_envs.d.ts +20 -20
- package/dist/actions/cvms/update_cvm_resources.d.ts +2 -2
- package/dist/actions/cvms/update_cvm_visibility.d.ts +26 -26
- package/dist/actions/cvms/update_docker_compose.d.ts +20 -20
- package/dist/actions/cvms/update_os_image.d.ts +2 -2
- package/dist/actions/cvms/update_prelaunch_script.d.ts +20 -20
- package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +319 -0
- package/dist/actions/get_cvm_create_resources.d.ts +2412 -0
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/kms/get_kms_list.d.ts +10 -10
- package/dist/actions/kms/next_app_ids.d.ts +6 -6
- package/dist/actions/list-instance-types.d.ts +12 -12
- package/dist/actions/ssh_keys/create_ssh_key.d.ts +2 -2
- package/dist/actions/ssh_keys/list_ssh_keys.d.ts +4 -4
- package/dist/actions/workspaces/get_workspace.d.ts +2 -0
- package/dist/actions/workspaces/get_workspace_nodes.d.ts +14 -14
- package/dist/actions/workspaces/list_workspaces.d.ts +18 -0
- package/dist/client.d.ts +5 -2
- package/dist/create-client.d.ts +48 -0
- package/dist/index.js +1882 -1257
- package/dist/index.mjs +1850 -1255
- package/dist/types/app_compose.d.ts +125 -0
- package/dist/types/app_info_v20251028.d.ts +136 -259
- package/dist/types/app_info_v20260121.d.ts +4677 -345
- package/dist/types/app_revision.d.ts +8 -8
- package/dist/types/client.d.ts +2 -2
- package/dist/types/cvm_id.d.ts +6 -6
- package/dist/types/cvm_info.d.ts +536 -10
- package/dist/types/cvm_info_v20251028.d.ts +65 -65
- package/dist/types/cvm_info_v20260121.d.ts +1636 -85
- package/dist/types/version-mappings.d.ts +45 -8
- package/dist/utils/errors.d.ts +8 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -23,6 +23,16 @@ var ApiErrorSchema = z.object({
|
|
|
23
23
|
type: z.string().optional(),
|
|
24
24
|
code: z.string().optional()
|
|
25
25
|
});
|
|
26
|
+
function extractRequestId(data) {
|
|
27
|
+
if (!data || typeof data !== "object") {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
const requestId = data.request_id;
|
|
31
|
+
return typeof requestId === "string" ? requestId : void 0;
|
|
32
|
+
}
|
|
33
|
+
function extractRequestIdFromResponse(response) {
|
|
34
|
+
return response?.headers?.get("X-Request-ID") ?? void 0;
|
|
35
|
+
}
|
|
26
36
|
var PhalaCloudError = class extends Error {
|
|
27
37
|
constructor(message, data) {
|
|
28
38
|
super(message);
|
|
@@ -30,6 +40,8 @@ var PhalaCloudError = class extends Error {
|
|
|
30
40
|
this.status = data.status;
|
|
31
41
|
this.statusText = data.statusText;
|
|
32
42
|
this.detail = data.detail;
|
|
43
|
+
this.requestId = data.requestId;
|
|
44
|
+
this.code = data.code;
|
|
33
45
|
if (Error.captureStackTrace) {
|
|
34
46
|
Error.captureStackTrace(this, this.constructor);
|
|
35
47
|
}
|
|
@@ -40,20 +52,24 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
40
52
|
super(message, {
|
|
41
53
|
status: options?.status ?? 0,
|
|
42
54
|
statusText: options?.statusText ?? "Unknown Error",
|
|
43
|
-
detail: options?.detail || message
|
|
55
|
+
detail: options?.detail || message,
|
|
56
|
+
requestId: options?.requestId,
|
|
57
|
+
code: options?.code
|
|
44
58
|
});
|
|
45
59
|
this.name = "RequestError";
|
|
46
60
|
this.isRequestError = true;
|
|
47
61
|
this.data = options?.data;
|
|
48
62
|
this.request = options?.request;
|
|
49
63
|
this.response = options?.response;
|
|
50
|
-
this.code = options?.code;
|
|
51
64
|
this.type = options?.type;
|
|
52
65
|
}
|
|
53
66
|
/**
|
|
54
67
|
* Create RequestError from FetchError
|
|
55
68
|
*/
|
|
56
69
|
static fromFetchError(error) {
|
|
70
|
+
const bodyRequestId = extractRequestId(error.data);
|
|
71
|
+
const headerRequestId = extractRequestIdFromResponse(error.response);
|
|
72
|
+
const requestId = bodyRequestId ?? headerRequestId;
|
|
57
73
|
const parseResult = ApiErrorSchema.safeParse(error.data);
|
|
58
74
|
if (parseResult.success) {
|
|
59
75
|
const detail = parseResult.data.detail ?? (error.data && typeof error.data === "object" && "error_code" in error.data ? error.data : void 0);
|
|
@@ -65,7 +81,22 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
65
81
|
response: error.response ?? void 0,
|
|
66
82
|
detail,
|
|
67
83
|
code: parseResult.data.code ?? void 0,
|
|
68
|
-
type: parseResult.data.type ?? void 0
|
|
84
|
+
type: parseResult.data.type ?? void 0,
|
|
85
|
+
requestId
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const cause = error.cause;
|
|
89
|
+
if (cause?.name === "TimeoutError" || error.message?.includes("[TimeoutError]")) {
|
|
90
|
+
const message = "Request timed out. The server did not respond in time.";
|
|
91
|
+
return new _RequestError(message, {
|
|
92
|
+
status: 0,
|
|
93
|
+
statusText: "Request Timeout",
|
|
94
|
+
data: error.data,
|
|
95
|
+
request: error.request ?? void 0,
|
|
96
|
+
response: error.response ?? void 0,
|
|
97
|
+
detail: message,
|
|
98
|
+
code: "TIMEOUT",
|
|
99
|
+
requestId
|
|
69
100
|
});
|
|
70
101
|
}
|
|
71
102
|
return new _RequestError(error.message, {
|
|
@@ -74,8 +105,9 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
74
105
|
data: error.data,
|
|
75
106
|
request: error.request ?? void 0,
|
|
76
107
|
response: error.response ?? void 0,
|
|
77
|
-
detail: error.data?.detail || "Unknown API error",
|
|
78
|
-
code: error.status?.toString() ?? void 0
|
|
108
|
+
detail: error.data?.detail || error.message || "Unknown API error",
|
|
109
|
+
code: error.status?.toString() ?? void 0,
|
|
110
|
+
requestId
|
|
79
111
|
});
|
|
80
112
|
}
|
|
81
113
|
/**
|
|
@@ -201,6 +233,7 @@ function parseApiError(requestError) {
|
|
|
201
233
|
status,
|
|
202
234
|
statusText,
|
|
203
235
|
detail,
|
|
236
|
+
requestId: structured.request_id ?? requestError.requestId,
|
|
204
237
|
errorCode: structured.error_code,
|
|
205
238
|
structuredDetails: structured.details,
|
|
206
239
|
suggestions: structured.suggestions,
|
|
@@ -209,7 +242,13 @@ function parseApiError(requestError) {
|
|
|
209
242
|
}
|
|
210
243
|
const errorType = categorizeErrorType(status);
|
|
211
244
|
const message = extractPrimaryMessage(status, detail, requestError.message);
|
|
212
|
-
const commonData = {
|
|
245
|
+
const commonData = {
|
|
246
|
+
status,
|
|
247
|
+
statusText,
|
|
248
|
+
detail,
|
|
249
|
+
requestId: requestError.requestId,
|
|
250
|
+
code: requestError.code
|
|
251
|
+
};
|
|
213
252
|
if (errorType === "validation" && Array.isArray(detail)) {
|
|
214
253
|
const { errors } = parseValidationErrors(detail);
|
|
215
254
|
return new ValidationError(message, {
|
|
@@ -290,6 +329,7 @@ function parseStructuredError(detail) {
|
|
|
290
329
|
return {
|
|
291
330
|
error_code: obj.error_code,
|
|
292
331
|
message: obj.message,
|
|
332
|
+
request_id: typeof obj.request_id === "string" ? obj.request_id : void 0,
|
|
293
333
|
details: obj.details,
|
|
294
334
|
suggestions: obj.suggestions,
|
|
295
335
|
links: obj.links
|
|
@@ -305,6 +345,9 @@ function formatStructuredError(error, options) {
|
|
|
305
345
|
} else {
|
|
306
346
|
parts.push(error.message);
|
|
307
347
|
}
|
|
348
|
+
if (error.requestId) {
|
|
349
|
+
parts.push(`Request ID: ${error.requestId}`);
|
|
350
|
+
}
|
|
308
351
|
if (error.structuredDetails && error.structuredDetails.length > 0) {
|
|
309
352
|
parts.push("");
|
|
310
353
|
parts.push("Details:");
|
|
@@ -342,9 +385,10 @@ function isAppIdConflictError(error) {
|
|
|
342
385
|
// src/client.ts
|
|
343
386
|
var SUPPORTED_API_VERSIONS = [
|
|
344
387
|
"2025-10-28",
|
|
345
|
-
"2026-01-21"
|
|
388
|
+
"2026-01-21",
|
|
389
|
+
"2026-05-22"
|
|
346
390
|
];
|
|
347
|
-
var DEFAULT_API_VERSION = "2026-
|
|
391
|
+
var DEFAULT_API_VERSION = "2026-05-22";
|
|
348
392
|
var logger = debug("phala::api-client");
|
|
349
393
|
function formatHeaders(headers) {
|
|
350
394
|
return Object.entries(headers).map(([key, value]) => ` -H "${key}: ${value}"`).join("\n");
|
|
@@ -397,7 +441,7 @@ var Client = class _Client {
|
|
|
397
441
|
}
|
|
398
442
|
this.fetchInstance = ofetch.create({
|
|
399
443
|
baseURL,
|
|
400
|
-
timeout: timeout ||
|
|
444
|
+
timeout: timeout || 6e4,
|
|
401
445
|
headers: requestHeaders,
|
|
402
446
|
...useCookieAuth ? { credentials: "include" } : {},
|
|
403
447
|
...fetchOptions,
|
|
@@ -702,7 +746,7 @@ var Client = class _Client {
|
|
|
702
746
|
*
|
|
703
747
|
* @example
|
|
704
748
|
* ```typescript
|
|
705
|
-
* const client = createClient(); // defaults to 2026-
|
|
749
|
+
* const client = createClient(); // defaults to 2026-05-22
|
|
706
750
|
* const legacyClient = client.withVersion("2025-10-28");
|
|
707
751
|
* const data = await getCvmInfo(legacyClient, { id: "xxx" });
|
|
708
752
|
* ```
|
|
@@ -1040,34 +1084,135 @@ var { action: getAvailableNodes, safeAction: safeGetAvailableNodes } = defineSim
|
|
|
1040
1084
|
}
|
|
1041
1085
|
);
|
|
1042
1086
|
|
|
1043
|
-
// src/actions/
|
|
1087
|
+
// src/actions/get_cvm_create_resources.ts
|
|
1044
1088
|
import { z as z6 } from "zod";
|
|
1045
|
-
var
|
|
1089
|
+
var ResourceIdV20260121Schema = z6.union([z6.number(), z6.string()]);
|
|
1090
|
+
var HashIdSchema = z6.string();
|
|
1091
|
+
var GpuAvailabilitySchema = z6.object({
|
|
1092
|
+
has_reserved_gpus: z6.boolean(),
|
|
1093
|
+
reserved_gpu_count: z6.number(),
|
|
1094
|
+
has_public_gpus: z6.boolean(),
|
|
1095
|
+
public_gpu_count: z6.number()
|
|
1096
|
+
}).passthrough();
|
|
1097
|
+
var CvmCreateKmsResourceV20260121Schema = z6.object({
|
|
1098
|
+
id: ResourceIdV20260121Schema,
|
|
1099
|
+
slug: z6.string().nullable().optional(),
|
|
1100
|
+
url: z6.string(),
|
|
1101
|
+
version: z6.string().nullable().optional(),
|
|
1102
|
+
kms_type: z6.string(),
|
|
1103
|
+
chain_id: z6.number().nullable().optional(),
|
|
1104
|
+
kms_contract_id: ResourceIdV20260121Schema.nullable().optional(),
|
|
1105
|
+
kms_contract_address: z6.string().nullable().optional(),
|
|
1106
|
+
gateway_app_id: z6.string().nullable().optional(),
|
|
1107
|
+
supported_os_images: z6.array(z6.string()).default([])
|
|
1108
|
+
}).passthrough();
|
|
1109
|
+
var CvmCreateNodeKmsRelationV20260121Schema = z6.object({
|
|
1110
|
+
teepod_id: z6.number(),
|
|
1111
|
+
kms_id: ResourceIdV20260121Schema,
|
|
1112
|
+
kms_type: z6.string(),
|
|
1113
|
+
kms_contract_id: ResourceIdV20260121Schema.nullable().optional(),
|
|
1114
|
+
kms_contract_address: z6.string().nullable().optional(),
|
|
1115
|
+
supported_os_images: z6.array(z6.string()).default([])
|
|
1116
|
+
}).passthrough();
|
|
1117
|
+
var CvmCreateGatewayResourceV20260121Schema = z6.object({
|
|
1118
|
+
id: ResourceIdV20260121Schema,
|
|
1119
|
+
teepod_id: z6.number().nullable().optional(),
|
|
1120
|
+
kms_contract_id: ResourceIdV20260121Schema,
|
|
1121
|
+
rpc_url: z6.string().nullable().optional(),
|
|
1122
|
+
domain_suffix: z6.string().nullable().optional(),
|
|
1123
|
+
enabled: z6.boolean()
|
|
1124
|
+
}).passthrough();
|
|
1125
|
+
var CvmCreateKmsResourceSchema = CvmCreateKmsResourceV20260121Schema.extend({
|
|
1126
|
+
id: HashIdSchema,
|
|
1127
|
+
kms_contract_id: HashIdSchema.nullable().optional()
|
|
1128
|
+
});
|
|
1129
|
+
var CvmCreateNodeKmsRelationSchema = CvmCreateNodeKmsRelationV20260121Schema.extend({
|
|
1130
|
+
kms_id: HashIdSchema,
|
|
1131
|
+
kms_contract_id: HashIdSchema.nullable().optional()
|
|
1132
|
+
});
|
|
1133
|
+
var CvmCreateGatewayResourceSchema = CvmCreateGatewayResourceV20260121Schema.extend({
|
|
1134
|
+
id: HashIdSchema,
|
|
1135
|
+
kms_contract_id: HashIdSchema
|
|
1136
|
+
});
|
|
1137
|
+
var CvmCreateInstanceTypeResourceSchema = z6.object({
|
|
1046
1138
|
id: z6.string(),
|
|
1047
1139
|
name: z6.string(),
|
|
1048
|
-
description: z6.string(),
|
|
1049
1140
|
vcpu: z6.number(),
|
|
1050
1141
|
memory_mb: z6.number(),
|
|
1051
|
-
|
|
1142
|
+
default_disk_size_gb: z6.number(),
|
|
1052
1143
|
requires_gpu: z6.boolean(),
|
|
1053
|
-
|
|
1054
|
-
family: z6.string().nullable()
|
|
1144
|
+
requires_gpu_count: z6.number(),
|
|
1145
|
+
family: z6.string().nullable().optional(),
|
|
1146
|
+
display_order: z6.number().nullable().optional()
|
|
1055
1147
|
}).passthrough();
|
|
1056
|
-
var
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1148
|
+
var CvmCreateResourceGraphV20260121Schema = z6.object({
|
|
1149
|
+
tier: z6.string(),
|
|
1150
|
+
capacity: ResourceThresholdSchema,
|
|
1151
|
+
nodes: z6.array(TeepodCapacitySchema),
|
|
1152
|
+
kms_nodes: z6.array(CvmCreateKmsResourceV20260121Schema),
|
|
1153
|
+
node_kms_relations: z6.array(CvmCreateNodeKmsRelationV20260121Schema),
|
|
1154
|
+
gateway_nodes: z6.array(CvmCreateGatewayResourceV20260121Schema),
|
|
1155
|
+
instance_types: z6.array(CvmCreateInstanceTypeResourceSchema),
|
|
1156
|
+
gpu_availability: GpuAvailabilitySchema
|
|
1157
|
+
}).passthrough();
|
|
1158
|
+
var CvmCreateResourceGraphV20260522Schema = CvmCreateResourceGraphV20260121Schema.extend({
|
|
1159
|
+
kms_nodes: z6.array(CvmCreateKmsResourceSchema),
|
|
1160
|
+
node_kms_relations: z6.array(CvmCreateNodeKmsRelationSchema),
|
|
1161
|
+
gateway_nodes: z6.array(CvmCreateGatewayResourceSchema)
|
|
1162
|
+
});
|
|
1163
|
+
var CvmCreateResourceGraphSchema = CvmCreateResourceGraphV20260522Schema;
|
|
1164
|
+
function getSchemaForVersion2(version) {
|
|
1165
|
+
if (version === "2026-01-21") return CvmCreateResourceGraphV20260121Schema;
|
|
1166
|
+
return CvmCreateResourceGraphV20260522Schema;
|
|
1167
|
+
}
|
|
1168
|
+
async function getCvmCreateResources(client, parameters) {
|
|
1169
|
+
const response = await client.get("/teepods/cvm-create-resources");
|
|
1170
|
+
if (parameters?.schema === false) return response;
|
|
1171
|
+
const schema = parameters?.schema || getSchemaForVersion2(client.config.version);
|
|
1172
|
+
return schema.parse(response);
|
|
1173
|
+
}
|
|
1174
|
+
async function safeGetCvmCreateResources(client, parameters) {
|
|
1175
|
+
try {
|
|
1176
|
+
const response = await client.get("/teepods/cvm-create-resources");
|
|
1177
|
+
if (parameters?.schema === false) {
|
|
1178
|
+
return { success: true, data: response };
|
|
1179
|
+
}
|
|
1180
|
+
const schema = parameters?.schema || getSchemaForVersion2(client.config.version);
|
|
1181
|
+
const data = schema.parse(response);
|
|
1182
|
+
return { success: true, data };
|
|
1183
|
+
} catch (error) {
|
|
1184
|
+
return { success: false, error };
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// src/actions/list-instance-types.ts
|
|
1189
|
+
import { z as z7 } from "zod";
|
|
1190
|
+
var InstanceTypeSchema = z7.object({
|
|
1191
|
+
id: z7.string(),
|
|
1192
|
+
name: z7.string(),
|
|
1193
|
+
description: z7.string(),
|
|
1194
|
+
vcpu: z7.number(),
|
|
1195
|
+
memory_mb: z7.number(),
|
|
1196
|
+
hourly_rate: z7.string(),
|
|
1197
|
+
requires_gpu: z7.boolean(),
|
|
1198
|
+
default_disk_size_gb: z7.number().default(20),
|
|
1199
|
+
family: z7.string().nullable()
|
|
1200
|
+
}).passthrough();
|
|
1201
|
+
var FamilyGroupSchema = z7.object({
|
|
1202
|
+
name: z7.string(),
|
|
1203
|
+
items: z7.array(InstanceTypeSchema),
|
|
1204
|
+
total: z7.number()
|
|
1060
1205
|
}).strict();
|
|
1061
|
-
var AllFamiliesResponseSchema =
|
|
1062
|
-
result:
|
|
1206
|
+
var AllFamiliesResponseSchema = z7.object({
|
|
1207
|
+
result: z7.array(FamilyGroupSchema)
|
|
1063
1208
|
}).strict();
|
|
1064
|
-
var FamilyInstanceTypesResponseSchema =
|
|
1065
|
-
items:
|
|
1066
|
-
total:
|
|
1067
|
-
family:
|
|
1209
|
+
var FamilyInstanceTypesResponseSchema = z7.object({
|
|
1210
|
+
items: z7.array(InstanceTypeSchema),
|
|
1211
|
+
total: z7.number(),
|
|
1212
|
+
family: z7.string()
|
|
1068
1213
|
}).strict();
|
|
1069
|
-
var ListFamilyInstanceTypesRequestSchema =
|
|
1070
|
-
family:
|
|
1214
|
+
var ListFamilyInstanceTypesRequestSchema = z7.object({
|
|
1215
|
+
family: z7.string()
|
|
1071
1216
|
}).strict();
|
|
1072
1217
|
var { action: listAllInstanceTypeFamilies, safeAction: safeListAllInstanceTypeFamilies } = defineAction(
|
|
1073
1218
|
AllFamiliesResponseSchema,
|
|
@@ -1081,24 +1226,25 @@ var { action: listFamilyInstanceTypes, safeAction: safeListFamilyInstanceTypes }
|
|
|
1081
1226
|
});
|
|
1082
1227
|
|
|
1083
1228
|
// src/actions/workspaces/list_workspaces.ts
|
|
1084
|
-
import { z as
|
|
1085
|
-
var WorkspaceResponseSchema =
|
|
1086
|
-
id:
|
|
1087
|
-
name:
|
|
1088
|
-
slug:
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1229
|
+
import { z as z8 } from "zod";
|
|
1230
|
+
var WorkspaceResponseSchema = z8.object({
|
|
1231
|
+
id: z8.string(),
|
|
1232
|
+
name: z8.string(),
|
|
1233
|
+
slug: z8.string().nullable(),
|
|
1234
|
+
avatar_url: z8.string().nullable().optional(),
|
|
1235
|
+
tier: z8.string(),
|
|
1236
|
+
role: z8.string(),
|
|
1237
|
+
is_default: z8.boolean(),
|
|
1238
|
+
created_at: z8.string(),
|
|
1239
|
+
confidential_models_enabled: z8.boolean().optional()
|
|
1094
1240
|
}).passthrough();
|
|
1095
|
-
var PaginationMetadataSchema =
|
|
1096
|
-
has_more:
|
|
1097
|
-
next_cursor:
|
|
1098
|
-
total:
|
|
1241
|
+
var PaginationMetadataSchema = z8.object({
|
|
1242
|
+
has_more: z8.boolean(),
|
|
1243
|
+
next_cursor: z8.string().nullable(),
|
|
1244
|
+
total: z8.number().nullable()
|
|
1099
1245
|
}).passthrough();
|
|
1100
|
-
var ListWorkspacesSchema =
|
|
1101
|
-
data:
|
|
1246
|
+
var ListWorkspacesSchema = z8.object({
|
|
1247
|
+
data: z8.array(WorkspaceResponseSchema),
|
|
1102
1248
|
pagination: PaginationMetadataSchema
|
|
1103
1249
|
}).passthrough();
|
|
1104
1250
|
var { action: listWorkspaces, safeAction: safeListWorkspaces } = defineAction(ListWorkspacesSchema, async (client, request) => {
|
|
@@ -1115,143 +1261,144 @@ var { action: getWorkspace, safeAction: safeGetWorkspace } = defineAction(Worksp
|
|
|
1115
1261
|
});
|
|
1116
1262
|
|
|
1117
1263
|
// src/types/cvm_info_v20251028.ts
|
|
1118
|
-
import { z as
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1264
|
+
import { z as z9 } from "zod";
|
|
1265
|
+
var TableIdSchema = z9.union([z9.number(), z9.string()]);
|
|
1266
|
+
var VmInfoV20251028Schema = z9.object({
|
|
1267
|
+
id: z9.string(),
|
|
1268
|
+
name: z9.string(),
|
|
1269
|
+
status: z9.string(),
|
|
1270
|
+
uptime: z9.string(),
|
|
1271
|
+
app_url: z9.string().nullable(),
|
|
1272
|
+
app_id: z9.string(),
|
|
1273
|
+
instance_id: z9.string().nullable(),
|
|
1274
|
+
configuration: z9.any().optional(),
|
|
1275
|
+
exited_at: z9.string().nullable(),
|
|
1276
|
+
boot_progress: z9.string().nullable(),
|
|
1277
|
+
boot_error: z9.string().nullable(),
|
|
1278
|
+
shutdown_progress: z9.string().nullable(),
|
|
1279
|
+
image_version: z9.string().nullable()
|
|
1280
|
+
});
|
|
1281
|
+
var ManagedUserV20251028Schema = z9.object({
|
|
1282
|
+
id: TableIdSchema,
|
|
1283
|
+
username: z9.string()
|
|
1284
|
+
});
|
|
1285
|
+
var CvmNodeV20251028Schema = z9.object({
|
|
1286
|
+
id: z9.number(),
|
|
1287
|
+
name: z9.string(),
|
|
1288
|
+
region_identifier: z9.string().nullable().optional()
|
|
1142
1289
|
});
|
|
1143
|
-
var MachineInfoV20251028Schema =
|
|
1144
|
-
vcpu:
|
|
1145
|
-
memory:
|
|
1146
|
-
disk_size:
|
|
1147
|
-
gpu_count:
|
|
1290
|
+
var MachineInfoV20251028Schema = z9.object({
|
|
1291
|
+
vcpu: z9.number(),
|
|
1292
|
+
memory: z9.number(),
|
|
1293
|
+
disk_size: z9.number(),
|
|
1294
|
+
gpu_count: z9.number().default(0)
|
|
1148
1295
|
});
|
|
1149
|
-
var CvmNetworkUrlsV20251028Schema =
|
|
1150
|
-
app:
|
|
1151
|
-
instance:
|
|
1296
|
+
var CvmNetworkUrlsV20251028Schema = z9.object({
|
|
1297
|
+
app: z9.string(),
|
|
1298
|
+
instance: z9.string()
|
|
1152
1299
|
});
|
|
1153
|
-
var CvmInfoV20251028Schema =
|
|
1300
|
+
var CvmInfoV20251028Schema = z9.object({
|
|
1154
1301
|
hosted: VmInfoV20251028Schema,
|
|
1155
|
-
name:
|
|
1302
|
+
name: z9.string(),
|
|
1156
1303
|
managed_user: ManagedUserV20251028Schema.nullable(),
|
|
1157
1304
|
node: CvmNodeV20251028Schema.nullable(),
|
|
1158
|
-
listed:
|
|
1159
|
-
status:
|
|
1160
|
-
in_progress:
|
|
1161
|
-
dapp_dashboard_url:
|
|
1162
|
-
syslog_endpoint:
|
|
1163
|
-
allow_upgrade:
|
|
1164
|
-
project_id:
|
|
1165
|
-
project_type:
|
|
1166
|
-
billing_period:
|
|
1305
|
+
listed: z9.boolean().default(false),
|
|
1306
|
+
status: z9.string(),
|
|
1307
|
+
in_progress: z9.boolean().default(false),
|
|
1308
|
+
dapp_dashboard_url: z9.string().nullable(),
|
|
1309
|
+
syslog_endpoint: z9.string().nullable(),
|
|
1310
|
+
allow_upgrade: z9.boolean().default(false),
|
|
1311
|
+
project_id: z9.string().nullable(),
|
|
1312
|
+
project_type: z9.string().nullable(),
|
|
1313
|
+
billing_period: z9.string().nullable(),
|
|
1167
1314
|
kms_info: KmsInfoSchema.nullable(),
|
|
1168
|
-
vcpu:
|
|
1169
|
-
memory:
|
|
1170
|
-
disk_size:
|
|
1171
|
-
gateway_domain:
|
|
1172
|
-
public_urls:
|
|
1315
|
+
vcpu: z9.number().nullable(),
|
|
1316
|
+
memory: z9.number().nullable(),
|
|
1317
|
+
disk_size: z9.number().nullable(),
|
|
1318
|
+
gateway_domain: z9.string().nullable(),
|
|
1319
|
+
public_urls: z9.array(CvmNetworkUrlsV20251028Schema),
|
|
1173
1320
|
machine_info: MachineInfoV20251028Schema.nullable().optional(),
|
|
1174
|
-
updated_at:
|
|
1321
|
+
updated_at: z9.string().nullable().optional()
|
|
1175
1322
|
});
|
|
1176
|
-
var CvmDetailV20251028Schema =
|
|
1177
|
-
id:
|
|
1178
|
-
name:
|
|
1179
|
-
status:
|
|
1180
|
-
in_progress:
|
|
1181
|
-
teepod_id:
|
|
1323
|
+
var CvmDetailV20251028Schema = z9.object({
|
|
1324
|
+
id: TableIdSchema,
|
|
1325
|
+
name: z9.string(),
|
|
1326
|
+
status: z9.string(),
|
|
1327
|
+
in_progress: z9.boolean().optional().default(false),
|
|
1328
|
+
teepod_id: z9.number().nullable(),
|
|
1182
1329
|
teepod: CvmNodeV20251028Schema.optional().nullable(),
|
|
1183
|
-
app_id:
|
|
1184
|
-
vm_uuid:
|
|
1185
|
-
instance_id:
|
|
1186
|
-
vcpu:
|
|
1187
|
-
memory:
|
|
1188
|
-
disk_size:
|
|
1189
|
-
base_image:
|
|
1190
|
-
encrypted_env_pubkey:
|
|
1191
|
-
listed:
|
|
1192
|
-
project_id:
|
|
1193
|
-
project_type:
|
|
1194
|
-
instance_type:
|
|
1195
|
-
public_sysinfo:
|
|
1196
|
-
public_logs:
|
|
1197
|
-
dapp_dashboard_url:
|
|
1198
|
-
syslog_endpoint:
|
|
1330
|
+
app_id: z9.string(),
|
|
1331
|
+
vm_uuid: z9.string().nullable(),
|
|
1332
|
+
instance_id: z9.string().nullable(),
|
|
1333
|
+
vcpu: z9.number(),
|
|
1334
|
+
memory: z9.number(),
|
|
1335
|
+
disk_size: z9.number(),
|
|
1336
|
+
base_image: z9.string().nullable(),
|
|
1337
|
+
encrypted_env_pubkey: z9.string().nullable(),
|
|
1338
|
+
listed: z9.boolean().optional().default(false),
|
|
1339
|
+
project_id: z9.string().optional().nullable(),
|
|
1340
|
+
project_type: z9.string().optional().nullable(),
|
|
1341
|
+
instance_type: z9.string().optional().nullable(),
|
|
1342
|
+
public_sysinfo: z9.boolean().optional().default(false),
|
|
1343
|
+
public_logs: z9.boolean().optional().default(false),
|
|
1344
|
+
dapp_dashboard_url: z9.string().optional().nullable(),
|
|
1345
|
+
syslog_endpoint: z9.string().optional().nullable(),
|
|
1199
1346
|
kms_info: KmsInfoSchema.optional().nullable(),
|
|
1200
|
-
contract_address:
|
|
1201
|
-
deployer_address:
|
|
1202
|
-
scheduled_delete_at:
|
|
1203
|
-
public_urls:
|
|
1204
|
-
gateway_domain:
|
|
1347
|
+
contract_address: z9.string().optional().nullable(),
|
|
1348
|
+
deployer_address: z9.string().optional().nullable(),
|
|
1349
|
+
scheduled_delete_at: z9.string().optional().nullable(),
|
|
1350
|
+
public_urls: z9.array(CvmNetworkUrlsV20251028Schema).optional().default([]),
|
|
1351
|
+
gateway_domain: z9.string().optional().nullable(),
|
|
1205
1352
|
machine_info: MachineInfoV20251028Schema.optional().nullable(),
|
|
1206
|
-
updated_at:
|
|
1353
|
+
updated_at: z9.string().optional().nullable()
|
|
1207
1354
|
});
|
|
1208
|
-
var PaginatedCvmInfosV20251028Schema =
|
|
1209
|
-
items:
|
|
1210
|
-
total:
|
|
1211
|
-
page:
|
|
1212
|
-
page_size:
|
|
1213
|
-
pages:
|
|
1355
|
+
var PaginatedCvmInfosV20251028Schema = z9.object({
|
|
1356
|
+
items: z9.array(CvmInfoV20251028Schema),
|
|
1357
|
+
total: z9.number(),
|
|
1358
|
+
page: z9.number(),
|
|
1359
|
+
page_size: z9.number(),
|
|
1360
|
+
pages: z9.number()
|
|
1214
1361
|
});
|
|
1215
1362
|
|
|
1216
1363
|
// src/types/cvm_info_v20260121.ts
|
|
1217
|
-
import { z as
|
|
1218
|
-
var BillingPeriodSchema =
|
|
1219
|
-
var KmsTypeSchema =
|
|
1220
|
-
var UserRefSchema =
|
|
1221
|
-
object_type:
|
|
1222
|
-
id:
|
|
1223
|
-
username:
|
|
1224
|
-
avatar_url:
|
|
1225
|
-
});
|
|
1226
|
-
var WorkspaceRefSchema =
|
|
1227
|
-
object_type:
|
|
1228
|
-
id:
|
|
1229
|
-
name:
|
|
1230
|
-
slug:
|
|
1231
|
-
avatar_url:
|
|
1232
|
-
});
|
|
1233
|
-
var CvmResourceInfoV20260121Schema =
|
|
1234
|
-
instance_type:
|
|
1235
|
-
vcpu:
|
|
1236
|
-
memory_in_gb:
|
|
1237
|
-
disk_in_gb:
|
|
1238
|
-
gpus:
|
|
1239
|
-
compute_billing_price:
|
|
1364
|
+
import { z as z10 } from "zod";
|
|
1365
|
+
var BillingPeriodSchema = z10.enum(["skip", "hourly", "monthly"]);
|
|
1366
|
+
var KmsTypeSchema = z10.enum(["phala", "ethereum", "base", "legacy"]);
|
|
1367
|
+
var UserRefSchema = z10.object({
|
|
1368
|
+
object_type: z10.literal("user"),
|
|
1369
|
+
id: z10.string().nullable().optional(),
|
|
1370
|
+
username: z10.string().nullable().optional(),
|
|
1371
|
+
avatar_url: z10.string().nullable().optional()
|
|
1372
|
+
});
|
|
1373
|
+
var WorkspaceRefSchema = z10.object({
|
|
1374
|
+
object_type: z10.literal("workspace"),
|
|
1375
|
+
id: z10.string(),
|
|
1376
|
+
name: z10.string(),
|
|
1377
|
+
slug: z10.string().nullable().optional(),
|
|
1378
|
+
avatar_url: z10.string().nullable().optional()
|
|
1379
|
+
});
|
|
1380
|
+
var CvmResourceInfoV20260121Schema = z10.object({
|
|
1381
|
+
instance_type: z10.string().nullable().optional(),
|
|
1382
|
+
vcpu: z10.number().int().nullable().optional(),
|
|
1383
|
+
memory_in_gb: z10.number().nullable().optional(),
|
|
1384
|
+
disk_in_gb: z10.number().int().nullable().optional(),
|
|
1385
|
+
gpus: z10.number().int().nullable().optional(),
|
|
1386
|
+
compute_billing_price: z10.string().nullable().optional(),
|
|
1240
1387
|
billing_period: BillingPeriodSchema.nullable().optional()
|
|
1241
1388
|
});
|
|
1242
|
-
var CvmOsInfoV20260121Schema =
|
|
1243
|
-
name:
|
|
1244
|
-
version:
|
|
1245
|
-
is_dev:
|
|
1246
|
-
os_image_hash:
|
|
1389
|
+
var CvmOsInfoV20260121Schema = z10.object({
|
|
1390
|
+
name: z10.string().nullable().optional(),
|
|
1391
|
+
version: z10.string().nullable().optional(),
|
|
1392
|
+
is_dev: z10.boolean().nullable().optional(),
|
|
1393
|
+
os_image_hash: z10.string().nullable().optional()
|
|
1247
1394
|
});
|
|
1248
|
-
var CvmKmsInfoV20260121BaseSchema =
|
|
1249
|
-
chain_id:
|
|
1250
|
-
dstack_kms_address:
|
|
1251
|
-
dstack_app_address:
|
|
1252
|
-
deployer_address:
|
|
1253
|
-
rpc_endpoint:
|
|
1254
|
-
encrypted_env_pubkey:
|
|
1395
|
+
var CvmKmsInfoV20260121BaseSchema = z10.object({
|
|
1396
|
+
chain_id: z10.number().int().nullable().optional(),
|
|
1397
|
+
dstack_kms_address: z10.string().nullable().optional(),
|
|
1398
|
+
dstack_app_address: z10.string().nullable().optional(),
|
|
1399
|
+
deployer_address: z10.string().nullable().optional(),
|
|
1400
|
+
rpc_endpoint: z10.string().nullable().optional(),
|
|
1401
|
+
encrypted_env_pubkey: z10.string().nullable().optional()
|
|
1255
1402
|
});
|
|
1256
1403
|
var CvmKmsInfoV20260121Schema = CvmKmsInfoV20260121BaseSchema.transform((data) => {
|
|
1257
1404
|
if (data.chain_id != null) {
|
|
@@ -1262,67 +1409,88 @@ var CvmKmsInfoV20260121Schema = CvmKmsInfoV20260121BaseSchema.transform((data) =
|
|
|
1262
1409
|
}
|
|
1263
1410
|
return data;
|
|
1264
1411
|
});
|
|
1265
|
-
var CvmProgressInfoV20260121Schema =
|
|
1266
|
-
target:
|
|
1267
|
-
started_at:
|
|
1268
|
-
correlation_id:
|
|
1269
|
-
});
|
|
1270
|
-
var CvmGatewayInfoV20260121Schema =
|
|
1271
|
-
base_domain:
|
|
1272
|
-
cname:
|
|
1273
|
-
});
|
|
1274
|
-
var
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1412
|
+
var CvmProgressInfoV20260121Schema = z10.object({
|
|
1413
|
+
target: z10.string().nullable().optional(),
|
|
1414
|
+
started_at: z10.string().nullable().optional(),
|
|
1415
|
+
correlation_id: z10.string().nullable().optional()
|
|
1416
|
+
});
|
|
1417
|
+
var CvmGatewayInfoV20260121Schema = z10.object({
|
|
1418
|
+
base_domain: z10.string().nullable().optional(),
|
|
1419
|
+
cname: z10.string().nullable().optional()
|
|
1420
|
+
});
|
|
1421
|
+
var CvmLogUrlsV20260121Schema = z10.object({
|
|
1422
|
+
serial: z10.string().nullable().optional(),
|
|
1423
|
+
stdout: z10.string().nullable().optional(),
|
|
1424
|
+
stderr: z10.string().nullable().optional(),
|
|
1425
|
+
container_log_base: z10.string().nullable().optional()
|
|
1426
|
+
});
|
|
1427
|
+
var NodeRefSchema = z10.object({
|
|
1428
|
+
object_type: z10.literal("node"),
|
|
1429
|
+
id: z10.number().int().nullable().optional(),
|
|
1430
|
+
name: z10.string().nullable().optional(),
|
|
1431
|
+
region: z10.string().nullable().optional(),
|
|
1432
|
+
device_id: z10.string().nullable().optional(),
|
|
1433
|
+
ppid: z10.string().nullable().optional(),
|
|
1434
|
+
status: z10.string().nullable().optional(),
|
|
1435
|
+
version: z10.string().nullable().optional()
|
|
1283
1436
|
});
|
|
1284
1437
|
var CvmNodeInfoV20260121Schema = NodeRefSchema;
|
|
1285
|
-
var CvmInfoV20260121Schema =
|
|
1286
|
-
id:
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
instance_id: z9.string().nullable().optional(),
|
|
1438
|
+
var CvmInfoV20260121Schema = z10.object({
|
|
1439
|
+
id: z10.string(),
|
|
1440
|
+
name: z10.string(),
|
|
1441
|
+
app_id: z10.string().nullable().optional(),
|
|
1442
|
+
vm_uuid: z10.string().nullable().optional(),
|
|
1443
|
+
instance_id: z10.string().nullable().optional(),
|
|
1292
1444
|
resource: CvmResourceInfoV20260121Schema,
|
|
1293
1445
|
node_info: NodeRefSchema.nullable().optional(),
|
|
1294
1446
|
os: CvmOsInfoV20260121Schema.nullable().optional(),
|
|
1295
1447
|
kms_type: KmsTypeSchema.nullable().optional(),
|
|
1296
1448
|
kms_info: CvmKmsInfoV20260121Schema.nullable().optional(),
|
|
1297
|
-
status:
|
|
1449
|
+
status: z10.string(),
|
|
1450
|
+
in_progress: z10.boolean().optional().default(false),
|
|
1298
1451
|
progress: CvmProgressInfoV20260121Schema.nullable().optional(),
|
|
1299
|
-
compose_hash:
|
|
1452
|
+
compose_hash: z10.string().nullable().optional(),
|
|
1453
|
+
docker_compose_hash: z10.string().nullable().optional(),
|
|
1454
|
+
pre_launch_script_hash: z10.string().nullable().optional(),
|
|
1300
1455
|
gateway: CvmGatewayInfoV20260121Schema,
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1456
|
+
logs: CvmLogUrlsV20260121Schema.optional().default({}),
|
|
1457
|
+
services: z10.array(z10.record(z10.any())).optional().default([]),
|
|
1458
|
+
endpoints: z10.array(CvmNetworkUrlsV20251028Schema).nullable().optional(),
|
|
1459
|
+
public_logs: z10.boolean().optional(),
|
|
1460
|
+
public_sysinfo: z10.boolean().optional(),
|
|
1461
|
+
public_tcbinfo: z10.boolean().optional(),
|
|
1462
|
+
gateway_enabled: z10.boolean().optional(),
|
|
1463
|
+
secure_time: z10.boolean().optional(),
|
|
1464
|
+
listed: z10.boolean().optional().default(false),
|
|
1465
|
+
storage_fs: z10.string().optional(),
|
|
1310
1466
|
workspace: WorkspaceRefSchema.nullable().optional(),
|
|
1311
|
-
creator: UserRefSchema.nullable().optional()
|
|
1467
|
+
creator: UserRefSchema.nullable().optional(),
|
|
1468
|
+
created_at: z10.string().nullable().optional(),
|
|
1469
|
+
deleted_at: z10.string().nullable().optional(),
|
|
1470
|
+
project_type: z10.string().nullable().optional()
|
|
1471
|
+
});
|
|
1472
|
+
var CvmInfoV20260522Schema = CvmInfoV20260121Schema.extend({
|
|
1473
|
+
id: z10.string()
|
|
1312
1474
|
});
|
|
1313
1475
|
var CvmInfoDetailV20260121Schema = CvmInfoV20260121Schema.extend({
|
|
1314
|
-
compose_file:
|
|
1476
|
+
compose_file: z10.union([z10.record(z10.any()), z10.string()]).nullable().optional()
|
|
1315
1477
|
});
|
|
1316
|
-
var
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1478
|
+
var CvmInfoDetailV20260522Schema = CvmInfoV20260522Schema.extend({
|
|
1479
|
+
compose_file: z10.union([z10.record(z10.any()), z10.string()]).nullable().optional()
|
|
1480
|
+
});
|
|
1481
|
+
var PaginatedCvmInfosV20260121Schema = z10.object({
|
|
1482
|
+
items: z10.array(CvmInfoV20260121Schema),
|
|
1483
|
+
total: z10.number(),
|
|
1484
|
+
page: z10.number(),
|
|
1485
|
+
page_size: z10.number(),
|
|
1486
|
+
pages: z10.number()
|
|
1487
|
+
});
|
|
1488
|
+
var PaginatedCvmInfosV20260522Schema = PaginatedCvmInfosV20260121Schema.extend({
|
|
1489
|
+
items: z10.array(CvmInfoV20260522Schema)
|
|
1322
1490
|
});
|
|
1323
1491
|
|
|
1324
1492
|
// src/types/cvm_id.ts
|
|
1325
|
-
import { z as
|
|
1493
|
+
import { z as z11 } from "zod";
|
|
1326
1494
|
|
|
1327
1495
|
// src/utils/hostname.ts
|
|
1328
1496
|
function isValidHostname(name) {
|
|
@@ -1380,20 +1548,20 @@ function generateDefaultCvmName(prefix = "dstack-app") {
|
|
|
1380
1548
|
}
|
|
1381
1549
|
|
|
1382
1550
|
// src/types/cvm_id.ts
|
|
1383
|
-
var CvmIdObjectSchema =
|
|
1551
|
+
var CvmIdObjectSchema = z11.object({
|
|
1384
1552
|
/** Direct CVM ID (any format) - accepts any string including names */
|
|
1385
|
-
id:
|
|
1553
|
+
id: z11.string().optional(),
|
|
1386
1554
|
/** UUID format (with or without dashes) */
|
|
1387
|
-
uuid:
|
|
1555
|
+
uuid: z11.string().regex(
|
|
1388
1556
|
/^[0-9a-f]{8}[-]?[0-9a-f]{4}[-]?4[0-9a-f]{3}[-]?[89ab][0-9a-f]{3}[-]?[0-9a-f]{12}$/i,
|
|
1389
1557
|
"Invalid UUID format"
|
|
1390
1558
|
).optional(),
|
|
1391
1559
|
/** App ID (40 characters, optionally prefixed with 'app_id_') */
|
|
1392
|
-
app_id:
|
|
1560
|
+
app_id: z11.string().optional(),
|
|
1393
1561
|
/** Instance ID (40 characters, optionally prefixed with 'instance_') */
|
|
1394
|
-
instance_id:
|
|
1562
|
+
instance_id: z11.string().optional(),
|
|
1395
1563
|
/** CVM name (RFC 1123 hostname format: 5-63 chars, starts with letter, alphanumeric + hyphens) */
|
|
1396
|
-
name:
|
|
1564
|
+
name: z11.string().refine(isValidHostname, {
|
|
1397
1565
|
message: "Name must be 5-63 characters, start with letter, and contain only letters/numbers/hyphens"
|
|
1398
1566
|
}).optional()
|
|
1399
1567
|
});
|
|
@@ -1437,13 +1605,15 @@ var CvmIdSchema = CvmIdBaseSchema.transform((data) => {
|
|
|
1437
1605
|
|
|
1438
1606
|
// src/actions/cvms/get_cvm_info.ts
|
|
1439
1607
|
var GetCvmInfoRequestSchema = CvmIdSchema;
|
|
1440
|
-
function
|
|
1441
|
-
|
|
1608
|
+
function getSchemaForVersion3(version) {
|
|
1609
|
+
if (version === "2025-10-28") return CvmDetailV20251028Schema;
|
|
1610
|
+
if (version === "2026-01-21") return CvmInfoDetailV20260121Schema;
|
|
1611
|
+
return CvmInfoDetailV20260522Schema;
|
|
1442
1612
|
}
|
|
1443
1613
|
async function getCvmInfo(client, request) {
|
|
1444
1614
|
const { cvmId } = GetCvmInfoRequestSchema.parse(request);
|
|
1445
1615
|
const response = await client.get(`/cvms/${cvmId}`);
|
|
1446
|
-
const schema =
|
|
1616
|
+
const schema = getSchemaForVersion3(client.config.version);
|
|
1447
1617
|
return schema.parse(response);
|
|
1448
1618
|
}
|
|
1449
1619
|
async function safeGetCvmInfo(client, request) {
|
|
@@ -1465,21 +1635,23 @@ async function safeGetCvmInfo(client, request) {
|
|
|
1465
1635
|
}
|
|
1466
1636
|
|
|
1467
1637
|
// src/actions/cvms/get_cvm_list.ts
|
|
1468
|
-
import { z as
|
|
1469
|
-
var GetCvmListRequestSchema =
|
|
1470
|
-
page:
|
|
1471
|
-
page_size:
|
|
1472
|
-
node_id:
|
|
1473
|
-
teepod_id:
|
|
1474
|
-
user_id:
|
|
1638
|
+
import { z as z12 } from "zod";
|
|
1639
|
+
var GetCvmListRequestSchema = z12.object({
|
|
1640
|
+
page: z12.number().int().min(1).optional(),
|
|
1641
|
+
page_size: z12.number().int().min(1).optional(),
|
|
1642
|
+
node_id: z12.number().int().min(1).optional(),
|
|
1643
|
+
teepod_id: z12.number().int().min(1).optional(),
|
|
1644
|
+
user_id: z12.string().optional()
|
|
1475
1645
|
}).strict();
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1646
|
+
function getSchemaForVersion4(version) {
|
|
1647
|
+
if (version === "2025-10-28") return PaginatedCvmInfosV20251028Schema;
|
|
1648
|
+
if (version === "2026-01-21") return PaginatedCvmInfosV20260121Schema;
|
|
1649
|
+
return PaginatedCvmInfosV20260522Schema;
|
|
1478
1650
|
}
|
|
1479
1651
|
async function getCvmList(client, request) {
|
|
1480
1652
|
const validatedRequest = GetCvmListRequestSchema.parse(request ?? {});
|
|
1481
1653
|
const response = await client.get("/cvms/paginated", { params: validatedRequest });
|
|
1482
|
-
const schema =
|
|
1654
|
+
const schema = getSchemaForVersion4(client.config.version);
|
|
1483
1655
|
return schema.parse(response);
|
|
1484
1656
|
}
|
|
1485
1657
|
async function safeGetCvmList(client, request) {
|
|
@@ -1501,10 +1673,10 @@ async function safeGetCvmList(client, request) {
|
|
|
1501
1673
|
}
|
|
1502
1674
|
|
|
1503
1675
|
// src/actions/cvms/provision_cvm.ts
|
|
1504
|
-
import { z as
|
|
1676
|
+
import { z as z14 } from "zod";
|
|
1505
1677
|
|
|
1506
1678
|
// src/types/app_compose.ts
|
|
1507
|
-
import { z as
|
|
1679
|
+
import { z as z13 } from "zod";
|
|
1508
1680
|
var MAX_COMPOSE_PAYLOAD_BYTES = 200 * 1024;
|
|
1509
1681
|
function validateComposePayloadSize(dockerComposeFile, preLaunchScript, ctx) {
|
|
1510
1682
|
const encoder = new TextEncoder();
|
|
@@ -1515,43 +1687,52 @@ function validateComposePayloadSize(dockerComposeFile, preLaunchScript, ctx) {
|
|
|
1515
1687
|
const maxKB = MAX_COMPOSE_PAYLOAD_BYTES / 1024;
|
|
1516
1688
|
const currentKB = Math.ceil(totalSize / 1024);
|
|
1517
1689
|
ctx.addIssue({
|
|
1518
|
-
code:
|
|
1690
|
+
code: z13.ZodIssueCode.custom,
|
|
1519
1691
|
message: `Combined size of docker_compose_file and pre_launch_script must not exceed ${maxKB}KB (current: ${currentKB}KB)`
|
|
1520
1692
|
});
|
|
1521
1693
|
}
|
|
1522
1694
|
}
|
|
1523
|
-
var LooseAppComposeSchema =
|
|
1524
|
-
allowed_envs:
|
|
1525
|
-
docker_compose_file:
|
|
1526
|
-
features:
|
|
1527
|
-
name:
|
|
1528
|
-
manifest_version:
|
|
1529
|
-
kms_enabled:
|
|
1530
|
-
public_logs:
|
|
1531
|
-
public_sysinfo:
|
|
1532
|
-
tproxy_enabled:
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1695
|
+
var LooseAppComposeSchema = z13.object({
|
|
1696
|
+
allowed_envs: z13.array(z13.string()).optional(),
|
|
1697
|
+
docker_compose_file: z13.string(),
|
|
1698
|
+
features: z13.array(z13.string()).optional(),
|
|
1699
|
+
name: z13.string().optional(),
|
|
1700
|
+
manifest_version: z13.number().optional(),
|
|
1701
|
+
kms_enabled: z13.boolean().optional(),
|
|
1702
|
+
public_logs: z13.boolean().optional(),
|
|
1703
|
+
public_sysinfo: z13.boolean().optional(),
|
|
1704
|
+
tproxy_enabled: z13.boolean().optional(),
|
|
1705
|
+
port_policy: z13.object({
|
|
1706
|
+
ports: z13.array(
|
|
1707
|
+
z13.object({
|
|
1708
|
+
port: z13.number().int().min(1).max(65535),
|
|
1709
|
+
pp: z13.boolean()
|
|
1710
|
+
})
|
|
1711
|
+
),
|
|
1712
|
+
restrict_mode: z13.boolean()
|
|
1713
|
+
}).optional(),
|
|
1714
|
+
storage_fs: z13.enum(["ext4", "zfs"]).optional(),
|
|
1715
|
+
pre_launch_script: z13.string().optional(),
|
|
1716
|
+
env_pubkey: z13.string().optional(),
|
|
1717
|
+
salt: z13.string().optional().nullable()
|
|
1537
1718
|
}).passthrough().superRefine((data, ctx) => {
|
|
1538
1719
|
validateComposePayloadSize(data.docker_compose_file, data.pre_launch_script, ctx);
|
|
1539
1720
|
});
|
|
1540
1721
|
|
|
1541
1722
|
// src/actions/cvms/provision_cvm.ts
|
|
1542
|
-
var ProvisionCvmSchema =
|
|
1543
|
-
app_id:
|
|
1544
|
-
app_env_encrypt_pubkey:
|
|
1545
|
-
compose_hash:
|
|
1723
|
+
var ProvisionCvmSchema = z14.object({
|
|
1724
|
+
app_id: z14.string().nullable().optional(),
|
|
1725
|
+
app_env_encrypt_pubkey: z14.string().nullable().optional(),
|
|
1726
|
+
compose_hash: z14.string(),
|
|
1546
1727
|
kms_info: KmsInfoSchema.nullable().optional(),
|
|
1547
|
-
fmspc:
|
|
1548
|
-
device_id:
|
|
1549
|
-
os_image_hash:
|
|
1550
|
-
instance_type:
|
|
1551
|
-
teepod_id:
|
|
1728
|
+
fmspc: z14.string().nullable().optional(),
|
|
1729
|
+
device_id: z14.string().nullable().optional(),
|
|
1730
|
+
os_image_hash: z14.string().nullable().optional(),
|
|
1731
|
+
instance_type: z14.string().nullable().optional(),
|
|
1732
|
+
teepod_id: z14.number().nullable().optional(),
|
|
1552
1733
|
// Will be transformed to node_id
|
|
1553
|
-
node_id:
|
|
1554
|
-
kms_id:
|
|
1734
|
+
node_id: z14.number().nullable().optional(),
|
|
1735
|
+
kms_id: z14.string().nullable().optional()
|
|
1555
1736
|
}).passthrough().transform((data) => {
|
|
1556
1737
|
if ("teepod_id" in data && data.teepod_id !== void 0) {
|
|
1557
1738
|
const { teepod_id, ...rest } = data;
|
|
@@ -1560,50 +1741,53 @@ var ProvisionCvmSchema = z13.object({
|
|
|
1560
1741
|
return data;
|
|
1561
1742
|
});
|
|
1562
1743
|
var NAME_VALIDATION_MESSAGE = "Name must be 5-63 characters, start with letter, and contain only letters/numbers/hyphens";
|
|
1563
|
-
var ProvisionCvmRequestSchema =
|
|
1564
|
-
node_id:
|
|
1744
|
+
var ProvisionCvmRequestSchema = z14.object({
|
|
1745
|
+
node_id: z14.number().optional(),
|
|
1565
1746
|
// recommended - optional, system auto-selects if not specified
|
|
1566
|
-
teepod_id:
|
|
1747
|
+
teepod_id: z14.number().optional(),
|
|
1567
1748
|
// deprecated, for compatibility
|
|
1568
|
-
region:
|
|
1749
|
+
region: z14.string().optional(),
|
|
1569
1750
|
// optional - region filter for auto-selection
|
|
1570
|
-
name:
|
|
1571
|
-
instance_type:
|
|
1751
|
+
name: z14.string().min(5, NAME_VALIDATION_MESSAGE).max(63, NAME_VALIDATION_MESSAGE).refine((val) => isValidHostname(val), NAME_VALIDATION_MESSAGE),
|
|
1752
|
+
instance_type: z14.string().optional(),
|
|
1572
1753
|
// optional, defaults to "tdx.small" when no resource params specified
|
|
1573
|
-
image:
|
|
1574
|
-
vcpu:
|
|
1754
|
+
image: z14.string().optional(),
|
|
1755
|
+
vcpu: z14.number().optional(),
|
|
1575
1756
|
// deprecated, use instance_type instead
|
|
1576
|
-
memory:
|
|
1757
|
+
memory: z14.number().optional(),
|
|
1577
1758
|
// deprecated, use instance_type instead
|
|
1578
|
-
disk_size:
|
|
1579
|
-
compose_file:
|
|
1580
|
-
allowed_envs:
|
|
1581
|
-
pre_launch_script:
|
|
1582
|
-
docker_compose_file:
|
|
1583
|
-
name:
|
|
1759
|
+
disk_size: z14.number().optional(),
|
|
1760
|
+
compose_file: z14.object({
|
|
1761
|
+
allowed_envs: z14.array(z14.string()).optional(),
|
|
1762
|
+
pre_launch_script: z14.string().optional(),
|
|
1763
|
+
docker_compose_file: z14.string().optional(),
|
|
1764
|
+
name: z14.string().optional().default(""),
|
|
1584
1765
|
// optional with default empty string
|
|
1585
|
-
kms_enabled:
|
|
1586
|
-
public_logs:
|
|
1587
|
-
public_sysinfo:
|
|
1588
|
-
gateway_enabled:
|
|
1766
|
+
kms_enabled: z14.boolean().optional(),
|
|
1767
|
+
public_logs: z14.boolean().optional(),
|
|
1768
|
+
public_sysinfo: z14.boolean().optional(),
|
|
1769
|
+
gateway_enabled: z14.boolean().optional(),
|
|
1589
1770
|
// recommended
|
|
1590
|
-
tproxy_enabled:
|
|
1771
|
+
tproxy_enabled: z14.boolean().optional(),
|
|
1591
1772
|
// deprecated, for compatibility
|
|
1592
|
-
storage_fs:
|
|
1593
|
-
}).superRefine((data, ctx) => {
|
|
1773
|
+
storage_fs: z14.enum(["ext4", "zfs"]).optional()
|
|
1774
|
+
}).passthrough().superRefine((data, ctx) => {
|
|
1594
1775
|
validateComposePayloadSize(data.docker_compose_file, data.pre_launch_script, ctx);
|
|
1595
1776
|
}),
|
|
1596
|
-
listed:
|
|
1597
|
-
kms_id:
|
|
1598
|
-
kms:
|
|
1777
|
+
listed: z14.boolean().optional(),
|
|
1778
|
+
kms_id: z14.string().optional(),
|
|
1779
|
+
kms: z14.enum(["PHALA", "ETHEREUM", "BASE"]).optional(),
|
|
1599
1780
|
// KMS type selection (defaults to PHALA)
|
|
1600
|
-
kms_contract:
|
|
1781
|
+
kms_contract: z14.string().optional(),
|
|
1601
1782
|
// KMS contract address for on-chain KMS
|
|
1602
|
-
|
|
1783
|
+
kms_contract_id: z14.union([z14.string(), z14.number()]).optional(),
|
|
1784
|
+
key_provider_mode: z14.enum(["kms", "local"]).optional(),
|
|
1785
|
+
skip_gateway: z14.boolean().optional(),
|
|
1786
|
+
env_keys: z14.array(z14.string()).optional(),
|
|
1603
1787
|
// Manual nonce specification (Advanced - PHALA KMS only)
|
|
1604
|
-
nonce:
|
|
1788
|
+
nonce: z14.number().optional(),
|
|
1605
1789
|
// User-specified nonce for deterministic app_id generation
|
|
1606
|
-
app_id:
|
|
1790
|
+
app_id: z14.string().optional()
|
|
1607
1791
|
// Expected app_id (must match calculated app_id from nonce)
|
|
1608
1792
|
}).passthrough().transform((data) => {
|
|
1609
1793
|
if (!data.instance_type && !data.vcpu && !data.memory) {
|
|
@@ -1635,59 +1819,90 @@ function handleGatewayCompatibility(appCompose) {
|
|
|
1635
1819
|
var { action: provisionCvm, safeAction: safeProvisionCvm } = defineAction(ProvisionCvmSchema, async (client, appCompose) => {
|
|
1636
1820
|
const validated = ProvisionCvmRequestSchema.parse(appCompose);
|
|
1637
1821
|
const body = handleGatewayCompatibility(validated);
|
|
1638
|
-
|
|
1639
|
-
if (typeof body.node_id === "number") {
|
|
1640
|
-
requestBody = { ...body, teepod_id: body.node_id };
|
|
1641
|
-
delete requestBody.node_id;
|
|
1642
|
-
} else if (typeof body.teepod_id === "number") {
|
|
1822
|
+
if (typeof body.teepod_id === "number" && typeof body.node_id !== "number") {
|
|
1643
1823
|
console.warn("[phala/cloud] teepod_id is deprecated, please use node_id instead.");
|
|
1644
1824
|
}
|
|
1645
|
-
return await client.post("/cvms/provision",
|
|
1825
|
+
return await client.post("/cvms/provision", body);
|
|
1646
1826
|
});
|
|
1647
1827
|
|
|
1648
1828
|
// src/actions/cvms/commit_cvm_provision.ts
|
|
1649
|
-
import { z as
|
|
1650
|
-
var
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
name: z14.string()
|
|
1829
|
+
import { z as z15 } from "zod";
|
|
1830
|
+
var CommitCvmProvisionBaseSchema = z15.object({
|
|
1831
|
+
name: z15.string(),
|
|
1832
|
+
status: z15.string(),
|
|
1833
|
+
teepod_id: z15.number(),
|
|
1834
|
+
teepod: z15.object({
|
|
1835
|
+
id: z15.number(),
|
|
1836
|
+
name: z15.string()
|
|
1658
1837
|
}).nullable(),
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
instance_id: z14.string().nullable(),
|
|
1838
|
+
app_id: z15.string().nullable(),
|
|
1839
|
+
vm_uuid: z15.string().nullable(),
|
|
1840
|
+
instance_id: z15.string().nullable(),
|
|
1663
1841
|
// Deprecated fields - will be removed in next API version
|
|
1664
|
-
app_url:
|
|
1665
|
-
base_image:
|
|
1666
|
-
vcpu:
|
|
1667
|
-
memory:
|
|
1668
|
-
disk_size:
|
|
1669
|
-
manifest_version:
|
|
1670
|
-
version:
|
|
1671
|
-
runner:
|
|
1672
|
-
docker_compose_file:
|
|
1673
|
-
features:
|
|
1674
|
-
created_at:
|
|
1675
|
-
encrypted_env_pubkey:
|
|
1676
|
-
app_auth_contract_address:
|
|
1677
|
-
deployer_address:
|
|
1678
|
-
}).passthrough();
|
|
1679
|
-
var CommitCvmProvisionRequestSchema = z14.object({
|
|
1680
|
-
encrypted_env: z14.string().optional().nullable(),
|
|
1681
|
-
app_id: z14.string(),
|
|
1682
|
-
compose_hash: z14.string(),
|
|
1683
|
-
kms_id: z14.string().optional(),
|
|
1684
|
-
contract_address: z14.string().optional(),
|
|
1685
|
-
deployer_address: z14.string().optional(),
|
|
1686
|
-
env_keys: z14.array(z14.string()).optional().nullable()
|
|
1842
|
+
app_url: z15.string().nullable().default(null),
|
|
1843
|
+
base_image: z15.string().nullable(),
|
|
1844
|
+
vcpu: z15.number(),
|
|
1845
|
+
memory: z15.number(),
|
|
1846
|
+
disk_size: z15.number(),
|
|
1847
|
+
manifest_version: z15.number().nullable().default(2),
|
|
1848
|
+
version: z15.string().nullable().default("1.0.0"),
|
|
1849
|
+
runner: z15.string().nullable().default("docker-compose"),
|
|
1850
|
+
docker_compose_file: z15.string().nullable(),
|
|
1851
|
+
features: z15.array(z15.string()).nullable().default(["kms", "tproxy-net"]),
|
|
1852
|
+
created_at: z15.string(),
|
|
1853
|
+
encrypted_env_pubkey: z15.string().nullable().optional(),
|
|
1854
|
+
app_auth_contract_address: z15.string().nullable().optional(),
|
|
1855
|
+
deployer_address: z15.string().nullable().optional()
|
|
1687
1856
|
}).passthrough();
|
|
1688
|
-
var
|
|
1689
|
-
|
|
1857
|
+
var CommitCvmProvisionV20260121Schema = CommitCvmProvisionBaseSchema.extend({
|
|
1858
|
+
id: z15.number(),
|
|
1859
|
+
user_id: z15.number().nullable()
|
|
1690
1860
|
});
|
|
1861
|
+
var CommitCvmProvisionV20260522Schema = CommitCvmProvisionBaseSchema.extend({
|
|
1862
|
+
id: z15.string(),
|
|
1863
|
+
user_id: z15.string().nullable()
|
|
1864
|
+
});
|
|
1865
|
+
var CommitCvmProvisionAnySchema = z15.union([
|
|
1866
|
+
CommitCvmProvisionV20260121Schema,
|
|
1867
|
+
CommitCvmProvisionV20260522Schema
|
|
1868
|
+
]);
|
|
1869
|
+
var CommitCvmProvisionSchema = CommitCvmProvisionV20260522Schema;
|
|
1870
|
+
var CommitCvmProvisionRequestSchema = z15.object({
|
|
1871
|
+
encrypted_env: z15.string().optional().nullable(),
|
|
1872
|
+
app_id: z15.string(),
|
|
1873
|
+
compose_hash: z15.string(),
|
|
1874
|
+
kms_id: z15.string().optional(),
|
|
1875
|
+
contract_address: z15.string().optional(),
|
|
1876
|
+
deployer_address: z15.string().optional(),
|
|
1877
|
+
env_keys: z15.array(z15.string()).optional().nullable()
|
|
1878
|
+
}).passthrough();
|
|
1879
|
+
function getSchemaForVersion5(version) {
|
|
1880
|
+
if (version === "2026-01-21") return CommitCvmProvisionV20260121Schema;
|
|
1881
|
+
return CommitCvmProvisionV20260522Schema;
|
|
1882
|
+
}
|
|
1883
|
+
async function commitCvmProvision(client, payload) {
|
|
1884
|
+
const response = await client.post("/cvms", payload);
|
|
1885
|
+
return getSchemaForVersion5(client.config.version).parse(
|
|
1886
|
+
response
|
|
1887
|
+
);
|
|
1888
|
+
}
|
|
1889
|
+
async function safeCommitCvmProvision(client, payload) {
|
|
1890
|
+
try {
|
|
1891
|
+
const data = await commitCvmProvision(client, payload);
|
|
1892
|
+
return { success: true, data };
|
|
1893
|
+
} catch (error) {
|
|
1894
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
1895
|
+
return { success: false, error };
|
|
1896
|
+
}
|
|
1897
|
+
return {
|
|
1898
|
+
success: false,
|
|
1899
|
+
error: {
|
|
1900
|
+
name: "Error",
|
|
1901
|
+
message: error instanceof Error ? error.message : String(error)
|
|
1902
|
+
}
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1691
1906
|
|
|
1692
1907
|
// src/utils/get_compose_hash.ts
|
|
1693
1908
|
import crypto from "crypto";
|
|
@@ -1749,20 +1964,20 @@ var { action: getCvmComposeFile, safeAction: safeGetCvmComposeFile } = defineAct
|
|
|
1749
1964
|
});
|
|
1750
1965
|
|
|
1751
1966
|
// src/actions/cvms/provision_cvm_compose_file_update.ts
|
|
1752
|
-
import { z as
|
|
1753
|
-
var ProvisionCvmComposeFileUpdateRequestSchema =
|
|
1754
|
-
id:
|
|
1755
|
-
uuid:
|
|
1756
|
-
app_id:
|
|
1967
|
+
import { z as z16 } from "zod";
|
|
1968
|
+
var ProvisionCvmComposeFileUpdateRequestSchema = z16.object({
|
|
1969
|
+
id: z16.string().optional(),
|
|
1970
|
+
uuid: z16.string().regex(/^[0-9a-f]{8}[-]?[0-9a-f]{4}[-]?4[0-9a-f]{3}[-]?[89ab][0-9a-f]{3}[-]?[0-9a-f]{12}$/i).optional(),
|
|
1971
|
+
app_id: z16.string().refine(
|
|
1757
1972
|
(val) => !val.startsWith("app_") && val.length === 40,
|
|
1758
1973
|
"app_id should be 40 characters without prefix"
|
|
1759
1974
|
).transform((val) => val.startsWith("app_") ? val : `app_${val}`).optional(),
|
|
1760
|
-
instance_id:
|
|
1975
|
+
instance_id: z16.string().refine(
|
|
1761
1976
|
(val) => !val.startsWith("instance_") && val.length === 40,
|
|
1762
1977
|
"instance_id should be 40 characters without prefix"
|
|
1763
1978
|
).transform((val) => val.startsWith("instance_") ? val : `instance_${val}`).optional(),
|
|
1764
1979
|
app_compose: LooseAppComposeSchema,
|
|
1765
|
-
update_env_vars:
|
|
1980
|
+
update_env_vars: z16.boolean().optional().nullable()
|
|
1766
1981
|
}).refine(
|
|
1767
1982
|
(data) => !!(data.id || data.uuid || data.app_id || data.instance_id),
|
|
1768
1983
|
"One of id, uuid, app_id, or instance_id must be provided"
|
|
@@ -1773,12 +1988,12 @@ var ProvisionCvmComposeFileUpdateRequestSchema = z15.object({
|
|
|
1773
1988
|
_raw: data
|
|
1774
1989
|
};
|
|
1775
1990
|
});
|
|
1776
|
-
var ProvisionCvmComposeFileUpdateResultSchema =
|
|
1777
|
-
app_id:
|
|
1778
|
-
device_id:
|
|
1779
|
-
compose_hash:
|
|
1991
|
+
var ProvisionCvmComposeFileUpdateResultSchema = z16.object({
|
|
1992
|
+
app_id: z16.string().nullable(),
|
|
1993
|
+
device_id: z16.string().nullable(),
|
|
1994
|
+
compose_hash: z16.string(),
|
|
1780
1995
|
kms_info: KmsInfoSchema.nullable().optional(),
|
|
1781
|
-
compose_hash_registered:
|
|
1996
|
+
compose_hash_registered: z16.boolean().optional().default(false)
|
|
1782
1997
|
}).passthrough();
|
|
1783
1998
|
var { action: provisionCvmComposeFileUpdate, safeAction: safeProvisionCvmComposeFileUpdate } = defineAction(ProvisionCvmComposeFileUpdateResultSchema, async (client, request) => {
|
|
1784
1999
|
const validatedRequest = ProvisionCvmComposeFileUpdateRequestSchema.parse(request);
|
|
@@ -1789,22 +2004,22 @@ var { action: provisionCvmComposeFileUpdate, safeAction: safeProvisionCvmCompose
|
|
|
1789
2004
|
});
|
|
1790
2005
|
|
|
1791
2006
|
// src/actions/cvms/commit_cvm_compose_file_update.ts
|
|
1792
|
-
import { z as
|
|
1793
|
-
var CommitCvmComposeFileUpdateRequestSchema =
|
|
1794
|
-
id:
|
|
1795
|
-
uuid:
|
|
1796
|
-
app_id:
|
|
2007
|
+
import { z as z17 } from "zod";
|
|
2008
|
+
var CommitCvmComposeFileUpdateRequestSchema = z17.object({
|
|
2009
|
+
id: z17.string().optional(),
|
|
2010
|
+
uuid: z17.string().regex(/^[0-9a-f]{8}[-]?[0-9a-f]{4}[-]?4[0-9a-f]{3}[-]?[89ab][0-9a-f]{3}[-]?[0-9a-f]{12}$/i).optional(),
|
|
2011
|
+
app_id: z17.string().refine(
|
|
1797
2012
|
(val) => !val.startsWith("app_") && val.length === 40,
|
|
1798
2013
|
"app_id should be 40 characters without prefix"
|
|
1799
2014
|
).transform((val) => val.startsWith("app_") ? val : `app_${val}`).optional(),
|
|
1800
|
-
instance_id:
|
|
2015
|
+
instance_id: z17.string().refine(
|
|
1801
2016
|
(val) => !val.startsWith("instance_") && val.length === 40,
|
|
1802
2017
|
"instance_id should be 40 characters without prefix"
|
|
1803
2018
|
).transform((val) => val.startsWith("instance_") ? val : `instance_${val}`).optional(),
|
|
1804
|
-
compose_hash:
|
|
1805
|
-
encrypted_env:
|
|
1806
|
-
env_keys:
|
|
1807
|
-
update_env_vars:
|
|
2019
|
+
compose_hash: z17.string().min(1, "Compose hash is required"),
|
|
2020
|
+
encrypted_env: z17.string().optional(),
|
|
2021
|
+
env_keys: z17.array(z17.string()).optional(),
|
|
2022
|
+
update_env_vars: z17.boolean().optional().nullable()
|
|
1808
2023
|
}).refine(
|
|
1809
2024
|
(data) => !!(data.id || data.uuid || data.app_id || data.instance_id),
|
|
1810
2025
|
"One of id, uuid, app_id, or instance_id must be provided"
|
|
@@ -1816,7 +2031,7 @@ var CommitCvmComposeFileUpdateRequestSchema = z16.object({
|
|
|
1816
2031
|
update_env_vars: data.update_env_vars ?? void 0,
|
|
1817
2032
|
_raw: data
|
|
1818
2033
|
}));
|
|
1819
|
-
var CommitCvmComposeFileUpdateSchema =
|
|
2034
|
+
var CommitCvmComposeFileUpdateSchema = z17.any().transform(() => void 0);
|
|
1820
2035
|
var { action: commitCvmComposeFileUpdate, safeAction: safeCommitCvmComposeFileUpdate } = defineAction(
|
|
1821
2036
|
CommitCvmComposeFileUpdateSchema,
|
|
1822
2037
|
async (client, request) => {
|
|
@@ -1831,13 +2046,13 @@ var { action: commitCvmComposeFileUpdate, safeAction: safeCommitCvmComposeFileUp
|
|
|
1831
2046
|
);
|
|
1832
2047
|
|
|
1833
2048
|
// src/actions/cvms/update_cvm_envs.ts
|
|
1834
|
-
import { z as
|
|
2049
|
+
import { z as z18 } from "zod";
|
|
1835
2050
|
var UpdateCvmEnvsRequestSchema = refineCvmId(
|
|
1836
2051
|
CvmIdObjectSchema.extend({
|
|
1837
|
-
encrypted_env:
|
|
1838
|
-
env_keys:
|
|
1839
|
-
compose_hash:
|
|
1840
|
-
transaction_hash:
|
|
2052
|
+
encrypted_env: z18.string().describe("Encrypted environment variables (hex string)"),
|
|
2053
|
+
env_keys: z18.array(z18.string()).optional().describe("List of allowed environment variable keys"),
|
|
2054
|
+
compose_hash: z18.string().optional().describe("Compose hash for verification (Phase 2, required when env_keys changes)"),
|
|
2055
|
+
transaction_hash: z18.string().optional().describe(
|
|
1841
2056
|
"On-chain transaction hash for verification (Phase 2, required when env_keys changes)"
|
|
1842
2057
|
)
|
|
1843
2058
|
})
|
|
@@ -1854,21 +2069,21 @@ var UpdateCvmEnvsRequestSchema = refineCvmId(
|
|
|
1854
2069
|
_raw: data
|
|
1855
2070
|
};
|
|
1856
2071
|
});
|
|
1857
|
-
var UpdateCvmEnvsInProgressSchema =
|
|
1858
|
-
status:
|
|
1859
|
-
message:
|
|
1860
|
-
correlation_id:
|
|
1861
|
-
allowed_envs_changed:
|
|
1862
|
-
});
|
|
1863
|
-
var UpdateCvmEnvsPreconditionRequiredSchema =
|
|
1864
|
-
status:
|
|
1865
|
-
message:
|
|
1866
|
-
compose_hash:
|
|
1867
|
-
app_id:
|
|
1868
|
-
device_id:
|
|
2072
|
+
var UpdateCvmEnvsInProgressSchema = z18.object({
|
|
2073
|
+
status: z18.literal("in_progress"),
|
|
2074
|
+
message: z18.string(),
|
|
2075
|
+
correlation_id: z18.string(),
|
|
2076
|
+
allowed_envs_changed: z18.boolean()
|
|
2077
|
+
});
|
|
2078
|
+
var UpdateCvmEnvsPreconditionRequiredSchema = z18.object({
|
|
2079
|
+
status: z18.literal("precondition_required"),
|
|
2080
|
+
message: z18.string(),
|
|
2081
|
+
compose_hash: z18.string(),
|
|
2082
|
+
app_id: z18.string(),
|
|
2083
|
+
device_id: z18.string(),
|
|
1869
2084
|
kms_info: KmsInfoSchema
|
|
1870
2085
|
});
|
|
1871
|
-
var UpdateCvmEnvsResultSchema =
|
|
2086
|
+
var UpdateCvmEnvsResultSchema = z18.union([
|
|
1872
2087
|
UpdateCvmEnvsInProgressSchema,
|
|
1873
2088
|
UpdateCvmEnvsPreconditionRequiredSchema
|
|
1874
2089
|
]);
|
|
@@ -1910,12 +2125,12 @@ var { action: updateCvmEnvs, safeAction: safeUpdateCvmEnvs } = defineAction(Upda
|
|
|
1910
2125
|
});
|
|
1911
2126
|
|
|
1912
2127
|
// src/actions/cvms/update_docker_compose.ts
|
|
1913
|
-
import { z as
|
|
2128
|
+
import { z as z19 } from "zod";
|
|
1914
2129
|
var UpdateDockerComposeRequestSchema = refineCvmId(
|
|
1915
2130
|
CvmIdObjectSchema.extend({
|
|
1916
|
-
docker_compose_file:
|
|
1917
|
-
compose_hash:
|
|
1918
|
-
transaction_hash:
|
|
2131
|
+
docker_compose_file: z19.string().describe("Docker Compose YAML content"),
|
|
2132
|
+
compose_hash: z19.string().optional().describe("Compose hash for verification (Phase 2, contract-owned KMS only)"),
|
|
2133
|
+
transaction_hash: z19.string().optional().describe("On-chain transaction hash for verification (Phase 2, contract-owned KMS only)")
|
|
1919
2134
|
})
|
|
1920
2135
|
).transform((data) => {
|
|
1921
2136
|
const { cvmId } = CvmIdSchema.parse(data);
|
|
@@ -1929,20 +2144,20 @@ var UpdateDockerComposeRequestSchema = refineCvmId(
|
|
|
1929
2144
|
_raw: data
|
|
1930
2145
|
};
|
|
1931
2146
|
});
|
|
1932
|
-
var UpdateDockerComposeInProgressSchema =
|
|
1933
|
-
status:
|
|
1934
|
-
message:
|
|
1935
|
-
correlation_id:
|
|
2147
|
+
var UpdateDockerComposeInProgressSchema = z19.object({
|
|
2148
|
+
status: z19.literal("in_progress"),
|
|
2149
|
+
message: z19.string(),
|
|
2150
|
+
correlation_id: z19.string()
|
|
1936
2151
|
});
|
|
1937
|
-
var UpdateDockerComposePreconditionRequiredSchema =
|
|
1938
|
-
status:
|
|
1939
|
-
message:
|
|
1940
|
-
compose_hash:
|
|
1941
|
-
app_id:
|
|
1942
|
-
device_id:
|
|
2152
|
+
var UpdateDockerComposePreconditionRequiredSchema = z19.object({
|
|
2153
|
+
status: z19.literal("precondition_required"),
|
|
2154
|
+
message: z19.string(),
|
|
2155
|
+
compose_hash: z19.string(),
|
|
2156
|
+
app_id: z19.string(),
|
|
2157
|
+
device_id: z19.string(),
|
|
1943
2158
|
kms_info: KmsInfoSchema
|
|
1944
2159
|
});
|
|
1945
|
-
var UpdateDockerComposeResultSchema =
|
|
2160
|
+
var UpdateDockerComposeResultSchema = z19.union([
|
|
1946
2161
|
UpdateDockerComposeInProgressSchema,
|
|
1947
2162
|
UpdateDockerComposePreconditionRequiredSchema
|
|
1948
2163
|
]);
|
|
@@ -1994,12 +2209,12 @@ var { action: updateDockerCompose, safeAction: safeUpdateDockerCompose } = defin
|
|
|
1994
2209
|
});
|
|
1995
2210
|
|
|
1996
2211
|
// src/actions/cvms/update_prelaunch_script.ts
|
|
1997
|
-
import { z as
|
|
2212
|
+
import { z as z20 } from "zod";
|
|
1998
2213
|
var UpdatePreLaunchScriptRequestSchema = refineCvmId(
|
|
1999
2214
|
CvmIdObjectSchema.extend({
|
|
2000
|
-
pre_launch_script:
|
|
2001
|
-
compose_hash:
|
|
2002
|
-
transaction_hash:
|
|
2215
|
+
pre_launch_script: z20.string().describe("Pre-launch script content (shell script)"),
|
|
2216
|
+
compose_hash: z20.string().optional().describe("Compose hash for verification (Phase 2, contract-owned KMS only)"),
|
|
2217
|
+
transaction_hash: z20.string().optional().describe("On-chain transaction hash for verification (Phase 2, contract-owned KMS only)")
|
|
2003
2218
|
})
|
|
2004
2219
|
).transform((data) => {
|
|
2005
2220
|
const { cvmId } = CvmIdSchema.parse(data);
|
|
@@ -2013,20 +2228,20 @@ var UpdatePreLaunchScriptRequestSchema = refineCvmId(
|
|
|
2013
2228
|
_raw: data
|
|
2014
2229
|
};
|
|
2015
2230
|
});
|
|
2016
|
-
var UpdatePreLaunchScriptInProgressSchema =
|
|
2017
|
-
status:
|
|
2018
|
-
message:
|
|
2019
|
-
correlation_id:
|
|
2020
|
-
});
|
|
2021
|
-
var UpdatePreLaunchScriptPreconditionRequiredSchema =
|
|
2022
|
-
status:
|
|
2023
|
-
message:
|
|
2024
|
-
compose_hash:
|
|
2025
|
-
app_id:
|
|
2026
|
-
device_id:
|
|
2231
|
+
var UpdatePreLaunchScriptInProgressSchema = z20.object({
|
|
2232
|
+
status: z20.literal("in_progress"),
|
|
2233
|
+
message: z20.string(),
|
|
2234
|
+
correlation_id: z20.string()
|
|
2235
|
+
});
|
|
2236
|
+
var UpdatePreLaunchScriptPreconditionRequiredSchema = z20.object({
|
|
2237
|
+
status: z20.literal("precondition_required"),
|
|
2238
|
+
message: z20.string(),
|
|
2239
|
+
compose_hash: z20.string(),
|
|
2240
|
+
app_id: z20.string(),
|
|
2241
|
+
device_id: z20.string(),
|
|
2027
2242
|
kms_info: KmsInfoSchema
|
|
2028
2243
|
});
|
|
2029
|
-
var UpdatePreLaunchScriptResultSchema =
|
|
2244
|
+
var UpdatePreLaunchScriptResultSchema = z20.union([
|
|
2030
2245
|
UpdatePreLaunchScriptInProgressSchema,
|
|
2031
2246
|
UpdatePreLaunchScriptPreconditionRequiredSchema
|
|
2032
2247
|
]);
|
|
@@ -2078,17 +2293,115 @@ var { action: updatePreLaunchScript, safeAction: safeUpdatePreLaunchScript } = d
|
|
|
2078
2293
|
});
|
|
2079
2294
|
|
|
2080
2295
|
// src/actions/cvms/get_cvm_prelaunch_script.ts
|
|
2081
|
-
import { z as
|
|
2296
|
+
import { z as z21 } from "zod";
|
|
2082
2297
|
var GetCvmPreLaunchScriptRequestSchema = CvmIdSchema;
|
|
2083
|
-
var { action: getCvmPreLaunchScript, safeAction: safeGetCvmPreLaunchScript } = defineAction(
|
|
2298
|
+
var { action: getCvmPreLaunchScript, safeAction: safeGetCvmPreLaunchScript } = defineAction(z21.string(), async (client, request) => {
|
|
2084
2299
|
const { cvmId } = GetCvmPreLaunchScriptRequestSchema.parse(request);
|
|
2085
2300
|
return await client.get(`/cvms/${cvmId}/pre-launch-script`);
|
|
2086
2301
|
});
|
|
2087
2302
|
|
|
2303
|
+
// src/actions/cvms/get_prelaunch_script_upgrade_status.ts
|
|
2304
|
+
import { z as z22 } from "zod";
|
|
2305
|
+
var GetPreLaunchScriptUpgradeStatusRequestSchema = CvmIdSchema;
|
|
2306
|
+
var PreLaunchScriptUpgradeStatusSchema = z22.object({
|
|
2307
|
+
current_hash: z22.string().nullable(),
|
|
2308
|
+
latest_official_hash: z22.string(),
|
|
2309
|
+
is_official: z22.boolean(),
|
|
2310
|
+
is_latest: z22.boolean(),
|
|
2311
|
+
can_upgrade: z22.boolean()
|
|
2312
|
+
});
|
|
2313
|
+
var { action: getPreLaunchScriptUpgradeStatus, safeAction: safeGetPreLaunchScriptUpgradeStatus } = defineAction(
|
|
2314
|
+
PreLaunchScriptUpgradeStatusSchema,
|
|
2315
|
+
async (client, request) => {
|
|
2316
|
+
const { cvmId } = GetPreLaunchScriptUpgradeStatusRequestSchema.parse(request);
|
|
2317
|
+
return await client.get(`/cvms/${cvmId}/pre-launch-script/upgrade-status`);
|
|
2318
|
+
}
|
|
2319
|
+
);
|
|
2320
|
+
|
|
2321
|
+
// src/actions/cvms/upgrade_prelaunch_script.ts
|
|
2322
|
+
import { z as z23 } from "zod";
|
|
2323
|
+
var UpgradePreLaunchScriptRequestSchema = refineCvmId(
|
|
2324
|
+
CvmIdObjectSchema.extend({
|
|
2325
|
+
compose_hash: z23.string().optional().describe("Compose hash for verification (Phase 2, contract-owned KMS only)"),
|
|
2326
|
+
transaction_hash: z23.string().optional().describe("On-chain transaction hash for verification (Phase 2, contract-owned KMS only)")
|
|
2327
|
+
})
|
|
2328
|
+
).transform((data) => {
|
|
2329
|
+
const { cvmId } = CvmIdSchema.parse(data);
|
|
2330
|
+
return {
|
|
2331
|
+
cvmId,
|
|
2332
|
+
request: {
|
|
2333
|
+
compose_hash: data.compose_hash,
|
|
2334
|
+
transaction_hash: data.transaction_hash
|
|
2335
|
+
},
|
|
2336
|
+
_raw: data
|
|
2337
|
+
};
|
|
2338
|
+
});
|
|
2339
|
+
var UpgradePreLaunchScriptInProgressSchema = z23.object({
|
|
2340
|
+
status: z23.literal("in_progress"),
|
|
2341
|
+
message: z23.string(),
|
|
2342
|
+
correlation_id: z23.string()
|
|
2343
|
+
});
|
|
2344
|
+
var UpgradePreLaunchScriptPreconditionRequiredSchema = z23.object({
|
|
2345
|
+
status: z23.literal("precondition_required"),
|
|
2346
|
+
message: z23.string(),
|
|
2347
|
+
compose_hash: z23.string(),
|
|
2348
|
+
app_id: z23.string(),
|
|
2349
|
+
device_id: z23.string(),
|
|
2350
|
+
kms_info: KmsInfoSchema
|
|
2351
|
+
});
|
|
2352
|
+
var UpgradePreLaunchScriptResultSchema = z23.union([
|
|
2353
|
+
UpgradePreLaunchScriptInProgressSchema,
|
|
2354
|
+
UpgradePreLaunchScriptPreconditionRequiredSchema
|
|
2355
|
+
]);
|
|
2356
|
+
var { action: upgradePreLaunchScript, safeAction: safeUpgradePreLaunchScript } = defineAction(UpgradePreLaunchScriptResultSchema, async (client, request) => {
|
|
2357
|
+
const validated = UpgradePreLaunchScriptRequestSchema.parse(request);
|
|
2358
|
+
const headers = {};
|
|
2359
|
+
if (validated.request.compose_hash) {
|
|
2360
|
+
headers["X-Compose-Hash"] = validated.request.compose_hash;
|
|
2361
|
+
}
|
|
2362
|
+
if (validated.request.transaction_hash) {
|
|
2363
|
+
headers["X-Transaction-Hash"] = validated.request.transaction_hash;
|
|
2364
|
+
}
|
|
2365
|
+
try {
|
|
2366
|
+
const response = await client.post(
|
|
2367
|
+
`/cvms/${validated.cvmId}/pre-launch-script/upgrade-to-latest-official`,
|
|
2368
|
+
void 0,
|
|
2369
|
+
{ headers }
|
|
2370
|
+
);
|
|
2371
|
+
return response;
|
|
2372
|
+
} catch (error) {
|
|
2373
|
+
if (error instanceof PhalaCloudError && error.status === 465) {
|
|
2374
|
+
const detail = error.detail;
|
|
2375
|
+
if (detail && typeof detail === "object") {
|
|
2376
|
+
const detailObj = detail;
|
|
2377
|
+
const detailsArray = detailObj.details;
|
|
2378
|
+
if (detailsArray && Array.isArray(detailsArray)) {
|
|
2379
|
+
const fieldMap = new Map(detailsArray.map((d) => [d.field, d.value]));
|
|
2380
|
+
const composeHash = fieldMap.get("compose_hash");
|
|
2381
|
+
const appId = fieldMap.get("app_id");
|
|
2382
|
+
const deviceId = fieldMap.get("device_id");
|
|
2383
|
+
const kmsInfo = fieldMap.get("kms_info");
|
|
2384
|
+
if (composeHash && appId) {
|
|
2385
|
+
return {
|
|
2386
|
+
status: "precondition_required",
|
|
2387
|
+
message: detailObj.message || "Compose hash verification required",
|
|
2388
|
+
compose_hash: composeHash,
|
|
2389
|
+
app_id: appId,
|
|
2390
|
+
device_id: deviceId || "",
|
|
2391
|
+
kms_info: kmsInfo
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
throw error;
|
|
2398
|
+
}
|
|
2399
|
+
});
|
|
2400
|
+
|
|
2088
2401
|
// src/actions/kms/get_kms_info.ts
|
|
2089
|
-
import { z as
|
|
2090
|
-
var GetKmsInfoRequestSchema =
|
|
2091
|
-
kms_id:
|
|
2402
|
+
import { z as z24 } from "zod";
|
|
2403
|
+
var GetKmsInfoRequestSchema = z24.object({
|
|
2404
|
+
kms_id: z24.string().min(1, "KMS ID is required")
|
|
2092
2405
|
});
|
|
2093
2406
|
var { action: getKmsInfo, safeAction: safeGetKmsInfo } = defineAction(KmsInfoSchema, async (client, request) => {
|
|
2094
2407
|
const validatedRequest = GetKmsInfoRequestSchema.parse(request);
|
|
@@ -2096,18 +2409,18 @@ var { action: getKmsInfo, safeAction: safeGetKmsInfo } = defineAction(KmsInfoSch
|
|
|
2096
2409
|
});
|
|
2097
2410
|
|
|
2098
2411
|
// src/actions/kms/get_kms_list.ts
|
|
2099
|
-
import { z as
|
|
2100
|
-
var GetKmsListRequestSchema =
|
|
2101
|
-
page:
|
|
2102
|
-
page_size:
|
|
2103
|
-
is_onchain:
|
|
2412
|
+
import { z as z25 } from "zod";
|
|
2413
|
+
var GetKmsListRequestSchema = z25.object({
|
|
2414
|
+
page: z25.number().int().min(1).optional(),
|
|
2415
|
+
page_size: z25.number().int().min(1).optional(),
|
|
2416
|
+
is_onchain: z25.boolean().optional()
|
|
2104
2417
|
}).strict();
|
|
2105
|
-
var GetKmsListSchema =
|
|
2106
|
-
items:
|
|
2107
|
-
total:
|
|
2108
|
-
page:
|
|
2109
|
-
page_size:
|
|
2110
|
-
pages:
|
|
2418
|
+
var GetKmsListSchema = z25.object({
|
|
2419
|
+
items: z25.array(KmsInfoSchema),
|
|
2420
|
+
total: z25.number(),
|
|
2421
|
+
page: z25.number(),
|
|
2422
|
+
page_size: z25.number(),
|
|
2423
|
+
pages: z25.number()
|
|
2111
2424
|
}).strict();
|
|
2112
2425
|
var { action: getKmsList, safeAction: safeGetKmsList } = defineAction(GetKmsListSchema, async (client, request) => {
|
|
2113
2426
|
const validatedRequest = GetKmsListRequestSchema.parse(request ?? {});
|
|
@@ -2115,17 +2428,17 @@ var { action: getKmsList, safeAction: safeGetKmsList } = defineAction(GetKmsList
|
|
|
2115
2428
|
});
|
|
2116
2429
|
|
|
2117
2430
|
// src/actions/kms/get_app_env_encrypt_pubkey.ts
|
|
2118
|
-
import { z as
|
|
2119
|
-
var GetAppEnvEncryptPubKeyRequestSchema =
|
|
2120
|
-
kms:
|
|
2121
|
-
app_id:
|
|
2431
|
+
import { z as z26 } from "zod";
|
|
2432
|
+
var GetAppEnvEncryptPubKeyRequestSchema = z26.object({
|
|
2433
|
+
kms: z26.string().min(1, "KMS ID or slug is required"),
|
|
2434
|
+
app_id: z26.string().refine(
|
|
2122
2435
|
(val) => val.length === 40 || val.startsWith("0x") && val.length === 42,
|
|
2123
2436
|
"App ID must be exactly 40 characters or 42 characters with 0x prefix"
|
|
2124
2437
|
)
|
|
2125
2438
|
}).strict();
|
|
2126
|
-
var GetAppEnvEncryptPubKeySchema =
|
|
2127
|
-
public_key:
|
|
2128
|
-
signature:
|
|
2439
|
+
var GetAppEnvEncryptPubKeySchema = z26.object({
|
|
2440
|
+
public_key: z26.string(),
|
|
2441
|
+
signature: z26.string()
|
|
2129
2442
|
}).strict();
|
|
2130
2443
|
var { action: getAppEnvEncryptPubKey, safeAction: safeGetAppEnvEncryptPubKey } = defineAction(GetAppEnvEncryptPubKeySchema, async (client, payload) => {
|
|
2131
2444
|
const validatedRequest = GetAppEnvEncryptPubKeyRequestSchema.parse(payload);
|
|
@@ -2133,15 +2446,15 @@ var { action: getAppEnvEncryptPubKey, safeAction: safeGetAppEnvEncryptPubKey } =
|
|
|
2133
2446
|
});
|
|
2134
2447
|
|
|
2135
2448
|
// src/actions/kms/next_app_ids.ts
|
|
2136
|
-
import { z as
|
|
2137
|
-
var NextAppIdsRequestSchema =
|
|
2138
|
-
counts:
|
|
2449
|
+
import { z as z27 } from "zod";
|
|
2450
|
+
var NextAppIdsRequestSchema = z27.object({
|
|
2451
|
+
counts: z27.number().int().min(1).max(20).optional().default(1)
|
|
2139
2452
|
}).strict();
|
|
2140
|
-
var NextAppIdsSchema =
|
|
2141
|
-
app_ids:
|
|
2142
|
-
|
|
2143
|
-
app_id:
|
|
2144
|
-
nonce:
|
|
2453
|
+
var NextAppIdsSchema = z27.object({
|
|
2454
|
+
app_ids: z27.array(
|
|
2455
|
+
z27.object({
|
|
2456
|
+
app_id: z27.string(),
|
|
2457
|
+
nonce: z27.number().int().min(0)
|
|
2145
2458
|
})
|
|
2146
2459
|
)
|
|
2147
2460
|
}).strict();
|
|
@@ -2153,78 +2466,159 @@ var { action: nextAppIds, safeAction: safeNextAppIds } = defineAction(NextAppIds
|
|
|
2153
2466
|
});
|
|
2154
2467
|
|
|
2155
2468
|
// src/types/cvm_info.ts
|
|
2156
|
-
import { z as
|
|
2157
|
-
var
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
region_identifier: z25.string().nullable().optional()
|
|
2469
|
+
import { z as z28 } from "zod";
|
|
2470
|
+
var VMBaseSchema = z28.object({
|
|
2471
|
+
name: z28.string(),
|
|
2472
|
+
status: z28.string(),
|
|
2473
|
+
teepod_id: z28.number(),
|
|
2474
|
+
teepod: z28.object({
|
|
2475
|
+
id: z28.number(),
|
|
2476
|
+
name: z28.string(),
|
|
2477
|
+
region_identifier: z28.string().nullable().optional()
|
|
2166
2478
|
}).optional().nullable(),
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2479
|
+
app_id: z28.string(),
|
|
2480
|
+
vm_uuid: z28.string().nullable(),
|
|
2481
|
+
instance_id: z28.string().nullable(),
|
|
2482
|
+
app_url: z28.string().optional().nullable(),
|
|
2483
|
+
base_image: z28.string().optional().nullable(),
|
|
2484
|
+
vcpu: z28.number(),
|
|
2485
|
+
memory: z28.number(),
|
|
2486
|
+
disk_size: z28.number(),
|
|
2487
|
+
manifest_version: z28.number().optional().nullable(),
|
|
2488
|
+
version: z28.string().optional().nullable(),
|
|
2489
|
+
runner: z28.string().optional().nullable(),
|
|
2490
|
+
docker_compose_file: z28.string().optional().nullable(),
|
|
2491
|
+
features: z28.array(z28.string()).optional().nullable(),
|
|
2492
|
+
created_at: z28.string(),
|
|
2493
|
+
encrypted_env_pubkey: z28.string().nullable()
|
|
2494
|
+
});
|
|
2495
|
+
var VMV20260121Schema = VMBaseSchema.extend({
|
|
2496
|
+
id: z28.number(),
|
|
2497
|
+
user_id: z28.number().optional().nullable()
|
|
2498
|
+
});
|
|
2499
|
+
var VMV20260522Schema = VMBaseSchema.extend({
|
|
2500
|
+
id: z28.string(),
|
|
2501
|
+
user_id: z28.string().optional().nullable()
|
|
2502
|
+
});
|
|
2503
|
+
var VMAnySchema = z28.union([VMV20260121Schema, VMV20260522Schema]);
|
|
2504
|
+
var VMSchema = VMV20260522Schema;
|
|
2505
|
+
function getVMSchemaForVersion(version) {
|
|
2506
|
+
if (version === "2026-01-21") return VMV20260121Schema;
|
|
2507
|
+
return VMV20260522Schema;
|
|
2508
|
+
}
|
|
2184
2509
|
|
|
2185
2510
|
// src/actions/cvms/start_cvm.ts
|
|
2186
2511
|
var StartCvmRequestSchema = CvmIdSchema;
|
|
2187
|
-
|
|
2512
|
+
async function startCvm(client, request) {
|
|
2188
2513
|
const { cvmId } = StartCvmRequestSchema.parse(request);
|
|
2189
|
-
|
|
2190
|
-
|
|
2514
|
+
const response = await client.post(`/cvms/${cvmId}/start`);
|
|
2515
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
2516
|
+
}
|
|
2517
|
+
async function safeStartCvm(client, request) {
|
|
2518
|
+
try {
|
|
2519
|
+
const data = await startCvm(client, request);
|
|
2520
|
+
return { success: true, data };
|
|
2521
|
+
} catch (error) {
|
|
2522
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2523
|
+
return { success: false, error };
|
|
2524
|
+
}
|
|
2525
|
+
return {
|
|
2526
|
+
success: false,
|
|
2527
|
+
error: {
|
|
2528
|
+
name: "Error",
|
|
2529
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2530
|
+
}
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2191
2534
|
|
|
2192
2535
|
// src/actions/cvms/stop_cvm.ts
|
|
2193
2536
|
var StopCvmRequestSchema = CvmIdSchema;
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2537
|
+
async function stopCvm(client, request) {
|
|
2538
|
+
const { cvmId } = StopCvmRequestSchema.parse(request);
|
|
2539
|
+
const response = await client.post(`/cvms/${cvmId}/stop`);
|
|
2540
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
2541
|
+
}
|
|
2542
|
+
async function safeStopCvm(client, request) {
|
|
2543
|
+
try {
|
|
2544
|
+
const data = await stopCvm(client, request);
|
|
2545
|
+
return { success: true, data };
|
|
2546
|
+
} catch (error) {
|
|
2547
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2548
|
+
return { success: false, error };
|
|
2549
|
+
}
|
|
2550
|
+
return {
|
|
2551
|
+
success: false,
|
|
2552
|
+
error: {
|
|
2553
|
+
name: "Error",
|
|
2554
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2555
|
+
}
|
|
2556
|
+
};
|
|
2199
2557
|
}
|
|
2200
|
-
|
|
2558
|
+
}
|
|
2201
2559
|
|
|
2202
2560
|
// src/actions/cvms/shutdown_cvm.ts
|
|
2203
2561
|
var ShutdownCvmRequestSchema = CvmIdSchema;
|
|
2204
|
-
|
|
2562
|
+
async function shutdownCvm(client, request) {
|
|
2205
2563
|
const { cvmId } = ShutdownCvmRequestSchema.parse(request);
|
|
2206
|
-
|
|
2207
|
-
|
|
2564
|
+
const response = await client.post(`/cvms/${cvmId}/shutdown`);
|
|
2565
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
2566
|
+
}
|
|
2567
|
+
async function safeShutdownCvm(client, request) {
|
|
2568
|
+
try {
|
|
2569
|
+
const data = await shutdownCvm(client, request);
|
|
2570
|
+
return { success: true, data };
|
|
2571
|
+
} catch (error) {
|
|
2572
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2573
|
+
return { success: false, error };
|
|
2574
|
+
}
|
|
2575
|
+
return {
|
|
2576
|
+
success: false,
|
|
2577
|
+
error: {
|
|
2578
|
+
name: "Error",
|
|
2579
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2580
|
+
}
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2208
2584
|
|
|
2209
2585
|
// src/actions/cvms/restart_cvm.ts
|
|
2210
|
-
import { z as
|
|
2586
|
+
import { z as z29 } from "zod";
|
|
2211
2587
|
var RestartCvmRequestSchema = refineCvmId(
|
|
2212
2588
|
CvmIdObjectSchema.extend({
|
|
2213
|
-
force:
|
|
2589
|
+
force: z29.boolean().optional()
|
|
2214
2590
|
})
|
|
2215
2591
|
);
|
|
2216
|
-
|
|
2592
|
+
async function restartCvm(client, request) {
|
|
2217
2593
|
const parsed = RestartCvmRequestSchema.parse(request);
|
|
2218
2594
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
2219
2595
|
const { force = false } = parsed;
|
|
2220
|
-
|
|
2221
|
-
|
|
2596
|
+
const response = await client.post(`/cvms/${cvmId}/restart`, { force });
|
|
2597
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
2598
|
+
}
|
|
2599
|
+
async function safeRestartCvm(client, request) {
|
|
2600
|
+
try {
|
|
2601
|
+
const data = await restartCvm(client, request);
|
|
2602
|
+
return { success: true, data };
|
|
2603
|
+
} catch (error) {
|
|
2604
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2605
|
+
return { success: false, error };
|
|
2606
|
+
}
|
|
2607
|
+
return {
|
|
2608
|
+
success: false,
|
|
2609
|
+
error: {
|
|
2610
|
+
name: "Error",
|
|
2611
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2612
|
+
}
|
|
2613
|
+
};
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2222
2616
|
|
|
2223
2617
|
// src/actions/cvms/delete_cvm.ts
|
|
2224
|
-
import { z as
|
|
2618
|
+
import { z as z30 } from "zod";
|
|
2225
2619
|
var DeleteCvmRequestSchema = CvmIdSchema;
|
|
2226
2620
|
var { action: deleteCvm, safeAction: safeDeleteCvm } = defineAction(
|
|
2227
|
-
|
|
2621
|
+
z30.void(),
|
|
2228
2622
|
async (client, request) => {
|
|
2229
2623
|
const { cvmId } = DeleteCvmRequestSchema.parse(request);
|
|
2230
2624
|
await client.delete(`/cvms/${cvmId}`);
|
|
@@ -2233,41 +2627,41 @@ var { action: deleteCvm, safeAction: safeDeleteCvm } = defineAction(
|
|
|
2233
2627
|
);
|
|
2234
2628
|
|
|
2235
2629
|
// src/actions/cvms/get_cvm_stats.ts
|
|
2236
|
-
import { z as
|
|
2237
|
-
var DiskInfoSchema =
|
|
2238
|
-
name:
|
|
2239
|
-
mount_point:
|
|
2240
|
-
total_size:
|
|
2241
|
-
free_size:
|
|
2242
|
-
});
|
|
2243
|
-
var SystemInfoSchema =
|
|
2244
|
-
os_name:
|
|
2245
|
-
os_version:
|
|
2246
|
-
kernel_version:
|
|
2247
|
-
cpu_model:
|
|
2248
|
-
num_cpus:
|
|
2249
|
-
total_memory:
|
|
2250
|
-
available_memory:
|
|
2251
|
-
used_memory:
|
|
2252
|
-
free_memory:
|
|
2253
|
-
total_swap:
|
|
2254
|
-
used_swap:
|
|
2255
|
-
free_swap:
|
|
2256
|
-
uptime:
|
|
2257
|
-
loadavg_one:
|
|
2258
|
-
loadavg_five:
|
|
2259
|
-
loadavg_fifteen:
|
|
2260
|
-
disks:
|
|
2261
|
-
});
|
|
2262
|
-
var CvmSystemInfoSchema =
|
|
2263
|
-
is_online:
|
|
2264
|
-
is_public:
|
|
2265
|
-
error:
|
|
2630
|
+
import { z as z31 } from "zod";
|
|
2631
|
+
var DiskInfoSchema = z31.object({
|
|
2632
|
+
name: z31.string(),
|
|
2633
|
+
mount_point: z31.string(),
|
|
2634
|
+
total_size: z31.number(),
|
|
2635
|
+
free_size: z31.number()
|
|
2636
|
+
});
|
|
2637
|
+
var SystemInfoSchema = z31.object({
|
|
2638
|
+
os_name: z31.string(),
|
|
2639
|
+
os_version: z31.string(),
|
|
2640
|
+
kernel_version: z31.string(),
|
|
2641
|
+
cpu_model: z31.string(),
|
|
2642
|
+
num_cpus: z31.number(),
|
|
2643
|
+
total_memory: z31.number(),
|
|
2644
|
+
available_memory: z31.number(),
|
|
2645
|
+
used_memory: z31.number(),
|
|
2646
|
+
free_memory: z31.number(),
|
|
2647
|
+
total_swap: z31.number(),
|
|
2648
|
+
used_swap: z31.number(),
|
|
2649
|
+
free_swap: z31.number(),
|
|
2650
|
+
uptime: z31.number(),
|
|
2651
|
+
loadavg_one: z31.number(),
|
|
2652
|
+
loadavg_five: z31.number(),
|
|
2653
|
+
loadavg_fifteen: z31.number(),
|
|
2654
|
+
disks: z31.array(DiskInfoSchema)
|
|
2655
|
+
});
|
|
2656
|
+
var CvmSystemInfoSchema = z31.object({
|
|
2657
|
+
is_online: z31.boolean(),
|
|
2658
|
+
is_public: z31.boolean().default(false),
|
|
2659
|
+
error: z31.string().nullable(),
|
|
2266
2660
|
sysinfo: SystemInfoSchema.nullable(),
|
|
2267
|
-
status:
|
|
2268
|
-
in_progress:
|
|
2269
|
-
boot_progress:
|
|
2270
|
-
boot_error:
|
|
2661
|
+
status: z31.string().nullable(),
|
|
2662
|
+
in_progress: z31.boolean().default(false),
|
|
2663
|
+
boot_progress: z31.string().nullable(),
|
|
2664
|
+
boot_error: z31.string().nullable()
|
|
2271
2665
|
});
|
|
2272
2666
|
var GetCvmStatsRequestSchema = CvmIdSchema;
|
|
2273
2667
|
var { action: getCvmStats, safeAction: safeGetCvmStats } = defineAction(CvmSystemInfoSchema, async (client, request) => {
|
|
@@ -2276,18 +2670,18 @@ var { action: getCvmStats, safeAction: safeGetCvmStats } = defineAction(CvmSyste
|
|
|
2276
2670
|
});
|
|
2277
2671
|
|
|
2278
2672
|
// src/actions/cvms/get_cvm_network.ts
|
|
2279
|
-
import { z as
|
|
2280
|
-
var CvmNetworkUrlsSchema =
|
|
2281
|
-
app:
|
|
2282
|
-
instance:
|
|
2283
|
-
});
|
|
2284
|
-
var CvmNetworkSchema =
|
|
2285
|
-
is_online:
|
|
2286
|
-
is_public:
|
|
2287
|
-
error:
|
|
2288
|
-
internal_ip:
|
|
2289
|
-
latest_handshake:
|
|
2290
|
-
public_urls:
|
|
2673
|
+
import { z as z32 } from "zod";
|
|
2674
|
+
var CvmNetworkUrlsSchema = z32.object({
|
|
2675
|
+
app: z32.string(),
|
|
2676
|
+
instance: z32.string()
|
|
2677
|
+
});
|
|
2678
|
+
var CvmNetworkSchema = z32.object({
|
|
2679
|
+
is_online: z32.boolean(),
|
|
2680
|
+
is_public: z32.boolean().default(true),
|
|
2681
|
+
error: z32.string().nullable(),
|
|
2682
|
+
internal_ip: z32.string().nullable(),
|
|
2683
|
+
latest_handshake: z32.string().nullable(),
|
|
2684
|
+
public_urls: z32.array(CvmNetworkUrlsSchema).nullable()
|
|
2291
2685
|
});
|
|
2292
2686
|
var GetCvmNetworkRequestSchema = CvmIdSchema;
|
|
2293
2687
|
var { action: getCvmNetwork, safeAction: safeGetCvmNetwork } = defineAction(CvmNetworkSchema, async (client, request) => {
|
|
@@ -2296,36 +2690,36 @@ var { action: getCvmNetwork, safeAction: safeGetCvmNetwork } = defineAction(CvmN
|
|
|
2296
2690
|
});
|
|
2297
2691
|
|
|
2298
2692
|
// src/actions/cvms/get_cvm_docker_compose.ts
|
|
2299
|
-
import { z as
|
|
2693
|
+
import { z as z33 } from "zod";
|
|
2300
2694
|
var GetCvmDockerComposeRequestSchema = CvmIdSchema;
|
|
2301
|
-
var { action: getCvmDockerCompose, safeAction: safeGetCvmDockerCompose } = defineAction(
|
|
2695
|
+
var { action: getCvmDockerCompose, safeAction: safeGetCvmDockerCompose } = defineAction(z33.string(), async (client, request) => {
|
|
2302
2696
|
const { cvmId } = GetCvmDockerComposeRequestSchema.parse(request);
|
|
2303
2697
|
return await client.get(`/cvms/${cvmId}/docker-compose.yml`);
|
|
2304
2698
|
});
|
|
2305
2699
|
|
|
2306
2700
|
// src/actions/cvms/get_cvm_containers_stats.ts
|
|
2307
|
-
import { z as
|
|
2308
|
-
var ContainerInfoSchema =
|
|
2309
|
-
id:
|
|
2310
|
-
names:
|
|
2311
|
-
image:
|
|
2312
|
-
image_id:
|
|
2313
|
-
command:
|
|
2314
|
-
created:
|
|
2315
|
-
state:
|
|
2316
|
-
status:
|
|
2317
|
-
log_endpoint:
|
|
2318
|
-
});
|
|
2319
|
-
var CvmContainersStatsSchema =
|
|
2320
|
-
is_online:
|
|
2321
|
-
is_public:
|
|
2322
|
-
error:
|
|
2323
|
-
docker_compose_file:
|
|
2324
|
-
manifest_version:
|
|
2325
|
-
version:
|
|
2326
|
-
runner:
|
|
2327
|
-
features:
|
|
2328
|
-
containers:
|
|
2701
|
+
import { z as z34 } from "zod";
|
|
2702
|
+
var ContainerInfoSchema = z34.object({
|
|
2703
|
+
id: z34.string(),
|
|
2704
|
+
names: z34.array(z34.string()),
|
|
2705
|
+
image: z34.string(),
|
|
2706
|
+
image_id: z34.string(),
|
|
2707
|
+
command: z34.string().nullable().optional(),
|
|
2708
|
+
created: z34.number(),
|
|
2709
|
+
state: z34.string(),
|
|
2710
|
+
status: z34.string(),
|
|
2711
|
+
log_endpoint: z34.string().nullable()
|
|
2712
|
+
});
|
|
2713
|
+
var CvmContainersStatsSchema = z34.object({
|
|
2714
|
+
is_online: z34.boolean(),
|
|
2715
|
+
is_public: z34.boolean().default(true),
|
|
2716
|
+
error: z34.string().nullable(),
|
|
2717
|
+
docker_compose_file: z34.string().nullable(),
|
|
2718
|
+
manifest_version: z34.number().nullable(),
|
|
2719
|
+
version: z34.string().nullable(),
|
|
2720
|
+
runner: z34.string().nullable(),
|
|
2721
|
+
features: z34.array(z34.string()).nullable(),
|
|
2722
|
+
containers: z34.array(ContainerInfoSchema).nullable()
|
|
2329
2723
|
});
|
|
2330
2724
|
var GetCvmContainersStatsRequestSchema = CvmIdSchema;
|
|
2331
2725
|
var { action: getCvmContainersStats, safeAction: safeGetCvmContainersStats } = defineAction(CvmContainersStatsSchema, async (client, request) => {
|
|
@@ -2334,62 +2728,62 @@ var { action: getCvmContainersStats, safeAction: safeGetCvmContainersStats } = d
|
|
|
2334
2728
|
});
|
|
2335
2729
|
|
|
2336
2730
|
// src/actions/cvms/get_cvm_attestation.ts
|
|
2337
|
-
import { z as
|
|
2338
|
-
var CertificateSubjectSchema =
|
|
2339
|
-
common_name:
|
|
2340
|
-
organization:
|
|
2341
|
-
country:
|
|
2342
|
-
state:
|
|
2343
|
-
locality:
|
|
2344
|
-
});
|
|
2345
|
-
var CertificateIssuerSchema =
|
|
2346
|
-
common_name:
|
|
2347
|
-
organization:
|
|
2348
|
-
country:
|
|
2349
|
-
});
|
|
2350
|
-
var CertificateSchema =
|
|
2731
|
+
import { z as z35 } from "zod";
|
|
2732
|
+
var CertificateSubjectSchema = z35.object({
|
|
2733
|
+
common_name: z35.string().nullable(),
|
|
2734
|
+
organization: z35.string().nullable(),
|
|
2735
|
+
country: z35.string().nullable(),
|
|
2736
|
+
state: z35.string().nullable(),
|
|
2737
|
+
locality: z35.string().nullable()
|
|
2738
|
+
});
|
|
2739
|
+
var CertificateIssuerSchema = z35.object({
|
|
2740
|
+
common_name: z35.string().nullable(),
|
|
2741
|
+
organization: z35.string().nullable(),
|
|
2742
|
+
country: z35.string().nullable()
|
|
2743
|
+
});
|
|
2744
|
+
var CertificateSchema = z35.object({
|
|
2351
2745
|
subject: CertificateSubjectSchema,
|
|
2352
2746
|
issuer: CertificateIssuerSchema,
|
|
2353
|
-
serial_number:
|
|
2354
|
-
not_before:
|
|
2747
|
+
serial_number: z35.string(),
|
|
2748
|
+
not_before: z35.string(),
|
|
2355
2749
|
// datetime serialized as ISO string
|
|
2356
|
-
not_after:
|
|
2750
|
+
not_after: z35.string(),
|
|
2357
2751
|
// datetime serialized as ISO string
|
|
2358
|
-
version:
|
|
2359
|
-
fingerprint:
|
|
2360
|
-
signature_algorithm:
|
|
2361
|
-
sans:
|
|
2362
|
-
is_ca:
|
|
2363
|
-
position_in_chain:
|
|
2364
|
-
quote:
|
|
2365
|
-
app_id:
|
|
2366
|
-
cert_usage:
|
|
2367
|
-
});
|
|
2368
|
-
var EventLogSchema =
|
|
2369
|
-
imr:
|
|
2370
|
-
event_type:
|
|
2371
|
-
digest:
|
|
2372
|
-
event:
|
|
2373
|
-
event_payload:
|
|
2374
|
-
});
|
|
2375
|
-
var TcbInfoSchema =
|
|
2376
|
-
mrtd:
|
|
2377
|
-
rootfs_hash:
|
|
2378
|
-
rtmr0:
|
|
2379
|
-
rtmr1:
|
|
2380
|
-
rtmr2:
|
|
2381
|
-
rtmr3:
|
|
2382
|
-
event_log:
|
|
2383
|
-
app_compose:
|
|
2384
|
-
});
|
|
2385
|
-
var CvmAttestationSchema =
|
|
2386
|
-
name:
|
|
2387
|
-
is_online:
|
|
2388
|
-
is_public:
|
|
2389
|
-
error:
|
|
2390
|
-
app_certificates:
|
|
2752
|
+
version: z35.string(),
|
|
2753
|
+
fingerprint: z35.string(),
|
|
2754
|
+
signature_algorithm: z35.string(),
|
|
2755
|
+
sans: z35.array(z35.string()).nullable(),
|
|
2756
|
+
is_ca: z35.boolean(),
|
|
2757
|
+
position_in_chain: z35.number().nullable(),
|
|
2758
|
+
quote: z35.string().nullable(),
|
|
2759
|
+
app_id: z35.string().nullable().optional(),
|
|
2760
|
+
cert_usage: z35.string().nullable().optional()
|
|
2761
|
+
});
|
|
2762
|
+
var EventLogSchema = z35.object({
|
|
2763
|
+
imr: z35.number(),
|
|
2764
|
+
event_type: z35.number(),
|
|
2765
|
+
digest: z35.string(),
|
|
2766
|
+
event: z35.string(),
|
|
2767
|
+
event_payload: z35.string()
|
|
2768
|
+
});
|
|
2769
|
+
var TcbInfoSchema = z35.object({
|
|
2770
|
+
mrtd: z35.string(),
|
|
2771
|
+
rootfs_hash: z35.string().nullable().optional(),
|
|
2772
|
+
rtmr0: z35.string(),
|
|
2773
|
+
rtmr1: z35.string(),
|
|
2774
|
+
rtmr2: z35.string(),
|
|
2775
|
+
rtmr3: z35.string(),
|
|
2776
|
+
event_log: z35.array(EventLogSchema),
|
|
2777
|
+
app_compose: z35.string()
|
|
2778
|
+
});
|
|
2779
|
+
var CvmAttestationSchema = z35.object({
|
|
2780
|
+
name: z35.string().nullable(),
|
|
2781
|
+
is_online: z35.boolean(),
|
|
2782
|
+
is_public: z35.boolean().default(true),
|
|
2783
|
+
error: z35.string().nullable(),
|
|
2784
|
+
app_certificates: z35.array(CertificateSchema).nullable(),
|
|
2391
2785
|
tcb_info: TcbInfoSchema.nullable(),
|
|
2392
|
-
compose_file:
|
|
2786
|
+
compose_file: z35.string().nullable()
|
|
2393
2787
|
});
|
|
2394
2788
|
var GetCvmAttestationRequestSchema = CvmIdSchema;
|
|
2395
2789
|
var { action: getCvmAttestation, safeAction: safeGetCvmAttestation } = defineAction(CvmAttestationSchema, async (client, request) => {
|
|
@@ -2398,17 +2792,17 @@ var { action: getCvmAttestation, safeAction: safeGetCvmAttestation } = defineAct
|
|
|
2398
2792
|
});
|
|
2399
2793
|
|
|
2400
2794
|
// src/actions/cvms/update_cvm_resources.ts
|
|
2401
|
-
import { z as
|
|
2795
|
+
import { z as z36 } from "zod";
|
|
2402
2796
|
var UpdateCvmResourcesRequestSchema = refineCvmId(
|
|
2403
2797
|
CvmIdObjectSchema.extend({
|
|
2404
|
-
vcpu:
|
|
2405
|
-
memory:
|
|
2406
|
-
disk_size:
|
|
2407
|
-
instance_type:
|
|
2408
|
-
allow_restart:
|
|
2798
|
+
vcpu: z36.number().optional(),
|
|
2799
|
+
memory: z36.number().optional(),
|
|
2800
|
+
disk_size: z36.number().optional(),
|
|
2801
|
+
instance_type: z36.string().optional(),
|
|
2802
|
+
allow_restart: z36.boolean().optional()
|
|
2409
2803
|
})
|
|
2410
2804
|
);
|
|
2411
|
-
var { action: updateCvmResources, safeAction: safeUpdateCvmResources } = defineAction(
|
|
2805
|
+
var { action: updateCvmResources, safeAction: safeUpdateCvmResources } = defineAction(z36.void(), async (client, request) => {
|
|
2412
2806
|
const parsed = UpdateCvmResourcesRequestSchema.parse(request);
|
|
2413
2807
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
2414
2808
|
const { ...body } = parsed;
|
|
@@ -2417,12 +2811,12 @@ var { action: updateCvmResources, safeAction: safeUpdateCvmResources } = defineA
|
|
|
2417
2811
|
});
|
|
2418
2812
|
|
|
2419
2813
|
// src/actions/cvms/update_cvm_visibility.ts
|
|
2420
|
-
import { z as
|
|
2814
|
+
import { z as z37 } from "zod";
|
|
2421
2815
|
var UpdateCvmVisibilityRequestSchema = refineCvmId(
|
|
2422
2816
|
CvmIdObjectSchema.extend({
|
|
2423
|
-
public_sysinfo:
|
|
2424
|
-
public_logs:
|
|
2425
|
-
public_tcbinfo:
|
|
2817
|
+
public_sysinfo: z37.boolean(),
|
|
2818
|
+
public_logs: z37.boolean(),
|
|
2819
|
+
public_tcbinfo: z37.boolean().optional()
|
|
2426
2820
|
})
|
|
2427
2821
|
);
|
|
2428
2822
|
var { action: updateCvmVisibility, safeAction: safeUpdateCvmVisibility } = defineAction(CvmDetailV20251028Schema, async (client, request) => {
|
|
@@ -2437,21 +2831,21 @@ var { action: updateCvmVisibility, safeAction: safeUpdateCvmVisibility } = defin
|
|
|
2437
2831
|
});
|
|
2438
2832
|
|
|
2439
2833
|
// src/actions/cvms/get_available_os_images.ts
|
|
2440
|
-
import { z as
|
|
2441
|
-
var OSImageVariantSchema =
|
|
2442
|
-
name:
|
|
2443
|
-
os_image_hash:
|
|
2444
|
-
is_current:
|
|
2445
|
-
});
|
|
2446
|
-
var
|
|
2447
|
-
version:
|
|
2448
|
-
|
|
2449
|
-
|
|
2834
|
+
import { z as z38 } from "zod";
|
|
2835
|
+
var OSImageVariantSchema = z38.object({
|
|
2836
|
+
name: z38.string(),
|
|
2837
|
+
os_image_hash: z38.string().nullable(),
|
|
2838
|
+
is_current: z38.boolean()
|
|
2839
|
+
});
|
|
2840
|
+
var AvailableOSImageSchema3 = z38.object({
|
|
2841
|
+
version: z38.union([
|
|
2842
|
+
z38.tuple([z38.number(), z38.number(), z38.number(), z38.number()]),
|
|
2843
|
+
z38.tuple([z38.number(), z38.number(), z38.number()])
|
|
2450
2844
|
]),
|
|
2451
2845
|
prod: OSImageVariantSchema.nullable(),
|
|
2452
2846
|
dev: OSImageVariantSchema.nullable()
|
|
2453
2847
|
});
|
|
2454
|
-
var GetAvailableOSImagesResponseSchema =
|
|
2848
|
+
var GetAvailableOSImagesResponseSchema = z38.array(AvailableOSImageSchema3);
|
|
2455
2849
|
var GetAvailableOSImagesRequestSchema = CvmIdSchema;
|
|
2456
2850
|
var { action: getAvailableOsImages, safeAction: safeGetAvailableOsImages } = defineAction(GetAvailableOSImagesResponseSchema, async (client, request) => {
|
|
2457
2851
|
const { cvmId } = GetAvailableOSImagesRequestSchema.parse(request);
|
|
@@ -2459,13 +2853,13 @@ var { action: getAvailableOsImages, safeAction: safeGetAvailableOsImages } = def
|
|
|
2459
2853
|
});
|
|
2460
2854
|
|
|
2461
2855
|
// src/actions/cvms/update_os_image.ts
|
|
2462
|
-
import { z as
|
|
2856
|
+
import { z as z39 } from "zod";
|
|
2463
2857
|
var UpdateOsImageRequestSchema = refineCvmId(
|
|
2464
2858
|
CvmIdObjectSchema.extend({
|
|
2465
|
-
os_image_name:
|
|
2859
|
+
os_image_name: z39.string().min(1, "OS image name is required")
|
|
2466
2860
|
})
|
|
2467
2861
|
);
|
|
2468
|
-
var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(
|
|
2862
|
+
var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(z39.void(), async (client, request) => {
|
|
2469
2863
|
const parsed = UpdateOsImageRequestSchema.parse(request);
|
|
2470
2864
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
2471
2865
|
const { os_image_name } = parsed;
|
|
@@ -2474,17 +2868,17 @@ var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(z36.
|
|
|
2474
2868
|
});
|
|
2475
2869
|
|
|
2476
2870
|
// src/actions/cvms/get_cvm_state.ts
|
|
2477
|
-
import { z as
|
|
2478
|
-
var CvmStateSchema =
|
|
2479
|
-
id:
|
|
2480
|
-
instance_id:
|
|
2481
|
-
name:
|
|
2482
|
-
status:
|
|
2483
|
-
uptime:
|
|
2484
|
-
exited_at:
|
|
2485
|
-
boot_progress:
|
|
2486
|
-
boot_error:
|
|
2487
|
-
shutdown_progress:
|
|
2871
|
+
import { z as z40 } from "zod";
|
|
2872
|
+
var CvmStateSchema = z40.object({
|
|
2873
|
+
id: z40.string().optional(),
|
|
2874
|
+
instance_id: z40.string().optional(),
|
|
2875
|
+
name: z40.string(),
|
|
2876
|
+
status: z40.string(),
|
|
2877
|
+
uptime: z40.string().optional(),
|
|
2878
|
+
exited_at: z40.string().optional(),
|
|
2879
|
+
boot_progress: z40.string().optional(),
|
|
2880
|
+
boot_error: z40.string().optional(),
|
|
2881
|
+
shutdown_progress: z40.string().optional()
|
|
2488
2882
|
});
|
|
2489
2883
|
var GetCvmStateRequestSchema = CvmIdSchema;
|
|
2490
2884
|
var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmStateSchema, async (client, request) => {
|
|
@@ -2493,21 +2887,21 @@ var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmState
|
|
|
2493
2887
|
});
|
|
2494
2888
|
|
|
2495
2889
|
// src/actions/ssh_keys/list_ssh_keys.ts
|
|
2496
|
-
import { z as
|
|
2497
|
-
var SshKeySchema =
|
|
2498
|
-
id:
|
|
2499
|
-
user_id:
|
|
2500
|
-
name:
|
|
2501
|
-
public_key:
|
|
2502
|
-
fingerprint:
|
|
2503
|
-
key_type:
|
|
2504
|
-
source:
|
|
2505
|
-
key_metadata:
|
|
2506
|
-
last_synced_at:
|
|
2507
|
-
created_at:
|
|
2508
|
-
updated_at:
|
|
2509
|
-
});
|
|
2510
|
-
var ListSshKeysResponseSchema =
|
|
2890
|
+
import { z as z41 } from "zod";
|
|
2891
|
+
var SshKeySchema = z41.object({
|
|
2892
|
+
id: z41.string(),
|
|
2893
|
+
user_id: z41.string(),
|
|
2894
|
+
name: z41.string(),
|
|
2895
|
+
public_key: z41.string(),
|
|
2896
|
+
fingerprint: z41.string(),
|
|
2897
|
+
key_type: z41.string(),
|
|
2898
|
+
source: z41.string(),
|
|
2899
|
+
key_metadata: z41.record(z41.unknown()).nullable().optional(),
|
|
2900
|
+
last_synced_at: z41.string().nullable().optional(),
|
|
2901
|
+
created_at: z41.string(),
|
|
2902
|
+
updated_at: z41.string()
|
|
2903
|
+
});
|
|
2904
|
+
var ListSshKeysResponseSchema = z41.array(SshKeySchema);
|
|
2511
2905
|
async function listSshKeys(client) {
|
|
2512
2906
|
const response = await client.get("/user/ssh-keys");
|
|
2513
2907
|
return ListSshKeysResponseSchema.parse(response);
|
|
@@ -2531,15 +2925,15 @@ async function safeListSshKeys(client) {
|
|
|
2531
2925
|
}
|
|
2532
2926
|
|
|
2533
2927
|
// src/actions/ssh_keys/import_github_profile.ts
|
|
2534
|
-
import { z as
|
|
2535
|
-
var ImportGithubProfileRequestSchema =
|
|
2536
|
-
github_username:
|
|
2928
|
+
import { z as z42 } from "zod";
|
|
2929
|
+
var ImportGithubProfileRequestSchema = z42.object({
|
|
2930
|
+
github_username: z42.string().min(1)
|
|
2537
2931
|
});
|
|
2538
|
-
var ImportGithubProfileResponseSchema =
|
|
2539
|
-
github_username:
|
|
2540
|
-
keys_added:
|
|
2541
|
-
keys_skipped:
|
|
2542
|
-
errors:
|
|
2932
|
+
var ImportGithubProfileResponseSchema = z42.object({
|
|
2933
|
+
github_username: z42.string(),
|
|
2934
|
+
keys_added: z42.number().int(),
|
|
2935
|
+
keys_skipped: z42.number().int(),
|
|
2936
|
+
errors: z42.array(z42.string()).default([])
|
|
2543
2937
|
});
|
|
2544
2938
|
var { action: importGithubProfileSshKeys, safeAction: safeImportGithubProfileSshKeys } = defineAction(
|
|
2545
2939
|
ImportGithubProfileResponseSchema,
|
|
@@ -2550,10 +2944,10 @@ var { action: importGithubProfileSshKeys, safeAction: safeImportGithubProfileSsh
|
|
|
2550
2944
|
);
|
|
2551
2945
|
|
|
2552
2946
|
// src/actions/ssh_keys/create_ssh_key.ts
|
|
2553
|
-
import { z as
|
|
2554
|
-
var CreateSshKeyRequestSchema =
|
|
2555
|
-
name:
|
|
2556
|
-
public_key:
|
|
2947
|
+
import { z as z43 } from "zod";
|
|
2948
|
+
var CreateSshKeyRequestSchema = z43.object({
|
|
2949
|
+
name: z43.string().min(1),
|
|
2950
|
+
public_key: z43.string().min(1)
|
|
2557
2951
|
});
|
|
2558
2952
|
var { action: createSshKey, safeAction: safeCreateSshKey } = defineAction(SshKeySchema, async (client, request) => {
|
|
2559
2953
|
const { name, public_key } = CreateSshKeyRequestSchema.parse(request);
|
|
@@ -2561,24 +2955,24 @@ var { action: createSshKey, safeAction: safeCreateSshKey } = defineAction(SshKey
|
|
|
2561
2955
|
});
|
|
2562
2956
|
|
|
2563
2957
|
// src/actions/ssh_keys/delete_ssh_key.ts
|
|
2564
|
-
import { z as
|
|
2565
|
-
var DeleteSshKeyRequestSchema =
|
|
2566
|
-
keyId:
|
|
2958
|
+
import { z as z44 } from "zod";
|
|
2959
|
+
var DeleteSshKeyRequestSchema = z44.object({
|
|
2960
|
+
keyId: z44.string().min(1)
|
|
2567
2961
|
});
|
|
2568
|
-
var { action: deleteSshKey, safeAction: safeDeleteSshKey } = defineAction(
|
|
2962
|
+
var { action: deleteSshKey, safeAction: safeDeleteSshKey } = defineAction(z44.void(), async (client, request) => {
|
|
2569
2963
|
const { keyId } = DeleteSshKeyRequestSchema.parse(request);
|
|
2570
2964
|
await client.delete(`/user/ssh-keys/${keyId}`);
|
|
2571
2965
|
return void 0;
|
|
2572
2966
|
});
|
|
2573
2967
|
|
|
2574
2968
|
// src/actions/ssh_keys/sync_github_ssh_keys.ts
|
|
2575
|
-
import { z as
|
|
2576
|
-
var SyncGithubSshKeysResponseSchema =
|
|
2577
|
-
synced_count:
|
|
2578
|
-
keys_added:
|
|
2579
|
-
keys_updated:
|
|
2580
|
-
keys_removed:
|
|
2581
|
-
errors:
|
|
2969
|
+
import { z as z45 } from "zod";
|
|
2970
|
+
var SyncGithubSshKeysResponseSchema = z45.object({
|
|
2971
|
+
synced_count: z45.number().int(),
|
|
2972
|
+
keys_added: z45.number().int(),
|
|
2973
|
+
keys_updated: z45.number().int(),
|
|
2974
|
+
keys_removed: z45.number().int(),
|
|
2975
|
+
errors: z45.array(z45.string()).default([])
|
|
2582
2976
|
});
|
|
2583
2977
|
var { action: syncGithubSshKeys, safeAction: safeSyncGithubSshKeys } = defineSimpleAction(
|
|
2584
2978
|
SyncGithubSshKeysResponseSchema,
|
|
@@ -2588,26 +2982,26 @@ var { action: syncGithubSshKeys, safeAction: safeSyncGithubSshKeys } = defineSim
|
|
|
2588
2982
|
);
|
|
2589
2983
|
|
|
2590
2984
|
// src/actions/os_images/get_os_images.ts
|
|
2591
|
-
import { z as
|
|
2592
|
-
var OSImagePublicSchema =
|
|
2593
|
-
name:
|
|
2594
|
-
slug:
|
|
2595
|
-
version:
|
|
2596
|
-
os_image_hash:
|
|
2597
|
-
is_dev:
|
|
2598
|
-
requires_gpu:
|
|
2985
|
+
import { z as z46 } from "zod";
|
|
2986
|
+
var OSImagePublicSchema = z46.object({
|
|
2987
|
+
name: z46.string(),
|
|
2988
|
+
slug: z46.string(),
|
|
2989
|
+
version: z46.string(),
|
|
2990
|
+
os_image_hash: z46.string().nullable(),
|
|
2991
|
+
is_dev: z46.boolean(),
|
|
2992
|
+
requires_gpu: z46.boolean()
|
|
2599
2993
|
}).passthrough();
|
|
2600
|
-
var GetOsImagesRequestSchema =
|
|
2601
|
-
page:
|
|
2602
|
-
page_size:
|
|
2603
|
-
is_dev:
|
|
2994
|
+
var GetOsImagesRequestSchema = z46.object({
|
|
2995
|
+
page: z46.number().int().min(1).optional(),
|
|
2996
|
+
page_size: z46.number().int().min(1).optional(),
|
|
2997
|
+
is_dev: z46.boolean().optional()
|
|
2604
2998
|
}).strict();
|
|
2605
|
-
var GetOsImagesResponseSchema =
|
|
2606
|
-
items:
|
|
2607
|
-
total:
|
|
2608
|
-
page:
|
|
2609
|
-
page_size:
|
|
2610
|
-
pages:
|
|
2999
|
+
var GetOsImagesResponseSchema = z46.object({
|
|
3000
|
+
items: z46.array(OSImagePublicSchema),
|
|
3001
|
+
total: z46.number(),
|
|
3002
|
+
page: z46.number(),
|
|
3003
|
+
page_size: z46.number(),
|
|
3004
|
+
pages: z46.number()
|
|
2611
3005
|
}).passthrough();
|
|
2612
3006
|
var { action: getOsImages, safeAction: safeGetOsImages } = defineAction(GetOsImagesResponseSchema, async (client, request) => {
|
|
2613
3007
|
const validatedRequest = GetOsImagesRequestSchema.parse(request ?? {});
|
|
@@ -2615,32 +3009,32 @@ var { action: getOsImages, safeAction: safeGetOsImages } = defineAction(GetOsIma
|
|
|
2615
3009
|
});
|
|
2616
3010
|
|
|
2617
3011
|
// src/actions/kms/get_kms_onchain_detail.ts
|
|
2618
|
-
import { z as
|
|
2619
|
-
var OnChainDeviceSchema =
|
|
2620
|
-
device_id:
|
|
2621
|
-
node_name:
|
|
2622
|
-
on_chain_allowed:
|
|
3012
|
+
import { z as z47 } from "zod";
|
|
3013
|
+
var OnChainDeviceSchema = z47.object({
|
|
3014
|
+
device_id: z47.string(),
|
|
3015
|
+
node_name: z47.string().nullable().optional(),
|
|
3016
|
+
on_chain_allowed: z47.boolean().nullable()
|
|
2623
3017
|
}).passthrough();
|
|
2624
|
-
var OnChainOsImageSchema =
|
|
2625
|
-
name:
|
|
2626
|
-
version:
|
|
2627
|
-
os_image_hash:
|
|
2628
|
-
on_chain_allowed:
|
|
3018
|
+
var OnChainOsImageSchema = z47.object({
|
|
3019
|
+
name: z47.string(),
|
|
3020
|
+
version: z47.string(),
|
|
3021
|
+
os_image_hash: z47.string().nullable(),
|
|
3022
|
+
on_chain_allowed: z47.boolean().nullable()
|
|
2629
3023
|
}).passthrough();
|
|
2630
|
-
var OnChainKmsContractSchema =
|
|
2631
|
-
contract_address:
|
|
2632
|
-
chain_id:
|
|
2633
|
-
chain_name:
|
|
2634
|
-
devices:
|
|
2635
|
-
os_images:
|
|
3024
|
+
var OnChainKmsContractSchema = z47.object({
|
|
3025
|
+
contract_address: z47.string(),
|
|
3026
|
+
chain_id: z47.number(),
|
|
3027
|
+
chain_name: z47.string(),
|
|
3028
|
+
devices: z47.array(OnChainDeviceSchema),
|
|
3029
|
+
os_images: z47.array(OnChainOsImageSchema)
|
|
2636
3030
|
}).passthrough();
|
|
2637
|
-
var GetKmsOnChainDetailResponseSchema =
|
|
2638
|
-
chain_name:
|
|
2639
|
-
chain_id:
|
|
2640
|
-
contracts:
|
|
3031
|
+
var GetKmsOnChainDetailResponseSchema = z47.object({
|
|
3032
|
+
chain_name: z47.string(),
|
|
3033
|
+
chain_id: z47.number(),
|
|
3034
|
+
contracts: z47.array(OnChainKmsContractSchema)
|
|
2641
3035
|
}).passthrough();
|
|
2642
|
-
var GetKmsOnChainDetailRequestSchema =
|
|
2643
|
-
chain:
|
|
3036
|
+
var GetKmsOnChainDetailRequestSchema = z47.object({
|
|
3037
|
+
chain: z47.string()
|
|
2644
3038
|
}).strict();
|
|
2645
3039
|
var { action: getKmsOnChainDetail, safeAction: safeGetKmsOnChainDetail } = defineAction(GetKmsOnChainDetailResponseSchema, async (client, request) => {
|
|
2646
3040
|
const { chain } = GetKmsOnChainDetailRequestSchema.parse(request);
|
|
@@ -2655,6 +3049,8 @@ function createClient2(config = {}) {
|
|
|
2655
3049
|
safeGetCurrentUser,
|
|
2656
3050
|
getAvailableNodes,
|
|
2657
3051
|
safeGetAvailableNodes,
|
|
3052
|
+
getCvmCreateResources,
|
|
3053
|
+
safeGetCvmCreateResources,
|
|
2658
3054
|
listAllInstanceTypeFamilies,
|
|
2659
3055
|
safeListAllInstanceTypeFamilies,
|
|
2660
3056
|
listFamilyInstanceTypes,
|
|
@@ -2685,6 +3081,10 @@ function createClient2(config = {}) {
|
|
|
2685
3081
|
safeUpdatePreLaunchScript,
|
|
2686
3082
|
getCvmPreLaunchScript,
|
|
2687
3083
|
safeGetCvmPreLaunchScript,
|
|
3084
|
+
getPreLaunchScriptUpgradeStatus,
|
|
3085
|
+
safeGetPreLaunchScriptUpgradeStatus,
|
|
3086
|
+
upgradePreLaunchScript,
|
|
3087
|
+
safeUpgradePreLaunchScript,
|
|
2688
3088
|
startCvm,
|
|
2689
3089
|
safeStartCvm,
|
|
2690
3090
|
stopCvm,
|
|
@@ -2742,161 +3142,139 @@ function createClient2(config = {}) {
|
|
|
2742
3142
|
}
|
|
2743
3143
|
|
|
2744
3144
|
// src/types/app_info_v20251028.ts
|
|
2745
|
-
import { z as
|
|
2746
|
-
var CvmBasicInfoV20251028Schema =
|
|
2747
|
-
vm_uuid:
|
|
2748
|
-
app_id:
|
|
2749
|
-
name:
|
|
2750
|
-
status:
|
|
2751
|
-
vcpu:
|
|
2752
|
-
memory:
|
|
2753
|
-
disk_size:
|
|
2754
|
-
teepod_id:
|
|
2755
|
-
teepod_name:
|
|
2756
|
-
region_identifier:
|
|
2757
|
-
kms_type:
|
|
2758
|
-
instance_type:
|
|
2759
|
-
listed:
|
|
2760
|
-
base_image:
|
|
2761
|
-
kms_slug:
|
|
2762
|
-
kms_id:
|
|
2763
|
-
instance_id:
|
|
3145
|
+
import { z as z48 } from "zod";
|
|
3146
|
+
var CvmBasicInfoV20251028Schema = z48.object({
|
|
3147
|
+
vm_uuid: z48.string().nullable(),
|
|
3148
|
+
app_id: z48.string(),
|
|
3149
|
+
name: z48.string().default(""),
|
|
3150
|
+
status: z48.string(),
|
|
3151
|
+
vcpu: z48.number().int(),
|
|
3152
|
+
memory: z48.number().int(),
|
|
3153
|
+
disk_size: z48.number().int(),
|
|
3154
|
+
teepod_id: z48.number().int(),
|
|
3155
|
+
teepod_name: z48.string(),
|
|
3156
|
+
region_identifier: z48.string().nullable().optional(),
|
|
3157
|
+
kms_type: z48.string().nullable().optional(),
|
|
3158
|
+
instance_type: z48.string().nullable().optional(),
|
|
3159
|
+
listed: z48.boolean().nullable().optional(),
|
|
3160
|
+
base_image: z48.string().nullable().optional(),
|
|
3161
|
+
kms_slug: z48.string().nullable().optional(),
|
|
3162
|
+
kms_id: z48.string().nullable().optional(),
|
|
3163
|
+
instance_id: z48.string().nullable().optional(),
|
|
2764
3164
|
machine_info: MachineInfoV20251028Schema.nullable().optional(),
|
|
2765
|
-
updated_at:
|
|
2766
|
-
});
|
|
2767
|
-
var AppProfileSchema =
|
|
2768
|
-
display_name:
|
|
2769
|
-
avatar_url:
|
|
2770
|
-
description:
|
|
2771
|
-
custom_domain:
|
|
2772
|
-
});
|
|
2773
|
-
var DstackAppFullResponseV20251028Schema =
|
|
2774
|
-
id:
|
|
2775
|
-
name:
|
|
2776
|
-
app_id:
|
|
2777
|
-
app_provision_type:
|
|
2778
|
-
app_icon_url:
|
|
2779
|
-
created_at:
|
|
2780
|
-
kms_type:
|
|
3165
|
+
updated_at: z48.string().nullable().optional()
|
|
3166
|
+
});
|
|
3167
|
+
var AppProfileSchema = z48.object({
|
|
3168
|
+
display_name: z48.string().nullable().optional(),
|
|
3169
|
+
avatar_url: z48.string().nullable().optional(),
|
|
3170
|
+
description: z48.string().nullable().optional(),
|
|
3171
|
+
custom_domain: z48.string().nullable().optional()
|
|
3172
|
+
});
|
|
3173
|
+
var DstackAppFullResponseV20251028Schema = z48.object({
|
|
3174
|
+
id: z48.string(),
|
|
3175
|
+
name: z48.string(),
|
|
3176
|
+
app_id: z48.string(),
|
|
3177
|
+
app_provision_type: z48.string().nullable().optional(),
|
|
3178
|
+
app_icon_url: z48.string().nullable().optional(),
|
|
3179
|
+
created_at: z48.string(),
|
|
3180
|
+
kms_type: z48.string(),
|
|
2781
3181
|
profile: AppProfileSchema.nullable().optional(),
|
|
2782
3182
|
current_cvm: CvmBasicInfoV20251028Schema.nullable().optional(),
|
|
2783
|
-
cvms:
|
|
2784
|
-
cvm_count:
|
|
2785
|
-
});
|
|
2786
|
-
var
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
kms_type: z45.null().optional(),
|
|
2794
|
-
current_cvm: z45.null().optional(),
|
|
2795
|
-
cvms: z45.null().optional(),
|
|
2796
|
-
cvm_count: z45.null().optional()
|
|
2797
|
-
});
|
|
2798
|
-
var DstackAppWithCvmResponseV20251028Schema = z45.union([
|
|
2799
|
-
DstackAppFullResponseV20251028Schema,
|
|
2800
|
-
DstackAppMinimalResponseV20251028Schema
|
|
2801
|
-
]);
|
|
2802
|
-
var DstackAppListResponseV20251028Schema = z45.object({
|
|
2803
|
-
dstack_apps: z45.array(DstackAppWithCvmResponseV20251028Schema),
|
|
2804
|
-
page: z45.number().int(),
|
|
2805
|
-
page_size: z45.number().int(),
|
|
2806
|
-
total: z45.number().int(),
|
|
2807
|
-
total_pages: z45.number().int()
|
|
3183
|
+
cvms: z48.array(CvmBasicInfoV20251028Schema).default([]),
|
|
3184
|
+
cvm_count: z48.number().int().default(0)
|
|
3185
|
+
});
|
|
3186
|
+
var DstackAppWithCvmResponseV20251028Schema = DstackAppFullResponseV20251028Schema;
|
|
3187
|
+
var DstackAppListResponseV20251028Schema = z48.object({
|
|
3188
|
+
dstack_apps: z48.array(DstackAppWithCvmResponseV20251028Schema),
|
|
3189
|
+
page: z48.number().int(),
|
|
3190
|
+
page_size: z48.number().int(),
|
|
3191
|
+
total: z48.number().int(),
|
|
3192
|
+
total_pages: z48.number().int()
|
|
2808
3193
|
});
|
|
2809
3194
|
|
|
2810
3195
|
// src/types/app_info_v20260121.ts
|
|
2811
|
-
import { z as
|
|
2812
|
-
var DstackAppFullResponseV20260121Schema =
|
|
2813
|
-
id:
|
|
2814
|
-
name:
|
|
2815
|
-
app_id:
|
|
2816
|
-
app_provision_type:
|
|
2817
|
-
app_icon_url:
|
|
2818
|
-
created_at:
|
|
2819
|
-
kms_type:
|
|
2820
|
-
profile:
|
|
2821
|
-
display_name:
|
|
2822
|
-
avatar_url:
|
|
2823
|
-
description:
|
|
2824
|
-
custom_domain:
|
|
3196
|
+
import { z as z49 } from "zod";
|
|
3197
|
+
var DstackAppFullResponseV20260121Schema = z49.object({
|
|
3198
|
+
id: z49.string(),
|
|
3199
|
+
name: z49.string(),
|
|
3200
|
+
app_id: z49.string(),
|
|
3201
|
+
app_provision_type: z49.string().nullable().optional(),
|
|
3202
|
+
app_icon_url: z49.string().nullable().optional(),
|
|
3203
|
+
created_at: z49.string(),
|
|
3204
|
+
kms_type: z49.string(),
|
|
3205
|
+
profile: z49.object({
|
|
3206
|
+
display_name: z49.string().nullable().optional(),
|
|
3207
|
+
avatar_url: z49.string().nullable().optional(),
|
|
3208
|
+
description: z49.string().nullable().optional(),
|
|
3209
|
+
custom_domain: z49.string().nullable().optional()
|
|
2825
3210
|
}).nullable().optional(),
|
|
2826
3211
|
current_cvm: CvmInfoV20260121Schema.nullable().optional(),
|
|
2827
|
-
cvms:
|
|
2828
|
-
cvm_count:
|
|
2829
|
-
});
|
|
2830
|
-
var
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
]);
|
|
2846
|
-
var DstackAppListResponseV20260121Schema = z46.object({
|
|
2847
|
-
dstack_apps: z46.array(DstackAppWithCvmResponseV20260121Schema),
|
|
2848
|
-
page: z46.number().int(),
|
|
2849
|
-
page_size: z46.number().int(),
|
|
2850
|
-
total: z46.number().int(),
|
|
2851
|
-
total_pages: z46.number().int()
|
|
3212
|
+
cvms: z49.array(CvmInfoV20260121Schema).default([]),
|
|
3213
|
+
cvm_count: z49.number().int().default(0)
|
|
3214
|
+
});
|
|
3215
|
+
var DstackAppFullResponseV20260522Schema = DstackAppFullResponseV20260121Schema.extend({
|
|
3216
|
+
current_cvm: CvmInfoV20260522Schema.nullable().optional(),
|
|
3217
|
+
cvms: z49.array(CvmInfoV20260522Schema).default([])
|
|
3218
|
+
});
|
|
3219
|
+
var DstackAppWithCvmResponseV20260121Schema = DstackAppFullResponseV20260121Schema;
|
|
3220
|
+
var DstackAppWithCvmResponseV20260522Schema = DstackAppFullResponseV20260522Schema;
|
|
3221
|
+
var DstackAppListResponseV20260121Schema = z49.object({
|
|
3222
|
+
dstack_apps: z49.array(DstackAppWithCvmResponseV20260121Schema),
|
|
3223
|
+
page: z49.number().int(),
|
|
3224
|
+
page_size: z49.number().int(),
|
|
3225
|
+
total: z49.number().int(),
|
|
3226
|
+
total_pages: z49.number().int()
|
|
3227
|
+
});
|
|
3228
|
+
var DstackAppListResponseV20260522Schema = DstackAppListResponseV20260121Schema.extend({
|
|
3229
|
+
dstack_apps: z49.array(DstackAppWithCvmResponseV20260522Schema)
|
|
2852
3230
|
});
|
|
2853
3231
|
|
|
2854
3232
|
// src/types/app_revision.ts
|
|
2855
|
-
import { z as
|
|
2856
|
-
var CvmRefSchema =
|
|
2857
|
-
object_type:
|
|
2858
|
-
id:
|
|
2859
|
-
name:
|
|
2860
|
-
app_id:
|
|
2861
|
-
vm_uuid:
|
|
2862
|
-
});
|
|
2863
|
-
var AppRevisionResponseSchema =
|
|
2864
|
-
revision_id:
|
|
2865
|
-
app_id:
|
|
2866
|
-
vm_uuid:
|
|
2867
|
-
compose_hash:
|
|
2868
|
-
created_at:
|
|
2869
|
-
trace_id:
|
|
2870
|
-
operation_type:
|
|
3233
|
+
import { z as z50 } from "zod";
|
|
3234
|
+
var CvmRefSchema = z50.object({
|
|
3235
|
+
object_type: z50.literal("cvm"),
|
|
3236
|
+
id: z50.string().nullable().optional(),
|
|
3237
|
+
name: z50.string().nullable().optional(),
|
|
3238
|
+
app_id: z50.string().nullable().optional(),
|
|
3239
|
+
vm_uuid: z50.string().nullable().optional()
|
|
3240
|
+
});
|
|
3241
|
+
var AppRevisionResponseSchema = z50.object({
|
|
3242
|
+
revision_id: z50.string(),
|
|
3243
|
+
app_id: z50.string(),
|
|
3244
|
+
vm_uuid: z50.string(),
|
|
3245
|
+
compose_hash: z50.string(),
|
|
3246
|
+
created_at: z50.string(),
|
|
3247
|
+
trace_id: z50.string().nullable().optional(),
|
|
3248
|
+
operation_type: z50.string(),
|
|
2871
3249
|
triggered_by: UserRefSchema.nullable().optional(),
|
|
2872
3250
|
cvm: CvmRefSchema.nullable().optional(),
|
|
2873
3251
|
workspace: WorkspaceRefSchema.nullable().optional()
|
|
2874
3252
|
});
|
|
2875
|
-
var AppRevisionDetailResponseSchema =
|
|
2876
|
-
revision_id:
|
|
2877
|
-
app_id:
|
|
2878
|
-
vm_uuid:
|
|
2879
|
-
compose_hash:
|
|
2880
|
-
compose_file:
|
|
2881
|
-
encrypted_env:
|
|
2882
|
-
user_config:
|
|
2883
|
-
created_at:
|
|
2884
|
-
trace_id:
|
|
2885
|
-
operation_type:
|
|
3253
|
+
var AppRevisionDetailResponseSchema = z50.object({
|
|
3254
|
+
revision_id: z50.string(),
|
|
3255
|
+
app_id: z50.string(),
|
|
3256
|
+
vm_uuid: z50.string(),
|
|
3257
|
+
compose_hash: z50.string(),
|
|
3258
|
+
compose_file: z50.union([z50.record(z50.any()), z50.string()]).nullable().optional(),
|
|
3259
|
+
encrypted_env: z50.string(),
|
|
3260
|
+
user_config: z50.string(),
|
|
3261
|
+
created_at: z50.string(),
|
|
3262
|
+
trace_id: z50.string().nullable().optional(),
|
|
3263
|
+
operation_type: z50.string(),
|
|
2886
3264
|
triggered_by: UserRefSchema.nullable().optional(),
|
|
2887
3265
|
cvm: CvmRefSchema.nullable().optional(),
|
|
2888
3266
|
workspace: WorkspaceRefSchema.nullable().optional()
|
|
2889
3267
|
});
|
|
2890
|
-
var AppRevisionsResponseSchema =
|
|
2891
|
-
revisions:
|
|
2892
|
-
total:
|
|
2893
|
-
page:
|
|
2894
|
-
page_size:
|
|
2895
|
-
total_pages:
|
|
3268
|
+
var AppRevisionsResponseSchema = z50.object({
|
|
3269
|
+
revisions: z50.array(AppRevisionResponseSchema),
|
|
3270
|
+
total: z50.number().int(),
|
|
3271
|
+
page: z50.number().int(),
|
|
3272
|
+
page_size: z50.number().int(),
|
|
3273
|
+
total_pages: z50.number().int()
|
|
2896
3274
|
});
|
|
2897
3275
|
|
|
2898
3276
|
// src/actions/blockchains/deploy_app_auth.ts
|
|
2899
|
-
import { z as
|
|
3277
|
+
import { z as z51 } from "zod";
|
|
2900
3278
|
import {
|
|
2901
3279
|
createPublicClient as createPublicClient2,
|
|
2902
3280
|
createWalletClient as createWalletClient2,
|
|
@@ -3602,25 +3980,25 @@ var kmsAuthAbi = [
|
|
|
3602
3980
|
anonymous: false
|
|
3603
3981
|
}
|
|
3604
3982
|
];
|
|
3605
|
-
var DeployAppAuthRequestBaseSchema =
|
|
3983
|
+
var DeployAppAuthRequestBaseSchema = z51.object({
|
|
3606
3984
|
// Chain configuration (conditionally required)
|
|
3607
|
-
chain:
|
|
3608
|
-
rpcUrl:
|
|
3985
|
+
chain: z51.unknown().optional(),
|
|
3986
|
+
rpcUrl: z51.string().optional(),
|
|
3609
3987
|
// Contract configuration (required)
|
|
3610
|
-
kmsContractAddress:
|
|
3988
|
+
kmsContractAddress: z51.string(),
|
|
3611
3989
|
// Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
|
|
3612
|
-
privateKey:
|
|
3613
|
-
walletClient:
|
|
3990
|
+
privateKey: z51.string().optional(),
|
|
3991
|
+
walletClient: z51.unknown().optional(),
|
|
3614
3992
|
// Public client (optional, will create default if not provided)
|
|
3615
|
-
publicClient:
|
|
3993
|
+
publicClient: z51.unknown().optional(),
|
|
3616
3994
|
// App configuration (optional)
|
|
3617
|
-
allowAnyDevice:
|
|
3618
|
-
deviceId:
|
|
3619
|
-
composeHash:
|
|
3620
|
-
disableUpgrades:
|
|
3995
|
+
allowAnyDevice: z51.boolean().optional().default(false),
|
|
3996
|
+
deviceId: z51.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
|
|
3997
|
+
composeHash: z51.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
|
|
3998
|
+
disableUpgrades: z51.boolean().optional().default(false),
|
|
3621
3999
|
// Validation configuration (optional)
|
|
3622
|
-
skipPrerequisiteChecks:
|
|
3623
|
-
minBalance:
|
|
4000
|
+
skipPrerequisiteChecks: z51.boolean().optional().default(false),
|
|
4001
|
+
minBalance: z51.string().optional()
|
|
3624
4002
|
// ETH amount as string, e.g., "0.01"
|
|
3625
4003
|
}).passthrough();
|
|
3626
4004
|
var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
|
|
@@ -3648,13 +4026,13 @@ var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
|
|
|
3648
4026
|
path: ["chain"]
|
|
3649
4027
|
}
|
|
3650
4028
|
);
|
|
3651
|
-
var DeployAppAuthSchema =
|
|
3652
|
-
appId:
|
|
3653
|
-
appAuthAddress:
|
|
3654
|
-
deployer:
|
|
3655
|
-
transactionHash:
|
|
3656
|
-
blockNumber:
|
|
3657
|
-
gasUsed:
|
|
4029
|
+
var DeployAppAuthSchema = z51.object({
|
|
4030
|
+
appId: z51.string(),
|
|
4031
|
+
appAuthAddress: z51.string(),
|
|
4032
|
+
deployer: z51.string(),
|
|
4033
|
+
transactionHash: z51.string(),
|
|
4034
|
+
blockNumber: z51.bigint().optional(),
|
|
4035
|
+
gasUsed: z51.bigint().optional()
|
|
3658
4036
|
}).passthrough();
|
|
3659
4037
|
function parseDeploymentResult(receipt, deployer, kmsContractAddress) {
|
|
3660
4038
|
try {
|
|
@@ -3900,7 +4278,7 @@ async function safeDeployAppAuth(request, parameters) {
|
|
|
3900
4278
|
}
|
|
3901
4279
|
|
|
3902
4280
|
// src/actions/blockchains/add_compose_hash.ts
|
|
3903
|
-
import { z as
|
|
4281
|
+
import { z as z52 } from "zod";
|
|
3904
4282
|
import {
|
|
3905
4283
|
createPublicClient as createPublicClient3,
|
|
3906
4284
|
createWalletClient as createWalletClient3,
|
|
@@ -3924,29 +4302,29 @@ var appAuthAbi = [
|
|
|
3924
4302
|
anonymous: false
|
|
3925
4303
|
}
|
|
3926
4304
|
];
|
|
3927
|
-
var AddComposeHashRequestSchema =
|
|
4305
|
+
var AddComposeHashRequestSchema = z52.object({
|
|
3928
4306
|
// Chain configuration (conditionally required)
|
|
3929
|
-
chain:
|
|
3930
|
-
rpcUrl:
|
|
3931
|
-
appId:
|
|
3932
|
-
composeHash:
|
|
4307
|
+
chain: z52.unknown().optional(),
|
|
4308
|
+
rpcUrl: z52.string().optional(),
|
|
4309
|
+
appId: z52.string(),
|
|
4310
|
+
composeHash: z52.string(),
|
|
3933
4311
|
// Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
|
|
3934
|
-
privateKey:
|
|
3935
|
-
walletClient:
|
|
4312
|
+
privateKey: z52.string().optional(),
|
|
4313
|
+
walletClient: z52.unknown().optional(),
|
|
3936
4314
|
// Public client (optional, will create default if not provided)
|
|
3937
|
-
publicClient:
|
|
4315
|
+
publicClient: z52.unknown().optional(),
|
|
3938
4316
|
// Validation configuration (optional)
|
|
3939
|
-
skipPrerequisiteChecks:
|
|
3940
|
-
minBalance:
|
|
4317
|
+
skipPrerequisiteChecks: z52.boolean().optional().default(false),
|
|
4318
|
+
minBalance: z52.string().optional(),
|
|
3941
4319
|
// ETH amount as string, e.g., "0.01"
|
|
3942
4320
|
// Transaction control options
|
|
3943
|
-
timeout:
|
|
3944
|
-
retryOptions:
|
|
3945
|
-
signal:
|
|
4321
|
+
timeout: z52.number().optional().default(12e4),
|
|
4322
|
+
retryOptions: z52.unknown().optional(),
|
|
4323
|
+
signal: z52.unknown().optional(),
|
|
3946
4324
|
// Progress callbacks
|
|
3947
|
-
onTransactionStateChange:
|
|
3948
|
-
onTransactionSubmitted:
|
|
3949
|
-
onTransactionConfirmed:
|
|
4325
|
+
onTransactionStateChange: z52.function().optional(),
|
|
4326
|
+
onTransactionSubmitted: z52.function().optional(),
|
|
4327
|
+
onTransactionConfirmed: z52.function().optional()
|
|
3950
4328
|
}).passthrough().refine(
|
|
3951
4329
|
(data) => {
|
|
3952
4330
|
const hasPrivateKey = !!data.privateKey;
|
|
@@ -3970,12 +4348,12 @@ var AddComposeHashRequestSchema = z49.object({
|
|
|
3970
4348
|
path: ["chain"]
|
|
3971
4349
|
}
|
|
3972
4350
|
);
|
|
3973
|
-
var AddComposeHashSchema =
|
|
3974
|
-
composeHash:
|
|
3975
|
-
appId:
|
|
3976
|
-
transactionHash:
|
|
3977
|
-
blockNumber:
|
|
3978
|
-
gasUsed:
|
|
4351
|
+
var AddComposeHashSchema = z52.object({
|
|
4352
|
+
composeHash: z52.string(),
|
|
4353
|
+
appId: z52.string(),
|
|
4354
|
+
transactionHash: z52.string(),
|
|
4355
|
+
blockNumber: z52.bigint().optional(),
|
|
4356
|
+
gasUsed: z52.bigint().optional()
|
|
3979
4357
|
}).passthrough();
|
|
3980
4358
|
function parseComposeHashResult(receipt, composeHash, appAuthAddress, appId) {
|
|
3981
4359
|
console.log(receipt.logs);
|
|
@@ -4185,7 +4563,7 @@ async function safeAddComposeHash(request, parameters) {
|
|
|
4185
4563
|
}
|
|
4186
4564
|
|
|
4187
4565
|
// src/actions/blockchains/add_device.ts
|
|
4188
|
-
import { z as
|
|
4566
|
+
import { z as z53 } from "zod";
|
|
4189
4567
|
import {
|
|
4190
4568
|
createPublicClient as createPublicClient4,
|
|
4191
4569
|
createWalletClient as createWalletClient4,
|
|
@@ -4280,22 +4658,22 @@ var dstackAppAbi = [
|
|
|
4280
4658
|
];
|
|
4281
4659
|
|
|
4282
4660
|
// src/actions/blockchains/add_device.ts
|
|
4283
|
-
var AddDeviceRequestSchema =
|
|
4284
|
-
chain:
|
|
4285
|
-
rpcUrl:
|
|
4286
|
-
appAddress:
|
|
4287
|
-
deviceId:
|
|
4288
|
-
privateKey:
|
|
4289
|
-
walletClient:
|
|
4290
|
-
publicClient:
|
|
4291
|
-
skipPrerequisiteChecks:
|
|
4292
|
-
minBalance:
|
|
4293
|
-
timeout:
|
|
4294
|
-
retryOptions:
|
|
4295
|
-
signal:
|
|
4296
|
-
onTransactionStateChange:
|
|
4297
|
-
onTransactionSubmitted:
|
|
4298
|
-
onTransactionConfirmed:
|
|
4661
|
+
var AddDeviceRequestSchema = z53.object({
|
|
4662
|
+
chain: z53.unknown().optional(),
|
|
4663
|
+
rpcUrl: z53.string().optional(),
|
|
4664
|
+
appAddress: z53.string(),
|
|
4665
|
+
deviceId: z53.string(),
|
|
4666
|
+
privateKey: z53.string().optional(),
|
|
4667
|
+
walletClient: z53.unknown().optional(),
|
|
4668
|
+
publicClient: z53.unknown().optional(),
|
|
4669
|
+
skipPrerequisiteChecks: z53.boolean().optional().default(false),
|
|
4670
|
+
minBalance: z53.string().optional(),
|
|
4671
|
+
timeout: z53.number().optional().default(12e4),
|
|
4672
|
+
retryOptions: z53.unknown().optional(),
|
|
4673
|
+
signal: z53.unknown().optional(),
|
|
4674
|
+
onTransactionStateChange: z53.function().optional(),
|
|
4675
|
+
onTransactionSubmitted: z53.function().optional(),
|
|
4676
|
+
onTransactionConfirmed: z53.function().optional()
|
|
4299
4677
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
4300
4678
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
4301
4679
|
path: ["privateKey", "walletClient"]
|
|
@@ -4309,12 +4687,12 @@ var AddDeviceRequestSchema = z50.object({
|
|
|
4309
4687
|
path: ["chain"]
|
|
4310
4688
|
}
|
|
4311
4689
|
);
|
|
4312
|
-
var AddDeviceSchema =
|
|
4313
|
-
appAddress:
|
|
4314
|
-
deviceId:
|
|
4315
|
-
transactionHash:
|
|
4316
|
-
blockNumber:
|
|
4317
|
-
gasUsed:
|
|
4690
|
+
var AddDeviceSchema = z53.object({
|
|
4691
|
+
appAddress: z53.string(),
|
|
4692
|
+
deviceId: z53.string(),
|
|
4693
|
+
transactionHash: z53.string(),
|
|
4694
|
+
blockNumber: z53.bigint().optional(),
|
|
4695
|
+
gasUsed: z53.bigint().optional()
|
|
4318
4696
|
}).passthrough();
|
|
4319
4697
|
async function addDevice(request, parameters) {
|
|
4320
4698
|
const validatedRequest = AddDeviceRequestSchema.parse(request);
|
|
@@ -4462,7 +4840,7 @@ async function safeAddDevice(request, parameters) {
|
|
|
4462
4840
|
}
|
|
4463
4841
|
|
|
4464
4842
|
// src/actions/blockchains/remove_device.ts
|
|
4465
|
-
import { z as
|
|
4843
|
+
import { z as z54 } from "zod";
|
|
4466
4844
|
import {
|
|
4467
4845
|
createPublicClient as createPublicClient5,
|
|
4468
4846
|
createWalletClient as createWalletClient5,
|
|
@@ -4470,22 +4848,22 @@ import {
|
|
|
4470
4848
|
parseEther as parseEther4
|
|
4471
4849
|
} from "viem";
|
|
4472
4850
|
import { privateKeyToAccount as privateKeyToAccount5 } from "viem/accounts";
|
|
4473
|
-
var RemoveDeviceRequestSchema =
|
|
4474
|
-
chain:
|
|
4475
|
-
rpcUrl:
|
|
4476
|
-
appAddress:
|
|
4477
|
-
deviceId:
|
|
4478
|
-
privateKey:
|
|
4479
|
-
walletClient:
|
|
4480
|
-
publicClient:
|
|
4481
|
-
skipPrerequisiteChecks:
|
|
4482
|
-
minBalance:
|
|
4483
|
-
timeout:
|
|
4484
|
-
retryOptions:
|
|
4485
|
-
signal:
|
|
4486
|
-
onTransactionStateChange:
|
|
4487
|
-
onTransactionSubmitted:
|
|
4488
|
-
onTransactionConfirmed:
|
|
4851
|
+
var RemoveDeviceRequestSchema = z54.object({
|
|
4852
|
+
chain: z54.unknown().optional(),
|
|
4853
|
+
rpcUrl: z54.string().optional(),
|
|
4854
|
+
appAddress: z54.string(),
|
|
4855
|
+
deviceId: z54.string(),
|
|
4856
|
+
privateKey: z54.string().optional(),
|
|
4857
|
+
walletClient: z54.unknown().optional(),
|
|
4858
|
+
publicClient: z54.unknown().optional(),
|
|
4859
|
+
skipPrerequisiteChecks: z54.boolean().optional().default(false),
|
|
4860
|
+
minBalance: z54.string().optional(),
|
|
4861
|
+
timeout: z54.number().optional().default(12e4),
|
|
4862
|
+
retryOptions: z54.unknown().optional(),
|
|
4863
|
+
signal: z54.unknown().optional(),
|
|
4864
|
+
onTransactionStateChange: z54.function().optional(),
|
|
4865
|
+
onTransactionSubmitted: z54.function().optional(),
|
|
4866
|
+
onTransactionConfirmed: z54.function().optional()
|
|
4489
4867
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
4490
4868
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
4491
4869
|
path: ["privateKey", "walletClient"]
|
|
@@ -4499,12 +4877,12 @@ var RemoveDeviceRequestSchema = z51.object({
|
|
|
4499
4877
|
path: ["chain"]
|
|
4500
4878
|
}
|
|
4501
4879
|
);
|
|
4502
|
-
var RemoveDeviceSchema =
|
|
4503
|
-
appAddress:
|
|
4504
|
-
deviceId:
|
|
4505
|
-
transactionHash:
|
|
4506
|
-
blockNumber:
|
|
4507
|
-
gasUsed:
|
|
4880
|
+
var RemoveDeviceSchema = z54.object({
|
|
4881
|
+
appAddress: z54.string(),
|
|
4882
|
+
deviceId: z54.string(),
|
|
4883
|
+
transactionHash: z54.string(),
|
|
4884
|
+
blockNumber: z54.bigint().optional(),
|
|
4885
|
+
gasUsed: z54.bigint().optional()
|
|
4508
4886
|
}).passthrough();
|
|
4509
4887
|
async function removeDevice(request, parameters) {
|
|
4510
4888
|
const validatedRequest = RemoveDeviceRequestSchema.parse(request);
|
|
@@ -4642,7 +5020,7 @@ async function safeRemoveDevice(request, parameters) {
|
|
|
4642
5020
|
}
|
|
4643
5021
|
|
|
4644
5022
|
// src/actions/blockchains/set_allow_any_device.ts
|
|
4645
|
-
import { z as
|
|
5023
|
+
import { z as z55 } from "zod";
|
|
4646
5024
|
import {
|
|
4647
5025
|
createPublicClient as createPublicClient6,
|
|
4648
5026
|
createWalletClient as createWalletClient6,
|
|
@@ -4650,22 +5028,22 @@ import {
|
|
|
4650
5028
|
parseEther as parseEther5
|
|
4651
5029
|
} from "viem";
|
|
4652
5030
|
import { privateKeyToAccount as privateKeyToAccount6 } from "viem/accounts";
|
|
4653
|
-
var SetAllowAnyDeviceRequestSchema =
|
|
4654
|
-
chain:
|
|
4655
|
-
rpcUrl:
|
|
4656
|
-
appAddress:
|
|
4657
|
-
allow:
|
|
4658
|
-
privateKey:
|
|
4659
|
-
walletClient:
|
|
4660
|
-
publicClient:
|
|
4661
|
-
skipPrerequisiteChecks:
|
|
4662
|
-
minBalance:
|
|
4663
|
-
timeout:
|
|
4664
|
-
retryOptions:
|
|
4665
|
-
signal:
|
|
4666
|
-
onTransactionStateChange:
|
|
4667
|
-
onTransactionSubmitted:
|
|
4668
|
-
onTransactionConfirmed:
|
|
5031
|
+
var SetAllowAnyDeviceRequestSchema = z55.object({
|
|
5032
|
+
chain: z55.unknown().optional(),
|
|
5033
|
+
rpcUrl: z55.string().optional(),
|
|
5034
|
+
appAddress: z55.string(),
|
|
5035
|
+
allow: z55.boolean(),
|
|
5036
|
+
privateKey: z55.string().optional(),
|
|
5037
|
+
walletClient: z55.unknown().optional(),
|
|
5038
|
+
publicClient: z55.unknown().optional(),
|
|
5039
|
+
skipPrerequisiteChecks: z55.boolean().optional().default(false),
|
|
5040
|
+
minBalance: z55.string().optional(),
|
|
5041
|
+
timeout: z55.number().optional().default(12e4),
|
|
5042
|
+
retryOptions: z55.unknown().optional(),
|
|
5043
|
+
signal: z55.unknown().optional(),
|
|
5044
|
+
onTransactionStateChange: z55.function().optional(),
|
|
5045
|
+
onTransactionSubmitted: z55.function().optional(),
|
|
5046
|
+
onTransactionConfirmed: z55.function().optional()
|
|
4669
5047
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
4670
5048
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
4671
5049
|
path: ["privateKey", "walletClient"]
|
|
@@ -4679,12 +5057,12 @@ var SetAllowAnyDeviceRequestSchema = z52.object({
|
|
|
4679
5057
|
path: ["chain"]
|
|
4680
5058
|
}
|
|
4681
5059
|
);
|
|
4682
|
-
var SetAllowAnyDeviceSchema =
|
|
4683
|
-
appAddress:
|
|
4684
|
-
allow:
|
|
4685
|
-
transactionHash:
|
|
4686
|
-
blockNumber:
|
|
4687
|
-
gasUsed:
|
|
5060
|
+
var SetAllowAnyDeviceSchema = z55.object({
|
|
5061
|
+
appAddress: z55.string(),
|
|
5062
|
+
allow: z55.boolean(),
|
|
5063
|
+
transactionHash: z55.string(),
|
|
5064
|
+
blockNumber: z55.bigint().optional(),
|
|
5065
|
+
gasUsed: z55.bigint().optional()
|
|
4688
5066
|
}).passthrough();
|
|
4689
5067
|
async function setAllowAnyDevice(request, parameters) {
|
|
4690
5068
|
const validatedRequest = SetAllowAnyDeviceRequestSchema.parse(request);
|
|
@@ -4821,13 +5199,13 @@ async function safeSetAllowAnyDevice(request, parameters) {
|
|
|
4821
5199
|
}
|
|
4822
5200
|
|
|
4823
5201
|
// src/actions/blockchains/get_allowed_devices.ts
|
|
4824
|
-
import { z as
|
|
5202
|
+
import { z as z56 } from "zod";
|
|
4825
5203
|
import { createPublicClient as createPublicClient7, http as http7 } from "viem";
|
|
4826
|
-
var GetAllowedDevicesSchema =
|
|
4827
|
-
appAddress:
|
|
4828
|
-
owner:
|
|
4829
|
-
allowAnyDevice:
|
|
4830
|
-
devices:
|
|
5204
|
+
var GetAllowedDevicesSchema = z56.object({
|
|
5205
|
+
appAddress: z56.string(),
|
|
5206
|
+
owner: z56.string(),
|
|
5207
|
+
allowAnyDevice: z56.boolean(),
|
|
5208
|
+
devices: z56.array(z56.string())
|
|
4831
5209
|
});
|
|
4832
5210
|
async function getAllowedDevices(request) {
|
|
4833
5211
|
const { chain, rpcUrl, appAddress, deviceIds, publicClient: providedPublicClient } = request;
|
|
@@ -5021,15 +5399,15 @@ async function safeCheckOnChainPrerequisites(request) {
|
|
|
5021
5399
|
}
|
|
5022
5400
|
|
|
5023
5401
|
// src/actions/workspaces/get_workspace_nodes.ts
|
|
5024
|
-
import { z as
|
|
5402
|
+
import { z as z57 } from "zod";
|
|
5025
5403
|
var NodeRefSchema2 = NodeRefSchema;
|
|
5026
5404
|
var NodeInfoSchema = NodeRefSchema2;
|
|
5027
|
-
var GetWorkspaceNodesSchema =
|
|
5028
|
-
items:
|
|
5029
|
-
total:
|
|
5030
|
-
page:
|
|
5031
|
-
page_size:
|
|
5032
|
-
pages:
|
|
5405
|
+
var GetWorkspaceNodesSchema = z57.object({
|
|
5406
|
+
items: z57.array(NodeRefSchema2),
|
|
5407
|
+
total: z57.number(),
|
|
5408
|
+
page: z57.number(),
|
|
5409
|
+
page_size: z57.number(),
|
|
5410
|
+
pages: z57.number()
|
|
5033
5411
|
}).passthrough();
|
|
5034
5412
|
var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAction(GetWorkspaceNodesSchema, async (client, request) => {
|
|
5035
5413
|
const { teamSlug, page, pageSize } = request;
|
|
@@ -5041,56 +5419,74 @@ var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAct
|
|
|
5041
5419
|
});
|
|
5042
5420
|
|
|
5043
5421
|
// src/actions/workspaces/get_workspace_quotas.ts
|
|
5044
|
-
import { z as
|
|
5045
|
-
var QuotaMetricSchema =
|
|
5046
|
-
limit:
|
|
5047
|
-
remaining:
|
|
5422
|
+
import { z as z58 } from "zod";
|
|
5423
|
+
var QuotaMetricSchema = z58.object({
|
|
5424
|
+
limit: z58.number(),
|
|
5425
|
+
remaining: z58.number()
|
|
5048
5426
|
}).passthrough();
|
|
5049
|
-
var WorkspaceQuotasSchema =
|
|
5427
|
+
var WorkspaceQuotasSchema = z58.object({
|
|
5050
5428
|
vm_slots: QuotaMetricSchema,
|
|
5051
5429
|
vcpu: QuotaMetricSchema,
|
|
5052
5430
|
memory_mb: QuotaMetricSchema,
|
|
5053
5431
|
disk_gb: QuotaMetricSchema
|
|
5054
5432
|
}).passthrough();
|
|
5055
|
-
var WorkspaceReservedGpuQuotaSchema =
|
|
5433
|
+
var WorkspaceReservedGpuQuotaSchema = z58.object({
|
|
5056
5434
|
gpus: QuotaMetricSchema,
|
|
5057
|
-
in_use:
|
|
5058
|
-
misconfigured:
|
|
5435
|
+
in_use: z58.number(),
|
|
5436
|
+
misconfigured: z58.number()
|
|
5059
5437
|
}).passthrough();
|
|
5060
|
-
var GetWorkspaceQuotasSchema =
|
|
5061
|
-
team_slug:
|
|
5062
|
-
tier:
|
|
5438
|
+
var GetWorkspaceQuotasSchema = z58.object({
|
|
5439
|
+
team_slug: z58.string(),
|
|
5440
|
+
tier: z58.string(),
|
|
5063
5441
|
quotas: WorkspaceQuotasSchema,
|
|
5064
5442
|
reserved_nodes: QuotaMetricSchema,
|
|
5065
5443
|
reserved_gpu: WorkspaceReservedGpuQuotaSchema,
|
|
5066
|
-
as_of:
|
|
5444
|
+
as_of: z58.string()
|
|
5067
5445
|
}).passthrough();
|
|
5068
5446
|
var { action: getWorkspaceQuotas, safeAction: safeGetWorkspaceQuotas } = defineAction(GetWorkspaceQuotasSchema, async (client, request) => {
|
|
5069
5447
|
return await client.get(`/workspaces/${request.teamSlug}/quotas`);
|
|
5070
5448
|
});
|
|
5071
5449
|
|
|
5072
5450
|
// src/actions/cvms/replicate_cvm.ts
|
|
5073
|
-
import { z as
|
|
5451
|
+
import { z as z59 } from "zod";
|
|
5074
5452
|
var ReplicateCvmRequestSchema = refineCvmId(
|
|
5075
5453
|
CvmIdObjectSchema.extend({
|
|
5076
|
-
node_id:
|
|
5454
|
+
node_id: z59.number().optional()
|
|
5077
5455
|
})
|
|
5078
5456
|
);
|
|
5079
|
-
|
|
5457
|
+
async function replicateCvm(client, request) {
|
|
5080
5458
|
const parsed = ReplicateCvmRequestSchema.parse(request);
|
|
5081
5459
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5082
5460
|
const { node_id } = parsed;
|
|
5083
|
-
|
|
5084
|
-
|
|
5461
|
+
const response = await client.post(`/cvms/${cvmId}/replicas`, { node_id });
|
|
5462
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
5463
|
+
}
|
|
5464
|
+
async function safeReplicateCvm(client, request) {
|
|
5465
|
+
try {
|
|
5466
|
+
const data = await replicateCvm(client, request);
|
|
5467
|
+
return { success: true, data };
|
|
5468
|
+
} catch (error) {
|
|
5469
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
5470
|
+
return { success: false, error };
|
|
5471
|
+
}
|
|
5472
|
+
return {
|
|
5473
|
+
success: false,
|
|
5474
|
+
error: {
|
|
5475
|
+
name: "Error",
|
|
5476
|
+
message: error instanceof Error ? error.message : String(error)
|
|
5477
|
+
}
|
|
5478
|
+
};
|
|
5479
|
+
}
|
|
5480
|
+
}
|
|
5085
5481
|
|
|
5086
5482
|
// src/actions/cvms/watch_cvm_state.ts
|
|
5087
|
-
import { z as
|
|
5088
|
-
var WatchCvmStateParamsSchema =
|
|
5089
|
-
target:
|
|
5090
|
-
interval:
|
|
5091
|
-
timeout:
|
|
5092
|
-
maxRetries:
|
|
5093
|
-
retryDelay:
|
|
5483
|
+
import { z as z60 } from "zod";
|
|
5484
|
+
var WatchCvmStateParamsSchema = z60.object({
|
|
5485
|
+
target: z60.string().describe("Target status to wait for (e.g., 'running', 'stopped')"),
|
|
5486
|
+
interval: z60.number().min(5).max(30).default(5).describe("Polling interval in seconds"),
|
|
5487
|
+
timeout: z60.number().min(10).max(600).default(300).describe("Timeout per attempt in seconds"),
|
|
5488
|
+
maxRetries: z60.number().min(0).default(Number.POSITIVE_INFINITY).describe("Maximum number of retry attempts (Infinity for unlimited)"),
|
|
5489
|
+
retryDelay: z60.number().min(0).default(5e3).describe("Delay between retries in milliseconds")
|
|
5094
5490
|
});
|
|
5095
5491
|
var WatchCvmStateRequestSchema = WatchCvmStateParamsSchema;
|
|
5096
5492
|
var WatchAbortedError = class extends Error {
|
|
@@ -5278,57 +5674,57 @@ function sleep(ms, signal) {
|
|
|
5278
5674
|
}
|
|
5279
5675
|
|
|
5280
5676
|
// src/actions/cvms/patch_cvm.ts
|
|
5281
|
-
import { z as
|
|
5677
|
+
import { z as z61 } from "zod";
|
|
5282
5678
|
var PatchCvmRequestSchema = refineCvmId(
|
|
5283
5679
|
CvmIdObjectSchema.extend({
|
|
5284
5680
|
// Compose-hash-affecting fields
|
|
5285
|
-
docker_compose_file:
|
|
5286
|
-
pre_launch_script:
|
|
5287
|
-
allowed_envs:
|
|
5681
|
+
docker_compose_file: z61.string().optional(),
|
|
5682
|
+
pre_launch_script: z61.string().optional(),
|
|
5683
|
+
allowed_envs: z61.array(z61.string()).optional(),
|
|
5288
5684
|
// Visibility
|
|
5289
|
-
public_logs:
|
|
5290
|
-
public_sysinfo:
|
|
5291
|
-
public_tcbinfo:
|
|
5685
|
+
public_logs: z61.boolean().optional(),
|
|
5686
|
+
public_sysinfo: z61.boolean().optional(),
|
|
5687
|
+
public_tcbinfo: z61.boolean().optional(),
|
|
5292
5688
|
// Non-compose-hash config
|
|
5293
|
-
encrypted_env:
|
|
5294
|
-
user_config:
|
|
5295
|
-
gpus:
|
|
5296
|
-
count:
|
|
5297
|
-
product_name:
|
|
5689
|
+
encrypted_env: z61.string().optional(),
|
|
5690
|
+
user_config: z61.string().optional(),
|
|
5691
|
+
gpus: z61.object({
|
|
5692
|
+
count: z61.number(),
|
|
5693
|
+
product_name: z61.string().optional()
|
|
5298
5694
|
}).optional(),
|
|
5299
5695
|
// Resources
|
|
5300
|
-
vcpu:
|
|
5301
|
-
memory:
|
|
5302
|
-
disk_size:
|
|
5696
|
+
vcpu: z61.number().optional(),
|
|
5697
|
+
memory: z61.number().optional(),
|
|
5698
|
+
disk_size: z61.number().optional(),
|
|
5303
5699
|
// OS image
|
|
5304
|
-
image:
|
|
5700
|
+
image: z61.string().optional(),
|
|
5305
5701
|
// Shutdown behavior
|
|
5306
|
-
shutdown_timeout:
|
|
5307
|
-
allow_force_stop:
|
|
5702
|
+
shutdown_timeout: z61.number().optional(),
|
|
5703
|
+
allow_force_stop: z61.boolean().optional(),
|
|
5308
5704
|
// Prepare-only mode (for multisig workflows)
|
|
5309
|
-
prepareOnly:
|
|
5705
|
+
prepareOnly: z61.boolean().optional()
|
|
5310
5706
|
})
|
|
5311
5707
|
);
|
|
5312
|
-
var PatchCvmAcceptedSchema =
|
|
5313
|
-
requiresOnChainHash:
|
|
5314
|
-
correlationId:
|
|
5315
|
-
});
|
|
5316
|
-
var PatchCvmHashRequiredSchema =
|
|
5317
|
-
requiresOnChainHash:
|
|
5318
|
-
composeHash:
|
|
5319
|
-
appId:
|
|
5320
|
-
deviceId:
|
|
5708
|
+
var PatchCvmAcceptedSchema = z61.object({
|
|
5709
|
+
requiresOnChainHash: z61.literal(false),
|
|
5710
|
+
correlationId: z61.string()
|
|
5711
|
+
});
|
|
5712
|
+
var PatchCvmHashRequiredSchema = z61.object({
|
|
5713
|
+
requiresOnChainHash: z61.literal(true),
|
|
5714
|
+
composeHash: z61.string(),
|
|
5715
|
+
appId: z61.string(),
|
|
5716
|
+
deviceId: z61.string(),
|
|
5321
5717
|
kmsInfo: KmsInfoSchema,
|
|
5322
|
-
commitToken:
|
|
5323
|
-
commitUrl:
|
|
5324
|
-
apiCommitUrl:
|
|
5325
|
-
onchainStatus:
|
|
5326
|
-
compose_hash_allowed:
|
|
5327
|
-
device_id_allowed:
|
|
5328
|
-
is_allowed:
|
|
5718
|
+
commitToken: z61.string().optional(),
|
|
5719
|
+
commitUrl: z61.string().optional(),
|
|
5720
|
+
apiCommitUrl: z61.string().optional(),
|
|
5721
|
+
onchainStatus: z61.object({
|
|
5722
|
+
compose_hash_allowed: z61.boolean(),
|
|
5723
|
+
device_id_allowed: z61.boolean(),
|
|
5724
|
+
is_allowed: z61.boolean()
|
|
5329
5725
|
}).optional()
|
|
5330
5726
|
});
|
|
5331
|
-
var PatchCvmResultSchema =
|
|
5727
|
+
var PatchCvmResultSchema = z61.discriminatedUnion("requiresOnChainHash", [
|
|
5332
5728
|
PatchCvmAcceptedSchema,
|
|
5333
5729
|
PatchCvmHashRequiredSchema
|
|
5334
5730
|
]);
|
|
@@ -5377,15 +5773,15 @@ var { action: patchCvm, safeAction: safePatchCvm } = defineAction(PatchCvmResult
|
|
|
5377
5773
|
});
|
|
5378
5774
|
|
|
5379
5775
|
// src/actions/cvms/confirm_cvm_patch.ts
|
|
5380
|
-
import { z as
|
|
5776
|
+
import { z as z62 } from "zod";
|
|
5381
5777
|
var ConfirmCvmPatchRequestSchema = refineCvmId(
|
|
5382
5778
|
CvmIdObjectSchema.extend({
|
|
5383
|
-
composeHash:
|
|
5384
|
-
transactionHash:
|
|
5779
|
+
composeHash: z62.string().describe("Compose hash from patchCvm Phase 1 response"),
|
|
5780
|
+
transactionHash: z62.string().describe("Transaction hash proving on-chain registration")
|
|
5385
5781
|
})
|
|
5386
5782
|
);
|
|
5387
|
-
var ConfirmCvmPatchResultSchema =
|
|
5388
|
-
correlationId:
|
|
5783
|
+
var ConfirmCvmPatchResultSchema = z62.object({
|
|
5784
|
+
correlationId: z62.string()
|
|
5389
5785
|
});
|
|
5390
5786
|
var { action: confirmCvmPatch, safeAction: safeConfirmCvmPatch } = defineAction(ConfirmCvmPatchResultSchema, async (client, request) => {
|
|
5391
5787
|
const parsed = ConfirmCvmPatchRequestSchema.parse(request);
|
|
@@ -5406,17 +5802,17 @@ var { action: confirmCvmPatch, safeAction: safeConfirmCvmPatch } = defineAction(
|
|
|
5406
5802
|
});
|
|
5407
5803
|
|
|
5408
5804
|
// src/actions/cvms/commit_cvm_update.ts
|
|
5409
|
-
import { z as
|
|
5805
|
+
import { z as z63 } from "zod";
|
|
5410
5806
|
var CommitCvmUpdateRequestSchema = refineCvmId(
|
|
5411
5807
|
CvmIdObjectSchema.extend({
|
|
5412
|
-
token:
|
|
5413
|
-
composeHash:
|
|
5414
|
-
transactionHash:
|
|
5808
|
+
token: z63.string().describe("One-time commit token from prepare-only flow"),
|
|
5809
|
+
composeHash: z63.string().describe("Compose hash from Phase 1 response"),
|
|
5810
|
+
transactionHash: z63.string().describe("Transaction hash proving on-chain registration")
|
|
5415
5811
|
})
|
|
5416
5812
|
);
|
|
5417
|
-
var CommitCvmUpdateResultSchema =
|
|
5418
|
-
correlationId:
|
|
5419
|
-
status:
|
|
5813
|
+
var CommitCvmUpdateResultSchema = z63.object({
|
|
5814
|
+
correlationId: z63.string(),
|
|
5815
|
+
status: z63.string()
|
|
5420
5816
|
});
|
|
5421
5817
|
var { action: commitCvmUpdate, safeAction: safeCommitCvmUpdate } = defineAction(CommitCvmUpdateResultSchema, async (client, request) => {
|
|
5422
5818
|
const parsed = CommitCvmUpdateRequestSchema.parse(request);
|
|
@@ -5433,74 +5829,140 @@ var { action: commitCvmUpdate, safeAction: safeCommitCvmUpdate } = defineAction(
|
|
|
5433
5829
|
});
|
|
5434
5830
|
|
|
5435
5831
|
// src/actions/cvms/refresh_cvm_instance_id.ts
|
|
5436
|
-
import { z as
|
|
5437
|
-
var
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5832
|
+
import { z as z64 } from "zod";
|
|
5833
|
+
var InstanceIdRefreshResultBaseSchema = z64.object({
|
|
5834
|
+
identifier: z64.string(),
|
|
5835
|
+
status: z64.enum(["updated", "unchanged", "skipped", "conflict", "error"]),
|
|
5836
|
+
old_instance_id: z64.string().nullable().optional(),
|
|
5837
|
+
new_instance_id: z64.string().nullable().optional(),
|
|
5838
|
+
source: z64.enum(["teepod_state", "teepod_info", "gateway", "none"]),
|
|
5839
|
+
verified_with_gateway: z64.boolean(),
|
|
5840
|
+
reason: z64.string().nullable().optional()
|
|
5841
|
+
});
|
|
5842
|
+
var InstanceIdRefreshResultV20260121Schema = InstanceIdRefreshResultBaseSchema.extend({
|
|
5843
|
+
cvm_id: z64.number().nullable()
|
|
5844
|
+
});
|
|
5845
|
+
var InstanceIdRefreshResultV20260522Schema = InstanceIdRefreshResultBaseSchema.extend({
|
|
5846
|
+
cvm_id: z64.string().nullable()
|
|
5847
|
+
});
|
|
5848
|
+
var InstanceIdRefreshResultAnySchema = z64.union([
|
|
5849
|
+
InstanceIdRefreshResultV20260121Schema,
|
|
5850
|
+
InstanceIdRefreshResultV20260522Schema
|
|
5851
|
+
]);
|
|
5852
|
+
var InstanceIdRefreshResultSchema = InstanceIdRefreshResultV20260522Schema;
|
|
5447
5853
|
var RefreshCvmInstanceIdRequestSchema = refineCvmId(
|
|
5448
5854
|
CvmIdObjectSchema.extend({
|
|
5449
|
-
overwrite:
|
|
5450
|
-
dry_run:
|
|
5855
|
+
overwrite: z64.boolean().optional(),
|
|
5856
|
+
dry_run: z64.boolean().optional()
|
|
5451
5857
|
})
|
|
5452
5858
|
);
|
|
5453
|
-
|
|
5859
|
+
function getSchemaForVersion6(version) {
|
|
5860
|
+
if (version === "2026-01-21") return InstanceIdRefreshResultV20260121Schema;
|
|
5861
|
+
return InstanceIdRefreshResultV20260522Schema;
|
|
5862
|
+
}
|
|
5863
|
+
async function refreshCvmInstanceId(client, request) {
|
|
5454
5864
|
const parsed = RefreshCvmInstanceIdRequestSchema.parse(request);
|
|
5455
5865
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5456
5866
|
const { overwrite, dry_run } = parsed;
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
}
|
|
5867
|
+
const response = await client.patch(`/cvms/${cvmId}/instance-id`, { overwrite, dry_run });
|
|
5868
|
+
return getSchemaForVersion6(client.config.version).parse(
|
|
5869
|
+
response
|
|
5870
|
+
);
|
|
5871
|
+
}
|
|
5872
|
+
async function safeRefreshCvmInstanceId(client, request) {
|
|
5873
|
+
try {
|
|
5874
|
+
const data = await refreshCvmInstanceId(client, request);
|
|
5875
|
+
return { success: true, data };
|
|
5876
|
+
} catch (error) {
|
|
5877
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
5878
|
+
return { success: false, error };
|
|
5879
|
+
}
|
|
5880
|
+
return {
|
|
5881
|
+
success: false,
|
|
5882
|
+
error: {
|
|
5883
|
+
name: "Error",
|
|
5884
|
+
message: error instanceof Error ? error.message : String(error)
|
|
5885
|
+
}
|
|
5886
|
+
};
|
|
5887
|
+
}
|
|
5888
|
+
}
|
|
5462
5889
|
|
|
5463
5890
|
// src/actions/cvms/refresh_cvm_instance_ids.ts
|
|
5464
|
-
import { z as
|
|
5465
|
-
var RefreshCvmInstanceIdsRequestSchema =
|
|
5466
|
-
cvm_ids:
|
|
5467
|
-
running_only:
|
|
5468
|
-
missing_only:
|
|
5469
|
-
overwrite:
|
|
5470
|
-
limit:
|
|
5471
|
-
dry_run:
|
|
5891
|
+
import { z as z65 } from "zod";
|
|
5892
|
+
var RefreshCvmInstanceIdsRequestSchema = z65.object({
|
|
5893
|
+
cvm_ids: z65.array(z65.string()).optional(),
|
|
5894
|
+
running_only: z65.boolean().optional(),
|
|
5895
|
+
missing_only: z65.boolean().optional(),
|
|
5896
|
+
overwrite: z65.boolean().optional(),
|
|
5897
|
+
limit: z65.number().int().min(1).max(500).optional(),
|
|
5898
|
+
dry_run: z65.boolean().optional()
|
|
5472
5899
|
}).strict();
|
|
5473
|
-
var
|
|
5474
|
-
total:
|
|
5475
|
-
scanned:
|
|
5476
|
-
updated:
|
|
5477
|
-
unchanged:
|
|
5478
|
-
skipped:
|
|
5479
|
-
conflicts:
|
|
5480
|
-
errors:
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5900
|
+
var RefreshCvmInstanceIdsResponseBaseSchema = z65.object({
|
|
5901
|
+
total: z65.number().int(),
|
|
5902
|
+
scanned: z65.number().int(),
|
|
5903
|
+
updated: z65.number().int(),
|
|
5904
|
+
unchanged: z65.number().int(),
|
|
5905
|
+
skipped: z65.number().int(),
|
|
5906
|
+
conflicts: z65.number().int(),
|
|
5907
|
+
errors: z65.number().int()
|
|
5908
|
+
});
|
|
5909
|
+
var RefreshCvmInstanceIdsResponseV20260121Schema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
5910
|
+
items: z65.array(InstanceIdRefreshResultV20260121Schema)
|
|
5911
|
+
});
|
|
5912
|
+
var RefreshCvmInstanceIdsResponseV20260522Schema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
5913
|
+
items: z65.array(InstanceIdRefreshResultV20260522Schema)
|
|
5914
|
+
});
|
|
5915
|
+
var RefreshCvmInstanceIdsResponseAnySchema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
5916
|
+
items: z65.array(
|
|
5917
|
+
z65.union([InstanceIdRefreshResultV20260121Schema, InstanceIdRefreshResultV20260522Schema])
|
|
5918
|
+
)
|
|
5486
5919
|
});
|
|
5920
|
+
var RefreshCvmInstanceIdsResponseSchema = RefreshCvmInstanceIdsResponseV20260522Schema;
|
|
5921
|
+
function getSchemaForVersion7(version) {
|
|
5922
|
+
if (version === "2026-01-21") return RefreshCvmInstanceIdsResponseV20260121Schema;
|
|
5923
|
+
return RefreshCvmInstanceIdsResponseV20260522Schema;
|
|
5924
|
+
}
|
|
5925
|
+
async function refreshCvmInstanceIds(client, request) {
|
|
5926
|
+
const parsed = RefreshCvmInstanceIdsRequestSchema.parse(request);
|
|
5927
|
+
const response = await client.patch("/cvms/instance-ids", parsed);
|
|
5928
|
+
return getSchemaForVersion7(client.config.version).parse(
|
|
5929
|
+
response
|
|
5930
|
+
);
|
|
5931
|
+
}
|
|
5932
|
+
async function safeRefreshCvmInstanceIds(client, request) {
|
|
5933
|
+
try {
|
|
5934
|
+
const data = await refreshCvmInstanceIds(client, request);
|
|
5935
|
+
return { success: true, data };
|
|
5936
|
+
} catch (error) {
|
|
5937
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
5938
|
+
return { success: false, error };
|
|
5939
|
+
}
|
|
5940
|
+
return {
|
|
5941
|
+
success: false,
|
|
5942
|
+
error: {
|
|
5943
|
+
name: "Error",
|
|
5944
|
+
message: error instanceof Error ? error.message : String(error)
|
|
5945
|
+
}
|
|
5946
|
+
};
|
|
5947
|
+
}
|
|
5948
|
+
}
|
|
5487
5949
|
|
|
5488
5950
|
// src/actions/cvms/get_cvm_status_batch.ts
|
|
5489
|
-
import { z as
|
|
5490
|
-
var CvmStatusSchema =
|
|
5491
|
-
vm_uuid:
|
|
5492
|
-
status:
|
|
5493
|
-
uptime:
|
|
5494
|
-
in_progress:
|
|
5495
|
-
boot_progress:
|
|
5496
|
-
boot_error:
|
|
5497
|
-
operation_type:
|
|
5498
|
-
operation_started_at:
|
|
5499
|
-
correlation_id:
|
|
5500
|
-
});
|
|
5501
|
-
var GetCvmStatusBatchResponseSchema =
|
|
5502
|
-
var GetCvmStatusBatchRequestSchema =
|
|
5503
|
-
vmUuids:
|
|
5951
|
+
import { z as z66 } from "zod";
|
|
5952
|
+
var CvmStatusSchema = z66.object({
|
|
5953
|
+
vm_uuid: z66.string(),
|
|
5954
|
+
status: z66.string(),
|
|
5955
|
+
uptime: z66.string().nullable().optional(),
|
|
5956
|
+
in_progress: z66.boolean(),
|
|
5957
|
+
boot_progress: z66.string().nullable().optional(),
|
|
5958
|
+
boot_error: z66.string().nullable().optional(),
|
|
5959
|
+
operation_type: z66.string().nullable().optional(),
|
|
5960
|
+
operation_started_at: z66.string().nullable().optional(),
|
|
5961
|
+
correlation_id: z66.string().nullable().optional()
|
|
5962
|
+
});
|
|
5963
|
+
var GetCvmStatusBatchResponseSchema = z66.record(z66.string(), CvmStatusSchema);
|
|
5964
|
+
var GetCvmStatusBatchRequestSchema = z66.object({
|
|
5965
|
+
vmUuids: z66.array(z66.string())
|
|
5504
5966
|
});
|
|
5505
5967
|
var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAction(GetCvmStatusBatchResponseSchema, async (client, request) => {
|
|
5506
5968
|
const { vmUuids } = GetCvmStatusBatchRequestSchema.parse(request);
|
|
@@ -5508,11 +5970,11 @@ var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAct
|
|
|
5508
5970
|
});
|
|
5509
5971
|
|
|
5510
5972
|
// src/actions/cvms/get_cvm_user_config.ts
|
|
5511
|
-
import { z as
|
|
5512
|
-
var CvmUserConfigSchema =
|
|
5513
|
-
hostname:
|
|
5514
|
-
ssh_authorized_keys:
|
|
5515
|
-
default_gateway_domain:
|
|
5973
|
+
import { z as z67 } from "zod";
|
|
5974
|
+
var CvmUserConfigSchema = z67.object({
|
|
5975
|
+
hostname: z67.string().nullable().optional(),
|
|
5976
|
+
ssh_authorized_keys: z67.array(z67.string()).default([]),
|
|
5977
|
+
default_gateway_domain: z67.string().nullable().optional()
|
|
5516
5978
|
});
|
|
5517
5979
|
var GetCvmUserConfigRequestSchema = CvmIdSchema;
|
|
5518
5980
|
var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineAction(CvmUserConfigSchema, async (client, request) => {
|
|
@@ -5521,38 +5983,70 @@ var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineActio
|
|
|
5521
5983
|
});
|
|
5522
5984
|
|
|
5523
5985
|
// src/actions/cvms/check_cvm_is_allowed.ts
|
|
5524
|
-
import { z as
|
|
5525
|
-
var
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5986
|
+
import { z as z68 } from "zod";
|
|
5987
|
+
var IsAllowedResultBaseSchema = z68.object({
|
|
5988
|
+
app_contract_address: z68.string(),
|
|
5989
|
+
compose_hash: z68.string(),
|
|
5990
|
+
device_id: z68.string(),
|
|
5991
|
+
compose_hash_allowed: z68.boolean(),
|
|
5992
|
+
allow_any_device: z68.boolean(),
|
|
5993
|
+
device_id_allowed: z68.boolean().nullable().optional(),
|
|
5994
|
+
is_allowed: z68.boolean(),
|
|
5995
|
+
error: z68.string().nullable().optional()
|
|
5996
|
+
});
|
|
5997
|
+
var IsAllowedResultV20260121Schema = IsAllowedResultBaseSchema.extend({
|
|
5998
|
+
cvm_id: z68.number().optional()
|
|
5999
|
+
});
|
|
6000
|
+
var IsAllowedResultV20260522Schema = IsAllowedResultBaseSchema.extend({
|
|
6001
|
+
cvm_id: z68.string().optional()
|
|
6002
|
+
});
|
|
6003
|
+
var IsAllowedResultAnySchema = z68.union([
|
|
6004
|
+
IsAllowedResultV20260121Schema,
|
|
6005
|
+
IsAllowedResultV20260522Schema
|
|
6006
|
+
]);
|
|
6007
|
+
var IsAllowedResultSchema = IsAllowedResultV20260522Schema;
|
|
6008
|
+
var CheckCvmIsAllowedInputSchema = z68.object({
|
|
6009
|
+
cvmId: z68.string().min(1),
|
|
6010
|
+
compose_hash: z68.string().optional(),
|
|
6011
|
+
node_id: z68.number().optional(),
|
|
6012
|
+
device_id: z68.string().optional()
|
|
5541
6013
|
});
|
|
5542
6014
|
var CheckCvmIsAllowedRequestSchema = CheckCvmIsAllowedInputSchema;
|
|
5543
|
-
|
|
6015
|
+
function getSchemaForVersion8(version) {
|
|
6016
|
+
if (version === "2026-01-21") return IsAllowedResultV20260121Schema;
|
|
6017
|
+
return IsAllowedResultV20260522Schema;
|
|
6018
|
+
}
|
|
6019
|
+
async function checkCvmIsAllowed(client, request) {
|
|
5544
6020
|
const { cvmId, ...body } = CheckCvmIsAllowedRequestSchema.parse(request);
|
|
5545
|
-
|
|
5546
|
-
|
|
6021
|
+
const response = await client.post(`/cvms/${cvmId}/is-allowed`, body);
|
|
6022
|
+
return getSchemaForVersion8(client.config.version).parse(response);
|
|
6023
|
+
}
|
|
6024
|
+
async function safeCheckCvmIsAllowed(client, request) {
|
|
6025
|
+
try {
|
|
6026
|
+
const data = await checkCvmIsAllowed(client, request);
|
|
6027
|
+
return { success: true, data };
|
|
6028
|
+
} catch (error) {
|
|
6029
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6030
|
+
return { success: false, error };
|
|
6031
|
+
}
|
|
6032
|
+
return {
|
|
6033
|
+
success: false,
|
|
6034
|
+
error: {
|
|
6035
|
+
name: "Error",
|
|
6036
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6037
|
+
}
|
|
6038
|
+
};
|
|
6039
|
+
}
|
|
6040
|
+
}
|
|
5547
6041
|
|
|
5548
6042
|
// src/actions/apps/check_app_is_allowed.ts
|
|
5549
|
-
import { z as
|
|
5550
|
-
var CheckAppIsAllowedRequestSchema =
|
|
5551
|
-
appId:
|
|
5552
|
-
compose_hash:
|
|
5553
|
-
node_id:
|
|
5554
|
-
device_id:
|
|
5555
|
-
chain_id:
|
|
6043
|
+
import { z as z69 } from "zod";
|
|
6044
|
+
var CheckAppIsAllowedRequestSchema = z69.object({
|
|
6045
|
+
appId: z69.string().min(1),
|
|
6046
|
+
compose_hash: z69.string(),
|
|
6047
|
+
node_id: z69.number().optional(),
|
|
6048
|
+
device_id: z69.string().optional(),
|
|
6049
|
+
chain_id: z69.number().optional()
|
|
5556
6050
|
});
|
|
5557
6051
|
var { action: checkAppIsAllowed, safeAction: safeCheckAppIsAllowed } = defineAction(IsAllowedResultSchema, async (client, request) => {
|
|
5558
6052
|
const { appId, ...body } = CheckAppIsAllowedRequestSchema.parse(request);
|
|
@@ -5560,46 +6054,83 @@ var { action: checkAppIsAllowed, safeAction: safeCheckAppIsAllowed } = defineAct
|
|
|
5560
6054
|
});
|
|
5561
6055
|
|
|
5562
6056
|
// src/actions/apps/check_app_cvms_is_allowed.ts
|
|
5563
|
-
import { z as
|
|
5564
|
-
var
|
|
5565
|
-
is_onchain:
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
})
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
6057
|
+
import { z as z70 } from "zod";
|
|
6058
|
+
var AppCvmsBatchIsAllowedResponseBaseSchema = z70.object({
|
|
6059
|
+
is_onchain: z70.boolean(),
|
|
6060
|
+
total: z70.number().default(0),
|
|
6061
|
+
allowed_count: z70.number().default(0),
|
|
6062
|
+
denied_count: z70.number().default(0),
|
|
6063
|
+
error_count: z70.number().default(0)
|
|
6064
|
+
});
|
|
6065
|
+
var AppCvmsBatchIsAllowedResponseV20260121Schema = AppCvmsBatchIsAllowedResponseBaseSchema.extend({
|
|
6066
|
+
results: z70.array(IsAllowedResultV20260121Schema.extend({ cvm_id: z70.number() })).default([]),
|
|
6067
|
+
skipped_cvm_ids: z70.array(z70.number()).default([])
|
|
6068
|
+
});
|
|
6069
|
+
var AppCvmsBatchIsAllowedResponseV20260522Schema = AppCvmsBatchIsAllowedResponseBaseSchema.extend({
|
|
6070
|
+
results: z70.array(IsAllowedResultV20260522Schema.extend({ cvm_id: z70.string() })).default([]),
|
|
6071
|
+
skipped_cvm_ids: z70.array(z70.string()).default([])
|
|
6072
|
+
});
|
|
6073
|
+
var AppCvmsBatchIsAllowedResponseAnySchema = z70.union([
|
|
6074
|
+
AppCvmsBatchIsAllowedResponseV20260121Schema,
|
|
6075
|
+
AppCvmsBatchIsAllowedResponseV20260522Schema
|
|
6076
|
+
]);
|
|
6077
|
+
var AppCvmsBatchIsAllowedResponseSchema = AppCvmsBatchIsAllowedResponseV20260522Schema;
|
|
6078
|
+
var CheckAppCvmsIsAllowedRequestSchema = z70.object({
|
|
6079
|
+
appId: z70.string().min(1)
|
|
5579
6080
|
});
|
|
6081
|
+
function getSchemaForVersion9(version) {
|
|
6082
|
+
if (version === "2026-01-21") return AppCvmsBatchIsAllowedResponseV20260121Schema;
|
|
6083
|
+
return AppCvmsBatchIsAllowedResponseV20260522Schema;
|
|
6084
|
+
}
|
|
6085
|
+
async function checkAppCvmsIsAllowed(client, request) {
|
|
6086
|
+
const { appId } = CheckAppCvmsIsAllowedRequestSchema.parse(request);
|
|
6087
|
+
const response = await client.post(`/apps/${appId}/cvms/is-allowed`, {});
|
|
6088
|
+
return getSchemaForVersion9(client.config.version).parse(
|
|
6089
|
+
response
|
|
6090
|
+
);
|
|
6091
|
+
}
|
|
6092
|
+
async function safeCheckAppCvmsIsAllowed(client, request) {
|
|
6093
|
+
try {
|
|
6094
|
+
const data = await checkAppCvmsIsAllowed(client, request);
|
|
6095
|
+
return { success: true, data };
|
|
6096
|
+
} catch (error) {
|
|
6097
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6098
|
+
return { success: false, error };
|
|
6099
|
+
}
|
|
6100
|
+
return {
|
|
6101
|
+
success: false,
|
|
6102
|
+
error: {
|
|
6103
|
+
name: "Error",
|
|
6104
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6105
|
+
}
|
|
6106
|
+
};
|
|
6107
|
+
}
|
|
6108
|
+
}
|
|
5580
6109
|
|
|
5581
6110
|
// src/actions/apps/get_app_list.ts
|
|
5582
|
-
import { z as
|
|
5583
|
-
var GetAppListRequestSchema =
|
|
5584
|
-
page:
|
|
5585
|
-
page_size:
|
|
5586
|
-
search:
|
|
5587
|
-
status:
|
|
5588
|
-
listed:
|
|
5589
|
-
base_image:
|
|
5590
|
-
instance_type:
|
|
5591
|
-
kms_slug:
|
|
5592
|
-
kms_type:
|
|
5593
|
-
node:
|
|
5594
|
-
region:
|
|
6111
|
+
import { z as z71 } from "zod";
|
|
6112
|
+
var GetAppListRequestSchema = z71.object({
|
|
6113
|
+
page: z71.number().int().min(1).optional(),
|
|
6114
|
+
page_size: z71.number().int().min(1).max(100).optional(),
|
|
6115
|
+
search: z71.string().optional(),
|
|
6116
|
+
status: z71.array(z71.string()).optional(),
|
|
6117
|
+
listed: z71.boolean().optional(),
|
|
6118
|
+
base_image: z71.string().optional(),
|
|
6119
|
+
instance_type: z71.string().optional(),
|
|
6120
|
+
kms_slug: z71.string().optional(),
|
|
6121
|
+
kms_type: z71.string().optional(),
|
|
6122
|
+
node: z71.string().optional(),
|
|
6123
|
+
region: z71.string().optional()
|
|
5595
6124
|
}).strict();
|
|
5596
|
-
function
|
|
5597
|
-
|
|
6125
|
+
function getSchemaForVersion10(version) {
|
|
6126
|
+
if (version === "2025-10-28") return DstackAppListResponseV20251028Schema;
|
|
6127
|
+
if (version === "2026-01-21") return DstackAppListResponseV20260121Schema;
|
|
6128
|
+
return DstackAppListResponseV20260522Schema;
|
|
5598
6129
|
}
|
|
5599
6130
|
async function getAppList(client, request) {
|
|
5600
6131
|
const validatedRequest = GetAppListRequestSchema.parse(request ?? {});
|
|
5601
6132
|
const response = await client.get("/apps", { params: validatedRequest });
|
|
5602
|
-
const schema =
|
|
6133
|
+
const schema = getSchemaForVersion10(client.config.version);
|
|
5603
6134
|
return schema.parse(response);
|
|
5604
6135
|
}
|
|
5605
6136
|
async function safeGetAppList(client, request) {
|
|
@@ -5621,17 +6152,19 @@ async function safeGetAppList(client, request) {
|
|
|
5621
6152
|
}
|
|
5622
6153
|
|
|
5623
6154
|
// src/actions/apps/get_app_info.ts
|
|
5624
|
-
import { z as
|
|
5625
|
-
var GetAppInfoRequestSchema =
|
|
5626
|
-
appId:
|
|
6155
|
+
import { z as z72 } from "zod";
|
|
6156
|
+
var GetAppInfoRequestSchema = z72.object({
|
|
6157
|
+
appId: z72.string().min(1)
|
|
5627
6158
|
}).strict();
|
|
5628
|
-
function
|
|
5629
|
-
|
|
6159
|
+
function getSchemaForVersion11(version) {
|
|
6160
|
+
if (version === "2025-10-28") return DstackAppWithCvmResponseV20251028Schema;
|
|
6161
|
+
if (version === "2026-01-21") return DstackAppWithCvmResponseV20260121Schema;
|
|
6162
|
+
return DstackAppWithCvmResponseV20260522Schema;
|
|
5630
6163
|
}
|
|
5631
6164
|
async function getAppInfo(client, request) {
|
|
5632
6165
|
const { appId } = GetAppInfoRequestSchema.parse(request);
|
|
5633
6166
|
const response = await client.get(`/apps/${appId}`);
|
|
5634
|
-
const schema =
|
|
6167
|
+
const schema = getSchemaForVersion11(client.config.version);
|
|
5635
6168
|
return schema.parse(response);
|
|
5636
6169
|
}
|
|
5637
6170
|
async function safeGetAppInfo(client, request) {
|
|
@@ -5653,17 +6186,19 @@ async function safeGetAppInfo(client, request) {
|
|
|
5653
6186
|
}
|
|
5654
6187
|
|
|
5655
6188
|
// src/actions/apps/get_app_cvms.ts
|
|
5656
|
-
import { z as
|
|
5657
|
-
var GetAppCvmsRequestSchema =
|
|
5658
|
-
appId:
|
|
6189
|
+
import { z as z73 } from "zod";
|
|
6190
|
+
var GetAppCvmsRequestSchema = z73.object({
|
|
6191
|
+
appId: z73.string().min(1)
|
|
5659
6192
|
}).strict();
|
|
5660
|
-
function
|
|
5661
|
-
|
|
6193
|
+
function getSchemaForVersion12(version) {
|
|
6194
|
+
if (version === "2025-10-28") return z73.array(CvmInfoV20251028Schema);
|
|
6195
|
+
if (version === "2026-01-21") return z73.array(CvmInfoV20260121Schema);
|
|
6196
|
+
return z73.array(CvmInfoV20260522Schema);
|
|
5662
6197
|
}
|
|
5663
6198
|
async function getAppCvms(client, request) {
|
|
5664
6199
|
const { appId } = GetAppCvmsRequestSchema.parse(request);
|
|
5665
6200
|
const response = await client.get(`/apps/${appId}/cvms`);
|
|
5666
|
-
const schema =
|
|
6201
|
+
const schema = getSchemaForVersion12(client.config.version);
|
|
5667
6202
|
return schema.parse(response);
|
|
5668
6203
|
}
|
|
5669
6204
|
async function safeGetAppCvms(client, request) {
|
|
@@ -5685,16 +6220,17 @@ async function safeGetAppCvms(client, request) {
|
|
|
5685
6220
|
}
|
|
5686
6221
|
|
|
5687
6222
|
// src/actions/apps/create_app_instance.ts
|
|
5688
|
-
import { z as
|
|
5689
|
-
var CreateAppInstanceRequestSchema =
|
|
5690
|
-
appId:
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
6223
|
+
import { z as z74 } from "zod";
|
|
6224
|
+
var CreateAppInstanceRequestSchema = z74.object({
|
|
6225
|
+
appId: z74.string().min(1),
|
|
6226
|
+
name: z74.string().optional(),
|
|
6227
|
+
node_id: z74.number().optional(),
|
|
6228
|
+
docker_compose_file: z74.string().optional(),
|
|
6229
|
+
pre_launch_script: z74.string().optional(),
|
|
6230
|
+
encrypted_env: z74.string().optional(),
|
|
6231
|
+
compose_hash: z74.string().optional(),
|
|
6232
|
+
token: z74.string().optional(),
|
|
6233
|
+
transaction_hash: z74.string().optional()
|
|
5698
6234
|
}).strict();
|
|
5699
6235
|
var { action: createAppInstance, safeAction: safeCreateAppInstance } = defineAction(VMSchema, async (client, request) => {
|
|
5700
6236
|
const parsed = CreateAppInstanceRequestSchema.parse(request);
|
|
@@ -5703,28 +6239,52 @@ var { action: createAppInstance, safeAction: safeCreateAppInstance } = defineAct
|
|
|
5703
6239
|
});
|
|
5704
6240
|
|
|
5705
6241
|
// src/actions/apps/get_app_device_allowlist.ts
|
|
5706
|
-
import { z as
|
|
5707
|
-
var
|
|
5708
|
-
device_id:
|
|
5709
|
-
node_name:
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
6242
|
+
import { z as z75 } from "zod";
|
|
6243
|
+
var DeviceAllowlistItemBaseSchema = z75.object({
|
|
6244
|
+
device_id: z75.string(),
|
|
6245
|
+
node_name: z75.string().nullable(),
|
|
6246
|
+
allowed_onchain: z75.boolean(),
|
|
6247
|
+
status: z75.string()
|
|
6248
|
+
});
|
|
6249
|
+
var DeviceAllowlistItemV20260121Schema = DeviceAllowlistItemBaseSchema.extend({
|
|
6250
|
+
cvm_ids: z75.array(z75.number())
|
|
6251
|
+
});
|
|
6252
|
+
var DeviceAllowlistItemV20260522Schema = DeviceAllowlistItemBaseSchema.extend({
|
|
6253
|
+
cvm_ids: z75.array(z75.string())
|
|
6254
|
+
});
|
|
6255
|
+
var DeviceAllowlistResponseBaseSchema = z75.object({
|
|
6256
|
+
is_onchain_kms: z75.boolean(),
|
|
6257
|
+
allow_any_device: z75.boolean().nullable().optional(),
|
|
6258
|
+
chain_id: z75.number().nullable().optional(),
|
|
6259
|
+
app_contract_address: z75.string().nullable().optional()
|
|
6260
|
+
});
|
|
6261
|
+
var DeviceAllowlistResponseV20260121Schema = DeviceAllowlistResponseBaseSchema.extend({
|
|
6262
|
+
devices: z75.array(DeviceAllowlistItemV20260121Schema).optional().default([])
|
|
6263
|
+
});
|
|
6264
|
+
var DeviceAllowlistResponseV20260522Schema = DeviceAllowlistResponseBaseSchema.extend({
|
|
6265
|
+
devices: z75.array(DeviceAllowlistItemV20260522Schema).optional().default([])
|
|
6266
|
+
});
|
|
6267
|
+
var DeviceAllowlistItemAnySchema = z75.union([
|
|
6268
|
+
DeviceAllowlistItemV20260121Schema,
|
|
6269
|
+
DeviceAllowlistItemV20260522Schema
|
|
6270
|
+
]);
|
|
6271
|
+
var DeviceAllowlistResponseAnySchema = z75.union([
|
|
6272
|
+
DeviceAllowlistResponseV20260121Schema,
|
|
6273
|
+
DeviceAllowlistResponseV20260522Schema
|
|
6274
|
+
]);
|
|
6275
|
+
function getSchemaForVersion13(version) {
|
|
6276
|
+
if (version === "2026-01-21") return DeviceAllowlistResponseV20260121Schema;
|
|
6277
|
+
return DeviceAllowlistResponseV20260522Schema;
|
|
6278
|
+
}
|
|
6279
|
+
var GetAppDeviceAllowlistRequestSchema = z75.object({
|
|
6280
|
+
appId: z75.string().min(1)
|
|
5723
6281
|
}).strict();
|
|
5724
6282
|
async function getAppDeviceAllowlist(client, request) {
|
|
5725
6283
|
const { appId } = GetAppDeviceAllowlistRequestSchema.parse(request);
|
|
5726
6284
|
const response = await client.get(`/apps/${appId}/device-allowlist`);
|
|
5727
|
-
return
|
|
6285
|
+
return getSchemaForVersion13(client.config.version).parse(
|
|
6286
|
+
response
|
|
6287
|
+
);
|
|
5728
6288
|
}
|
|
5729
6289
|
async function safeGetAppDeviceAllowlist(client, request) {
|
|
5730
6290
|
try {
|
|
@@ -5745,11 +6305,11 @@ async function safeGetAppDeviceAllowlist(client, request) {
|
|
|
5745
6305
|
}
|
|
5746
6306
|
|
|
5747
6307
|
// src/actions/apps/get_app_revisions.ts
|
|
5748
|
-
import { z as
|
|
5749
|
-
var GetAppRevisionsRequestSchema =
|
|
5750
|
-
appId:
|
|
5751
|
-
page:
|
|
5752
|
-
page_size:
|
|
6308
|
+
import { z as z76 } from "zod";
|
|
6309
|
+
var GetAppRevisionsRequestSchema = z76.object({
|
|
6310
|
+
appId: z76.string().min(1),
|
|
6311
|
+
page: z76.number().int().min(1).optional(),
|
|
6312
|
+
page_size: z76.number().int().min(1).max(1e3).optional()
|
|
5753
6313
|
}).strict();
|
|
5754
6314
|
async function getAppRevisions(client, request) {
|
|
5755
6315
|
const { appId, ...params } = GetAppRevisionsRequestSchema.parse(request);
|
|
@@ -5775,11 +6335,11 @@ async function safeGetAppRevisions(client, request) {
|
|
|
5775
6335
|
}
|
|
5776
6336
|
|
|
5777
6337
|
// src/actions/apps/get_app_revision_detail.ts
|
|
5778
|
-
import { z as
|
|
5779
|
-
var GetAppRevisionDetailRequestSchema =
|
|
5780
|
-
appId:
|
|
5781
|
-
revisionId:
|
|
5782
|
-
rawComposeFile:
|
|
6338
|
+
import { z as z77 } from "zod";
|
|
6339
|
+
var GetAppRevisionDetailRequestSchema = z77.object({
|
|
6340
|
+
appId: z77.string().min(1),
|
|
6341
|
+
revisionId: z77.string().min(1),
|
|
6342
|
+
rawComposeFile: z77.boolean().optional()
|
|
5783
6343
|
}).strict();
|
|
5784
6344
|
async function getAppRevisionDetail(client, request) {
|
|
5785
6345
|
const { appId, revisionId, rawComposeFile } = GetAppRevisionDetailRequestSchema.parse(request);
|
|
@@ -5806,15 +6366,15 @@ async function safeGetAppRevisionDetail(client, request) {
|
|
|
5806
6366
|
}
|
|
5807
6367
|
|
|
5808
6368
|
// src/actions/apps/get_app_filter_options.ts
|
|
5809
|
-
import { z as
|
|
5810
|
-
var AppFilterOptionsSchema =
|
|
5811
|
-
statuses:
|
|
5812
|
-
image_versions:
|
|
5813
|
-
instance_types:
|
|
5814
|
-
kms_slugs:
|
|
5815
|
-
kms_types:
|
|
5816
|
-
regions:
|
|
5817
|
-
nodes:
|
|
6369
|
+
import { z as z78 } from "zod";
|
|
6370
|
+
var AppFilterOptionsSchema = z78.object({
|
|
6371
|
+
statuses: z78.array(z78.string()),
|
|
6372
|
+
image_versions: z78.array(z78.string()),
|
|
6373
|
+
instance_types: z78.array(z78.string()),
|
|
6374
|
+
kms_slugs: z78.array(z78.string()),
|
|
6375
|
+
kms_types: z78.array(z78.string()),
|
|
6376
|
+
regions: z78.array(z78.string()),
|
|
6377
|
+
nodes: z78.array(z78.string())
|
|
5818
6378
|
});
|
|
5819
6379
|
async function getAppFilterOptions(client) {
|
|
5820
6380
|
const response = await client.get("/apps/filter-options");
|
|
@@ -5839,47 +6399,52 @@ async function safeGetAppFilterOptions(client) {
|
|
|
5839
6399
|
}
|
|
5840
6400
|
|
|
5841
6401
|
// src/actions/apps/get_app_attestation.ts
|
|
5842
|
-
import { z as
|
|
5843
|
-
var KmsInfoSchema2 =
|
|
5844
|
-
contract_address:
|
|
5845
|
-
chain_id:
|
|
5846
|
-
version:
|
|
5847
|
-
url:
|
|
5848
|
-
gateway_app_id:
|
|
5849
|
-
gateway_app_url:
|
|
5850
|
-
kms_type:
|
|
5851
|
-
});
|
|
5852
|
-
var GuestAgentInfoSchema =
|
|
5853
|
-
app_id:
|
|
5854
|
-
instance_id:
|
|
5855
|
-
app_name:
|
|
5856
|
-
device_id:
|
|
6402
|
+
import { z as z79 } from "zod";
|
|
6403
|
+
var KmsInfoSchema2 = z79.object({
|
|
6404
|
+
contract_address: z79.string(),
|
|
6405
|
+
chain_id: z79.string().nullable(),
|
|
6406
|
+
version: z79.string(),
|
|
6407
|
+
url: z79.string(),
|
|
6408
|
+
gateway_app_id: z79.string().nullable(),
|
|
6409
|
+
gateway_app_url: z79.string(),
|
|
6410
|
+
kms_type: z79.string()
|
|
6411
|
+
});
|
|
6412
|
+
var GuestAgentInfoSchema = z79.object({
|
|
6413
|
+
app_id: z79.string().optional(),
|
|
6414
|
+
instance_id: z79.string().optional(),
|
|
6415
|
+
app_name: z79.string().optional(),
|
|
6416
|
+
device_id: z79.string().optional()
|
|
5857
6417
|
}).passthrough().nullable();
|
|
5858
|
-
var AppAttestationInstanceSchema =
|
|
5859
|
-
vm_uuid:
|
|
5860
|
-
name:
|
|
5861
|
-
instance_id:
|
|
5862
|
-
status:
|
|
5863
|
-
image_version:
|
|
5864
|
-
quote:
|
|
5865
|
-
ppid:
|
|
5866
|
-
|
|
6418
|
+
var AppAttestationInstanceSchema = z79.object({
|
|
6419
|
+
vm_uuid: z79.string().nullable().optional(),
|
|
6420
|
+
name: z79.string().optional(),
|
|
6421
|
+
instance_id: z79.string().nullable().optional(),
|
|
6422
|
+
status: z79.string().optional(),
|
|
6423
|
+
image_version: z79.string().nullable().optional(),
|
|
6424
|
+
quote: z79.string().nullable().optional(),
|
|
6425
|
+
ppid: z79.string().optional(),
|
|
6426
|
+
ppid_sha256: z79.string().nullable().optional(),
|
|
6427
|
+
device_id: z79.string().optional(),
|
|
6428
|
+
fmspc: z79.string().nullable().optional(),
|
|
6429
|
+
tee_tcb_svn: z79.string().nullable().optional(),
|
|
6430
|
+
cpusvn: z79.string().nullable().optional(),
|
|
6431
|
+
pcesvn: z79.number().nullable().optional(),
|
|
5867
6432
|
tcb_info: TcbInfoSchema.nullable().optional(),
|
|
5868
|
-
app_certificates:
|
|
5869
|
-
compose_file:
|
|
5870
|
-
error:
|
|
6433
|
+
app_certificates: z79.array(CertificateSchema).nullable().optional(),
|
|
6434
|
+
compose_file: z79.string().nullable().optional(),
|
|
6435
|
+
error: z79.string().nullable().optional()
|
|
5871
6436
|
});
|
|
5872
|
-
var AppAttestationResponseSchema =
|
|
5873
|
-
app_id:
|
|
5874
|
-
contract_address:
|
|
6437
|
+
var AppAttestationResponseSchema = z79.object({
|
|
6438
|
+
app_id: z79.string(),
|
|
6439
|
+
contract_address: z79.string(),
|
|
5875
6440
|
kms_info: KmsInfoSchema2,
|
|
5876
|
-
instances:
|
|
6441
|
+
instances: z79.array(AppAttestationInstanceSchema),
|
|
5877
6442
|
kms_guest_agent_info: GuestAgentInfoSchema,
|
|
5878
6443
|
gateway_guest_agent_info: GuestAgentInfoSchema,
|
|
5879
|
-
qemu_version:
|
|
6444
|
+
qemu_version: z79.string().nullable()
|
|
5880
6445
|
});
|
|
5881
|
-
var GetAppAttestationRequestSchema =
|
|
5882
|
-
appId:
|
|
6446
|
+
var GetAppAttestationRequestSchema = z79.object({
|
|
6447
|
+
appId: z79.string().min(1)
|
|
5883
6448
|
}).strict();
|
|
5884
6449
|
var { action: getAppAttestation, safeAction: safeGetAppAttestation } = defineAction(AppAttestationResponseSchema, async (client, request) => {
|
|
5885
6450
|
const { appId } = GetAppAttestationRequestSchema.parse(request);
|
|
@@ -5962,15 +6527,28 @@ export {
|
|
|
5962
6527
|
CvmAttestationSchema,
|
|
5963
6528
|
CvmBasicInfoV20251028Schema,
|
|
5964
6529
|
CvmContainersStatsSchema,
|
|
6530
|
+
CvmCreateGatewayResourceSchema,
|
|
6531
|
+
CvmCreateGatewayResourceV20260121Schema,
|
|
6532
|
+
CvmCreateInstanceTypeResourceSchema,
|
|
6533
|
+
CvmCreateKmsResourceSchema,
|
|
6534
|
+
CvmCreateKmsResourceV20260121Schema,
|
|
6535
|
+
CvmCreateNodeKmsRelationSchema,
|
|
6536
|
+
CvmCreateNodeKmsRelationV20260121Schema,
|
|
6537
|
+
CvmCreateResourceGraphSchema,
|
|
6538
|
+
CvmCreateResourceGraphV20260121Schema,
|
|
6539
|
+
CvmCreateResourceGraphV20260522Schema,
|
|
5965
6540
|
CvmDetailV20251028Schema,
|
|
5966
6541
|
CvmGatewayInfoV20260121Schema,
|
|
5967
6542
|
CvmIdBaseSchema,
|
|
5968
6543
|
CvmIdObjectSchema,
|
|
5969
6544
|
CvmIdSchema,
|
|
5970
6545
|
CvmInfoDetailV20260121Schema,
|
|
6546
|
+
CvmInfoDetailV20260522Schema,
|
|
5971
6547
|
CvmInfoV20251028Schema,
|
|
5972
6548
|
CvmInfoV20260121Schema,
|
|
6549
|
+
CvmInfoV20260522Schema,
|
|
5973
6550
|
CvmKmsInfoV20260121Schema,
|
|
6551
|
+
CvmLogUrlsV20260121Schema,
|
|
5974
6552
|
CvmNetworkSchema,
|
|
5975
6553
|
CvmNetworkUrlsV20251028Schema,
|
|
5976
6554
|
CvmNodeInfoV20260121Schema,
|
|
@@ -5989,12 +6567,13 @@ export {
|
|
|
5989
6567
|
DeployAppAuthSchema,
|
|
5990
6568
|
DstackAppFullResponseV20251028Schema,
|
|
5991
6569
|
DstackAppFullResponseV20260121Schema,
|
|
6570
|
+
DstackAppFullResponseV20260522Schema,
|
|
5992
6571
|
DstackAppListResponseV20251028Schema,
|
|
5993
6572
|
DstackAppListResponseV20260121Schema,
|
|
5994
|
-
|
|
5995
|
-
DstackAppMinimalResponseV20260121Schema,
|
|
6573
|
+
DstackAppListResponseV20260522Schema,
|
|
5996
6574
|
DstackAppWithCvmResponseV20251028Schema,
|
|
5997
6575
|
DstackAppWithCvmResponseV20260121Schema,
|
|
6576
|
+
DstackAppWithCvmResponseV20260522Schema,
|
|
5998
6577
|
ErrorCodes,
|
|
5999
6578
|
EventLogSchema,
|
|
6000
6579
|
FamilyGroupSchema,
|
|
@@ -6031,8 +6610,10 @@ export {
|
|
|
6031
6610
|
GetKmsOnChainDetailResponseSchema,
|
|
6032
6611
|
GetOsImagesRequestSchema,
|
|
6033
6612
|
GetOsImagesResponseSchema,
|
|
6613
|
+
GetPreLaunchScriptUpgradeStatusRequestSchema,
|
|
6034
6614
|
GetWorkspaceNodesSchema,
|
|
6035
6615
|
GetWorkspaceQuotasSchema,
|
|
6616
|
+
GpuAvailabilitySchema,
|
|
6036
6617
|
ImportGithubProfileRequestSchema,
|
|
6037
6618
|
ImportGithubProfileResponseSchema,
|
|
6038
6619
|
InstanceIdRefreshResultSchema,
|
|
@@ -6060,10 +6641,12 @@ export {
|
|
|
6060
6641
|
OnChainOsImageSchema,
|
|
6061
6642
|
PaginatedCvmInfosV20251028Schema,
|
|
6062
6643
|
PaginatedCvmInfosV20260121Schema,
|
|
6644
|
+
PaginatedCvmInfosV20260522Schema,
|
|
6063
6645
|
PaginationMetadataSchema,
|
|
6064
6646
|
PatchCvmRequestSchema,
|
|
6065
6647
|
PatchCvmResultSchema,
|
|
6066
6648
|
PhalaCloudError,
|
|
6649
|
+
PreLaunchScriptUpgradeStatusSchema,
|
|
6067
6650
|
ProvisionCvmComposeFileUpdateRequestSchema,
|
|
6068
6651
|
ProvisionCvmComposeFileUpdateResultSchema,
|
|
6069
6652
|
ProvisionCvmRequestSchema,
|
|
@@ -6098,9 +6681,14 @@ export {
|
|
|
6098
6681
|
UpdateOsImageRequestSchema,
|
|
6099
6682
|
UpdatePreLaunchScriptRequestSchema,
|
|
6100
6683
|
UpdatePreLaunchScriptResultSchema,
|
|
6684
|
+
UpgradePreLaunchScriptRequestSchema,
|
|
6685
|
+
UpgradePreLaunchScriptResultSchema,
|
|
6101
6686
|
UserInfoSchema,
|
|
6102
6687
|
UserRefSchema,
|
|
6688
|
+
VMAnySchema,
|
|
6103
6689
|
VMSchema,
|
|
6690
|
+
VMV20260121Schema,
|
|
6691
|
+
VMV20260522Schema,
|
|
6104
6692
|
ValidationError,
|
|
6105
6693
|
VmInfoV20251028Schema,
|
|
6106
6694
|
WalletError,
|
|
@@ -6172,6 +6760,7 @@ export {
|
|
|
6172
6760
|
getCvmAttestation,
|
|
6173
6761
|
getCvmComposeFile,
|
|
6174
6762
|
getCvmContainersStats,
|
|
6763
|
+
getCvmCreateResources,
|
|
6175
6764
|
getCvmDockerCompose,
|
|
6176
6765
|
getCvmInfo,
|
|
6177
6766
|
getCvmList,
|
|
@@ -6186,6 +6775,8 @@ export {
|
|
|
6186
6775
|
getKmsList,
|
|
6187
6776
|
getKmsOnChainDetail,
|
|
6188
6777
|
getOsImages,
|
|
6778
|
+
getPreLaunchScriptUpgradeStatus,
|
|
6779
|
+
getVMSchemaForVersion,
|
|
6189
6780
|
getValidationFields,
|
|
6190
6781
|
getWorkspace,
|
|
6191
6782
|
getWorkspaceNodes,
|
|
@@ -6245,6 +6836,7 @@ export {
|
|
|
6245
6836
|
safeGetCvmAttestation,
|
|
6246
6837
|
safeGetCvmComposeFile,
|
|
6247
6838
|
safeGetCvmContainersStats,
|
|
6839
|
+
safeGetCvmCreateResources,
|
|
6248
6840
|
safeGetCvmDockerCompose,
|
|
6249
6841
|
safeGetCvmInfo,
|
|
6250
6842
|
safeGetCvmList,
|
|
@@ -6258,6 +6850,7 @@ export {
|
|
|
6258
6850
|
safeGetKmsList,
|
|
6259
6851
|
safeGetKmsOnChainDetail,
|
|
6260
6852
|
safeGetOsImages,
|
|
6853
|
+
safeGetPreLaunchScriptUpgradeStatus,
|
|
6261
6854
|
safeGetWorkspace,
|
|
6262
6855
|
safeGetWorkspaceNodes,
|
|
6263
6856
|
safeGetWorkspaceQuotas,
|
|
@@ -6286,6 +6879,7 @@ export {
|
|
|
6286
6879
|
safeUpdateDockerCompose,
|
|
6287
6880
|
safeUpdateOsImage,
|
|
6288
6881
|
safeUpdatePreLaunchScript,
|
|
6882
|
+
safeUpgradePreLaunchScript,
|
|
6289
6883
|
safeValidateActionParameters,
|
|
6290
6884
|
setAllowAnyDevice,
|
|
6291
6885
|
shutdownCvm,
|
|
@@ -6300,6 +6894,7 @@ export {
|
|
|
6300
6894
|
updateDockerCompose,
|
|
6301
6895
|
updateOsImage,
|
|
6302
6896
|
updatePreLaunchScript,
|
|
6897
|
+
upgradePreLaunchScript,
|
|
6303
6898
|
validateActionParameters,
|
|
6304
6899
|
validateComposePayloadSize,
|
|
6305
6900
|
validateNetworkPrerequisites,
|