@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
@@ -5,19 +5,7 @@ export declare const CvmRefSchema: z.ZodObject<{
5
5
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
6
  app_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
7
  vm_uuid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
- }, "strip", z.ZodTypeAny, {
9
- object_type: "cvm";
10
- name?: string | null | undefined;
11
- id?: string | null | undefined;
12
- app_id?: string | null | undefined;
13
- vm_uuid?: string | null | undefined;
14
- }, {
15
- object_type: "cvm";
16
- name?: string | null | undefined;
17
- id?: string | null | undefined;
18
- app_id?: string | null | undefined;
19
- vm_uuid?: string | null | undefined;
20
- }>;
8
+ }, z.core.$strip>;
21
9
  export type CvmRef = z.infer<typeof CvmRefSchema>;
22
10
  export declare const AppRevisionResponseSchema: z.ZodObject<{
23
11
  revision_id: z.ZodString;
@@ -32,119 +20,29 @@ export declare const AppRevisionResponseSchema: z.ZodObject<{
32
20
  id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
21
  username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
22
  avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
- }, "strip", z.ZodTypeAny, {
36
- object_type: "user";
37
- username?: string | null | undefined;
38
- id?: string | null | undefined;
39
- avatar_url?: string | null | undefined;
40
- }, {
41
- object_type: "user";
42
- username?: string | null | undefined;
43
- id?: string | null | undefined;
44
- avatar_url?: string | null | undefined;
45
- }>>>;
23
+ }, z.core.$strip>>>;
46
24
  cvm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
47
25
  object_type: z.ZodLiteral<"cvm">;
48
26
  id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
27
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
28
  app_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
29
  vm_uuid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
- }, "strip", z.ZodTypeAny, {
53
- object_type: "cvm";
54
- name?: string | null | undefined;
55
- id?: string | null | undefined;
56
- app_id?: string | null | undefined;
57
- vm_uuid?: string | null | undefined;
58
- }, {
59
- object_type: "cvm";
60
- name?: string | null | undefined;
61
- id?: string | null | undefined;
62
- app_id?: string | null | undefined;
63
- vm_uuid?: string | null | undefined;
64
- }>>>;
30
+ }, z.core.$strip>>>;
65
31
  workspace: z.ZodOptional<z.ZodNullable<z.ZodObject<{
66
32
  object_type: z.ZodLiteral<"workspace">;
67
33
  id: z.ZodString;
68
34
  name: z.ZodString;
69
35
  slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
36
  avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
- }, "strip", z.ZodTypeAny, {
72
- name: string;
73
- id: string;
74
- object_type: "workspace";
75
- slug?: string | null | undefined;
76
- avatar_url?: string | null | undefined;
77
- }, {
78
- name: string;
79
- id: string;
80
- object_type: "workspace";
81
- slug?: string | null | undefined;
82
- avatar_url?: string | null | undefined;
83
- }>>>;
84
- }, "strip", z.ZodTypeAny, {
85
- app_id: string;
86
- compose_hash: string;
87
- vm_uuid: string;
88
- created_at: string;
89
- revision_id: string;
90
- operation_type: string;
91
- workspace?: {
92
- name: string;
93
- id: string;
94
- object_type: "workspace";
95
- slug?: string | null | undefined;
96
- avatar_url?: string | null | undefined;
97
- } | null | undefined;
98
- cvm?: {
99
- object_type: "cvm";
100
- name?: string | null | undefined;
101
- id?: string | null | undefined;
102
- app_id?: string | null | undefined;
103
- vm_uuid?: string | null | undefined;
104
- } | null | undefined;
105
- trace_id?: string | null | undefined;
106
- triggered_by?: {
107
- object_type: "user";
108
- username?: string | null | undefined;
109
- id?: string | null | undefined;
110
- avatar_url?: string | null | undefined;
111
- } | null | undefined;
112
- }, {
113
- app_id: string;
114
- compose_hash: string;
115
- vm_uuid: string;
116
- created_at: string;
117
- revision_id: string;
118
- operation_type: string;
119
- workspace?: {
120
- name: string;
121
- id: string;
122
- object_type: "workspace";
123
- slug?: string | null | undefined;
124
- avatar_url?: string | null | undefined;
125
- } | null | undefined;
126
- cvm?: {
127
- object_type: "cvm";
128
- name?: string | null | undefined;
129
- id?: string | null | undefined;
130
- app_id?: string | null | undefined;
131
- vm_uuid?: string | null | undefined;
132
- } | null | undefined;
133
- trace_id?: string | null | undefined;
134
- triggered_by?: {
135
- object_type: "user";
136
- username?: string | null | undefined;
137
- id?: string | null | undefined;
138
- avatar_url?: string | null | undefined;
139
- } | null | undefined;
140
- }>;
37
+ }, z.core.$strip>>>;
38
+ }, z.core.$strip>;
141
39
  export type AppRevisionResponse = z.infer<typeof AppRevisionResponseSchema>;
