@phala/cloud 0.2.1-beta.4 → 0.2.2
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 +8 -6
- package/dist/actions/workspaces/get_workspace_nodes.d.ts +313 -0
- package/dist/actions/workspaces/get_workspace_quotas.d.ts +1169 -0
- package/dist/actions/workspaces/list_workspaces.d.ts +24 -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 +1713 -664
- package/dist/index.mjs +1627 -657
- package/dist/types/app_info_v20251028.d.ts +1266 -0
- package/dist/types/app_info_v20260121.d.ts +3385 -0
- package/dist/types/app_revision.d.ts +453 -0
- package/dist/types/client.d.ts +41 -3
- 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 +1333 -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
|
@@ -23,40 +23,40 @@ export declare const GetAppEnvEncryptPubKeySchema: z.ZodObject<{
|
|
|
23
23
|
export type GetAppEnvEncryptPubKeyRequest = z.infer<typeof GetAppEnvEncryptPubKeyRequestSchema>;
|
|
24
24
|
export type GetAppEnvEncryptPubKey = z.infer<typeof GetAppEnvEncryptPubKeySchema>;
|
|
25
25
|
declare const getAppEnvEncryptPubKey: {
|
|
26
|
-
(client: Client
|
|
26
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
27
27
|
app_id: string;
|
|
28
28
|
kms: string;
|
|
29
29
|
}): Promise<{
|
|
30
30
|
public_key: string;
|
|
31
31
|
signature: string;
|
|
32
32
|
}>;
|
|
33
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
33
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
|
|
34
34
|
app_id: string;
|
|
35
35
|
kms: string;
|
|
36
36
|
}, parameters: {
|
|
37
37
|
schema: T;
|
|
38
38
|
}): Promise<z.TypeOf<T>>;
|
|
39
|
-
(client: Client
|
|
39
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
40
40
|
app_id: string;
|
|
41
41
|
kms: string;
|
|
42
42
|
}, parameters: {
|
|
43
43
|
schema: false;
|
|
44
44
|
}): Promise<unknown>;
|
|
45
45
|
}, safeGetAppEnvEncryptPubKey: {
|
|
46
|
-
(client: Client
|
|
46
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
47
47
|
app_id: string;
|
|
48
48
|
kms: string;
|
|
49
49
|
}): Promise<import("../..").SafeResult<{
|
|
50
50
|
public_key: string;
|
|
51
51
|
signature: string;
|
|
52
52
|
}>>;
|
|
53
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
53
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
|
|
54
54
|
app_id: string;
|
|
55
55
|
kms: string;
|
|
56
56
|
}, parameters: {
|
|
57
57
|
schema: T;
|
|
58
58
|
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
59
|
-
(client: Client
|
|
59
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
60
60
|
app_id: string;
|
|
61
61
|
kms: string;
|
|
62
62
|
}, parameters: {
|
|
@@ -24,29 +24,29 @@ export type GetKmsInfoRequest = z.infer<typeof GetKmsInfoRequestSchema>;
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
declare const getKmsInfo: {
|
|
27
|
-
(client: Client
|
|
27
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
28
28
|
kms_id: string;
|
|
29
29
|
}): Promise<KmsInfo>;
|
|
30
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
30
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
|
|
31
31
|
kms_id: string;
|
|
32
32
|
}, parameters: {
|
|
33
33
|
schema: T;
|
|
34
34
|
}): Promise<z.TypeOf<T>>;
|
|
35
|
-
(client: Client
|
|
35
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
36
36
|
kms_id: string;
|
|
37
37
|
}, parameters: {
|
|
38
38
|
schema: false;
|
|
39
39
|
}): Promise<unknown>;
|
|
40
40
|
}, safeGetKmsInfo: {
|
|
41
|
-
(client: Client
|
|
41
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
42
42
|
kms_id: string;
|
|
43
43
|
}): Promise<import("../..").SafeResult<KmsInfo>>;
|
|
44
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
44
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
|
|
45
45
|
kms_id: string;
|
|
46
46
|
}, parameters: {
|
|
47
47
|
schema: T;
|
|
48
48
|
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
49
|
-
(client: Client
|
|
49
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
50
50
|
kms_id: string;
|
|
51
51
|
}, parameters: {
|
|
52
52
|
schema: false;
|
|
@@ -94,19 +94,19 @@ export type GetKmsListResponse = z.infer<typeof GetKmsListSchema> & {
|
|
|
94
94
|
items: KmsInfo[];
|
|
95
95
|
};
|
|
96
96
|
declare const getKmsList: {
|
|
97
|
-
(client: Client
|
|
97
|
+
(client: Client<import("../..").ApiVersion>, params?: {
|
|
98
98
|
page?: number | undefined;
|
|
99
99
|
page_size?: number | undefined;
|
|
100
100
|
is_onchain?: boolean | undefined;
|
|
101
101
|
} | undefined): Promise<GetKmsListResponse>;
|
|
102
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
102
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params?: {
|
|
103
103
|
page?: number | undefined;
|
|
104
104
|
page_size?: number | undefined;
|
|
105
105
|
is_onchain?: boolean | undefined;
|
|
106
106
|
} | undefined, parameters?: {
|
|
107
107
|
schema: T;
|
|
108
108
|
} | undefined): Promise<z.TypeOf<T>>;
|
|
109
|
-
(client: Client
|
|
109
|
+
(client: Client<import("../..").ApiVersion>, params?: {
|
|
110
110
|
page?: number | undefined;
|
|
111
111
|
page_size?: number | undefined;
|
|
112
112
|
is_onchain?: boolean | undefined;
|
|
@@ -114,19 +114,19 @@ declare const getKmsList: {
|
|
|
114
114
|
schema: false;
|
|
115
115
|
} | undefined): Promise<unknown>;
|
|
116
116
|
}, safeGetKmsList: {
|
|
117
|
-
(client: Client
|
|
117
|
+
(client: Client<import("../..").ApiVersion>, params?: {
|
|
118
118
|
page?: number | undefined;
|
|
119
119
|
page_size?: number | undefined;
|
|
120
120
|
is_onchain?: boolean | undefined;
|
|
121
121
|
} | undefined): Promise<import("../..").SafeResult<GetKmsListResponse>>;
|
|
122
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
122
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params?: {
|
|
123
123
|
page?: number | undefined;
|
|
124
124
|
page_size?: number | undefined;
|
|
125
125
|
is_onchain?: boolean | undefined;
|
|
126
126
|
} | undefined, parameters?: {
|
|
127
127
|
schema: T;
|
|
128
128
|
} | undefined): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
129
|
-
(client: Client
|
|
129
|
+
(client: Client<import("../..").ApiVersion>, params?: {
|
|
130
130
|
page?: number | undefined;
|
|
131
131
|
page_size?: number | undefined;
|
|
132
132
|
is_onchain?: boolean | undefined;
|
|
@@ -32,7 +32,7 @@ export declare const NextAppIdsSchema: z.ZodObject<{
|
|
|
32
32
|
export type NextAppIdsRequest = z.infer<typeof NextAppIdsRequestSchema>;
|
|
33
33
|
export type NextAppIds = z.infer<typeof NextAppIdsSchema>;
|
|
34
34
|
declare const nextAppIds: {
|
|
35
|
-
(client: Client
|
|
35
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
36
36
|
counts: number;
|
|
37
37
|
}): Promise<{
|
|
38
38
|
app_ids: {
|
|
@@ -40,18 +40,18 @@ declare const nextAppIds: {
|
|
|
40
40
|
app_id: string;
|
|
41
41
|
}[];
|
|
42
42
|
}>;
|
|
43
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
43
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
|
|
44
44
|
counts: number;
|
|
45
45
|
}, parameters: {
|
|
46
46
|
schema: T;
|
|
47
47
|
}): Promise<z.TypeOf<T>>;
|
|
48
|
-
(client: Client
|
|
48
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
49
49
|
counts: number;
|
|
50
50
|
}, parameters: {
|
|
51
51
|
schema: false;
|
|
52
52
|
}): Promise<unknown>;
|
|
53
53
|
}, safeNextAppIds: {
|
|
54
|
-
(client: Client
|
|
54
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
55
55
|
counts: number;
|
|
56
56
|
}): Promise<import("../..").SafeResult<{
|
|
57
57
|
app_ids: {
|
|
@@ -59,12 +59,12 @@ declare const nextAppIds: {
|
|
|
59
59
|
app_id: string;
|
|
60
60
|
}[];
|
|
61
61
|
}>>;
|
|
62
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
62
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
|
|
63
63
|
counts: number;
|
|
64
64
|
}, parameters: {
|
|
65
65
|
schema: T;
|
|
66
66
|
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
67
|
-
(client: Client
|
|
67
|
+
(client: Client<import("../..").ApiVersion>, params: {
|
|
68
68
|
counts: number;
|
|
69
69
|
}, parameters: {
|
|
70
70
|
schema: false;
|
|
@@ -226,7 +226,6 @@ export declare const FamilyInstanceTypesResponseSchema: z.ZodObject<{
|
|
|
226
226
|
total: z.ZodNumber;
|
|
227
227
|
family: z.ZodString;
|
|
228
228
|
}, "strict", z.ZodTypeAny, {
|
|
229
|
-
family: string;
|
|
230
229
|
items: z.objectOutputType<{
|
|
231
230
|
id: z.ZodString;
|
|
232
231
|
name: z.ZodString;
|
|
@@ -239,8 +238,8 @@ export declare const FamilyInstanceTypesResponseSchema: z.ZodObject<{
|
|
|
239
238
|
family: z.ZodNullable<z.ZodString>;
|
|
240
239
|
}, z.ZodTypeAny, "passthrough">[];
|
|
241
240
|
total: number;
|
|
242
|
-
}, {
|
|
243
241
|
family: string;
|
|
242
|
+
}, {
|
|
244
243
|
items: z.objectInputType<{
|
|
245
244
|
id: z.ZodString;
|
|
246
245
|
name: z.ZodString;
|
|
@@ -253,6 +252,7 @@ export declare const FamilyInstanceTypesResponseSchema: z.ZodObject<{
|
|
|
253
252
|
family: z.ZodNullable<z.ZodString>;
|
|
254
253
|
}, z.ZodTypeAny, "passthrough">[];
|
|
255
254
|
total: number;
|
|
255
|
+
family: string;
|
|
256
256
|
}>;
|
|
257
257
|
export type InstanceType = z.infer<typeof InstanceTypeSchema>;
|
|
258
258
|
export type FamilyGroup = z.infer<typeof FamilyGroupSchema>;
|
|
@@ -284,7 +284,7 @@ export type ListFamilyInstanceTypesRequest = z.infer<typeof ListFamilyInstanceTy
|
|
|
284
284
|
* ```
|
|
285
285
|
*/
|
|
286
286
|
declare const listAllInstanceTypeFamilies: {
|
|
287
|
-
(client: Client
|
|
287
|
+
(client: Client<import("..").ApiVersion>, params?: void | undefined): Promise<{
|
|
288
288
|
result: {
|
|
289
289
|
name: string;
|
|
290
290
|
items: z.objectOutputType<{
|
|
@@ -301,14 +301,14 @@ declare const listAllInstanceTypeFamilies: {
|
|
|
301
301
|
total: number;
|
|
302
302
|
}[];
|
|
303
303
|
}>;
|
|
304
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
304
|
+
<T extends z.ZodTypeAny>(client: Client<import("..").ApiVersion>, params?: void | undefined, parameters?: {
|
|
305
305
|
schema: T;
|
|
306
306
|
} | undefined): Promise<z.TypeOf<T>>;
|
|
307
|
-
(client: Client
|
|
307
|
+
(client: Client<import("..").ApiVersion>, params?: void | undefined, parameters?: {
|
|
308
308
|
schema: false;
|
|
309
309
|
} | undefined): Promise<unknown>;
|
|
310
310
|
}, safeListAllInstanceTypeFamilies: {
|
|
311
|
-
(client: Client
|
|
311
|
+
(client: Client<import("..").ApiVersion>, params?: void | undefined): Promise<import("..").SafeResult<{
|
|
312
312
|
result: {
|
|
313
313
|
name: string;
|
|
314
314
|
items: z.objectOutputType<{
|
|
@@ -325,10 +325,10 @@ declare const listAllInstanceTypeFamilies: {
|
|
|
325
325
|
total: number;
|
|
326
326
|
}[];
|
|
327
327
|
}>>;
|
|
328
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
328
|
+
<T extends z.ZodTypeAny>(client: Client<import("..").ApiVersion>, params?: void | undefined, parameters?: {
|
|
329
329
|
schema: T;
|
|
330
330
|
} | undefined): Promise<import("..").SafeResult<z.TypeOf<T>>>;
|
|
331
|
-
(client: Client
|
|
331
|
+
(client: Client<import("..").ApiVersion>, params?: void | undefined, parameters?: {
|
|
332
332
|
schema: false;
|
|
333
333
|
} | undefined): Promise<import("..").SafeResult<unknown>>;
|
|
334
334
|
};
|
|
@@ -351,10 +351,9 @@ declare const listAllInstanceTypeFamilies: {
|
|
|
351
351
|
* ```
|
|
352
352
|
*/
|
|
353
353
|
declare const listFamilyInstanceTypes: {
|
|
354
|
-
(client: Client
|
|
354
|
+
(client: Client<import("..").ApiVersion>, params: {
|
|
355
355
|
family: string;
|
|
356
356
|
}): Promise<{
|
|
357
|
-
family: string;
|
|
358
357
|
items: z.objectOutputType<{
|
|
359
358
|
id: z.ZodString;
|
|
360
359
|
name: z.ZodString;
|
|
@@ -367,22 +366,22 @@ declare const listFamilyInstanceTypes: {
|
|
|
367
366
|
family: z.ZodNullable<z.ZodString>;
|
|
368
367
|
}, z.ZodTypeAny, "passthrough">[];
|
|
369
368
|
total: number;
|
|
369
|
+
family: string;
|
|
370
370
|
}>;
|
|
371
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
371
|
+
<T extends z.ZodTypeAny>(client: Client<import("..").ApiVersion>, params: {
|
|
372
372
|
family: string;
|
|
373
373
|
}, parameters: {
|
|
374
374
|
schema: T;
|
|
375
375
|
}): Promise<z.TypeOf<T>>;
|
|
376
|
-
(client: Client
|
|
376
|
+
(client: Client<import("..").ApiVersion>, params: {
|
|
377
377
|
family: string;
|
|
378
378
|
}, parameters: {
|
|
379
379
|
schema: false;
|
|
380
380
|
}): Promise<unknown>;
|
|
381
381
|
}, safeListFamilyInstanceTypes: {
|
|
382
|
-
(client: Client
|
|
382
|
+
(client: Client<import("..").ApiVersion>, params: {
|
|
383
383
|
family: string;
|
|
384
384
|
}): Promise<import("..").SafeResult<{
|
|
385
|
-
family: string;
|
|
386
385
|
items: z.objectOutputType<{
|
|
387
386
|
id: z.ZodString;
|
|
388
387
|
name: z.ZodString;
|
|
@@ -395,13 +394,14 @@ declare const listFamilyInstanceTypes: {
|
|
|
395
394
|
family: z.ZodNullable<z.ZodString>;
|
|
396
395
|
}, z.ZodTypeAny, "passthrough">[];
|
|
397
396
|
total: number;
|
|
397
|
+
family: string;
|
|
398
398
|
}>>;
|
|
399
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
399
|
+
<T extends z.ZodTypeAny>(client: Client<import("..").ApiVersion>, params: {
|
|
400
400
|
family: string;
|
|
401
401
|
}, parameters: {
|
|
402
402
|
schema: T;
|
|
403
403
|
}): Promise<import("..").SafeResult<z.TypeOf<T>>>;
|
|
404
|
-
(client: Client
|
|
404
|
+
(client: Client<import("..").ApiVersion>, params: {
|
|
405
405
|
family: string;
|
|
406
406
|
}, parameters: {
|
|
407
407
|
schema: false;
|
|
@@ -64,33 +64,35 @@ import { type Client } from "../../client";
|
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
66
|
declare const getWorkspace: {
|
|
67
|
-
(client: Client
|
|
67
|
+
(client: Client<import("../..").ApiVersion>, params: string): Promise<z.objectOutputType<{
|
|
68
68
|
id: z.ZodString;
|
|
69
69
|
name: z.ZodString;
|
|
70
70
|
slug: z.ZodNullable<z.ZodString>;
|
|
71
71
|
tier: z.ZodString;
|
|
72
72
|
role: z.ZodString;
|
|
73
|
+
is_default: z.ZodBoolean;
|
|
73
74
|
created_at: z.ZodString;
|
|
74
75
|
}, z.ZodTypeAny, "passthrough">>;
|
|
75
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
76
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: string, parameters: {
|
|
76
77
|
schema: T;
|
|
77
78
|
}): Promise<z.TypeOf<T>>;
|
|
78
|
-
(client: Client
|
|
79
|
+
(client: Client<import("../..").ApiVersion>, params: string, parameters: {
|
|
79
80
|
schema: false;
|
|
80
81
|
}): Promise<unknown>;
|
|
81
82
|
}, safeGetWorkspace: {
|
|
82
|
-
(client: Client
|
|
83
|
+
(client: Client<import("../..").ApiVersion>, params: string): Promise<import("../..").SafeResult<z.objectOutputType<{
|
|
83
84
|
id: z.ZodString;
|
|
84
85
|
name: z.ZodString;
|
|
85
86
|
slug: z.ZodNullable<z.ZodString>;
|
|
86
87
|
tier: z.ZodString;
|
|
87
88
|
role: z.ZodString;
|
|
89
|
+
is_default: z.ZodBoolean;
|
|
88
90
|
created_at: z.ZodString;
|
|
89
91
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
90
|
-
<T extends z.ZodTypeAny>(client: Client
|
|
92
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: string, parameters: {
|
|
91
93
|
schema: T;
|
|
92
94
|
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
93
|
-
(client: Client
|
|
95
|
+
(client: Client<import("../..").ApiVersion>, params: string, parameters: {
|
|
94
96
|
schema: false;
|
|
95
97
|
}): Promise<import("../..").SafeResult<unknown>>;
|
|
96
98
|
};
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type Client } from "../../client";
|
|
3
|
+
/**
|
|
4
|
+
* List nodes accessible by a workspace
|
|
5
|
+
*
|
|
6
|
+
* Returns paginated list of nodes that the workspace can use for deploying CVMs.
|
|
7
|
+
* Nodes are ordered by availability (reserved nodes first, then public nodes by resource score).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { createClient, getWorkspaceNodes } from '@phala/cloud'
|
|
12
|
+
*
|
|
13
|
+
* const client = createClient({ apiKey: 'your-api-key' })
|
|
14
|
+
* const nodes = await getWorkspaceNodes(client, { teamSlug: 'team-slug' })
|
|
15
|
+
* // Output: { items: [{ id: 1, name: 'node-1', status: 'ONLINE', ... }], total: 10, page: 1, ... }
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* ## Returns
|
|
19
|
+
*
|
|
20
|
+
* `GetWorkspaceNodes | unknown`
|
|
21
|
+
*
|
|
22
|
+
* List of available nodes with pagination metadata. Return type depends on schema parameter.
|
|
23
|
+
*
|
|
24
|
+
* ## Parameters
|
|
25
|
+
*
|
|
26
|
+
* ### request (required)
|
|
27
|
+
* - **Type:** `GetWorkspaceNodesRequest`
|
|
28
|
+
*
|
|
29
|
+
* Request parameters including workspace identifier and optional pagination.
|
|
30
|
+
*
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Use default schema
|
|
33
|
+
* const nodes = await getWorkspaceNodes(client, { teamSlug: 'team-slug' })
|
|
34
|
+
*
|
|
35
|
+
* // With pagination
|
|
36
|
+
* const page = await getWorkspaceNodes(client, {
|
|
37
|
+
* teamSlug: 'team-slug',
|
|
38
|
+
* page: 2,
|
|
39
|
+
* pageSize: 20
|
|
40
|
+
* })
|
|
41
|
+
*
|
|
42
|
+
* // Return raw data without validation
|
|
43
|
+
* const raw = await getWorkspaceNodes(client, { teamSlug: 'team-slug' }, { schema: false })
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* ## Safe Version
|
|
47
|
+
*
|
|
48
|
+
* Use `safeGetWorkspaceNodes` for error handling without exceptions:
|
|
49
|
+
*
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { safeGetWorkspaceNodes } from '@phala/cloud'
|
|
52
|
+
*
|
|
53
|
+
* const result = await safeGetWorkspaceNodes(client, { teamSlug: 'team-slug' })
|
|
54
|
+
* if (result.success) {
|
|
55
|
+
* console.log(result.data.items[0].name)
|
|
56
|
+
* console.log(`Total: ${result.data.total}`)
|
|
57
|
+
* } else {
|
|
58
|
+
* if ("isRequestError" in result.error) {
|
|
59
|
+
* console.error(`HTTP ${result.error.status}: ${result.error.message}`)
|
|
60
|
+
* } else {
|
|
61
|
+
* console.error(`Validation error: ${result.error.issues}`)
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare const NodeRefSchema: z.ZodObject<{
|
|
67
|
+
object_type: z.ZodLiteral<"node">;
|
|
68
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
69
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
ppid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
object_type: "node";
|
|
77
|
+
status?: string | null | undefined;
|
|
78
|
+
name?: string | null | undefined;
|
|
79
|
+
version?: string | null | undefined;
|
|
80
|
+
id?: number | null | undefined;
|
|
81
|
+
region?: string | null | undefined;
|
|
82
|
+
device_id?: string | null | undefined;
|
|
83
|
+
ppid?: string | null | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
object_type: "node";
|
|
86
|
+
status?: string | null | undefined;
|
|
87
|
+
name?: string | null | undefined;
|
|
88
|
+
version?: string | null | undefined;
|
|
89
|
+
id?: number | null | undefined;
|
|
90
|
+
region?: string | null | undefined;
|
|
91
|
+
device_id?: string | null | undefined;
|
|
92
|
+
ppid?: string | null | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const NodeInfoSchema: z.ZodObject<{
|
|
95
|
+
object_type: z.ZodLiteral<"node">;
|
|
96
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
97
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
ppid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
object_type: "node";
|
|
105
|
+
status?: string | null | undefined;
|
|
106
|
+
name?: string | null | undefined;
|
|
107
|
+
version?: string | null | undefined;
|
|
108
|
+
id?: number | null | undefined;
|
|
109
|
+
region?: string | null | undefined;
|
|
110
|
+
device_id?: string | null | undefined;
|
|
111
|
+
ppid?: string | null | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
object_type: "node";
|
|
114
|
+
status?: string | null | undefined;
|
|
115
|
+
name?: string | null | undefined;
|
|
116
|
+
version?: string | null | undefined;
|
|
117
|
+
id?: number | null | undefined;
|
|
118
|
+
region?: string | null | undefined;
|
|
119
|
+
device_id?: string | null | undefined;
|
|
120
|
+
ppid?: string | null | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const GetWorkspaceNodesSchema: z.ZodObject<{
|
|
123
|
+
items: z.ZodArray<z.ZodObject<{
|
|
124
|
+
object_type: z.ZodLiteral<"node">;
|
|
125
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
126
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
127
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
ppid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
object_type: "node";
|
|
134
|
+
status?: string | null | undefined;
|
|
135
|
+
name?: string | null | undefined;
|
|
136
|
+
version?: string | null | undefined;
|
|
137
|
+
id?: number | null | undefined;
|
|
138
|
+
region?: string | null | undefined;
|
|
139
|
+
device_id?: string | null | undefined;
|
|
140
|
+
ppid?: string | null | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
object_type: "node";
|
|
143
|
+
status?: string | null | undefined;
|
|
144
|
+
name?: string | null | undefined;
|
|
145
|
+
version?: string | null | undefined;
|
|
146
|
+
id?: number | null | undefined;
|
|
147
|
+
region?: string | null | undefined;
|
|
148
|
+
device_id?: string | null | undefined;
|
|
149
|
+
ppid?: string | null | undefined;
|
|
150
|
+
}>, "many">;
|
|
151
|
+
total: z.ZodNumber;
|
|
152
|
+
page: z.ZodNumber;
|
|
153
|
+
page_size: z.ZodNumber;
|
|
154
|
+
pages: z.ZodNumber;
|
|
155
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
156
|
+
items: z.ZodArray<z.ZodObject<{
|
|
157
|
+
object_type: z.ZodLiteral<"node">;
|
|
158
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
159
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
160
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
162
|
+
ppid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
163
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
object_type: "node";
|
|
167
|
+
status?: string | null | undefined;
|
|
168
|
+
name?: string | null | undefined;
|
|
169
|
+
version?: string | null | undefined;
|
|
170
|
+
id?: number | null | undefined;
|
|
171
|
+
region?: string | null | undefined;
|
|
172
|
+
device_id?: string | null | undefined;
|
|
173
|
+
ppid?: string | null | undefined;
|
|
174
|
+
}, {
|
|
175
|
+
object_type: "node";
|
|
176
|
+
status?: string | null | undefined;
|
|
177
|
+
name?: string | null | undefined;
|
|
178
|
+
version?: string | null | undefined;
|
|
179
|
+
id?: number | null | undefined;
|
|
180
|
+
region?: string | null | undefined;
|
|
181
|
+
device_id?: string | null | undefined;
|
|
182
|
+
ppid?: string | null | undefined;
|
|
183
|
+
}>, "many">;
|
|
184
|
+
total: z.ZodNumber;
|
|
185
|
+
page: z.ZodNumber;
|
|
186
|
+
page_size: z.ZodNumber;
|
|
187
|
+
pages: z.ZodNumber;
|
|
188
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
189
|
+
items: z.ZodArray<z.ZodObject<{
|
|
190
|
+
object_type: z.ZodLiteral<"node">;
|
|
191
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
192
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
ppid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
197
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
}, "strip", z.ZodTypeAny, {
|
|
199
|
+
object_type: "node";
|
|
200
|
+
status?: string | null | undefined;
|
|
201
|
+
name?: string | null | undefined;
|
|
202
|
+
version?: string | null | undefined;
|
|
203
|
+
id?: number | null | undefined;
|
|
204
|
+
region?: string | null | undefined;
|
|
205
|
+
device_id?: string | null | undefined;
|
|
206
|
+
ppid?: string | null | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
object_type: "node";
|
|
209
|
+
status?: string | null | undefined;
|
|
210
|
+
name?: string | null | undefined;
|
|
211
|
+
version?: string | null | undefined;
|
|
212
|
+
id?: number | null | undefined;
|
|
213
|
+
region?: string | null | undefined;
|
|
214
|
+
device_id?: string | null | undefined;
|
|
215
|
+
ppid?: string | null | undefined;
|
|
216
|
+
}>, "many">;
|
|
217
|
+
total: z.ZodNumber;
|
|
218
|
+
page: z.ZodNumber;
|
|
219
|
+
page_size: z.ZodNumber;
|
|
220
|
+
pages: z.ZodNumber;
|
|
221
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
222
|
+
export type NodeRef = z.infer<typeof NodeRefSchema>;
|
|
223
|
+
export type NodeInfo = NodeRef;
|
|
224
|
+
export type GetWorkspaceNodes = z.infer<typeof GetWorkspaceNodesSchema>;
|
|
225
|
+
export type GetWorkspaceNodesRequest = {
|
|
226
|
+
teamSlug: string;
|
|
227
|
+
page?: number;
|
|
228
|
+
pageSize?: number;
|
|
229
|
+
};
|
|
230
|
+
declare const getWorkspaceNodes: {
|
|
231
|
+
(client: Client<import("../..").ApiVersion>, params: GetWorkspaceNodesRequest): Promise<z.objectOutputType<{
|
|
232
|
+
items: z.ZodArray<z.ZodObject<{
|
|
233
|
+
object_type: z.ZodLiteral<"node">;
|
|
234
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
235
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
238
|
+
ppid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
object_type: "node";
|
|
243
|
+
status?: string | null | undefined;
|
|
244
|
+
name?: string | null | undefined;
|
|
245
|
+
version?: string | null | undefined;
|
|
246
|
+
id?: number | null | undefined;
|
|
247
|
+
region?: string | null | undefined;
|
|
248
|
+
device_id?: string | null | undefined;
|
|
249
|
+
ppid?: string | null | undefined;
|
|
250
|
+
}, {
|
|
251
|
+
object_type: "node";
|
|
252
|
+
status?: string | null | undefined;
|
|
253
|
+
name?: string | null | undefined;
|
|
254
|
+
version?: string | null | undefined;
|
|
255
|
+
id?: number | null | undefined;
|
|
256
|
+
region?: string | null | undefined;
|
|
257
|
+
device_id?: string | null | undefined;
|
|
258
|
+
ppid?: string | null | undefined;
|
|
259
|
+
}>, "many">;
|
|
260
|
+
total: z.ZodNumber;
|
|
261
|
+
page: z.ZodNumber;
|
|
262
|
+
page_size: z.ZodNumber;
|
|
263
|
+
pages: z.ZodNumber;
|
|
264
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
265
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: GetWorkspaceNodesRequest, parameters: {
|
|
266
|
+
schema: T;
|
|
267
|
+
}): Promise<z.TypeOf<T>>;
|
|
268
|
+
(client: Client<import("../..").ApiVersion>, params: GetWorkspaceNodesRequest, parameters: {
|
|
269
|
+
schema: false;
|
|
270
|
+
}): Promise<unknown>;
|
|
271
|
+
}, safeGetWorkspaceNodes: {
|
|
272
|
+
(client: Client<import("../..").ApiVersion>, params: GetWorkspaceNodesRequest): Promise<import("../..").SafeResult<z.objectOutputType<{
|
|
273
|
+
items: z.ZodArray<z.ZodObject<{
|
|
274
|
+
object_type: z.ZodLiteral<"node">;
|
|
275
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
276
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
277
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
278
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
279
|
+
ppid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
280
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
281
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
object_type: "node";
|
|
284
|
+
status?: string | null | undefined;
|
|
285
|
+
name?: string | null | undefined;
|
|
286
|
+
version?: string | null | undefined;
|
|
287
|
+
id?: number | null | undefined;
|
|
288
|
+
region?: string | null | undefined;
|
|
289
|
+
device_id?: string | null | undefined;
|
|
290
|
+
ppid?: string | null | undefined;
|
|
291
|
+
}, {
|
|
292
|
+
object_type: "node";
|
|
293
|
+
status?: string | null | undefined;
|
|
294
|
+
name?: string | null | undefined;
|
|
295
|
+
version?: string | null | undefined;
|
|
296
|
+
id?: number | null | undefined;
|
|
297
|
+
region?: string | null | undefined;
|
|
298
|
+
device_id?: string | null | undefined;
|
|
299
|
+
ppid?: string | null | undefined;
|
|
300
|
+
}>, "many">;
|
|
301
|
+
total: z.ZodNumber;
|
|
302
|
+
page: z.ZodNumber;
|
|
303
|
+
page_size: z.ZodNumber;
|
|
304
|
+
pages: z.ZodNumber;
|
|
305
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
306
|
+
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: GetWorkspaceNodesRequest, parameters: {
|
|
307
|
+
schema: T;
|
|
308
|
+
}): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
|
|
309
|
+
(client: Client<import("../..").ApiVersion>, params: GetWorkspaceNodesRequest, parameters: {
|
|
310
|
+
schema: false;
|
|
311
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
312
|
+
};
|
|
313
|
+
export { getWorkspaceNodes, safeGetWorkspaceNodes };
|