@phala/cloud 0.3.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 (112) 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 +116 -772
  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 -416
  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 +426 -512
  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 +9 -17
  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 +97 -64
  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 +666 -287
  44. package/dist/actions/cvms/provision_cvm.d.ts +339 -725
  45. package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +584 -777
  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 +144 -195
  54. package/dist/actions/cvms/update_cvm_resources.d.ts +93 -37
  55. package/dist/actions/cvms/update_cvm_visibility.d.ts +90 -130
  56. package/dist/actions/cvms/update_docker_compose.d.ts +143 -187
  57. package/dist/actions/cvms/update_os_image.d.ts +55 -28
  58. package/dist/actions/cvms/update_prelaunch_script.d.ts +143 -187
  59. package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +126 -185
  60. package/dist/actions/cvms/watch_cvm_state.d.ts +5 -15
  61. package/dist/actions/get_available_nodes.d.ts +201 -823
  62. package/dist/actions/get_cvm_create_resources.d.ts +150 -2150
  63. package/dist/actions/index.d.ts +14 -4
  64. package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +11 -23
  65. package/dist/actions/kms/get_kms_contract.d.ts +57 -0
  66. package/dist/actions/kms/get_kms_info.d.ts +3 -7
  67. package/dist/actions/kms/get_kms_list.d.ts +43 -82
  68. package/dist/actions/kms/get_kms_onchain_detail.d.ts +72 -616
  69. package/dist/actions/kms/list_kms_contract_nodes.d.ts +66 -0
  70. package/dist/actions/kms/list_kms_contracts.d.ts +98 -0
  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 -24
  82. package/dist/actions/workspaces/get_workspace_nodes.d.ts +56 -182
  83. package/dist/actions/workspaces/get_workspace_quotas.d.ts +107 -1021
  84. package/dist/actions/workspaces/list_workspaces.d.ts +69 -245
  85. package/dist/client.d.ts +27 -5
  86. package/dist/create-client.d.ts +1820 -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 +1 -2
  90. package/dist/index.js +5454 -4389
  91. package/dist/index.mjs +5396 -4395
  92. package/dist/types/app_compose.d.ts +116 -184
  93. package/dist/types/app_info_v20251028.d.ts +29 -1030
  94. package/dist/types/app_info_v20260121.d.ts +686 -6832
  95. package/dist/types/app_revision.d.ts +15 -371
  96. package/dist/types/client.d.ts +18 -2
  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 +102 -800
  101. package/dist/types/cvm_info_v20260121.d.ts +411 -2347
  102. package/dist/types/kms_contract.d.ts +34 -0
  103. package/dist/types/kms_info.d.ts +34 -60
  104. package/dist/types/version-mappings.d.ts +6 -6
  105. package/dist/utils/define-action.d.ts +4 -4
  106. package/dist/utils/error_codes.d.ts +1 -0
  107. package/dist/utils/errors.d.ts +34 -37
  108. package/dist/utils/get_compose_hash.d.ts +59 -4
  109. package/dist/utils/get_mr_config_id.d.ts +146 -0
  110. package/dist/utils/index.d.ts +3 -2
  111. package/dist/utils/placement-request.d.ts +3 -0
  112. package/package.json +4 -4
@@ -1,23 +1,11 @@
1
1
  import { z } from "zod";
2
- export declare const CheckAppIsAllowedRequestSchema: z.ZodObject<{
2
+ export declare const CheckAppIsAllowedRequestSchema: z.ZodPipe<z.ZodUnknown, z.ZodObject<{
3
3
  appId: z.ZodString;
4
4
  compose_hash: z.ZodString;
5
- node_id: z.ZodOptional<z.ZodNumber>;
5
+ node: z.ZodOptional<z.ZodString>;
6
6
  device_id: z.ZodOptional<z.ZodString>;
7
7
  chain_id: z.ZodOptional<z.ZodNumber>;
8
- }, "strip", z.ZodTypeAny, {
9
- compose_hash: string;
10
- appId: string;
11
- device_id?: string | undefined;
12
- node_id?: number | undefined;
13
- chain_id?: number | undefined;
14
- }, {
15
- compose_hash: string;
16
- appId: string;
17
- device_id?: string | undefined;
18
- node_id?: number | undefined;
19
- chain_id?: number | undefined;
20
- }>;
8
+ }, z.core.$strip>>;
21
9
  export type CheckAppIsAllowedRequest = z.infer<typeof CheckAppIsAllowedRequestSchema>;