142
40
  export declare const AppRevisionDetailResponseSchema: z.ZodObject<{
143
41
  revision_id: z.ZodString;
144
42
  app_id: z.ZodString;
145
43
  vm_uuid: z.ZodString;
146
44
  compose_hash: z.ZodString;
147
- compose_file: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodString]>>>;
45
+ compose_file: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodString]>>>;
148
46
  encrypted_env: z.ZodString;
149
47
  user_config: z.ZodString;
150
48
  created_at: z.ZodString;
@@ -155,118 +53,22 @@ export declare const AppRevisionDetailResponseSchema: z.ZodObject<{
155
53
  id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
54
  username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
157
55
  avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
158
- }, "strip", z.ZodTypeAny, {
159
- object_type: "user";
160
- username?: string | null | undefined;
161
- id?: string | null | undefined;
162
- avatar_url?: string | null | undefined;
163
- }, {
164
- object_type: "user";
165
- username?: string | null | undefined;
166
- id?: string | null | undefined;
167
- avatar_url?: string | null | undefined;
168
- }>>>;
56
+ }, z.core.$strip>>>;
169
57
  cvm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
170
58
  object_type: z.ZodLiteral<"cvm">;
171
59
  id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
172
60
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
173
61
  app_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
174
62
  vm_uuid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
