@phala/cloud 0.0.12 → 0.1.1-beta.1

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 (84) hide show
  1. package/dist/actions/{add_compose_hash.d.ts → blockchains/add_compose_hash.d.ts} +6 -7
  2. package/dist/actions/{deploy_app_auth.d.ts → blockchains/deploy_app_auth.d.ts} +6 -7
  3. package/dist/actions/{commit_cvm_compose_file_update.d.ts → cvms/commit_cvm_compose_file_update.d.ts} +25 -13
  4. package/dist/actions/{commit_cvm_provision.d.ts → cvms/commit_cvm_provision.d.ts} +139 -13
  5. package/dist/actions/cvms/get_cvm_compose_file.d.ts +225 -0
  6. package/dist/actions/{get_cvm_info.d.ts → cvms/get_cvm_info.d.ts} +21 -12
  7. package/dist/actions/{get_cvm_list.d.ts → cvms/get_cvm_list.d.ts} +187 -39
  8. package/dist/actions/{provision_cvm.d.ts → cvms/provision_cvm.d.ts} +75 -20
  9. package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +768 -0
  10. package/dist/actions/get_available_nodes.d.ts +319 -7
  11. package/dist/actions/get_current_user.d.ts +35 -7
  12. package/dist/actions/index.d.ts +17 -18
  13. package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +66 -0
  14. package/dist/actions/kms/get_kms_info.d.ts +55 -0
  15. package/dist/actions/{get_kms_list.d.ts → kms/get_kms_list.d.ts} +44 -8
  16. package/dist/actions/list-instance-types.d.ts +69 -10
  17. package/dist/actions/workspaces/get_workspace.d.ts +33 -8
  18. package/dist/actions/workspaces/list_workspaces.d.ts +92 -7
  19. package/dist/chunk-O5QBIXBA.mjs +1128 -0
  20. package/dist/client.d.ts +16 -1
  21. package/dist/create-client.d.ts +311 -0
  22. package/dist/create-client.js +1143 -0
  23. package/dist/create-client.mjs +74 -0
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +504 -722
  26. package/dist/index.mjs +135 -1351
  27. package/dist/parse_dotenv.d.ts +0 -1
  28. package/dist/types/app_compose.d.ts +0 -1
  29. package/dist/types/client.d.ts +0 -1
  30. package/dist/types/common.d.ts +17 -4
  31. package/dist/types/cvm_info.d.ts +34 -35
  32. package/dist/types/index.d.ts +0 -1
  33. package/dist/types/kms_info.d.ts +0 -1
  34. package/dist/types/supported_chains.d.ts +0 -1
  35. package/dist/utils/as-hex.d.ts +0 -1
  36. package/dist/utils/client-factories.d.ts +0 -1
  37. package/dist/utils/define-action.d.ts +61 -0
  38. package/dist/utils/get_compose_hash.d.ts +0 -1
  39. package/dist/utils/get_error_message.d.ts +0 -1
  40. package/dist/utils/index.d.ts +0 -1
  41. package/dist/utils/network.d.ts +0 -1
  42. package/dist/utils/transaction.d.ts +0 -1
  43. package/dist/utils/validate-parameters.d.ts +5 -5
  44. package/package.json +70 -66
  45. package/dist/actions/add_compose_hash.d.ts.map +0 -1
  46. package/dist/actions/commit_cvm_compose_file_update.d.ts.map +0 -1
  47. package/dist/actions/commit_cvm_provision.d.ts.map +0 -1
  48. package/dist/actions/deploy_app_auth.d.ts.map +0 -1
  49. package/dist/actions/get_app_env_encrypt_pubkey.d.ts +0 -30
  50. package/dist/actions/get_app_env_encrypt_pubkey.d.ts.map +0 -1
  51. package/dist/actions/get_available_nodes.d.ts.map +0 -1
  52. package/dist/actions/get_current_user.d.ts.map +0 -1
  53. package/dist/actions/get_cvm_compose_file.d.ts +0 -122
  54. package/dist/actions/get_cvm_compose_file.d.ts.map +0 -1
  55. package/dist/actions/get_cvm_info.d.ts.map +0 -1
  56. package/dist/actions/get_cvm_list.d.ts.map +0 -1
  57. package/dist/actions/get_kms_info.d.ts +0 -34
  58. package/dist/actions/get_kms_info.d.ts.map +0 -1
  59. package/dist/actions/get_kms_list.d.ts.map +0 -1
  60. package/dist/actions/index.d.ts.map +0 -1
  61. package/dist/actions/list-instance-types.d.ts.map +0 -1
  62. package/dist/actions/provision_cvm.d.ts.map +0 -1
  63. package/dist/actions/provision_cvm_compose_file_update.d.ts +0 -413
  64. package/dist/actions/provision_cvm_compose_file_update.d.ts.map +0 -1
  65. package/dist/actions/workspaces/get_workspace.d.ts.map +0 -1
  66. package/dist/actions/workspaces/list_workspaces.d.ts.map +0 -1
  67. package/dist/client.d.ts.map +0 -1
  68. package/dist/index.d.ts.map +0 -1
  69. package/dist/parse_dotenv.d.ts.map +0 -1
  70. package/dist/types/app_compose.d.ts.map +0 -1
  71. package/dist/types/client.d.ts.map +0 -1
  72. package/dist/types/common.d.ts.map +0 -1
  73. package/dist/types/cvm_info.d.ts.map +0 -1
  74. package/dist/types/index.d.ts.map +0 -1
  75. package/dist/types/kms_info.d.ts.map +0 -1
  76. package/dist/types/supported_chains.d.ts.map +0 -1
  77. package/dist/utils/as-hex.d.ts.map +0 -1
  78. package/dist/utils/client-factories.d.ts.map +0 -1
  79. package/dist/utils/get_compose_hash.d.ts.map +0 -1
  80. package/dist/utils/get_error_message.d.ts.map +0 -1
  81. package/dist/utils/index.d.ts.map +0 -1
  82. package/dist/utils/network.d.ts.map +0 -1
  83. package/dist/utils/transaction.d.ts.map +0 -1
  84. package/dist/utils/validate-parameters.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { type Chain, type Address, type Hash, type Hex, type TransactionReceipt, type PublicClient, type WalletClient } from "viem";