22
10
  /**
23
11
  * Check if a deployment is allowed by an on-chain DStack App contract.
@@ -28,17 +16,17 @@ export type CheckAppIsAllowedRequest = z.infer<typeof CheckAppIsAllowedRequestSc
28
16
  * @param request - Request parameters
29
17
  * @param request.appId - App contract address
30
18
  * @param request.compose_hash - Compose hash to check
31
- * @param request.node_id - Node ID (resolves device_id from DB)
19
+ * @param request.node - Physical node name (resolves device_id from DB)
32
20
  * @param request.device_id - Device ID (hex, direct)
33
21
  * @param request.chain_id - Chain ID for RPC URL resolution
34
22
  * @returns On-chain allowance check result
35
23
  */
36
24
  declare const checkAppIsAllowed: {
37
25
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
38
- compose_hash: string;
39
26
  appId: string;
27
+ compose_hash: string;
28
+ node?: string | undefined;
40
29
  device_id?: string | undefined;
41
- node_id?: number | undefined;
42
30
  chain_id?: number | undefined;
43
31
  }): Promise<{
44
32
  app_contract_address: string;
@@ -47,34 +35,34 @@ declare const checkAppIsAllowed: {
47
35
  compose_hash_allowed: boolean;
48
36
  allow_any_device: boolean;
49
37
  is_allowed: boolean;
50
- error?: string | null | undefined;
51
38
  device_id_allowed?: boolean | null | undefined;
39
+ error?: string | null | undefined;
52
40
  cvm_id?: string | undefined;
53
41
  }>;
54
42
  <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
55
- compose_hash: string;
56
43
  appId: string;
44
+ compose_hash: string;
45
+ node?: string | undefined;
57
46
  device_id?: string | undefined;
58
- node_id?: number | undefined;
59
47
  chain_id?: number | undefined;
60
48
  }, parameters: {
61
49
  schema: T;
62
- }): Promise<z.TypeOf<T>>;
50
+ }): Promise<z.core.output<T>>;
63
51
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
64
- compose_hash: string;
65
52
  appId: string;
53
+ compose_hash: string;
54
+ node?: string | undefined;
66
55
  device_id?: string | undefined;
67
- node_id?: number | undefined;
68
56
  chain_id?: number | undefined;
69
57
  }, parameters: {
70
58
  schema: false;
71
59
  }): Promise<unknown>;
72
60
  }, safeCheckAppIsAllowed: {
73
61
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
74
- compose_hash: string;
75
62
  appId: string;
63
+ compose_hash: string;
64
+ node?: string | undefined;
76
65
  device_id?: string | undefined;
77
- node_id?: number | undefined;
78
66
  chain_id?: number | undefined;
79
67
  }): Promise<import("../..").SafeResult<{
80
68
  app_contract_address: string;
@@ -83,24 +71,24 @@ declare const checkAppIsAllowed: {
83
71
  compose_hash_allowed: boolean;
84
72
  allow_any_device: boolean;
85
73
  is_allowed: boolean;
86
- error?: string | null | undefined;
87
74
  device_id_allowed?: boolean | null | undefined;
75
+ error?: string | null | undefined;
88
76
  cvm_id?: string | undefined;
89
77
  }>>;
90
78
  <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
91
- compose_hash: string;
92
79
  appId: string;
80
+ compose_hash: string;
81
+ node?: string | undefined;
93
82
  device_id?: string | undefined;
94
- node_id?: number | undefined;
95
83
  chain_id?: number | undefined;
96
84
  }, parameters: {
97
85
  schema: T;
98
- }): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
86
+ }): Promise<import("../..").SafeResult<z.core.output<T>>>;
99
87
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
100
- compose_hash: string;
101
88
  appId: string;
89
+ compose_hash: string;
90
+ node?: string | undefined;
102
91
  device_id?: string | undefined;
103
- node_id?: number | undefined;
104
92
  chain_id?: number | undefined;