175
- }, "strip", z.ZodTypeAny, {
176
- object_type: "cvm";
177
- name?: string | null | undefined;
178
- id?: string | null | undefined;
179
- app_id?: string | null | undefined;
180
- vm_uuid?: string | null | undefined;
181
- }, {
182
- object_type: "cvm";
183
- name?: string | null | undefined;
184
- id?: string | null | undefined;
185
- app_id?: string | null | undefined;
186
- vm_uuid?: string | null | undefined;
187
- }>>>;
63
+ }, z.core.$strip>>>;
188
64
  workspace: z.ZodOptional<z.ZodNullable<z.ZodObject<{
189
65
  object_type: z.ZodLiteral<"workspace">;
190
66
  id: z.ZodString;
191
67
  name: z.ZodString;
192
68
  slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
193
69
  avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
194
- }, "strip", z.ZodTypeAny, {
195
- name: string;
196
- id: string;
197
- object_type: "workspace";
198
- slug?: string | null | undefined;
199
- avatar_url?: string | null | undefined;
200
- }, {
201
- name: string;
202
- id: string;
203
- object_type: "workspace";
204
- slug?: string | null | undefined;
205
- avatar_url?: string | null | undefined;
206
- }>>>;
207
- }, "strip", z.ZodTypeAny, {
208
- app_id: string;
209
- compose_hash: string;
210
- vm_uuid: string;
211
- created_at: string;
212
- encrypted_env: string;
213
- revision_id: string;
214
- operation_type: string;
215
- user_config: string;
216
- workspace?: {
217
- name: string;
218
- id: string;
219
- object_type: "workspace";
220
- slug?: string | null | undefined;
221
- avatar_url?: string | null | undefined;
222
- } | null | undefined;
223
- compose_file?: string | Record<string, any> | null | undefined;
224
- cvm?: {
225
- object_type: "cvm";
226
- name?: string | null | undefined;
227
- id?: string | null | undefined;
228
- app_id?: string | null | undefined;
229
- vm_uuid?: string | null | undefined;
230
- } | null | undefined;
231
- trace_id?: string | null | undefined;
232
- triggered_by?: {
233
- object_type: "user";
234
- username?: string | null | undefined;
235
- id?: string | null | undefined;
236
- avatar_url?: string | null | undefined;
237
- } | null | undefined;
238
- }, {
239
- app_id: string;
240
- compose_hash: string;
241
- vm_uuid: string;
242
- created_at: string;
243
- encrypted_env: string;
244
- revision_id: string;
245
- operation_type: string;
246
- user_config: string;
247
- workspace?: {
248
- name: string;
249
- id: string;
250
- object_type: "workspace";
251
- slug?: string | null | undefined;
252
- avatar_url?: string | null | undefined;
253
- } | null | undefined;
254
- compose_file?: string | Record<string, any> | null | undefined;
255
- cvm?: {
256
- object_type: "cvm";
257
- name?: string | null | undefined;
258
- id?: string | null | undefined;
259
- app_id?: string | null | undefined;
260
- vm_uuid?: string | null | undefined;
261
- } | null | undefined;
262
- trace_id?: string | null | undefined;
263
- triggered_by?: {
264
- object_type: "user";
265
- username?: string | null | undefined;
266
- id?: string | null | undefined;
267
- avatar_url?: string | null | undefined;
268
- } | null | undefined;
269
- }>;
70
+ }, z.core.$strip>>>;
71
+ }, z.core.$strip>;
270
72
  export type AppRevisionDetailResponse = z.infer<typeof AppRevisionDetailResponseSchema>;
271
73
  export declare const AppRevisionsResponseSchema: z.ZodObject<{
272
74
  revisions: z.ZodArray<z.ZodObject<{
@@ -282,183 +84,25 @@ export declare const AppRevisionsResponseSchema: z.ZodObject<{
282
84
  id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
85
  username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
86
  avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
285
- }, "strip", z.ZodTypeAny, {
286
- object_type: "user";
287
- username?: string | null | undefined;
288
- id?: string | null | undefined;
289
- avatar_url?: string | null | undefined;
290
- }, {
291
- object_type: "user";
292
- username?: string | null | undefined;
293
- id?: string | null | undefined;
294
- avatar_url?: string | null | undefined;
295
- }>>>;
87
+ }, z.core.$strip>>>;
296
88
  cvm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
297
89
  object_type: z.ZodLiteral<"cvm">;
298
90
  id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
91
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
92
  app_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
93
  vm_uuid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
302
- }, "strip", z.ZodTypeAny, {
303
- object_type: "cvm";
304
- name?: string | null | undefined;
305
- id?: string | null | undefined;
306
- app_id?: string | null | undefined;
307
- vm_uuid?: string | null | undefined;
308
- }, {
309
- object_type: "cvm";
310
- name?: string | null | undefined;
311
- id?: string | null | undefined;
312
- app_id?: string | null | undefined;
313
- vm_uuid?: string | null | undefined;
314
- }>>>;
94
+ }, z.core.$strip>>>;
315
95
  workspace: z.ZodOptional<z.ZodNullable<z.ZodObject<{
316
96
  object_type: z.ZodLiteral<"workspace">;
317
97
  id: z.ZodString;
318
98
  name: z.ZodString;
319
99
  slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
320
100
  avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
321
- }, "strip", z.ZodTypeAny, {
322
- name: string;
323
- id: string;
324
- object_type: "workspace";
325
- slug?: string | null | undefined;
326
- avatar_url?: string | null | undefined;
327
- }, {
328
- name: string;
329
- id: string;
330
- object_type: "workspace";
331
- slug?: string | null | undefined;
332
- avatar_url?: string | null | undefined;
333
- }>>>;
334
- }, "strip", z.ZodTypeAny, {
335
- app_id: string;
336
- compose_hash: string;
337
- vm_uuid: string;
338
- created_at: string;
339
- revision_id: string;
340
- operation_type: string;
341
- workspace?: {
342
- name: string;
343
- id: string;
344
- object_type: "workspace";
345
- slug?: string | null | undefined;
346
- avatar_url?: string | null | undefined;
347
- } | null | undefined;
348
- cvm?: {
349
- object_type: "cvm";
350
- name?: string | null | undefined;
351
- id?: string | null | undefined;
352
- app_id?: string | null | undefined;
353
- vm_uuid?: string | null | undefined;
354
- } | null | undefined;
355
- trace_id?: string | null | undefined;
356
- triggered_by?: {
357
- object_type: "user";
358
- username?: string | null | undefined;
359
- id?: string | null | undefined;
360
- avatar_url?: string | null | undefined;
361
- } | null | undefined;
362
- }, {
363
- app_id: string;
364
- compose_hash: string;
365
- vm_uuid: string;
366
- created_at: string;
367
- revision_id: string;
368
- operation_type: string;
369
- workspace?: {
370
- name: string;
371
- id: string;
372
- object_type: "workspace";
373
- slug?: string | null | undefined;
374
- avatar_url?: string | null | undefined;
375
- } | null | undefined;
376
- cvm?: {
377
- object_type: "cvm";
378
- name?: string | null | undefined;
379
- id?: string | null | undefined;
380
- app_id?: string | null | undefined;
381
- vm_uuid?: string | null | undefined;
382
- } | null | undefined;
383
- trace_id?: string | null | undefined;
384
- triggered_by?: {
385
- object_type: "user";
386
- username?: string | null | undefined;
387
- id?: string | null | undefined;
388
- avatar_url?: string | null | undefined;
389
- } | null | undefined;
390
- }>, "many">;
101
+ }, z.core.$strip>>>;
102
+ }, z.core.$strip>>;
391
103
  total: z.ZodNumber;