3
- import { type TransactionTracker, type RetryOptions } from "../utils";
3
+ import { type TransactionTracker, type RetryOptions } from "../../utils";
4
4
  export type AddComposeHashRequest = {
5
5
  chain?: Chain;
6
6
  rpcUrl?: string;
@@ -38,15 +38,15 @@ export declare const AddComposeHashSchema: z.ZodObject<{
38
38
  gasUsed: z.ZodOptional<z.ZodBigInt>;
39
39
  }, z.ZodTypeAny, "passthrough">>;
40
40
  export type AddComposeHash = z.infer<typeof AddComposeHashSchema>;
41
- export type AddComposeHashParameters<T = undefined> = T extends z.ZodSchema ? {
41
+ export type AddComposeHashParameters<T = undefined> = T extends z.ZodTypeAny ? {
42
42
  schema: T;
43
43
  } : T extends false ? {
44
44
  schema: false;
45
45
  } : {
46
- schema?: z.ZodSchema | false;
46
+ schema?: z.ZodTypeAny | false;
47
47
  };
48
- export type AddComposeHashReturnType<T = undefined> = T extends z.ZodSchema ? z.infer<T> : T extends false ? unknown : AddComposeHash;
49
- export declare function addComposeHash<T extends z.ZodSchema | false | undefined = undefined>(request: AddComposeHashRequest, parameters?: AddComposeHashParameters<T>): Promise<AddComposeHashReturnType<T>>;
48
+ export type AddComposeHashReturnType<T = undefined> = T extends z.ZodTypeAny ? z.infer<T> : T extends false ? unknown : AddComposeHash;
49
+ export declare function addComposeHash<T extends z.ZodTypeAny | false | undefined = undefined>(request: AddComposeHashRequest, parameters?: AddComposeHashParameters<T>): Promise<AddComposeHashReturnType<T>>;
50
50
  export type SafeAddComposeHashResult<T = undefined> = {
51
51
  success: true;
52
52
  data: AddComposeHashReturnType<T>;
@@ -59,5 +59,4 @@ export type SafeAddComposeHashResult<T = undefined> = {
59
59
  detail: string;
60
60
  };
61
61
  };
62
- export declare function safeAddComposeHash<T extends z.ZodSchema | false | undefined = undefined>(request: AddComposeHashRequest, parameters?: AddComposeHashParameters<T>): Promise<SafeAddComposeHashResult<T>>;
63
- //# sourceMappingURL=add_compose_hash.d.ts.map
62
+ export declare function safeAddComposeHash<T extends z.ZodTypeAny | false | undefined = undefined>(request: AddComposeHashRequest, parameters?: AddComposeHashParameters<T>): Promise<SafeAddComposeHashResult<T>>;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { type Chain, type Address, type Hash, type Hex, type TransactionReceipt, type PublicClient, type WalletClient } from "viem";
3
- import { type TransactionTracker, type RetryOptions } from "../utils";
3
+ import { type TransactionTracker, type RetryOptions } from "../../utils";
4
4
  export declare const DeployAppAuthRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5
5
  chain: z.ZodOptional<z.ZodUnknown>;
6
6
  rpcUrl: z.ZodOptional<z.ZodString>;
@@ -136,15 +136,15 @@ export declare const DeployAppAuthSchema: z.ZodObject<{
136
136
  gasUsed: z.ZodOptional<z.ZodBigInt>;
137
137
  }, z.ZodTypeAny, "passthrough">>;
138
138
  export type DeployAppAuth = z.infer<typeof DeployAppAuthSchema>;
139
- export type DeployAppAuthParameters<T = undefined> = T extends z.ZodSchema ? {
139
+ export type DeployAppAuthParameters<T = undefined> = T extends z.ZodTypeAny ? {
140
140
  schema: T;
141
141
  } : T extends false ? {
142
142
  schema: false;
143
143
  } : {
144
- schema?: z.ZodSchema | false;
144
+ schema?: z.ZodTypeAny | false;
145
145
  };
146
- export type DeployAppAuthReturnType<T = undefined> = T extends z.ZodSchema ? z.infer<T> : T extends false ? unknown : DeployAppAuth;
147
- export declare function deployAppAuth<T extends z.ZodSchema | false | undefined = undefined>(request: DeployAppAuthRequest, parameters?: DeployAppAuthParameters<T>): Promise<DeployAppAuthReturnType<T>>;
146
+ export type DeployAppAuthReturnType<T = undefined> = T extends z.ZodTypeAny ? z.infer<T> : T extends false ? unknown : DeployAppAuth;
147
+ export declare function deployAppAuth<T extends z.ZodTypeAny | false | undefined = undefined>(request: DeployAppAuthRequest, parameters?: DeployAppAuthParameters<T>): Promise<DeployAppAuthReturnType<T>>;
148
148
  /**
149
149
  * Enhanced safe version with transaction tracking capabilities
150
150
  */
@@ -160,5 +160,4 @@ export type SafeDeployAppAuthResult<T = undefined> = {
160
160
  detail: string;
161
161
  };
162
162
  };
163
- export declare function safeDeployAppAuth<T extends z.ZodSchema | false | undefined = undefined>(request: DeployAppAuthRequest, parameters?: DeployAppAuthParameters<T>): Promise<SafeDeployAppAuthResult<T>>;
164
- //# sourceMappingURL=deploy_app_auth.d.ts.map
163
+ export declare function safeDeployAppAuth<T extends z.ZodTypeAny | false | undefined = undefined>(request: DeployAppAuthRequest, parameters?: DeployAppAuthParameters<T>): Promise<SafeDeployAppAuthResult<T>>;
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type Client, type SafeResult } from "../client";
3
- import { ActionParameters, ActionReturnType } from "../types/common";
2
+ import { type Client } from "../../client";
4
3
  /**
5
4
  * Commit CVM compose file update
6
5
  *
@@ -84,36 +83,36 @@ export declare const CommitCvmComposeFileUpdateRequestSchema: z.ZodEffects<z.Zod
84
83
  id?: string | undefined;
85
84
  app_id?: string | undefined;
86
85
  instance_id?: string | undefined;
86
+ uuid?: string | undefined;
87
87
  env_keys?: string[] | undefined;
88
88
  encrypted_env?: string | undefined;
89
- uuid?: string | undefined;
90
89
  update_env_vars?: boolean | null | undefined;
91
90
  }, {
92
91
  compose_hash: string;
93
92
  id?: string | undefined;
94
93
  app_id?: string | undefined;
95
94
  instance_id?: string | undefined;
95
+ uuid?: string | undefined;
96
96
  env_keys?: string[] | undefined;
97
97
  encrypted_env?: string | undefined;
98
- uuid?: string | undefined;
99
98
  update_env_vars?: boolean | null | undefined;
100
99
  }>, {
101
100
  compose_hash: string;
102
101
  id?: string | undefined;
103
102
  app_id?: string | undefined;
104
103
  instance_id?: string | undefined;
104
+ uuid?: string | undefined;
105
105
  env_keys?: string[] | undefined;
106
106
  encrypted_env?: string | undefined;
107
- uuid?: string | undefined;
108
107
  update_env_vars?: boolean | null | undefined;
109
108
  }, {
110
109
  compose_hash: string;
111
110
  id?: string | undefined;
112
111
  app_id?: string | undefined;
113
112
  instance_id?: string | undefined;
113
+ uuid?: string | undefined;
114
114
  env_keys?: string[] | undefined;
115
115
  encrypted_env?: string | undefined;
116
- uuid?: string | undefined;
117
116
  update_env_vars?: boolean | null | undefined;
118
117
  }>, {
119
118
  cvmId: string | undefined;
@@ -126,9 +125,9 @@ export declare const CommitCvmComposeFileUpdateRequestSchema: z.ZodEffects<z.Zod
126
125
  id?: string | undefined;
127
126
  app_id?: string | undefined;
128
127
  instance_id?: string | undefined;
128
+ uuid?: string | undefined;
129
129
  env_keys?: string[] | undefined;
130
130
  encrypted_env?: string | undefined;
131
- uuid?: string | undefined;
132
131
  update_env_vars?: boolean | null | undefined;
133
132
  };
134
133
  }, {
@@ -136,9 +135,9 @@ export declare const CommitCvmComposeFileUpdateRequestSchema: z.ZodEffects<z.Zod
136
135
  id?: string | undefined;
137
136
  app_id?: string | undefined;
138
137
  instance_id?: string | undefined;
138
+ uuid?: string | undefined;
139
139
  env_keys?: string[] | undefined;
140
140
  encrypted_env?: string | undefined;
141
- uuid?: string | undefined;
142
141
  update_env_vars?: boolean | null | undefined;
143
142
  }>;
144
143
  export declare const CommitCvmComposeFileUpdateSchema: z.ZodEffects<z.ZodAny, undefined, any>;
@@ -150,8 +149,21 @@ export type CommitCvmComposeFileUpdateRequest = Omit<z.infer<typeof CommitCvmCom
150
149
  update_env_vars?: boolean | null;
151
150
  };
152
151
  export type CommitCvmComposeFileUpdate = undefined;
153
- export type CommitCvmComposeFileUpdateParameters<T = undefined> = ActionParameters<T>;
154
- export type CommitCvmComposeFileUpdateReturnType<T = undefined> = ActionReturnType<CommitCvmComposeFileUpdate, T>;
155
- export declare function commitCvmComposeFileUpdate<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request: CommitCvmComposeFileUpdateRequest, parameters?: CommitCvmComposeFileUpdateParameters<T>): Promise<CommitCvmComposeFileUpdateReturnType<T>>;
156
- export declare function safeCommitCvmComposeFileUpdate<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request: CommitCvmComposeFileUpdateRequest, parameters?: CommitCvmComposeFileUpdateParameters<T>): Promise<SafeResult<CommitCvmComposeFileUpdateReturnType<T>>>;
157
- //# sourceMappingURL=commit_cvm_compose_file_update.d.ts.map
152
+ declare const commitCvmComposeFileUpdate: {
153
+ (client: Client, params: CommitCvmComposeFileUpdateRequest): Promise<undefined>;
154
+ <T extends z.ZodTypeAny>(client: Client, params: CommitCvmComposeFileUpdateRequest, parameters: {
155
+ schema: T;
156
+ }): Promise<z.TypeOf<T>>;
157
+ (client: Client, params: CommitCvmComposeFileUpdateRequest, parameters: {
158
+ schema: false;
159
+ }): Promise<unknown>;
160
+ }, safeCommitCvmComposeFileUpdate: {
161
+ (client: Client, params: CommitCvmComposeFileUpdateRequest): Promise<import("../..").SafeResult<undefined>>;
162
+ <T extends z.ZodTypeAny>(client: Client, params: CommitCvmComposeFileUpdateRequest, parameters: {
163
+ schema: T;
164
+ }): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
165
+ (client: Client, params: CommitCvmComposeFileUpdateRequest, parameters: {
166
+ schema: false;
167
+ }): Promise<import("../..").SafeResult<unknown>>;
168
+ };
169
+ export { commitCvmComposeFileUpdate, safeCommitCvmComposeFileUpdate };
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type Client, type SafeResult } from "../client";
3
- import { ActionParameters, ActionReturnType } from "../types/common";
2
+ import { type Client } from "../../client";
4
3
  /**
5
4
  * Commit CVM Provision (Create CVM from provisioned data)
6
5
  *
@@ -84,11 +83,11 @@ export declare const CommitCvmProvisionSchema: z.ZodObject<{
84
83
  id: z.ZodNumber;
85
84
  name: z.ZodString;
86
85
  }, "strip", z.ZodTypeAny, {
87
- id: number;
88
86
  name: string;
89
- }, {
90
87
  id: number;
88
+ }, {
91
89
  name: string;
90
+ id: number;
92
91
  }>>;
93
92
  user_id: z.ZodNullable<z.ZodNumber>;
94
93
  app_id: z.ZodNullable<z.ZodString>;
@@ -117,11 +116,11 @@ export declare const CommitCvmProvisionSchema: z.ZodObject<{
117
116
  id: z.ZodNumber;
118
117
  name: z.ZodString;
119
118
  }, "strip", z.ZodTypeAny, {
120
- id: number;
121
119
  name: string;
122
- }, {
123
120
  id: number;
121
+ }, {
124
122
  name: string;
123
+ id: number;
125
124
  }>>;
126
125
  user_id: z.ZodNullable<z.ZodNumber>;
127
126
  app_id: z.ZodNullable<z.ZodString>;
@@ -150,11 +149,11 @@ export declare const CommitCvmProvisionSchema: z.ZodObject<{
150
149
  id: z.ZodNumber;
151
150
  name: z.ZodString;
152
151
  }, "strip", z.ZodTypeAny, {
153
- id: number;
154
152
  name: string;
155
- }, {
156
153
  id: number;
154
+ }, {
157
155
  name: string;
156
+ id: number;
158
157
  }>>;
159
158
  user_id: z.ZodNullable<z.ZodNumber>;
160
159
  app_id: z.ZodNullable<z.ZodString>;
@@ -202,8 +201,135 @@ export declare const CommitCvmProvisionRequestSchema: z.ZodObject<{
202
201
  env_keys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
203
202
  }, z.ZodTypeAny, "passthrough">>;
204
203
  export type CommitCvmProvisionRequest = z.infer<typeof CommitCvmProvisionRequestSchema>;
205
- export type CommitCvmProvisionParameters<T = undefined> = ActionParameters<T>;
206
- export type CommitCvmProvisionReturnType<T = undefined> = ActionReturnType<CommitCvmProvision, T>;
207
- export declare function commitCvmProvision<T extends z.ZodSchema | false | undefined = undefined>(client: Client, payload: CommitCvmProvisionRequest, parameters?: CommitCvmProvisionParameters<T>): Promise<CommitCvmProvisionReturnType<T>>;
208
- export declare function safeCommitCvmProvision<T extends z.ZodSchema | false | undefined = undefined>(client: Client, payload: CommitCvmProvisionRequest, parameters?: CommitCvmProvisionParameters<T>): Promise<SafeResult<CommitCvmProvisionReturnType<T>>>;
209
- //# sourceMappingURL=commit_cvm_provision.d.ts.map
204
+ declare const commitCvmProvision: {
205
+ (client: Client, params: z.objectOutputType<{
206
+ encrypted_env: z.ZodNullable<z.ZodOptional<z.ZodString>>;
207
+ app_id: z.ZodString;
208
+ compose_hash: z.ZodOptional<z.ZodString>;
209
+ kms_id: z.ZodOptional<z.ZodString>;
210
+ contract_address: z.ZodOptional<z.ZodString>;
211
+ deployer_address: z.ZodOptional<z.ZodString>;
212
+ env_keys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
213
+ }, z.ZodTypeAny, "passthrough">): Promise<z.objectOutputType<{
214
+ id: z.ZodNumber;
215
+ name: z.ZodString;
216
+ status: z.ZodString;
217
+ teepod_id: z.ZodNumber;
218
+ teepod: z.ZodNullable<z.ZodObject<{
219
+ id: z.ZodNumber;
220
+ name: z.ZodString;
221
+ }, "strip", z.ZodTypeAny, {
222
+ name: string;
223
+ id: number;
224
+ }, {
225
+ name: string;
226
+ id: number;
227
+ }>>;
228
+ user_id: z.ZodNullable<z.ZodNumber>;
229
+ app_id: z.ZodNullable<z.ZodString>;
230
+ vm_uuid: z.ZodNullable<z.ZodString>;
231
+ instance_id: z.ZodNullable<z.ZodString>;
232
+ app_url: z.ZodNullable<z.ZodString>;
233
+ base_image: z.ZodNullable<z.ZodString>;
234
+ vcpu: z.ZodNumber;
235
+ memory: z.ZodNumber;
236
+ disk_size: z.ZodNumber;
237
+ manifest_version: z.ZodNullable<z.ZodNumber>;
238
+ version: z.ZodNullable<z.ZodString>;
239
+ runner: z.ZodNullable<z.ZodString>;
240
+ docker_compose_file: z.ZodNullable<z.ZodString>;
241
+ features: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
242
+ created_at: z.ZodString;
243
+ encrypted_env_pubkey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ app_auth_contract_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ deployer_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
+ }, z.ZodTypeAny, "passthrough">>;
247
+ <T extends z.ZodTypeAny>(client: Client, params: z.objectOutputType<{
248
+ encrypted_env: z.ZodNullable<z.ZodOptional<z.ZodString>>;
249
+ app_id: z.ZodString;
250
+ compose_hash: z.ZodOptional<z.ZodString>;
251
+ kms_id: z.ZodOptional<z.ZodString>;
252
+ contract_address: z.ZodOptional<z.ZodString>;
253
+ deployer_address: z.ZodOptional<z.ZodString>;
254
+ env_keys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
255
+ }, z.ZodTypeAny, "passthrough">, parameters: {
256
+ schema: T;
257
+ }): Promise<z.TypeOf<T>>;
258
+ (client: Client, params: z.objectOutputType<{
259
+ encrypted_env: z.ZodNullable<z.ZodOptional<z.ZodString>>;
260
+ app_id: z.ZodString;
261
+ compose_hash: z.ZodOptional<z.ZodString>;
262
+ kms_id: z.ZodOptional<z.ZodString>;
263
+ contract_address: z.ZodOptional<z.ZodString>;
264
+ deployer_address: z.ZodOptional<z.ZodString>;
265
+ env_keys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
266
+ }, z.ZodTypeAny, "passthrough">, parameters: {
267
+ schema: false;
268
+ }): Promise<unknown>;
269
+ }, safeCommitCvmProvision: {
270
+ (client: Client, params: z.objectOutputType<{
271
+ encrypted_env: z.ZodNullable<z.ZodOptional<z.ZodString>>;
272
+ app_id: z.ZodString;
273
+ compose_hash: z.ZodOptional<z.ZodString>;
274
+ kms_id: z.ZodOptional<z.ZodString>;
275
+ contract_address: z.ZodOptional<z.ZodString>;
276
+ deployer_address: z.ZodOptional<z.ZodString>;
277
+ env_keys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
278
+ }, z.ZodTypeAny, "passthrough">): Promise<import("../..").SafeResult<z.objectOutputType<{
279
+ id: z.ZodNumber;
280
+ name: z.ZodString;
281
+ status: z.ZodString;
282
+ teepod_id: z.ZodNumber;
283
+ teepod: z.ZodNullable<z.ZodObject<{
284
+ id: z.ZodNumber;
285
+ name: z.ZodString;
286
+ }, "strip", z.ZodTypeAny, {
287
+ name: string;
288
+ id: number;
289
+ }, {
290
+ name: string;
291
+ id: number;
292
+ }>>;
293
+ user_id: z.ZodNullable<z.ZodNumber>;
294
+ app_id: z.ZodNullable<z.ZodString>;
295
+ vm_uuid: z.ZodNullable<z.ZodString>;
296
+ instance_id: z.ZodNullable<z.ZodString>;
297
+ app_url: z.ZodNullable<z.ZodString>;
298
+ base_image: z.ZodNullable<z.ZodString>;
299
+ vcpu: z.ZodNumber;
300
+ memory: z.ZodNumber;
301
+ disk_size: z.ZodNumber;
302
+ manifest_version: z.ZodNullable<z.ZodNumber>;
303
+ version: z.ZodNullable<z.ZodString>;
304
+ runner: z.ZodNullable<z.ZodString>;
305
+ docker_compose_file: z.ZodNullable<z.ZodString>;
306
+ features: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
307
+ created_at: z.ZodString;
308
+ encrypted_env_pubkey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
309
+ app_auth_contract_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
310
+ deployer_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
+ }, z.ZodTypeAny, "passthrough">>>;
312
+ <T extends z.ZodTypeAny>(client: Client, params: z.objectOutputType<{
313
+ encrypted_env: z.ZodNullable<z.ZodOptional<z.ZodString>>;
314
+ app_id: z.ZodString;
315
+ compose_hash: z.ZodOptional<z.ZodString>;
316
+ kms_id: z.ZodOptional<z.ZodString>;
317
+ contract_address: z.ZodOptional<z.ZodString>;
318
+ deployer_address: z.ZodOptional<z.ZodString>;
319
+ env_keys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
320
+ }, z.ZodTypeAny, "passthrough">, parameters: {
321
+ schema: T;
322
+ }): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
323
+ (client: Client, params: z.objectOutputType<{
324
+ encrypted_env: z.ZodNullable<z.ZodOptional<z.ZodString>>;
325
+ app_id: z.ZodString;
326
+ compose_hash: z.ZodOptional<z.ZodString>;
327
+ kms_id: z.ZodOptional<z.ZodString>;
328
+ contract_address: z.ZodOptional<z.ZodString>;
329
+ deployer_address: z.ZodOptional<z.ZodString>;
330
+ env_keys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
331
+ }, z.ZodTypeAny, "passthrough">, parameters: {
332
+ schema: false;
333
+ }): Promise<import("../..").SafeResult<unknown>>;
334
+ };
335
+ export { commitCvmProvision, safeCommitCvmProvision };
@@ -0,0 +1,225 @@
1
+ import { z } from "zod";
2
+ import { type Client } from "../../client";
3
+ import { LooseAppComposeSchema } from "../../types/app_compose";
4
+ /**
5
+ * Get CVM compose file configuration
6
+ *
7
+ * Retrieves the current Docker Compose file configuration and metadata for a specified CVM.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { createClient, getCvmComposeFile } from '@phala/cloud'
12
+ *
13
+ * const client = createClient({ apiKey: 'your-api-key' })
14
+ * const composeFile = await getCvmComposeFile(client, { id: 'cvm-123' })
15
+ * // Output: { compose_content: '...', version: '...', last_modified: '...' }
16
+ * ```
17
+ *
18
+ * ## Returns
19
+ *
20
+ * `GetCvmComposeFileResult | unknown`
21
+ *
22
+ * The CVM compose file configuration including compose_content and metadata. Return type depends on schema parameter.
23
+ *
24
+ * ## Parameters
25
+ *
26
+ * ### request (required)
27
+ * - **Type:** `GetCvmComposeFileRequest`
28
+ *
29
+ * Request parameters containing the CVM identifier. Can be one of:
30
+ * - id: The CVM ID
31
+ * - uuid: The CVM UUID
32
+ * - appId: The App ID (40 chars)
33
+ * - instanceId: The Instance ID (40 chars)
34
+ *
35
+ * ### parameters (optional)
36
+ * - **Type:** `GetCvmComposeFileParameters`
37
+ *
38
+ * Optional behavior parameters for schema validation.
39
+ *
40
+ * ```typescript
41
+ * // Use default schema
42
+ * const result = await getCvmComposeFile(client, { id: 'cvm-123' })
43
+ *
44
+ * // Return raw data without validation
45
+ * const raw = await getCvmComposeFile(client, { id: 'cvm-123' }, { schema: false })
46
+ *
47
+ * // Use custom schema
48
+ * const customSchema = z.object({ compose_content: z.string() })
49
+ * const custom = await getCvmComposeFile(client, { id: 'cvm-123' }, { schema: customSchema })
50
+ * ```
51
+ *
52
+ * ## Safe Version
53
+ *
54
+ * Use `safeGetCvmComposeFile` for error handling without exceptions:
55
+ *
56
+ * ```typescript
57
+ * import { safeGetCvmComposeFile } from '@phala/cloud'
58
+ *
59
+ * const result = await safeGetCvmComposeFile(client, { id: 'cvm-123' })
60
+ * if (result.success) {
61
+ * console.log(result.data.compose_content)
62
+ * } else {
63
+ * if ("isRequestError" in result.error) {
64
+ * console.error(`HTTP ${result.error.status}: ${result.error.message}`)
65
+ * } else {
66
+ * console.error(`Validation error: ${result.error.issues}`)
67
+ * }
68
+ * }
69
+ * ```
70
+ */
71
+ export declare const GetCvmComposeFileResultSchema: z.ZodObject<{
72
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
73
+ docker_compose_file: z.ZodString;
74
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
75
+ name: z.ZodOptional<z.ZodString>;
76
+ manifest_version: z.ZodOptional<z.ZodNumber>;
77
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
78
+ public_logs: z.ZodOptional<z.ZodBoolean>;
79
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
80
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
81
+ pre_launch_script: z.ZodOptional<z.ZodString>;
82
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
83
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
84
+ docker_compose_file: z.ZodString;
85
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
86
+ name: z.ZodOptional<z.ZodString>;
87
+ manifest_version: z.ZodOptional<z.ZodNumber>;
88
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
89
+ public_logs: z.ZodOptional<z.ZodBoolean>;
90
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
91
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
92
+ pre_launch_script: z.ZodOptional<z.ZodString>;
93
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
94
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
95
+ docker_compose_file: z.ZodString;
96
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
97
+ name: z.ZodOptional<z.ZodString>;
98
+ manifest_version: z.ZodOptional<z.ZodNumber>;
99
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
100
+ public_logs: z.ZodOptional<z.ZodBoolean>;
101
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
102
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
103
+ pre_launch_script: z.ZodOptional<z.ZodString>;
104
+ }, z.ZodTypeAny, "passthrough">>;
105
+ export declare const CvmComposeFileSchema: z.ZodObject<{
106
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
107
+ docker_compose_file: z.ZodString;
108
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
109
+ name: z.ZodOptional<z.ZodString>;
110
+ manifest_version: z.ZodOptional<z.ZodNumber>;
111
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
112
+ public_logs: z.ZodOptional<z.ZodBoolean>;
113
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
114
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
115
+ pre_launch_script: z.ZodOptional<z.ZodString>;
116
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
117
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
118
+ docker_compose_file: z.ZodString;
119
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
120
+ name: z.ZodOptional<z.ZodString>;
121
+ manifest_version: z.ZodOptional<z.ZodNumber>;
122
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
123
+ public_logs: z.ZodOptional<z.ZodBoolean>;
124
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
125
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
126
+ pre_launch_script: z.ZodOptional<z.ZodString>;
127
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
128
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
129
+ docker_compose_file: z.ZodString;
130
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
131
+ name: z.ZodOptional<z.ZodString>;
132
+ manifest_version: z.ZodOptional<z.ZodNumber>;
133
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
134
+ public_logs: z.ZodOptional<z.ZodBoolean>;
135
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
136
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
137
+ pre_launch_script: z.ZodOptional<z.ZodString>;
138
+ }, z.ZodTypeAny, "passthrough">>;
139
+ export type CvmComposeFile = z.infer<typeof CvmComposeFileSchema>;
140
+ export type GetCvmComposeFileResult = z.infer<typeof LooseAppComposeSchema>;
141
+ export declare const GetCvmComposeFileRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
142
+ id: z.ZodOptional<z.ZodString>;
143
+ uuid: z.ZodOptional<z.ZodString>;
144
+ app_id: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
145
+ instance_id: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ id?: string | undefined;
148
+ app_id?: string | undefined;
149
+ instance_id?: string | undefined;
150
+ uuid?: string | undefined;
151
+ }, {
152
+ id?: string | undefined;
153
+ app_id?: string | undefined;
154
+ instance_id?: string | undefined;
155
+ uuid?: string | undefined;
156
+ }>, {
157
+ id?: string | undefined;
158
+ app_id?: string | undefined;
159
+ instance_id?: string | undefined;
160
+ uuid?: string | undefined;
161
+ }, {
162
+ id?: string | undefined;
163
+ app_id?: string | undefined;
164
+ instance_id?: string | undefined;
165
+ uuid?: string | undefined;
166
+ }>, {
167
+ cvmId: string | undefined;
168
+ _raw: {
169
+ id?: string | undefined;
170
+ app_id?: string | undefined;
171
+ instance_id?: string | undefined;
172
+ uuid?: string | undefined;
173
+ };
174
+ }, {
175
+ id?: string | undefined;
176
+ app_id?: string | undefined;
177
+ instance_id?: string | undefined;
178
+ uuid?: string | undefined;
179
+ }>;
180
+ export type GetCvmComposeFileRequest = {
181
+ id?: string;
182
+ uuid?: string;
183
+ app_id?: string;
184
+ instance_id?: string;
185
+ };
186
+ declare const getCvmComposeFile: {
187
+ (client: Client, params: GetCvmComposeFileRequest): Promise<z.objectOutputType<{
188
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
189
+ docker_compose_file: z.ZodString;
190
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
191
+ name: z.ZodOptional<z.ZodString>;
192
+ manifest_version: z.ZodOptional<z.ZodNumber>;
193
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
194
+ public_logs: z.ZodOptional<z.ZodBoolean>;
195
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
196
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
197
+ pre_launch_script: z.ZodOptional<z.ZodString>;
198
+ }, z.ZodTypeAny, "passthrough">>;
199
+ <T extends z.ZodTypeAny>(client: Client, params: GetCvmComposeFileRequest, parameters: {
200
+ schema: T;
201
+ }): Promise<z.TypeOf<T>>;
202
+ (client: Client, params: GetCvmComposeFileRequest, parameters: {
203
+ schema: false;
204
+ }): Promise<unknown>;
205
+ }, safeGetCvmComposeFile: {
206
+ (client: Client, params: GetCvmComposeFileRequest): Promise<import("../..").SafeResult<z.objectOutputType<{
207
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
208
+ docker_compose_file: z.ZodString;
209
+ features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
210
+ name: z.ZodOptional<z.ZodString>;
211
+ manifest_version: z.ZodOptional<z.ZodNumber>;
212
+ kms_enabled: z.ZodOptional<z.ZodBoolean>;
213
+ public_logs: z.ZodOptional<z.ZodBoolean>;
214
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
215
+ tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
216
+ pre_launch_script: z.ZodOptional<z.ZodString>;
217
+ }, z.ZodTypeAny, "passthrough">>>;
218
+ <T extends z.ZodTypeAny>(client: Client, params: GetCvmComposeFileRequest, parameters: {
219
+ schema: T;
220
+ }): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
221
+ (client: Client, params: GetCvmComposeFileRequest, parameters: {
222
+ schema: false;
223
+ }): Promise<import("../..").SafeResult<unknown>>;
224
+ };
225
+ export { getCvmComposeFile, safeGetCvmComposeFile };
@@ -1,8 +1,7 @@
1
1
  import { z } from "zod";