105
93
  }, parameters: {
106
94
  schema: false;
@@ -17,14 +17,14 @@ import { z } from "zod";
17
17
  * // Create instance with existing compose
18
18
  * const instance = await createAppInstance(client, {
19
19
  * appId: '50b0e827cc6c53f4010b57e588a18c5ef9388cc1',
20
- * node_id: 5,
20
+ * node: 'usw5',
21
21
  * });
22
22
  *
23
23
  * // Create instance with new Docker Compose
24
24
  * const instance2 = await createAppInstance(client, {
25
25
  * appId: '50b0e827cc6c53f4010b57e588a18c5ef9388cc1',
26
26
  * docker_compose_file: 'services:\n app:\n image: nginx',
27
- * node_id: 5,
27
+ * node: 'usw5',
28
28
  * });
29
29
  * ```
30
30
  *
@@ -41,71 +41,51 @@ import { z } from "zod";
41
41
  * }
42
42
  * ```
43
43
  */
44
- export declare const CreateAppInstanceRequestSchema: z.ZodObject<{
44
+ export declare const CreateAppInstanceRequestSchema: z.ZodPipe<z.ZodUnknown, z.ZodObject<{
45
45
  appId: z.ZodString;
46
46
  name: z.ZodOptional<z.ZodString>;
47
- node_id: z.ZodOptional<z.ZodNumber>;
47
+ node: z.ZodOptional<z.ZodString>;
48
48
  docker_compose_file: z.ZodOptional<z.ZodString>;
49
49
  pre_launch_script: z.ZodOptional<z.ZodString>;
50
50
  encrypted_env: z.ZodOptional<z.ZodString>;
51
51
  compose_hash: z.ZodOptional<z.ZodString>;
52
52
  token: z.ZodOptional<z.ZodString>;
53
53
  transaction_hash: z.ZodOptional<z.ZodString>;
54
- }, "strict", z.ZodTypeAny, {
55
- appId: string;
56
- name?: string | undefined;
57
- compose_hash?: string | undefined;
58
- node_id?: number | undefined;
59
- docker_compose_file?: string | undefined;
60
- encrypted_env?: string | undefined;
61
- pre_launch_script?: string | undefined;
62
- transaction_hash?: string | undefined;
63
- token?: string | undefined;
64
- }, {
65
- appId: string;
66
- name?: string | undefined;
67
- compose_hash?: string | undefined;
68
- node_id?: number | undefined;
69
- docker_compose_file?: string | undefined;
70
- encrypted_env?: string | undefined;
71
- pre_launch_script?: string | undefined;
72
- transaction_hash?: string | undefined;
73
- token?: string | undefined;
74
- }>;
54
+ }, z.core.$strict>>;
75
55
  export type CreateAppInstanceRequest = z.infer<typeof CreateAppInstanceRequestSchema>;
76
56
  declare const createAppInstance: {
77
57
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
78
58
  appId: string;
79
59
  name?: string | undefined;
80
- compose_hash?: string | undefined;
81
- node_id?: number | undefined;
60
+ node?: string | undefined;
82
61
  docker_compose_file?: string | undefined;
83
- encrypted_env?: string | undefined;
84
62
  pre_launch_script?: string | undefined;
85
- transaction_hash?: string | undefined;
63
+ encrypted_env?: string | undefined;
64
+ compose_hash?: string | undefined;
86
65
  token?: string | undefined;
66
+ transaction_hash?: string | undefined;
87
67
  }): Promise<{
88
- status: string;
89
68
  name: string;
90
- id: string;
91
- app_id: string;
92
- instance_id: string | null;
69
+ status: string;
93
70
  teepod_id: number;
71
+ app_id: string;
94
72
  vm_uuid: string | null;
73
+ instance_id: string | null;
95
74
  vcpu: number;
96
75
  memory: number;
97
76
  disk_size: number;
98
77
  created_at: string;
99
78
  encrypted_env_pubkey: string | null;
100
- version?: string | null | undefined;
79
+ id: string;
101
80
  teepod?: {
102
- name: string;
103
81
  id: number;
82
+ name: string;
104
83
  region_identifier?: string | null | undefined;
105
84
  } | null | undefined;
106
85
  app_url?: string | null | undefined;
107
86
  base_image?: string | null | undefined;
108
87
  manifest_version?: number | null | undefined;
88
+ version?: string | null | undefined;
109
89
  runner?: string | null | undefined;
110
90
  docker_compose_file?: string | null | undefined;
111
91
  features?: string[] | null | undefined;
@@ -114,26 +94,26 @@ declare const createAppInstance: {
114
94
  <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
115
95
  appId: string;
116
96
  name?: string | undefined;
117
- compose_hash?: string | undefined;
118
- node_id?: number | undefined;
97
+ node?: string | undefined;
119
98
  docker_compose_file?: string | undefined;
120
- encrypted_env?: string | undefined;
121
99
  pre_launch_script?: string | undefined;
122
- transaction_hash?: string | undefined;
100
+ encrypted_env?: string | undefined;
101
+ compose_hash?: string | undefined;
123
102
  token?: string | undefined;
103
+ transaction_hash?: string | undefined;
124
104
  }, parameters: {
125
105
  schema: T;
126
- }): Promise<z.TypeOf<T>>;
106
+ }): Promise<z.core.output<T>>;
127
107
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
128
108
  appId: string;
