@phala/cloud 0.2.1-beta.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/actions/apps/get_app_cvms.d.ts +30 -0
- package/dist/actions/apps/get_app_info.d.ts +30 -0
- package/dist/actions/apps/get_app_list.d.ts +74 -0
- package/dist/actions/apps/get_app_revision_detail.d.ts +48 -0
- package/dist/actions/apps/get_app_revisions.d.ts +42 -0
- package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +7 -7
- package/dist/actions/cvms/commit_cvm_provision.d.ts +31 -31
- package/dist/actions/cvms/delete_cvm.d.ts +10 -7
- package/dist/actions/cvms/get_available_os_images.d.ts +10 -7
- package/dist/actions/cvms/get_cvm_attestation.d.ts +10 -7
- package/dist/actions/cvms/get_cvm_compose_file.d.ts +18 -15
- package/dist/actions/cvms/get_cvm_containers_stats.d.ts +14 -11
- package/dist/actions/cvms/get_cvm_docker_compose.d.ts +10 -7
- package/dist/actions/cvms/get_cvm_info.d.ts +19 -35
- package/dist/actions/cvms/get_cvm_list.d.ts +11 -537
- package/dist/actions/cvms/get_cvm_network.d.ts +10 -7
- package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +42 -0
- package/dist/actions/cvms/get_cvm_state.d.ts +10 -7
- package/dist/actions/cvms/get_cvm_stats.d.ts +10 -7
- package/dist/actions/cvms/get_cvm_status_batch.d.ts +167 -0
- package/dist/actions/cvms/provision_cvm.d.ts +404 -21
- package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +32 -32
- package/dist/actions/cvms/restart_cvm.d.ts +17 -14
- package/dist/actions/cvms/shutdown_cvm.d.ts +18 -15
- package/dist/actions/cvms/start_cvm.d.ts +18 -15
- package/dist/actions/cvms/stop_cvm.d.ts +18 -15
- package/dist/actions/cvms/update_cvm_envs.d.ts +32 -118
- package/dist/actions/cvms/update_cvm_resources.d.ts +13 -10
- package/dist/actions/cvms/update_cvm_visibility.d.ts +33 -14
- package/dist/actions/cvms/update_docker_compose.d.ts +420 -0
- package/dist/actions/cvms/update_os_image.d.ts +9 -6
- package/dist/actions/cvms/update_prelaunch_script.d.ts +417 -0
- package/dist/actions/cvms/watch_cvm_state.d.ts +1 -1
- package/dist/actions/get_available_nodes.d.ts +6 -6
- package/dist/actions/get_current_user.d.ts +36 -89
- package/dist/actions/index.d.ts +13 -2
- package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +6 -6
- package/dist/actions/kms/get_kms_info.d.ts +6 -6
- package/dist/actions/kms/get_kms_list.d.ts +6 -6
- package/dist/actions/kms/next_app_ids.d.ts +6 -6
- package/dist/actions/list-instance-types.d.ts +16 -16
- package/dist/actions/workspaces/get_workspace.d.ts +6 -6
- package/dist/actions/workspaces/get_workspace_nodes.d.ts +266 -0
- package/dist/actions/workspaces/get_workspace_quotas.d.ts +1169 -0
- package/dist/actions/workspaces/list_workspaces.d.ts +6 -6
- package/dist/client.d.ts +49 -9
- package/dist/create-client.d.ts +72 -36
- package/dist/credentials/current_user_v20251028.d.ts +30 -0
- package/dist/credentials/current_user_v20260121.d.ts +276 -0
- package/dist/credentials/index.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1714 -664
- package/dist/index.mjs +1629 -657
- package/dist/types/app_info_v20251028.d.ts +1266 -0
- package/dist/types/app_info_v20260121.d.ts +3293 -0
- package/dist/types/app_revision.d.ts +453 -0
- package/dist/types/client.d.ts +40 -2
- package/dist/types/cvm_id.d.ts +29 -11
- package/dist/types/cvm_info.d.ts +16 -502
- package/dist/types/cvm_info_v20251028.d.ts +988 -0
- package/dist/types/cvm_info_v20260121.d.ts +1264 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/version-mappings.d.ts +38 -0
- package/dist/utils/define-action.d.ts +15 -14
- package/dist/utils/errors.d.ts +2 -2
- package/dist/utils/hostname.d.ts +77 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -41,18 +41,21 @@ export declare const GetCvmStateRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
41
41
|
uuid: z.ZodOptional<z.ZodString>;
|
|
42
42
|
app_id: z.ZodOptional<z.ZodString>;
|
|
43
43
|
instance_id: z.ZodOptional<z.ZodString>;
|
|
44
|
+
name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
44
45
|
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
name?: string | undefined;
|
|
45
47
|
id?: string | undefined;
|
|
46
48
|
app_id?: string | undefined;
|
|
47
49
|
instance_id?: string | undefined;
|
|
48
50
|
uuid?: string | undefined;
|
|
49
51
|
}, {
|
|
52
|
+
name?: string | undefined;
|
|
50
53
|
id?: string | undefined;
|
|
51
54
|
app_id?: string | undefined;
|
|
52
55
|
instance_id?: string | undefined;
|
|
53
56
|
uuid?: string | undefined;
|
|
54
57
|
}>, any, any>, {
|
|
55
|
-
cvmId:
|
|
58
|
+
cvmId: any;
|
|
56
59
|
}, any>;
|
|
57
60
|
export type GetCvmStateRequest = CvmIdInput;
|
|
58
61
|
/**
|
|
@@ -74,7 +77,7 @@ export type GetCvmStateRequest = CvmIdInput;
|
|
|
74
77
|
* ```
|
|
75
78
|
*/
|
|
76
79
|
declare const getCvmState: {
|
|
77
|
-
(client: Client
|
|
80
|
+
(client: Client<import("../..").ApiVersion>, params: CvmIdInput): Promise<{
|
|
78
81
|
status: string;
|
|
79
82
|
name: string;
|
|
80
83
|
id?: string | undefined;
|
|
@@ -85,14 +88,14 @@ declare const getCvmState: {
|
|
|
85
88
|
boot_error?: string | undefined;
|
|
86
89
|
shutdown_progress?: string | undefined;
|
|
87
90
|
}>;
|
|
88
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
91
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
89
92
|
schema: T;
|
|
90
93
|
}): Promise<z.TypeOf<T>>;
|
|
91
|
-
(client: Client
|
|
94
|
+
(client: Client<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
92
95
|
schema: false;
|
|
93
96
|
}): Promise<unknown>;
|
|
94
97
|
}, safeGetCvmState: {
|
|
95
|
-
(client: Client
|
|
98
|
+
(client: Client<import("../..").ApiVersion>, params: CvmIdInput): Promise<import("../..").SafeResult<{
|
|
96
99
|
status: string;
|
|
97
100
|
name: string;
|
|
98
101
|
id?: string | undefined;
|
|
@@ -103,10 +106,10 @@ declare const getCvmState: {
|
|
|
103
106
|
boot_error?: string | undefined;
|
|
104
107
|
shutdown_progress?: string | undefined;
|
|
105
108
|
}>>;
|
|
106
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
109
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
107
110
|
schema: T;
|
|
108
111
|
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
109
|
-
(client: Client
|
|
112
|
+
(client: Client<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
110
113
|
schema: false;
|
|
111
114
|
}): Promise<import("../..").SafeResult<unknown>>;
|
|
112
115
|
};
|
|
@@ -159,22 +159,25 @@ export declare const GetCvmStatsRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
159
159
|
uuid: z.ZodOptional<z.ZodString>;
|
|
160
160
|
app_id: z.ZodOptional<z.ZodString>;
|
|
161
161
|
instance_id: z.ZodOptional<z.ZodString>;
|
|
162
|
+
name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
162
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
name?: string | undefined;
|
|
163
165
|
id?: string | undefined;
|
|
164
166
|
app_id?: string | undefined;
|
|
165
167
|
instance_id?: string | undefined;
|
|
166
168
|
uuid?: string | undefined;
|
|
167
169
|
}, {
|
|
170
|
+
name?: string | undefined;
|
|
168
171
|
id?: string | undefined;
|
|
169
172
|
app_id?: string | undefined;
|
|
170
173
|
instance_id?: string | undefined;
|
|
171
174
|
uuid?: string | undefined;
|
|
172
175
|
}>, any, any>, {
|
|
173
|
-
cvmId:
|
|
176
|
+
cvmId: any;
|
|
174
177
|
}, any>;
|
|
175
178
|
export type GetCvmStatsRequest = CvmIdInput;
|
|
176
179
|
declare const getCvmStats: {
|
|
177
|
-
(client: import("../..").BaseClient
|
|
180
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput): Promise<{
|
|
178
181
|
status: string | null;
|
|
179
182
|
error: string | null;
|
|
180
183
|
boot_progress: string | null;
|
|
@@ -207,14 +210,14 @@ declare const getCvmStats: {
|
|
|
207
210
|
}[];
|
|
208
211
|
} | null;
|
|
209
212
|
}>;
|
|
210
|
-
<T extends z.ZodTypeAny>(client: import("../..").BaseClient
|
|
213
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
211
214
|
schema: T;
|
|
212
215
|
}): Promise<z.TypeOf<T>>;
|
|
213
|
-
(client: import("../..").BaseClient
|
|
216
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
214
217
|
schema: false;
|
|
215
218
|
}): Promise<unknown>;
|
|
216
219
|
}, safeGetCvmStats: {
|
|
217
|
-
(client: import("../..").BaseClient
|
|
220
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput): Promise<import("../..").SafeResult<{
|
|
218
221
|
status: string | null;
|
|
219
222
|
error: string | null;
|
|
220
223
|
boot_progress: string | null;
|
|
@@ -247,10 +250,10 @@ declare const getCvmStats: {
|
|
|
247
250
|
}[];
|
|
248
251
|
} | null;
|
|
249
252
|
}>>;
|
|
250
|
-
<T extends z.ZodTypeAny>(client: import("../..").BaseClient
|
|
253
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
251
254
|
schema: T;
|
|
252
255
|
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
253
|
-
(client: import("../..").BaseClient
|
|
256
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
254
257
|
schema: false;
|
|
255
258
|
}): Promise<import("../..").SafeResult<unknown>>;
|
|
256
259
|
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* CVM status schema for batch status API
|
|
4
|
+
*
|
|
5
|
+
* This is different from CvmStateSchema which is used for /cvms/{id}/state endpoint.
|
|
6
|
+
* CvmStatusSchema is used for /status/batch endpoint which returns status
|
|
7
|
+
* information optimized for polling.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CvmStatusSchema: z.ZodObject<{
|
|
10
|
+
vm_uuid: z.ZodString;
|
|
11
|
+
status: z.ZodString;
|
|
12
|
+
uptime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
in_progress: z.ZodBoolean;
|
|
14
|
+
boot_progress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
boot_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
operation_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
operation_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
correlation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
status: string;
|
|
21
|
+
in_progress: boolean;
|
|
22
|
+
vm_uuid: string;
|
|
23
|
+
uptime?: string | null | undefined;
|
|
24
|
+
boot_progress?: string | null | undefined;
|
|
25
|
+
boot_error?: string | null | undefined;
|
|
26
|
+
correlation_id?: string | null | undefined;
|
|
27
|
+
operation_type?: string | null | undefined;
|
|
28
|
+
operation_started_at?: string | null | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
status: string;
|
|
31
|
+
in_progress: boolean;
|
|
32
|
+
vm_uuid: string;
|
|
33
|
+
uptime?: string | null | undefined;
|
|
34
|
+
boot_progress?: string | null | undefined;
|
|
35
|
+
boot_error?: string | null | undefined;
|
|
36
|
+
correlation_id?: string | null | undefined;
|
|
37
|
+
operation_type?: string | null | undefined;
|
|
38
|
+
operation_started_at?: string | null | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
export type CvmStatus = z.infer<typeof CvmStatusSchema>;
|
|
41
|
+
/**
|
|
42
|
+
* Batch status response: Record<vm_uuid, CvmStatus>
|
|
43
|
+
*/
|
|
44
|
+
export declare const GetCvmStatusBatchResponseSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
45
|
+
vm_uuid: z.ZodString;
|
|
46
|
+
status: z.ZodString;
|
|
47
|
+
uptime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
in_progress: z.ZodBoolean;
|
|
49
|
+
boot_progress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
boot_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
operation_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
operation_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
correlation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
status: string;
|
|
56
|
+
in_progress: boolean;
|
|
57
|
+
vm_uuid: string;
|
|
58
|
+
uptime?: string | null | undefined;
|
|
59
|
+
boot_progress?: string | null | undefined;
|
|
60
|
+
boot_error?: string | null | undefined;
|
|
61
|
+
correlation_id?: string | null | undefined;
|
|
62
|
+
operation_type?: string | null | undefined;
|
|
63
|
+
operation_started_at?: string | null | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
status: string;
|
|
66
|
+
in_progress: boolean;
|
|
67
|
+
vm_uuid: string;
|
|
68
|
+
uptime?: string | null | undefined;
|
|
69
|
+
boot_progress?: string | null | undefined;
|
|
70
|
+
boot_error?: string | null | undefined;
|
|
71
|
+
correlation_id?: string | null | undefined;
|
|
72
|
+
operation_type?: string | null | undefined;
|
|
73
|
+
operation_started_at?: string | null | undefined;
|
|
74
|
+
}>>;
|
|
75
|
+
export type GetCvmStatusBatchResponse = z.infer<typeof GetCvmStatusBatchResponseSchema>;
|
|
76
|
+
export declare const GetCvmStatusBatchRequestSchema: z.ZodObject<{
|
|
77
|
+
vmUuids: z.ZodArray<z.ZodString, "many">;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
vmUuids: string[];
|
|
80
|
+
}, {
|
|
81
|
+
vmUuids: string[];
|
|
82
|
+
}>;
|
|
83
|
+
export type GetCvmStatusBatchRequest = z.infer<typeof GetCvmStatusBatchRequestSchema>;
|
|
84
|
+
/**
|
|
85
|
+
* Get batch CVM status for multiple CVMs
|
|
86
|
+
*
|
|
87
|
+
* This action retrieves status information for multiple CVMs in a single request.
|
|
88
|
+
* Optimized for polling scenarios where you need to monitor multiple CVMs.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* import { createClient, getCvmStatusBatch } from '@phala/cloud'
|
|
93
|
+
*
|
|
94
|
+
* const client = createClient();
|
|
95
|
+
* const statuses = await getCvmStatusBatch(client, {
|
|
96
|
+
* vmUuids: ['uuid-1', 'uuid-2', 'uuid-3']
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* // Check status of each CVM
|
|
100
|
+
* for (const [vmUuid, status] of Object.entries(statuses)) {
|
|
101
|
+
* console.log(`${vmUuid}: ${status.status}, in_progress: ${status.in_progress}`);
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* ## Safe Version
|
|
106
|
+
*
|
|
107
|
+
* Use `safeGetCvmStatusBatch` for error handling without exceptions:
|
|
108
|
+
*
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const result = await safeGetCvmStatusBatch(client, { vmUuids: ['uuid-1'] });
|
|
111
|
+
* if (result.success) {
|
|
112
|
+
* console.log('Statuses:', result.data);
|
|
113
|
+
* } else {
|
|
114
|
+
* console.error('Failed:', result.error.message);
|
|
115
|
+
* }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
declare const getCvmStatusBatch: {
|
|
119
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
120
|
+
vmUuids: string[];
|
|
121
|
+
}): Promise<Record<string, {
|
|
122
|
+
status: string;
|
|
123
|
+
in_progress: boolean;
|
|
124
|
+
vm_uuid: string;
|
|
125
|
+
uptime?: string | null | undefined;
|
|
126
|
+
boot_progress?: string | null | undefined;
|
|
127
|
+
boot_error?: string | null | undefined;
|
|
128
|
+
correlation_id?: string | null | undefined;
|
|
129
|
+
operation_type?: string | null | undefined;
|
|
130
|
+
operation_started_at?: string | null | undefined;
|
|
131
|
+
}>>;
|
|
132
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
133
|
+
vmUuids: string[];
|
|
134
|
+
}, parameters: {
|
|
135
|
+
schema: T;
|
|
136
|
+
}): Promise<z.TypeOf<T>>;
|
|
137
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
138
|
+
vmUuids: string[];
|
|
139
|
+
}, parameters: {
|
|
140
|
+
schema: false;
|
|
141
|
+
}): Promise<unknown>;
|
|
142
|
+
}, safeGetCvmStatusBatch: {
|
|
143
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
144
|
+
vmUuids: string[];
|
|
145
|
+
}): Promise<import("../..").SafeResult<Record<string, {
|
|
146
|
+
status: string;
|
|
147
|
+
in_progress: boolean;
|
|
148
|
+
vm_uuid: string;
|
|
149
|
+
uptime?: string | null | undefined;
|
|
150
|
+
boot_progress?: string | null | undefined;
|
|
151
|
+
boot_error?: string | null | undefined;
|
|
152
|
+
correlation_id?: string | null | undefined;
|
|
153
|
+
operation_type?: string | null | undefined;
|
|
154
|
+
operation_started_at?: string | null | undefined;
|
|
155
|
+
}>>>;
|
|
156
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
157
|
+
vmUuids: string[];
|
|
158
|
+
}, parameters: {
|
|
159
|
+
schema: T;
|
|
160
|
+
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
161
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
162
|
+
vmUuids: string[];
|
|
163
|
+
}, parameters: {
|
|
164
|
+
schema: false;
|
|
165
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
166
|
+
};
|
|
167
|
+
export { getCvmStatusBatch, safeGetCvmStatusBatch };
|