@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
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type Client } from "../../client";
|
|
3
|
+
/**
|
|
4
|
+
* Update CVM Docker Compose file
|
|
5
|
+
*
|
|
6
|
+
* Updates the Docker Compose configuration for a CVM. Supports two scenarios:
|
|
7
|
+
* 1. Legacy/offchain KMS: Direct update without compose hash verification
|
|
8
|
+
* 2. Contract-owned KMS (ETHEREUM/BASE): Requires compose hash verification (two-phase)
|
|
9
|
+
*
|
|
10
|
+
* When using contract-owned KMS and compose_hash/transaction_hash are not provided,
|
|
11
|
+
* the API returns HTTP 465 with the compose hash to sign.
|
|
12
|
+
* The client should then register the compose hash on-chain and retry the request
|
|
13
|
+
* with both compose_hash and transaction_hash.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { createClient, updateDockerCompose } from '@phala/cloud'
|
|
18
|
+
*
|
|
19
|
+
* const client = createClient({ apiKey: 'your-api-key' })
|
|
20
|
+
*
|
|
21
|
+
* const composeYaml = `
|
|
22
|
+
* version: '3'
|
|
23
|
+
* services:
|
|
24
|
+
* web:
|
|
25
|
+
* image: nginx:latest
|
|
26
|
+
* ports:
|
|
27
|
+
* - "80:80"
|
|
28
|
+
* `
|
|
29
|
+
*
|
|
30
|
+
* // Phase 1: Initial update (may return precondition_required for contract-owned KMS)
|
|
31
|
+
* const result = await updateDockerCompose(client, {
|
|
32
|
+
* id: 'cvm-123',
|
|
33
|
+
* docker_compose_file: composeYaml
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* if (result.status === 'precondition_required') {
|
|
37
|
+
* // Register compose hash on-chain and get transaction hash
|
|
38
|
+
* const txHash = await registerComposeHashOnChain(
|
|
39
|
+
* result.compose_hash,
|
|
40
|
+
* result.kms_info
|
|
41
|
+
* )
|
|
42
|
+
*
|
|
43
|
+
* // Phase 2: Retry with compose hash and transaction hash
|
|
44
|
+
* const finalResult = await updateDockerCompose(client, {
|
|
45
|
+
* id: 'cvm-123',
|
|
46
|
+
* docker_compose_file: composeYaml,
|
|
47
|
+
* compose_hash: result.compose_hash,
|
|
48
|
+
* transaction_hash: txHash
|
|
49
|
+
* })
|
|
50
|
+
*
|
|
51
|
+
* if (finalResult.status === 'in_progress') {
|
|
52
|
+
* console.log(`Update started: ${finalResult.correlation_id}`)
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* ## Returns
|
|
58
|
+
*
|
|
59
|
+
* `UpdateDockerComposeResult | unknown`
|
|
60
|
+
*
|
|
61
|
+
* Returns either:
|
|
62
|
+
* - `{ status: "in_progress", ... }` - Update initiated successfully
|
|
63
|
+
* - `{ status: "precondition_required", compose_hash: "...", ... }` - Compose hash verification required
|
|
64
|
+
*
|
|
65
|
+
* Return type depends on schema parameter.
|
|
66
|
+
*
|
|
67
|
+
* ## Parameters
|
|
68
|
+
*
|
|
69
|
+
* ### request (required)
|
|
70
|
+
* - **Type:** `UpdateDockerComposeRequest`
|
|
71
|
+
*
|
|
72
|
+
* Request parameters containing CVM ID, docker_compose_file content, and optional compose_hash/transaction_hash.
|
|
73
|
+
*
|
|
74
|
+
* ### parameters (optional)
|
|
75
|
+
* - **Type:** `UpdateDockerComposeParameters`
|
|
76
|
+
*
|
|
77
|
+
* Optional behavior parameters for schema validation.
|
|
78
|
+
*
|
|
79
|
+
* ```typescript
|
|
80
|
+
* // Use default schema
|
|
81
|
+
* const result = await updateDockerCompose(client, {
|
|
82
|
+
* id: 'cvm-123',
|
|
83
|
+
* docker_compose_file: composeYaml
|
|
84
|
+
* })
|
|
85
|
+
*
|
|
86
|
+
* // Return raw data without validation
|
|
87
|
+
* const raw = await updateDockerCompose(client, request, { schema: false })
|
|
88
|
+
*
|
|
89
|
+
* // Use custom schema
|
|
90
|
+
* const customSchema = z.object({ status: z.string() })
|
|
91
|
+
* const custom = await updateDockerCompose(client, request, { schema: customSchema })
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* ## Safe Version
|
|
95
|
+
*
|
|
96
|
+
* Use `safeUpdateDockerCompose` for error handling without exceptions:
|
|
97
|
+
*
|
|
98
|
+
* ```typescript
|
|
99
|
+
* import { safeUpdateDockerCompose } from '@phala/cloud'
|
|
100
|
+
*
|
|
101
|
+
* const result = await safeUpdateDockerCompose(client, {
|
|
102
|
+
* id: 'cvm-123',
|
|
103
|
+
* docker_compose_file: composeYaml
|
|
104
|
+
* })
|
|
105
|
+
*
|
|
106
|
+
* if (result.success) {
|
|
107
|
+
* if (result.data.status === 'precondition_required') {
|
|
108
|
+
* console.log(`Compose hash: ${result.data.compose_hash}`)
|
|
109
|
+
* console.log(`App ID: ${result.data.app_id}`)
|
|
110
|
+
* // Register on-chain and retry with transaction_hash
|
|
111
|
+
* } else {
|
|
112
|
+
* console.log(`Update started: ${result.data.correlation_id}`)
|
|
113
|
+
* }
|
|
114
|
+
* } else {
|
|
115
|
+
* if ("isRequestError" in result.error) {
|
|
116
|
+
* console.error(`HTTP ${result.error.status}: ${result.error.message}`)
|
|
117
|
+
* } else {
|
|
118
|
+
* console.error(`Validation error: ${result.error.issues}`)
|
|
119
|
+
* }
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
export declare const UpdateDockerComposeRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
124
|
+
id: z.ZodOptional<z.ZodString>;
|
|
125
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
126
|
+
app_id: z.ZodOptional<z.ZodString>;
|
|
127
|
+
instance_id: z.ZodOptional<z.ZodString>;
|
|
128
|
+
name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
129
|
+
} & {
|
|
130
|
+
docker_compose_file: z.ZodString;
|
|
131
|
+
compose_hash: z.ZodOptional<z.ZodString>;
|
|
132
|
+
transaction_hash: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
docker_compose_file: string;
|
|
135
|
+
name?: string | undefined;
|
|
136
|
+
id?: string | undefined;
|
|
137
|
+
app_id?: string | undefined;
|
|
138
|
+
instance_id?: string | undefined;
|
|
139
|
+
compose_hash?: string | undefined;
|
|
140
|
+
uuid?: string | undefined;
|
|
141
|
+
transaction_hash?: string | undefined;
|
|
142
|
+
}, {
|
|
143
|
+
docker_compose_file: string;
|
|
144
|
+
name?: string | undefined;
|
|
145
|
+
id?: string | undefined;
|
|
146
|
+
app_id?: string | undefined;
|
|
147
|
+
instance_id?: string | undefined;
|
|
148
|
+
compose_hash?: string | undefined;
|
|
149
|
+
uuid?: string | undefined;
|
|
150
|
+
transaction_hash?: string | undefined;
|
|
151
|
+
}>, any, any>, {
|
|
152
|
+
cvmId: any;
|
|
153
|
+
request: {
|
|
154
|
+
docker_compose_file: any;
|
|
155
|
+
compose_hash: any;
|
|
156
|
+
transaction_hash: any;
|
|
157
|
+
};
|
|
158
|
+
_raw: any;
|
|
159
|
+
}, any>;
|
|
160
|
+
declare const UpdateDockerComposeInProgressSchema: z.ZodObject<{
|
|
161
|
+
status: z.ZodLiteral<"in_progress">;
|
|
162
|
+
message: z.ZodString;
|
|
163
|
+
correlation_id: z.ZodString;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
status: "in_progress";
|
|
166
|
+
message: string;
|
|
167
|
+
correlation_id: string;
|
|
168
|
+
}, {
|
|
169
|
+
status: "in_progress";
|
|
170
|
+
message: string;
|
|
171
|
+
correlation_id: string;
|
|
172
|
+
}>;
|
|
173
|
+
declare const UpdateDockerComposePreconditionRequiredSchema: z.ZodObject<{
|
|
174
|
+
status: z.ZodLiteral<"precondition_required">;
|
|
175
|
+
message: z.ZodString;
|
|
176
|
+
compose_hash: z.ZodString;
|
|
177
|
+
app_id: z.ZodString;
|
|
178
|
+
device_id: z.ZodString;
|
|
179
|
+
kms_info: z.ZodEffects<z.ZodObject<{
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
182
|
+
url: z.ZodString;
|
|
183
|
+
version: z.ZodString;
|
|
184
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
185
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
186
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
187
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
188
|
+
id: z.ZodString;
|
|
189
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
190
|
+
url: z.ZodString;
|
|
191
|
+
version: z.ZodString;
|
|
192
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
193
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
194
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
195
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
196
|
+
id: z.ZodString;
|
|
197
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
198
|
+
url: z.ZodString;
|
|
199
|
+
version: z.ZodString;
|
|
200
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
201
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
202
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
203
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
204
|
+
id: z.ZodString;
|
|
205
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
206
|
+
url: z.ZodString;
|
|
207
|
+
version: z.ZodString;
|
|
208
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
209
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
210
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
211
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
212
|
+
id: z.ZodString;
|
|
213
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
214
|
+
url: z.ZodString;
|
|
215
|
+
version: z.ZodString;
|
|
216
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
217
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
218
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
219
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
status: "precondition_required";
|
|
222
|
+
message: string;
|
|
223
|
+
app_id: string;
|
|
224
|
+
kms_info: {
|
|
225
|
+
version: string;
|
|
226
|
+
id: string;
|
|
227
|
+
slug: string | null;
|
|
228
|
+
url: string;
|
|
229
|
+
chain_id: number | null;
|
|
230
|
+
kms_contract_address: `0x${string}`;
|
|
231
|
+
gateway_app_id: `0x${string}`;
|
|
232
|
+
} & {
|
|
233
|
+
[k: string]: unknown;
|
|
234
|
+
};
|
|
235
|
+
device_id: string;
|
|
236
|
+
compose_hash: string;
|
|
237
|
+
}, {
|
|
238
|
+
status: "precondition_required";
|
|
239
|
+
message: string;
|
|
240
|
+
app_id: string;
|
|
241
|
+
kms_info: {
|
|
242
|
+
version: string;
|
|
243
|
+
id: string;
|
|
244
|
+
slug: string | null;
|
|
245
|
+
url: string;
|
|
246
|
+
chain_id: number | null;
|
|
247
|
+
kms_contract_address: string | null;
|
|
248
|
+
gateway_app_id: string | null;
|
|
249
|
+
} & {
|
|
250
|
+
[k: string]: unknown;
|
|
251
|
+
};
|
|
252
|
+
device_id: string;
|
|
253
|
+
compose_hash: string;
|
|
254
|
+
}>;
|
|
255
|
+
export declare const UpdateDockerComposeResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
256
|
+
status: z.ZodLiteral<"in_progress">;
|
|
257
|
+
message: z.ZodString;
|
|
258
|
+
correlation_id: z.ZodString;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
status: "in_progress";
|
|
261
|
+
message: string;
|
|
262
|
+
correlation_id: string;
|
|
263
|
+
}, {
|
|
264
|
+
status: "in_progress";
|
|
265
|
+
message: string;
|
|
266
|
+
correlation_id: string;
|
|
267
|
+
}>, z.ZodObject<{
|
|
268
|
+
status: z.ZodLiteral<"precondition_required">;
|
|
269
|
+
message: z.ZodString;
|
|
270
|
+
compose_hash: z.ZodString;
|
|
271
|
+
app_id: z.ZodString;
|
|
272
|
+
device_id: z.ZodString;
|
|
273
|
+
kms_info: z.ZodEffects<z.ZodObject<{
|
|
274
|
+
id: z.ZodString;
|
|
275
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
276
|
+
url: z.ZodString;
|
|
277
|
+
version: z.ZodString;
|
|
278
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
279
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
280
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
281
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
282
|
+
id: z.ZodString;
|
|
283
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
284
|
+
url: z.ZodString;
|
|
285
|
+
version: z.ZodString;
|
|
286
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
287
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
288
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
289
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
290
|
+
id: z.ZodString;
|
|
291
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
292
|
+
url: z.ZodString;
|
|
293
|
+
version: z.ZodString;
|
|
294
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
295
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
296
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
297
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
298
|
+
id: z.ZodString;
|
|
299
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
300
|
+
url: z.ZodString;
|
|
301
|
+
version: z.ZodString;
|
|
302
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
303
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
304
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
305
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
308
|
+
url: z.ZodString;
|
|
309
|
+
version: z.ZodString;
|
|
310
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
311
|
+
kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
312
|
+
gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
|
|
313
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
314
|
+
}, "strip", z.ZodTypeAny, {
|
|
315
|
+
status: "precondition_required";
|
|
316
|
+
message: string;
|
|
317
|
+
app_id: string;
|
|
318
|
+
kms_info: {
|
|
319
|
+
version: string;
|
|
320
|
+
id: string;
|
|
321
|
+
slug: string | null;
|
|
322
|
+
url: string;
|
|
323
|
+
chain_id: number | null;
|
|
324
|
+
kms_contract_address: `0x${string}`;
|
|
325
|
+
gateway_app_id: `0x${string}`;
|
|
326
|
+
} & {
|
|
327
|
+
[k: string]: unknown;
|
|
328
|
+
};
|
|
329
|
+
device_id: string;
|
|
330
|
+
compose_hash: string;
|
|
331
|
+
}, {
|
|
332
|
+
status: "precondition_required";
|
|
333
|
+
message: string;
|
|
334
|
+
app_id: string;
|
|
335
|
+
kms_info: {
|
|
336
|
+
version: string;
|
|
337
|
+
id: string;
|
|
338
|
+
slug: string | null;
|
|
339
|
+
url: string;
|
|
340
|
+
chain_id: number | null;
|
|
341
|
+
kms_contract_address: string | null;
|
|
342
|
+
gateway_app_id: string | null;
|
|
343
|
+
} & {
|
|
344
|
+
[k: string]: unknown;
|
|
345
|
+
};
|
|
346
|
+
device_id: string;
|
|
347
|
+
compose_hash: string;
|
|
348
|
+
}>]>;
|
|
349
|
+
export type UpdateDockerComposeRequest = z.input<typeof UpdateDockerComposeRequestSchema>;
|
|
350
|
+
export type UpdateDockerComposeResult = z.infer<typeof UpdateDockerComposeResultSchema>;
|
|
351
|
+
export type UpdateDockerComposeInProgress = z.infer<typeof UpdateDockerComposeInProgressSchema>;
|
|
352
|
+
export type UpdateDockerComposePreconditionRequired = z.infer<typeof UpdateDockerComposePreconditionRequiredSchema>;
|
|
353
|
+
/**
|
|
354
|
+
* Update CVM Docker Compose file
|
|
355
|
+
*
|
|
356
|
+
* @param client - The API client
|
|
357
|
+
* @param request - Request parameters containing CVM ID and Docker Compose content
|
|
358
|
+
* @param parameters - Optional behavior parameters
|
|
359
|
+
* @returns Update result (either in_progress or precondition_required)
|
|
360
|
+
*/
|
|
361
|
+
declare const updateDockerCompose: {
|
|
362
|
+
(client: Client<import("../..").ApiVersion>, params?: any): Promise<{
|
|
363
|
+
status: "in_progress";
|
|
364
|
+
message: string;
|
|
365
|
+
correlation_id: string;
|
|
366
|
+
} | {
|
|
367
|
+
status: "precondition_required";
|
|
368
|
+
message: string;
|
|
369
|
+
app_id: string;
|
|
370
|
+
kms_info: {
|
|
371
|
+
version: string;
|
|
372
|
+
id: string;
|
|
373
|
+
slug: string | null;
|
|
374
|
+
url: string;
|
|
375
|
+
chain_id: number | null;
|
|
376
|
+
kms_contract_address: `0x${string}`;
|
|
377
|
+
gateway_app_id: `0x${string}`;
|
|
378
|
+
} & {
|
|
379
|
+
[k: string]: unknown;
|
|
380
|
+
};
|
|
381
|
+
device_id: string;
|
|
382
|
+
compose_hash: string;
|
|
383
|
+
}>;
|
|
384
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
385
|
+
schema: T;
|
|
386
|
+
} | undefined): Promise<z.TypeOf<T>>;
|
|
387
|
+
(client: Client<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
388
|
+
schema: false;
|
|
389
|
+
} | undefined): Promise<unknown>;
|
|
390
|
+
}, safeUpdateDockerCompose: {
|
|
391
|
+
(client: Client<import("../..").ApiVersion>, params?: any): Promise<import("../..").SafeResult<{
|
|
392
|
+
status: "in_progress";
|
|
393
|
+
message: string;
|
|
394
|
+
correlation_id: string;
|
|
395
|
+
} | {
|
|
396
|
+
status: "precondition_required";
|
|
397
|
+
message: string;
|
|
398
|
+
app_id: string;
|
|
399
|
+
kms_info: {
|
|
400
|
+
version: string;
|
|
401
|
+
id: string;
|
|
402
|
+
slug: string | null;
|
|
403
|
+
url: string;
|
|
404
|
+
chain_id: number | null;
|
|
405
|
+
kms_contract_address: `0x${string}`;
|
|
406
|
+
gateway_app_id: `0x${string}`;
|
|
407
|
+
} & {
|
|
408
|
+
[k: string]: unknown;
|
|
409
|
+
};
|
|
410
|
+
device_id: string;
|
|
411
|
+
compose_hash: string;
|
|
412
|
+
}>>;
|
|
413
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
414
|
+
schema: T;
|
|
415
|
+
} | undefined): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
416
|
+
(client: Client<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
417
|
+
schema: false;
|
|
418
|
+
} | undefined): Promise<import("../..").SafeResult<unknown>>;
|
|
419
|
+
};
|
|
420
|
+
export { updateDockerCompose, safeUpdateDockerCompose };
|
|
@@ -25,16 +25,19 @@ export declare const UpdateOsImageRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
25
25
|
uuid: z.ZodOptional<z.ZodString>;
|
|
26
26
|
app_id: z.ZodOptional<z.ZodString>;
|
|
27
27
|
instance_id: z.ZodOptional<z.ZodString>;
|
|
28
|
+
name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
28
29
|
} & {
|
|
29
30
|
os_image_name: z.ZodString;
|
|
30
31
|
}, "strip", z.ZodTypeAny, {
|
|
31
32
|
os_image_name: string;
|
|
33
|
+
name?: string | undefined;
|
|
32
34
|
id?: string | undefined;
|
|
33
35
|
app_id?: string | undefined;
|
|
34
36
|
instance_id?: string | undefined;
|
|
35
37
|
uuid?: string | undefined;
|
|
36
38
|
}, {
|
|
37
39
|
os_image_name: string;
|
|
40
|
+
name?: string | undefined;
|
|
38
41
|
id?: string | undefined;
|
|
39
42
|
app_id?: string | undefined;
|
|
40
43
|
instance_id?: string | undefined;
|
|
@@ -42,19 +45,19 @@ export declare const UpdateOsImageRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
42
45
|
}>, any, any>;
|
|
43
46
|
export type UpdateOsImageRequest = z.infer<typeof UpdateOsImageRequestSchema>;
|
|
44
47
|
declare const updateOsImage: {
|
|
45
|
-
(client: import("../..").BaseClient
|
|
46
|
-
<T extends z.ZodTypeAny>(client: import("../..").BaseClient
|
|
48
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any): Promise<void>;
|
|
49
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
47
50
|
schema: T;
|
|
48
51
|
} | undefined): Promise<z.TypeOf<T>>;
|
|
49
|
-
(client: import("../..").BaseClient
|
|
52
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
50
53
|
schema: false;
|
|
51
54
|
} | undefined): Promise<unknown>;
|
|
52
55
|
}, safeUpdateOsImage: {
|
|
53
|
-
(client: import("../..").BaseClient
|
|
54
|
-
<T extends z.ZodTypeAny>(client: import("../..").BaseClient
|
|
56
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any): Promise<import("../..").SafeResult<void>>;
|
|
57
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
55
58
|
schema: T;
|
|
56
59
|
} | undefined): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
57
|
-
(client: import("../..").BaseClient
|
|
60
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
|
|
58
61
|
schema: false;
|
|
59
62
|
} | undefined): Promise<import("../..").SafeResult<unknown>>;
|
|
60
63
|
};
|