129
109
  name?: string | undefined;
130
- compose_hash?: string | undefined;
131
- node_id?: number | undefined;
110
+ node?: string | undefined;
132
111
  docker_compose_file?: string | undefined;
133
- encrypted_env?: string | undefined;
134
112
  pre_launch_script?: string | undefined;
135
- transaction_hash?: string | undefined;
113
+ encrypted_env?: string | undefined;
114
+ compose_hash?: string | undefined;
136
115
  token?: string | undefined;
116
+ transaction_hash?: string | undefined;
137
117
  }, parameters: {
138
118
  schema: false;
139
119
  }): Promise<unknown>;
@@ -141,35 +121,35 @@ declare const createAppInstance: {
141
121
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
142
122
  appId: string;
143
123
  name?: string | undefined;
144
- compose_hash?: string | undefined;
145
- node_id?: number | undefined;
124
+ node?: string | undefined;
146
125
  docker_compose_file?: string | undefined;
147
- encrypted_env?: string | undefined;
148
126
  pre_launch_script?: string | undefined;
149
- transaction_hash?: string | undefined;
127
+ encrypted_env?: string | undefined;
128
+ compose_hash?: string | undefined;
150
129
  token?: string | undefined;
130
+ transaction_hash?: string | undefined;
151
131
  }): Promise<import("../..").SafeResult<{
152
- status: string;
153
132
  name: string;
154
- id: string;
155
- app_id: string;
156
- instance_id: string | null;
133
+ status: string;
157
134
  teepod_id: number;
135
+ app_id: string;
158
136
  vm_uuid: string | null;
137
+ instance_id: string | null;
159
138
  vcpu: number;
160
139
  memory: number;
161
140
  disk_size: number;
162
141
  created_at: string;
163
142
  encrypted_env_pubkey: string | null;
164
- version?: string | null | undefined;
143
+ id: string;
165
144
  teepod?: {
166
- name: string;
167
145
  id: number;
146
+ name: string;
168
147
  region_identifier?: string | null | undefined;
169
148
  } | null | undefined;
170
149
  app_url?: string | null | undefined;
171
150
  base_image?: string | null | undefined;
172
151
  manifest_version?: number | null | undefined;
152
+ version?: string | null | undefined;
173
153
  runner?: string | null | undefined;
174
154
  docker_compose_file?: string | null | undefined;
175
155
  features?: string[] | null | undefined;
@@ -178,26 +158,26 @@ declare const createAppInstance: {
178
158
  <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
179
159
  appId: string;
180
160
  name?: string | undefined;
181
- compose_hash?: string | undefined;
182
- node_id?: number | undefined;
161
+ node?: string | undefined;
183
162
  docker_compose_file?: string | undefined;
184
- encrypted_env?: string | undefined;
185
163
  pre_launch_script?: string | undefined;
186
- transaction_hash?: string | undefined;
164
+ encrypted_env?: string | undefined;
165
+ compose_hash?: string | undefined;
187
166
  token?: string | undefined;
167
+ transaction_hash?: string | undefined;
188
168
  }, parameters: {
189
169
  schema: T;
190
- }): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
170
+ }): Promise<import("../..").SafeResult<z.core.output<T>>>;
191
171
  (client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
192
172
  appId: string;
193
173
  name?: string | undefined;
194
- compose_hash?: string | undefined;
195
- node_id?: number | undefined;
174
+ node?: string | undefined;
196
175
  docker_compose_file?: string | undefined;
197
- encrypted_env?: string | undefined;
198
176
  pre_launch_script?: string | undefined;
199
- transaction_hash?: string | undefined;
177
+ encrypted_env?: string | undefined;
178
+ compose_hash?: string | undefined;
200
179
  token?: string | undefined;
180
+ transaction_hash?: string | undefined;
201
181
  }, parameters: {
202
182
  schema: false;
203
183
  }): Promise<import("../..").SafeResult<unknown>>;