@phala/cloud 0.6.6-beta.1 → 0.6.7-beta.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/README.md +19 -0
- package/dist/actions/apps/create_app_instance.d.ts +38 -0
- package/dist/actions/apps/get_app_pending_updates.d.ts +93 -0
- package/dist/actions/blockchains/remove_compose_hash.d.ts +77 -0
- package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +83 -11
- package/dist/actions/cvms/commit_cvm_provision.d.ts +191 -0
- package/dist/actions/cvms/commit_cvm_update.d.ts +77 -3
- package/dist/actions/cvms/confirm_cvm_patch.d.ts +80 -3
- package/dist/actions/cvms/cvm_draft.d.ts +1338 -0
- package/dist/actions/cvms/cvm_update_response.d.ts +154 -0
- package/dist/actions/cvms/get_cvm_init_scripts.d.ts +10 -16
- package/dist/actions/cvms/patch_cvm.d.ts +206 -62
- package/dist/actions/cvms/provision_cvm.d.ts +5 -7
- package/dist/actions/cvms/put_cvm_init_scripts.d.ts +49 -10
- package/dist/actions/cvms/update_cvm_envs.d.ts +129 -19
- package/dist/actions/cvms/update_docker_compose.d.ts +134 -20
- package/dist/actions/cvms/update_prelaunch_script.d.ts +134 -20
- package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +145 -15
- package/dist/actions/cvms/wait_for_cvm_finality.d.ts +153 -0
- package/dist/actions/index.d.ts +5 -1
- package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +31 -7
- package/dist/create-client.d.ts +1267 -22
- package/dist/index.js +2540 -1784
- package/dist/index.mjs +2509 -1785
- package/dist/types/app_compose.d.ts +8 -6
- package/dist/types/cvm_finality.d.ts +134 -0
- package/dist/types/cvm_info.d.ts +266 -0
- package/dist/types/cvm_info_v20251028.d.ts +37 -0
- package/dist/types/cvm_info_v20260121.d.ts +111 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CvmUpdateAcceptedFieldsSchema: z.ZodObject<{
|
|
3
|
+
correlationId: z.ZodString;
|
|
4
|
+
status: z.ZodOptional<z.ZodString>;
|
|
5
|
+
finalityWait: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
operation: z.ZodUnion<readonly [z.ZodEnum<{
|
|
7
|
+
create: "create";
|
|
8
|
+
update: "update";
|
|
9
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
10
|
+
correlation_id: z.ZodString;
|
|
11
|
+
phase: z.ZodUnion<readonly [z.ZodEnum<{
|
|
12
|
+
applying: "applying";
|
|
13
|
+
awaiting_finality: "awaiting_finality";
|
|
14
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
15
|
+
stage: z.ZodUnion<readonly [z.ZodEnum<{
|
|
16
|
+
finalized: "finalized";
|
|
17
|
+
safe: "safe";
|
|
18
|
+
submitted: "submitted";
|
|
19
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
20
|
+
stages: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
21
|
+
applying: "applying";
|
|
22
|
+
finalized: "finalized";
|
|
23
|
+
safe: "safe";
|
|
24
|
+
submitted: "submitted";
|
|
25
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>>>;
|
|
26
|
+
transaction: z.ZodNullable<z.ZodObject<{
|
|
27
|
+
hash: z.ZodString;
|
|
28
|
+
block_number: z.ZodNumber;
|
|
29
|
+
chain_id: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
finality: z.ZodObject<{
|
|
32
|
+
block_tag: z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
33
|
+
finalized: "finalized";
|
|
34
|
+
latest: "latest";
|
|
35
|
+
safe: "safe";
|
|
36
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
|
|
37
|
+
policy_block_number: z.ZodNullable<z.ZodNumber>;
|
|
38
|
+
blocks_remaining: z.ZodNullable<z.ZodNumber>;
|
|
39
|
+
eta_seconds: z.ZodNullable<z.ZodNumber>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const CvmUpdateHashRequiredSchema: z.ZodObject<{
|
|
44
|
+
requiresOnChainHash: z.ZodLiteral<true>;
|
|
45
|
+
composeHash: z.ZodString;
|
|
46
|
+
appId: z.ZodString;
|
|
47
|
+
deviceId: z.ZodString;
|
|
48
|
+
kmsInfo: z.ZodPipe<z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
51
|
+
url: z.ZodString;
|
|
52
|
+
version: z.ZodString;
|
|
53
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
54
|
+
kms_contract_address: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<`0x${string}`, string | null>>;
|
|
55
|
+
gateway_app_id: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<`0x${string}`, string | null>>;
|
|
56
|
+
k256_pubkey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
58
|
+
[x: string]: unknown;
|
|
59
|
+
id: string;
|
|
60
|
+
slug: string | null;
|
|
61
|
+
url: string;
|
|
62
|
+
version: string;
|
|
63
|
+
chain_id: number | null;
|
|
64
|
+
kms_contract_address: `0x${string}`;
|
|
65
|
+
gateway_app_id: `0x${string}`;
|
|
66
|
+
k256_pubkey?: string | null | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
[x: string]: unknown;
|
|
69
|
+
id: string;
|
|
70
|
+
slug: string | null;
|
|
71
|
+
url: string;
|
|
72
|
+
version: string;
|
|
73
|
+
chain_id: number | null;
|
|
74
|
+
kms_contract_address: `0x${string}`;
|
|
75
|
+
gateway_app_id: `0x${string}`;
|
|
76
|
+
k256_pubkey?: string | null | undefined;
|
|
77
|
+
}>>;
|
|
78
|
+
commitToken: z.ZodOptional<z.ZodString>;
|
|
79
|
+
commitUrl: z.ZodOptional<z.ZodString>;
|
|
80
|
+
apiCommitUrl: z.ZodOptional<z.ZodString>;
|
|
81
|
+
onchainStatus: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
compose_hash_allowed: z.ZodBoolean;
|
|
83
|
+
device_id_allowed: z.ZodBoolean;
|
|
84
|
+
is_allowed: z.ZodBoolean;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export declare function readCvmUpdateAcceptance(response: unknown): {
|
|
88
|
+
correlationId: string;
|
|
89
|
+
status?: string | undefined;
|
|
90
|
+
finalityWait?: {
|
|
91
|
+
operation: "create" | "update" | (string & Record<never, never>);
|
|
92
|
+
correlation_id: string;
|
|
93
|
+
phase: "applying" | "awaiting_finality" | (string & Record<never, never>);
|
|
94
|
+
stage: "finalized" | "safe" | "submitted" | (string & Record<never, never>);
|
|
95
|
+
stages?: ("applying" | "finalized" | "safe" | "submitted" | (string & Record<never, never>))[] | undefined;
|
|
96
|
+
transaction: {
|
|
97
|
+
hash: string;
|
|
98
|
+
block_number: number;
|
|
99
|
+
chain_id: number;
|
|
100
|
+
} | null;
|
|
101
|
+
finality: {
|
|
102
|
+
block_tag: "finalized" | "latest" | "safe" | (string & Record<never, never>) | null;
|
|
103
|
+
policy_block_number: number | null;
|
|
104
|
+
blocks_remaining: number | null;
|
|
105
|
+
eta_seconds: number | null;
|
|
106
|
+
};
|
|
107
|
+
} | undefined;
|
|
108
|
+
};
|
|
109
|
+
export declare function cvmUpdateCommitHeaders(composeHash: string, transactionHash: string): {
|
|
110
|
+
"X-Compose-Hash": string;
|
|
111
|
+
"X-Transaction-Hash": string;
|
|
112
|
+
};
|
|
113
|
+
/** Unified patch and draft apply return the same 202 and 465 responses. */
|
|
114
|
+
export declare function submitCvmUpdate(send: () => Promise<unknown>): Promise<{
|
|
115
|
+
correlationId: string;
|
|
116
|
+
status?: string | undefined;
|
|
117
|
+
finalityWait?: {
|
|
118
|
+
operation: "create" | "update" | (string & Record<never, never>);
|
|
119
|
+
correlation_id: string;
|
|
120
|
+
phase: "applying" | "awaiting_finality" | (string & Record<never, never>);
|
|
121
|
+
stage: "finalized" | "safe" | "submitted" | (string & Record<never, never>);
|
|
122
|
+
stages?: ("applying" | "finalized" | "safe" | "submitted" | (string & Record<never, never>))[] | undefined;
|
|
123
|
+
transaction: {
|
|
124
|
+
hash: string;
|
|
125
|
+
block_number: number;
|
|
126
|
+
chain_id: number;
|
|
127
|
+
} | null;
|
|
128
|
+
finality: {
|
|
129
|
+
block_tag: "finalized" | "latest" | "safe" | (string & Record<never, never>) | null;
|
|
130
|
+
policy_block_number: number | null;
|
|
131
|
+
blocks_remaining: number | null;
|
|
132
|
+
eta_seconds: number | null;
|
|
133
|
+
};
|
|
134
|
+
} | undefined;
|
|
135
|
+
requiresOnChainHash: false;
|
|
136
|
+
composeHash?: undefined;
|
|
137
|
+
appId?: undefined;
|
|
138
|
+
deviceId?: undefined;
|
|
139
|
+
kmsInfo?: undefined;
|
|
140
|
+
commitToken?: undefined;
|
|
141
|
+
commitUrl?: undefined;
|
|
142
|
+
apiCommitUrl?: undefined;
|
|
143
|
+
onchainStatus?: undefined;
|
|
144
|
+
} | {
|
|
145
|
+
requiresOnChainHash: true;
|
|
146
|
+
composeHash: unknown;
|
|
147
|
+
appId: string;
|
|
148
|
+
deviceId: unknown;
|
|
149
|
+
kmsInfo: unknown;
|
|
150
|
+
commitToken: unknown;
|
|
151
|
+
commitUrl: unknown;
|
|
152
|
+
apiCommitUrl: unknown;
|
|
153
|
+
onchainStatus: unknown;
|
|
154
|
+
}>;
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type CvmIdInput } from "../../types/cvm_id";
|
|
3
3
|
export declare const CvmInitScriptSchema: z.ZodObject<{
|
|
4
|
-
slug: z.
|
|
5
|
-
docker_cleanup: "docker_cleanup";
|
|
6
|
-
env_merge: "env_merge";
|
|
7
|
-
}>;
|
|
4
|
+
slug: z.ZodString;
|
|
8
5
|
selected: z.ZodBoolean;
|
|
9
6
|
selectable: z.ZodBoolean;
|
|
10
7
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
8
|
}, z.core.$strip>;
|
|
12
9
|
export declare const CvmInitScriptsSchema: z.ZodObject<{
|
|
13
10
|
items: z.ZodArray<z.ZodObject<{
|
|
14
|
-
slug: z.
|
|
15
|
-
docker_cleanup: "docker_cleanup";
|
|
16
|
-
env_merge: "env_merge";
|
|
17
|
-
}>;
|
|
11
|
+
slug: z.ZodString;
|
|
18
12
|
selected: z.ZodBoolean;
|
|
19
13
|
selectable: z.ZodBoolean;
|
|
20
14
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -40,13 +34,13 @@ export declare const GetCvmInitScriptsRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
40
34
|
}>>;
|
|
41
35
|
export type GetCvmInitScriptsRequest = CvmIdInput;
|
|
42
36
|
/**
|
|
43
|
-
* List the
|
|
37
|
+
* List the init scripts Phala Cloud provides for a CVM
|
|
44
38
|
*
|
|
45
|
-
* Returns every
|
|
46
|
-
* current compose runs it, and whether the caller
|
|
47
|
-
* reason when not). has_custom_scripts is true when the compose also runs
|
|
48
|
-
*
|
|
49
|
-
* `patchCvm({ init_scripts })
|
|
39
|
+
* Returns every provided init script in the order Phala Cloud runs them: whether
|
|
40
|
+
* the CVM's current compose runs it, and whether the caller can select it (with
|
|
41
|
+
* the reason when not). has_custom_scripts is true when the compose also runs
|
|
42
|
+
* scripts set by Phala Cloud support. Change the selection with
|
|
43
|
+
* `patchCvm({ init_scripts })`.
|
|
50
44
|
*
|
|
51
45
|
* @example
|
|
52
46
|
* ```typescript
|
|
@@ -59,7 +53,7 @@ export type GetCvmInitScriptsRequest = CvmIdInput;
|
|
|
59
53
|
declare const getCvmInitScripts: {
|
|
60
54
|
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput): Promise<{
|
|
61
55
|
items: {
|
|
62
|
-
slug:
|
|
56
|
+
slug: string;
|
|
63
57
|
selected: boolean;
|
|
64
58
|
selectable: boolean;
|
|
65
59
|
reason?: string | null | undefined;
|
|
@@ -75,7 +69,7 @@ declare const getCvmInitScripts: {
|
|
|
75
69
|
}, safeGetCvmInitScripts: {
|
|
76
70
|
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput): Promise<import("../..").SafeResult<{
|
|
77
71
|
items: {
|
|
78
|
-
slug:
|
|
72
|
+
slug: string;
|
|
79
73
|
selected: boolean;
|
|
80
74
|
selectable: boolean;
|
|
81
75
|
reason?: string | null | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { CvmUpdateHashRequiredSchema } from "./cvm_update_response";
|
|
2
3
|
/**
|
|
3
4
|
* Patch CVM (unified update)
|
|
4
5
|
*
|
|
@@ -143,6 +144,82 @@ export declare const ComposePatchSchema: z.ZodObject<{
|
|
|
143
144
|
features: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
144
145
|
}, z.core.$loose>;
|
|
145
146
|
export type ComposePatch = z.input<typeof ComposePatchSchema>;
|
|
147
|
+
export declare const CvmPatchBodySchema: z.ZodObject<{
|
|
148
|
+
docker_compose_file: z.ZodOptional<z.ZodString>;
|
|
149
|
+
pre_launch_script: z.ZodOptional<z.ZodString>;
|
|
150
|
+
allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
public_logs: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
public_sysinfo: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
public_tcbinfo: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
compose: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
secure_time: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
156
|
+
swap_size: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
157
|
+
storage_discard: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
158
|
+
snapshotter: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
159
|
+
overlayfs: "overlayfs";
|
|
160
|
+
stargz: "stargz";
|
|
161
|
+
}>>>;
|
|
162
|
+
gateway_enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
163
|
+
port_policy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
164
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
|
+
port: z.ZodNumber;
|
|
166
|
+
pp: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
}, z.core.$strip>>>;
|
|
168
|
+
restrict_mode: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
}, z.core.$strip>>>;
|
|
170
|
+
event_log_version: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>>;
|
|
171
|
+
requirements: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
172
|
+
ephemeral_data_disk: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
173
|
+
health_check: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
174
|
+
health_status_file: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
175
|
+
launch_token_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
176
|
+
platforms: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
177
|
+
tdx_measure_acpi_tables: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
178
|
+
}, z.core.$loose>>>;
|
|
179
|
+
kms_enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
180
|
+
key_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
181
|
+
kms: "kms";
|
|
182
|
+
local: "local";
|
|
183
|
+
none: "none";
|
|
184
|
+
tpm: "tpm";
|
|
185
|
+
}>>>;
|
|
186
|
+
key_provider_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
|
+
local_key_provider_enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
188
|
+
manifest_version: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
189
|
+
no_instance_id: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
190
|
+
runner: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
storage_fs: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
192
|
+
ext4: "ext4";
|
|
193
|
+
zfs: "zfs";
|
|
194
|
+
}>>>;
|
|
195
|
+
verity_volumes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
196
|
+
source: z.ZodString;
|
|
197
|
+
target: z.ZodString;
|
|
198
|
+
verity_root: z.ZodString;
|
|
199
|
+
}, z.core.$strip>>>>;
|
|
200
|
+
tproxy_enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
201
|
+
features: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
202
|
+
}, z.core.$loose>>;
|
|
203
|
+
init_scripts: z.ZodOptional<z.ZodArray<z.ZodType<import("../..").InitScriptSlug, unknown, z.core.$ZodTypeInternals<import("../..").InitScriptSlug, unknown>>>>;
|
|
204
|
+
init_script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
205
|
+
confirm_data_wipe: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
encrypted_env: z.ZodOptional<z.ZodString>;
|
|
207
|
+
user_config: z.ZodOptional<z.ZodString>;
|
|
208
|
+
gpus: z.ZodOptional<z.ZodObject<{
|
|
209
|
+
gpus: z.ZodArray<z.ZodObject<{
|
|
210
|
+
slot: z.ZodString;
|
|
211
|
+
product_id: z.ZodOptional<z.ZodString>;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
attach_mode: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
vcpu: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
memory: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
disk_size: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
instance_type: z.ZodOptional<z.ZodString>;
|
|
219
|
+
image: z.ZodOptional<z.ZodString>;
|
|
220
|
+
shutdown_timeout: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
allow_force_stop: z.ZodOptional<z.ZodBoolean>;
|
|
222
|
+
}, z.core.$strip>;
|
|
146
223
|
export declare const PatchCvmRequestSchema: z.ZodObject<{
|
|
147
224
|
id: z.ZodOptional<z.ZodString>;
|
|
148
225
|
uuid: z.ZodOptional<z.ZodString>;
|
|
@@ -204,10 +281,7 @@ export declare const PatchCvmRequestSchema: z.ZodObject<{
|
|
|
204
281
|
tproxy_enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
205
282
|
features: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
206
283
|
}, z.core.$loose>>;
|
|
207
|
-
init_scripts: z.ZodOptional<z.ZodArray<z.
|
|
208
|
-
docker_cleanup: "docker_cleanup";
|
|
209
|
-
env_merge: "env_merge";
|
|
210
|
-
}>>>;
|
|
284
|
+
init_scripts: z.ZodOptional<z.ZodArray<z.ZodType<import("../..").InitScriptSlug, unknown, z.core.$ZodTypeInternals<import("../..").InitScriptSlug, unknown>>>>;
|
|
211
285
|
init_script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
286
|
confirm_data_wipe: z.ZodOptional<z.ZodBoolean>;
|
|
213
287
|
encrypted_env: z.ZodOptional<z.ZodString>;
|
|
@@ -230,56 +304,88 @@ export declare const PatchCvmRequestSchema: z.ZodObject<{
|
|
|
230
304
|
}, z.core.$strip>;
|
|
231
305
|
export type PatchCvmRequest = z.input<typeof PatchCvmRequestSchema>;
|
|
232
306
|
declare const PatchCvmAcceptedSchema: z.ZodObject<{
|
|
233
|
-
requiresOnChainHash: z.ZodLiteral<false>;
|
|
234
307
|
correlationId: z.ZodString;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
commitUrl: z.ZodOptional<z.ZodString>;
|
|
273
|
-
apiCommitUrl: z.ZodOptional<z.ZodString>;
|
|
274
|
-
onchainStatus: z.ZodOptional<z.ZodObject<{
|
|
275
|
-
compose_hash_allowed: z.ZodBoolean;
|
|
276
|
-
device_id_allowed: z.ZodBoolean;
|
|
277
|
-
is_allowed: z.ZodBoolean;
|
|
308
|
+
status: z.ZodOptional<z.ZodString>;
|
|
309
|
+
finalityWait: z.ZodOptional<z.ZodObject<{
|
|
310
|
+
operation: z.ZodUnion<readonly [z.ZodEnum<{
|
|
311
|
+
create: "create";
|
|
312
|
+
update: "update";
|
|
313
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
314
|
+
correlation_id: z.ZodString;
|
|
315
|
+
phase: z.ZodUnion<readonly [z.ZodEnum<{
|
|
316
|
+
applying: "applying";
|
|
317
|
+
awaiting_finality: "awaiting_finality";
|
|
318
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
319
|
+
stage: z.ZodUnion<readonly [z.ZodEnum<{
|
|
320
|
+
finalized: "finalized";
|
|
321
|
+
safe: "safe";
|
|
322
|
+
submitted: "submitted";
|
|
323
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
324
|
+
stages: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
325
|
+
applying: "applying";
|
|
326
|
+
finalized: "finalized";
|
|
327
|
+
safe: "safe";
|
|
328
|
+
submitted: "submitted";
|
|
329
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>>>;
|
|
330
|
+
transaction: z.ZodNullable<z.ZodObject<{
|
|
331
|
+
hash: z.ZodString;
|
|
332
|
+
block_number: z.ZodNumber;
|
|
333
|
+
chain_id: z.ZodNumber;
|
|
334
|
+
}, z.core.$strip>>;
|
|
335
|
+
finality: z.ZodObject<{
|
|
336
|
+
block_tag: z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
337
|
+
finalized: "finalized";
|
|
338
|
+
latest: "latest";
|
|
339
|
+
safe: "safe";
|
|
340
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
|
|
341
|
+
policy_block_number: z.ZodNullable<z.ZodNumber>;
|
|
342
|
+
blocks_remaining: z.ZodNullable<z.ZodNumber>;
|
|
343
|
+
eta_seconds: z.ZodNullable<z.ZodNumber>;
|
|
344
|
+
}, z.core.$strip>;
|
|
278
345
|
}, z.core.$strip>>;
|
|
346
|
+
requiresOnChainHash: z.ZodLiteral<false>;
|
|
279
347
|
}, z.core.$strip>;
|
|
280
348
|
export declare const PatchCvmResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
281
|
-
requiresOnChainHash: z.ZodLiteral<false>;
|
|
282
349
|
correlationId: z.ZodString;
|
|
350
|
+
status: z.ZodOptional<z.ZodString>;
|
|
351
|
+
finalityWait: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
operation: z.ZodUnion<readonly [z.ZodEnum<{
|
|
353
|
+
create: "create";
|
|
354
|
+
update: "update";
|
|
355
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
356
|
+
correlation_id: z.ZodString;
|
|
357
|
+
phase: z.ZodUnion<readonly [z.ZodEnum<{
|
|
358
|
+
applying: "applying";
|
|
359
|
+
awaiting_finality: "awaiting_finality";
|
|
360
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
361
|
+
stage: z.ZodUnion<readonly [z.ZodEnum<{
|
|
362
|
+
finalized: "finalized";
|
|
363
|
+
safe: "safe";
|
|
364
|
+
submitted: "submitted";
|
|
365
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
|
|
366
|
+
stages: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
367
|
+
applying: "applying";
|
|
368
|
+
finalized: "finalized";
|
|
369
|
+
safe: "safe";
|
|
370
|
+
submitted: "submitted";
|
|
371
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>>>;
|
|
372
|
+
transaction: z.ZodNullable<z.ZodObject<{
|
|
373
|
+
hash: z.ZodString;
|
|
374
|
+
block_number: z.ZodNumber;
|
|
375
|
+
chain_id: z.ZodNumber;
|
|
376
|
+
}, z.core.$strip>>;
|
|
377
|
+
finality: z.ZodObject<{
|
|
378
|
+
block_tag: z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
379
|
+
finalized: "finalized";
|
|
380
|
+
latest: "latest";
|
|
381
|
+
safe: "safe";
|
|
382
|
+
}>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
|
|
383
|
+
policy_block_number: z.ZodNullable<z.ZodNumber>;
|
|
384
|
+
blocks_remaining: z.ZodNullable<z.ZodNumber>;
|
|
385
|
+
eta_seconds: z.ZodNullable<z.ZodNumber>;
|
|
386
|
+
}, z.core.$strip>;
|
|
387
|
+
}, z.core.$strip>>;
|
|
388
|
+
requiresOnChainHash: z.ZodLiteral<false>;
|
|
283
389
|
}, z.core.$strip>, z.ZodObject<{
|
|
284
390
|
requiresOnChainHash: z.ZodLiteral<true>;
|
|
285
391
|
composeHash: z.ZodString;
|
|
@@ -326,7 +432,7 @@ export declare const PatchCvmResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
326
432
|
}, z.core.$strip>], "requiresOnChainHash">;
|
|
327
433
|
export type PatchCvmResult = z.infer<typeof PatchCvmResultSchema>;
|
|
328
434
|
export type PatchCvmAccepted = z.infer<typeof PatchCvmAcceptedSchema>;
|
|
329
|
-
export type PatchCvmHashRequired = z.infer<typeof
|
|
435
|
+
export type PatchCvmHashRequired = z.infer<typeof CvmUpdateHashRequiredSchema>;
|
|
330
436
|
declare const patchCvm: {
|
|
331
437
|
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
332
438
|
id?: string | undefined;
|
|
@@ -380,7 +486,7 @@ declare const patchCvm: {
|
|
|
380
486
|
tproxy_enabled?: boolean | null | undefined;
|
|
381
487
|
features?: string[] | null | undefined;
|
|
382
488
|
} | undefined;
|
|
383
|
-
init_scripts?:
|
|
489
|
+
init_scripts?: unknown[] | undefined;
|
|
384
490
|
init_script?: string[] | undefined;
|
|
385
491
|
confirm_data_wipe?: boolean | undefined;
|
|
386
492
|
encrypted_env?: string | undefined;
|
|
@@ -401,9 +507,6 @@ declare const patchCvm: {
|
|
|
401
507
|
allow_force_stop?: boolean | undefined;
|
|
402
508
|
prepareOnly?: boolean | undefined;
|
|
403
509
|
}): Promise<{
|
|
404
|
-
requiresOnChainHash: false;
|
|
405
|
-
correlationId: string;
|
|
406
|
-
} | {
|
|
407
510
|
requiresOnChainHash: true;
|
|
408
511
|
composeHash: string;
|
|
409
512
|
appId: string;
|
|
@@ -427,6 +530,28 @@ declare const patchCvm: {
|
|
|
427
530
|
device_id_allowed: boolean;
|
|
428
531
|
is_allowed: boolean;
|
|
429
532
|
} | undefined;
|
|
533
|
+
} | {
|
|
534
|
+
correlationId: string;
|
|
535
|
+
status?: string | undefined;
|
|
536
|
+
finalityWait?: {
|
|
537
|
+
operation: "create" | "update" | (string & Record<never, never>);
|
|
538
|
+
correlation_id: string;
|
|
539
|
+
phase: "applying" | "awaiting_finality" | (string & Record<never, never>);
|
|
540
|
+
stage: "finalized" | "safe" | "submitted" | (string & Record<never, never>);
|
|
541
|
+
stages?: ("applying" | "finalized" | "safe" | "submitted" | (string & Record<never, never>))[] | undefined;
|
|
542
|
+
transaction: {
|
|
543
|
+
hash: string;
|
|
544
|
+
block_number: number;
|
|
545
|
+
chain_id: number;
|
|
546
|
+
} | null;
|
|
547
|
+
finality: {
|
|
548
|
+
block_tag: "finalized" | "latest" | "safe" | (string & Record<never, never>) | null;
|
|
549
|
+
policy_block_number: number | null;
|
|
550
|
+
blocks_remaining: number | null;
|
|
551
|
+
eta_seconds: number | null;
|
|
552
|
+
};
|
|
553
|
+
} | undefined;
|
|
554
|
+
requiresOnChainHash: false;
|
|
430
555
|
}>;
|
|
431
556
|
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
432
557
|
id?: string | undefined;
|
|
@@ -480,7 +605,7 @@ declare const patchCvm: {
|
|
|
480
605
|
tproxy_enabled?: boolean | null | undefined;
|
|
481
606
|
features?: string[] | null | undefined;
|
|
482
607
|
} | undefined;
|
|
483
|
-
init_scripts?:
|
|
608
|
+
init_scripts?: unknown[] | undefined;
|
|
484
609
|
init_script?: string[] | undefined;
|
|
485
610
|
confirm_data_wipe?: boolean | undefined;
|
|
486
611
|
encrypted_env?: string | undefined;
|
|
@@ -555,7 +680,7 @@ declare const patchCvm: {
|
|
|
555
680
|
tproxy_enabled?: boolean | null | undefined;
|
|
556
681
|
features?: string[] | null | undefined;
|
|
557
682
|
} | undefined;
|
|
558
|
-
init_scripts?:
|
|
683
|
+
init_scripts?: unknown[] | undefined;
|
|
559
684
|
init_script?: string[] | undefined;
|
|
560
685
|
confirm_data_wipe?: boolean | undefined;
|
|
561
686
|
encrypted_env?: string | undefined;
|
|
@@ -631,7 +756,7 @@ declare const patchCvm: {
|
|
|
631
756
|
tproxy_enabled?: boolean | null | undefined;
|
|
632
757
|
features?: string[] | null | undefined;
|
|
633
758
|
} | undefined;
|
|
634
|
-
init_scripts?:
|
|
759
|
+
init_scripts?: unknown[] | undefined;
|
|
635
760
|
init_script?: string[] | undefined;
|
|
636
761
|
confirm_data_wipe?: boolean | undefined;
|
|
637
762
|
encrypted_env?: string | undefined;
|
|
@@ -652,9 +777,6 @@ declare const patchCvm: {
|
|
|
652
777
|
allow_force_stop?: boolean | undefined;
|
|
653
778
|
prepareOnly?: boolean | undefined;
|
|
654
779
|
}): Promise<import("../..").SafeResult<{
|
|
655
|
-
requiresOnChainHash: false;
|
|
656
|
-
correlationId: string;
|
|
657
|
-
} | {
|
|
658
780
|
requiresOnChainHash: true;
|
|
659
781
|
composeHash: string;
|
|
660
782
|
appId: string;
|
|
@@ -678,6 +800,28 @@ declare const patchCvm: {
|
|
|
678
800
|
device_id_allowed: boolean;
|
|
679
801
|
is_allowed: boolean;
|
|
680
802
|
} | undefined;
|
|
803
|
+
} | {
|
|
804
|
+
correlationId: string;
|
|
805
|
+
status?: string | undefined;
|
|
806
|
+
finalityWait?: {
|
|
807
|
+
operation: "create" | "update" | (string & Record<never, never>);
|
|
808
|
+
correlation_id: string;
|
|
809
|
+
phase: "applying" | "awaiting_finality" | (string & Record<never, never>);
|
|
810
|
+
stage: "finalized" | "safe" | "submitted" | (string & Record<never, never>);
|
|
811
|
+
stages?: ("applying" | "finalized" | "safe" | "submitted" | (string & Record<never, never>))[] | undefined;
|
|
812
|
+
transaction: {
|
|
813
|
+
hash: string;
|
|
814
|
+
block_number: number;
|
|
815
|
+
chain_id: number;
|
|
816
|
+
} | null;
|
|
817
|
+
finality: {
|
|
818
|
+
block_tag: "finalized" | "latest" | "safe" | (string & Record<never, never>) | null;
|
|
819
|
+
policy_block_number: number | null;
|
|
820
|
+
blocks_remaining: number | null;
|
|
821
|
+
eta_seconds: number | null;
|
|
822
|
+
};
|
|
823
|
+
} | undefined;
|
|
824
|
+
requiresOnChainHash: false;
|
|
681
825
|
}>>;
|
|
682
826
|
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
683
827
|
id?: string | undefined;
|
|
@@ -731,7 +875,7 @@ declare const patchCvm: {
|
|
|
731
875
|
tproxy_enabled?: boolean | null | undefined;
|
|
732
876
|
features?: string[] | null | undefined;
|
|
733
877
|
} | undefined;
|
|
734
|
-
init_scripts?:
|
|
878
|
+
init_scripts?: unknown[] | undefined;
|
|
735
879
|
init_script?: string[] | undefined;
|
|
736
880
|
confirm_data_wipe?: boolean | undefined;
|
|
737
881
|
encrypted_env?: string | undefined;
|
|
@@ -806,7 +950,7 @@ declare const patchCvm: {
|
|
|
806
950
|
tproxy_enabled?: boolean | null | undefined;
|
|
807
951
|
features?: string[] | null | undefined;
|
|
808
952
|
} | undefined;
|
|
809
|
-
init_scripts?:
|
|
953
|
+
init_scripts?: unknown[] | undefined;
|
|
810
954
|
init_script?: string[] | undefined;
|
|
811
955
|
confirm_data_wipe?: boolean | undefined;
|
|
812
956
|
encrypted_env?: string | undefined;
|
|
@@ -129,7 +129,8 @@ import { type Client } from "../../client";
|
|
|
129
129
|
* - Specify only if you need a different size than the default
|
|
130
130
|
* - **env_keys**: List of allowed environment variable keys
|
|
131
131
|
* - **listed**: Whether the CVM is publicly listed (default: false)
|
|
132
|
-
* - **init_scripts**:
|
|
132
|
+
* - **init_scripts**: Names of init scripts provided by Phala Cloud, such as `docker_cleanup`.
|
|
133
|
+
* Phala Cloud owns the list and the run order; see `getCvmInitScripts`
|
|
133
134
|
* - **launch_token**: Launch token (at least 32 bytes) the guest checks on every boot;
|
|
134
135
|
* Phala Cloud writes its hash into `compose_file.requirements.launch_token_hash`
|
|
135
136
|
* - **generate_launch_token**: Let Phala Cloud generate the token for a new app; it is
|
|
@@ -284,10 +285,7 @@ export declare const ProvisionCvmRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
284
285
|
init_script: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
285
286
|
}, z.core.$loose>>;
|
|
286
287
|
compose_file_raw: z.ZodOptional<z.ZodString>;
|
|
287
|
-
init_scripts: z.ZodOptional<z.ZodArray<z.
|
|
288
|
-
docker_cleanup: "docker_cleanup";
|
|
289
|
-
env_merge: "env_merge";
|
|
290
|
-
}>>>;
|
|
288
|
+
init_scripts: z.ZodOptional<z.ZodArray<z.ZodType<import("../..").InitScriptSlug, unknown, z.core.$ZodTypeInternals<import("../..").InitScriptSlug, unknown>>>>;
|
|
291
289
|
launch_token: z.ZodOptional<z.ZodString>;
|
|
292
290
|
generate_launch_token: z.ZodOptional<z.ZodBoolean>;
|
|
293
291
|
annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -375,7 +373,7 @@ export declare const ProvisionCvmRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
375
373
|
init_script?: string | string[] | undefined;
|
|
376
374
|
} | undefined;
|
|
377
375
|
compose_file_raw?: string | undefined;
|
|
378
|
-
init_scripts?: ("
|
|
376
|
+
init_scripts?: import("../..").InitScriptSlug[] | undefined;
|
|
379
377
|
launch_token?: string | undefined;
|
|
380
378
|
generate_launch_token?: boolean | undefined;
|
|
381
379
|
annotations?: Record<string, string> | undefined;
|
|
@@ -456,7 +454,7 @@ export declare const ProvisionCvmRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
456
454
|
init_script?: string | string[] | undefined;
|
|
457
455
|
} | undefined;
|
|
458
456
|
compose_file_raw?: string | undefined;
|
|
459
|
-
init_scripts?: ("
|
|
457
|
+
init_scripts?: import("../..").InitScriptSlug[] | undefined;
|
|
460
458
|
launch_token?: string | undefined;
|
|
461
459
|
generate_launch_token?: boolean | undefined;
|
|
462
460
|
annotations?: Record<string, string> | undefined;
|