@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.js
CHANGED
|
@@ -68,15 +68,28 @@ __export(index_exports, {
|
|
|
68
68
|
CvmAttestationSchema: () => CvmAttestationSchema,
|
|
69
69
|
CvmBasicInfoV20251028Schema: () => CvmBasicInfoV20251028Schema,
|
|
70
70
|
CvmContainersStatsSchema: () => CvmContainersStatsSchema,
|
|
71
|
+
CvmCreateGatewayResourceSchema: () => CvmCreateGatewayResourceSchema,
|
|
72
|
+
CvmCreateGatewayResourceV20260121Schema: () => CvmCreateGatewayResourceV20260121Schema,
|
|
73
|
+
CvmCreateInstanceTypeResourceSchema: () => CvmCreateInstanceTypeResourceSchema,
|
|
74
|
+
CvmCreateKmsResourceSchema: () => CvmCreateKmsResourceSchema,
|
|
75
|
+
CvmCreateKmsResourceV20260121Schema: () => CvmCreateKmsResourceV20260121Schema,
|
|
76
|
+
CvmCreateNodeKmsRelationSchema: () => CvmCreateNodeKmsRelationSchema,
|
|
77
|
+
CvmCreateNodeKmsRelationV20260121Schema: () => CvmCreateNodeKmsRelationV20260121Schema,
|
|
78
|
+
CvmCreateResourceGraphSchema: () => CvmCreateResourceGraphSchema,
|
|
79
|
+
CvmCreateResourceGraphV20260121Schema: () => CvmCreateResourceGraphV20260121Schema,
|
|
80
|
+
CvmCreateResourceGraphV20260522Schema: () => CvmCreateResourceGraphV20260522Schema,
|
|
71
81
|
CvmDetailV20251028Schema: () => CvmDetailV20251028Schema,
|
|
72
82
|
CvmGatewayInfoV20260121Schema: () => CvmGatewayInfoV20260121Schema,
|
|
73
83
|
CvmIdBaseSchema: () => CvmIdBaseSchema,
|
|
74
84
|
CvmIdObjectSchema: () => CvmIdObjectSchema,
|
|
75
85
|
CvmIdSchema: () => CvmIdSchema,
|
|
76
86
|
CvmInfoDetailV20260121Schema: () => CvmInfoDetailV20260121Schema,
|
|
87
|
+
CvmInfoDetailV20260522Schema: () => CvmInfoDetailV20260522Schema,
|
|
77
88
|
CvmInfoV20251028Schema: () => CvmInfoV20251028Schema,
|
|
78
89
|
CvmInfoV20260121Schema: () => CvmInfoV20260121Schema,
|
|
90
|
+
CvmInfoV20260522Schema: () => CvmInfoV20260522Schema,
|
|
79
91
|
CvmKmsInfoV20260121Schema: () => CvmKmsInfoV20260121Schema,
|
|
92
|
+
CvmLogUrlsV20260121Schema: () => CvmLogUrlsV20260121Schema,
|
|
80
93
|
CvmNetworkSchema: () => CvmNetworkSchema,
|
|
81
94
|
CvmNetworkUrlsV20251028Schema: () => CvmNetworkUrlsV20251028Schema,
|
|
82
95
|
CvmNodeInfoV20260121Schema: () => CvmNodeInfoV20260121Schema,
|
|
@@ -95,12 +108,13 @@ __export(index_exports, {
|
|
|
95
108
|
DeployAppAuthSchema: () => DeployAppAuthSchema,
|
|
96
109
|
DstackAppFullResponseV20251028Schema: () => DstackAppFullResponseV20251028Schema,
|
|
97
110
|
DstackAppFullResponseV20260121Schema: () => DstackAppFullResponseV20260121Schema,
|
|
111
|
+
DstackAppFullResponseV20260522Schema: () => DstackAppFullResponseV20260522Schema,
|
|
98
112
|
DstackAppListResponseV20251028Schema: () => DstackAppListResponseV20251028Schema,
|
|
99
113
|
DstackAppListResponseV20260121Schema: () => DstackAppListResponseV20260121Schema,
|
|
100
|
-
|
|
101
|
-
DstackAppMinimalResponseV20260121Schema: () => DstackAppMinimalResponseV20260121Schema,
|
|
114
|
+
DstackAppListResponseV20260522Schema: () => DstackAppListResponseV20260522Schema,
|
|
102
115
|
DstackAppWithCvmResponseV20251028Schema: () => DstackAppWithCvmResponseV20251028Schema,
|
|
103
116
|
DstackAppWithCvmResponseV20260121Schema: () => DstackAppWithCvmResponseV20260121Schema,
|
|
117
|
+
DstackAppWithCvmResponseV20260522Schema: () => DstackAppWithCvmResponseV20260522Schema,
|
|
104
118
|
ErrorCodes: () => ErrorCodes,
|
|
105
119
|
EventLogSchema: () => EventLogSchema,
|
|
106
120
|
FamilyGroupSchema: () => FamilyGroupSchema,
|
|
@@ -137,8 +151,10 @@ __export(index_exports, {
|
|
|
137
151
|
GetKmsOnChainDetailResponseSchema: () => GetKmsOnChainDetailResponseSchema,
|
|
138
152
|
GetOsImagesRequestSchema: () => GetOsImagesRequestSchema,
|
|
139
153
|
GetOsImagesResponseSchema: () => GetOsImagesResponseSchema,
|
|
154
|
+
GetPreLaunchScriptUpgradeStatusRequestSchema: () => GetPreLaunchScriptUpgradeStatusRequestSchema,
|
|
140
155
|
GetWorkspaceNodesSchema: () => GetWorkspaceNodesSchema,
|
|
141
156
|
GetWorkspaceQuotasSchema: () => GetWorkspaceQuotasSchema,
|
|
157
|
+
GpuAvailabilitySchema: () => GpuAvailabilitySchema,
|
|
142
158
|
ImportGithubProfileRequestSchema: () => ImportGithubProfileRequestSchema,
|
|
143
159
|
ImportGithubProfileResponseSchema: () => ImportGithubProfileResponseSchema,
|
|
144
160
|
InstanceIdRefreshResultSchema: () => InstanceIdRefreshResultSchema,
|
|
@@ -166,10 +182,12 @@ __export(index_exports, {
|
|
|
166
182
|
OnChainOsImageSchema: () => OnChainOsImageSchema,
|
|
167
183
|
PaginatedCvmInfosV20251028Schema: () => PaginatedCvmInfosV20251028Schema,
|
|
168
184
|
PaginatedCvmInfosV20260121Schema: () => PaginatedCvmInfosV20260121Schema,
|
|
185
|
+
PaginatedCvmInfosV20260522Schema: () => PaginatedCvmInfosV20260522Schema,
|
|
169
186
|
PaginationMetadataSchema: () => PaginationMetadataSchema,
|
|
170
187
|
PatchCvmRequestSchema: () => PatchCvmRequestSchema,
|
|
171
188
|
PatchCvmResultSchema: () => PatchCvmResultSchema,
|
|
172
189
|
PhalaCloudError: () => PhalaCloudError,
|
|
190
|
+
PreLaunchScriptUpgradeStatusSchema: () => PreLaunchScriptUpgradeStatusSchema,
|
|
173
191
|
ProvisionCvmComposeFileUpdateRequestSchema: () => ProvisionCvmComposeFileUpdateRequestSchema,
|
|
174
192
|
ProvisionCvmComposeFileUpdateResultSchema: () => ProvisionCvmComposeFileUpdateResultSchema,
|
|
175
193
|
ProvisionCvmRequestSchema: () => ProvisionCvmRequestSchema,
|
|
@@ -204,9 +222,14 @@ __export(index_exports, {
|
|
|
204
222
|
UpdateOsImageRequestSchema: () => UpdateOsImageRequestSchema,
|
|
205
223
|
UpdatePreLaunchScriptRequestSchema: () => UpdatePreLaunchScriptRequestSchema,
|
|
206
224
|
UpdatePreLaunchScriptResultSchema: () => UpdatePreLaunchScriptResultSchema,
|
|
225
|
+
UpgradePreLaunchScriptRequestSchema: () => UpgradePreLaunchScriptRequestSchema,
|
|
226
|
+
UpgradePreLaunchScriptResultSchema: () => UpgradePreLaunchScriptResultSchema,
|
|
207
227
|
UserInfoSchema: () => UserInfoSchema,
|
|
208
228
|
UserRefSchema: () => UserRefSchema,
|
|
229
|
+
VMAnySchema: () => VMAnySchema,
|
|
209
230
|
VMSchema: () => VMSchema,
|
|
231
|
+
VMV20260121Schema: () => VMV20260121Schema,
|
|
232
|
+
VMV20260522Schema: () => VMV20260522Schema,
|
|
210
233
|
ValidationError: () => ValidationError,
|
|
211
234
|
VmInfoV20251028Schema: () => VmInfoV20251028Schema,
|
|
212
235
|
WalletError: () => WalletError,
|
|
@@ -278,6 +301,7 @@ __export(index_exports, {
|
|
|
278
301
|
getCvmAttestation: () => getCvmAttestation,
|
|
279
302
|
getCvmComposeFile: () => getCvmComposeFile,
|
|
280
303
|
getCvmContainersStats: () => getCvmContainersStats,
|
|
304
|
+
getCvmCreateResources: () => getCvmCreateResources,
|
|
281
305
|
getCvmDockerCompose: () => getCvmDockerCompose,
|
|
282
306
|
getCvmInfo: () => getCvmInfo,
|
|
283
307
|
getCvmList: () => getCvmList,
|
|
@@ -292,6 +316,8 @@ __export(index_exports, {
|
|
|
292
316
|
getKmsList: () => getKmsList,
|
|
293
317
|
getKmsOnChainDetail: () => getKmsOnChainDetail,
|
|
294
318
|
getOsImages: () => getOsImages,
|
|
319
|
+
getPreLaunchScriptUpgradeStatus: () => getPreLaunchScriptUpgradeStatus,
|
|
320
|
+
getVMSchemaForVersion: () => getVMSchemaForVersion,
|
|
295
321
|
getValidationFields: () => getValidationFields,
|
|
296
322
|
getWorkspace: () => getWorkspace,
|
|
297
323
|
getWorkspaceNodes: () => getWorkspaceNodes,
|
|
@@ -351,6 +377,7 @@ __export(index_exports, {
|
|
|
351
377
|
safeGetCvmAttestation: () => safeGetCvmAttestation,
|
|
352
378
|
safeGetCvmComposeFile: () => safeGetCvmComposeFile,
|
|
353
379
|
safeGetCvmContainersStats: () => safeGetCvmContainersStats,
|
|
380
|
+
safeGetCvmCreateResources: () => safeGetCvmCreateResources,
|
|
354
381
|
safeGetCvmDockerCompose: () => safeGetCvmDockerCompose,
|
|
355
382
|
safeGetCvmInfo: () => safeGetCvmInfo,
|
|
356
383
|
safeGetCvmList: () => safeGetCvmList,
|
|
@@ -364,6 +391,7 @@ __export(index_exports, {
|
|
|
364
391
|
safeGetKmsList: () => safeGetKmsList,
|
|
365
392
|
safeGetKmsOnChainDetail: () => safeGetKmsOnChainDetail,
|
|
366
393
|
safeGetOsImages: () => safeGetOsImages,
|
|
394
|
+
safeGetPreLaunchScriptUpgradeStatus: () => safeGetPreLaunchScriptUpgradeStatus,
|
|
367
395
|
safeGetWorkspace: () => safeGetWorkspace,
|
|
368
396
|
safeGetWorkspaceNodes: () => safeGetWorkspaceNodes,
|
|
369
397
|
safeGetWorkspaceQuotas: () => safeGetWorkspaceQuotas,
|
|
@@ -392,6 +420,7 @@ __export(index_exports, {
|
|
|
392
420
|
safeUpdateDockerCompose: () => safeUpdateDockerCompose,
|
|
393
421
|
safeUpdateOsImage: () => safeUpdateOsImage,
|
|
394
422
|
safeUpdatePreLaunchScript: () => safeUpdatePreLaunchScript,
|
|
423
|
+
safeUpgradePreLaunchScript: () => safeUpgradePreLaunchScript,
|
|
395
424
|
safeValidateActionParameters: () => safeValidateActionParameters,
|
|
396
425
|
setAllowAnyDevice: () => setAllowAnyDevice,
|
|
397
426
|
shutdownCvm: () => shutdownCvm,
|
|
@@ -406,6 +435,7 @@ __export(index_exports, {
|
|
|
406
435
|
updateDockerCompose: () => updateDockerCompose,
|
|
407
436
|
updateOsImage: () => updateOsImage,
|
|
408
437
|
updatePreLaunchScript: () => updatePreLaunchScript,
|
|
438
|
+
upgradePreLaunchScript: () => upgradePreLaunchScript,
|
|
409
439
|
validateActionParameters: () => validateActionParameters,
|
|
410
440
|
validateComposePayloadSize: () => validateComposePayloadSize,
|
|
411
441
|
validateNetworkPrerequisites: () => validateNetworkPrerequisites,
|
|
@@ -441,6 +471,16 @@ var ApiErrorSchema = import_zod.z.object({
|
|
|
441
471
|
type: import_zod.z.string().optional(),
|
|
442
472
|
code: import_zod.z.string().optional()
|
|
443
473
|
});
|
|
474
|
+
function extractRequestId(data) {
|
|
475
|
+
if (!data || typeof data !== "object") {
|
|
476
|
+
return void 0;
|
|
477
|
+
}
|
|
478
|
+
const requestId = data.request_id;
|
|
479
|
+
return typeof requestId === "string" ? requestId : void 0;
|
|
480
|
+
}
|
|
481
|
+
function extractRequestIdFromResponse(response) {
|
|
482
|
+
return response?.headers?.get("X-Request-ID") ?? void 0;
|
|
483
|
+
}
|
|
444
484
|
var PhalaCloudError = class extends Error {
|
|
445
485
|
constructor(message, data) {
|
|
446
486
|
super(message);
|
|
@@ -448,6 +488,8 @@ var PhalaCloudError = class extends Error {
|
|
|
448
488
|
this.status = data.status;
|
|
449
489
|
this.statusText = data.statusText;
|
|
450
490
|
this.detail = data.detail;
|
|
491
|
+
this.requestId = data.requestId;
|
|
492
|
+
this.code = data.code;
|
|
451
493
|
if (Error.captureStackTrace) {
|
|
452
494
|
Error.captureStackTrace(this, this.constructor);
|
|
453
495
|
}
|
|
@@ -458,20 +500,24 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
458
500
|
super(message, {
|
|
459
501
|
status: options?.status ?? 0,
|
|
460
502
|
statusText: options?.statusText ?? "Unknown Error",
|
|
461
|
-
detail: options?.detail || message
|
|
503
|
+
detail: options?.detail || message,
|
|
504
|
+
requestId: options?.requestId,
|
|
505
|
+
code: options?.code
|
|
462
506
|
});
|
|
463
507
|
this.name = "RequestError";
|
|
464
508
|
this.isRequestError = true;
|
|
465
509
|
this.data = options?.data;
|
|
466
510
|
this.request = options?.request;
|
|
467
511
|
this.response = options?.response;
|
|
468
|
-
this.code = options?.code;
|
|
469
512
|
this.type = options?.type;
|
|
470
513
|
}
|
|
471
514
|
/**
|
|
472
515
|
* Create RequestError from FetchError
|
|
473
516
|
*/
|
|
474
517
|
static fromFetchError(error) {
|
|
518
|
+
const bodyRequestId = extractRequestId(error.data);
|
|
519
|
+
const headerRequestId = extractRequestIdFromResponse(error.response);
|
|
520
|
+
const requestId = bodyRequestId ?? headerRequestId;
|
|
475
521
|
const parseResult = ApiErrorSchema.safeParse(error.data);
|
|
476
522
|
if (parseResult.success) {
|
|
477
523
|
const detail = parseResult.data.detail ?? (error.data && typeof error.data === "object" && "error_code" in error.data ? error.data : void 0);
|
|
@@ -483,7 +529,22 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
483
529
|
response: error.response ?? void 0,
|
|
484
530
|
detail,
|
|
485
531
|
code: parseResult.data.code ?? void 0,
|
|
486
|
-
type: parseResult.data.type ?? void 0
|
|
532
|
+
type: parseResult.data.type ?? void 0,
|
|
533
|
+
requestId
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
const cause = error.cause;
|
|
537
|
+
if (cause?.name === "TimeoutError" || error.message?.includes("[TimeoutError]")) {
|
|
538
|
+
const message = "Request timed out. The server did not respond in time.";
|
|
539
|
+
return new _RequestError(message, {
|
|
540
|
+
status: 0,
|
|
541
|
+
statusText: "Request Timeout",
|
|
542
|
+
data: error.data,
|
|
543
|
+
request: error.request ?? void 0,
|
|
544
|
+
response: error.response ?? void 0,
|
|
545
|
+
detail: message,
|
|
546
|
+
code: "TIMEOUT",
|
|
547
|
+
requestId
|
|
487
548
|
});
|
|
488
549
|
}
|
|
489
550
|
return new _RequestError(error.message, {
|
|
@@ -492,8 +553,9 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
492
553
|
data: error.data,
|
|
493
554
|
request: error.request ?? void 0,
|
|
494
555
|
response: error.response ?? void 0,
|
|
495
|
-
detail: error.data?.detail || "Unknown API error",
|
|
496
|
-
code: error.status?.toString() ?? void 0
|
|
556
|
+
detail: error.data?.detail || error.message || "Unknown API error",
|
|
557
|
+
code: error.status?.toString() ?? void 0,
|
|
558
|
+
requestId
|
|
497
559
|
});
|
|
498
560
|
}
|
|
499
561
|
/**
|
|
@@ -619,6 +681,7 @@ function parseApiError(requestError) {
|
|
|
619
681
|
status,
|
|
620
682
|
statusText,
|
|
621
683
|
detail,
|
|
684
|
+
requestId: structured.request_id ?? requestError.requestId,
|
|
622
685
|
errorCode: structured.error_code,
|
|
623
686
|
structuredDetails: structured.details,
|
|
624
687
|
suggestions: structured.suggestions,
|
|
@@ -627,7 +690,13 @@ function parseApiError(requestError) {
|
|
|
627
690
|
}
|
|
628
691
|
const errorType = categorizeErrorType(status);
|
|
629
692
|
const message = extractPrimaryMessage(status, detail, requestError.message);
|
|
630
|
-
const commonData = {
|
|
693
|
+
const commonData = {
|
|
694
|
+
status,
|
|
695
|
+
statusText,
|
|
696
|
+
detail,
|
|
697
|
+
requestId: requestError.requestId,
|
|
698
|
+
code: requestError.code
|
|
699
|
+
};
|
|
631
700
|
if (errorType === "validation" && Array.isArray(detail)) {
|
|
632
701
|
const { errors } = parseValidationErrors(detail);
|
|
633
702
|
return new ValidationError(message, {
|
|
@@ -708,6 +777,7 @@ function parseStructuredError(detail) {
|
|
|
708
777
|
return {
|
|
709
778
|
error_code: obj.error_code,
|
|
710
779
|
message: obj.message,
|
|
780
|
+
request_id: typeof obj.request_id === "string" ? obj.request_id : void 0,
|
|
711
781
|
details: obj.details,
|
|
712
782
|
suggestions: obj.suggestions,
|
|
713
783
|
links: obj.links
|
|
@@ -723,6 +793,9 @@ function formatStructuredError(error, options) {
|
|
|
723
793
|
} else {
|
|
724
794
|
parts.push(error.message);
|
|
725
795
|
}
|
|
796
|
+
if (error.requestId) {
|
|
797
|
+
parts.push(`Request ID: ${error.requestId}`);
|
|
798
|
+
}
|
|
726
799
|
if (error.structuredDetails && error.structuredDetails.length > 0) {
|
|
727
800
|
parts.push("");
|
|
728
801
|
parts.push("Details:");
|
|
@@ -760,9 +833,10 @@ function isAppIdConflictError(error) {
|
|
|
760
833
|
// src/client.ts
|
|
761
834
|
var SUPPORTED_API_VERSIONS = [
|
|
762
835
|
"2025-10-28",
|
|
763
|
-
"2026-01-21"
|
|
836
|
+
"2026-01-21",
|
|
837
|
+
"2026-05-22"
|
|
764
838
|
];
|
|
765
|
-
var DEFAULT_API_VERSION = "2026-
|
|
839
|
+
var DEFAULT_API_VERSION = "2026-05-22";
|
|
766
840
|
var logger = (0, import_debug.default)("phala::api-client");
|
|
767
841
|
function formatHeaders(headers) {
|
|
768
842
|
return Object.entries(headers).map(([key, value]) => ` -H "${key}: ${value}"`).join("\n");
|
|
@@ -815,7 +889,7 @@ var Client = class _Client {
|
|
|
815
889
|
}
|
|
816
890
|
this.fetchInstance = import_ofetch.ofetch.create({
|
|
817
891
|
baseURL,
|
|
818
|
-
timeout: timeout ||
|
|
892
|
+
timeout: timeout || 6e4,
|
|
819
893
|
headers: requestHeaders,
|
|
820
894
|
...useCookieAuth ? { credentials: "include" } : {},
|
|
821
895
|
...fetchOptions,
|
|
@@ -1120,7 +1194,7 @@ var Client = class _Client {
|
|
|
1120
1194
|
*
|
|
1121
1195
|
* @example
|
|
1122
1196
|
* ```typescript
|
|
1123
|
-
* const client = createClient(); // defaults to 2026-
|
|
1197
|
+
* const client = createClient(); // defaults to 2026-05-22
|
|
1124
1198
|
* const legacyClient = client.withVersion("2025-10-28");
|
|
1125
1199
|
* const data = await getCvmInfo(legacyClient, { id: "xxx" });
|
|
1126
1200
|
* ```
|
|
@@ -1458,34 +1532,135 @@ var { action: getAvailableNodes, safeAction: safeGetAvailableNodes } = defineSim
|
|
|
1458
1532
|
}
|
|
1459
1533
|
);
|
|
1460
1534
|
|
|
1461
|
-
// src/actions/
|
|
1535
|
+
// src/actions/get_cvm_create_resources.ts
|
|
1462
1536
|
var import_zod6 = require("zod");
|
|
1463
|
-
var
|
|
1537
|
+
var ResourceIdV20260121Schema = import_zod6.z.union([import_zod6.z.number(), import_zod6.z.string()]);
|
|
1538
|
+
var HashIdSchema = import_zod6.z.string();
|
|
1539
|
+
var GpuAvailabilitySchema = import_zod6.z.object({
|
|
1540
|
+
has_reserved_gpus: import_zod6.z.boolean(),
|
|
1541
|
+
reserved_gpu_count: import_zod6.z.number(),
|
|
1542
|
+
has_public_gpus: import_zod6.z.boolean(),
|
|
1543
|
+
public_gpu_count: import_zod6.z.number()
|
|
1544
|
+
}).passthrough();
|
|
1545
|
+
var CvmCreateKmsResourceV20260121Schema = import_zod6.z.object({
|
|
1546
|
+
id: ResourceIdV20260121Schema,
|
|
1547
|
+
slug: import_zod6.z.string().nullable().optional(),
|
|
1548
|
+
url: import_zod6.z.string(),
|
|
1549
|
+
version: import_zod6.z.string().nullable().optional(),
|
|
1550
|
+
kms_type: import_zod6.z.string(),
|
|
1551
|
+
chain_id: import_zod6.z.number().nullable().optional(),
|
|
1552
|
+
kms_contract_id: ResourceIdV20260121Schema.nullable().optional(),
|
|
1553
|
+
kms_contract_address: import_zod6.z.string().nullable().optional(),
|
|
1554
|
+
gateway_app_id: import_zod6.z.string().nullable().optional(),
|
|
1555
|
+
supported_os_images: import_zod6.z.array(import_zod6.z.string()).default([])
|
|
1556
|
+
}).passthrough();
|
|
1557
|
+
var CvmCreateNodeKmsRelationV20260121Schema = import_zod6.z.object({
|
|
1558
|
+
teepod_id: import_zod6.z.number(),
|
|
1559
|
+
kms_id: ResourceIdV20260121Schema,
|
|
1560
|
+
kms_type: import_zod6.z.string(),
|
|
1561
|
+
kms_contract_id: ResourceIdV20260121Schema.nullable().optional(),
|
|
1562
|
+
kms_contract_address: import_zod6.z.string().nullable().optional(),
|
|
1563
|
+
supported_os_images: import_zod6.z.array(import_zod6.z.string()).default([])
|
|
1564
|
+
}).passthrough();
|
|
1565
|
+
var CvmCreateGatewayResourceV20260121Schema = import_zod6.z.object({
|
|
1566
|
+
id: ResourceIdV20260121Schema,
|
|
1567
|
+
teepod_id: import_zod6.z.number().nullable().optional(),
|
|
1568
|
+
kms_contract_id: ResourceIdV20260121Schema,
|
|
1569
|
+
rpc_url: import_zod6.z.string().nullable().optional(),
|
|
1570
|
+
domain_suffix: import_zod6.z.string().nullable().optional(),
|
|
1571
|
+
enabled: import_zod6.z.boolean()
|
|
1572
|
+
}).passthrough();
|
|
1573
|
+
var CvmCreateKmsResourceSchema = CvmCreateKmsResourceV20260121Schema.extend({
|
|
1574
|
+
id: HashIdSchema,
|
|
1575
|
+
kms_contract_id: HashIdSchema.nullable().optional()
|
|
1576
|
+
});
|
|
1577
|
+
var CvmCreateNodeKmsRelationSchema = CvmCreateNodeKmsRelationV20260121Schema.extend({
|
|
1578
|
+
kms_id: HashIdSchema,
|
|
1579
|
+
kms_contract_id: HashIdSchema.nullable().optional()
|
|
1580
|
+
});
|
|
1581
|
+
var CvmCreateGatewayResourceSchema = CvmCreateGatewayResourceV20260121Schema.extend({
|
|
1582
|
+
id: HashIdSchema,
|
|
1583
|
+
kms_contract_id: HashIdSchema
|
|
1584
|
+
});
|
|
1585
|
+
var CvmCreateInstanceTypeResourceSchema = import_zod6.z.object({
|
|
1464
1586
|
id: import_zod6.z.string(),
|
|
1465
1587
|
name: import_zod6.z.string(),
|
|
1466
|
-
description: import_zod6.z.string(),
|
|
1467
1588
|
vcpu: import_zod6.z.number(),
|
|
1468
1589
|
memory_mb: import_zod6.z.number(),
|
|
1469
|
-
|
|
1590
|
+
default_disk_size_gb: import_zod6.z.number(),
|
|
1470
1591
|
requires_gpu: import_zod6.z.boolean(),
|
|
1471
|
-
|
|
1472
|
-
family: import_zod6.z.string().nullable()
|
|
1592
|
+
requires_gpu_count: import_zod6.z.number(),
|
|
1593
|
+
family: import_zod6.z.string().nullable().optional(),
|
|
1594
|
+
display_order: import_zod6.z.number().nullable().optional()
|
|
1473
1595
|
}).passthrough();
|
|
1474
|
-
var
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1596
|
+
var CvmCreateResourceGraphV20260121Schema = import_zod6.z.object({
|
|
1597
|
+
tier: import_zod6.z.string(),
|
|
1598
|
+
capacity: ResourceThresholdSchema,
|
|
1599
|
+
nodes: import_zod6.z.array(TeepodCapacitySchema),
|
|
1600
|
+
kms_nodes: import_zod6.z.array(CvmCreateKmsResourceV20260121Schema),
|
|
1601
|
+
node_kms_relations: import_zod6.z.array(CvmCreateNodeKmsRelationV20260121Schema),
|
|
1602
|
+
gateway_nodes: import_zod6.z.array(CvmCreateGatewayResourceV20260121Schema),
|
|
1603
|
+
instance_types: import_zod6.z.array(CvmCreateInstanceTypeResourceSchema),
|
|
1604
|
+
gpu_availability: GpuAvailabilitySchema
|
|
1605
|
+
}).passthrough();
|
|
1606
|
+
var CvmCreateResourceGraphV20260522Schema = CvmCreateResourceGraphV20260121Schema.extend({
|
|
1607
|
+
kms_nodes: import_zod6.z.array(CvmCreateKmsResourceSchema),
|
|
1608
|
+
node_kms_relations: import_zod6.z.array(CvmCreateNodeKmsRelationSchema),
|
|
1609
|
+
gateway_nodes: import_zod6.z.array(CvmCreateGatewayResourceSchema)
|
|
1610
|
+
});
|
|
1611
|
+
var CvmCreateResourceGraphSchema = CvmCreateResourceGraphV20260522Schema;
|
|
1612
|
+
function getSchemaForVersion2(version) {
|
|
1613
|
+
if (version === "2026-01-21") return CvmCreateResourceGraphV20260121Schema;
|
|
1614
|
+
return CvmCreateResourceGraphV20260522Schema;
|
|
1615
|
+
}
|
|
1616
|
+
async function getCvmCreateResources(client, parameters) {
|
|
1617
|
+
const response = await client.get("/teepods/cvm-create-resources");
|
|
1618
|
+
if (parameters?.schema === false) return response;
|
|
1619
|
+
const schema = parameters?.schema || getSchemaForVersion2(client.config.version);
|
|
1620
|
+
return schema.parse(response);
|
|
1621
|
+
}
|
|
1622
|
+
async function safeGetCvmCreateResources(client, parameters) {
|
|
1623
|
+
try {
|
|
1624
|
+
const response = await client.get("/teepods/cvm-create-resources");
|
|
1625
|
+
if (parameters?.schema === false) {
|
|
1626
|
+
return { success: true, data: response };
|
|
1627
|
+
}
|
|
1628
|
+
const schema = parameters?.schema || getSchemaForVersion2(client.config.version);
|
|
1629
|
+
const data = schema.parse(response);
|
|
1630
|
+
return { success: true, data };
|
|
1631
|
+
} catch (error) {
|
|
1632
|
+
return { success: false, error };
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
// src/actions/list-instance-types.ts
|
|
1637
|
+
var import_zod7 = require("zod");
|
|
1638
|
+
var InstanceTypeSchema = import_zod7.z.object({
|
|
1639
|
+
id: import_zod7.z.string(),
|
|
1640
|
+
name: import_zod7.z.string(),
|
|
1641
|
+
description: import_zod7.z.string(),
|
|
1642
|
+
vcpu: import_zod7.z.number(),
|
|
1643
|
+
memory_mb: import_zod7.z.number(),
|
|
1644
|
+
hourly_rate: import_zod7.z.string(),
|
|
1645
|
+
requires_gpu: import_zod7.z.boolean(),
|
|
1646
|
+
default_disk_size_gb: import_zod7.z.number().default(20),
|
|
1647
|
+
family: import_zod7.z.string().nullable()
|
|
1648
|
+
}).passthrough();
|
|
1649
|
+
var FamilyGroupSchema = import_zod7.z.object({
|
|
1650
|
+
name: import_zod7.z.string(),
|
|
1651
|
+
items: import_zod7.z.array(InstanceTypeSchema),
|
|
1652
|
+
total: import_zod7.z.number()
|
|
1478
1653
|
}).strict();
|
|
1479
|
-
var AllFamiliesResponseSchema =
|
|
1480
|
-
result:
|
|
1654
|
+
var AllFamiliesResponseSchema = import_zod7.z.object({
|
|
1655
|
+
result: import_zod7.z.array(FamilyGroupSchema)
|
|
1481
1656
|
}).strict();
|
|
1482
|
-
var FamilyInstanceTypesResponseSchema =
|
|
1483
|
-
items:
|
|
1484
|
-
total:
|
|
1485
|
-
family:
|
|
1657
|
+
var FamilyInstanceTypesResponseSchema = import_zod7.z.object({
|
|
1658
|
+
items: import_zod7.z.array(InstanceTypeSchema),
|
|
1659
|
+
total: import_zod7.z.number(),
|
|
1660
|
+
family: import_zod7.z.string()
|
|
1486
1661
|
}).strict();
|
|
1487
|
-
var ListFamilyInstanceTypesRequestSchema =
|
|
1488
|
-
family:
|
|
1662
|
+
var ListFamilyInstanceTypesRequestSchema = import_zod7.z.object({
|
|
1663
|
+
family: import_zod7.z.string()
|
|
1489
1664
|
}).strict();
|
|
1490
1665
|
var { action: listAllInstanceTypeFamilies, safeAction: safeListAllInstanceTypeFamilies } = defineAction(
|
|
1491
1666
|
AllFamiliesResponseSchema,
|
|
@@ -1499,24 +1674,25 @@ var { action: listFamilyInstanceTypes, safeAction: safeListFamilyInstanceTypes }
|
|
|
1499
1674
|
});
|
|
1500
1675
|
|
|
1501
1676
|
// src/actions/workspaces/list_workspaces.ts
|
|
1502
|
-
var
|
|
1503
|
-
var WorkspaceResponseSchema =
|
|
1504
|
-
id:
|
|
1505
|
-
name:
|
|
1506
|
-
slug:
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1677
|
+
var import_zod8 = require("zod");
|
|
1678
|
+
var WorkspaceResponseSchema = import_zod8.z.object({
|
|
1679
|
+
id: import_zod8.z.string(),
|
|
1680
|
+
name: import_zod8.z.string(),
|
|
1681
|
+
slug: import_zod8.z.string().nullable(),
|
|
1682
|
+
avatar_url: import_zod8.z.string().nullable().optional(),
|
|
1683
|
+
tier: import_zod8.z.string(),
|
|
1684
|
+
role: import_zod8.z.string(),
|
|
1685
|
+
is_default: import_zod8.z.boolean(),
|
|
1686
|
+
created_at: import_zod8.z.string(),
|
|
1687
|
+
confidential_models_enabled: import_zod8.z.boolean().optional()
|
|
1512
1688
|
}).passthrough();
|
|
1513
|
-
var PaginationMetadataSchema =
|
|
1514
|
-
has_more:
|
|
1515
|
-
next_cursor:
|
|
1516
|
-
total:
|
|
1689
|
+
var PaginationMetadataSchema = import_zod8.z.object({
|
|
1690
|
+
has_more: import_zod8.z.boolean(),
|
|
1691
|
+
next_cursor: import_zod8.z.string().nullable(),
|
|
1692
|
+
total: import_zod8.z.number().nullable()
|
|
1517
1693
|
}).passthrough();
|
|
1518
|
-
var ListWorkspacesSchema =
|
|
1519
|
-
data:
|
|
1694
|
+
var ListWorkspacesSchema = import_zod8.z.object({
|
|
1695
|
+
data: import_zod8.z.array(WorkspaceResponseSchema),
|
|
1520
1696
|
pagination: PaginationMetadataSchema
|
|
1521
1697
|
}).passthrough();
|
|
1522
1698
|
var { action: listWorkspaces, safeAction: safeListWorkspaces } = defineAction(ListWorkspacesSchema, async (client, request) => {
|
|
@@ -1533,143 +1709,144 @@ var { action: getWorkspace, safeAction: safeGetWorkspace } = defineAction(Worksp
|
|
|
1533
1709
|
});
|
|
1534
1710
|
|
|
1535
1711
|
// src/types/cvm_info_v20251028.ts
|
|
1536
|
-
var
|
|
1537
|
-
var
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1712
|
+
var import_zod9 = require("zod");
|
|
1713
|
+
var TableIdSchema = import_zod9.z.union([import_zod9.z.number(), import_zod9.z.string()]);
|
|
1714
|
+
var VmInfoV20251028Schema = import_zod9.z.object({
|
|
1715
|
+
id: import_zod9.z.string(),
|
|
1716
|
+
name: import_zod9.z.string(),
|
|
1717
|
+
status: import_zod9.z.string(),
|
|
1718
|
+
uptime: import_zod9.z.string(),
|
|
1719
|
+
app_url: import_zod9.z.string().nullable(),
|
|
1720
|
+
app_id: import_zod9.z.string(),
|
|
1721
|
+
instance_id: import_zod9.z.string().nullable(),
|
|
1722
|
+
configuration: import_zod9.z.any().optional(),
|
|
1723
|
+
exited_at: import_zod9.z.string().nullable(),
|
|
1724
|
+
boot_progress: import_zod9.z.string().nullable(),
|
|
1725
|
+
boot_error: import_zod9.z.string().nullable(),
|
|
1726
|
+
shutdown_progress: import_zod9.z.string().nullable(),
|
|
1727
|
+
image_version: import_zod9.z.string().nullable()
|
|
1728
|
+
});
|
|
1729
|
+
var ManagedUserV20251028Schema = import_zod9.z.object({
|
|
1730
|
+
id: TableIdSchema,
|
|
1731
|
+
username: import_zod9.z.string()
|
|
1732
|
+
});
|
|
1733
|
+
var CvmNodeV20251028Schema = import_zod9.z.object({
|
|
1734
|
+
id: import_zod9.z.number(),
|
|
1735
|
+
name: import_zod9.z.string(),
|
|
1736
|
+
region_identifier: import_zod9.z.string().nullable().optional()
|
|
1560
1737
|
});
|
|
1561
|
-
var MachineInfoV20251028Schema =
|
|
1562
|
-
vcpu:
|
|
1563
|
-
memory:
|
|
1564
|
-
disk_size:
|
|
1565
|
-
gpu_count:
|
|
1738
|
+
var MachineInfoV20251028Schema = import_zod9.z.object({
|
|
1739
|
+
vcpu: import_zod9.z.number(),
|
|
1740
|
+
memory: import_zod9.z.number(),
|
|
1741
|
+
disk_size: import_zod9.z.number(),
|
|
1742
|
+
gpu_count: import_zod9.z.number().default(0)
|
|
1566
1743
|
});
|
|
1567
|
-
var CvmNetworkUrlsV20251028Schema =
|
|
1568
|
-
app:
|
|
1569
|
-
instance:
|
|
1744
|
+
var CvmNetworkUrlsV20251028Schema = import_zod9.z.object({
|
|
1745
|
+
app: import_zod9.z.string(),
|
|
1746
|
+
instance: import_zod9.z.string()
|
|
1570
1747
|
});
|
|
1571
|
-
var CvmInfoV20251028Schema =
|
|
1748
|
+
var CvmInfoV20251028Schema = import_zod9.z.object({
|
|
1572
1749
|
hosted: VmInfoV20251028Schema,
|
|
1573
|
-
name:
|
|
1750
|
+
name: import_zod9.z.string(),
|
|
1574
1751
|
managed_user: ManagedUserV20251028Schema.nullable(),
|
|
1575
1752
|
node: CvmNodeV20251028Schema.nullable(),
|
|
1576
|
-
listed:
|
|
1577
|
-
status:
|
|
1578
|
-
in_progress:
|
|
1579
|
-
dapp_dashboard_url:
|
|
1580
|
-
syslog_endpoint:
|
|
1581
|
-
allow_upgrade:
|
|
1582
|
-
project_id:
|
|
1583
|
-
project_type:
|
|
1584
|
-
billing_period:
|
|
1753
|
+
listed: import_zod9.z.boolean().default(false),
|
|
1754
|
+
status: import_zod9.z.string(),
|
|
1755
|
+
in_progress: import_zod9.z.boolean().default(false),
|
|
1756
|
+
dapp_dashboard_url: import_zod9.z.string().nullable(),
|
|
1757
|
+
syslog_endpoint: import_zod9.z.string().nullable(),
|
|
1758
|
+
allow_upgrade: import_zod9.z.boolean().default(false),
|
|
1759
|
+
project_id: import_zod9.z.string().nullable(),
|
|
1760
|
+
project_type: import_zod9.z.string().nullable(),
|
|
1761
|
+
billing_period: import_zod9.z.string().nullable(),
|
|
1585
1762
|
kms_info: KmsInfoSchema.nullable(),
|
|
1586
|
-
vcpu:
|
|
1587
|
-
memory:
|
|
1588
|
-
disk_size:
|
|
1589
|
-
gateway_domain:
|
|
1590
|
-
public_urls:
|
|
1763
|
+
vcpu: import_zod9.z.number().nullable(),
|
|
1764
|
+
memory: import_zod9.z.number().nullable(),
|
|
1765
|
+
disk_size: import_zod9.z.number().nullable(),
|
|
1766
|
+
gateway_domain: import_zod9.z.string().nullable(),
|
|
1767
|
+
public_urls: import_zod9.z.array(CvmNetworkUrlsV20251028Schema),
|
|
1591
1768
|
machine_info: MachineInfoV20251028Schema.nullable().optional(),
|
|
1592
|
-
updated_at:
|
|
1769
|
+
updated_at: import_zod9.z.string().nullable().optional()
|
|
1593
1770
|
});
|
|
1594
|
-
var CvmDetailV20251028Schema =
|
|
1595
|
-
id:
|
|
1596
|
-
name:
|
|
1597
|
-
status:
|
|
1598
|
-
in_progress:
|
|
1599
|
-
teepod_id:
|
|
1771
|
+
var CvmDetailV20251028Schema = import_zod9.z.object({
|
|
1772
|
+
id: TableIdSchema,
|
|
1773
|
+
name: import_zod9.z.string(),
|
|
1774
|
+
status: import_zod9.z.string(),
|
|
1775
|
+
in_progress: import_zod9.z.boolean().optional().default(false),
|
|
1776
|
+
teepod_id: import_zod9.z.number().nullable(),
|
|
1600
1777
|
teepod: CvmNodeV20251028Schema.optional().nullable(),
|
|
1601
|
-
app_id:
|
|
1602
|
-
vm_uuid:
|
|
1603
|
-
instance_id:
|
|
1604
|
-
vcpu:
|
|
1605
|
-
memory:
|
|
1606
|
-
disk_size:
|
|
1607
|
-
base_image:
|
|
1608
|
-
encrypted_env_pubkey:
|
|
1609
|
-
listed:
|
|
1610
|
-
project_id:
|
|
1611
|
-
project_type:
|
|
1612
|
-
instance_type:
|
|
1613
|
-
public_sysinfo:
|
|
1614
|
-
public_logs:
|
|
1615
|
-
dapp_dashboard_url:
|
|
1616
|
-
syslog_endpoint:
|
|
1778
|
+
app_id: import_zod9.z.string(),
|
|
1779
|
+
vm_uuid: import_zod9.z.string().nullable(),
|
|
1780
|
+
instance_id: import_zod9.z.string().nullable(),
|
|
1781
|
+
vcpu: import_zod9.z.number(),
|
|
1782
|
+
memory: import_zod9.z.number(),
|
|
1783
|
+
disk_size: import_zod9.z.number(),
|
|
1784
|
+
base_image: import_zod9.z.string().nullable(),
|
|
1785
|
+
encrypted_env_pubkey: import_zod9.z.string().nullable(),
|
|
1786
|
+
listed: import_zod9.z.boolean().optional().default(false),
|
|
1787
|
+
project_id: import_zod9.z.string().optional().nullable(),
|
|
1788
|
+
project_type: import_zod9.z.string().optional().nullable(),
|
|
1789
|
+
instance_type: import_zod9.z.string().optional().nullable(),
|
|
1790
|
+
public_sysinfo: import_zod9.z.boolean().optional().default(false),
|
|
1791
|
+
public_logs: import_zod9.z.boolean().optional().default(false),
|
|
1792
|
+
dapp_dashboard_url: import_zod9.z.string().optional().nullable(),
|
|
1793
|
+
syslog_endpoint: import_zod9.z.string().optional().nullable(),
|
|
1617
1794
|
kms_info: KmsInfoSchema.optional().nullable(),
|
|
1618
|
-
contract_address:
|
|
1619
|
-
deployer_address:
|
|
1620
|
-
scheduled_delete_at:
|
|
1621
|
-
public_urls:
|
|
1622
|
-
gateway_domain:
|
|
1795
|
+
contract_address: import_zod9.z.string().optional().nullable(),
|
|
1796
|
+
deployer_address: import_zod9.z.string().optional().nullable(),
|
|
1797
|
+
scheduled_delete_at: import_zod9.z.string().optional().nullable(),
|
|
1798
|
+
public_urls: import_zod9.z.array(CvmNetworkUrlsV20251028Schema).optional().default([]),
|
|
1799
|
+
gateway_domain: import_zod9.z.string().optional().nullable(),
|
|
1623
1800
|
machine_info: MachineInfoV20251028Schema.optional().nullable(),
|
|
1624
|
-
updated_at:
|
|
1801
|
+
updated_at: import_zod9.z.string().optional().nullable()
|
|
1625
1802
|
});
|
|
1626
|
-
var PaginatedCvmInfosV20251028Schema =
|
|
1627
|
-
items:
|
|
1628
|
-
total:
|
|
1629
|
-
page:
|
|
1630
|
-
page_size:
|
|
1631
|
-
pages:
|
|
1803
|
+
var PaginatedCvmInfosV20251028Schema = import_zod9.z.object({
|
|
1804
|
+
items: import_zod9.z.array(CvmInfoV20251028Schema),
|
|
1805
|
+
total: import_zod9.z.number(),
|
|
1806
|
+
page: import_zod9.z.number(),
|
|
1807
|
+
page_size: import_zod9.z.number(),
|
|
1808
|
+
pages: import_zod9.z.number()
|
|
1632
1809
|
});
|
|
1633
1810
|
|
|
1634
1811
|
// src/types/cvm_info_v20260121.ts
|
|
1635
|
-
var
|
|
1636
|
-
var BillingPeriodSchema =
|
|
1637
|
-
var KmsTypeSchema =
|
|
1638
|
-
var UserRefSchema =
|
|
1639
|
-
object_type:
|
|
1640
|
-
id:
|
|
1641
|
-
username:
|
|
1642
|
-
avatar_url:
|
|
1643
|
-
});
|
|
1644
|
-
var WorkspaceRefSchema =
|
|
1645
|
-
object_type:
|
|
1646
|
-
id:
|
|
1647
|
-
name:
|
|
1648
|
-
slug:
|
|
1649
|
-
avatar_url:
|
|
1650
|
-
});
|
|
1651
|
-
var CvmResourceInfoV20260121Schema =
|
|
1652
|
-
instance_type:
|
|
1653
|
-
vcpu:
|
|
1654
|
-
memory_in_gb:
|
|
1655
|
-
disk_in_gb:
|
|
1656
|
-
gpus:
|
|
1657
|
-
compute_billing_price:
|
|
1812
|
+
var import_zod10 = require("zod");
|
|
1813
|
+
var BillingPeriodSchema = import_zod10.z.enum(["skip", "hourly", "monthly"]);
|
|
1814
|
+
var KmsTypeSchema = import_zod10.z.enum(["phala", "ethereum", "base", "legacy"]);
|
|
1815
|
+
var UserRefSchema = import_zod10.z.object({
|
|
1816
|
+
object_type: import_zod10.z.literal("user"),
|
|
1817
|
+
id: import_zod10.z.string().nullable().optional(),
|
|
1818
|
+
username: import_zod10.z.string().nullable().optional(),
|
|
1819
|
+
avatar_url: import_zod10.z.string().nullable().optional()
|
|
1820
|
+
});
|
|
1821
|
+
var WorkspaceRefSchema = import_zod10.z.object({
|
|
1822
|
+
object_type: import_zod10.z.literal("workspace"),
|
|
1823
|
+
id: import_zod10.z.string(),
|
|
1824
|
+
name: import_zod10.z.string(),
|
|
1825
|
+
slug: import_zod10.z.string().nullable().optional(),
|
|
1826
|
+
avatar_url: import_zod10.z.string().nullable().optional()
|
|
1827
|
+
});
|
|
1828
|
+
var CvmResourceInfoV20260121Schema = import_zod10.z.object({
|
|
1829
|
+
instance_type: import_zod10.z.string().nullable().optional(),
|
|
1830
|
+
vcpu: import_zod10.z.number().int().nullable().optional(),
|
|
1831
|
+
memory_in_gb: import_zod10.z.number().nullable().optional(),
|
|
1832
|
+
disk_in_gb: import_zod10.z.number().int().nullable().optional(),
|
|
1833
|
+
gpus: import_zod10.z.number().int().nullable().optional(),
|
|
1834
|
+
compute_billing_price: import_zod10.z.string().nullable().optional(),
|
|
1658
1835
|
billing_period: BillingPeriodSchema.nullable().optional()
|
|
1659
1836
|
});
|
|
1660
|
-
var CvmOsInfoV20260121Schema =
|
|
1661
|
-
name:
|
|
1662
|
-
version:
|
|
1663
|
-
is_dev:
|
|
1664
|
-
os_image_hash:
|
|
1837
|
+
var CvmOsInfoV20260121Schema = import_zod10.z.object({
|
|
1838
|
+
name: import_zod10.z.string().nullable().optional(),
|
|
1839
|
+
version: import_zod10.z.string().nullable().optional(),
|
|
1840
|
+
is_dev: import_zod10.z.boolean().nullable().optional(),
|
|
1841
|
+
os_image_hash: import_zod10.z.string().nullable().optional()
|
|
1665
1842
|
});
|
|
1666
|
-
var CvmKmsInfoV20260121BaseSchema =
|
|
1667
|
-
chain_id:
|
|
1668
|
-
dstack_kms_address:
|
|
1669
|
-
dstack_app_address:
|
|
1670
|
-
deployer_address:
|
|
1671
|
-
rpc_endpoint:
|
|
1672
|
-
encrypted_env_pubkey:
|
|
1843
|
+
var CvmKmsInfoV20260121BaseSchema = import_zod10.z.object({
|
|
1844
|
+
chain_id: import_zod10.z.number().int().nullable().optional(),
|
|
1845
|
+
dstack_kms_address: import_zod10.z.string().nullable().optional(),
|
|
1846
|
+
dstack_app_address: import_zod10.z.string().nullable().optional(),
|
|
1847
|
+
deployer_address: import_zod10.z.string().nullable().optional(),
|
|
1848
|
+
rpc_endpoint: import_zod10.z.string().nullable().optional(),
|
|
1849
|
+
encrypted_env_pubkey: import_zod10.z.string().nullable().optional()
|
|
1673
1850
|
});
|
|
1674
1851
|
var CvmKmsInfoV20260121Schema = CvmKmsInfoV20260121BaseSchema.transform((data) => {
|
|
1675
1852
|
if (data.chain_id != null) {
|
|
@@ -1680,67 +1857,88 @@ var CvmKmsInfoV20260121Schema = CvmKmsInfoV20260121BaseSchema.transform((data) =
|
|
|
1680
1857
|
}
|
|
1681
1858
|
return data;
|
|
1682
1859
|
});
|
|
1683
|
-
var CvmProgressInfoV20260121Schema =
|
|
1684
|
-
target:
|
|
1685
|
-
started_at:
|
|
1686
|
-
correlation_id:
|
|
1687
|
-
});
|
|
1688
|
-
var CvmGatewayInfoV20260121Schema =
|
|
1689
|
-
base_domain:
|
|
1690
|
-
cname:
|
|
1691
|
-
});
|
|
1692
|
-
var
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1860
|
+
var CvmProgressInfoV20260121Schema = import_zod10.z.object({
|
|
1861
|
+
target: import_zod10.z.string().nullable().optional(),
|
|
1862
|
+
started_at: import_zod10.z.string().nullable().optional(),
|
|
1863
|
+
correlation_id: import_zod10.z.string().nullable().optional()
|
|
1864
|
+
});
|
|
1865
|
+
var CvmGatewayInfoV20260121Schema = import_zod10.z.object({
|
|
1866
|
+
base_domain: import_zod10.z.string().nullable().optional(),
|
|
1867
|
+
cname: import_zod10.z.string().nullable().optional()
|
|
1868
|
+
});
|
|
1869
|
+
var CvmLogUrlsV20260121Schema = import_zod10.z.object({
|
|
1870
|
+
serial: import_zod10.z.string().nullable().optional(),
|
|
1871
|
+
stdout: import_zod10.z.string().nullable().optional(),
|
|
1872
|
+
stderr: import_zod10.z.string().nullable().optional(),
|
|
1873
|
+
container_log_base: import_zod10.z.string().nullable().optional()
|
|
1874
|
+
});
|
|
1875
|
+
var NodeRefSchema = import_zod10.z.object({
|
|
1876
|
+
object_type: import_zod10.z.literal("node"),
|
|
1877
|
+
id: import_zod10.z.number().int().nullable().optional(),
|
|
1878
|
+
name: import_zod10.z.string().nullable().optional(),
|
|
1879
|
+
region: import_zod10.z.string().nullable().optional(),
|
|
1880
|
+
device_id: import_zod10.z.string().nullable().optional(),
|
|
1881
|
+
ppid: import_zod10.z.string().nullable().optional(),
|
|
1882
|
+
status: import_zod10.z.string().nullable().optional(),
|
|
1883
|
+
version: import_zod10.z.string().nullable().optional()
|
|
1701
1884
|
});
|
|
1702
1885
|
var CvmNodeInfoV20260121Schema = NodeRefSchema;
|
|
1703
|
-
var CvmInfoV20260121Schema =
|
|
1704
|
-
id:
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
instance_id: import_zod9.z.string().nullable().optional(),
|
|
1886
|
+
var CvmInfoV20260121Schema = import_zod10.z.object({
|
|
1887
|
+
id: import_zod10.z.string(),
|
|
1888
|
+
name: import_zod10.z.string(),
|
|
1889
|
+
app_id: import_zod10.z.string().nullable().optional(),
|
|
1890
|
+
vm_uuid: import_zod10.z.string().nullable().optional(),
|
|
1891
|
+
instance_id: import_zod10.z.string().nullable().optional(),
|
|
1710
1892
|
resource: CvmResourceInfoV20260121Schema,
|
|
1711
1893
|
node_info: NodeRefSchema.nullable().optional(),
|
|
1712
1894
|
os: CvmOsInfoV20260121Schema.nullable().optional(),
|
|
1713
1895
|
kms_type: KmsTypeSchema.nullable().optional(),
|
|
1714
1896
|
kms_info: CvmKmsInfoV20260121Schema.nullable().optional(),
|
|
1715
|
-
status:
|
|
1897
|
+
status: import_zod10.z.string(),
|
|
1898
|
+
in_progress: import_zod10.z.boolean().optional().default(false),
|
|
1716
1899
|
progress: CvmProgressInfoV20260121Schema.nullable().optional(),
|
|
1717
|
-
compose_hash:
|
|
1900
|
+
compose_hash: import_zod10.z.string().nullable().optional(),
|
|
1901
|
+
docker_compose_hash: import_zod10.z.string().nullable().optional(),
|
|
1902
|
+
pre_launch_script_hash: import_zod10.z.string().nullable().optional(),
|
|
1718
1903
|
gateway: CvmGatewayInfoV20260121Schema,
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1904
|
+
logs: CvmLogUrlsV20260121Schema.optional().default({}),
|
|
1905
|
+
services: import_zod10.z.array(import_zod10.z.record(import_zod10.z.any())).optional().default([]),
|
|
1906
|
+
endpoints: import_zod10.z.array(CvmNetworkUrlsV20251028Schema).nullable().optional(),
|
|
1907
|
+
public_logs: import_zod10.z.boolean().optional(),
|
|
1908
|
+
public_sysinfo: import_zod10.z.boolean().optional(),
|
|
1909
|
+
public_tcbinfo: import_zod10.z.boolean().optional(),
|
|
1910
|
+
gateway_enabled: import_zod10.z.boolean().optional(),
|
|
1911
|
+
secure_time: import_zod10.z.boolean().optional(),
|
|
1912
|
+
listed: import_zod10.z.boolean().optional().default(false),
|
|
1913
|
+
storage_fs: import_zod10.z.string().optional(),
|
|
1728
1914
|
workspace: WorkspaceRefSchema.nullable().optional(),
|
|
1729
|
-
creator: UserRefSchema.nullable().optional()
|
|
1915
|
+
creator: UserRefSchema.nullable().optional(),
|
|
1916
|
+
created_at: import_zod10.z.string().nullable().optional(),
|
|
1917
|
+
deleted_at: import_zod10.z.string().nullable().optional(),
|
|
1918
|
+
project_type: import_zod10.z.string().nullable().optional()
|
|
1919
|
+
});
|
|
1920
|
+
var CvmInfoV20260522Schema = CvmInfoV20260121Schema.extend({
|
|
1921
|
+
id: import_zod10.z.string()
|
|
1730
1922
|
});
|
|
1731
1923
|
var CvmInfoDetailV20260121Schema = CvmInfoV20260121Schema.extend({
|
|
1732
|
-
compose_file:
|
|
1924
|
+
compose_file: import_zod10.z.union([import_zod10.z.record(import_zod10.z.any()), import_zod10.z.string()]).nullable().optional()
|
|
1733
1925
|
});
|
|
1734
|
-
var
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1926
|
+
var CvmInfoDetailV20260522Schema = CvmInfoV20260522Schema.extend({
|
|
1927
|
+
compose_file: import_zod10.z.union([import_zod10.z.record(import_zod10.z.any()), import_zod10.z.string()]).nullable().optional()
|
|
1928
|
+
});
|
|
1929
|
+
var PaginatedCvmInfosV20260121Schema = import_zod10.z.object({
|
|
1930
|
+
items: import_zod10.z.array(CvmInfoV20260121Schema),
|
|
1931
|
+
total: import_zod10.z.number(),
|
|
1932
|
+
page: import_zod10.z.number(),
|
|
1933
|
+
page_size: import_zod10.z.number(),
|
|
1934
|
+
pages: import_zod10.z.number()
|
|
1935
|
+
});
|
|
1936
|
+
var PaginatedCvmInfosV20260522Schema = PaginatedCvmInfosV20260121Schema.extend({
|
|
1937
|
+
items: import_zod10.z.array(CvmInfoV20260522Schema)
|
|
1740
1938
|
});
|
|
1741
1939
|
|
|
1742
1940
|
// src/types/cvm_id.ts
|
|
1743
|
-
var
|
|
1941
|
+
var import_zod11 = require("zod");
|
|
1744
1942
|
|
|
1745
1943
|
// src/utils/hostname.ts
|
|
1746
1944
|
function isValidHostname(name) {
|
|
@@ -1798,20 +1996,20 @@ function generateDefaultCvmName(prefix = "dstack-app") {
|
|
|
1798
1996
|
}
|
|
1799
1997
|
|
|
1800
1998
|
// src/types/cvm_id.ts
|
|
1801
|
-
var CvmIdObjectSchema =
|
|
1999
|
+
var CvmIdObjectSchema = import_zod11.z.object({
|
|
1802
2000
|
/** Direct CVM ID (any format) - accepts any string including names */
|
|
1803
|
-
id:
|
|
2001
|
+
id: import_zod11.z.string().optional(),
|
|
1804
2002
|
/** UUID format (with or without dashes) */
|
|
1805
|
-
uuid:
|
|
2003
|
+
uuid: import_zod11.z.string().regex(
|
|
1806
2004
|
/^[0-9a-f]{8}[-]?[0-9a-f]{4}[-]?4[0-9a-f]{3}[-]?[89ab][0-9a-f]{3}[-]?[0-9a-f]{12}$/i,
|
|
1807
2005
|
"Invalid UUID format"
|
|
1808
2006
|
).optional(),
|
|
1809
2007
|
/** App ID (40 characters, optionally prefixed with 'app_id_') */
|
|
1810
|
-
app_id:
|
|
2008
|
+
app_id: import_zod11.z.string().optional(),
|
|
1811
2009
|
/** Instance ID (40 characters, optionally prefixed with 'instance_') */
|
|
1812
|
-
instance_id:
|
|
2010
|
+
instance_id: import_zod11.z.string().optional(),
|
|
1813
2011
|
/** CVM name (RFC 1123 hostname format: 5-63 chars, starts with letter, alphanumeric + hyphens) */
|
|
1814
|
-
name:
|
|
2012
|
+
name: import_zod11.z.string().refine(isValidHostname, {
|
|
1815
2013
|
message: "Name must be 5-63 characters, start with letter, and contain only letters/numbers/hyphens"
|
|
1816
2014
|
}).optional()
|
|
1817
2015
|
});
|
|
@@ -1855,13 +2053,15 @@ var CvmIdSchema = CvmIdBaseSchema.transform((data) => {
|
|
|
1855
2053
|
|
|
1856
2054
|
// src/actions/cvms/get_cvm_info.ts
|
|
1857
2055
|
var GetCvmInfoRequestSchema = CvmIdSchema;
|
|
1858
|
-
function
|
|
1859
|
-
|
|
2056
|
+
function getSchemaForVersion3(version) {
|
|
2057
|
+
if (version === "2025-10-28") return CvmDetailV20251028Schema;
|
|
2058
|
+
if (version === "2026-01-21") return CvmInfoDetailV20260121Schema;
|
|
2059
|
+
return CvmInfoDetailV20260522Schema;
|
|
1860
2060
|
}
|
|
1861
2061
|
async function getCvmInfo(client, request) {
|
|
1862
2062
|
const { cvmId } = GetCvmInfoRequestSchema.parse(request);
|
|
1863
2063
|
const response = await client.get(`/cvms/${cvmId}`);
|
|
1864
|
-
const schema =
|
|
2064
|
+
const schema = getSchemaForVersion3(client.config.version);
|
|
1865
2065
|
return schema.parse(response);
|
|
1866
2066
|
}
|
|
1867
2067
|
async function safeGetCvmInfo(client, request) {
|
|
@@ -1883,21 +2083,23 @@ async function safeGetCvmInfo(client, request) {
|
|
|
1883
2083
|
}
|
|
1884
2084
|
|
|
1885
2085
|
// src/actions/cvms/get_cvm_list.ts
|
|
1886
|
-
var
|
|
1887
|
-
var GetCvmListRequestSchema =
|
|
1888
|
-
page:
|
|
1889
|
-
page_size:
|
|
1890
|
-
node_id:
|
|
1891
|
-
teepod_id:
|
|
1892
|
-
user_id:
|
|
2086
|
+
var import_zod12 = require("zod");
|
|
2087
|
+
var GetCvmListRequestSchema = import_zod12.z.object({
|
|
2088
|
+
page: import_zod12.z.number().int().min(1).optional(),
|
|
2089
|
+
page_size: import_zod12.z.number().int().min(1).optional(),
|
|
2090
|
+
node_id: import_zod12.z.number().int().min(1).optional(),
|
|
2091
|
+
teepod_id: import_zod12.z.number().int().min(1).optional(),
|
|
2092
|
+
user_id: import_zod12.z.string().optional()
|
|
1893
2093
|
}).strict();
|
|
1894
|
-
function
|
|
1895
|
-
|
|
2094
|
+
function getSchemaForVersion4(version) {
|
|
2095
|
+
if (version === "2025-10-28") return PaginatedCvmInfosV20251028Schema;
|
|
2096
|
+
if (version === "2026-01-21") return PaginatedCvmInfosV20260121Schema;
|
|
2097
|
+
return PaginatedCvmInfosV20260522Schema;
|
|
1896
2098
|
}
|
|
1897
2099
|
async function getCvmList(client, request) {
|
|
1898
2100
|
const validatedRequest = GetCvmListRequestSchema.parse(request ?? {});
|
|
1899
2101
|
const response = await client.get("/cvms/paginated", { params: validatedRequest });
|
|
1900
|
-
const schema =
|
|
2102
|
+
const schema = getSchemaForVersion4(client.config.version);
|
|
1901
2103
|
return schema.parse(response);
|
|
1902
2104
|
}
|
|
1903
2105
|
async function safeGetCvmList(client, request) {
|
|
@@ -1919,10 +2121,10 @@ async function safeGetCvmList(client, request) {
|
|
|
1919
2121
|
}
|
|
1920
2122
|
|
|
1921
2123
|
// src/actions/cvms/provision_cvm.ts
|
|
1922
|
-
var
|
|
2124
|
+
var import_zod14 = require("zod");
|
|
1923
2125
|
|
|
1924
2126
|
// src/types/app_compose.ts
|
|
1925
|
-
var
|
|
2127
|
+
var import_zod13 = require("zod");
|
|
1926
2128
|
var MAX_COMPOSE_PAYLOAD_BYTES = 200 * 1024;
|
|
1927
2129
|
function validateComposePayloadSize(dockerComposeFile, preLaunchScript, ctx) {
|
|
1928
2130
|
const encoder = new TextEncoder();
|
|
@@ -1933,43 +2135,52 @@ function validateComposePayloadSize(dockerComposeFile, preLaunchScript, ctx) {
|
|
|
1933
2135
|
const maxKB = MAX_COMPOSE_PAYLOAD_BYTES / 1024;
|
|
1934
2136
|
const currentKB = Math.ceil(totalSize / 1024);
|
|
1935
2137
|
ctx.addIssue({
|
|
1936
|
-
code:
|
|
2138
|
+
code: import_zod13.z.ZodIssueCode.custom,
|
|
1937
2139
|
message: `Combined size of docker_compose_file and pre_launch_script must not exceed ${maxKB}KB (current: ${currentKB}KB)`
|
|
1938
2140
|
});
|
|
1939
2141
|
}
|
|
1940
2142
|
}
|
|
1941
|
-
var LooseAppComposeSchema =
|
|
1942
|
-
allowed_envs:
|
|
1943
|
-
docker_compose_file:
|
|
1944
|
-
features:
|
|
1945
|
-
name:
|
|
1946
|
-
manifest_version:
|
|
1947
|
-
kms_enabled:
|
|
1948
|
-
public_logs:
|
|
1949
|
-
public_sysinfo:
|
|
1950
|
-
tproxy_enabled:
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
2143
|
+
var LooseAppComposeSchema = import_zod13.z.object({
|
|
2144
|
+
allowed_envs: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
2145
|
+
docker_compose_file: import_zod13.z.string(),
|
|
2146
|
+
features: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
2147
|
+
name: import_zod13.z.string().optional(),
|
|
2148
|
+
manifest_version: import_zod13.z.number().optional(),
|
|
2149
|
+
kms_enabled: import_zod13.z.boolean().optional(),
|
|
2150
|
+
public_logs: import_zod13.z.boolean().optional(),
|
|
2151
|
+
public_sysinfo: import_zod13.z.boolean().optional(),
|
|
2152
|
+
tproxy_enabled: import_zod13.z.boolean().optional(),
|
|
2153
|
+
port_policy: import_zod13.z.object({
|
|
2154
|
+
ports: import_zod13.z.array(
|
|
2155
|
+
import_zod13.z.object({
|
|
2156
|
+
port: import_zod13.z.number().int().min(1).max(65535),
|
|
2157
|
+
pp: import_zod13.z.boolean()
|
|
2158
|
+
})
|
|
2159
|
+
),
|
|
2160
|
+
restrict_mode: import_zod13.z.boolean()
|
|
2161
|
+
}).optional(),
|
|
2162
|
+
storage_fs: import_zod13.z.enum(["ext4", "zfs"]).optional(),
|
|
2163
|
+
pre_launch_script: import_zod13.z.string().optional(),
|
|
2164
|
+
env_pubkey: import_zod13.z.string().optional(),
|
|
2165
|
+
salt: import_zod13.z.string().optional().nullable()
|
|
1955
2166
|
}).passthrough().superRefine((data, ctx) => {
|
|
1956
2167
|
validateComposePayloadSize(data.docker_compose_file, data.pre_launch_script, ctx);
|
|
1957
2168
|
});
|
|
1958
2169
|
|
|
1959
2170
|
// src/actions/cvms/provision_cvm.ts
|
|
1960
|
-
var ProvisionCvmSchema =
|
|
1961
|
-
app_id:
|
|
1962
|
-
app_env_encrypt_pubkey:
|
|
1963
|
-
compose_hash:
|
|
2171
|
+
var ProvisionCvmSchema = import_zod14.z.object({
|
|
2172
|
+
app_id: import_zod14.z.string().nullable().optional(),
|
|
2173
|
+
app_env_encrypt_pubkey: import_zod14.z.string().nullable().optional(),
|
|
2174
|
+
compose_hash: import_zod14.z.string(),
|
|
1964
2175
|
kms_info: KmsInfoSchema.nullable().optional(),
|
|
1965
|
-
fmspc:
|
|
1966
|
-
device_id:
|
|
1967
|
-
os_image_hash:
|
|
1968
|
-
instance_type:
|
|
1969
|
-
teepod_id:
|
|
2176
|
+
fmspc: import_zod14.z.string().nullable().optional(),
|
|
2177
|
+
device_id: import_zod14.z.string().nullable().optional(),
|
|
2178
|
+
os_image_hash: import_zod14.z.string().nullable().optional(),
|
|
2179
|
+
instance_type: import_zod14.z.string().nullable().optional(),
|
|
2180
|
+
teepod_id: import_zod14.z.number().nullable().optional(),
|
|
1970
2181
|
// Will be transformed to node_id
|
|
1971
|
-
node_id:
|
|
1972
|
-
kms_id:
|
|
2182
|
+
node_id: import_zod14.z.number().nullable().optional(),
|
|
2183
|
+
kms_id: import_zod14.z.string().nullable().optional()
|
|
1973
2184
|
}).passthrough().transform((data) => {
|
|
1974
2185
|
if ("teepod_id" in data && data.teepod_id !== void 0) {
|
|
1975
2186
|
const { teepod_id, ...rest } = data;
|
|
@@ -1978,50 +2189,53 @@ var ProvisionCvmSchema = import_zod13.z.object({
|
|
|
1978
2189
|
return data;
|
|
1979
2190
|
});
|
|
1980
2191
|
var NAME_VALIDATION_MESSAGE = "Name must be 5-63 characters, start with letter, and contain only letters/numbers/hyphens";
|
|
1981
|
-
var ProvisionCvmRequestSchema =
|
|
1982
|
-
node_id:
|
|
2192
|
+
var ProvisionCvmRequestSchema = import_zod14.z.object({
|
|
2193
|
+
node_id: import_zod14.z.number().optional(),
|
|
1983
2194
|
// recommended - optional, system auto-selects if not specified
|
|
1984
|
-
teepod_id:
|
|
2195
|
+
teepod_id: import_zod14.z.number().optional(),
|
|
1985
2196
|
// deprecated, for compatibility
|
|
1986
|
-
region:
|
|
2197
|
+
region: import_zod14.z.string().optional(),
|
|
1987
2198
|
// optional - region filter for auto-selection
|
|
1988
|
-
name:
|
|
1989
|
-
instance_type:
|
|
2199
|
+
name: import_zod14.z.string().min(5, NAME_VALIDATION_MESSAGE).max(63, NAME_VALIDATION_MESSAGE).refine((val) => isValidHostname(val), NAME_VALIDATION_MESSAGE),
|
|
2200
|
+
instance_type: import_zod14.z.string().optional(),
|
|
1990
2201
|
// optional, defaults to "tdx.small" when no resource params specified
|
|
1991
|
-
image:
|
|
1992
|
-
vcpu:
|
|
2202
|
+
image: import_zod14.z.string().optional(),
|
|
2203
|
+
vcpu: import_zod14.z.number().optional(),
|
|
1993
2204
|
// deprecated, use instance_type instead
|
|
1994
|
-
memory:
|
|
2205
|
+
memory: import_zod14.z.number().optional(),
|
|
1995
2206
|
// deprecated, use instance_type instead
|
|
1996
|
-
disk_size:
|
|
1997
|
-
compose_file:
|
|
1998
|
-
allowed_envs:
|
|
1999
|
-
pre_launch_script:
|
|
2000
|
-
docker_compose_file:
|
|
2001
|
-
name:
|
|
2207
|
+
disk_size: import_zod14.z.number().optional(),
|
|
2208
|
+
compose_file: import_zod14.z.object({
|
|
2209
|
+
allowed_envs: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
2210
|
+
pre_launch_script: import_zod14.z.string().optional(),
|
|
2211
|
+
docker_compose_file: import_zod14.z.string().optional(),
|
|
2212
|
+
name: import_zod14.z.string().optional().default(""),
|
|
2002
2213
|
// optional with default empty string
|
|
2003
|
-
kms_enabled:
|
|
2004
|
-
public_logs:
|
|
2005
|
-
public_sysinfo:
|
|
2006
|
-
gateway_enabled:
|
|
2214
|
+
kms_enabled: import_zod14.z.boolean().optional(),
|
|
2215
|
+
public_logs: import_zod14.z.boolean().optional(),
|
|
2216
|
+
public_sysinfo: import_zod14.z.boolean().optional(),
|
|
2217
|
+
gateway_enabled: import_zod14.z.boolean().optional(),
|
|
2007
2218
|
// recommended
|
|
2008
|
-
tproxy_enabled:
|
|
2219
|
+
tproxy_enabled: import_zod14.z.boolean().optional(),
|
|
2009
2220
|
// deprecated, for compatibility
|
|
2010
|
-
storage_fs:
|
|
2011
|
-
}).superRefine((data, ctx) => {
|
|
2221
|
+
storage_fs: import_zod14.z.enum(["ext4", "zfs"]).optional()
|
|
2222
|
+
}).passthrough().superRefine((data, ctx) => {
|
|
2012
2223
|
validateComposePayloadSize(data.docker_compose_file, data.pre_launch_script, ctx);
|
|
2013
2224
|
}),
|
|
2014
|
-
listed:
|
|
2015
|
-
kms_id:
|
|
2016
|
-
kms:
|
|
2225
|
+
listed: import_zod14.z.boolean().optional(),
|
|
2226
|
+
kms_id: import_zod14.z.string().optional(),
|
|
2227
|
+
kms: import_zod14.z.enum(["PHALA", "ETHEREUM", "BASE"]).optional(),
|
|
2017
2228
|
// KMS type selection (defaults to PHALA)
|
|
2018
|
-
kms_contract:
|
|
2229
|
+
kms_contract: import_zod14.z.string().optional(),
|
|
2019
2230
|
// KMS contract address for on-chain KMS
|
|
2020
|
-
|
|
2231
|
+
kms_contract_id: import_zod14.z.union([import_zod14.z.string(), import_zod14.z.number()]).optional(),
|
|
2232
|
+
key_provider_mode: import_zod14.z.enum(["kms", "local"]).optional(),
|
|
2233
|
+
skip_gateway: import_zod14.z.boolean().optional(),
|
|
2234
|
+
env_keys: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
2021
2235
|
// Manual nonce specification (Advanced - PHALA KMS only)
|
|
2022
|
-
nonce:
|
|
2236
|
+
nonce: import_zod14.z.number().optional(),
|
|
2023
2237
|
// User-specified nonce for deterministic app_id generation
|
|
2024
|
-
app_id:
|
|
2238
|
+
app_id: import_zod14.z.string().optional()
|
|
2025
2239
|
// Expected app_id (must match calculated app_id from nonce)
|
|
2026
2240
|
}).passthrough().transform((data) => {
|
|
2027
2241
|
if (!data.instance_type && !data.vcpu && !data.memory) {
|
|
@@ -2053,59 +2267,90 @@ function handleGatewayCompatibility(appCompose) {
|
|
|
2053
2267
|
var { action: provisionCvm, safeAction: safeProvisionCvm } = defineAction(ProvisionCvmSchema, async (client, appCompose) => {
|
|
2054
2268
|
const validated = ProvisionCvmRequestSchema.parse(appCompose);
|
|
2055
2269
|
const body = handleGatewayCompatibility(validated);
|
|
2056
|
-
|
|
2057
|
-
if (typeof body.node_id === "number") {
|
|
2058
|
-
requestBody = { ...body, teepod_id: body.node_id };
|
|
2059
|
-
delete requestBody.node_id;
|
|
2060
|
-
} else if (typeof body.teepod_id === "number") {
|
|
2270
|
+
if (typeof body.teepod_id === "number" && typeof body.node_id !== "number") {
|
|
2061
2271
|
console.warn("[phala/cloud] teepod_id is deprecated, please use node_id instead.");
|
|
2062
2272
|
}
|
|
2063
|
-
return await client.post("/cvms/provision",
|
|
2273
|
+
return await client.post("/cvms/provision", body);
|
|
2064
2274
|
});
|
|
2065
2275
|
|
|
2066
2276
|
// src/actions/cvms/commit_cvm_provision.ts
|
|
2067
|
-
var
|
|
2068
|
-
var
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
name: import_zod14.z.string()
|
|
2277
|
+
var import_zod15 = require("zod");
|
|
2278
|
+
var CommitCvmProvisionBaseSchema = import_zod15.z.object({
|
|
2279
|
+
name: import_zod15.z.string(),
|
|
2280
|
+
status: import_zod15.z.string(),
|
|
2281
|
+
teepod_id: import_zod15.z.number(),
|
|
2282
|
+
teepod: import_zod15.z.object({
|
|
2283
|
+
id: import_zod15.z.number(),
|
|
2284
|
+
name: import_zod15.z.string()
|
|
2076
2285
|
}).nullable(),
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
instance_id: import_zod14.z.string().nullable(),
|
|
2286
|
+
app_id: import_zod15.z.string().nullable(),
|
|
2287
|
+
vm_uuid: import_zod15.z.string().nullable(),
|
|
2288
|
+
instance_id: import_zod15.z.string().nullable(),
|
|
2081
2289
|
// Deprecated fields - will be removed in next API version
|
|
2082
|
-
app_url:
|
|
2083
|
-
base_image:
|
|
2084
|
-
vcpu:
|
|
2085
|
-
memory:
|
|
2086
|
-
disk_size:
|
|
2087
|
-
manifest_version:
|
|
2088
|
-
version:
|
|
2089
|
-
runner:
|
|
2090
|
-
docker_compose_file:
|
|
2091
|
-
features:
|
|
2092
|
-
created_at:
|
|
2093
|
-
encrypted_env_pubkey:
|
|
2094
|
-
app_auth_contract_address:
|
|
2095
|
-
deployer_address:
|
|
2096
|
-
}).passthrough();
|
|
2097
|
-
var CommitCvmProvisionRequestSchema = import_zod14.z.object({
|
|
2098
|
-
encrypted_env: import_zod14.z.string().optional().nullable(),
|
|
2099
|
-
app_id: import_zod14.z.string(),
|
|
2100
|
-
compose_hash: import_zod14.z.string(),
|
|
2101
|
-
kms_id: import_zod14.z.string().optional(),
|
|
2102
|
-
contract_address: import_zod14.z.string().optional(),
|
|
2103
|
-
deployer_address: import_zod14.z.string().optional(),
|
|
2104
|
-
env_keys: import_zod14.z.array(import_zod14.z.string()).optional().nullable()
|
|
2290
|
+
app_url: import_zod15.z.string().nullable().default(null),
|
|
2291
|
+
base_image: import_zod15.z.string().nullable(),
|
|
2292
|
+
vcpu: import_zod15.z.number(),
|
|
2293
|
+
memory: import_zod15.z.number(),
|
|
2294
|
+
disk_size: import_zod15.z.number(),
|
|
2295
|
+
manifest_version: import_zod15.z.number().nullable().default(2),
|
|
2296
|
+
version: import_zod15.z.string().nullable().default("1.0.0"),
|
|
2297
|
+
runner: import_zod15.z.string().nullable().default("docker-compose"),
|
|
2298
|
+
docker_compose_file: import_zod15.z.string().nullable(),
|
|
2299
|
+
features: import_zod15.z.array(import_zod15.z.string()).nullable().default(["kms", "tproxy-net"]),
|
|
2300
|
+
created_at: import_zod15.z.string(),
|
|
2301
|
+
encrypted_env_pubkey: import_zod15.z.string().nullable().optional(),
|
|
2302
|
+
app_auth_contract_address: import_zod15.z.string().nullable().optional(),
|
|
2303
|
+
deployer_address: import_zod15.z.string().nullable().optional()
|
|
2105
2304
|
}).passthrough();
|
|
2106
|
-
var
|
|
2107
|
-
|
|
2305
|
+
var CommitCvmProvisionV20260121Schema = CommitCvmProvisionBaseSchema.extend({
|
|
2306
|
+
id: import_zod15.z.number(),
|
|
2307
|
+
user_id: import_zod15.z.number().nullable()
|
|
2108
2308
|
});
|
|
2309
|
+
var CommitCvmProvisionV20260522Schema = CommitCvmProvisionBaseSchema.extend({
|
|
2310
|
+
id: import_zod15.z.string(),
|
|
2311
|
+
user_id: import_zod15.z.string().nullable()
|
|
2312
|
+
});
|
|
2313
|
+
var CommitCvmProvisionAnySchema = import_zod15.z.union([
|
|
2314
|
+
CommitCvmProvisionV20260121Schema,
|
|
2315
|
+
CommitCvmProvisionV20260522Schema
|
|
2316
|
+
]);
|
|
2317
|
+
var CommitCvmProvisionSchema = CommitCvmProvisionV20260522Schema;
|
|
2318
|
+
var CommitCvmProvisionRequestSchema = import_zod15.z.object({
|
|
2319
|
+
encrypted_env: import_zod15.z.string().optional().nullable(),
|
|
2320
|
+
app_id: import_zod15.z.string(),
|
|
2321
|
+
compose_hash: import_zod15.z.string(),
|
|
2322
|
+
kms_id: import_zod15.z.string().optional(),
|
|
2323
|
+
contract_address: import_zod15.z.string().optional(),
|
|
2324
|
+
deployer_address: import_zod15.z.string().optional(),
|
|
2325
|
+
env_keys: import_zod15.z.array(import_zod15.z.string()).optional().nullable()
|
|
2326
|
+
}).passthrough();
|
|
2327
|
+
function getSchemaForVersion5(version) {
|
|
2328
|
+
if (version === "2026-01-21") return CommitCvmProvisionV20260121Schema;
|
|
2329
|
+
return CommitCvmProvisionV20260522Schema;
|
|
2330
|
+
}
|
|
2331
|
+
async function commitCvmProvision(client, payload) {
|
|
2332
|
+
const response = await client.post("/cvms", payload);
|
|
2333
|
+
return getSchemaForVersion5(client.config.version).parse(
|
|
2334
|
+
response
|
|
2335
|
+
);
|
|
2336
|
+
}
|
|
2337
|
+
async function safeCommitCvmProvision(client, payload) {
|
|
2338
|
+
try {
|
|
2339
|
+
const data = await commitCvmProvision(client, payload);
|
|
2340
|
+
return { success: true, data };
|
|
2341
|
+
} catch (error) {
|
|
2342
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2343
|
+
return { success: false, error };
|
|
2344
|
+
}
|
|
2345
|
+
return {
|
|
2346
|
+
success: false,
|
|
2347
|
+
error: {
|
|
2348
|
+
name: "Error",
|
|
2349
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2350
|
+
}
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2109
2354
|
|
|
2110
2355
|
// src/utils/get_compose_hash.ts
|
|
2111
2356
|
var import_crypto = __toESM(require("crypto"));
|
|
@@ -2167,20 +2412,20 @@ var { action: getCvmComposeFile, safeAction: safeGetCvmComposeFile } = defineAct
|
|
|
2167
2412
|
});
|
|
2168
2413
|
|
|
2169
2414
|
// src/actions/cvms/provision_cvm_compose_file_update.ts
|
|
2170
|
-
var
|
|
2171
|
-
var ProvisionCvmComposeFileUpdateRequestSchema =
|
|
2172
|
-
id:
|
|
2173
|
-
uuid:
|
|
2174
|
-
app_id:
|
|
2415
|
+
var import_zod16 = require("zod");
|
|
2416
|
+
var ProvisionCvmComposeFileUpdateRequestSchema = import_zod16.z.object({
|
|
2417
|
+
id: import_zod16.z.string().optional(),
|
|
2418
|
+
uuid: import_zod16.z.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(),
|
|
2419
|
+
app_id: import_zod16.z.string().refine(
|
|
2175
2420
|
(val) => !val.startsWith("app_") && val.length === 40,
|
|
2176
2421
|
"app_id should be 40 characters without prefix"
|
|
2177
2422
|
).transform((val) => val.startsWith("app_") ? val : `app_${val}`).optional(),
|
|
2178
|
-
instance_id:
|
|
2423
|
+
instance_id: import_zod16.z.string().refine(
|
|
2179
2424
|
(val) => !val.startsWith("instance_") && val.length === 40,
|
|
2180
2425
|
"instance_id should be 40 characters without prefix"
|
|
2181
2426
|
).transform((val) => val.startsWith("instance_") ? val : `instance_${val}`).optional(),
|
|
2182
2427
|
app_compose: LooseAppComposeSchema,
|
|
2183
|
-
update_env_vars:
|
|
2428
|
+
update_env_vars: import_zod16.z.boolean().optional().nullable()
|
|
2184
2429
|
}).refine(
|
|
2185
2430
|
(data) => !!(data.id || data.uuid || data.app_id || data.instance_id),
|
|
2186
2431
|
"One of id, uuid, app_id, or instance_id must be provided"
|
|
@@ -2191,12 +2436,12 @@ var ProvisionCvmComposeFileUpdateRequestSchema = import_zod15.z.object({
|
|
|
2191
2436
|
_raw: data
|
|
2192
2437
|
};
|
|
2193
2438
|
});
|
|
2194
|
-
var ProvisionCvmComposeFileUpdateResultSchema =
|
|
2195
|
-
app_id:
|
|
2196
|
-
device_id:
|
|
2197
|
-
compose_hash:
|
|
2439
|
+
var ProvisionCvmComposeFileUpdateResultSchema = import_zod16.z.object({
|
|
2440
|
+
app_id: import_zod16.z.string().nullable(),
|
|
2441
|
+
device_id: import_zod16.z.string().nullable(),
|
|
2442
|
+
compose_hash: import_zod16.z.string(),
|
|
2198
2443
|
kms_info: KmsInfoSchema.nullable().optional(),
|
|
2199
|
-
compose_hash_registered:
|
|
2444
|
+
compose_hash_registered: import_zod16.z.boolean().optional().default(false)
|
|
2200
2445
|
}).passthrough();
|
|
2201
2446
|
var { action: provisionCvmComposeFileUpdate, safeAction: safeProvisionCvmComposeFileUpdate } = defineAction(ProvisionCvmComposeFileUpdateResultSchema, async (client, request) => {
|
|
2202
2447
|
const validatedRequest = ProvisionCvmComposeFileUpdateRequestSchema.parse(request);
|
|
@@ -2207,22 +2452,22 @@ var { action: provisionCvmComposeFileUpdate, safeAction: safeProvisionCvmCompose
|
|
|
2207
2452
|
});
|
|
2208
2453
|
|
|
2209
2454
|
// src/actions/cvms/commit_cvm_compose_file_update.ts
|
|
2210
|
-
var
|
|
2211
|
-
var CommitCvmComposeFileUpdateRequestSchema =
|
|
2212
|
-
id:
|
|
2213
|
-
uuid:
|
|
2214
|
-
app_id:
|
|
2455
|
+
var import_zod17 = require("zod");
|
|
2456
|
+
var CommitCvmComposeFileUpdateRequestSchema = import_zod17.z.object({
|
|
2457
|
+
id: import_zod17.z.string().optional(),
|
|
2458
|
+
uuid: import_zod17.z.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(),
|
|
2459
|
+
app_id: import_zod17.z.string().refine(
|
|
2215
2460
|
(val) => !val.startsWith("app_") && val.length === 40,
|
|
2216
2461
|
"app_id should be 40 characters without prefix"
|
|
2217
2462
|
).transform((val) => val.startsWith("app_") ? val : `app_${val}`).optional(),
|
|
2218
|
-
instance_id:
|
|
2463
|
+
instance_id: import_zod17.z.string().refine(
|
|
2219
2464
|
(val) => !val.startsWith("instance_") && val.length === 40,
|
|
2220
2465
|
"instance_id should be 40 characters without prefix"
|
|
2221
2466
|
).transform((val) => val.startsWith("instance_") ? val : `instance_${val}`).optional(),
|
|
2222
|
-
compose_hash:
|
|
2223
|
-
encrypted_env:
|
|
2224
|
-
env_keys:
|
|
2225
|
-
update_env_vars:
|
|
2467
|
+
compose_hash: import_zod17.z.string().min(1, "Compose hash is required"),
|
|
2468
|
+
encrypted_env: import_zod17.z.string().optional(),
|
|
2469
|
+
env_keys: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
2470
|
+
update_env_vars: import_zod17.z.boolean().optional().nullable()
|
|
2226
2471
|
}).refine(
|
|
2227
2472
|
(data) => !!(data.id || data.uuid || data.app_id || data.instance_id),
|
|
2228
2473
|
"One of id, uuid, app_id, or instance_id must be provided"
|
|
@@ -2234,7 +2479,7 @@ var CommitCvmComposeFileUpdateRequestSchema = import_zod16.z.object({
|
|
|
2234
2479
|
update_env_vars: data.update_env_vars ?? void 0,
|
|
2235
2480
|
_raw: data
|
|
2236
2481
|
}));
|
|
2237
|
-
var CommitCvmComposeFileUpdateSchema =
|
|
2482
|
+
var CommitCvmComposeFileUpdateSchema = import_zod17.z.any().transform(() => void 0);
|
|
2238
2483
|
var { action: commitCvmComposeFileUpdate, safeAction: safeCommitCvmComposeFileUpdate } = defineAction(
|
|
2239
2484
|
CommitCvmComposeFileUpdateSchema,
|
|
2240
2485
|
async (client, request) => {
|
|
@@ -2249,13 +2494,13 @@ var { action: commitCvmComposeFileUpdate, safeAction: safeCommitCvmComposeFileUp
|
|
|
2249
2494
|
);
|
|
2250
2495
|
|
|
2251
2496
|
// src/actions/cvms/update_cvm_envs.ts
|
|
2252
|
-
var
|
|
2497
|
+
var import_zod18 = require("zod");
|
|
2253
2498
|
var UpdateCvmEnvsRequestSchema = refineCvmId(
|
|
2254
2499
|
CvmIdObjectSchema.extend({
|
|
2255
|
-
encrypted_env:
|
|
2256
|
-
env_keys:
|
|
2257
|
-
compose_hash:
|
|
2258
|
-
transaction_hash:
|
|
2500
|
+
encrypted_env: import_zod18.z.string().describe("Encrypted environment variables (hex string)"),
|
|
2501
|
+
env_keys: import_zod18.z.array(import_zod18.z.string()).optional().describe("List of allowed environment variable keys"),
|
|
2502
|
+
compose_hash: import_zod18.z.string().optional().describe("Compose hash for verification (Phase 2, required when env_keys changes)"),
|
|
2503
|
+
transaction_hash: import_zod18.z.string().optional().describe(
|
|
2259
2504
|
"On-chain transaction hash for verification (Phase 2, required when env_keys changes)"
|
|
2260
2505
|
)
|
|
2261
2506
|
})
|
|
@@ -2272,21 +2517,21 @@ var UpdateCvmEnvsRequestSchema = refineCvmId(
|
|
|
2272
2517
|
_raw: data
|
|
2273
2518
|
};
|
|
2274
2519
|
});
|
|
2275
|
-
var UpdateCvmEnvsInProgressSchema =
|
|
2276
|
-
status:
|
|
2277
|
-
message:
|
|
2278
|
-
correlation_id:
|
|
2279
|
-
allowed_envs_changed:
|
|
2280
|
-
});
|
|
2281
|
-
var UpdateCvmEnvsPreconditionRequiredSchema =
|
|
2282
|
-
status:
|
|
2283
|
-
message:
|
|
2284
|
-
compose_hash:
|
|
2285
|
-
app_id:
|
|
2286
|
-
device_id:
|
|
2520
|
+
var UpdateCvmEnvsInProgressSchema = import_zod18.z.object({
|
|
2521
|
+
status: import_zod18.z.literal("in_progress"),
|
|
2522
|
+
message: import_zod18.z.string(),
|
|
2523
|
+
correlation_id: import_zod18.z.string(),
|
|
2524
|
+
allowed_envs_changed: import_zod18.z.boolean()
|
|
2525
|
+
});
|
|
2526
|
+
var UpdateCvmEnvsPreconditionRequiredSchema = import_zod18.z.object({
|
|
2527
|
+
status: import_zod18.z.literal("precondition_required"),
|
|
2528
|
+
message: import_zod18.z.string(),
|
|
2529
|
+
compose_hash: import_zod18.z.string(),
|
|
2530
|
+
app_id: import_zod18.z.string(),
|
|
2531
|
+
device_id: import_zod18.z.string(),
|
|
2287
2532
|
kms_info: KmsInfoSchema
|
|
2288
2533
|
});
|
|
2289
|
-
var UpdateCvmEnvsResultSchema =
|
|
2534
|
+
var UpdateCvmEnvsResultSchema = import_zod18.z.union([
|
|
2290
2535
|
UpdateCvmEnvsInProgressSchema,
|
|
2291
2536
|
UpdateCvmEnvsPreconditionRequiredSchema
|
|
2292
2537
|
]);
|
|
@@ -2328,12 +2573,12 @@ var { action: updateCvmEnvs, safeAction: safeUpdateCvmEnvs } = defineAction(Upda
|
|
|
2328
2573
|
});
|
|
2329
2574
|
|
|
2330
2575
|
// src/actions/cvms/update_docker_compose.ts
|
|
2331
|
-
var
|
|
2576
|
+
var import_zod19 = require("zod");
|
|
2332
2577
|
var UpdateDockerComposeRequestSchema = refineCvmId(
|
|
2333
2578
|
CvmIdObjectSchema.extend({
|
|
2334
|
-
docker_compose_file:
|
|
2335
|
-
compose_hash:
|
|
2336
|
-
transaction_hash:
|
|
2579
|
+
docker_compose_file: import_zod19.z.string().describe("Docker Compose YAML content"),
|
|
2580
|
+
compose_hash: import_zod19.z.string().optional().describe("Compose hash for verification (Phase 2, contract-owned KMS only)"),
|
|
2581
|
+
transaction_hash: import_zod19.z.string().optional().describe("On-chain transaction hash for verification (Phase 2, contract-owned KMS only)")
|
|
2337
2582
|
})
|
|
2338
2583
|
).transform((data) => {
|
|
2339
2584
|
const { cvmId } = CvmIdSchema.parse(data);
|
|
@@ -2347,20 +2592,20 @@ var UpdateDockerComposeRequestSchema = refineCvmId(
|
|
|
2347
2592
|
_raw: data
|
|
2348
2593
|
};
|
|
2349
2594
|
});
|
|
2350
|
-
var UpdateDockerComposeInProgressSchema =
|
|
2351
|
-
status:
|
|
2352
|
-
message:
|
|
2353
|
-
correlation_id:
|
|
2595
|
+
var UpdateDockerComposeInProgressSchema = import_zod19.z.object({
|
|
2596
|
+
status: import_zod19.z.literal("in_progress"),
|
|
2597
|
+
message: import_zod19.z.string(),
|
|
2598
|
+
correlation_id: import_zod19.z.string()
|
|
2354
2599
|
});
|
|
2355
|
-
var UpdateDockerComposePreconditionRequiredSchema =
|
|
2356
|
-
status:
|
|
2357
|
-
message:
|
|
2358
|
-
compose_hash:
|
|
2359
|
-
app_id:
|
|
2360
|
-
device_id:
|
|
2600
|
+
var UpdateDockerComposePreconditionRequiredSchema = import_zod19.z.object({
|
|
2601
|
+
status: import_zod19.z.literal("precondition_required"),
|
|
2602
|
+
message: import_zod19.z.string(),
|
|
2603
|
+
compose_hash: import_zod19.z.string(),
|
|
2604
|
+
app_id: import_zod19.z.string(),
|
|
2605
|
+
device_id: import_zod19.z.string(),
|
|
2361
2606
|
kms_info: KmsInfoSchema
|
|
2362
2607
|
});
|
|
2363
|
-
var UpdateDockerComposeResultSchema =
|
|
2608
|
+
var UpdateDockerComposeResultSchema = import_zod19.z.union([
|
|
2364
2609
|
UpdateDockerComposeInProgressSchema,
|
|
2365
2610
|
UpdateDockerComposePreconditionRequiredSchema
|
|
2366
2611
|
]);
|
|
@@ -2412,12 +2657,12 @@ var { action: updateDockerCompose, safeAction: safeUpdateDockerCompose } = defin
|
|
|
2412
2657
|
});
|
|
2413
2658
|
|
|
2414
2659
|
// src/actions/cvms/update_prelaunch_script.ts
|
|
2415
|
-
var
|
|
2660
|
+
var import_zod20 = require("zod");
|
|
2416
2661
|
var UpdatePreLaunchScriptRequestSchema = refineCvmId(
|
|
2417
2662
|
CvmIdObjectSchema.extend({
|
|
2418
|
-
pre_launch_script:
|
|
2419
|
-
compose_hash:
|
|
2420
|
-
transaction_hash:
|
|
2663
|
+
pre_launch_script: import_zod20.z.string().describe("Pre-launch script content (shell script)"),
|
|
2664
|
+
compose_hash: import_zod20.z.string().optional().describe("Compose hash for verification (Phase 2, contract-owned KMS only)"),
|
|
2665
|
+
transaction_hash: import_zod20.z.string().optional().describe("On-chain transaction hash for verification (Phase 2, contract-owned KMS only)")
|
|
2421
2666
|
})
|
|
2422
2667
|
).transform((data) => {
|
|
2423
2668
|
const { cvmId } = CvmIdSchema.parse(data);
|
|
@@ -2431,20 +2676,20 @@ var UpdatePreLaunchScriptRequestSchema = refineCvmId(
|
|
|
2431
2676
|
_raw: data
|
|
2432
2677
|
};
|
|
2433
2678
|
});
|
|
2434
|
-
var UpdatePreLaunchScriptInProgressSchema =
|
|
2435
|
-
status:
|
|
2436
|
-
message:
|
|
2437
|
-
correlation_id:
|
|
2438
|
-
});
|
|
2439
|
-
var UpdatePreLaunchScriptPreconditionRequiredSchema =
|
|
2440
|
-
status:
|
|
2441
|
-
message:
|
|
2442
|
-
compose_hash:
|
|
2443
|
-
app_id:
|
|
2444
|
-
device_id:
|
|
2679
|
+
var UpdatePreLaunchScriptInProgressSchema = import_zod20.z.object({
|
|
2680
|
+
status: import_zod20.z.literal("in_progress"),
|
|
2681
|
+
message: import_zod20.z.string(),
|
|
2682
|
+
correlation_id: import_zod20.z.string()
|
|
2683
|
+
});
|
|
2684
|
+
var UpdatePreLaunchScriptPreconditionRequiredSchema = import_zod20.z.object({
|
|
2685
|
+
status: import_zod20.z.literal("precondition_required"),
|
|
2686
|
+
message: import_zod20.z.string(),
|
|
2687
|
+
compose_hash: import_zod20.z.string(),
|
|
2688
|
+
app_id: import_zod20.z.string(),
|
|
2689
|
+
device_id: import_zod20.z.string(),
|
|
2445
2690
|
kms_info: KmsInfoSchema
|
|
2446
2691
|
});
|
|
2447
|
-
var UpdatePreLaunchScriptResultSchema =
|
|
2692
|
+
var UpdatePreLaunchScriptResultSchema = import_zod20.z.union([
|
|
2448
2693
|
UpdatePreLaunchScriptInProgressSchema,
|
|
2449
2694
|
UpdatePreLaunchScriptPreconditionRequiredSchema
|
|
2450
2695
|
]);
|
|
@@ -2496,17 +2741,115 @@ var { action: updatePreLaunchScript, safeAction: safeUpdatePreLaunchScript } = d
|
|
|
2496
2741
|
});
|
|
2497
2742
|
|
|
2498
2743
|
// src/actions/cvms/get_cvm_prelaunch_script.ts
|
|
2499
|
-
var
|
|
2744
|
+
var import_zod21 = require("zod");
|
|
2500
2745
|
var GetCvmPreLaunchScriptRequestSchema = CvmIdSchema;
|
|
2501
|
-
var { action: getCvmPreLaunchScript, safeAction: safeGetCvmPreLaunchScript } = defineAction(
|
|
2746
|
+
var { action: getCvmPreLaunchScript, safeAction: safeGetCvmPreLaunchScript } = defineAction(import_zod21.z.string(), async (client, request) => {
|
|
2502
2747
|
const { cvmId } = GetCvmPreLaunchScriptRequestSchema.parse(request);
|
|
2503
2748
|
return await client.get(`/cvms/${cvmId}/pre-launch-script`);
|
|
2504
2749
|
});
|
|
2505
2750
|
|
|
2751
|
+
// src/actions/cvms/get_prelaunch_script_upgrade_status.ts
|
|
2752
|
+
var import_zod22 = require("zod");
|
|
2753
|
+
var GetPreLaunchScriptUpgradeStatusRequestSchema = CvmIdSchema;
|
|
2754
|
+
var PreLaunchScriptUpgradeStatusSchema = import_zod22.z.object({
|
|
2755
|
+
current_hash: import_zod22.z.string().nullable(),
|
|
2756
|
+
latest_official_hash: import_zod22.z.string(),
|
|
2757
|
+
is_official: import_zod22.z.boolean(),
|
|
2758
|
+
is_latest: import_zod22.z.boolean(),
|
|
2759
|
+
can_upgrade: import_zod22.z.boolean()
|
|
2760
|
+
});
|
|
2761
|
+
var { action: getPreLaunchScriptUpgradeStatus, safeAction: safeGetPreLaunchScriptUpgradeStatus } = defineAction(
|
|
2762
|
+
PreLaunchScriptUpgradeStatusSchema,
|
|
2763
|
+
async (client, request) => {
|
|
2764
|
+
const { cvmId } = GetPreLaunchScriptUpgradeStatusRequestSchema.parse(request);
|
|
2765
|
+
return await client.get(`/cvms/${cvmId}/pre-launch-script/upgrade-status`);
|
|
2766
|
+
}
|
|
2767
|
+
);
|
|
2768
|
+
|
|
2769
|
+
// src/actions/cvms/upgrade_prelaunch_script.ts
|
|
2770
|
+
var import_zod23 = require("zod");
|
|
2771
|
+
var UpgradePreLaunchScriptRequestSchema = refineCvmId(
|
|
2772
|
+
CvmIdObjectSchema.extend({
|
|
2773
|
+
compose_hash: import_zod23.z.string().optional().describe("Compose hash for verification (Phase 2, contract-owned KMS only)"),
|
|
2774
|
+
transaction_hash: import_zod23.z.string().optional().describe("On-chain transaction hash for verification (Phase 2, contract-owned KMS only)")
|
|
2775
|
+
})
|
|
2776
|
+
).transform((data) => {
|
|
2777
|
+
const { cvmId } = CvmIdSchema.parse(data);
|
|
2778
|
+
return {
|
|
2779
|
+
cvmId,
|
|
2780
|
+
request: {
|
|
2781
|
+
compose_hash: data.compose_hash,
|
|
2782
|
+
transaction_hash: data.transaction_hash
|
|
2783
|
+
},
|
|
2784
|
+
_raw: data
|
|
2785
|
+
};
|
|
2786
|
+
});
|
|
2787
|
+
var UpgradePreLaunchScriptInProgressSchema = import_zod23.z.object({
|
|
2788
|
+
status: import_zod23.z.literal("in_progress"),
|
|
2789
|
+
message: import_zod23.z.string(),
|
|
2790
|
+
correlation_id: import_zod23.z.string()
|
|
2791
|
+
});
|
|
2792
|
+
var UpgradePreLaunchScriptPreconditionRequiredSchema = import_zod23.z.object({
|
|
2793
|
+
status: import_zod23.z.literal("precondition_required"),
|
|
2794
|
+
message: import_zod23.z.string(),
|
|
2795
|
+
compose_hash: import_zod23.z.string(),
|
|
2796
|
+
app_id: import_zod23.z.string(),
|
|
2797
|
+
device_id: import_zod23.z.string(),
|
|
2798
|
+
kms_info: KmsInfoSchema
|
|
2799
|
+
});
|
|
2800
|
+
var UpgradePreLaunchScriptResultSchema = import_zod23.z.union([
|
|
2801
|
+
UpgradePreLaunchScriptInProgressSchema,
|
|
2802
|
+
UpgradePreLaunchScriptPreconditionRequiredSchema
|
|
2803
|
+
]);
|
|
2804
|
+
var { action: upgradePreLaunchScript, safeAction: safeUpgradePreLaunchScript } = defineAction(UpgradePreLaunchScriptResultSchema, async (client, request) => {
|
|
2805
|
+
const validated = UpgradePreLaunchScriptRequestSchema.parse(request);
|
|
2806
|
+
const headers = {};
|
|
2807
|
+
if (validated.request.compose_hash) {
|
|
2808
|
+
headers["X-Compose-Hash"] = validated.request.compose_hash;
|
|
2809
|
+
}
|
|
2810
|
+
if (validated.request.transaction_hash) {
|
|
2811
|
+
headers["X-Transaction-Hash"] = validated.request.transaction_hash;
|
|
2812
|
+
}
|
|
2813
|
+
try {
|
|
2814
|
+
const response = await client.post(
|
|
2815
|
+
`/cvms/${validated.cvmId}/pre-launch-script/upgrade-to-latest-official`,
|
|
2816
|
+
void 0,
|
|
2817
|
+
{ headers }
|
|
2818
|
+
);
|
|
2819
|
+
return response;
|
|
2820
|
+
} catch (error) {
|
|
2821
|
+
if (error instanceof PhalaCloudError && error.status === 465) {
|
|
2822
|
+
const detail = error.detail;
|
|
2823
|
+
if (detail && typeof detail === "object") {
|
|
2824
|
+
const detailObj = detail;
|
|
2825
|
+
const detailsArray = detailObj.details;
|
|
2826
|
+
if (detailsArray && Array.isArray(detailsArray)) {
|
|
2827
|
+
const fieldMap = new Map(detailsArray.map((d) => [d.field, d.value]));
|
|
2828
|
+
const composeHash = fieldMap.get("compose_hash");
|
|
2829
|
+
const appId = fieldMap.get("app_id");
|
|
2830
|
+
const deviceId = fieldMap.get("device_id");
|
|
2831
|
+
const kmsInfo = fieldMap.get("kms_info");
|
|
2832
|
+
if (composeHash && appId) {
|
|
2833
|
+
return {
|
|
2834
|
+
status: "precondition_required",
|
|
2835
|
+
message: detailObj.message || "Compose hash verification required",
|
|
2836
|
+
compose_hash: composeHash,
|
|
2837
|
+
app_id: appId,
|
|
2838
|
+
device_id: deviceId || "",
|
|
2839
|
+
kms_info: kmsInfo
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
throw error;
|
|
2846
|
+
}
|
|
2847
|
+
});
|
|
2848
|
+
|
|
2506
2849
|
// src/actions/kms/get_kms_info.ts
|
|
2507
|
-
var
|
|
2508
|
-
var GetKmsInfoRequestSchema =
|
|
2509
|
-
kms_id:
|
|
2850
|
+
var import_zod24 = require("zod");
|
|
2851
|
+
var GetKmsInfoRequestSchema = import_zod24.z.object({
|
|
2852
|
+
kms_id: import_zod24.z.string().min(1, "KMS ID is required")
|
|
2510
2853
|
});
|
|
2511
2854
|
var { action: getKmsInfo, safeAction: safeGetKmsInfo } = defineAction(KmsInfoSchema, async (client, request) => {
|
|
2512
2855
|
const validatedRequest = GetKmsInfoRequestSchema.parse(request);
|
|
@@ -2514,18 +2857,18 @@ var { action: getKmsInfo, safeAction: safeGetKmsInfo } = defineAction(KmsInfoSch
|
|
|
2514
2857
|
});
|
|
2515
2858
|
|
|
2516
2859
|
// src/actions/kms/get_kms_list.ts
|
|
2517
|
-
var
|
|
2518
|
-
var GetKmsListRequestSchema =
|
|
2519
|
-
page:
|
|
2520
|
-
page_size:
|
|
2521
|
-
is_onchain:
|
|
2860
|
+
var import_zod25 = require("zod");
|
|
2861
|
+
var GetKmsListRequestSchema = import_zod25.z.object({
|
|
2862
|
+
page: import_zod25.z.number().int().min(1).optional(),
|
|
2863
|
+
page_size: import_zod25.z.number().int().min(1).optional(),
|
|
2864
|
+
is_onchain: import_zod25.z.boolean().optional()
|
|
2522
2865
|
}).strict();
|
|
2523
|
-
var GetKmsListSchema =
|
|
2524
|
-
items:
|
|
2525
|
-
total:
|
|
2526
|
-
page:
|
|
2527
|
-
page_size:
|
|
2528
|
-
pages:
|
|
2866
|
+
var GetKmsListSchema = import_zod25.z.object({
|
|
2867
|
+
items: import_zod25.z.array(KmsInfoSchema),
|
|
2868
|
+
total: import_zod25.z.number(),
|
|
2869
|
+
page: import_zod25.z.number(),
|
|
2870
|
+
page_size: import_zod25.z.number(),
|
|
2871
|
+
pages: import_zod25.z.number()
|
|
2529
2872
|
}).strict();
|
|
2530
2873
|
var { action: getKmsList, safeAction: safeGetKmsList } = defineAction(GetKmsListSchema, async (client, request) => {
|
|
2531
2874
|
const validatedRequest = GetKmsListRequestSchema.parse(request ?? {});
|
|
@@ -2533,17 +2876,17 @@ var { action: getKmsList, safeAction: safeGetKmsList } = defineAction(GetKmsList
|
|
|
2533
2876
|
});
|
|
2534
2877
|
|
|
2535
2878
|
// src/actions/kms/get_app_env_encrypt_pubkey.ts
|
|
2536
|
-
var
|
|
2537
|
-
var GetAppEnvEncryptPubKeyRequestSchema =
|
|
2538
|
-
kms:
|
|
2539
|
-
app_id:
|
|
2879
|
+
var import_zod26 = require("zod");
|
|
2880
|
+
var GetAppEnvEncryptPubKeyRequestSchema = import_zod26.z.object({
|
|
2881
|
+
kms: import_zod26.z.string().min(1, "KMS ID or slug is required"),
|
|
2882
|
+
app_id: import_zod26.z.string().refine(
|
|
2540
2883
|
(val) => val.length === 40 || val.startsWith("0x") && val.length === 42,
|
|
2541
2884
|
"App ID must be exactly 40 characters or 42 characters with 0x prefix"
|
|
2542
2885
|
)
|
|
2543
2886
|
}).strict();
|
|
2544
|
-
var GetAppEnvEncryptPubKeySchema =
|
|
2545
|
-
public_key:
|
|
2546
|
-
signature:
|
|
2887
|
+
var GetAppEnvEncryptPubKeySchema = import_zod26.z.object({
|
|
2888
|
+
public_key: import_zod26.z.string(),
|
|
2889
|
+
signature: import_zod26.z.string()
|
|
2547
2890
|
}).strict();
|
|
2548
2891
|
var { action: getAppEnvEncryptPubKey, safeAction: safeGetAppEnvEncryptPubKey } = defineAction(GetAppEnvEncryptPubKeySchema, async (client, payload) => {
|
|
2549
2892
|
const validatedRequest = GetAppEnvEncryptPubKeyRequestSchema.parse(payload);
|
|
@@ -2551,15 +2894,15 @@ var { action: getAppEnvEncryptPubKey, safeAction: safeGetAppEnvEncryptPubKey } =
|
|
|
2551
2894
|
});
|
|
2552
2895
|
|
|
2553
2896
|
// src/actions/kms/next_app_ids.ts
|
|
2554
|
-
var
|
|
2555
|
-
var NextAppIdsRequestSchema =
|
|
2556
|
-
counts:
|
|
2897
|
+
var import_zod27 = require("zod");
|
|
2898
|
+
var NextAppIdsRequestSchema = import_zod27.z.object({
|
|
2899
|
+
counts: import_zod27.z.number().int().min(1).max(20).optional().default(1)
|
|
2557
2900
|
}).strict();
|
|
2558
|
-
var NextAppIdsSchema =
|
|
2559
|
-
app_ids:
|
|
2560
|
-
|
|
2561
|
-
app_id:
|
|
2562
|
-
nonce:
|
|
2901
|
+
var NextAppIdsSchema = import_zod27.z.object({
|
|
2902
|
+
app_ids: import_zod27.z.array(
|
|
2903
|
+
import_zod27.z.object({
|
|
2904
|
+
app_id: import_zod27.z.string(),
|
|
2905
|
+
nonce: import_zod27.z.number().int().min(0)
|
|
2563
2906
|
})
|
|
2564
2907
|
)
|
|
2565
2908
|
}).strict();
|
|
@@ -2571,78 +2914,159 @@ var { action: nextAppIds, safeAction: safeNextAppIds } = defineAction(NextAppIds
|
|
|
2571
2914
|
});
|
|
2572
2915
|
|
|
2573
2916
|
// src/types/cvm_info.ts
|
|
2574
|
-
var
|
|
2575
|
-
var
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
region_identifier: import_zod25.z.string().nullable().optional()
|
|
2917
|
+
var import_zod28 = require("zod");
|
|
2918
|
+
var VMBaseSchema = import_zod28.z.object({
|
|
2919
|
+
name: import_zod28.z.string(),
|
|
2920
|
+
status: import_zod28.z.string(),
|
|
2921
|
+
teepod_id: import_zod28.z.number(),
|
|
2922
|
+
teepod: import_zod28.z.object({
|
|
2923
|
+
id: import_zod28.z.number(),
|
|
2924
|
+
name: import_zod28.z.string(),
|
|
2925
|
+
region_identifier: import_zod28.z.string().nullable().optional()
|
|
2584
2926
|
}).optional().nullable(),
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2927
|
+
app_id: import_zod28.z.string(),
|
|
2928
|
+
vm_uuid: import_zod28.z.string().nullable(),
|
|
2929
|
+
instance_id: import_zod28.z.string().nullable(),
|
|
2930
|
+
app_url: import_zod28.z.string().optional().nullable(),
|
|
2931
|
+
base_image: import_zod28.z.string().optional().nullable(),
|
|
2932
|
+
vcpu: import_zod28.z.number(),
|
|
2933
|
+
memory: import_zod28.z.number(),
|
|
2934
|
+
disk_size: import_zod28.z.number(),
|
|
2935
|
+
manifest_version: import_zod28.z.number().optional().nullable(),
|
|
2936
|
+
version: import_zod28.z.string().optional().nullable(),
|
|
2937
|
+
runner: import_zod28.z.string().optional().nullable(),
|
|
2938
|
+
docker_compose_file: import_zod28.z.string().optional().nullable(),
|
|
2939
|
+
features: import_zod28.z.array(import_zod28.z.string()).optional().nullable(),
|
|
2940
|
+
created_at: import_zod28.z.string(),
|
|
2941
|
+
encrypted_env_pubkey: import_zod28.z.string().nullable()
|
|
2942
|
+
});
|
|
2943
|
+
var VMV20260121Schema = VMBaseSchema.extend({
|
|
2944
|
+
id: import_zod28.z.number(),
|
|
2945
|
+
user_id: import_zod28.z.number().optional().nullable()
|
|
2946
|
+
});
|
|
2947
|
+
var VMV20260522Schema = VMBaseSchema.extend({
|
|
2948
|
+
id: import_zod28.z.string(),
|
|
2949
|
+
user_id: import_zod28.z.string().optional().nullable()
|
|
2950
|
+
});
|
|
2951
|
+
var VMAnySchema = import_zod28.z.union([VMV20260121Schema, VMV20260522Schema]);
|
|
2952
|
+
var VMSchema = VMV20260522Schema;
|
|
2953
|
+
function getVMSchemaForVersion(version) {
|
|
2954
|
+
if (version === "2026-01-21") return VMV20260121Schema;
|
|
2955
|
+
return VMV20260522Schema;
|
|
2956
|
+
}
|
|
2602
2957
|
|
|
2603
2958
|
// src/actions/cvms/start_cvm.ts
|
|
2604
2959
|
var StartCvmRequestSchema = CvmIdSchema;
|
|
2605
|
-
|
|
2960
|
+
async function startCvm(client, request) {
|
|
2606
2961
|
const { cvmId } = StartCvmRequestSchema.parse(request);
|
|
2607
|
-
|
|
2608
|
-
|
|
2962
|
+
const response = await client.post(`/cvms/${cvmId}/start`);
|
|
2963
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
2964
|
+
}
|
|
2965
|
+
async function safeStartCvm(client, request) {
|
|
2966
|
+
try {
|
|
2967
|
+
const data = await startCvm(client, request);
|
|
2968
|
+
return { success: true, data };
|
|
2969
|
+
} catch (error) {
|
|
2970
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2971
|
+
return { success: false, error };
|
|
2972
|
+
}
|
|
2973
|
+
return {
|
|
2974
|
+
success: false,
|
|
2975
|
+
error: {
|
|
2976
|
+
name: "Error",
|
|
2977
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2978
|
+
}
|
|
2979
|
+
};
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2609
2982
|
|
|
2610
2983
|
// src/actions/cvms/stop_cvm.ts
|
|
2611
2984
|
var StopCvmRequestSchema = CvmIdSchema;
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2985
|
+
async function stopCvm(client, request) {
|
|
2986
|
+
const { cvmId } = StopCvmRequestSchema.parse(request);
|
|
2987
|
+
const response = await client.post(`/cvms/${cvmId}/stop`);
|
|
2988
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
2989
|
+
}
|
|
2990
|
+
async function safeStopCvm(client, request) {
|
|
2991
|
+
try {
|
|
2992
|
+
const data = await stopCvm(client, request);
|
|
2993
|
+
return { success: true, data };
|
|
2994
|
+
} catch (error) {
|
|
2995
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2996
|
+
return { success: false, error };
|
|
2997
|
+
}
|
|
2998
|
+
return {
|
|
2999
|
+
success: false,
|
|
3000
|
+
error: {
|
|
3001
|
+
name: "Error",
|
|
3002
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3003
|
+
}
|
|
3004
|
+
};
|
|
2617
3005
|
}
|
|
2618
|
-
|
|
3006
|
+
}
|
|
2619
3007
|
|
|
2620
3008
|
// src/actions/cvms/shutdown_cvm.ts
|
|
2621
3009
|
var ShutdownCvmRequestSchema = CvmIdSchema;
|
|
2622
|
-
|
|
3010
|
+
async function shutdownCvm(client, request) {
|
|
2623
3011
|
const { cvmId } = ShutdownCvmRequestSchema.parse(request);
|
|
2624
|
-
|
|
2625
|
-
|
|
3012
|
+
const response = await client.post(`/cvms/${cvmId}/shutdown`);
|
|
3013
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
3014
|
+
}
|
|
3015
|
+
async function safeShutdownCvm(client, request) {
|
|
3016
|
+
try {
|
|
3017
|
+
const data = await shutdownCvm(client, request);
|
|
3018
|
+
return { success: true, data };
|
|
3019
|
+
} catch (error) {
|
|
3020
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
3021
|
+
return { success: false, error };
|
|
3022
|
+
}
|
|
3023
|
+
return {
|
|
3024
|
+
success: false,
|
|
3025
|
+
error: {
|
|
3026
|
+
name: "Error",
|
|
3027
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3028
|
+
}
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
2626
3032
|
|
|
2627
3033
|
// src/actions/cvms/restart_cvm.ts
|
|
2628
|
-
var
|
|
3034
|
+
var import_zod29 = require("zod");
|
|
2629
3035
|
var RestartCvmRequestSchema = refineCvmId(
|
|
2630
3036
|
CvmIdObjectSchema.extend({
|
|
2631
|
-
force:
|
|
3037
|
+
force: import_zod29.z.boolean().optional()
|
|
2632
3038
|
})
|
|
2633
3039
|
);
|
|
2634
|
-
|
|
3040
|
+
async function restartCvm(client, request) {
|
|
2635
3041
|
const parsed = RestartCvmRequestSchema.parse(request);
|
|
2636
3042
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
2637
3043
|
const { force = false } = parsed;
|
|
2638
|
-
|
|
2639
|
-
|
|
3044
|
+
const response = await client.post(`/cvms/${cvmId}/restart`, { force });
|
|
3045
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
3046
|
+
}
|
|
3047
|
+
async function safeRestartCvm(client, request) {
|
|
3048
|
+
try {
|
|
3049
|
+
const data = await restartCvm(client, request);
|
|
3050
|
+
return { success: true, data };
|
|
3051
|
+
} catch (error) {
|
|
3052
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
3053
|
+
return { success: false, error };
|
|
3054
|
+
}
|
|
3055
|
+
return {
|
|
3056
|
+
success: false,
|
|
3057
|
+
error: {
|
|
3058
|
+
name: "Error",
|
|
3059
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
2640
3064
|
|
|
2641
3065
|
// src/actions/cvms/delete_cvm.ts
|
|
2642
|
-
var
|
|
3066
|
+
var import_zod30 = require("zod");
|
|
2643
3067
|
var DeleteCvmRequestSchema = CvmIdSchema;
|
|
2644
3068
|
var { action: deleteCvm, safeAction: safeDeleteCvm } = defineAction(
|
|
2645
|
-
|
|
3069
|
+
import_zod30.z.void(),
|
|
2646
3070
|
async (client, request) => {
|
|
2647
3071
|
const { cvmId } = DeleteCvmRequestSchema.parse(request);
|
|
2648
3072
|
await client.delete(`/cvms/${cvmId}`);
|
|
@@ -2651,41 +3075,41 @@ var { action: deleteCvm, safeAction: safeDeleteCvm } = defineAction(
|
|
|
2651
3075
|
);
|
|
2652
3076
|
|
|
2653
3077
|
// src/actions/cvms/get_cvm_stats.ts
|
|
2654
|
-
var
|
|
2655
|
-
var DiskInfoSchema =
|
|
2656
|
-
name:
|
|
2657
|
-
mount_point:
|
|
2658
|
-
total_size:
|
|
2659
|
-
free_size:
|
|
2660
|
-
});
|
|
2661
|
-
var SystemInfoSchema =
|
|
2662
|
-
os_name:
|
|
2663
|
-
os_version:
|
|
2664
|
-
kernel_version:
|
|
2665
|
-
cpu_model:
|
|
2666
|
-
num_cpus:
|
|
2667
|
-
total_memory:
|
|
2668
|
-
available_memory:
|
|
2669
|
-
used_memory:
|
|
2670
|
-
free_memory:
|
|
2671
|
-
total_swap:
|
|
2672
|
-
used_swap:
|
|
2673
|
-
free_swap:
|
|
2674
|
-
uptime:
|
|
2675
|
-
loadavg_one:
|
|
2676
|
-
loadavg_five:
|
|
2677
|
-
loadavg_fifteen:
|
|
2678
|
-
disks:
|
|
2679
|
-
});
|
|
2680
|
-
var CvmSystemInfoSchema =
|
|
2681
|
-
is_online:
|
|
2682
|
-
is_public:
|
|
2683
|
-
error:
|
|
3078
|
+
var import_zod31 = require("zod");
|
|
3079
|
+
var DiskInfoSchema = import_zod31.z.object({
|
|
3080
|
+
name: import_zod31.z.string(),
|
|
3081
|
+
mount_point: import_zod31.z.string(),
|
|
3082
|
+
total_size: import_zod31.z.number(),
|
|
3083
|
+
free_size: import_zod31.z.number()
|
|
3084
|
+
});
|
|
3085
|
+
var SystemInfoSchema = import_zod31.z.object({
|
|
3086
|
+
os_name: import_zod31.z.string(),
|
|
3087
|
+
os_version: import_zod31.z.string(),
|
|
3088
|
+
kernel_version: import_zod31.z.string(),
|
|
3089
|
+
cpu_model: import_zod31.z.string(),
|
|
3090
|
+
num_cpus: import_zod31.z.number(),
|
|
3091
|
+
total_memory: import_zod31.z.number(),
|
|
3092
|
+
available_memory: import_zod31.z.number(),
|
|
3093
|
+
used_memory: import_zod31.z.number(),
|
|
3094
|
+
free_memory: import_zod31.z.number(),
|
|
3095
|
+
total_swap: import_zod31.z.number(),
|
|
3096
|
+
used_swap: import_zod31.z.number(),
|
|
3097
|
+
free_swap: import_zod31.z.number(),
|
|
3098
|
+
uptime: import_zod31.z.number(),
|
|
3099
|
+
loadavg_one: import_zod31.z.number(),
|
|
3100
|
+
loadavg_five: import_zod31.z.number(),
|
|
3101
|
+
loadavg_fifteen: import_zod31.z.number(),
|
|
3102
|
+
disks: import_zod31.z.array(DiskInfoSchema)
|
|
3103
|
+
});
|
|
3104
|
+
var CvmSystemInfoSchema = import_zod31.z.object({
|
|
3105
|
+
is_online: import_zod31.z.boolean(),
|
|
3106
|
+
is_public: import_zod31.z.boolean().default(false),
|
|
3107
|
+
error: import_zod31.z.string().nullable(),
|
|
2684
3108
|
sysinfo: SystemInfoSchema.nullable(),
|
|
2685
|
-
status:
|
|
2686
|
-
in_progress:
|
|
2687
|
-
boot_progress:
|
|
2688
|
-
boot_error:
|
|
3109
|
+
status: import_zod31.z.string().nullable(),
|
|
3110
|
+
in_progress: import_zod31.z.boolean().default(false),
|
|
3111
|
+
boot_progress: import_zod31.z.string().nullable(),
|
|
3112
|
+
boot_error: import_zod31.z.string().nullable()
|
|
2689
3113
|
});
|
|
2690
3114
|
var GetCvmStatsRequestSchema = CvmIdSchema;
|
|
2691
3115
|
var { action: getCvmStats, safeAction: safeGetCvmStats } = defineAction(CvmSystemInfoSchema, async (client, request) => {
|
|
@@ -2694,18 +3118,18 @@ var { action: getCvmStats, safeAction: safeGetCvmStats } = defineAction(CvmSyste
|
|
|
2694
3118
|
});
|
|
2695
3119
|
|
|
2696
3120
|
// src/actions/cvms/get_cvm_network.ts
|
|
2697
|
-
var
|
|
2698
|
-
var CvmNetworkUrlsSchema =
|
|
2699
|
-
app:
|
|
2700
|
-
instance:
|
|
2701
|
-
});
|
|
2702
|
-
var CvmNetworkSchema =
|
|
2703
|
-
is_online:
|
|
2704
|
-
is_public:
|
|
2705
|
-
error:
|
|
2706
|
-
internal_ip:
|
|
2707
|
-
latest_handshake:
|
|
2708
|
-
public_urls:
|
|
3121
|
+
var import_zod32 = require("zod");
|
|
3122
|
+
var CvmNetworkUrlsSchema = import_zod32.z.object({
|
|
3123
|
+
app: import_zod32.z.string(),
|
|
3124
|
+
instance: import_zod32.z.string()
|
|
3125
|
+
});
|
|
3126
|
+
var CvmNetworkSchema = import_zod32.z.object({
|
|
3127
|
+
is_online: import_zod32.z.boolean(),
|
|
3128
|
+
is_public: import_zod32.z.boolean().default(true),
|
|
3129
|
+
error: import_zod32.z.string().nullable(),
|
|
3130
|
+
internal_ip: import_zod32.z.string().nullable(),
|
|
3131
|
+
latest_handshake: import_zod32.z.string().nullable(),
|
|
3132
|
+
public_urls: import_zod32.z.array(CvmNetworkUrlsSchema).nullable()
|
|
2709
3133
|
});
|
|
2710
3134
|
var GetCvmNetworkRequestSchema = CvmIdSchema;
|
|
2711
3135
|
var { action: getCvmNetwork, safeAction: safeGetCvmNetwork } = defineAction(CvmNetworkSchema, async (client, request) => {
|
|
@@ -2714,36 +3138,36 @@ var { action: getCvmNetwork, safeAction: safeGetCvmNetwork } = defineAction(CvmN
|
|
|
2714
3138
|
});
|
|
2715
3139
|
|
|
2716
3140
|
// src/actions/cvms/get_cvm_docker_compose.ts
|
|
2717
|
-
var
|
|
3141
|
+
var import_zod33 = require("zod");
|
|
2718
3142
|
var GetCvmDockerComposeRequestSchema = CvmIdSchema;
|
|
2719
|
-
var { action: getCvmDockerCompose, safeAction: safeGetCvmDockerCompose } = defineAction(
|
|
3143
|
+
var { action: getCvmDockerCompose, safeAction: safeGetCvmDockerCompose } = defineAction(import_zod33.z.string(), async (client, request) => {
|
|
2720
3144
|
const { cvmId } = GetCvmDockerComposeRequestSchema.parse(request);
|
|
2721
3145
|
return await client.get(`/cvms/${cvmId}/docker-compose.yml`);
|
|
2722
3146
|
});
|
|
2723
3147
|
|
|
2724
3148
|
// src/actions/cvms/get_cvm_containers_stats.ts
|
|
2725
|
-
var
|
|
2726
|
-
var ContainerInfoSchema =
|
|
2727
|
-
id:
|
|
2728
|
-
names:
|
|
2729
|
-
image:
|
|
2730
|
-
image_id:
|
|
2731
|
-
command:
|
|
2732
|
-
created:
|
|
2733
|
-
state:
|
|
2734
|
-
status:
|
|
2735
|
-
log_endpoint:
|
|
2736
|
-
});
|
|
2737
|
-
var CvmContainersStatsSchema =
|
|
2738
|
-
is_online:
|
|
2739
|
-
is_public:
|
|
2740
|
-
error:
|
|
2741
|
-
docker_compose_file:
|
|
2742
|
-
manifest_version:
|
|
2743
|
-
version:
|
|
2744
|
-
runner:
|
|
2745
|
-
features:
|
|
2746
|
-
containers:
|
|
3149
|
+
var import_zod34 = require("zod");
|
|
3150
|
+
var ContainerInfoSchema = import_zod34.z.object({
|
|
3151
|
+
id: import_zod34.z.string(),
|
|
3152
|
+
names: import_zod34.z.array(import_zod34.z.string()),
|
|
3153
|
+
image: import_zod34.z.string(),
|
|
3154
|
+
image_id: import_zod34.z.string(),
|
|
3155
|
+
command: import_zod34.z.string().nullable().optional(),
|
|
3156
|
+
created: import_zod34.z.number(),
|
|
3157
|
+
state: import_zod34.z.string(),
|
|
3158
|
+
status: import_zod34.z.string(),
|
|
3159
|
+
log_endpoint: import_zod34.z.string().nullable()
|
|
3160
|
+
});
|
|
3161
|
+
var CvmContainersStatsSchema = import_zod34.z.object({
|
|
3162
|
+
is_online: import_zod34.z.boolean(),
|
|
3163
|
+
is_public: import_zod34.z.boolean().default(true),
|
|
3164
|
+
error: import_zod34.z.string().nullable(),
|
|
3165
|
+
docker_compose_file: import_zod34.z.string().nullable(),
|
|
3166
|
+
manifest_version: import_zod34.z.number().nullable(),
|
|
3167
|
+
version: import_zod34.z.string().nullable(),
|
|
3168
|
+
runner: import_zod34.z.string().nullable(),
|
|
3169
|
+
features: import_zod34.z.array(import_zod34.z.string()).nullable(),
|
|
3170
|
+
containers: import_zod34.z.array(ContainerInfoSchema).nullable()
|
|
2747
3171
|
});
|
|
2748
3172
|
var GetCvmContainersStatsRequestSchema = CvmIdSchema;
|
|
2749
3173
|
var { action: getCvmContainersStats, safeAction: safeGetCvmContainersStats } = defineAction(CvmContainersStatsSchema, async (client, request) => {
|
|
@@ -2752,62 +3176,62 @@ var { action: getCvmContainersStats, safeAction: safeGetCvmContainersStats } = d
|
|
|
2752
3176
|
});
|
|
2753
3177
|
|
|
2754
3178
|
// src/actions/cvms/get_cvm_attestation.ts
|
|
2755
|
-
var
|
|
2756
|
-
var CertificateSubjectSchema =
|
|
2757
|
-
common_name:
|
|
2758
|
-
organization:
|
|
2759
|
-
country:
|
|
2760
|
-
state:
|
|
2761
|
-
locality:
|
|
2762
|
-
});
|
|
2763
|
-
var CertificateIssuerSchema =
|
|
2764
|
-
common_name:
|
|
2765
|
-
organization:
|
|
2766
|
-
country:
|
|
2767
|
-
});
|
|
2768
|
-
var CertificateSchema =
|
|
3179
|
+
var import_zod35 = require("zod");
|
|
3180
|
+
var CertificateSubjectSchema = import_zod35.z.object({
|
|
3181
|
+
common_name: import_zod35.z.string().nullable(),
|
|
3182
|
+
organization: import_zod35.z.string().nullable(),
|
|
3183
|
+
country: import_zod35.z.string().nullable(),
|
|
3184
|
+
state: import_zod35.z.string().nullable(),
|
|
3185
|
+
locality: import_zod35.z.string().nullable()
|
|
3186
|
+
});
|
|
3187
|
+
var CertificateIssuerSchema = import_zod35.z.object({
|
|
3188
|
+
common_name: import_zod35.z.string().nullable(),
|
|
3189
|
+
organization: import_zod35.z.string().nullable(),
|
|
3190
|
+
country: import_zod35.z.string().nullable()
|
|
3191
|
+
});
|
|
3192
|
+
var CertificateSchema = import_zod35.z.object({
|
|
2769
3193
|
subject: CertificateSubjectSchema,
|
|
2770
3194
|
issuer: CertificateIssuerSchema,
|
|
2771
|
-
serial_number:
|
|
2772
|
-
not_before:
|
|
3195
|
+
serial_number: import_zod35.z.string(),
|
|
3196
|
+
not_before: import_zod35.z.string(),
|
|
2773
3197
|
// datetime serialized as ISO string
|
|
2774
|
-
not_after:
|
|
3198
|
+
not_after: import_zod35.z.string(),
|
|
2775
3199
|
// datetime serialized as ISO string
|
|
2776
|
-
version:
|
|
2777
|
-
fingerprint:
|
|
2778
|
-
signature_algorithm:
|
|
2779
|
-
sans:
|
|
2780
|
-
is_ca:
|
|
2781
|
-
position_in_chain:
|
|
2782
|
-
quote:
|
|
2783
|
-
app_id:
|
|
2784
|
-
cert_usage:
|
|
2785
|
-
});
|
|
2786
|
-
var EventLogSchema =
|
|
2787
|
-
imr:
|
|
2788
|
-
event_type:
|
|
2789
|
-
digest:
|
|
2790
|
-
event:
|
|
2791
|
-
event_payload:
|
|
2792
|
-
});
|
|
2793
|
-
var TcbInfoSchema =
|
|
2794
|
-
mrtd:
|
|
2795
|
-
rootfs_hash:
|
|
2796
|
-
rtmr0:
|
|
2797
|
-
rtmr1:
|
|
2798
|
-
rtmr2:
|
|
2799
|
-
rtmr3:
|
|
2800
|
-
event_log:
|
|
2801
|
-
app_compose:
|
|
2802
|
-
});
|
|
2803
|
-
var CvmAttestationSchema =
|
|
2804
|
-
name:
|
|
2805
|
-
is_online:
|
|
2806
|
-
is_public:
|
|
2807
|
-
error:
|
|
2808
|
-
app_certificates:
|
|
3200
|
+
version: import_zod35.z.string(),
|
|
3201
|
+
fingerprint: import_zod35.z.string(),
|
|
3202
|
+
signature_algorithm: import_zod35.z.string(),
|
|
3203
|
+
sans: import_zod35.z.array(import_zod35.z.string()).nullable(),
|
|
3204
|
+
is_ca: import_zod35.z.boolean(),
|
|
3205
|
+
position_in_chain: import_zod35.z.number().nullable(),
|
|
3206
|
+
quote: import_zod35.z.string().nullable(),
|
|
3207
|
+
app_id: import_zod35.z.string().nullable().optional(),
|
|
3208
|
+
cert_usage: import_zod35.z.string().nullable().optional()
|
|
3209
|
+
});
|
|
3210
|
+
var EventLogSchema = import_zod35.z.object({
|
|
3211
|
+
imr: import_zod35.z.number(),
|
|
3212
|
+
event_type: import_zod35.z.number(),
|
|
3213
|
+
digest: import_zod35.z.string(),
|
|
3214
|
+
event: import_zod35.z.string(),
|
|
3215
|
+
event_payload: import_zod35.z.string()
|
|
3216
|
+
});
|
|
3217
|
+
var TcbInfoSchema = import_zod35.z.object({
|
|
3218
|
+
mrtd: import_zod35.z.string(),
|
|
3219
|
+
rootfs_hash: import_zod35.z.string().nullable().optional(),
|
|
3220
|
+
rtmr0: import_zod35.z.string(),
|
|
3221
|
+
rtmr1: import_zod35.z.string(),
|
|
3222
|
+
rtmr2: import_zod35.z.string(),
|
|
3223
|
+
rtmr3: import_zod35.z.string(),
|
|
3224
|
+
event_log: import_zod35.z.array(EventLogSchema),
|
|
3225
|
+
app_compose: import_zod35.z.string()
|
|
3226
|
+
});
|
|
3227
|
+
var CvmAttestationSchema = import_zod35.z.object({
|
|
3228
|
+
name: import_zod35.z.string().nullable(),
|
|
3229
|
+
is_online: import_zod35.z.boolean(),
|
|
3230
|
+
is_public: import_zod35.z.boolean().default(true),
|
|
3231
|
+
error: import_zod35.z.string().nullable(),
|
|
3232
|
+
app_certificates: import_zod35.z.array(CertificateSchema).nullable(),
|
|
2809
3233
|
tcb_info: TcbInfoSchema.nullable(),
|
|
2810
|
-
compose_file:
|
|
3234
|
+
compose_file: import_zod35.z.string().nullable()
|
|
2811
3235
|
});
|
|
2812
3236
|
var GetCvmAttestationRequestSchema = CvmIdSchema;
|
|
2813
3237
|
var { action: getCvmAttestation, safeAction: safeGetCvmAttestation } = defineAction(CvmAttestationSchema, async (client, request) => {
|
|
@@ -2816,17 +3240,17 @@ var { action: getCvmAttestation, safeAction: safeGetCvmAttestation } = defineAct
|
|
|
2816
3240
|
});
|
|
2817
3241
|
|
|
2818
3242
|
// src/actions/cvms/update_cvm_resources.ts
|
|
2819
|
-
var
|
|
3243
|
+
var import_zod36 = require("zod");
|
|
2820
3244
|
var UpdateCvmResourcesRequestSchema = refineCvmId(
|
|
2821
3245
|
CvmIdObjectSchema.extend({
|
|
2822
|
-
vcpu:
|
|
2823
|
-
memory:
|
|
2824
|
-
disk_size:
|
|
2825
|
-
instance_type:
|
|
2826
|
-
allow_restart:
|
|
3246
|
+
vcpu: import_zod36.z.number().optional(),
|
|
3247
|
+
memory: import_zod36.z.number().optional(),
|
|
3248
|
+
disk_size: import_zod36.z.number().optional(),
|
|
3249
|
+
instance_type: import_zod36.z.string().optional(),
|
|
3250
|
+
allow_restart: import_zod36.z.boolean().optional()
|
|
2827
3251
|
})
|
|
2828
3252
|
);
|
|
2829
|
-
var { action: updateCvmResources, safeAction: safeUpdateCvmResources } = defineAction(
|
|
3253
|
+
var { action: updateCvmResources, safeAction: safeUpdateCvmResources } = defineAction(import_zod36.z.void(), async (client, request) => {
|
|
2830
3254
|
const parsed = UpdateCvmResourcesRequestSchema.parse(request);
|
|
2831
3255
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
2832
3256
|
const { ...body } = parsed;
|
|
@@ -2835,12 +3259,12 @@ var { action: updateCvmResources, safeAction: safeUpdateCvmResources } = defineA
|
|
|
2835
3259
|
});
|
|
2836
3260
|
|
|
2837
3261
|
// src/actions/cvms/update_cvm_visibility.ts
|
|
2838
|
-
var
|
|
3262
|
+
var import_zod37 = require("zod");
|
|
2839
3263
|
var UpdateCvmVisibilityRequestSchema = refineCvmId(
|
|
2840
3264
|
CvmIdObjectSchema.extend({
|
|
2841
|
-
public_sysinfo:
|
|
2842
|
-
public_logs:
|
|
2843
|
-
public_tcbinfo:
|
|
3265
|
+
public_sysinfo: import_zod37.z.boolean(),
|
|
3266
|
+
public_logs: import_zod37.z.boolean(),
|
|
3267
|
+
public_tcbinfo: import_zod37.z.boolean().optional()
|
|
2844
3268
|
})
|
|
2845
3269
|
);
|
|
2846
3270
|
var { action: updateCvmVisibility, safeAction: safeUpdateCvmVisibility } = defineAction(CvmDetailV20251028Schema, async (client, request) => {
|
|
@@ -2855,21 +3279,21 @@ var { action: updateCvmVisibility, safeAction: safeUpdateCvmVisibility } = defin
|
|
|
2855
3279
|
});
|
|
2856
3280
|
|
|
2857
3281
|
// src/actions/cvms/get_available_os_images.ts
|
|
2858
|
-
var
|
|
2859
|
-
var OSImageVariantSchema =
|
|
2860
|
-
name:
|
|
2861
|
-
os_image_hash:
|
|
2862
|
-
is_current:
|
|
2863
|
-
});
|
|
2864
|
-
var
|
|
2865
|
-
version:
|
|
2866
|
-
|
|
2867
|
-
|
|
3282
|
+
var import_zod38 = require("zod");
|
|
3283
|
+
var OSImageVariantSchema = import_zod38.z.object({
|
|
3284
|
+
name: import_zod38.z.string(),
|
|
3285
|
+
os_image_hash: import_zod38.z.string().nullable(),
|
|
3286
|
+
is_current: import_zod38.z.boolean()
|
|
3287
|
+
});
|
|
3288
|
+
var AvailableOSImageSchema3 = import_zod38.z.object({
|
|
3289
|
+
version: import_zod38.z.union([
|
|
3290
|
+
import_zod38.z.tuple([import_zod38.z.number(), import_zod38.z.number(), import_zod38.z.number(), import_zod38.z.number()]),
|
|
3291
|
+
import_zod38.z.tuple([import_zod38.z.number(), import_zod38.z.number(), import_zod38.z.number()])
|
|
2868
3292
|
]),
|
|
2869
3293
|
prod: OSImageVariantSchema.nullable(),
|
|
2870
3294
|
dev: OSImageVariantSchema.nullable()
|
|
2871
3295
|
});
|
|
2872
|
-
var GetAvailableOSImagesResponseSchema =
|
|
3296
|
+
var GetAvailableOSImagesResponseSchema = import_zod38.z.array(AvailableOSImageSchema3);
|
|
2873
3297
|
var GetAvailableOSImagesRequestSchema = CvmIdSchema;
|
|
2874
3298
|
var { action: getAvailableOsImages, safeAction: safeGetAvailableOsImages } = defineAction(GetAvailableOSImagesResponseSchema, async (client, request) => {
|
|
2875
3299
|
const { cvmId } = GetAvailableOSImagesRequestSchema.parse(request);
|
|
@@ -2877,13 +3301,13 @@ var { action: getAvailableOsImages, safeAction: safeGetAvailableOsImages } = def
|
|
|
2877
3301
|
});
|
|
2878
3302
|
|
|
2879
3303
|
// src/actions/cvms/update_os_image.ts
|
|
2880
|
-
var
|
|
3304
|
+
var import_zod39 = require("zod");
|
|
2881
3305
|
var UpdateOsImageRequestSchema = refineCvmId(
|
|
2882
3306
|
CvmIdObjectSchema.extend({
|
|
2883
|
-
os_image_name:
|
|
3307
|
+
os_image_name: import_zod39.z.string().min(1, "OS image name is required")
|
|
2884
3308
|
})
|
|
2885
3309
|
);
|
|
2886
|
-
var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(
|
|
3310
|
+
var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(import_zod39.z.void(), async (client, request) => {
|
|
2887
3311
|
const parsed = UpdateOsImageRequestSchema.parse(request);
|
|
2888
3312
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
2889
3313
|
const { os_image_name } = parsed;
|
|
@@ -2892,17 +3316,17 @@ var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(impo
|
|
|
2892
3316
|
});
|
|
2893
3317
|
|
|
2894
3318
|
// src/actions/cvms/get_cvm_state.ts
|
|
2895
|
-
var
|
|
2896
|
-
var CvmStateSchema =
|
|
2897
|
-
id:
|
|
2898
|
-
instance_id:
|
|
2899
|
-
name:
|
|
2900
|
-
status:
|
|
2901
|
-
uptime:
|
|
2902
|
-
exited_at:
|
|
2903
|
-
boot_progress:
|
|
2904
|
-
boot_error:
|
|
2905
|
-
shutdown_progress:
|
|
3319
|
+
var import_zod40 = require("zod");
|
|
3320
|
+
var CvmStateSchema = import_zod40.z.object({
|
|
3321
|
+
id: import_zod40.z.string().optional(),
|
|
3322
|
+
instance_id: import_zod40.z.string().optional(),
|
|
3323
|
+
name: import_zod40.z.string(),
|
|
3324
|
+
status: import_zod40.z.string(),
|
|
3325
|
+
uptime: import_zod40.z.string().optional(),
|
|
3326
|
+
exited_at: import_zod40.z.string().optional(),
|
|
3327
|
+
boot_progress: import_zod40.z.string().optional(),
|
|
3328
|
+
boot_error: import_zod40.z.string().optional(),
|
|
3329
|
+
shutdown_progress: import_zod40.z.string().optional()
|
|
2906
3330
|
});
|
|
2907
3331
|
var GetCvmStateRequestSchema = CvmIdSchema;
|
|
2908
3332
|
var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmStateSchema, async (client, request) => {
|
|
@@ -2911,21 +3335,21 @@ var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmState
|
|
|
2911
3335
|
});
|
|
2912
3336
|
|
|
2913
3337
|
// src/actions/ssh_keys/list_ssh_keys.ts
|
|
2914
|
-
var
|
|
2915
|
-
var SshKeySchema =
|
|
2916
|
-
id:
|
|
2917
|
-
user_id:
|
|
2918
|
-
name:
|
|
2919
|
-
public_key:
|
|
2920
|
-
fingerprint:
|
|
2921
|
-
key_type:
|
|
2922
|
-
source:
|
|
2923
|
-
key_metadata:
|
|
2924
|
-
last_synced_at:
|
|
2925
|
-
created_at:
|
|
2926
|
-
updated_at:
|
|
2927
|
-
});
|
|
2928
|
-
var ListSshKeysResponseSchema =
|
|
3338
|
+
var import_zod41 = require("zod");
|
|
3339
|
+
var SshKeySchema = import_zod41.z.object({
|
|
3340
|
+
id: import_zod41.z.string(),
|
|
3341
|
+
user_id: import_zod41.z.string(),
|
|
3342
|
+
name: import_zod41.z.string(),
|
|
3343
|
+
public_key: import_zod41.z.string(),
|
|
3344
|
+
fingerprint: import_zod41.z.string(),
|
|
3345
|
+
key_type: import_zod41.z.string(),
|
|
3346
|
+
source: import_zod41.z.string(),
|
|
3347
|
+
key_metadata: import_zod41.z.record(import_zod41.z.unknown()).nullable().optional(),
|
|
3348
|
+
last_synced_at: import_zod41.z.string().nullable().optional(),
|
|
3349
|
+
created_at: import_zod41.z.string(),
|
|
3350
|
+
updated_at: import_zod41.z.string()
|
|
3351
|
+
});
|
|
3352
|
+
var ListSshKeysResponseSchema = import_zod41.z.array(SshKeySchema);
|
|
2929
3353
|
async function listSshKeys(client) {
|
|
2930
3354
|
const response = await client.get("/user/ssh-keys");
|
|
2931
3355
|
return ListSshKeysResponseSchema.parse(response);
|
|
@@ -2949,15 +3373,15 @@ async function safeListSshKeys(client) {
|
|
|
2949
3373
|
}
|
|
2950
3374
|
|
|
2951
3375
|
// src/actions/ssh_keys/import_github_profile.ts
|
|
2952
|
-
var
|
|
2953
|
-
var ImportGithubProfileRequestSchema =
|
|
2954
|
-
github_username:
|
|
3376
|
+
var import_zod42 = require("zod");
|
|
3377
|
+
var ImportGithubProfileRequestSchema = import_zod42.z.object({
|
|
3378
|
+
github_username: import_zod42.z.string().min(1)
|
|
2955
3379
|
});
|
|
2956
|
-
var ImportGithubProfileResponseSchema =
|
|
2957
|
-
github_username:
|
|
2958
|
-
keys_added:
|
|
2959
|
-
keys_skipped:
|
|
2960
|
-
errors:
|
|
3380
|
+
var ImportGithubProfileResponseSchema = import_zod42.z.object({
|
|
3381
|
+
github_username: import_zod42.z.string(),
|
|
3382
|
+
keys_added: import_zod42.z.number().int(),
|
|
3383
|
+
keys_skipped: import_zod42.z.number().int(),
|
|
3384
|
+
errors: import_zod42.z.array(import_zod42.z.string()).default([])
|
|
2961
3385
|
});
|
|
2962
3386
|
var { action: importGithubProfileSshKeys, safeAction: safeImportGithubProfileSshKeys } = defineAction(
|
|
2963
3387
|
ImportGithubProfileResponseSchema,
|
|
@@ -2968,10 +3392,10 @@ var { action: importGithubProfileSshKeys, safeAction: safeImportGithubProfileSsh
|
|
|
2968
3392
|
);
|
|
2969
3393
|
|
|
2970
3394
|
// src/actions/ssh_keys/create_ssh_key.ts
|
|
2971
|
-
var
|
|
2972
|
-
var CreateSshKeyRequestSchema =
|
|
2973
|
-
name:
|
|
2974
|
-
public_key:
|
|
3395
|
+
var import_zod43 = require("zod");
|
|
3396
|
+
var CreateSshKeyRequestSchema = import_zod43.z.object({
|
|
3397
|
+
name: import_zod43.z.string().min(1),
|
|
3398
|
+
public_key: import_zod43.z.string().min(1)
|
|
2975
3399
|
});
|
|
2976
3400
|
var { action: createSshKey, safeAction: safeCreateSshKey } = defineAction(SshKeySchema, async (client, request) => {
|
|
2977
3401
|
const { name, public_key } = CreateSshKeyRequestSchema.parse(request);
|
|
@@ -2979,24 +3403,24 @@ var { action: createSshKey, safeAction: safeCreateSshKey } = defineAction(SshKey
|
|
|
2979
3403
|
});
|
|
2980
3404
|
|
|
2981
3405
|
// src/actions/ssh_keys/delete_ssh_key.ts
|
|
2982
|
-
var
|
|
2983
|
-
var DeleteSshKeyRequestSchema =
|
|
2984
|
-
keyId:
|
|
3406
|
+
var import_zod44 = require("zod");
|
|
3407
|
+
var DeleteSshKeyRequestSchema = import_zod44.z.object({
|
|
3408
|
+
keyId: import_zod44.z.string().min(1)
|
|
2985
3409
|
});
|
|
2986
|
-
var { action: deleteSshKey, safeAction: safeDeleteSshKey } = defineAction(
|
|
3410
|
+
var { action: deleteSshKey, safeAction: safeDeleteSshKey } = defineAction(import_zod44.z.void(), async (client, request) => {
|
|
2987
3411
|
const { keyId } = DeleteSshKeyRequestSchema.parse(request);
|
|
2988
3412
|
await client.delete(`/user/ssh-keys/${keyId}`);
|
|
2989
3413
|
return void 0;
|
|
2990
3414
|
});
|
|
2991
3415
|
|
|
2992
3416
|
// src/actions/ssh_keys/sync_github_ssh_keys.ts
|
|
2993
|
-
var
|
|
2994
|
-
var SyncGithubSshKeysResponseSchema =
|
|
2995
|
-
synced_count:
|
|
2996
|
-
keys_added:
|
|
2997
|
-
keys_updated:
|
|
2998
|
-
keys_removed:
|
|
2999
|
-
errors:
|
|
3417
|
+
var import_zod45 = require("zod");
|
|
3418
|
+
var SyncGithubSshKeysResponseSchema = import_zod45.z.object({
|
|
3419
|
+
synced_count: import_zod45.z.number().int(),
|
|
3420
|
+
keys_added: import_zod45.z.number().int(),
|
|
3421
|
+
keys_updated: import_zod45.z.number().int(),
|
|
3422
|
+
keys_removed: import_zod45.z.number().int(),
|
|
3423
|
+
errors: import_zod45.z.array(import_zod45.z.string()).default([])
|
|
3000
3424
|
});
|
|
3001
3425
|
var { action: syncGithubSshKeys, safeAction: safeSyncGithubSshKeys } = defineSimpleAction(
|
|
3002
3426
|
SyncGithubSshKeysResponseSchema,
|
|
@@ -3006,26 +3430,26 @@ var { action: syncGithubSshKeys, safeAction: safeSyncGithubSshKeys } = defineSim
|
|
|
3006
3430
|
);
|
|
3007
3431
|
|
|
3008
3432
|
// src/actions/os_images/get_os_images.ts
|
|
3009
|
-
var
|
|
3010
|
-
var OSImagePublicSchema =
|
|
3011
|
-
name:
|
|
3012
|
-
slug:
|
|
3013
|
-
version:
|
|
3014
|
-
os_image_hash:
|
|
3015
|
-
is_dev:
|
|
3016
|
-
requires_gpu:
|
|
3433
|
+
var import_zod46 = require("zod");
|
|
3434
|
+
var OSImagePublicSchema = import_zod46.z.object({
|
|
3435
|
+
name: import_zod46.z.string(),
|
|
3436
|
+
slug: import_zod46.z.string(),
|
|
3437
|
+
version: import_zod46.z.string(),
|
|
3438
|
+
os_image_hash: import_zod46.z.string().nullable(),
|
|
3439
|
+
is_dev: import_zod46.z.boolean(),
|
|
3440
|
+
requires_gpu: import_zod46.z.boolean()
|
|
3017
3441
|
}).passthrough();
|
|
3018
|
-
var GetOsImagesRequestSchema =
|
|
3019
|
-
page:
|
|
3020
|
-
page_size:
|
|
3021
|
-
is_dev:
|
|
3442
|
+
var GetOsImagesRequestSchema = import_zod46.z.object({
|
|
3443
|
+
page: import_zod46.z.number().int().min(1).optional(),
|
|
3444
|
+
page_size: import_zod46.z.number().int().min(1).optional(),
|
|
3445
|
+
is_dev: import_zod46.z.boolean().optional()
|
|
3022
3446
|
}).strict();
|
|
3023
|
-
var GetOsImagesResponseSchema =
|
|
3024
|
-
items:
|
|
3025
|
-
total:
|
|
3026
|
-
page:
|
|
3027
|
-
page_size:
|
|
3028
|
-
pages:
|
|
3447
|
+
var GetOsImagesResponseSchema = import_zod46.z.object({
|
|
3448
|
+
items: import_zod46.z.array(OSImagePublicSchema),
|
|
3449
|
+
total: import_zod46.z.number(),
|
|
3450
|
+
page: import_zod46.z.number(),
|
|
3451
|
+
page_size: import_zod46.z.number(),
|
|
3452
|
+
pages: import_zod46.z.number()
|
|
3029
3453
|
}).passthrough();
|
|
3030
3454
|
var { action: getOsImages, safeAction: safeGetOsImages } = defineAction(GetOsImagesResponseSchema, async (client, request) => {
|
|
3031
3455
|
const validatedRequest = GetOsImagesRequestSchema.parse(request ?? {});
|
|
@@ -3033,32 +3457,32 @@ var { action: getOsImages, safeAction: safeGetOsImages } = defineAction(GetOsIma
|
|
|
3033
3457
|
});
|
|
3034
3458
|
|
|
3035
3459
|
// src/actions/kms/get_kms_onchain_detail.ts
|
|
3036
|
-
var
|
|
3037
|
-
var OnChainDeviceSchema =
|
|
3038
|
-
device_id:
|
|
3039
|
-
node_name:
|
|
3040
|
-
on_chain_allowed:
|
|
3460
|
+
var import_zod47 = require("zod");
|
|
3461
|
+
var OnChainDeviceSchema = import_zod47.z.object({
|
|
3462
|
+
device_id: import_zod47.z.string(),
|
|
3463
|
+
node_name: import_zod47.z.string().nullable().optional(),
|
|
3464
|
+
on_chain_allowed: import_zod47.z.boolean().nullable()
|
|
3041
3465
|
}).passthrough();
|
|
3042
|
-
var OnChainOsImageSchema =
|
|
3043
|
-
name:
|
|
3044
|
-
version:
|
|
3045
|
-
os_image_hash:
|
|
3046
|
-
on_chain_allowed:
|
|
3466
|
+
var OnChainOsImageSchema = import_zod47.z.object({
|
|
3467
|
+
name: import_zod47.z.string(),
|
|
3468
|
+
version: import_zod47.z.string(),
|
|
3469
|
+
os_image_hash: import_zod47.z.string().nullable(),
|
|
3470
|
+
on_chain_allowed: import_zod47.z.boolean().nullable()
|
|
3047
3471
|
}).passthrough();
|
|
3048
|
-
var OnChainKmsContractSchema =
|
|
3049
|
-
contract_address:
|
|
3050
|
-
chain_id:
|
|
3051
|
-
chain_name:
|
|
3052
|
-
devices:
|
|
3053
|
-
os_images:
|
|
3472
|
+
var OnChainKmsContractSchema = import_zod47.z.object({
|
|
3473
|
+
contract_address: import_zod47.z.string(),
|
|
3474
|
+
chain_id: import_zod47.z.number(),
|
|
3475
|
+
chain_name: import_zod47.z.string(),
|
|
3476
|
+
devices: import_zod47.z.array(OnChainDeviceSchema),
|
|
3477
|
+
os_images: import_zod47.z.array(OnChainOsImageSchema)
|
|
3054
3478
|
}).passthrough();
|
|
3055
|
-
var GetKmsOnChainDetailResponseSchema =
|
|
3056
|
-
chain_name:
|
|
3057
|
-
chain_id:
|
|
3058
|
-
contracts:
|
|
3479
|
+
var GetKmsOnChainDetailResponseSchema = import_zod47.z.object({
|
|
3480
|
+
chain_name: import_zod47.z.string(),
|
|
3481
|
+
chain_id: import_zod47.z.number(),
|
|
3482
|
+
contracts: import_zod47.z.array(OnChainKmsContractSchema)
|
|
3059
3483
|
}).passthrough();
|
|
3060
|
-
var GetKmsOnChainDetailRequestSchema =
|
|
3061
|
-
chain:
|
|
3484
|
+
var GetKmsOnChainDetailRequestSchema = import_zod47.z.object({
|
|
3485
|
+
chain: import_zod47.z.string()
|
|
3062
3486
|
}).strict();
|
|
3063
3487
|
var { action: getKmsOnChainDetail, safeAction: safeGetKmsOnChainDetail } = defineAction(GetKmsOnChainDetailResponseSchema, async (client, request) => {
|
|
3064
3488
|
const { chain } = GetKmsOnChainDetailRequestSchema.parse(request);
|
|
@@ -3073,6 +3497,8 @@ function createClient2(config = {}) {
|
|
|
3073
3497
|
safeGetCurrentUser,
|
|
3074
3498
|
getAvailableNodes,
|
|
3075
3499
|
safeGetAvailableNodes,
|
|
3500
|
+
getCvmCreateResources,
|
|
3501
|
+
safeGetCvmCreateResources,
|
|
3076
3502
|
listAllInstanceTypeFamilies,
|
|
3077
3503
|
safeListAllInstanceTypeFamilies,
|
|
3078
3504
|
listFamilyInstanceTypes,
|
|
@@ -3103,6 +3529,10 @@ function createClient2(config = {}) {
|
|
|
3103
3529
|
safeUpdatePreLaunchScript,
|
|
3104
3530
|
getCvmPreLaunchScript,
|
|
3105
3531
|
safeGetCvmPreLaunchScript,
|
|
3532
|
+
getPreLaunchScriptUpgradeStatus,
|
|
3533
|
+
safeGetPreLaunchScriptUpgradeStatus,
|
|
3534
|
+
upgradePreLaunchScript,
|
|
3535
|
+
safeUpgradePreLaunchScript,
|
|
3106
3536
|
startCvm,
|
|
3107
3537
|
safeStartCvm,
|
|
3108
3538
|
stopCvm,
|
|
@@ -3160,161 +3590,139 @@ function createClient2(config = {}) {
|
|
|
3160
3590
|
}
|
|
3161
3591
|
|
|
3162
3592
|
// src/types/app_info_v20251028.ts
|
|
3163
|
-
var
|
|
3164
|
-
var CvmBasicInfoV20251028Schema =
|
|
3165
|
-
vm_uuid:
|
|
3166
|
-
app_id:
|
|
3167
|
-
name:
|
|
3168
|
-
status:
|
|
3169
|
-
vcpu:
|
|
3170
|
-
memory:
|
|
3171
|
-
disk_size:
|
|
3172
|
-
teepod_id:
|
|
3173
|
-
teepod_name:
|
|
3174
|
-
region_identifier:
|
|
3175
|
-
kms_type:
|
|
3176
|
-
instance_type:
|
|
3177
|
-
listed:
|
|
3178
|
-
base_image:
|
|
3179
|
-
kms_slug:
|
|
3180
|
-
kms_id:
|
|
3181
|
-
instance_id:
|
|
3593
|
+
var import_zod48 = require("zod");
|
|
3594
|
+
var CvmBasicInfoV20251028Schema = import_zod48.z.object({
|
|
3595
|
+
vm_uuid: import_zod48.z.string().nullable(),
|
|
3596
|
+
app_id: import_zod48.z.string(),
|
|
3597
|
+
name: import_zod48.z.string().default(""),
|
|
3598
|
+
status: import_zod48.z.string(),
|
|
3599
|
+
vcpu: import_zod48.z.number().int(),
|
|
3600
|
+
memory: import_zod48.z.number().int(),
|
|
3601
|
+
disk_size: import_zod48.z.number().int(),
|
|
3602
|
+
teepod_id: import_zod48.z.number().int(),
|
|
3603
|
+
teepod_name: import_zod48.z.string(),
|
|
3604
|
+
region_identifier: import_zod48.z.string().nullable().optional(),
|
|
3605
|
+
kms_type: import_zod48.z.string().nullable().optional(),
|
|
3606
|
+
instance_type: import_zod48.z.string().nullable().optional(),
|
|
3607
|
+
listed: import_zod48.z.boolean().nullable().optional(),
|
|
3608
|
+
base_image: import_zod48.z.string().nullable().optional(),
|
|
3609
|
+
kms_slug: import_zod48.z.string().nullable().optional(),
|
|
3610
|
+
kms_id: import_zod48.z.string().nullable().optional(),
|
|
3611
|
+
instance_id: import_zod48.z.string().nullable().optional(),
|
|
3182
3612
|
machine_info: MachineInfoV20251028Schema.nullable().optional(),
|
|
3183
|
-
updated_at:
|
|
3184
|
-
});
|
|
3185
|
-
var AppProfileSchema =
|
|
3186
|
-
display_name:
|
|
3187
|
-
avatar_url:
|
|
3188
|
-
description:
|
|
3189
|
-
custom_domain:
|
|
3190
|
-
});
|
|
3191
|
-
var DstackAppFullResponseV20251028Schema =
|
|
3192
|
-
id:
|
|
3193
|
-
name:
|
|
3194
|
-
app_id:
|
|
3195
|
-
app_provision_type:
|
|
3196
|
-
app_icon_url:
|
|
3197
|
-
created_at:
|
|
3198
|
-
kms_type:
|
|
3613
|
+
updated_at: import_zod48.z.string().nullable().optional()
|
|
3614
|
+
});
|
|
3615
|
+
var AppProfileSchema = import_zod48.z.object({
|
|
3616
|
+
display_name: import_zod48.z.string().nullable().optional(),
|
|
3617
|
+
avatar_url: import_zod48.z.string().nullable().optional(),
|
|
3618
|
+
description: import_zod48.z.string().nullable().optional(),
|
|
3619
|
+
custom_domain: import_zod48.z.string().nullable().optional()
|
|
3620
|
+
});
|
|
3621
|
+
var DstackAppFullResponseV20251028Schema = import_zod48.z.object({
|
|
3622
|
+
id: import_zod48.z.string(),
|
|
3623
|
+
name: import_zod48.z.string(),
|
|
3624
|
+
app_id: import_zod48.z.string(),
|
|
3625
|
+
app_provision_type: import_zod48.z.string().nullable().optional(),
|
|
3626
|
+
app_icon_url: import_zod48.z.string().nullable().optional(),
|
|
3627
|
+
created_at: import_zod48.z.string(),
|
|
3628
|
+
kms_type: import_zod48.z.string(),
|
|
3199
3629
|
profile: AppProfileSchema.nullable().optional(),
|
|
3200
3630
|
current_cvm: CvmBasicInfoV20251028Schema.nullable().optional(),
|
|
3201
|
-
cvms:
|
|
3202
|
-
cvm_count:
|
|
3203
|
-
});
|
|
3204
|
-
var
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
kms_type: import_zod45.z.null().optional(),
|
|
3212
|
-
current_cvm: import_zod45.z.null().optional(),
|
|
3213
|
-
cvms: import_zod45.z.null().optional(),
|
|
3214
|
-
cvm_count: import_zod45.z.null().optional()
|
|
3215
|
-
});
|
|
3216
|
-
var DstackAppWithCvmResponseV20251028Schema = import_zod45.z.union([
|
|
3217
|
-
DstackAppFullResponseV20251028Schema,
|
|
3218
|
-
DstackAppMinimalResponseV20251028Schema
|
|
3219
|
-
]);
|
|
3220
|
-
var DstackAppListResponseV20251028Schema = import_zod45.z.object({
|
|
3221
|
-
dstack_apps: import_zod45.z.array(DstackAppWithCvmResponseV20251028Schema),
|
|
3222
|
-
page: import_zod45.z.number().int(),
|
|
3223
|
-
page_size: import_zod45.z.number().int(),
|
|
3224
|
-
total: import_zod45.z.number().int(),
|
|
3225
|
-
total_pages: import_zod45.z.number().int()
|
|
3631
|
+
cvms: import_zod48.z.array(CvmBasicInfoV20251028Schema).default([]),
|
|
3632
|
+
cvm_count: import_zod48.z.number().int().default(0)
|
|
3633
|
+
});
|
|
3634
|
+
var DstackAppWithCvmResponseV20251028Schema = DstackAppFullResponseV20251028Schema;
|
|
3635
|
+
var DstackAppListResponseV20251028Schema = import_zod48.z.object({
|
|
3636
|
+
dstack_apps: import_zod48.z.array(DstackAppWithCvmResponseV20251028Schema),
|
|
3637
|
+
page: import_zod48.z.number().int(),
|
|
3638
|
+
page_size: import_zod48.z.number().int(),
|
|
3639
|
+
total: import_zod48.z.number().int(),
|
|
3640
|
+
total_pages: import_zod48.z.number().int()
|
|
3226
3641
|
});
|
|
3227
3642
|
|
|
3228
3643
|
// src/types/app_info_v20260121.ts
|
|
3229
|
-
var
|
|
3230
|
-
var DstackAppFullResponseV20260121Schema =
|
|
3231
|
-
id:
|
|
3232
|
-
name:
|
|
3233
|
-
app_id:
|
|
3234
|
-
app_provision_type:
|
|
3235
|
-
app_icon_url:
|
|
3236
|
-
created_at:
|
|
3237
|
-
kms_type:
|
|
3238
|
-
profile:
|
|
3239
|
-
display_name:
|
|
3240
|
-
avatar_url:
|
|
3241
|
-
description:
|
|
3242
|
-
custom_domain:
|
|
3644
|
+
var import_zod49 = require("zod");
|
|
3645
|
+
var DstackAppFullResponseV20260121Schema = import_zod49.z.object({
|
|
3646
|
+
id: import_zod49.z.string(),
|
|
3647
|
+
name: import_zod49.z.string(),
|
|
3648
|
+
app_id: import_zod49.z.string(),
|
|
3649
|
+
app_provision_type: import_zod49.z.string().nullable().optional(),
|
|
3650
|
+
app_icon_url: import_zod49.z.string().nullable().optional(),
|
|
3651
|
+
created_at: import_zod49.z.string(),
|
|
3652
|
+
kms_type: import_zod49.z.string(),
|
|
3653
|
+
profile: import_zod49.z.object({
|
|
3654
|
+
display_name: import_zod49.z.string().nullable().optional(),
|
|
3655
|
+
avatar_url: import_zod49.z.string().nullable().optional(),
|
|
3656
|
+
description: import_zod49.z.string().nullable().optional(),
|
|
3657
|
+
custom_domain: import_zod49.z.string().nullable().optional()
|
|
3243
3658
|
}).nullable().optional(),
|
|
3244
3659
|
current_cvm: CvmInfoV20260121Schema.nullable().optional(),
|
|
3245
|
-
cvms:
|
|
3246
|
-
cvm_count:
|
|
3247
|
-
});
|
|
3248
|
-
var
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
]);
|
|
3264
|
-
var DstackAppListResponseV20260121Schema = import_zod46.z.object({
|
|
3265
|
-
dstack_apps: import_zod46.z.array(DstackAppWithCvmResponseV20260121Schema),
|
|
3266
|
-
page: import_zod46.z.number().int(),
|
|
3267
|
-
page_size: import_zod46.z.number().int(),
|
|
3268
|
-
total: import_zod46.z.number().int(),
|
|
3269
|
-
total_pages: import_zod46.z.number().int()
|
|
3660
|
+
cvms: import_zod49.z.array(CvmInfoV20260121Schema).default([]),
|
|
3661
|
+
cvm_count: import_zod49.z.number().int().default(0)
|
|
3662
|
+
});
|
|
3663
|
+
var DstackAppFullResponseV20260522Schema = DstackAppFullResponseV20260121Schema.extend({
|
|
3664
|
+
current_cvm: CvmInfoV20260522Schema.nullable().optional(),
|
|
3665
|
+
cvms: import_zod49.z.array(CvmInfoV20260522Schema).default([])
|
|
3666
|
+
});
|
|
3667
|
+
var DstackAppWithCvmResponseV20260121Schema = DstackAppFullResponseV20260121Schema;
|
|
3668
|
+
var DstackAppWithCvmResponseV20260522Schema = DstackAppFullResponseV20260522Schema;
|
|
3669
|
+
var DstackAppListResponseV20260121Schema = import_zod49.z.object({
|
|
3670
|
+
dstack_apps: import_zod49.z.array(DstackAppWithCvmResponseV20260121Schema),
|
|
3671
|
+
page: import_zod49.z.number().int(),
|
|
3672
|
+
page_size: import_zod49.z.number().int(),
|
|
3673
|
+
total: import_zod49.z.number().int(),
|
|
3674
|
+
total_pages: import_zod49.z.number().int()
|
|
3675
|
+
});
|
|
3676
|
+
var DstackAppListResponseV20260522Schema = DstackAppListResponseV20260121Schema.extend({
|
|
3677
|
+
dstack_apps: import_zod49.z.array(DstackAppWithCvmResponseV20260522Schema)
|
|
3270
3678
|
});
|
|
3271
3679
|
|
|
3272
3680
|
// src/types/app_revision.ts
|
|
3273
|
-
var
|
|
3274
|
-
var CvmRefSchema =
|
|
3275
|
-
object_type:
|
|
3276
|
-
id:
|
|
3277
|
-
name:
|
|
3278
|
-
app_id:
|
|
3279
|
-
vm_uuid:
|
|
3280
|
-
});
|
|
3281
|
-
var AppRevisionResponseSchema =
|
|
3282
|
-
revision_id:
|
|
3283
|
-
app_id:
|
|
3284
|
-
vm_uuid:
|
|
3285
|
-
compose_hash:
|
|
3286
|
-
created_at:
|
|
3287
|
-
trace_id:
|
|
3288
|
-
operation_type:
|
|
3681
|
+
var import_zod50 = require("zod");
|
|
3682
|
+
var CvmRefSchema = import_zod50.z.object({
|
|
3683
|
+
object_type: import_zod50.z.literal("cvm"),
|
|
3684
|
+
id: import_zod50.z.string().nullable().optional(),
|
|
3685
|
+
name: import_zod50.z.string().nullable().optional(),
|
|
3686
|
+
app_id: import_zod50.z.string().nullable().optional(),
|
|
3687
|
+
vm_uuid: import_zod50.z.string().nullable().optional()
|
|
3688
|
+
});
|
|
3689
|
+
var AppRevisionResponseSchema = import_zod50.z.object({
|
|
3690
|
+
revision_id: import_zod50.z.string(),
|
|
3691
|
+
app_id: import_zod50.z.string(),
|
|
3692
|
+
vm_uuid: import_zod50.z.string(),
|
|
3693
|
+
compose_hash: import_zod50.z.string(),
|
|
3694
|
+
created_at: import_zod50.z.string(),
|
|
3695
|
+
trace_id: import_zod50.z.string().nullable().optional(),
|
|
3696
|
+
operation_type: import_zod50.z.string(),
|
|
3289
3697
|
triggered_by: UserRefSchema.nullable().optional(),
|
|
3290
3698
|
cvm: CvmRefSchema.nullable().optional(),
|
|
3291
3699
|
workspace: WorkspaceRefSchema.nullable().optional()
|
|
3292
3700
|
});
|
|
3293
|
-
var AppRevisionDetailResponseSchema =
|
|
3294
|
-
revision_id:
|
|
3295
|
-
app_id:
|
|
3296
|
-
vm_uuid:
|
|
3297
|
-
compose_hash:
|
|
3298
|
-
compose_file:
|
|
3299
|
-
encrypted_env:
|
|
3300
|
-
user_config:
|
|
3301
|
-
created_at:
|
|
3302
|
-
trace_id:
|
|
3303
|
-
operation_type:
|
|
3701
|
+
var AppRevisionDetailResponseSchema = import_zod50.z.object({
|
|
3702
|
+
revision_id: import_zod50.z.string(),
|
|
3703
|
+
app_id: import_zod50.z.string(),
|
|
3704
|
+
vm_uuid: import_zod50.z.string(),
|
|
3705
|
+
compose_hash: import_zod50.z.string(),
|
|
3706
|
+
compose_file: import_zod50.z.union([import_zod50.z.record(import_zod50.z.any()), import_zod50.z.string()]).nullable().optional(),
|
|
3707
|
+
encrypted_env: import_zod50.z.string(),
|
|
3708
|
+
user_config: import_zod50.z.string(),
|
|
3709
|
+
created_at: import_zod50.z.string(),
|
|
3710
|
+
trace_id: import_zod50.z.string().nullable().optional(),
|
|
3711
|
+
operation_type: import_zod50.z.string(),
|
|
3304
3712
|
triggered_by: UserRefSchema.nullable().optional(),
|
|
3305
3713
|
cvm: CvmRefSchema.nullable().optional(),
|
|
3306
3714
|
workspace: WorkspaceRefSchema.nullable().optional()
|
|
3307
3715
|
});
|
|
3308
|
-
var AppRevisionsResponseSchema =
|
|
3309
|
-
revisions:
|
|
3310
|
-
total:
|
|
3311
|
-
page:
|
|
3312
|
-
page_size:
|
|
3313
|
-
total_pages:
|
|
3716
|
+
var AppRevisionsResponseSchema = import_zod50.z.object({
|
|
3717
|
+
revisions: import_zod50.z.array(AppRevisionResponseSchema),
|
|
3718
|
+
total: import_zod50.z.number().int(),
|
|
3719
|
+
page: import_zod50.z.number().int(),
|
|
3720
|
+
page_size: import_zod50.z.number().int(),
|
|
3721
|
+
total_pages: import_zod50.z.number().int()
|
|
3314
3722
|
});
|
|
3315
3723
|
|
|
3316
3724
|
// src/actions/blockchains/deploy_app_auth.ts
|
|
3317
|
-
var
|
|
3725
|
+
var import_zod51 = require("zod");
|
|
3318
3726
|
var import_viem3 = require("viem");
|
|
3319
3727
|
var import_accounts2 = require("viem/accounts");
|
|
3320
3728
|
|
|
@@ -4009,25 +4417,25 @@ var kmsAuthAbi = [
|
|
|
4009
4417
|
anonymous: false
|
|
4010
4418
|
}
|
|
4011
4419
|
];
|
|
4012
|
-
var DeployAppAuthRequestBaseSchema =
|
|
4420
|
+
var DeployAppAuthRequestBaseSchema = import_zod51.z.object({
|
|
4013
4421
|
// Chain configuration (conditionally required)
|
|
4014
|
-
chain:
|
|
4015
|
-
rpcUrl:
|
|
4422
|
+
chain: import_zod51.z.unknown().optional(),
|
|
4423
|
+
rpcUrl: import_zod51.z.string().optional(),
|
|
4016
4424
|
// Contract configuration (required)
|
|
4017
|
-
kmsContractAddress:
|
|
4425
|
+
kmsContractAddress: import_zod51.z.string(),
|
|
4018
4426
|
// Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
|
|
4019
|
-
privateKey:
|
|
4020
|
-
walletClient:
|
|
4427
|
+
privateKey: import_zod51.z.string().optional(),
|
|
4428
|
+
walletClient: import_zod51.z.unknown().optional(),
|
|
4021
4429
|
// Public client (optional, will create default if not provided)
|
|
4022
|
-
publicClient:
|
|
4430
|
+
publicClient: import_zod51.z.unknown().optional(),
|
|
4023
4431
|
// App configuration (optional)
|
|
4024
|
-
allowAnyDevice:
|
|
4025
|
-
deviceId:
|
|
4026
|
-
composeHash:
|
|
4027
|
-
disableUpgrades:
|
|
4432
|
+
allowAnyDevice: import_zod51.z.boolean().optional().default(false),
|
|
4433
|
+
deviceId: import_zod51.z.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
|
|
4434
|
+
composeHash: import_zod51.z.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
|
|
4435
|
+
disableUpgrades: import_zod51.z.boolean().optional().default(false),
|
|
4028
4436
|
// Validation configuration (optional)
|
|
4029
|
-
skipPrerequisiteChecks:
|
|
4030
|
-
minBalance:
|
|
4437
|
+
skipPrerequisiteChecks: import_zod51.z.boolean().optional().default(false),
|
|
4438
|
+
minBalance: import_zod51.z.string().optional()
|
|
4031
4439
|
// ETH amount as string, e.g., "0.01"
|
|
4032
4440
|
}).passthrough();
|
|
4033
4441
|
var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
|
|
@@ -4055,13 +4463,13 @@ var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
|
|
|
4055
4463
|
path: ["chain"]
|
|
4056
4464
|
}
|
|
4057
4465
|
);
|
|
4058
|
-
var DeployAppAuthSchema =
|
|
4059
|
-
appId:
|
|
4060
|
-
appAuthAddress:
|
|
4061
|
-
deployer:
|
|
4062
|
-
transactionHash:
|
|
4063
|
-
blockNumber:
|
|
4064
|
-
gasUsed:
|
|
4466
|
+
var DeployAppAuthSchema = import_zod51.z.object({
|
|
4467
|
+
appId: import_zod51.z.string(),
|
|
4468
|
+
appAuthAddress: import_zod51.z.string(),
|
|
4469
|
+
deployer: import_zod51.z.string(),
|
|
4470
|
+
transactionHash: import_zod51.z.string(),
|
|
4471
|
+
blockNumber: import_zod51.z.bigint().optional(),
|
|
4472
|
+
gasUsed: import_zod51.z.bigint().optional()
|
|
4065
4473
|
}).passthrough();
|
|
4066
4474
|
function parseDeploymentResult(receipt, deployer, kmsContractAddress) {
|
|
4067
4475
|
try {
|
|
@@ -4307,7 +4715,7 @@ async function safeDeployAppAuth(request, parameters) {
|
|
|
4307
4715
|
}
|
|
4308
4716
|
|
|
4309
4717
|
// src/actions/blockchains/add_compose_hash.ts
|
|
4310
|
-
var
|
|
4718
|
+
var import_zod52 = require("zod");
|
|
4311
4719
|
var import_viem4 = require("viem");
|
|
4312
4720
|
var import_accounts3 = require("viem/accounts");
|
|
4313
4721
|
var appAuthAbi = [
|
|
@@ -4325,29 +4733,29 @@ var appAuthAbi = [
|
|
|
4325
4733
|
anonymous: false
|
|
4326
4734
|
}
|
|
4327
4735
|
];
|
|
4328
|
-
var AddComposeHashRequestSchema =
|
|
4736
|
+
var AddComposeHashRequestSchema = import_zod52.z.object({
|
|
4329
4737
|
// Chain configuration (conditionally required)
|
|
4330
|
-
chain:
|
|
4331
|
-
rpcUrl:
|
|
4332
|
-
appId:
|
|
4333
|
-
composeHash:
|
|
4738
|
+
chain: import_zod52.z.unknown().optional(),
|
|
4739
|
+
rpcUrl: import_zod52.z.string().optional(),
|
|
4740
|
+
appId: import_zod52.z.string(),
|
|
4741
|
+
composeHash: import_zod52.z.string(),
|
|
4334
4742
|
// Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
|
|
4335
|
-
privateKey:
|
|
4336
|
-
walletClient:
|
|
4743
|
+
privateKey: import_zod52.z.string().optional(),
|
|
4744
|
+
walletClient: import_zod52.z.unknown().optional(),
|
|
4337
4745
|
// Public client (optional, will create default if not provided)
|
|
4338
|
-
publicClient:
|
|
4746
|
+
publicClient: import_zod52.z.unknown().optional(),
|
|
4339
4747
|
// Validation configuration (optional)
|
|
4340
|
-
skipPrerequisiteChecks:
|
|
4341
|
-
minBalance:
|
|
4748
|
+
skipPrerequisiteChecks: import_zod52.z.boolean().optional().default(false),
|
|
4749
|
+
minBalance: import_zod52.z.string().optional(),
|
|
4342
4750
|
// ETH amount as string, e.g., "0.01"
|
|
4343
4751
|
// Transaction control options
|
|
4344
|
-
timeout:
|
|
4345
|
-
retryOptions:
|
|
4346
|
-
signal:
|
|
4752
|
+
timeout: import_zod52.z.number().optional().default(12e4),
|
|
4753
|
+
retryOptions: import_zod52.z.unknown().optional(),
|
|
4754
|
+
signal: import_zod52.z.unknown().optional(),
|
|
4347
4755
|
// Progress callbacks
|
|
4348
|
-
onTransactionStateChange:
|
|
4349
|
-
onTransactionSubmitted:
|
|
4350
|
-
onTransactionConfirmed:
|
|
4756
|
+
onTransactionStateChange: import_zod52.z.function().optional(),
|
|
4757
|
+
onTransactionSubmitted: import_zod52.z.function().optional(),
|
|
4758
|
+
onTransactionConfirmed: import_zod52.z.function().optional()
|
|
4351
4759
|
}).passthrough().refine(
|
|
4352
4760
|
(data) => {
|
|
4353
4761
|
const hasPrivateKey = !!data.privateKey;
|
|
@@ -4371,12 +4779,12 @@ var AddComposeHashRequestSchema = import_zod49.z.object({
|
|
|
4371
4779
|
path: ["chain"]
|
|
4372
4780
|
}
|
|
4373
4781
|
);
|
|
4374
|
-
var AddComposeHashSchema =
|
|
4375
|
-
composeHash:
|
|
4376
|
-
appId:
|
|
4377
|
-
transactionHash:
|
|
4378
|
-
blockNumber:
|
|
4379
|
-
gasUsed:
|
|
4782
|
+
var AddComposeHashSchema = import_zod52.z.object({
|
|
4783
|
+
composeHash: import_zod52.z.string(),
|
|
4784
|
+
appId: import_zod52.z.string(),
|
|
4785
|
+
transactionHash: import_zod52.z.string(),
|
|
4786
|
+
blockNumber: import_zod52.z.bigint().optional(),
|
|
4787
|
+
gasUsed: import_zod52.z.bigint().optional()
|
|
4380
4788
|
}).passthrough();
|
|
4381
4789
|
function parseComposeHashResult(receipt, composeHash, appAuthAddress, appId) {
|
|
4382
4790
|
console.log(receipt.logs);
|
|
@@ -4586,7 +4994,7 @@ async function safeAddComposeHash(request, parameters) {
|
|
|
4586
4994
|
}
|
|
4587
4995
|
|
|
4588
4996
|
// src/actions/blockchains/add_device.ts
|
|
4589
|
-
var
|
|
4997
|
+
var import_zod53 = require("zod");
|
|
4590
4998
|
var import_viem5 = require("viem");
|
|
4591
4999
|
var import_accounts4 = require("viem/accounts");
|
|
4592
5000
|
|
|
@@ -4676,22 +5084,22 @@ var dstackAppAbi = [
|
|
|
4676
5084
|
];
|
|
4677
5085
|
|
|
4678
5086
|
// src/actions/blockchains/add_device.ts
|
|
4679
|
-
var AddDeviceRequestSchema =
|
|
4680
|
-
chain:
|
|
4681
|
-
rpcUrl:
|
|
4682
|
-
appAddress:
|
|
4683
|
-
deviceId:
|
|
4684
|
-
privateKey:
|
|
4685
|
-
walletClient:
|
|
4686
|
-
publicClient:
|
|
4687
|
-
skipPrerequisiteChecks:
|
|
4688
|
-
minBalance:
|
|
4689
|
-
timeout:
|
|
4690
|
-
retryOptions:
|
|
4691
|
-
signal:
|
|
4692
|
-
onTransactionStateChange:
|
|
4693
|
-
onTransactionSubmitted:
|
|
4694
|
-
onTransactionConfirmed:
|
|
5087
|
+
var AddDeviceRequestSchema = import_zod53.z.object({
|
|
5088
|
+
chain: import_zod53.z.unknown().optional(),
|
|
5089
|
+
rpcUrl: import_zod53.z.string().optional(),
|
|
5090
|
+
appAddress: import_zod53.z.string(),
|
|
5091
|
+
deviceId: import_zod53.z.string(),
|
|
5092
|
+
privateKey: import_zod53.z.string().optional(),
|
|
5093
|
+
walletClient: import_zod53.z.unknown().optional(),
|
|
5094
|
+
publicClient: import_zod53.z.unknown().optional(),
|
|
5095
|
+
skipPrerequisiteChecks: import_zod53.z.boolean().optional().default(false),
|
|
5096
|
+
minBalance: import_zod53.z.string().optional(),
|
|
5097
|
+
timeout: import_zod53.z.number().optional().default(12e4),
|
|
5098
|
+
retryOptions: import_zod53.z.unknown().optional(),
|
|
5099
|
+
signal: import_zod53.z.unknown().optional(),
|
|
5100
|
+
onTransactionStateChange: import_zod53.z.function().optional(),
|
|
5101
|
+
onTransactionSubmitted: import_zod53.z.function().optional(),
|
|
5102
|
+
onTransactionConfirmed: import_zod53.z.function().optional()
|
|
4695
5103
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
4696
5104
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
4697
5105
|
path: ["privateKey", "walletClient"]
|
|
@@ -4705,12 +5113,12 @@ var AddDeviceRequestSchema = import_zod50.z.object({
|
|
|
4705
5113
|
path: ["chain"]
|
|
4706
5114
|
}
|
|
4707
5115
|
);
|
|
4708
|
-
var AddDeviceSchema =
|
|
4709
|
-
appAddress:
|
|
4710
|
-
deviceId:
|
|
4711
|
-
transactionHash:
|
|
4712
|
-
blockNumber:
|
|
4713
|
-
gasUsed:
|
|
5116
|
+
var AddDeviceSchema = import_zod53.z.object({
|
|
5117
|
+
appAddress: import_zod53.z.string(),
|
|
5118
|
+
deviceId: import_zod53.z.string(),
|
|
5119
|
+
transactionHash: import_zod53.z.string(),
|
|
5120
|
+
blockNumber: import_zod53.z.bigint().optional(),
|
|
5121
|
+
gasUsed: import_zod53.z.bigint().optional()
|
|
4714
5122
|
}).passthrough();
|
|
4715
5123
|
async function addDevice(request, parameters) {
|
|
4716
5124
|
const validatedRequest = AddDeviceRequestSchema.parse(request);
|
|
@@ -4858,25 +5266,25 @@ async function safeAddDevice(request, parameters) {
|
|
|
4858
5266
|
}
|
|
4859
5267
|
|
|
4860
5268
|
// src/actions/blockchains/remove_device.ts
|
|
4861
|
-
var
|
|
5269
|
+
var import_zod54 = require("zod");
|
|
4862
5270
|
var import_viem6 = require("viem");
|
|
4863
5271
|
var import_accounts5 = require("viem/accounts");
|
|
4864
|
-
var RemoveDeviceRequestSchema =
|
|
4865
|
-
chain:
|
|
4866
|
-
rpcUrl:
|
|
4867
|
-
appAddress:
|
|
4868
|
-
deviceId:
|
|
4869
|
-
privateKey:
|
|
4870
|
-
walletClient:
|
|
4871
|
-
publicClient:
|
|
4872
|
-
skipPrerequisiteChecks:
|
|
4873
|
-
minBalance:
|
|
4874
|
-
timeout:
|
|
4875
|
-
retryOptions:
|
|
4876
|
-
signal:
|
|
4877
|
-
onTransactionStateChange:
|
|
4878
|
-
onTransactionSubmitted:
|
|
4879
|
-
onTransactionConfirmed:
|
|
5272
|
+
var RemoveDeviceRequestSchema = import_zod54.z.object({
|
|
5273
|
+
chain: import_zod54.z.unknown().optional(),
|
|
5274
|
+
rpcUrl: import_zod54.z.string().optional(),
|
|
5275
|
+
appAddress: import_zod54.z.string(),
|
|
5276
|
+
deviceId: import_zod54.z.string(),
|
|
5277
|
+
privateKey: import_zod54.z.string().optional(),
|
|
5278
|
+
walletClient: import_zod54.z.unknown().optional(),
|
|
5279
|
+
publicClient: import_zod54.z.unknown().optional(),
|
|
5280
|
+
skipPrerequisiteChecks: import_zod54.z.boolean().optional().default(false),
|
|
5281
|
+
minBalance: import_zod54.z.string().optional(),
|
|
5282
|
+
timeout: import_zod54.z.number().optional().default(12e4),
|
|
5283
|
+
retryOptions: import_zod54.z.unknown().optional(),
|
|
5284
|
+
signal: import_zod54.z.unknown().optional(),
|
|
5285
|
+
onTransactionStateChange: import_zod54.z.function().optional(),
|
|
5286
|
+
onTransactionSubmitted: import_zod54.z.function().optional(),
|
|
5287
|
+
onTransactionConfirmed: import_zod54.z.function().optional()
|
|
4880
5288
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
4881
5289
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
4882
5290
|
path: ["privateKey", "walletClient"]
|
|
@@ -4890,12 +5298,12 @@ var RemoveDeviceRequestSchema = import_zod51.z.object({
|
|
|
4890
5298
|
path: ["chain"]
|
|
4891
5299
|
}
|
|
4892
5300
|
);
|
|
4893
|
-
var RemoveDeviceSchema =
|
|
4894
|
-
appAddress:
|
|
4895
|
-
deviceId:
|
|
4896
|
-
transactionHash:
|
|
4897
|
-
blockNumber:
|
|
4898
|
-
gasUsed:
|
|
5301
|
+
var RemoveDeviceSchema = import_zod54.z.object({
|
|
5302
|
+
appAddress: import_zod54.z.string(),
|
|
5303
|
+
deviceId: import_zod54.z.string(),
|
|
5304
|
+
transactionHash: import_zod54.z.string(),
|
|
5305
|
+
blockNumber: import_zod54.z.bigint().optional(),
|
|
5306
|
+
gasUsed: import_zod54.z.bigint().optional()
|
|
4899
5307
|
}).passthrough();
|
|
4900
5308
|
async function removeDevice(request, parameters) {
|
|
4901
5309
|
const validatedRequest = RemoveDeviceRequestSchema.parse(request);
|
|
@@ -5033,25 +5441,25 @@ async function safeRemoveDevice(request, parameters) {
|
|
|
5033
5441
|
}
|
|
5034
5442
|
|
|
5035
5443
|
// src/actions/blockchains/set_allow_any_device.ts
|
|
5036
|
-
var
|
|
5444
|
+
var import_zod55 = require("zod");
|
|
5037
5445
|
var import_viem7 = require("viem");
|
|
5038
5446
|
var import_accounts6 = require("viem/accounts");
|
|
5039
|
-
var SetAllowAnyDeviceRequestSchema =
|
|
5040
|
-
chain:
|
|
5041
|
-
rpcUrl:
|
|
5042
|
-
appAddress:
|
|
5043
|
-
allow:
|
|
5044
|
-
privateKey:
|
|
5045
|
-
walletClient:
|
|
5046
|
-
publicClient:
|
|
5047
|
-
skipPrerequisiteChecks:
|
|
5048
|
-
minBalance:
|
|
5049
|
-
timeout:
|
|
5050
|
-
retryOptions:
|
|
5051
|
-
signal:
|
|
5052
|
-
onTransactionStateChange:
|
|
5053
|
-
onTransactionSubmitted:
|
|
5054
|
-
onTransactionConfirmed:
|
|
5447
|
+
var SetAllowAnyDeviceRequestSchema = import_zod55.z.object({
|
|
5448
|
+
chain: import_zod55.z.unknown().optional(),
|
|
5449
|
+
rpcUrl: import_zod55.z.string().optional(),
|
|
5450
|
+
appAddress: import_zod55.z.string(),
|
|
5451
|
+
allow: import_zod55.z.boolean(),
|
|
5452
|
+
privateKey: import_zod55.z.string().optional(),
|
|
5453
|
+
walletClient: import_zod55.z.unknown().optional(),
|
|
5454
|
+
publicClient: import_zod55.z.unknown().optional(),
|
|
5455
|
+
skipPrerequisiteChecks: import_zod55.z.boolean().optional().default(false),
|
|
5456
|
+
minBalance: import_zod55.z.string().optional(),
|
|
5457
|
+
timeout: import_zod55.z.number().optional().default(12e4),
|
|
5458
|
+
retryOptions: import_zod55.z.unknown().optional(),
|
|
5459
|
+
signal: import_zod55.z.unknown().optional(),
|
|
5460
|
+
onTransactionStateChange: import_zod55.z.function().optional(),
|
|
5461
|
+
onTransactionSubmitted: import_zod55.z.function().optional(),
|
|
5462
|
+
onTransactionConfirmed: import_zod55.z.function().optional()
|
|
5055
5463
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
5056
5464
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
5057
5465
|
path: ["privateKey", "walletClient"]
|
|
@@ -5065,12 +5473,12 @@ var SetAllowAnyDeviceRequestSchema = import_zod52.z.object({
|
|
|
5065
5473
|
path: ["chain"]
|
|
5066
5474
|
}
|
|
5067
5475
|
);
|
|
5068
|
-
var SetAllowAnyDeviceSchema =
|
|
5069
|
-
appAddress:
|
|
5070
|
-
allow:
|
|
5071
|
-
transactionHash:
|
|
5072
|
-
blockNumber:
|
|
5073
|
-
gasUsed:
|
|
5476
|
+
var SetAllowAnyDeviceSchema = import_zod55.z.object({
|
|
5477
|
+
appAddress: import_zod55.z.string(),
|
|
5478
|
+
allow: import_zod55.z.boolean(),
|
|
5479
|
+
transactionHash: import_zod55.z.string(),
|
|
5480
|
+
blockNumber: import_zod55.z.bigint().optional(),
|
|
5481
|
+
gasUsed: import_zod55.z.bigint().optional()
|
|
5074
5482
|
}).passthrough();
|
|
5075
5483
|
async function setAllowAnyDevice(request, parameters) {
|
|
5076
5484
|
const validatedRequest = SetAllowAnyDeviceRequestSchema.parse(request);
|
|
@@ -5207,13 +5615,13 @@ async function safeSetAllowAnyDevice(request, parameters) {
|
|
|
5207
5615
|
}
|
|
5208
5616
|
|
|
5209
5617
|
// src/actions/blockchains/get_allowed_devices.ts
|
|
5210
|
-
var
|
|
5618
|
+
var import_zod56 = require("zod");
|
|
5211
5619
|
var import_viem8 = require("viem");
|
|
5212
|
-
var GetAllowedDevicesSchema =
|
|
5213
|
-
appAddress:
|
|
5214
|
-
owner:
|
|
5215
|
-
allowAnyDevice:
|
|
5216
|
-
devices:
|
|
5620
|
+
var GetAllowedDevicesSchema = import_zod56.z.object({
|
|
5621
|
+
appAddress: import_zod56.z.string(),
|
|
5622
|
+
owner: import_zod56.z.string(),
|
|
5623
|
+
allowAnyDevice: import_zod56.z.boolean(),
|
|
5624
|
+
devices: import_zod56.z.array(import_zod56.z.string())
|
|
5217
5625
|
});
|
|
5218
5626
|
async function getAllowedDevices(request) {
|
|
5219
5627
|
const { chain, rpcUrl, appAddress, deviceIds, publicClient: providedPublicClient } = request;
|
|
@@ -5407,15 +5815,15 @@ async function safeCheckOnChainPrerequisites(request) {
|
|
|
5407
5815
|
}
|
|
5408
5816
|
|
|
5409
5817
|
// src/actions/workspaces/get_workspace_nodes.ts
|
|
5410
|
-
var
|
|
5818
|
+
var import_zod57 = require("zod");
|
|
5411
5819
|
var NodeRefSchema2 = NodeRefSchema;
|
|
5412
5820
|
var NodeInfoSchema = NodeRefSchema2;
|
|
5413
|
-
var GetWorkspaceNodesSchema =
|
|
5414
|
-
items:
|
|
5415
|
-
total:
|
|
5416
|
-
page:
|
|
5417
|
-
page_size:
|
|
5418
|
-
pages:
|
|
5821
|
+
var GetWorkspaceNodesSchema = import_zod57.z.object({
|
|
5822
|
+
items: import_zod57.z.array(NodeRefSchema2),
|
|
5823
|
+
total: import_zod57.z.number(),
|
|
5824
|
+
page: import_zod57.z.number(),
|
|
5825
|
+
page_size: import_zod57.z.number(),
|
|
5826
|
+
pages: import_zod57.z.number()
|
|
5419
5827
|
}).passthrough();
|
|
5420
5828
|
var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAction(GetWorkspaceNodesSchema, async (client, request) => {
|
|
5421
5829
|
const { teamSlug, page, pageSize } = request;
|
|
@@ -5427,56 +5835,74 @@ var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAct
|
|
|
5427
5835
|
});
|
|
5428
5836
|
|
|
5429
5837
|
// src/actions/workspaces/get_workspace_quotas.ts
|
|
5430
|
-
var
|
|
5431
|
-
var QuotaMetricSchema =
|
|
5432
|
-
limit:
|
|
5433
|
-
remaining:
|
|
5838
|
+
var import_zod58 = require("zod");
|
|
5839
|
+
var QuotaMetricSchema = import_zod58.z.object({
|
|
5840
|
+
limit: import_zod58.z.number(),
|
|
5841
|
+
remaining: import_zod58.z.number()
|
|
5434
5842
|
}).passthrough();
|
|
5435
|
-
var WorkspaceQuotasSchema =
|
|
5843
|
+
var WorkspaceQuotasSchema = import_zod58.z.object({
|
|
5436
5844
|
vm_slots: QuotaMetricSchema,
|
|
5437
5845
|
vcpu: QuotaMetricSchema,
|
|
5438
5846
|
memory_mb: QuotaMetricSchema,
|
|
5439
5847
|
disk_gb: QuotaMetricSchema
|
|
5440
5848
|
}).passthrough();
|
|
5441
|
-
var WorkspaceReservedGpuQuotaSchema =
|
|
5849
|
+
var WorkspaceReservedGpuQuotaSchema = import_zod58.z.object({
|
|
5442
5850
|
gpus: QuotaMetricSchema,
|
|
5443
|
-
in_use:
|
|
5444
|
-
misconfigured:
|
|
5851
|
+
in_use: import_zod58.z.number(),
|
|
5852
|
+
misconfigured: import_zod58.z.number()
|
|
5445
5853
|
}).passthrough();
|
|
5446
|
-
var GetWorkspaceQuotasSchema =
|
|
5447
|
-
team_slug:
|
|
5448
|
-
tier:
|
|
5854
|
+
var GetWorkspaceQuotasSchema = import_zod58.z.object({
|
|
5855
|
+
team_slug: import_zod58.z.string(),
|
|
5856
|
+
tier: import_zod58.z.string(),
|
|
5449
5857
|
quotas: WorkspaceQuotasSchema,
|
|
5450
5858
|
reserved_nodes: QuotaMetricSchema,
|
|
5451
5859
|
reserved_gpu: WorkspaceReservedGpuQuotaSchema,
|
|
5452
|
-
as_of:
|
|
5860
|
+
as_of: import_zod58.z.string()
|
|
5453
5861
|
}).passthrough();
|
|
5454
5862
|
var { action: getWorkspaceQuotas, safeAction: safeGetWorkspaceQuotas } = defineAction(GetWorkspaceQuotasSchema, async (client, request) => {
|
|
5455
5863
|
return await client.get(`/workspaces/${request.teamSlug}/quotas`);
|
|
5456
5864
|
});
|
|
5457
5865
|
|
|
5458
5866
|
// src/actions/cvms/replicate_cvm.ts
|
|
5459
|
-
var
|
|
5867
|
+
var import_zod59 = require("zod");
|
|
5460
5868
|
var ReplicateCvmRequestSchema = refineCvmId(
|
|
5461
5869
|
CvmIdObjectSchema.extend({
|
|
5462
|
-
node_id:
|
|
5870
|
+
node_id: import_zod59.z.number().optional()
|
|
5463
5871
|
})
|
|
5464
5872
|
);
|
|
5465
|
-
|
|
5873
|
+
async function replicateCvm(client, request) {
|
|
5466
5874
|
const parsed = ReplicateCvmRequestSchema.parse(request);
|
|
5467
5875
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5468
5876
|
const { node_id } = parsed;
|
|
5469
|
-
|
|
5470
|
-
|
|
5877
|
+
const response = await client.post(`/cvms/${cvmId}/replicas`, { node_id });
|
|
5878
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
5879
|
+
}
|
|
5880
|
+
async function safeReplicateCvm(client, request) {
|
|
5881
|
+
try {
|
|
5882
|
+
const data = await replicateCvm(client, request);
|
|
5883
|
+
return { success: true, data };
|
|
5884
|
+
} catch (error) {
|
|
5885
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
5886
|
+
return { success: false, error };
|
|
5887
|
+
}
|
|
5888
|
+
return {
|
|
5889
|
+
success: false,
|
|
5890
|
+
error: {
|
|
5891
|
+
name: "Error",
|
|
5892
|
+
message: error instanceof Error ? error.message : String(error)
|
|
5893
|
+
}
|
|
5894
|
+
};
|
|
5895
|
+
}
|
|
5896
|
+
}
|
|
5471
5897
|
|
|
5472
5898
|
// src/actions/cvms/watch_cvm_state.ts
|
|
5473
|
-
var
|
|
5474
|
-
var WatchCvmStateParamsSchema =
|
|
5475
|
-
target:
|
|
5476
|
-
interval:
|
|
5477
|
-
timeout:
|
|
5478
|
-
maxRetries:
|
|
5479
|
-
retryDelay:
|
|
5899
|
+
var import_zod60 = require("zod");
|
|
5900
|
+
var WatchCvmStateParamsSchema = import_zod60.z.object({
|
|
5901
|
+
target: import_zod60.z.string().describe("Target status to wait for (e.g., 'running', 'stopped')"),
|
|
5902
|
+
interval: import_zod60.z.number().min(5).max(30).default(5).describe("Polling interval in seconds"),
|
|
5903
|
+
timeout: import_zod60.z.number().min(10).max(600).default(300).describe("Timeout per attempt in seconds"),
|
|
5904
|
+
maxRetries: import_zod60.z.number().min(0).default(Number.POSITIVE_INFINITY).describe("Maximum number of retry attempts (Infinity for unlimited)"),
|
|
5905
|
+
retryDelay: import_zod60.z.number().min(0).default(5e3).describe("Delay between retries in milliseconds")
|
|
5480
5906
|
});
|
|
5481
5907
|
var WatchCvmStateRequestSchema = WatchCvmStateParamsSchema;
|
|
5482
5908
|
var WatchAbortedError = class extends Error {
|
|
@@ -5664,57 +6090,57 @@ function sleep(ms, signal) {
|
|
|
5664
6090
|
}
|
|
5665
6091
|
|
|
5666
6092
|
// src/actions/cvms/patch_cvm.ts
|
|
5667
|
-
var
|
|
6093
|
+
var import_zod61 = require("zod");
|
|
5668
6094
|
var PatchCvmRequestSchema = refineCvmId(
|
|
5669
6095
|
CvmIdObjectSchema.extend({
|
|
5670
6096
|
// Compose-hash-affecting fields
|
|
5671
|
-
docker_compose_file:
|
|
5672
|
-
pre_launch_script:
|
|
5673
|
-
allowed_envs:
|
|
6097
|
+
docker_compose_file: import_zod61.z.string().optional(),
|
|
6098
|
+
pre_launch_script: import_zod61.z.string().optional(),
|
|
6099
|
+
allowed_envs: import_zod61.z.array(import_zod61.z.string()).optional(),
|
|
5674
6100
|
// Visibility
|
|
5675
|
-
public_logs:
|
|
5676
|
-
public_sysinfo:
|
|
5677
|
-
public_tcbinfo:
|
|
6101
|
+
public_logs: import_zod61.z.boolean().optional(),
|
|
6102
|
+
public_sysinfo: import_zod61.z.boolean().optional(),
|
|
6103
|
+
public_tcbinfo: import_zod61.z.boolean().optional(),
|
|
5678
6104
|
// Non-compose-hash config
|
|
5679
|
-
encrypted_env:
|
|
5680
|
-
user_config:
|
|
5681
|
-
gpus:
|
|
5682
|
-
count:
|
|
5683
|
-
product_name:
|
|
6105
|
+
encrypted_env: import_zod61.z.string().optional(),
|
|
6106
|
+
user_config: import_zod61.z.string().optional(),
|
|
6107
|
+
gpus: import_zod61.z.object({
|
|
6108
|
+
count: import_zod61.z.number(),
|
|
6109
|
+
product_name: import_zod61.z.string().optional()
|
|
5684
6110
|
}).optional(),
|
|
5685
6111
|
// Resources
|
|
5686
|
-
vcpu:
|
|
5687
|
-
memory:
|
|
5688
|
-
disk_size:
|
|
6112
|
+
vcpu: import_zod61.z.number().optional(),
|
|
6113
|
+
memory: import_zod61.z.number().optional(),
|
|
6114
|
+
disk_size: import_zod61.z.number().optional(),
|
|
5689
6115
|
// OS image
|
|
5690
|
-
image:
|
|
6116
|
+
image: import_zod61.z.string().optional(),
|
|
5691
6117
|
// Shutdown behavior
|
|
5692
|
-
shutdown_timeout:
|
|
5693
|
-
allow_force_stop:
|
|
6118
|
+
shutdown_timeout: import_zod61.z.number().optional(),
|
|
6119
|
+
allow_force_stop: import_zod61.z.boolean().optional(),
|
|
5694
6120
|
// Prepare-only mode (for multisig workflows)
|
|
5695
|
-
prepareOnly:
|
|
6121
|
+
prepareOnly: import_zod61.z.boolean().optional()
|
|
5696
6122
|
})
|
|
5697
6123
|
);
|
|
5698
|
-
var PatchCvmAcceptedSchema =
|
|
5699
|
-
requiresOnChainHash:
|
|
5700
|
-
correlationId:
|
|
5701
|
-
});
|
|
5702
|
-
var PatchCvmHashRequiredSchema =
|
|
5703
|
-
requiresOnChainHash:
|
|
5704
|
-
composeHash:
|
|
5705
|
-
appId:
|
|
5706
|
-
deviceId:
|
|
6124
|
+
var PatchCvmAcceptedSchema = import_zod61.z.object({
|
|
6125
|
+
requiresOnChainHash: import_zod61.z.literal(false),
|
|
6126
|
+
correlationId: import_zod61.z.string()
|
|
6127
|
+
});
|
|
6128
|
+
var PatchCvmHashRequiredSchema = import_zod61.z.object({
|
|
6129
|
+
requiresOnChainHash: import_zod61.z.literal(true),
|
|
6130
|
+
composeHash: import_zod61.z.string(),
|
|
6131
|
+
appId: import_zod61.z.string(),
|
|
6132
|
+
deviceId: import_zod61.z.string(),
|
|
5707
6133
|
kmsInfo: KmsInfoSchema,
|
|
5708
|
-
commitToken:
|
|
5709
|
-
commitUrl:
|
|
5710
|
-
apiCommitUrl:
|
|
5711
|
-
onchainStatus:
|
|
5712
|
-
compose_hash_allowed:
|
|
5713
|
-
device_id_allowed:
|
|
5714
|
-
is_allowed:
|
|
6134
|
+
commitToken: import_zod61.z.string().optional(),
|
|
6135
|
+
commitUrl: import_zod61.z.string().optional(),
|
|
6136
|
+
apiCommitUrl: import_zod61.z.string().optional(),
|
|
6137
|
+
onchainStatus: import_zod61.z.object({
|
|
6138
|
+
compose_hash_allowed: import_zod61.z.boolean(),
|
|
6139
|
+
device_id_allowed: import_zod61.z.boolean(),
|
|
6140
|
+
is_allowed: import_zod61.z.boolean()
|
|
5715
6141
|
}).optional()
|
|
5716
6142
|
});
|
|
5717
|
-
var PatchCvmResultSchema =
|
|
6143
|
+
var PatchCvmResultSchema = import_zod61.z.discriminatedUnion("requiresOnChainHash", [
|
|
5718
6144
|
PatchCvmAcceptedSchema,
|
|
5719
6145
|
PatchCvmHashRequiredSchema
|
|
5720
6146
|
]);
|
|
@@ -5763,15 +6189,15 @@ var { action: patchCvm, safeAction: safePatchCvm } = defineAction(PatchCvmResult
|
|
|
5763
6189
|
});
|
|
5764
6190
|
|
|
5765
6191
|
// src/actions/cvms/confirm_cvm_patch.ts
|
|
5766
|
-
var
|
|
6192
|
+
var import_zod62 = require("zod");
|
|
5767
6193
|
var ConfirmCvmPatchRequestSchema = refineCvmId(
|
|
5768
6194
|
CvmIdObjectSchema.extend({
|
|
5769
|
-
composeHash:
|
|
5770
|
-
transactionHash:
|
|
6195
|
+
composeHash: import_zod62.z.string().describe("Compose hash from patchCvm Phase 1 response"),
|
|
6196
|
+
transactionHash: import_zod62.z.string().describe("Transaction hash proving on-chain registration")
|
|
5771
6197
|
})
|
|
5772
6198
|
);
|
|
5773
|
-
var ConfirmCvmPatchResultSchema =
|
|
5774
|
-
correlationId:
|
|
6199
|
+
var ConfirmCvmPatchResultSchema = import_zod62.z.object({
|
|
6200
|
+
correlationId: import_zod62.z.string()
|
|
5775
6201
|
});
|
|
5776
6202
|
var { action: confirmCvmPatch, safeAction: safeConfirmCvmPatch } = defineAction(ConfirmCvmPatchResultSchema, async (client, request) => {
|
|
5777
6203
|
const parsed = ConfirmCvmPatchRequestSchema.parse(request);
|
|
@@ -5792,17 +6218,17 @@ var { action: confirmCvmPatch, safeAction: safeConfirmCvmPatch } = defineAction(
|
|
|
5792
6218
|
});
|
|
5793
6219
|
|
|
5794
6220
|
// src/actions/cvms/commit_cvm_update.ts
|
|
5795
|
-
var
|
|
6221
|
+
var import_zod63 = require("zod");
|
|
5796
6222
|
var CommitCvmUpdateRequestSchema = refineCvmId(
|
|
5797
6223
|
CvmIdObjectSchema.extend({
|
|
5798
|
-
token:
|
|
5799
|
-
composeHash:
|
|
5800
|
-
transactionHash:
|
|
6224
|
+
token: import_zod63.z.string().describe("One-time commit token from prepare-only flow"),
|
|
6225
|
+
composeHash: import_zod63.z.string().describe("Compose hash from Phase 1 response"),
|
|
6226
|
+
transactionHash: import_zod63.z.string().describe("Transaction hash proving on-chain registration")
|
|
5801
6227
|
})
|
|
5802
6228
|
);
|
|
5803
|
-
var CommitCvmUpdateResultSchema =
|
|
5804
|
-
correlationId:
|
|
5805
|
-
status:
|
|
6229
|
+
var CommitCvmUpdateResultSchema = import_zod63.z.object({
|
|
6230
|
+
correlationId: import_zod63.z.string(),
|
|
6231
|
+
status: import_zod63.z.string()
|
|
5806
6232
|
});
|
|
5807
6233
|
var { action: commitCvmUpdate, safeAction: safeCommitCvmUpdate } = defineAction(CommitCvmUpdateResultSchema, async (client, request) => {
|
|
5808
6234
|
const parsed = CommitCvmUpdateRequestSchema.parse(request);
|
|
@@ -5819,74 +6245,140 @@ var { action: commitCvmUpdate, safeAction: safeCommitCvmUpdate } = defineAction(
|
|
|
5819
6245
|
});
|
|
5820
6246
|
|
|
5821
6247
|
// src/actions/cvms/refresh_cvm_instance_id.ts
|
|
5822
|
-
var
|
|
5823
|
-
var
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
6248
|
+
var import_zod64 = require("zod");
|
|
6249
|
+
var InstanceIdRefreshResultBaseSchema = import_zod64.z.object({
|
|
6250
|
+
identifier: import_zod64.z.string(),
|
|
6251
|
+
status: import_zod64.z.enum(["updated", "unchanged", "skipped", "conflict", "error"]),
|
|
6252
|
+
old_instance_id: import_zod64.z.string().nullable().optional(),
|
|
6253
|
+
new_instance_id: import_zod64.z.string().nullable().optional(),
|
|
6254
|
+
source: import_zod64.z.enum(["teepod_state", "teepod_info", "gateway", "none"]),
|
|
6255
|
+
verified_with_gateway: import_zod64.z.boolean(),
|
|
6256
|
+
reason: import_zod64.z.string().nullable().optional()
|
|
6257
|
+
});
|
|
6258
|
+
var InstanceIdRefreshResultV20260121Schema = InstanceIdRefreshResultBaseSchema.extend({
|
|
6259
|
+
cvm_id: import_zod64.z.number().nullable()
|
|
6260
|
+
});
|
|
6261
|
+
var InstanceIdRefreshResultV20260522Schema = InstanceIdRefreshResultBaseSchema.extend({
|
|
6262
|
+
cvm_id: import_zod64.z.string().nullable()
|
|
6263
|
+
});
|
|
6264
|
+
var InstanceIdRefreshResultAnySchema = import_zod64.z.union([
|
|
6265
|
+
InstanceIdRefreshResultV20260121Schema,
|
|
6266
|
+
InstanceIdRefreshResultV20260522Schema
|
|
6267
|
+
]);
|
|
6268
|
+
var InstanceIdRefreshResultSchema = InstanceIdRefreshResultV20260522Schema;
|
|
5833
6269
|
var RefreshCvmInstanceIdRequestSchema = refineCvmId(
|
|
5834
6270
|
CvmIdObjectSchema.extend({
|
|
5835
|
-
overwrite:
|
|
5836
|
-
dry_run:
|
|
6271
|
+
overwrite: import_zod64.z.boolean().optional(),
|
|
6272
|
+
dry_run: import_zod64.z.boolean().optional()
|
|
5837
6273
|
})
|
|
5838
6274
|
);
|
|
5839
|
-
|
|
6275
|
+
function getSchemaForVersion6(version) {
|
|
6276
|
+
if (version === "2026-01-21") return InstanceIdRefreshResultV20260121Schema;
|
|
6277
|
+
return InstanceIdRefreshResultV20260522Schema;
|
|
6278
|
+
}
|
|
6279
|
+
async function refreshCvmInstanceId(client, request) {
|
|
5840
6280
|
const parsed = RefreshCvmInstanceIdRequestSchema.parse(request);
|
|
5841
6281
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5842
6282
|
const { overwrite, dry_run } = parsed;
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
}
|
|
6283
|
+
const response = await client.patch(`/cvms/${cvmId}/instance-id`, { overwrite, dry_run });
|
|
6284
|
+
return getSchemaForVersion6(client.config.version).parse(
|
|
6285
|
+
response
|
|
6286
|
+
);
|
|
6287
|
+
}
|
|
6288
|
+
async function safeRefreshCvmInstanceId(client, request) {
|
|
6289
|
+
try {
|
|
6290
|
+
const data = await refreshCvmInstanceId(client, request);
|
|
6291
|
+
return { success: true, data };
|
|
6292
|
+
} catch (error) {
|
|
6293
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6294
|
+
return { success: false, error };
|
|
6295
|
+
}
|
|
6296
|
+
return {
|
|
6297
|
+
success: false,
|
|
6298
|
+
error: {
|
|
6299
|
+
name: "Error",
|
|
6300
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6301
|
+
}
|
|
6302
|
+
};
|
|
6303
|
+
}
|
|
6304
|
+
}
|
|
5848
6305
|
|
|
5849
6306
|
// src/actions/cvms/refresh_cvm_instance_ids.ts
|
|
5850
|
-
var
|
|
5851
|
-
var RefreshCvmInstanceIdsRequestSchema =
|
|
5852
|
-
cvm_ids:
|
|
5853
|
-
running_only:
|
|
5854
|
-
missing_only:
|
|
5855
|
-
overwrite:
|
|
5856
|
-
limit:
|
|
5857
|
-
dry_run:
|
|
6307
|
+
var import_zod65 = require("zod");
|
|
6308
|
+
var RefreshCvmInstanceIdsRequestSchema = import_zod65.z.object({
|
|
6309
|
+
cvm_ids: import_zod65.z.array(import_zod65.z.string()).optional(),
|
|
6310
|
+
running_only: import_zod65.z.boolean().optional(),
|
|
6311
|
+
missing_only: import_zod65.z.boolean().optional(),
|
|
6312
|
+
overwrite: import_zod65.z.boolean().optional(),
|
|
6313
|
+
limit: import_zod65.z.number().int().min(1).max(500).optional(),
|
|
6314
|
+
dry_run: import_zod65.z.boolean().optional()
|
|
5858
6315
|
}).strict();
|
|
5859
|
-
var
|
|
5860
|
-
total:
|
|
5861
|
-
scanned:
|
|
5862
|
-
updated:
|
|
5863
|
-
unchanged:
|
|
5864
|
-
skipped:
|
|
5865
|
-
conflicts:
|
|
5866
|
-
errors:
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
6316
|
+
var RefreshCvmInstanceIdsResponseBaseSchema = import_zod65.z.object({
|
|
6317
|
+
total: import_zod65.z.number().int(),
|
|
6318
|
+
scanned: import_zod65.z.number().int(),
|
|
6319
|
+
updated: import_zod65.z.number().int(),
|
|
6320
|
+
unchanged: import_zod65.z.number().int(),
|
|
6321
|
+
skipped: import_zod65.z.number().int(),
|
|
6322
|
+
conflicts: import_zod65.z.number().int(),
|
|
6323
|
+
errors: import_zod65.z.number().int()
|
|
6324
|
+
});
|
|
6325
|
+
var RefreshCvmInstanceIdsResponseV20260121Schema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
6326
|
+
items: import_zod65.z.array(InstanceIdRefreshResultV20260121Schema)
|
|
6327
|
+
});
|
|
6328
|
+
var RefreshCvmInstanceIdsResponseV20260522Schema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
6329
|
+
items: import_zod65.z.array(InstanceIdRefreshResultV20260522Schema)
|
|
6330
|
+
});
|
|
6331
|
+
var RefreshCvmInstanceIdsResponseAnySchema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
6332
|
+
items: import_zod65.z.array(
|
|
6333
|
+
import_zod65.z.union([InstanceIdRefreshResultV20260121Schema, InstanceIdRefreshResultV20260522Schema])
|
|
6334
|
+
)
|
|
5872
6335
|
});
|
|
6336
|
+
var RefreshCvmInstanceIdsResponseSchema = RefreshCvmInstanceIdsResponseV20260522Schema;
|
|
6337
|
+
function getSchemaForVersion7(version) {
|
|
6338
|
+
if (version === "2026-01-21") return RefreshCvmInstanceIdsResponseV20260121Schema;
|
|
6339
|
+
return RefreshCvmInstanceIdsResponseV20260522Schema;
|
|
6340
|
+
}
|
|
6341
|
+
async function refreshCvmInstanceIds(client, request) {
|
|
6342
|
+
const parsed = RefreshCvmInstanceIdsRequestSchema.parse(request);
|
|
6343
|
+
const response = await client.patch("/cvms/instance-ids", parsed);
|
|
6344
|
+
return getSchemaForVersion7(client.config.version).parse(
|
|
6345
|
+
response
|
|
6346
|
+
);
|
|
6347
|
+
}
|
|
6348
|
+
async function safeRefreshCvmInstanceIds(client, request) {
|
|
6349
|
+
try {
|
|
6350
|
+
const data = await refreshCvmInstanceIds(client, request);
|
|
6351
|
+
return { success: true, data };
|
|
6352
|
+
} catch (error) {
|
|
6353
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6354
|
+
return { success: false, error };
|
|
6355
|
+
}
|
|
6356
|
+
return {
|
|
6357
|
+
success: false,
|
|
6358
|
+
error: {
|
|
6359
|
+
name: "Error",
|
|
6360
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6361
|
+
}
|
|
6362
|
+
};
|
|
6363
|
+
}
|
|
6364
|
+
}
|
|
5873
6365
|
|
|
5874
6366
|
// src/actions/cvms/get_cvm_status_batch.ts
|
|
5875
|
-
var
|
|
5876
|
-
var CvmStatusSchema =
|
|
5877
|
-
vm_uuid:
|
|
5878
|
-
status:
|
|
5879
|
-
uptime:
|
|
5880
|
-
in_progress:
|
|
5881
|
-
boot_progress:
|
|
5882
|
-
boot_error:
|
|
5883
|
-
operation_type:
|
|
5884
|
-
operation_started_at:
|
|
5885
|
-
correlation_id:
|
|
5886
|
-
});
|
|
5887
|
-
var GetCvmStatusBatchResponseSchema =
|
|
5888
|
-
var GetCvmStatusBatchRequestSchema =
|
|
5889
|
-
vmUuids:
|
|
6367
|
+
var import_zod66 = require("zod");
|
|
6368
|
+
var CvmStatusSchema = import_zod66.z.object({
|
|
6369
|
+
vm_uuid: import_zod66.z.string(),
|
|
6370
|
+
status: import_zod66.z.string(),
|
|
6371
|
+
uptime: import_zod66.z.string().nullable().optional(),
|
|
6372
|
+
in_progress: import_zod66.z.boolean(),
|
|
6373
|
+
boot_progress: import_zod66.z.string().nullable().optional(),
|
|
6374
|
+
boot_error: import_zod66.z.string().nullable().optional(),
|
|
6375
|
+
operation_type: import_zod66.z.string().nullable().optional(),
|
|
6376
|
+
operation_started_at: import_zod66.z.string().nullable().optional(),
|
|
6377
|
+
correlation_id: import_zod66.z.string().nullable().optional()
|
|
6378
|
+
});
|
|
6379
|
+
var GetCvmStatusBatchResponseSchema = import_zod66.z.record(import_zod66.z.string(), CvmStatusSchema);
|
|
6380
|
+
var GetCvmStatusBatchRequestSchema = import_zod66.z.object({
|
|
6381
|
+
vmUuids: import_zod66.z.array(import_zod66.z.string())
|
|
5890
6382
|
});
|
|
5891
6383
|
var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAction(GetCvmStatusBatchResponseSchema, async (client, request) => {
|
|
5892
6384
|
const { vmUuids } = GetCvmStatusBatchRequestSchema.parse(request);
|
|
@@ -5894,11 +6386,11 @@ var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAct
|
|
|
5894
6386
|
});
|
|
5895
6387
|
|
|
5896
6388
|
// src/actions/cvms/get_cvm_user_config.ts
|
|
5897
|
-
var
|
|
5898
|
-
var CvmUserConfigSchema =
|
|
5899
|
-
hostname:
|
|
5900
|
-
ssh_authorized_keys:
|
|
5901
|
-
default_gateway_domain:
|
|
6389
|
+
var import_zod67 = require("zod");
|
|
6390
|
+
var CvmUserConfigSchema = import_zod67.z.object({
|
|
6391
|
+
hostname: import_zod67.z.string().nullable().optional(),
|
|
6392
|
+
ssh_authorized_keys: import_zod67.z.array(import_zod67.z.string()).default([]),
|
|
6393
|
+
default_gateway_domain: import_zod67.z.string().nullable().optional()
|
|
5902
6394
|
});
|
|
5903
6395
|
var GetCvmUserConfigRequestSchema = CvmIdSchema;
|
|
5904
6396
|
var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineAction(CvmUserConfigSchema, async (client, request) => {
|
|
@@ -5907,38 +6399,70 @@ var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineActio
|
|
|
5907
6399
|
});
|
|
5908
6400
|
|
|
5909
6401
|
// src/actions/cvms/check_cvm_is_allowed.ts
|
|
5910
|
-
var
|
|
5911
|
-
var
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
6402
|
+
var import_zod68 = require("zod");
|
|
6403
|
+
var IsAllowedResultBaseSchema = import_zod68.z.object({
|
|
6404
|
+
app_contract_address: import_zod68.z.string(),
|
|
6405
|
+
compose_hash: import_zod68.z.string(),
|
|
6406
|
+
device_id: import_zod68.z.string(),
|
|
6407
|
+
compose_hash_allowed: import_zod68.z.boolean(),
|
|
6408
|
+
allow_any_device: import_zod68.z.boolean(),
|
|
6409
|
+
device_id_allowed: import_zod68.z.boolean().nullable().optional(),
|
|
6410
|
+
is_allowed: import_zod68.z.boolean(),
|
|
6411
|
+
error: import_zod68.z.string().nullable().optional()
|
|
6412
|
+
});
|
|
6413
|
+
var IsAllowedResultV20260121Schema = IsAllowedResultBaseSchema.extend({
|
|
6414
|
+
cvm_id: import_zod68.z.number().optional()
|
|
6415
|
+
});
|
|
6416
|
+
var IsAllowedResultV20260522Schema = IsAllowedResultBaseSchema.extend({
|
|
6417
|
+
cvm_id: import_zod68.z.string().optional()
|
|
6418
|
+
});
|
|
6419
|
+
var IsAllowedResultAnySchema = import_zod68.z.union([
|
|
6420
|
+
IsAllowedResultV20260121Schema,
|
|
6421
|
+
IsAllowedResultV20260522Schema
|
|
6422
|
+
]);
|
|
6423
|
+
var IsAllowedResultSchema = IsAllowedResultV20260522Schema;
|
|
6424
|
+
var CheckCvmIsAllowedInputSchema = import_zod68.z.object({
|
|
6425
|
+
cvmId: import_zod68.z.string().min(1),
|
|
6426
|
+
compose_hash: import_zod68.z.string().optional(),
|
|
6427
|
+
node_id: import_zod68.z.number().optional(),
|
|
6428
|
+
device_id: import_zod68.z.string().optional()
|
|
5927
6429
|
});
|
|
5928
6430
|
var CheckCvmIsAllowedRequestSchema = CheckCvmIsAllowedInputSchema;
|
|
5929
|
-
|
|
6431
|
+
function getSchemaForVersion8(version) {
|
|
6432
|
+
if (version === "2026-01-21") return IsAllowedResultV20260121Schema;
|
|
6433
|
+
return IsAllowedResultV20260522Schema;
|
|
6434
|
+
}
|
|
6435
|
+
async function checkCvmIsAllowed(client, request) {
|
|
5930
6436
|
const { cvmId, ...body } = CheckCvmIsAllowedRequestSchema.parse(request);
|
|
5931
|
-
|
|
5932
|
-
|
|
6437
|
+
const response = await client.post(`/cvms/${cvmId}/is-allowed`, body);
|
|
6438
|
+
return getSchemaForVersion8(client.config.version).parse(response);
|
|
6439
|
+
}
|
|
6440
|
+
async function safeCheckCvmIsAllowed(client, request) {
|
|
6441
|
+
try {
|
|
6442
|
+
const data = await checkCvmIsAllowed(client, request);
|
|
6443
|
+
return { success: true, data };
|
|
6444
|
+
} catch (error) {
|
|
6445
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6446
|
+
return { success: false, error };
|
|
6447
|
+
}
|
|
6448
|
+
return {
|
|
6449
|
+
success: false,
|
|
6450
|
+
error: {
|
|
6451
|
+
name: "Error",
|
|
6452
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6453
|
+
}
|
|
6454
|
+
};
|
|
6455
|
+
}
|
|
6456
|
+
}
|
|
5933
6457
|
|
|
5934
6458
|
// src/actions/apps/check_app_is_allowed.ts
|
|
5935
|
-
var
|
|
5936
|
-
var CheckAppIsAllowedRequestSchema =
|
|
5937
|
-
appId:
|
|
5938
|
-
compose_hash:
|
|
5939
|
-
node_id:
|
|
5940
|
-
device_id:
|
|
5941
|
-
chain_id:
|
|
6459
|
+
var import_zod69 = require("zod");
|
|
6460
|
+
var CheckAppIsAllowedRequestSchema = import_zod69.z.object({
|
|
6461
|
+
appId: import_zod69.z.string().min(1),
|
|
6462
|
+
compose_hash: import_zod69.z.string(),
|
|
6463
|
+
node_id: import_zod69.z.number().optional(),
|
|
6464
|
+
device_id: import_zod69.z.string().optional(),
|
|
6465
|
+
chain_id: import_zod69.z.number().optional()
|
|
5942
6466
|
});
|
|
5943
6467
|
var { action: checkAppIsAllowed, safeAction: safeCheckAppIsAllowed } = defineAction(IsAllowedResultSchema, async (client, request) => {
|
|
5944
6468
|
const { appId, ...body } = CheckAppIsAllowedRequestSchema.parse(request);
|
|
@@ -5946,46 +6470,83 @@ var { action: checkAppIsAllowed, safeAction: safeCheckAppIsAllowed } = defineAct
|
|
|
5946
6470
|
});
|
|
5947
6471
|
|
|
5948
6472
|
// src/actions/apps/check_app_cvms_is_allowed.ts
|
|
5949
|
-
var
|
|
5950
|
-
var
|
|
5951
|
-
is_onchain:
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
})
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
6473
|
+
var import_zod70 = require("zod");
|
|
6474
|
+
var AppCvmsBatchIsAllowedResponseBaseSchema = import_zod70.z.object({
|
|
6475
|
+
is_onchain: import_zod70.z.boolean(),
|
|
6476
|
+
total: import_zod70.z.number().default(0),
|
|
6477
|
+
allowed_count: import_zod70.z.number().default(0),
|
|
6478
|
+
denied_count: import_zod70.z.number().default(0),
|
|
6479
|
+
error_count: import_zod70.z.number().default(0)
|
|
6480
|
+
});
|
|
6481
|
+
var AppCvmsBatchIsAllowedResponseV20260121Schema = AppCvmsBatchIsAllowedResponseBaseSchema.extend({
|
|
6482
|
+
results: import_zod70.z.array(IsAllowedResultV20260121Schema.extend({ cvm_id: import_zod70.z.number() })).default([]),
|
|
6483
|
+
skipped_cvm_ids: import_zod70.z.array(import_zod70.z.number()).default([])
|
|
6484
|
+
});
|
|
6485
|
+
var AppCvmsBatchIsAllowedResponseV20260522Schema = AppCvmsBatchIsAllowedResponseBaseSchema.extend({
|
|
6486
|
+
results: import_zod70.z.array(IsAllowedResultV20260522Schema.extend({ cvm_id: import_zod70.z.string() })).default([]),
|
|
6487
|
+
skipped_cvm_ids: import_zod70.z.array(import_zod70.z.string()).default([])
|
|
6488
|
+
});
|
|
6489
|
+
var AppCvmsBatchIsAllowedResponseAnySchema = import_zod70.z.union([
|
|
6490
|
+
AppCvmsBatchIsAllowedResponseV20260121Schema,
|
|
6491
|
+
AppCvmsBatchIsAllowedResponseV20260522Schema
|
|
6492
|
+
]);
|
|
6493
|
+
var AppCvmsBatchIsAllowedResponseSchema = AppCvmsBatchIsAllowedResponseV20260522Schema;
|
|
6494
|
+
var CheckAppCvmsIsAllowedRequestSchema = import_zod70.z.object({
|
|
6495
|
+
appId: import_zod70.z.string().min(1)
|
|
5965
6496
|
});
|
|
6497
|
+
function getSchemaForVersion9(version) {
|
|
6498
|
+
if (version === "2026-01-21") return AppCvmsBatchIsAllowedResponseV20260121Schema;
|
|
6499
|
+
return AppCvmsBatchIsAllowedResponseV20260522Schema;
|
|
6500
|
+
}
|
|
6501
|
+
async function checkAppCvmsIsAllowed(client, request) {
|
|
6502
|
+
const { appId } = CheckAppCvmsIsAllowedRequestSchema.parse(request);
|
|
6503
|
+
const response = await client.post(`/apps/${appId}/cvms/is-allowed`, {});
|
|
6504
|
+
return getSchemaForVersion9(client.config.version).parse(
|
|
6505
|
+
response
|
|
6506
|
+
);
|
|
6507
|
+
}
|
|
6508
|
+
async function safeCheckAppCvmsIsAllowed(client, request) {
|
|
6509
|
+
try {
|
|
6510
|
+
const data = await checkAppCvmsIsAllowed(client, request);
|
|
6511
|
+
return { success: true, data };
|
|
6512
|
+
} catch (error) {
|
|
6513
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6514
|
+
return { success: false, error };
|
|
6515
|
+
}
|
|
6516
|
+
return {
|
|
6517
|
+
success: false,
|
|
6518
|
+
error: {
|
|
6519
|
+
name: "Error",
|
|
6520
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6521
|
+
}
|
|
6522
|
+
};
|
|
6523
|
+
}
|
|
6524
|
+
}
|
|
5966
6525
|
|
|
5967
6526
|
// src/actions/apps/get_app_list.ts
|
|
5968
|
-
var
|
|
5969
|
-
var GetAppListRequestSchema =
|
|
5970
|
-
page:
|
|
5971
|
-
page_size:
|
|
5972
|
-
search:
|
|
5973
|
-
status:
|
|
5974
|
-
listed:
|
|
5975
|
-
base_image:
|
|
5976
|
-
instance_type:
|
|
5977
|
-
kms_slug:
|
|
5978
|
-
kms_type:
|
|
5979
|
-
node:
|
|
5980
|
-
region:
|
|
6527
|
+
var import_zod71 = require("zod");
|
|
6528
|
+
var GetAppListRequestSchema = import_zod71.z.object({
|
|
6529
|
+
page: import_zod71.z.number().int().min(1).optional(),
|
|
6530
|
+
page_size: import_zod71.z.number().int().min(1).max(100).optional(),
|
|
6531
|
+
search: import_zod71.z.string().optional(),
|
|
6532
|
+
status: import_zod71.z.array(import_zod71.z.string()).optional(),
|
|
6533
|
+
listed: import_zod71.z.boolean().optional(),
|
|
6534
|
+
base_image: import_zod71.z.string().optional(),
|
|
6535
|
+
instance_type: import_zod71.z.string().optional(),
|
|
6536
|
+
kms_slug: import_zod71.z.string().optional(),
|
|
6537
|
+
kms_type: import_zod71.z.string().optional(),
|
|
6538
|
+
node: import_zod71.z.string().optional(),
|
|
6539
|
+
region: import_zod71.z.string().optional()
|
|
5981
6540
|
}).strict();
|
|
5982
|
-
function
|
|
5983
|
-
|
|
6541
|
+
function getSchemaForVersion10(version) {
|
|
6542
|
+
if (version === "2025-10-28") return DstackAppListResponseV20251028Schema;
|
|
6543
|
+
if (version === "2026-01-21") return DstackAppListResponseV20260121Schema;
|
|
6544
|
+
return DstackAppListResponseV20260522Schema;
|
|
5984
6545
|
}
|
|
5985
6546
|
async function getAppList(client, request) {
|
|
5986
6547
|
const validatedRequest = GetAppListRequestSchema.parse(request ?? {});
|
|
5987
6548
|
const response = await client.get("/apps", { params: validatedRequest });
|
|
5988
|
-
const schema =
|
|
6549
|
+
const schema = getSchemaForVersion10(client.config.version);
|
|
5989
6550
|
return schema.parse(response);
|
|
5990
6551
|
}
|
|
5991
6552
|
async function safeGetAppList(client, request) {
|
|
@@ -6007,17 +6568,19 @@ async function safeGetAppList(client, request) {
|
|
|
6007
6568
|
}
|
|
6008
6569
|
|
|
6009
6570
|
// src/actions/apps/get_app_info.ts
|
|
6010
|
-
var
|
|
6011
|
-
var GetAppInfoRequestSchema =
|
|
6012
|
-
appId:
|
|
6571
|
+
var import_zod72 = require("zod");
|
|
6572
|
+
var GetAppInfoRequestSchema = import_zod72.z.object({
|
|
6573
|
+
appId: import_zod72.z.string().min(1)
|
|
6013
6574
|
}).strict();
|
|
6014
|
-
function
|
|
6015
|
-
|
|
6575
|
+
function getSchemaForVersion11(version) {
|
|
6576
|
+
if (version === "2025-10-28") return DstackAppWithCvmResponseV20251028Schema;
|
|
6577
|
+
if (version === "2026-01-21") return DstackAppWithCvmResponseV20260121Schema;
|
|
6578
|
+
return DstackAppWithCvmResponseV20260522Schema;
|
|
6016
6579
|
}
|
|
6017
6580
|
async function getAppInfo(client, request) {
|
|
6018
6581
|
const { appId } = GetAppInfoRequestSchema.parse(request);
|
|
6019
6582
|
const response = await client.get(`/apps/${appId}`);
|
|
6020
|
-
const schema =
|
|
6583
|
+
const schema = getSchemaForVersion11(client.config.version);
|
|
6021
6584
|
return schema.parse(response);
|
|
6022
6585
|
}
|
|
6023
6586
|
async function safeGetAppInfo(client, request) {
|
|
@@ -6039,17 +6602,19 @@ async function safeGetAppInfo(client, request) {
|
|
|
6039
6602
|
}
|
|
6040
6603
|
|
|
6041
6604
|
// src/actions/apps/get_app_cvms.ts
|
|
6042
|
-
var
|
|
6043
|
-
var GetAppCvmsRequestSchema =
|
|
6044
|
-
appId:
|
|
6605
|
+
var import_zod73 = require("zod");
|
|
6606
|
+
var GetAppCvmsRequestSchema = import_zod73.z.object({
|
|
6607
|
+
appId: import_zod73.z.string().min(1)
|
|
6045
6608
|
}).strict();
|
|
6046
|
-
function
|
|
6047
|
-
|
|
6609
|
+
function getSchemaForVersion12(version) {
|
|
6610
|
+
if (version === "2025-10-28") return import_zod73.z.array(CvmInfoV20251028Schema);
|
|
6611
|
+
if (version === "2026-01-21") return import_zod73.z.array(CvmInfoV20260121Schema);
|
|
6612
|
+
return import_zod73.z.array(CvmInfoV20260522Schema);
|
|
6048
6613
|
}
|
|
6049
6614
|
async function getAppCvms(client, request) {
|
|
6050
6615
|
const { appId } = GetAppCvmsRequestSchema.parse(request);
|
|
6051
6616
|
const response = await client.get(`/apps/${appId}/cvms`);
|
|
6052
|
-
const schema =
|
|
6617
|
+
const schema = getSchemaForVersion12(client.config.version);
|
|
6053
6618
|
return schema.parse(response);
|
|
6054
6619
|
}
|
|
6055
6620
|
async function safeGetAppCvms(client, request) {
|
|
@@ -6071,16 +6636,17 @@ async function safeGetAppCvms(client, request) {
|
|
|
6071
6636
|
}
|
|
6072
6637
|
|
|
6073
6638
|
// src/actions/apps/create_app_instance.ts
|
|
6074
|
-
var
|
|
6075
|
-
var CreateAppInstanceRequestSchema =
|
|
6076
|
-
appId:
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6639
|
+
var import_zod74 = require("zod");
|
|
6640
|
+
var CreateAppInstanceRequestSchema = import_zod74.z.object({
|
|
6641
|
+
appId: import_zod74.z.string().min(1),
|
|
6642
|
+
name: import_zod74.z.string().optional(),
|
|
6643
|
+
node_id: import_zod74.z.number().optional(),
|
|
6644
|
+
docker_compose_file: import_zod74.z.string().optional(),
|
|
6645
|
+
pre_launch_script: import_zod74.z.string().optional(),
|
|
6646
|
+
encrypted_env: import_zod74.z.string().optional(),
|
|
6647
|
+
compose_hash: import_zod74.z.string().optional(),
|
|
6648
|
+
token: import_zod74.z.string().optional(),
|
|
6649
|
+
transaction_hash: import_zod74.z.string().optional()
|
|
6084
6650
|
}).strict();
|
|
6085
6651
|
var { action: createAppInstance, safeAction: safeCreateAppInstance } = defineAction(VMSchema, async (client, request) => {
|
|
6086
6652
|
const parsed = CreateAppInstanceRequestSchema.parse(request);
|
|
@@ -6089,28 +6655,52 @@ var { action: createAppInstance, safeAction: safeCreateAppInstance } = defineAct
|
|
|
6089
6655
|
});
|
|
6090
6656
|
|
|
6091
6657
|
// src/actions/apps/get_app_device_allowlist.ts
|
|
6092
|
-
var
|
|
6093
|
-
var
|
|
6094
|
-
device_id:
|
|
6095
|
-
node_name:
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6658
|
+
var import_zod75 = require("zod");
|
|
6659
|
+
var DeviceAllowlistItemBaseSchema = import_zod75.z.object({
|
|
6660
|
+
device_id: import_zod75.z.string(),
|
|
6661
|
+
node_name: import_zod75.z.string().nullable(),
|
|
6662
|
+
allowed_onchain: import_zod75.z.boolean(),
|
|
6663
|
+
status: import_zod75.z.string()
|
|
6664
|
+
});
|
|
6665
|
+
var DeviceAllowlistItemV20260121Schema = DeviceAllowlistItemBaseSchema.extend({
|
|
6666
|
+
cvm_ids: import_zod75.z.array(import_zod75.z.number())
|
|
6667
|
+
});
|
|
6668
|
+
var DeviceAllowlistItemV20260522Schema = DeviceAllowlistItemBaseSchema.extend({
|
|
6669
|
+
cvm_ids: import_zod75.z.array(import_zod75.z.string())
|
|
6670
|
+
});
|
|
6671
|
+
var DeviceAllowlistResponseBaseSchema = import_zod75.z.object({
|
|
6672
|
+
is_onchain_kms: import_zod75.z.boolean(),
|
|
6673
|
+
allow_any_device: import_zod75.z.boolean().nullable().optional(),
|
|
6674
|
+
chain_id: import_zod75.z.number().nullable().optional(),
|
|
6675
|
+
app_contract_address: import_zod75.z.string().nullable().optional()
|
|
6676
|
+
});
|
|
6677
|
+
var DeviceAllowlistResponseV20260121Schema = DeviceAllowlistResponseBaseSchema.extend({
|
|
6678
|
+
devices: import_zod75.z.array(DeviceAllowlistItemV20260121Schema).optional().default([])
|
|
6679
|
+
});
|
|
6680
|
+
var DeviceAllowlistResponseV20260522Schema = DeviceAllowlistResponseBaseSchema.extend({
|
|
6681
|
+
devices: import_zod75.z.array(DeviceAllowlistItemV20260522Schema).optional().default([])
|
|
6682
|
+
});
|
|
6683
|
+
var DeviceAllowlistItemAnySchema = import_zod75.z.union([
|
|
6684
|
+
DeviceAllowlistItemV20260121Schema,
|
|
6685
|
+
DeviceAllowlistItemV20260522Schema
|
|
6686
|
+
]);
|
|
6687
|
+
var DeviceAllowlistResponseAnySchema = import_zod75.z.union([
|
|
6688
|
+
DeviceAllowlistResponseV20260121Schema,
|
|
6689
|
+
DeviceAllowlistResponseV20260522Schema
|
|
6690
|
+
]);
|
|
6691
|
+
function getSchemaForVersion13(version) {
|
|
6692
|
+
if (version === "2026-01-21") return DeviceAllowlistResponseV20260121Schema;
|
|
6693
|
+
return DeviceAllowlistResponseV20260522Schema;
|
|
6694
|
+
}
|
|
6695
|
+
var GetAppDeviceAllowlistRequestSchema = import_zod75.z.object({
|
|
6696
|
+
appId: import_zod75.z.string().min(1)
|
|
6109
6697
|
}).strict();
|
|
6110
6698
|
async function getAppDeviceAllowlist(client, request) {
|
|
6111
6699
|
const { appId } = GetAppDeviceAllowlistRequestSchema.parse(request);
|
|
6112
6700
|
const response = await client.get(`/apps/${appId}/device-allowlist`);
|
|
6113
|
-
return
|
|
6701
|
+
return getSchemaForVersion13(client.config.version).parse(
|
|
6702
|
+
response
|
|
6703
|
+
);
|
|
6114
6704
|
}
|
|
6115
6705
|
async function safeGetAppDeviceAllowlist(client, request) {
|
|
6116
6706
|
try {
|
|
@@ -6131,11 +6721,11 @@ async function safeGetAppDeviceAllowlist(client, request) {
|
|
|
6131
6721
|
}
|
|
6132
6722
|
|
|
6133
6723
|
// src/actions/apps/get_app_revisions.ts
|
|
6134
|
-
var
|
|
6135
|
-
var GetAppRevisionsRequestSchema =
|
|
6136
|
-
appId:
|
|
6137
|
-
page:
|
|
6138
|
-
page_size:
|
|
6724
|
+
var import_zod76 = require("zod");
|
|
6725
|
+
var GetAppRevisionsRequestSchema = import_zod76.z.object({
|
|
6726
|
+
appId: import_zod76.z.string().min(1),
|
|
6727
|
+
page: import_zod76.z.number().int().min(1).optional(),
|
|
6728
|
+
page_size: import_zod76.z.number().int().min(1).max(1e3).optional()
|
|
6139
6729
|
}).strict();
|
|
6140
6730
|
async function getAppRevisions(client, request) {
|
|
6141
6731
|
const { appId, ...params } = GetAppRevisionsRequestSchema.parse(request);
|
|
@@ -6161,11 +6751,11 @@ async function safeGetAppRevisions(client, request) {
|
|
|
6161
6751
|
}
|
|
6162
6752
|
|
|
6163
6753
|
// src/actions/apps/get_app_revision_detail.ts
|
|
6164
|
-
var
|
|
6165
|
-
var GetAppRevisionDetailRequestSchema =
|
|
6166
|
-
appId:
|
|
6167
|
-
revisionId:
|
|
6168
|
-
rawComposeFile:
|
|
6754
|
+
var import_zod77 = require("zod");
|
|
6755
|
+
var GetAppRevisionDetailRequestSchema = import_zod77.z.object({
|
|
6756
|
+
appId: import_zod77.z.string().min(1),
|
|
6757
|
+
revisionId: import_zod77.z.string().min(1),
|
|
6758
|
+
rawComposeFile: import_zod77.z.boolean().optional()
|
|
6169
6759
|
}).strict();
|
|
6170
6760
|
async function getAppRevisionDetail(client, request) {
|
|
6171
6761
|
const { appId, revisionId, rawComposeFile } = GetAppRevisionDetailRequestSchema.parse(request);
|
|
@@ -6192,15 +6782,15 @@ async function safeGetAppRevisionDetail(client, request) {
|
|
|
6192
6782
|
}
|
|
6193
6783
|
|
|
6194
6784
|
// src/actions/apps/get_app_filter_options.ts
|
|
6195
|
-
var
|
|
6196
|
-
var AppFilterOptionsSchema =
|
|
6197
|
-
statuses:
|
|
6198
|
-
image_versions:
|
|
6199
|
-
instance_types:
|
|
6200
|
-
kms_slugs:
|
|
6201
|
-
kms_types:
|
|
6202
|
-
regions:
|
|
6203
|
-
nodes:
|
|
6785
|
+
var import_zod78 = require("zod");
|
|
6786
|
+
var AppFilterOptionsSchema = import_zod78.z.object({
|
|
6787
|
+
statuses: import_zod78.z.array(import_zod78.z.string()),
|
|
6788
|
+
image_versions: import_zod78.z.array(import_zod78.z.string()),
|
|
6789
|
+
instance_types: import_zod78.z.array(import_zod78.z.string()),
|
|
6790
|
+
kms_slugs: import_zod78.z.array(import_zod78.z.string()),
|
|
6791
|
+
kms_types: import_zod78.z.array(import_zod78.z.string()),
|
|
6792
|
+
regions: import_zod78.z.array(import_zod78.z.string()),
|
|
6793
|
+
nodes: import_zod78.z.array(import_zod78.z.string())
|
|
6204
6794
|
});
|
|
6205
6795
|
async function getAppFilterOptions(client) {
|
|
6206
6796
|
const response = await client.get("/apps/filter-options");
|
|
@@ -6225,47 +6815,52 @@ async function safeGetAppFilterOptions(client) {
|
|
|
6225
6815
|
}
|
|
6226
6816
|
|
|
6227
6817
|
// src/actions/apps/get_app_attestation.ts
|
|
6228
|
-
var
|
|
6229
|
-
var KmsInfoSchema2 =
|
|
6230
|
-
contract_address:
|
|
6231
|
-
chain_id:
|
|
6232
|
-
version:
|
|
6233
|
-
url:
|
|
6234
|
-
gateway_app_id:
|
|
6235
|
-
gateway_app_url:
|
|
6236
|
-
kms_type:
|
|
6237
|
-
});
|
|
6238
|
-
var GuestAgentInfoSchema =
|
|
6239
|
-
app_id:
|
|
6240
|
-
instance_id:
|
|
6241
|
-
app_name:
|
|
6242
|
-
device_id:
|
|
6818
|
+
var import_zod79 = require("zod");
|
|
6819
|
+
var KmsInfoSchema2 = import_zod79.z.object({
|
|
6820
|
+
contract_address: import_zod79.z.string(),
|
|
6821
|
+
chain_id: import_zod79.z.string().nullable(),
|
|
6822
|
+
version: import_zod79.z.string(),
|
|
6823
|
+
url: import_zod79.z.string(),
|
|
6824
|
+
gateway_app_id: import_zod79.z.string().nullable(),
|
|
6825
|
+
gateway_app_url: import_zod79.z.string(),
|
|
6826
|
+
kms_type: import_zod79.z.string()
|
|
6827
|
+
});
|
|
6828
|
+
var GuestAgentInfoSchema = import_zod79.z.object({
|
|
6829
|
+
app_id: import_zod79.z.string().optional(),
|
|
6830
|
+
instance_id: import_zod79.z.string().optional(),
|
|
6831
|
+
app_name: import_zod79.z.string().optional(),
|
|
6832
|
+
device_id: import_zod79.z.string().optional()
|
|
6243
6833
|
}).passthrough().nullable();
|
|
6244
|
-
var AppAttestationInstanceSchema =
|
|
6245
|
-
vm_uuid:
|
|
6246
|
-
name:
|
|
6247
|
-
instance_id:
|
|
6248
|
-
status:
|
|
6249
|
-
image_version:
|
|
6250
|
-
quote:
|
|
6251
|
-
ppid:
|
|
6252
|
-
|
|
6834
|
+
var AppAttestationInstanceSchema = import_zod79.z.object({
|
|
6835
|
+
vm_uuid: import_zod79.z.string().nullable().optional(),
|
|
6836
|
+
name: import_zod79.z.string().optional(),
|
|
6837
|
+
instance_id: import_zod79.z.string().nullable().optional(),
|
|
6838
|
+
status: import_zod79.z.string().optional(),
|
|
6839
|
+
image_version: import_zod79.z.string().nullable().optional(),
|
|
6840
|
+
quote: import_zod79.z.string().nullable().optional(),
|
|
6841
|
+
ppid: import_zod79.z.string().optional(),
|
|
6842
|
+
ppid_sha256: import_zod79.z.string().nullable().optional(),
|
|
6843
|
+
device_id: import_zod79.z.string().optional(),
|
|
6844
|
+
fmspc: import_zod79.z.string().nullable().optional(),
|
|
6845
|
+
tee_tcb_svn: import_zod79.z.string().nullable().optional(),
|
|
6846
|
+
cpusvn: import_zod79.z.string().nullable().optional(),
|
|
6847
|
+
pcesvn: import_zod79.z.number().nullable().optional(),
|
|
6253
6848
|
tcb_info: TcbInfoSchema.nullable().optional(),
|
|
6254
|
-
app_certificates:
|
|
6255
|
-
compose_file:
|
|
6256
|
-
error:
|
|
6849
|
+
app_certificates: import_zod79.z.array(CertificateSchema).nullable().optional(),
|
|
6850
|
+
compose_file: import_zod79.z.string().nullable().optional(),
|
|
6851
|
+
error: import_zod79.z.string().nullable().optional()
|
|
6257
6852
|
});
|
|
6258
|
-
var AppAttestationResponseSchema =
|
|
6259
|
-
app_id:
|
|
6260
|
-
contract_address:
|
|
6853
|
+
var AppAttestationResponseSchema = import_zod79.z.object({
|
|
6854
|
+
app_id: import_zod79.z.string(),
|
|
6855
|
+
contract_address: import_zod79.z.string(),
|
|
6261
6856
|
kms_info: KmsInfoSchema2,
|
|
6262
|
-
instances:
|
|
6857
|
+
instances: import_zod79.z.array(AppAttestationInstanceSchema),
|
|
6263
6858
|
kms_guest_agent_info: GuestAgentInfoSchema,
|
|
6264
6859
|
gateway_guest_agent_info: GuestAgentInfoSchema,
|
|
6265
|
-
qemu_version:
|
|
6860
|
+
qemu_version: import_zod79.z.string().nullable()
|
|
6266
6861
|
});
|
|
6267
|
-
var GetAppAttestationRequestSchema =
|
|
6268
|
-
appId:
|
|
6862
|
+
var GetAppAttestationRequestSchema = import_zod79.z.object({
|
|
6863
|
+
appId: import_zod79.z.string().min(1)
|
|
6269
6864
|
}).strict();
|
|
6270
6865
|
var { action: getAppAttestation, safeAction: safeGetAppAttestation } = defineAction(AppAttestationResponseSchema, async (client, request) => {
|
|
6271
6866
|
const { appId } = GetAppAttestationRequestSchema.parse(request);
|
|
@@ -6347,15 +6942,28 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6347
6942
|
CvmAttestationSchema,
|
|
6348
6943
|
CvmBasicInfoV20251028Schema,
|
|
6349
6944
|
CvmContainersStatsSchema,
|
|
6945
|
+
CvmCreateGatewayResourceSchema,
|
|
6946
|
+
CvmCreateGatewayResourceV20260121Schema,
|
|
6947
|
+
CvmCreateInstanceTypeResourceSchema,
|
|
6948
|
+
CvmCreateKmsResourceSchema,
|
|
6949
|
+
CvmCreateKmsResourceV20260121Schema,
|
|
6950
|
+
CvmCreateNodeKmsRelationSchema,
|
|
6951
|
+
CvmCreateNodeKmsRelationV20260121Schema,
|
|
6952
|
+
CvmCreateResourceGraphSchema,
|
|
6953
|
+
CvmCreateResourceGraphV20260121Schema,
|
|
6954
|
+
CvmCreateResourceGraphV20260522Schema,
|
|
6350
6955
|
CvmDetailV20251028Schema,
|
|
6351
6956
|
CvmGatewayInfoV20260121Schema,
|
|
6352
6957
|
CvmIdBaseSchema,
|
|
6353
6958
|
CvmIdObjectSchema,
|
|
6354
6959
|
CvmIdSchema,
|
|
6355
6960
|
CvmInfoDetailV20260121Schema,
|
|
6961
|
+
CvmInfoDetailV20260522Schema,
|
|
6356
6962
|
CvmInfoV20251028Schema,
|
|
6357
6963
|
CvmInfoV20260121Schema,
|
|
6964
|
+
CvmInfoV20260522Schema,
|
|
6358
6965
|
CvmKmsInfoV20260121Schema,
|
|
6966
|
+
CvmLogUrlsV20260121Schema,
|
|
6359
6967
|
CvmNetworkSchema,
|
|
6360
6968
|
CvmNetworkUrlsV20251028Schema,
|
|
6361
6969
|
CvmNodeInfoV20260121Schema,
|
|
@@ -6374,12 +6982,13 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6374
6982
|
DeployAppAuthSchema,
|
|
6375
6983
|
DstackAppFullResponseV20251028Schema,
|
|
6376
6984
|
DstackAppFullResponseV20260121Schema,
|
|
6985
|
+
DstackAppFullResponseV20260522Schema,
|
|
6377
6986
|
DstackAppListResponseV20251028Schema,
|
|
6378
6987
|
DstackAppListResponseV20260121Schema,
|
|
6379
|
-
|
|
6380
|
-
DstackAppMinimalResponseV20260121Schema,
|
|
6988
|
+
DstackAppListResponseV20260522Schema,
|
|
6381
6989
|
DstackAppWithCvmResponseV20251028Schema,
|
|
6382
6990
|
DstackAppWithCvmResponseV20260121Schema,
|
|
6991
|
+
DstackAppWithCvmResponseV20260522Schema,
|
|
6383
6992
|
ErrorCodes,
|
|
6384
6993
|
EventLogSchema,
|
|
6385
6994
|
FamilyGroupSchema,
|
|
@@ -6416,8 +7025,10 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6416
7025
|
GetKmsOnChainDetailResponseSchema,
|
|
6417
7026
|
GetOsImagesRequestSchema,
|
|
6418
7027
|
GetOsImagesResponseSchema,
|
|
7028
|
+
GetPreLaunchScriptUpgradeStatusRequestSchema,
|
|
6419
7029
|
GetWorkspaceNodesSchema,
|
|
6420
7030
|
GetWorkspaceQuotasSchema,
|
|
7031
|
+
GpuAvailabilitySchema,
|
|
6421
7032
|
ImportGithubProfileRequestSchema,
|
|
6422
7033
|
ImportGithubProfileResponseSchema,
|
|
6423
7034
|
InstanceIdRefreshResultSchema,
|
|
@@ -6445,10 +7056,12 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6445
7056
|
OnChainOsImageSchema,
|
|
6446
7057
|
PaginatedCvmInfosV20251028Schema,
|
|
6447
7058
|
PaginatedCvmInfosV20260121Schema,
|
|
7059
|
+
PaginatedCvmInfosV20260522Schema,
|
|
6448
7060
|
PaginationMetadataSchema,
|
|
6449
7061
|
PatchCvmRequestSchema,
|
|
6450
7062
|
PatchCvmResultSchema,
|
|
6451
7063
|
PhalaCloudError,
|
|
7064
|
+
PreLaunchScriptUpgradeStatusSchema,
|
|
6452
7065
|
ProvisionCvmComposeFileUpdateRequestSchema,
|
|
6453
7066
|
ProvisionCvmComposeFileUpdateResultSchema,
|
|
6454
7067
|
ProvisionCvmRequestSchema,
|
|
@@ -6483,9 +7096,14 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6483
7096
|
UpdateOsImageRequestSchema,
|
|
6484
7097
|
UpdatePreLaunchScriptRequestSchema,
|
|
6485
7098
|
UpdatePreLaunchScriptResultSchema,
|
|
7099
|
+
UpgradePreLaunchScriptRequestSchema,
|
|
7100
|
+
UpgradePreLaunchScriptResultSchema,
|
|
6486
7101
|
UserInfoSchema,
|
|
6487
7102
|
UserRefSchema,
|
|
7103
|
+
VMAnySchema,
|
|
6488
7104
|
VMSchema,
|
|
7105
|
+
VMV20260121Schema,
|
|
7106
|
+
VMV20260522Schema,
|
|
6489
7107
|
ValidationError,
|
|
6490
7108
|
VmInfoV20251028Schema,
|
|
6491
7109
|
WalletError,
|
|
@@ -6557,6 +7175,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6557
7175
|
getCvmAttestation,
|
|
6558
7176
|
getCvmComposeFile,
|
|
6559
7177
|
getCvmContainersStats,
|
|
7178
|
+
getCvmCreateResources,
|
|
6560
7179
|
getCvmDockerCompose,
|
|
6561
7180
|
getCvmInfo,
|
|
6562
7181
|
getCvmList,
|
|
@@ -6571,6 +7190,8 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6571
7190
|
getKmsList,
|
|
6572
7191
|
getKmsOnChainDetail,
|
|
6573
7192
|
getOsImages,
|
|
7193
|
+
getPreLaunchScriptUpgradeStatus,
|
|
7194
|
+
getVMSchemaForVersion,
|
|
6574
7195
|
getValidationFields,
|
|
6575
7196
|
getWorkspace,
|
|
6576
7197
|
getWorkspaceNodes,
|
|
@@ -6630,6 +7251,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6630
7251
|
safeGetCvmAttestation,
|
|
6631
7252
|
safeGetCvmComposeFile,
|
|
6632
7253
|
safeGetCvmContainersStats,
|
|
7254
|
+
safeGetCvmCreateResources,
|
|
6633
7255
|
safeGetCvmDockerCompose,
|
|
6634
7256
|
safeGetCvmInfo,
|
|
6635
7257
|
safeGetCvmList,
|
|
@@ -6643,6 +7265,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6643
7265
|
safeGetKmsList,
|
|
6644
7266
|
safeGetKmsOnChainDetail,
|
|
6645
7267
|
safeGetOsImages,
|
|
7268
|
+
safeGetPreLaunchScriptUpgradeStatus,
|
|
6646
7269
|
safeGetWorkspace,
|
|
6647
7270
|
safeGetWorkspaceNodes,
|
|
6648
7271
|
safeGetWorkspaceQuotas,
|
|
@@ -6671,6 +7294,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6671
7294
|
safeUpdateDockerCompose,
|
|
6672
7295
|
safeUpdateOsImage,
|
|
6673
7296
|
safeUpdatePreLaunchScript,
|
|
7297
|
+
safeUpgradePreLaunchScript,
|
|
6674
7298
|
safeValidateActionParameters,
|
|
6675
7299
|
setAllowAnyDevice,
|
|
6676
7300
|
shutdownCvm,
|
|
@@ -6685,6 +7309,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6685
7309
|
updateDockerCompose,
|
|
6686
7310
|
updateOsImage,
|
|
6687
7311
|
updatePreLaunchScript,
|
|
7312
|
+
upgradePreLaunchScript,
|
|
6688
7313
|
validateActionParameters,
|
|
6689
7314
|
validateComposePayloadSize,
|
|
6690
7315
|
validateNetworkPrerequisites,
|