@phala/cloud 0.4.0 → 0.5.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 (110) hide show
  1. package/README.md +20 -0
  2. package/dist/actions/api_tokens/revoke_current_api_token.d.ts +47 -0
  3. package/dist/actions/apps/app_launch_token.d.ts +121 -0
  4. package/dist/actions/apps/check_app_cvms_is_allowed.d.ts +17 -311
  5. package/dist/actions/apps/check_app_is_allowed.d.ts +20 -32
  6. package/dist/actions/apps/create_app_instance.d.ts +43 -63
  7. package/dist/actions/apps/get_app_attestation.d.ts +113 -779
  8. package/dist/actions/apps/get_app_cvms.d.ts +1 -5
  9. package/dist/actions/apps/get_app_device_allowlist.d.ts +26 -272
  10. package/dist/actions/apps/get_app_filter_options.d.ts +8 -24
  11. package/dist/actions/apps/get_app_info.d.ts +1 -5
  12. package/dist/actions/apps/get_app_list.d.ts +2 -26
  13. package/dist/actions/apps/get_app_revision_detail.d.ts +1 -9
  14. package/dist/actions/apps/get_app_revisions.d.ts +1 -9
  15. package/dist/actions/blockchains/add_compose_hash.d.ts +1 -13
  16. package/dist/actions/blockchains/add_device.d.ts +1 -13
  17. package/dist/actions/blockchains/deploy_app_auth.d.ts +3 -95
  18. package/dist/actions/blockchains/get_allowed_devices.d.ts +2 -12
  19. package/dist/actions/blockchains/remove_device.d.ts +1 -13
  20. package/dist/actions/blockchains/set_allow_any_device.d.ts +1 -13
  21. package/dist/actions/cvms/check_cvm_is_allowed.d.ts +13 -138
  22. package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +9 -45
  23. package/dist/actions/cvms/commit_cvm_provision.d.ts +32 -422
  24. package/dist/actions/cvms/commit_cvm_update.d.ts +70 -41
  25. package/dist/actions/cvms/confirm_cvm_patch.d.ts +62 -35
  26. package/dist/actions/cvms/cvm_annotations.d.ts +152 -0
  27. package/dist/actions/cvms/delete_cvm.d.ts +8 -14
  28. package/dist/actions/cvms/get_available_os_images.d.ts +70 -111
  29. package/dist/actions/cvms/get_cvm_attestation.d.ts +34 -392
  30. package/dist/actions/cvms/get_cvm_compose_file.d.ts +384 -614
  31. package/dist/actions/cvms/get_cvm_containers_stats.d.ts +25 -91
  32. package/dist/actions/cvms/get_cvm_docker_compose.d.ts +8 -14
  33. package/dist/actions/cvms/get_cvm_info.d.ts +6 -12
  34. package/dist/actions/cvms/get_cvm_init_scripts.d.ts +87 -0
  35. package/dist/actions/cvms/get_cvm_list.d.ts +7 -13
  36. package/dist/actions/cvms/get_cvm_network.d.ts +18 -50
  37. package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +8 -14
  38. package/dist/actions/cvms/get_cvm_state.d.ts +11 -37
  39. package/dist/actions/cvms/get_cvm_stats.d.ts +23 -149
  40. package/dist/actions/cvms/get_cvm_status_batch.d.ts +19 -209
  41. package/dist/actions/cvms/get_cvm_user_config.d.ts +13 -24
  42. package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +9 -27
  43. package/dist/actions/cvms/patch_cvm.d.ts +658 -295
  44. package/dist/actions/cvms/provision_cvm.d.ts +326 -1561
  45. package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +550 -953
  46. package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +74 -131
  47. package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +77 -297
  48. package/dist/actions/cvms/replicate_cvm.d.ts +7 -21
  49. package/dist/actions/cvms/restart_cvm.d.ts +3 -18
  50. package/dist/actions/cvms/shutdown_cvm.d.ts +6 -12
  51. package/dist/actions/cvms/start_cvm.d.ts +6 -12
  52. package/dist/actions/cvms/stop_cvm.d.ts +6 -12
  53. package/dist/actions/cvms/update_cvm_envs.d.ts +136 -203
  54. package/dist/actions/cvms/update_cvm_resources.d.ts +82 -48
  55. package/dist/actions/cvms/update_cvm_visibility.d.ts +90 -132
  56. package/dist/actions/cvms/update_docker_compose.d.ts +127 -202
  57. package/dist/actions/cvms/update_os_image.d.ts +55 -28
  58. package/dist/actions/cvms/update_prelaunch_script.d.ts +127 -202
  59. package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +118 -193
  60. package/dist/actions/cvms/watch_cvm_state.d.ts +5 -15
  61. package/dist/actions/get_available_nodes.d.ts +186 -1067
  62. package/dist/actions/get_cvm_create_resources.d.ts +138 -2489
  63. package/dist/actions/index.d.ts +8 -2
  64. package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +11 -23
  65. package/dist/actions/kms/get_kms_contract.d.ts +25 -27
  66. package/dist/actions/kms/get_kms_info.d.ts +3 -7
  67. package/dist/actions/kms/get_kms_list.d.ts +34 -88
  68. package/dist/actions/kms/get_kms_onchain_detail.d.ts +66 -664
  69. package/dist/actions/kms/list_kms_contract_nodes.d.ts +21 -53
  70. package/dist/actions/kms/list_kms_contracts.d.ts +33 -87
  71. package/dist/actions/kms/next_app_ids.d.ts +5 -25
  72. package/dist/actions/list-instance-types.d.ts +77 -257
  73. package/dist/actions/os_images/get_os_images.d.ts +38 -152
  74. package/dist/actions/ssh_keys/create_ssh_key.d.ts +11 -17
  75. package/dist/actions/ssh_keys/delete_ssh_key.d.ts +3 -7
  76. package/dist/actions/ssh_keys/get_cvm_ssh_keys.d.ts +113 -0
  77. package/dist/actions/ssh_keys/import_github_profile.d.ts +7 -21
  78. package/dist/actions/ssh_keys/list_ssh_keys.d.ts +2 -50
  79. package/dist/actions/ssh_keys/sync_github_ssh_keys.d.ts +8 -20
  80. package/dist/actions/ssh_keys/update_cvm_ssh_keys.d.ts +140 -0
  81. package/dist/actions/workspaces/get_workspace.d.ts +32 -28
  82. package/dist/actions/workspaces/get_workspace_nodes.d.ts +34 -321
  83. package/dist/actions/workspaces/get_workspace_quotas.d.ts +107 -1021
  84. package/dist/actions/workspaces/list_workspaces.d.ts +67 -369
  85. package/dist/client.d.ts +23 -4
  86. package/dist/create-client.d.ts +1772 -1
  87. package/dist/credentials/current_user_v20251028.d.ts +1 -17
  88. package/dist/credentials/current_user_v20260121.d.ts +22 -227
  89. package/dist/index.d.ts +0 -1
  90. package/dist/index.js +5010 -4265
  91. package/dist/index.mjs +4892 -4192
  92. package/dist/types/app_compose.d.ts +108 -221
  93. package/dist/types/app_info_v20251028.d.ts +22 -1067
  94. package/dist/types/app_info_v20260121.d.ts +430 -8900
  95. package/dist/types/app_revision.d.ts +15 -371
  96. package/dist/types/client.d.ts +16 -0
  97. package/dist/types/common.d.ts +6 -0
  98. package/dist/types/cvm_id.d.ts +12 -57
  99. package/dist/types/cvm_info.d.ts +33 -460
  100. package/dist/types/cvm_info_v20251028.d.ts +99 -820
  101. package/dist/types/cvm_info_v20260121.d.ts +247 -3160
  102. package/dist/types/kms_contract.d.ts +2 -32
  103. package/dist/types/kms_info.d.ts +34 -68
  104. package/dist/utils/define-action.d.ts +4 -4
  105. package/dist/utils/errors.d.ts +4 -36
  106. package/dist/utils/get_compose_hash.d.ts +36 -5
  107. package/dist/utils/get_mr_config_id.d.ts +94 -3
  108. package/dist/utils/index.d.ts +1 -1
  109. package/dist/utils/placement-request.d.ts +3 -0
  110. package/package.json +4 -4
