@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.
Files changed (70) hide show
  1. package/dist/actions/apps/check_app_cvms_is_allowed.d.ts +324 -75
  2. package/dist/actions/apps/check_app_is_allowed.d.ts +16 -16
  3. package/dist/actions/apps/create_app_instance.d.ts +33 -24
  4. package/dist/actions/apps/get_app_attestation.d.ts +82 -32
  5. package/dist/actions/apps/get_app_device_allowlist.d.ts +281 -11
  6. package/dist/actions/apps/get_app_filter_options.d.ts +2 -2
  7. package/dist/actions/apps/get_app_list.d.ts +2 -2
  8. package/dist/actions/cvms/check_cvm_is_allowed.d.ts +142 -74
  9. package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +12 -12
  10. package/dist/actions/cvms/commit_cvm_provision.d.ts +424 -277
  11. package/dist/actions/cvms/commit_cvm_update.d.ts +2 -2
  12. package/dist/actions/cvms/confirm_cvm_patch.d.ts +2 -2
  13. package/dist/actions/cvms/delete_cvm.d.ts +2 -2
  14. package/dist/actions/cvms/get_available_os_images.d.ts +2 -2
  15. package/dist/actions/cvms/get_cvm_attestation.d.ts +2 -2
  16. package/dist/actions/cvms/get_cvm_compose_file.d.ts +338 -10
  17. package/dist/actions/cvms/get_cvm_containers_stats.d.ts +10 -10
  18. package/dist/actions/cvms/get_cvm_docker_compose.d.ts +2 -2
  19. package/dist/actions/cvms/get_cvm_info.d.ts +2 -2
  20. package/dist/actions/cvms/get_cvm_list.d.ts +4 -4
  21. package/dist/actions/cvms/get_cvm_network.d.ts +2 -2
  22. package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +2 -2
  23. package/dist/actions/cvms/get_cvm_state.d.ts +6 -6
  24. package/dist/actions/cvms/get_cvm_stats.d.ts +2 -2
  25. package/dist/actions/cvms/get_cvm_status_batch.d.ts +6 -6
  26. package/dist/actions/cvms/get_cvm_user_config.d.ts +2 -2
  27. package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +93 -0
  28. package/dist/actions/cvms/patch_cvm.d.ts +18 -18
  29. package/dist/actions/cvms/provision_cvm.d.ts +243 -225
  30. package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +254 -38
  31. package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +130 -43
  32. package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +294 -110
  33. package/dist/actions/cvms/replicate_cvm.d.ts +7 -72
  34. package/dist/actions/cvms/restart_cvm.d.ts +7 -72
  35. package/dist/actions/cvms/shutdown_cvm.d.ts +9 -72
  36. package/dist/actions/cvms/start_cvm.d.ts +7 -72
  37. package/dist/actions/cvms/stop_cvm.d.ts +7 -72
  38. package/dist/actions/cvms/update_cvm_envs.d.ts +20 -20
  39. package/dist/actions/cvms/update_cvm_resources.d.ts +2 -2
  40. package/dist/actions/cvms/update_cvm_visibility.d.ts +26 -26
  41. package/dist/actions/cvms/update_docker_compose.d.ts +20 -20
  42. package/dist/actions/cvms/update_os_image.d.ts +2 -2
  43. package/dist/actions/cvms/update_prelaunch_script.d.ts +20 -20
  44. package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +319 -0
  45. package/dist/actions/get_cvm_create_resources.d.ts +2412 -0
  46. package/dist/actions/index.d.ts +3 -0
  47. package/dist/actions/kms/get_kms_list.d.ts +10 -10
  48. package/dist/actions/kms/next_app_ids.d.ts +6 -6
  49. package/dist/actions/list-instance-types.d.ts +12 -12
  50. package/dist/actions/ssh_keys/create_ssh_key.d.ts +2 -2
  51. package/dist/actions/ssh_keys/list_ssh_keys.d.ts +4 -4
  52. package/dist/actions/workspaces/get_workspace.d.ts +2 -0
  53. package/dist/actions/workspaces/get_workspace_nodes.d.ts +14 -14
  54. package/dist/actions/workspaces/list_workspaces.d.ts +18 -0
  55. package/dist/client.d.ts +5 -2
  56. package/dist/create-client.d.ts +48 -0
  57. package/dist/index.js +1882 -1257
  58. package/dist/index.mjs +1850 -1255
  59. package/dist/types/app_compose.d.ts +125 -0
  60. package/dist/types/app_info_v20251028.d.ts +136 -259
  61. package/dist/types/app_info_v20260121.d.ts +4677 -345
  62. package/dist/types/app_revision.d.ts +8 -8
  63. package/dist/types/client.d.ts +2 -2
  64. package/dist/types/cvm_id.d.ts +6 -6
  65. package/dist/types/cvm_info.d.ts +536 -10
  66. package/dist/types/cvm_info_v20251028.d.ts +65 -65
  67. package/dist/types/cvm_info_v20260121.d.ts +1636 -85
  68. package/dist/types/version-mappings.d.ts +45 -8
  69. package/dist/utils/errors.d.ts +8 -1
  70. 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 { CvmInfoDetailV20260121, CvmInfoV20260121, PaginatedCvmInfosV20260121 } from "./cvm_info_v20260121";
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;
@@ -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.2.9",
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.7",
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",