392
104
  page: z.ZodNumber;
393
105
  page_size: z.ZodNumber;
394
106
  total_pages: z.ZodNumber;
395
- }, "strip", z.ZodTypeAny, {
396
- total: number;
397
- page: number;
398
- page_size: number;
399
- total_pages: number;
400
- revisions: {
401
- app_id: string;
402
- compose_hash: string;
403
- vm_uuid: string;
404
- created_at: string;
405
- revision_id: string;
406
- operation_type: string;
407
- workspace?: {
408
- name: string;
409
- id: string;
410
- object_type: "workspace";
411
- slug?: string | null | undefined;
412
- avatar_url?: string | null | undefined;
413
- } | null | undefined;
414
- cvm?: {
415
- object_type: "cvm";
416
- name?: string | null | undefined;
417
- id?: string | null | undefined;
418
- app_id?: string | null | undefined;
419
- vm_uuid?: string | null | undefined;
420
- } | null | undefined;
421
- trace_id?: string | null | undefined;
422
- triggered_by?: {
423
- object_type: "user";
424
- username?: string | null | undefined;
425
- id?: string | null | undefined;
426
- avatar_url?: string | null | undefined;
427
- } | null | undefined;
428
- }[];
429
- }, {
430
- total: number;
431
- page: number;
432
- page_size: number;
433
- total_pages: number;
434
- revisions: {
435
- app_id: string;
436
- compose_hash: string;
437
- vm_uuid: string;
438
- created_at: string;
439
- revision_id: string;
440
- operation_type: string;
441
- workspace?: {
442
- name: string;
443
- id: string;
444
- object_type: "workspace";
445
- slug?: string | null | undefined;
446
- avatar_url?: string | null | undefined;
447
- } | null | undefined;
448
- cvm?: {
449
- object_type: "cvm";
450
- name?: string | null | undefined;
451
- id?: string | null | undefined;
452
- app_id?: string | null | undefined;
453
- vm_uuid?: string | null | undefined;
454
- } | null | undefined;
455
- trace_id?: string | null | undefined;
456
- triggered_by?: {
457
- object_type: "user";
458
- username?: string | null | undefined;
459
- id?: string | null | undefined;
460
- avatar_url?: string | null | undefined;
461
- } | null | undefined;
462
- }[];
463
- }>;
107
+ }, z.core.$strip>;
464
108
  export type AppRevisionsResponse = z.infer<typeof AppRevisionsResponseSchema>;