@@ -2,7 +2,20 @@ import { z } from "zod";
2
2
  /**
3
3
  * Update CVM visibility settings
4
4
  *
5
- * This action updates whether system info and logs are publicly accessible.
5
+ * This action updates whether system info, logs and TCB info are publicly
6
+ * accessible. It sends the flags to the unified `PATCH /cvms/{cvmId}` endpoint
7
+ * and returns the accepted update (202) or `status: "no_change"` when the flags
8
+ * already match.
9
+ *
10
+ * Visibility flags are part of the compose hash. For a CVM on contract-owned
11
+ * KMS the request fails with HTTP 465 until the new compose hash is registered
12
+ * on-chain; register it and call this action again, or use `patchCvm` and
13
+ * `confirmCvmPatch` for the two-phase flow.
14
+ *
15
+ * On a 465 the compose hash to register is in `error.detail.details` (the entry
16
+ * with field `compose_hash`). Register it on-chain, then call this action
17
+ * again. Alternatively use `patchCvm`, which parses the 465 payload for you and
18
+ * supports `prepareOnly`.
6
19
  *
7
20
  * @example
8
21
  * ```typescript
@@ -14,158 +27,103 @@ import { z } from "zod";
14
27
  * public_sysinfo: true,
15
28
  * public_logs: false
16
29
  * });
17
- * console.log(result.public_sysinfo, result.public_logs);
30
+ * console.log(result.status, result.correlation_id);
18
31
  * ```
19
32
  */
