Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit cace552

Browse files
authored
Merge pull request #40 from Phala-Network/feat-update-schema
Update schema & release
2 parents 96b4b77 + df78cde commit cace552

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phala",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"description": "CLI for Managing Phala Cloud Services",
55
"author": {
66
"name": "Phala Network",

src/api/types.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const dockerConfigSchema = z.object({
1010
// Compose File Schema
1111
export const composeFileSchema = z.object({
1212
docker_compose_file: z.string(),
13-
docker_config: dockerConfigSchema.optional(),
13+
docker_config: dockerConfigSchema.optional().nullable(),
1414
features: z.array(z.string()),
1515
kms_enabled: z.boolean(),
1616
manifest_version: z.number(),
@@ -21,35 +21,35 @@ export const composeFileSchema = z.object({
2121
salt: z.string().nullable().optional(),
2222
tproxy_enabled: z.boolean(),
2323
version: z.string().optional()
24-
});
24+
}).passthrough();
2525

2626
// Configuration Schema
2727
export const configurationSchema = z.object({
2828
name: z.string(),
2929
image: z.string(),
30-
compose_file: composeFileSchema.nullable(),
30+
compose_file: composeFileSchema.nullable().optional(),
3131
vcpu: z.number(),
3232
memory: z.number(),
3333
disk_size: z.number(),
3434
ports: z.array(z.any())
35-
});
35+
}).passthrough();
3636

3737
// Hosted Schema
3838
export const hostedSchema = z.object({
3939
id: z.string(),
4040
name: z.string(),
4141
status: z.string(),
4242
uptime: z.string(),
43-
app_url: z.string(),
43+
app_url: z.string().nullable(),
4444
app_id: z.string(),
45-
instance_id: z.string(),
46-
configuration: configurationSchema,
47-
exited_at: z.string(),
48-
boot_progress: z.string(),
49-
boot_error: z.string(),
50-
shutdown_progress: z.string(),
51-
image_version: z.string()
52-
});
45+
instance_id: z.string().nullable(),
46+
configuration: configurationSchema.nullable().optional(),
47+
exited_at: z.string().nullable(),
48+
boot_progress: z.string().nullable(),
49+
boot_error: z.string().nullable(),
50+
shutdown_progress: z.string().nullable(),
51+
image_version: z.string().nullable(),
52+
}).passthrough();
5353

5454
// Managed User Schema
5555
export const managedUserSchema = z.object({
@@ -210,11 +210,12 @@ export const capacitySchema = z.object({
210210
// KMS List Item Schema
211211
export const kmsListItemSchema = z.object({
212212
id: z.string(),
213+
slug: z.string(),
213214
url: z.string(),
214215
version: z.string(),
215216
chain_id: z.number(),
216217
kms_contract_address: z.string(),
217-
gateway_app_id: z.string(),
218+
gateway_app_id: z.string().nullable().optional(),
218219
});
219220

220221
// TeepodResponse Schema

src/commands/nodes/list.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ export async function listNodes() {
3636
logger.info('\nAvailable KMS Instances:');
3737
kmsList.forEach((kms: KmsListItem) => {
3838
logger.info('----------------------------------------');
39-
logger.info(` ID: ${kms.id}`);
39+
logger.info(` Slug: ${kms.slug}`);
4040
logger.info(` URL: ${kms.url}`);
4141
logger.info(` Version: ${kms.version}`);
42-
logger.info(` Chain ID: ${kms.chain_id}`);
43-
logger.info(` Contract Address: ${kms.kms_contract_address}`);
44-
logger.info(` Gateway App ID: ${kms.gateway_app_id}`);
42+
if (kms.chain_id) {
43+
logger.info(` Chain ID: ${kms.chain_id}`);
44+
logger.info(` Contract Address: ${kms.kms_contract_address}`);
45+
logger.info(` Gateway App ID: ${kms.gateway_app_id}`);
46+
}
4547
});
4648
}
4749
} catch (error) {

0 commit comments

Comments
 (0)