@@ -55,6 +55,8 @@ export type SafeResult<T, E = SafeError> = {
55
55
  *
56
56
  * Environment Variables:
57
57
  * - PHALA_CLOUD_API_KEY: API key for authentication
58
+ * - PHALA_OIDC_TOKEN: GitHub Actions OIDC JWT (Authorization Bearer)
59
+ * - PHALA_CLOUD_WORKSPACE: Workspace slug (X-Phala-Workspace)
58
60
  * - PHALA_CLOUD_API_PREFIX: Base URL prefix for the API
59
61
  */
60
62
  export interface ClientConfig<V extends ApiVersion = ApiVersion> extends FetchOptions {
@@ -64,6 +66,20 @@ export interface ClientConfig<V extends ApiVersion = ApiVersion> extends FetchOp
64
66
  * Not required when useCookieAuth is true
65
67
  */
66
68
  apiKey?: string;
69
+ /**
70
+ * Bearer token for authentication (e.g. GitHub Actions OIDC JWT).
71
+ * Sent as `Authorization: Bearer <token>`.
72
+ * If not provided, will read from PHALA_OIDC_TOKEN environment variable.
73
+ * When both apiKey and bearerToken are set, apiKey (X-API-Key) takes precedence
74
+ * unless only bearer is intended — prefer passing one method explicitly.
75
+ * Not used when useCookieAuth is true.
76
+ */
77
+ bearerToken?: string;
78
+ /**
79
+ * Workspace slug sent as `X-Phala-Workspace`.
80
+ * If not provided, will read from PHALA_CLOUD_WORKSPACE environment variable.
81
+ */
82
+ workspace?: string;
67
83
  /**
68
84
  * Base URL for the API (overrides FetchOptions baseURL)
69
85
  * If not provided, will read from PHALA_CLOUD_API_PREFIX environment variable
@@ -13,6 +13,12 @@ import { z } from "zod";
13
13
  export type Prettify<T> = {
14
14
  [K in keyof T]: T[K];
15
15
  } & {};
16
+ /**
17
+ * Schema for an optional callback option. Zod 4 no longer provides `z.function()`
18
+ * as a schema, so this validates that the value is a function and keeps the
19
+ * `(...args: unknown[]) => unknown` type that `z.function()` inferred in Zod 3.
20
+ */
21
+ export declare const callbackSchema: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
16
22
  /**
17
23
  * Common type for action parameters that control behavior (e.g., schema validation)
18
24
  */
@@ -14,61 +14,27 @@ import { z } from "zod";
14
14
  * ```
15
15
  */
16
16
  export declare const CvmIdObjectSchema: z.ZodObject<{
17
- /** Direct CVM ID (any format) - accepts any string including names */
18
17
  id: z.ZodOptional<z.ZodString>;
19
- /** UUID format (with or without dashes) */
20
18
  uuid: z.ZodOptional<z.ZodString>;
21
- /** App ID (40 characters, optionally prefixed with 'app_id_') */
22
19
  app_id: z.ZodOptional<z.ZodString>;
23
- /** Instance ID (40 characters, optionally prefixed with 'instance_') */
24
20
  instance_id: z.ZodOptional<z.ZodString>;
25
- /** CVM name (RFC 1123 hostname format: 5-63 chars, starts with letter, alphanumeric + hyphens) */
26
- name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
27
- }, "strip", z.ZodTypeAny, {
28
- name?: string | undefined;
29
- id?: string | undefined;
30
- uuid?: string | undefined;
31
- app_id?: string | undefined;
32
- instance_id?: string | undefined;
33
- }, {
34
- name?: string | undefined;
35
- id?: string | undefined;
36
- uuid?: string | undefined;
37
- app_id?: string | undefined;
38
- instance_id?: string | undefined;
39
- }>;
21
+ name: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
40
23
  /**
41
24
  * Helper function to add CVM ID validation refine to any schema
42
25
  */
43
- export declare const refineCvmId: <T extends z.ZodTypeAny>(schema: T) => z.ZodEffects<T, any, any>;
26
+ export declare const refineCvmId: <T extends z.ZodTypeAny>(schema: T) => T;
44
27
  /**
45
28
  * Base CVM ID Schema with validation
46
29
  * For extending with additional fields, use CvmIdObjectSchema.extend() then call refineCvmId()
47
30
  */
48
- export declare const CvmIdBaseSchema: z.ZodEffects<z.ZodObject<{
49
- /** Direct CVM ID (any format) - accepts any string including names */
31
+ export declare const CvmIdBaseSchema: z.ZodObject<{
50
32
  id: z.ZodOptional<z.ZodString>;
51
- /** UUID format (with or without dashes) */
52
33
  uuid: z.ZodOptional<z.ZodString>;
53
- /** App ID (40 characters, optionally prefixed with 'app_id_') */
54
34
  app_id: z.ZodOptional<z.ZodString>;
55
- /** Instance ID (40 characters, optionally prefixed with 'instance_') */
56
35
  instance_id: z.ZodOptional<z.ZodString>;
57
- /** CVM name (RFC 1123 hostname format: 5-63 chars, starts with letter, alphanumeric + hyphens) */
58
- name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
59
- }, "strip", z.ZodTypeAny, {
60
- name?: string | undefined;
61
- id?: string | undefined;
62
- uuid?: string | undefined;
63
- app_id?: string | undefined;
64
- instance_id?: string | undefined;
65
- }, {
66
- name?: string | undefined;
67
- id?: string | undefined;
68
- uuid?: string | undefined;
69
- app_id?: string | undefined;
70
- instance_id?: string | undefined;
71
- }>, any, any>;
36
+ name: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>;
72
38
  /**
73
39
  * CVM ID Schema - supports multiple identifier formats
74
40
  * Automatically detects and normalizes any CVM ID format
@@ -100,32 +66,21 @@ export declare const CvmIdBaseSchema: z.ZodEffects<z.ZodObject<{
100
66
  * // → { cvmId: "my-app" }
101
67
  * ```
102
68
  */
103
- export declare const CvmIdSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
104
- /** Direct CVM ID (any format) - accepts any string including names */
69
+ export declare const CvmIdSchema: z.ZodPipe<z.ZodObject<{
105
70
  id: z.ZodOptional<z.ZodString>;
106
- /** UUID format (with or without dashes) */
107
71
  uuid: z.ZodOptional<z.ZodString>;
108
- /** App ID (40 characters, optionally prefixed with 'app_id_') */
109
72
  app_id: z.ZodOptional<z.ZodString>;
110
- /** Instance ID (40 characters, optionally prefixed with 'instance_') */
111
73
  instance_id: z.ZodOptional<z.ZodString>;
112
- /** CVM name (RFC 1123 hostname format: 5-63 chars, starts with letter, alphanumeric + hyphens) */
113
- name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
114
- }, "strip", z.ZodTypeAny, {
115
- name?: string | undefined;
116
- id?: string | undefined;
117
- uuid?: string | undefined;
118
- app_id?: string | undefined;
119
- instance_id?: string | undefined;
74
+ name: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strip>, z.ZodTransform<{
76
+ cvmId: string;
120
77
  }, {
121
- name?: string | undefined;
122
78
  id?: string | undefined;
123
79
  uuid?: string | undefined;
124
80
  app_id?: string | undefined;
125
81
  instance_id?: string | undefined;
126
- }>, any, any>, {
127
- cvmId: any;
128
- }, any>;
82
+ name?: string | undefined;
83
+ }>>;
129
84
  /**
130
85
  * Input type for CVM ID
131
86
  *