20
- export declare const UpdateCvmVisibilityRequestSchema: z.ZodEffects<z.ZodObject<{
33
+ export declare const UpdateCvmVisibilityRequestSchema: z.ZodObject<{
21
34
  id: z.ZodOptional<z.ZodString>;
22
35
  uuid: z.ZodOptional<z.ZodString>;
23
36
  app_id: z.ZodOptional<z.ZodString>;
24
37
  instance_id: z.ZodOptional<z.ZodString>;
25
- name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
26
- } & {
38
+ name: z.ZodOptional<z.ZodString>;
27
39
  public_sysinfo: z.ZodBoolean;
28
40
  public_logs: z.ZodBoolean;
29
41
  public_tcbinfo: z.ZodOptional<z.ZodBoolean>;
30
- }, "strip", z.ZodTypeAny, {
31
- public_sysinfo: boolean;
32
- public_logs: boolean;
33
- name?: string | undefined;
34
- id?: string | undefined;
35
- uuid?: string | undefined;
36
- app_id?: string | undefined;
37
- instance_id?: string | undefined;
38
- public_tcbinfo?: boolean | undefined;
39
- }, {
40
- public_sysinfo: boolean;
41
- public_logs: boolean;
42
- name?: string | undefined;
43
- id?: string | undefined;
44
- uuid?: string | undefined;
45
- app_id?: string | undefined;
46
- instance_id?: string | undefined;
47
- public_tcbinfo?: boolean | undefined;
48
- }>, any, any>;
42
+ }, z.core.$strip>;
49
43
  export type UpdateCvmVisibilityRequest = z.infer<typeof UpdateCvmVisibilityRequestSchema>;
44
+ export declare const UpdateCvmVisibilityResponseSchema: z.ZodObject<{
45
+ message: z.ZodString;
46
+ correlation_id: z.ZodString;
47
+ status: z.ZodString;
48
+ }, z.core.$strip>;
49
+ export type UpdateCvmVisibilityResponse = z.infer<typeof UpdateCvmVisibilityResponseSchema>;
50
50
  declare const updateCvmVisibility: {
51
- (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any): Promise<{
52
- status: string;
53
- name: string;
54
- id: string | number;
55
- app_id: string;
56
- instance_id: string | null;
57
- teepod_id: number | null;
58
- vm_uuid: string | null;
59
- base_image: string | null;
60
- vcpu: number;
61
- memory: number;
62
- disk_size: number;
63
- encrypted_env_pubkey: string | null;
64
- listed: boolean;
65
- in_progress: boolean;
66
- public_urls: {
67
- app: string;
68
- instance: string;
69
- }[];
51
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
70
52
  public_sysinfo: boolean;
71
53
  public_logs: boolean;
72
- teepod?: {
73
- name: string;
74
- id: number;
75
- region_identifier?: string | null | undefined;
76
- } | null | undefined;
77
- deployer_address?: string | null | undefined;
78
- contract_address?: string | null | undefined;
79
- dapp_dashboard_url?: string | null | undefined;
80
- syslog_endpoint?: string | null | undefined;
81
- project_id?: string | null | undefined;
82
- project_type?: string | null | undefined;
83
- kms_info?: z.objectOutputType<{
84
- id: z.ZodString;
85
- slug: z.ZodNullable<z.ZodString>;
86
- url: z.ZodString;
87
- version: z.ZodString;
88
- chain_id: z.ZodNullable<z.ZodNumber>;
89
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
90
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
91
- k256_pubkey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
- }, z.ZodTypeAny, "passthrough"> | null | undefined;
93
- gateway_domain?: string | null | undefined;
94
- machine_info?: {
95
- vcpu: number;
96
- memory: number;
97
- disk_size: number;
98
- gpu_count: number;
99
- } | null | undefined;
100
- updated_at?: string | null | undefined;
101
- instance_type?: string | null | undefined;
102
- scheduled_delete_at?: string | null | undefined;
54
+ id?: string | undefined;
55
+ uuid?: string | undefined;
56
+ app_id?: string | undefined;
57
+ instance_id?: string | undefined;
58
+ name?: string | undefined;
59
+ public_tcbinfo?: boolean | undefined;
60
+ }): Promise<{
61
+ message: string;
62
+ correlation_id: string;
63
+ status: string;
103
64
  }>;