2
- import { type Client, type SafeResult } from "../client";
3
- import { CvmLegacyDetailSchema } from "../types/cvm_info";
4
- import { type KmsInfo } from "../types/kms_info";
5
- import { ActionParameters, ActionReturnType } from "../types/common";
2
+ import { type Client } from "../../client";
3
+ import { CvmLegacyDetailSchema } from "../../types/cvm_info";
4
+ import { type KmsInfo } from "../../types/kms_info";
6
5
  export { CvmLegacyDetailSchema };
7
6
  export type GetCvmInfoResponse = z.infer<typeof CvmLegacyDetailSchema> & {
8
7
  kms_info: KmsInfo;
@@ -52,8 +51,6 @@ export type GetCvmInfoRequest = {
52
51
  app_id?: string;
53
52
  instance_id?: string;
54
53
  };
55
- export type GetCvmInfoParameters<T = undefined> = ActionParameters<T>;
56
- export type GetCvmInfoReturnType<T = undefined> = ActionReturnType<GetCvmInfoResponse, T>;
57
54
  /**
58
55
  * Get information about a specific CVM
59
56
  *
@@ -68,9 +65,21 @@ export type GetCvmInfoReturnType<T = undefined> = ActionReturnType<GetCvmInfoRes
68
65
  * const info = await getCvmInfo(client, { cvmId: "cvm-123" })
69
66
  * ```
70
67
  */
71
- export declare function getCvmInfo<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request: GetCvmInfoRequest, parameters?: GetCvmInfoParameters<T>): Promise<GetCvmInfoReturnType<T>>;
72
- /**
73
- * Safe version of getCvmInfo that returns a Result type instead of throwing
74
- */
75
- export declare function safeGetCvmInfo<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request: GetCvmInfoRequest, parameters?: GetCvmInfoParameters<T>): Promise<SafeResult<GetCvmInfoReturnType<T>>>;
76
- //# sourceMappingURL=get_cvm_info.d.ts.map
68
+ declare const getCvmInfo: {
69
+ (client: Client, params: GetCvmInfoRequest): Promise<GetCvmInfoResponse>;
70
+ <T extends z.ZodTypeAny>(client: Client, params: GetCvmInfoRequest, parameters: {
71
+ schema: T;
72
+ }): Promise<z.TypeOf<T>>;
73
+ (client: Client, params: GetCvmInfoRequest, parameters: {
74
+ schema: false;
75
+ }): Promise<unknown>;
76
+ }, safeGetCvmInfo: {
77
+ (client: Client, params: GetCvmInfoRequest): Promise<import("../..").SafeResult<GetCvmInfoResponse>>;
78
+ <T extends z.ZodTypeAny>(client: Client, params: GetCvmInfoRequest, parameters: {
79
+ schema: T;
80
+ }): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
81
+ (client: Client, params: GetCvmInfoRequest, parameters: {
82
+ schema: false;
83
+ }): Promise<import("../..").SafeResult<unknown>>;
84
+ };
85
+ export { getCvmInfo, safeGetCvmInfo };