@phala/cloud 0.2.9 → 0.3.0
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/dist/actions/apps/check_app_cvms_is_allowed.d.ts +324 -75
- package/dist/actions/apps/check_app_is_allowed.d.ts +16 -16
- package/dist/actions/apps/create_app_instance.d.ts +33 -24
- package/dist/actions/apps/get_app_attestation.d.ts +82 -32
- package/dist/actions/apps/get_app_device_allowlist.d.ts +281 -11
- package/dist/actions/apps/get_app_filter_options.d.ts +2 -2
- package/dist/actions/apps/get_app_list.d.ts +2 -2
- package/dist/actions/cvms/check_cvm_is_allowed.d.ts +142 -74
- package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +12 -12
- package/dist/actions/cvms/commit_cvm_provision.d.ts +424 -277
- package/dist/actions/cvms/commit_cvm_update.d.ts +2 -2
- package/dist/actions/cvms/confirm_cvm_patch.d.ts +2 -2
- package/dist/actions/cvms/delete_cvm.d.ts +2 -2
- package/dist/actions/cvms/get_available_os_images.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_attestation.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_compose_file.d.ts +338 -10
- package/dist/actions/cvms/get_cvm_containers_stats.d.ts +10 -10
- package/dist/actions/cvms/get_cvm_docker_compose.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_info.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_list.d.ts +4 -4
- package/dist/actions/cvms/get_cvm_network.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_state.d.ts +6 -6
- package/dist/actions/cvms/get_cvm_stats.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_status_batch.d.ts +6 -6
- package/dist/actions/cvms/get_cvm_user_config.d.ts +2 -2
- package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +93 -0
- package/dist/actions/cvms/patch_cvm.d.ts +18 -18
- package/dist/actions/cvms/provision_cvm.d.ts +243 -225
- package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +254 -38
- package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +130 -43
- package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +294 -110
- package/dist/actions/cvms/replicate_cvm.d.ts +7 -72
- package/dist/actions/cvms/restart_cvm.d.ts +7 -72
- package/dist/actions/cvms/shutdown_cvm.d.ts +9 -72
- package/dist/actions/cvms/start_cvm.d.ts +7 -72
- package/dist/actions/cvms/stop_cvm.d.ts +7 -72
- package/dist/actions/cvms/update_cvm_envs.d.ts +20 -20
- package/dist/actions/cvms/update_cvm_resources.d.ts +2 -2
- package/dist/actions/cvms/update_cvm_visibility.d.ts +26 -26
- package/dist/actions/cvms/update_docker_compose.d.ts +20 -20
- package/dist/actions/cvms/update_os_image.d.ts +2 -2
- package/dist/actions/cvms/update_prelaunch_script.d.ts +20 -20
- package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +319 -0
- package/dist/actions/get_cvm_create_resources.d.ts +2412 -0
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/kms/get_kms_list.d.ts +10 -10
- package/dist/actions/kms/next_app_ids.d.ts +6 -6
- package/dist/actions/list-instance-types.d.ts +12 -12
- package/dist/actions/ssh_keys/create_ssh_key.d.ts +2 -2
- package/dist/actions/ssh_keys/list_ssh_keys.d.ts +4 -4
- package/dist/actions/workspaces/get_workspace.d.ts +2 -0
- package/dist/actions/workspaces/get_workspace_nodes.d.ts +14 -14
- package/dist/actions/workspaces/list_workspaces.d.ts +18 -0
- package/dist/client.d.ts +5 -2
- package/dist/create-client.d.ts +48 -0
- package/dist/index.js +1882 -1257
- package/dist/index.mjs +1850 -1255
- package/dist/types/app_compose.d.ts +125 -0
- package/dist/types/app_info_v20251028.d.ts +136 -259
- package/dist/types/app_info_v20260121.d.ts +4677 -345
- package/dist/types/app_revision.d.ts +8 -8
- package/dist/types/client.d.ts +2 -2
- package/dist/types/cvm_id.d.ts +6 -6
- package/dist/types/cvm_info.d.ts +536 -10
- package/dist/types/cvm_info_v20251028.d.ts +65 -65
- package/dist/types/cvm_info_v20260121.d.ts +1636 -85
- package/dist/types/version-mappings.d.ts +45 -8
- package/dist/utils/errors.d.ts +8 -1
- package/package.json +2 -2
|
@@ -7,32 +7,69 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { CurrentUserV20260121 } from "../credentials/current_user_v20260121";
|
|
9
9
|
import type { CurrentUserV20251028 } from "../credentials/current_user_v20251028";
|
|
10
|
+
import type { AppCvmsBatchIsAllowedResponseV20260121, AppCvmsBatchIsAllowedResponseV20260522 } from "../actions/apps/check_app_cvms_is_allowed";
|
|
11
|
+
import type { DeviceAllowlistResponseV20260121, DeviceAllowlistResponseV20260522 } from "../actions/apps/get_app_device_allowlist";
|
|
12
|
+
import type { IsAllowedResultV20260121, IsAllowedResultV20260522 } from "../actions/cvms/check_cvm_is_allowed";
|
|
13
|
+
import type { InstanceIdRefreshResultV20260121, InstanceIdRefreshResultV20260522 } from "../actions/cvms/refresh_cvm_instance_id";
|
|
14
|
+
import type { RefreshCvmInstanceIdsResponseV20260121, RefreshCvmInstanceIdsResponseV20260522 } from "../actions/cvms/refresh_cvm_instance_ids";
|
|
15
|
+
import type { CommitCvmProvisionV20260121, CommitCvmProvisionV20260522 } from "../actions/cvms/commit_cvm_provision";
|
|
10
16
|
import type { DstackAppListResponseV20251028, DstackAppWithCvmResponseV20251028 } from "./app_info_v20251028";
|
|
11
|
-
import type { DstackAppListResponseV20260121, DstackAppWithCvmResponseV20260121 } from "./app_info_v20260121";
|
|
17
|
+
import type { DstackAppListResponseV20260121, DstackAppListResponseV20260522, DstackAppWithCvmResponseV20260121, DstackAppWithCvmResponseV20260522 } from "./app_info_v20260121";
|
|
12
18
|
import type { ApiVersion } from "./client";
|
|
13
19
|
import type { CvmDetailV20251028, CvmInfoV20251028, PaginatedCvmInfosV20251028 } from "./cvm_info_v20251028";
|
|
14
|
-
import type {
|
|
20
|
+
import type { VMForVersion } from "./cvm_info";
|
|
21
|
+
import type { CvmInfoDetailV20260121, CvmInfoDetailV20260522, CvmInfoV20260121, CvmInfoV20260522, PaginatedCvmInfosV20260121, PaginatedCvmInfosV20260522 } from "./cvm_info_v20260121";
|
|
15
22
|
/**
|
|
16
23
|
* Maps API version to the auth/me response type
|
|
17
24
|
*/
|
|
18
|
-
export type GetCurrentUserResponse<V extends ApiVersion> = V extends "2026-01-21" ? CurrentUserV20260121 : V extends "2025-10-28" ? CurrentUserV20251028 : CurrentUserV20260121;
|
|
25
|
+
export type GetCurrentUserResponse<V extends ApiVersion> = V extends "2026-05-22" ? CurrentUserV20260121 : V extends "2026-01-21" ? CurrentUserV20260121 : V extends "2025-10-28" ? CurrentUserV20251028 : CurrentUserV20260121;
|
|
19
26
|
/**
|
|
20
27
|
* Maps API version to the paginated CVM list response type
|
|
21
28
|
*/
|
|
22
|
-
export type GetCvmListResponse<V extends ApiVersion> = V extends "2026-01-21" ? PaginatedCvmInfosV20260121 : V extends "2025-10-28" ? PaginatedCvmInfosV20251028 : PaginatedCvmInfosV20260121;
|
|
29
|
+
export type GetCvmListResponse<V extends ApiVersion> = V extends "2026-05-22" ? PaginatedCvmInfosV20260522 : V extends "2026-01-21" ? PaginatedCvmInfosV20260121 : V extends "2025-10-28" ? PaginatedCvmInfosV20251028 : PaginatedCvmInfosV20260121;
|
|
23
30
|
/**
|
|
24
31
|
* Maps API version to the CVM info detail response type
|
|
25
32
|
*/
|
|
26
|
-
export type GetCvmInfoResponse<V extends ApiVersion> = V extends "2026-01-21" ? CvmInfoDetailV20260121 : V extends "2025-10-28" ? CvmDetailV20251028 : CvmInfoDetailV20260121;
|
|
33
|
+
export type GetCvmInfoResponse<V extends ApiVersion> = V extends "2026-05-22" ? CvmInfoDetailV20260522 : V extends "2026-01-21" ? CvmInfoDetailV20260121 : V extends "2025-10-28" ? CvmDetailV20251028 : CvmInfoDetailV20260121;
|
|
27
34
|
/**
|
|
28
35
|
* Maps API version to the app list response type
|
|
29
36
|
*/
|
|
30
|
-
export type GetAppListResponse<V extends ApiVersion> = V extends "2026-01-21" ? DstackAppListResponseV20260121 : V extends "2025-10-28" ? DstackAppListResponseV20251028 : DstackAppListResponseV20260121;
|
|
37
|
+
export type GetAppListResponse<V extends ApiVersion> = V extends "2026-05-22" ? DstackAppListResponseV20260522 : V extends "2026-01-21" ? DstackAppListResponseV20260121 : V extends "2025-10-28" ? DstackAppListResponseV20251028 : DstackAppListResponseV20260121;
|
|
31
38
|
/**
|
|
32
39
|
* Maps API version to the app info response type
|
|
33
40
|
*/
|
|
34
|
-
export type GetAppInfoResponse<V extends ApiVersion> = V extends "2026-01-21" ? DstackAppWithCvmResponseV20260121 : V extends "2025-10-28" ? DstackAppWithCvmResponseV20251028 : DstackAppWithCvmResponseV20260121;
|
|
41
|
+
export type GetAppInfoResponse<V extends ApiVersion> = V extends "2026-05-22" ? DstackAppWithCvmResponseV20260522 : V extends "2026-01-21" ? DstackAppWithCvmResponseV20260121 : V extends "2025-10-28" ? DstackAppWithCvmResponseV20251028 : DstackAppWithCvmResponseV20260121;
|
|
35
42
|
/**
|
|
36
43
|
* Maps API version to the app CVMs list response type
|
|
37
44
|
*/
|
|
38
|
-
export type GetAppCvmsResponse<V extends ApiVersion> = V extends "2026-01-21" ? CvmInfoV20260121[] : V extends "2025-10-28" ? CvmInfoV20251028[] : CvmInfoV20260121[];
|
|
45
|
+
export type GetAppCvmsResponse<V extends ApiVersion> = V extends "2026-05-22" ? CvmInfoV20260522[] : V extends "2026-01-21" ? CvmInfoV20260121[] : V extends "2025-10-28" ? CvmInfoV20251028[] : CvmInfoV20260121[];
|
|
46
|
+
/**
|
|
47
|
+
* Maps API version to the CVM lifecycle action response type (start/stop/restart/shutdown/replicate)
|
|
48
|
+
*/
|
|
49
|
+
export type CvmLifecycleResponse<V extends ApiVersion> = VMForVersion<V>;
|
|
50
|
+
/**
|
|
51
|
+
* Maps API version to the commit CVM provision response type
|
|
52
|
+
*/
|
|
53
|
+
export type CommitCvmProvisionResponse<V extends ApiVersion> = V extends "2026-01-21" ? CommitCvmProvisionV20260121 : CommitCvmProvisionV20260522;
|
|
54
|
+
/**
|
|
55
|
+
* Maps API version to the check CVM is-allowed response type
|
|
56
|
+
*/
|
|
57
|
+
export type CheckCvmIsAllowedResponse<V extends ApiVersion> = V extends "2026-01-21" ? IsAllowedResultV20260121 : IsAllowedResultV20260522;
|
|
58
|
+
/**
|
|
59
|
+
* Maps API version to the app batch is-allowed response type
|
|
60
|
+
*/
|
|
61
|
+
export type CheckAppCvmsIsAllowedResponse<V extends ApiVersion> = V extends "2026-01-21" ? AppCvmsBatchIsAllowedResponseV20260121 : AppCvmsBatchIsAllowedResponseV20260522;
|
|
62
|
+
/**
|
|
63
|
+
* Maps API version to the device allowlist response type
|
|
64
|
+
*/
|
|
65
|
+
export type GetAppDeviceAllowlistResponse<V extends ApiVersion> = V extends "2026-01-21" ? DeviceAllowlistResponseV20260121 : DeviceAllowlistResponseV20260522;
|
|
66
|
+
/**
|
|
67
|
+
* Maps API version to the refresh CVM instance ID response type
|
|
68
|
+
*/
|
|
69
|
+
export type RefreshCvmInstanceIdResponse<V extends ApiVersion> = V extends "2026-01-21" ? InstanceIdRefreshResultV20260121 : InstanceIdRefreshResultV20260522;
|
|
70
|
+
/**
|
|
71
|
+
* Maps API version to the batch refresh CVM instance IDs response type
|
|
72
|
+
* Note: defined as RefreshCvmInstanceIdsVersionedResponse to avoid conflict with the
|
|
73
|
+
* concrete exported type RefreshCvmInstanceIdsResponse from the action module.
|
|
74
|
+
*/
|
|
75
|
+
export type RefreshCvmInstanceIdsVersionedResponse<V extends ApiVersion> = V extends "2026-01-21" ? RefreshCvmInstanceIdsResponseV20260121 : RefreshCvmInstanceIdsResponseV20260522;
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -71,6 +71,9 @@ export declare class PhalaCloudError extends Error {
|
|
|
71
71
|
type?: string;
|
|
72
72
|
ctx?: Record<string, unknown>;
|
|
73
73
|
}>;
|
|
74
|
+
readonly requestId?: string;
|
|
75
|
+
/** Machine-readable error code (e.g. "TIMEOUT", HTTP status as string). */
|
|
76
|
+
readonly code?: string;
|
|
74
77
|
constructor(message: string, data: {
|
|
75
78
|
status: number;
|
|
76
79
|
statusText: string;
|
|
@@ -79,6 +82,8 @@ export declare class PhalaCloudError extends Error {
|
|
|
79
82
|
type?: string;
|
|
80
83
|
ctx?: Record<string, unknown>;
|
|
81
84
|
}>;
|
|
85
|
+
requestId?: string;
|
|
86
|
+
code?: string;
|
|
82
87
|
});
|
|
83
88
|
}
|
|
84
89
|
/**
|
|
@@ -91,7 +96,6 @@ export declare class RequestError extends PhalaCloudError implements ApiError {
|
|
|
91
96
|
readonly data?: unknown;
|
|
92
97
|
readonly request?: FetchRequest | undefined;
|
|
93
98
|
readonly response?: Response | undefined;
|
|
94
|
-
readonly code?: string | undefined;
|
|
95
99
|
readonly type?: string | undefined;
|
|
96
100
|
constructor(message: string, options?: {
|
|
97
101
|
status?: number | undefined;
|
|
@@ -110,6 +114,7 @@ export declare class RequestError extends PhalaCloudError implements ApiError {
|
|
|
110
114
|
}>;
|
|
111
115
|
code?: string | undefined;
|
|
112
116
|
type?: string | undefined;
|
|
117
|
+
requestId?: string | undefined;
|
|
113
118
|
});
|
|
114
119
|
/**
|
|
115
120
|
* Create RequestError from FetchError
|
|
@@ -303,6 +308,7 @@ export interface ErrorLink {
|
|
|
303
308
|
export interface StructuredErrorResponse {
|
|
304
309
|
error_code: string;
|
|
305
310
|
message: string;
|
|
311
|
+
request_id?: string;
|
|
306
312
|
details?: StructuredErrorDetail[];
|
|
307
313
|
suggestions?: string[];
|
|
308
314
|
links?: ErrorLink[];
|
|
@@ -331,6 +337,7 @@ export declare class ResourceError extends BusinessError {
|
|
|
331
337
|
input?: unknown;
|
|
332
338
|
[key: string]: unknown;
|
|
333
339
|
}>;
|
|
340
|
+
requestId?: string;
|
|
334
341
|
errorCode?: string;
|
|
335
342
|
structuredDetails?: StructuredErrorDetail[];
|
|
336
343
|
suggestions?: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phala/cloud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "TypeScript SDK for Phala Cloud API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"author": "Leechael Yim",
|
|
44
44
|
"license": "Apache-2.0",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@phala/dstack-sdk": "0.5.
|
|
46
|
+
"@phala/dstack-sdk": "0.5.8",
|
|
47
47
|
"debug": "^4.4.1",
|
|
48
48
|
"mitt": "^3.0.1",
|
|
49
49
|
"ofetch": "^1.3.3",
|