104
- <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
65
+ <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
66
+ public_sysinfo: boolean;
67
+ public_logs: boolean;
68
+ id?: string | undefined;
69
+ uuid?: string | undefined;
70
+ app_id?: string | undefined;
71
+ instance_id?: string | undefined;
72
+ name?: string | undefined;
73
+ public_tcbinfo?: boolean | undefined;
74
+ }, parameters: {
105
75
  schema: T;
106
- } | undefined): Promise<z.TypeOf<T>>;
107
- (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
76
+ }): Promise<z.core.output<T>>;
77
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
78
+ public_sysinfo: boolean;
79
+ public_logs: boolean;
80
+ id?: string | undefined;
81
+ uuid?: string | undefined;
82
+ app_id?: string | undefined;
83
+ instance_id?: string | undefined;
84
+ name?: string | undefined;
85
+ public_tcbinfo?: boolean | undefined;
86
+ }, parameters: {
108
87
  schema: false;
109
- } | undefined): Promise<unknown>;
88
+ }): Promise<unknown>;
110
89
  }, safeUpdateCvmVisibility: {
111
- (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any): Promise<import("../..").SafeResult<{
112
- status: string;
113
- name: string;
114
- id: string | number;
115
- app_id: string;
116
- instance_id: string | null;
117
- teepod_id: number | null;
118
- vm_uuid: string | null;
119
- base_image: string | null;
120
- vcpu: number;
121
- memory: number;
122
- disk_size: number;
123
- encrypted_env_pubkey: string | null;
124
- listed: boolean;
125
- in_progress: boolean;
126
- public_urls: {
127
- app: string;
128
- instance: string;
129
- }[];
90
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
130
91
  public_sysinfo: boolean;
131
92
  public_logs: boolean;
132
- teepod?: {
133
- name: string;
134
- id: number;
135
- region_identifier?: string | null | undefined;
136
- } | null | undefined;
137
- deployer_address?: string | null | undefined;
138
- contract_address?: string | null | undefined;
139
- dapp_dashboard_url?: string | null | undefined;
140
- syslog_endpoint?: string | null | undefined;
141
- project_id?: string | null | undefined;
142
- project_type?: string | null | undefined;
143
- kms_info?: z.objectOutputType<{
144
- id: z.ZodString;
145
- slug: z.ZodNullable<z.ZodString>;
146
- url: z.ZodString;
147
- version: z.ZodString;
148
- chain_id: z.ZodNullable<z.ZodNumber>;
149
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
150
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
151
- k256_pubkey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
152
- }, z.ZodTypeAny, "passthrough"> | null | undefined;
153
- gateway_domain?: string | null | undefined;
154
- machine_info?: {
155
- vcpu: number;
156
- memory: number;
157
- disk_size: number;
158
- gpu_count: number;
159
- } | null | undefined;
160
- updated_at?: string | null | undefined;
161
- instance_type?: string | null | undefined;
162
- scheduled_delete_at?: string | null | undefined;
93
+ id?: string | undefined;
94
+ uuid?: string | undefined;
95
+ app_id?: string | undefined;
96
+ instance_id?: string | undefined;
97
+ name?: string | undefined;
98
+ public_tcbinfo?: boolean | undefined;
99
+ }): Promise<import("../..").SafeResult<{
100
+ message: string;
101
+ correlation_id: string;
102
+ status: string;
163
103
  }>>;
164
- <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
104
+ <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
105
+ public_sysinfo: boolean;
106
+ public_logs: boolean;
107
+ id?: string | undefined;
108
+ uuid?: string | undefined;
109
+ app_id?: string | undefined;
110
+ instance_id?: string | undefined;
111
+ name?: string | undefined;
112
+ public_tcbinfo?: boolean | undefined;
113
+ }, parameters: {
165
114
  schema: T;
166
- } | undefined): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
167
- (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
115
+ }): Promise<import("../..").SafeResult<z.core.output<T>>>;
116
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
117
+ public_sysinfo: boolean;
118
+ public_logs: boolean;
119
+ id?: string | undefined;
120
+ uuid?: string | undefined;
121
+ app_id?: string | undefined;
122
+ instance_id?: string | undefined;
123
+ name?: string | undefined;
124
+ public_tcbinfo?: boolean | undefined;
125
+ }, parameters: {
168
126
  schema: false;
169
- } | undefined): Promise<import("../..").SafeResult<unknown>>;
127
+ }): Promise<import("../..").SafeResult<unknown>>;
170
128
  };
171
129
  export { updateCvmVisibility, safeUpdateCvmVisibility };