@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.
- package/README.md +20 -0
- package/dist/actions/api_tokens/revoke_current_api_token.d.ts +47 -0
- package/dist/actions/apps/app_launch_token.d.ts +121 -0
- package/dist/actions/apps/check_app_cvms_is_allowed.d.ts +17 -311
- package/dist/actions/apps/check_app_is_allowed.d.ts +20 -32
- package/dist/actions/apps/create_app_instance.d.ts +43 -63
- package/dist/actions/apps/get_app_attestation.d.ts +113 -779
- package/dist/actions/apps/get_app_cvms.d.ts +1 -5
- package/dist/actions/apps/get_app_device_allowlist.d.ts +26 -272
- package/dist/actions/apps/get_app_filter_options.d.ts +8 -24
- package/dist/actions/apps/get_app_info.d.ts +1 -5
- package/dist/actions/apps/get_app_list.d.ts +2 -26
- package/dist/actions/apps/get_app_revision_detail.d.ts +1 -9
- package/dist/actions/apps/get_app_revisions.d.ts +1 -9
- package/dist/actions/blockchains/add_compose_hash.d.ts +1 -13
- package/dist/actions/blockchains/add_device.d.ts +1 -13
- package/dist/actions/blockchains/deploy_app_auth.d.ts +3 -95
- package/dist/actions/blockchains/get_allowed_devices.d.ts +2 -12
- package/dist/actions/blockchains/remove_device.d.ts +1 -13
- package/dist/actions/blockchains/set_allow_any_device.d.ts +1 -13
- package/dist/actions/cvms/check_cvm_is_allowed.d.ts +13 -138
- package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +9 -45
- package/dist/actions/cvms/commit_cvm_provision.d.ts +32 -422
- package/dist/actions/cvms/commit_cvm_update.d.ts +70 -41
- package/dist/actions/cvms/confirm_cvm_patch.d.ts +62 -35
- package/dist/actions/cvms/cvm_annotations.d.ts +152 -0
- package/dist/actions/cvms/delete_cvm.d.ts +8 -14
- package/dist/actions/cvms/get_available_os_images.d.ts +70 -111
- package/dist/actions/cvms/get_cvm_attestation.d.ts +34 -392
- package/dist/actions/cvms/get_cvm_compose_file.d.ts +384 -614
- package/dist/actions/cvms/get_cvm_containers_stats.d.ts +25 -91
- package/dist/actions/cvms/get_cvm_docker_compose.d.ts +8 -14
- package/dist/actions/cvms/get_cvm_info.d.ts +6 -12
- package/dist/actions/cvms/get_cvm_init_scripts.d.ts +87 -0
- package/dist/actions/cvms/get_cvm_list.d.ts +7 -13
- package/dist/actions/cvms/get_cvm_network.d.ts +18 -50
- package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +8 -14
- package/dist/actions/cvms/get_cvm_state.d.ts +11 -37
- package/dist/actions/cvms/get_cvm_stats.d.ts +23 -149
- package/dist/actions/cvms/get_cvm_status_batch.d.ts +19 -209
- package/dist/actions/cvms/get_cvm_user_config.d.ts +13 -24
- package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +9 -27
- package/dist/actions/cvms/patch_cvm.d.ts +658 -295
- package/dist/actions/cvms/provision_cvm.d.ts +326 -1561
- package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +550 -953
- package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +74 -131
- package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +77 -297
- package/dist/actions/cvms/replicate_cvm.d.ts +7 -21
- package/dist/actions/cvms/restart_cvm.d.ts +3 -18
- package/dist/actions/cvms/shutdown_cvm.d.ts +6 -12
- package/dist/actions/cvms/start_cvm.d.ts +6 -12
- package/dist/actions/cvms/stop_cvm.d.ts +6 -12
- package/dist/actions/cvms/update_cvm_envs.d.ts +136 -203
- package/dist/actions/cvms/update_cvm_resources.d.ts +82 -48
- package/dist/actions/cvms/update_cvm_visibility.d.ts +90 -132
- package/dist/actions/cvms/update_docker_compose.d.ts +127 -202
- package/dist/actions/cvms/update_os_image.d.ts +55 -28
- package/dist/actions/cvms/update_prelaunch_script.d.ts +127 -202
- package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +118 -193
- package/dist/actions/cvms/watch_cvm_state.d.ts +5 -15
- package/dist/actions/get_available_nodes.d.ts +186 -1067
- package/dist/actions/get_cvm_create_resources.d.ts +138 -2489
- package/dist/actions/index.d.ts +8 -2
- package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +11 -23
- package/dist/actions/kms/get_kms_contract.d.ts +25 -27
- package/dist/actions/kms/get_kms_info.d.ts +3 -7
- package/dist/actions/kms/get_kms_list.d.ts +34 -88
- package/dist/actions/kms/get_kms_onchain_detail.d.ts +66 -664
- package/dist/actions/kms/list_kms_contract_nodes.d.ts +21 -53
- package/dist/actions/kms/list_kms_contracts.d.ts +33 -87
- package/dist/actions/kms/next_app_ids.d.ts +5 -25
- package/dist/actions/list-instance-types.d.ts +77 -257
- package/dist/actions/os_images/get_os_images.d.ts +38 -152
- package/dist/actions/ssh_keys/create_ssh_key.d.ts +11 -17
- package/dist/actions/ssh_keys/delete_ssh_key.d.ts +3 -7
- package/dist/actions/ssh_keys/get_cvm_ssh_keys.d.ts +113 -0
- package/dist/actions/ssh_keys/import_github_profile.d.ts +7 -21
- package/dist/actions/ssh_keys/list_ssh_keys.d.ts +2 -50
- package/dist/actions/ssh_keys/sync_github_ssh_keys.d.ts +8 -20
- package/dist/actions/ssh_keys/update_cvm_ssh_keys.d.ts +140 -0
- package/dist/actions/workspaces/get_workspace.d.ts +32 -28
- package/dist/actions/workspaces/get_workspace_nodes.d.ts +34 -321
- package/dist/actions/workspaces/get_workspace_quotas.d.ts +107 -1021
- package/dist/actions/workspaces/list_workspaces.d.ts +67 -369
- package/dist/client.d.ts +23 -4
- package/dist/create-client.d.ts +1772 -1
- package/dist/credentials/current_user_v20251028.d.ts +1 -17
- package/dist/credentials/current_user_v20260121.d.ts +22 -227
- package/dist/index.d.ts +0 -1
- package/dist/index.js +5010 -4265
- package/dist/index.mjs +4892 -4192
- package/dist/types/app_compose.d.ts +108 -221
- package/dist/types/app_info_v20251028.d.ts +22 -1067
- package/dist/types/app_info_v20260121.d.ts +430 -8900
- package/dist/types/app_revision.d.ts +15 -371
- package/dist/types/client.d.ts +16 -0
- package/dist/types/common.d.ts +6 -0
- package/dist/types/cvm_id.d.ts +12 -57
- package/dist/types/cvm_info.d.ts +33 -460
- package/dist/types/cvm_info_v20251028.d.ts +99 -820
- package/dist/types/cvm_info_v20260121.d.ts +247 -3160
- package/dist/types/kms_contract.d.ts +2 -32
- package/dist/types/kms_info.d.ts +34 -68
- package/dist/utils/define-action.d.ts +4 -4
- package/dist/utils/errors.d.ts +4 -36
- package/dist/utils/get_compose_hash.d.ts +36 -5
- package/dist/utils/get_mr_config_id.d.ts +94 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/placement-request.d.ts +3 -0
- package/package.json +4 -4
|
@@ -66,265 +66,49 @@ export declare const WorkspaceResponseSchema: z.ZodObject<{
|
|
|
66
66
|
name: z.ZodString;
|
|
67
67
|
slug: z.ZodNullable<z.ZodString>;
|
|
68
68
|
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
70
|
tier: z.ZodString;
|
|
70
71
|
role: z.ZodString;
|
|
71
72
|
is_default: z.ZodBoolean;
|
|
72
73
|
created_at: z.ZodString;
|
|
73
74
|
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
75
|
+
billing_status: z.ZodDefault<z.ZodEnum<{
|
|
76
|
+
active: "active";
|
|
77
|
+
suspended: "suspended";
|
|
78
|
+
abandoned: "abandoned";
|
|
79
|
+
}>>;
|
|
80
80
|
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
-
},
|
|
82
|
-
id: z.ZodString;
|
|
83
|
-
name: z.ZodString;
|
|
84
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
85
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
-
tier: z.ZodString;
|
|
87
|
-
role: z.ZodString;
|
|
88
|
-
is_default: z.ZodBoolean;
|
|
89
|
-
created_at: z.ZodString;
|
|
90
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
-
/**
|
|
92
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
93
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
94
|
-
*/
|
|
95
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
96
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
97
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
99
|
-
id: z.ZodString;
|
|
100
|
-
name: z.ZodString;
|
|
101
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
102
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
-
tier: z.ZodString;
|
|
104
|
-
role: z.ZodString;
|
|
105
|
-
is_default: z.ZodBoolean;
|
|
106
|
-
created_at: z.ZodString;
|
|
107
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
-
/**
|
|
109
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
110
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
111
|
-
*/
|
|
112
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
113
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
114
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
81
|
+
}, z.core.$loose>;
|
|
116
82
|
export declare const PaginationMetadataSchema: z.ZodObject<{
|
|
117
83
|
has_more: z.ZodBoolean;
|
|
118
84
|
next_cursor: z.ZodNullable<z.ZodString>;
|
|
119
85
|
total: z.ZodNullable<z.ZodNumber>;
|
|
120
|
-
},
|
|
121
|
-
has_more: z.ZodBoolean;
|
|
122
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
123
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
124
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
125
|
-
has_more: z.ZodBoolean;
|
|
126
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
127
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
128
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
86
|
+
}, z.core.$loose>;
|
|
129
87
|
export declare const ListWorkspacesSchema: z.ZodObject<{
|
|
130
88
|
data: z.ZodArray<z.ZodObject<{
|
|
131
89
|
id: z.ZodString;
|
|
132
90
|
name: z.ZodString;
|
|
133
91
|
slug: z.ZodNullable<z.ZodString>;
|
|
134
92
|
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
94
|
tier: z.ZodString;
|
|
136
95
|
role: z.ZodString;
|
|
137
96
|
is_default: z.ZodBoolean;
|
|
138
97
|
created_at: z.ZodString;
|
|
139
98
|
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
146
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
148
|
-
id: z.ZodString;
|
|
149
|
-
name: z.ZodString;
|
|
150
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
151
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
-
tier: z.ZodString;
|
|
153
|
-
role: z.ZodString;
|
|
154
|
-
is_default: z.ZodBoolean;
|
|
155
|
-
created_at: z.ZodString;
|
|
156
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
-
/**
|
|
158
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
159
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
160
|
-
*/
|
|
161
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
162
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
163
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
165
|
-
id: z.ZodString;
|
|
166
|
-
name: z.ZodString;
|
|
167
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
168
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
-
tier: z.ZodString;
|
|
170
|
-
role: z.ZodString;
|
|
171
|
-
is_default: z.ZodBoolean;
|
|
172
|
-
created_at: z.ZodString;
|
|
173
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
-
/**
|
|
175
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
176
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
177
|
-
*/
|
|
178
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
179
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
180
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
-
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
182
|
-
pagination: z.ZodObject<{
|
|
183
|
-
has_more: z.ZodBoolean;
|
|
184
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
185
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
186
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
187
|
-
has_more: z.ZodBoolean;
|
|
188
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
189
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
190
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
191
|
-
has_more: z.ZodBoolean;
|
|
192
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
193
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
194
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
195
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
196
|
-
data: z.ZodArray<z.ZodObject<{
|
|
197
|
-
id: z.ZodString;
|
|
198
|
-
name: z.ZodString;
|
|
199
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
200
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
201
|
-
tier: z.ZodString;
|
|
202
|
-
role: z.ZodString;
|
|
203
|
-
is_default: z.ZodBoolean;
|
|
204
|
-
created_at: z.ZodString;
|
|
205
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
-
/**
|
|
207
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
208
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
209
|
-
*/
|
|
210
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
211
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
99
|
+
billing_status: z.ZodDefault<z.ZodEnum<{
|
|
100
|
+
active: "active";
|
|
101
|
+
suspended: "suspended";
|
|
102
|
+
abandoned: "abandoned";
|
|
103
|
+
}>>;
|
|
212
104
|
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
|
-
},
|
|
214
|
-
id: z.ZodString;
|
|
215
|
-
name: z.ZodString;
|
|
216
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
217
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
218
|
-
tier: z.ZodString;
|
|
219
|
-
role: z.ZodString;
|
|
220
|
-
is_default: z.ZodBoolean;
|
|
221
|
-
created_at: z.ZodString;
|
|
222
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
223
|
-
/**
|
|
224
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
225
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
226
|
-
*/
|
|
227
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
228
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
229
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
230
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
231
|
-
id: z.ZodString;
|
|
232
|
-
name: z.ZodString;
|
|
233
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
234
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
-
tier: z.ZodString;
|
|
236
|
-
role: z.ZodString;
|
|
237
|
-
is_default: z.ZodBoolean;
|
|
238
|
-
created_at: z.ZodString;
|
|
239
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
-
/**
|
|
241
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
242
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
243
|
-
*/
|
|
244
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
245
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
246
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
247
|
-
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
105
|
+
}, z.core.$loose>>;
|
|
248
106
|
pagination: z.ZodObject<{
|
|
249
107
|
has_more: z.ZodBoolean;
|
|
250
108
|
next_cursor: z.ZodNullable<z.ZodString>;
|
|
251
109
|
total: z.ZodNullable<z.ZodNumber>;
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
255
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
256
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
257
|
-
has_more: z.ZodBoolean;
|
|
258
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
259
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
260
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
261
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
262
|
-
data: z.ZodArray<z.ZodObject<{
|
|
263
|
-
id: z.ZodString;
|
|
264
|
-
name: z.ZodString;
|
|
265
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
266
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
267
|
-
tier: z.ZodString;
|
|
268
|
-
role: z.ZodString;
|
|
269
|
-
is_default: z.ZodBoolean;
|
|
270
|
-
created_at: z.ZodString;
|
|
271
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
-
/**
|
|
273
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
274
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
275
|
-
*/
|
|
276
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
277
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
278
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
279
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
280
|
-
id: z.ZodString;
|
|
281
|
-
name: z.ZodString;
|
|
282
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
283
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
-
tier: z.ZodString;
|
|
285
|
-
role: z.ZodString;
|
|
286
|
-
is_default: z.ZodBoolean;
|
|
287
|
-
created_at: z.ZodString;
|
|
288
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
289
|
-
/**
|
|
290
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
291
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
292
|
-
*/
|
|
293
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
294
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
295
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
296
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
297
|
-
id: z.ZodString;
|
|
298
|
-
name: z.ZodString;
|
|
299
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
300
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
301
|
-
tier: z.ZodString;
|
|
302
|
-
role: z.ZodString;
|
|
303
|
-
is_default: z.ZodBoolean;
|
|
304
|
-
created_at: z.ZodString;
|
|
305
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
306
|
-
/**
|
|
307
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
308
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
309
|
-
*/
|
|
310
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
311
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
312
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
-
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
314
|
-
pagination: z.ZodObject<{
|
|
315
|
-
has_more: z.ZodBoolean;
|
|
316
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
317
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
318
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
319
|
-
has_more: z.ZodBoolean;
|
|
320
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
321
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
322
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
323
|
-
has_more: z.ZodBoolean;
|
|
324
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
325
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
326
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
327
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
110
|
+
}, z.core.$loose>;
|
|
111
|
+
}, z.core.$loose>;
|
|
328
112
|
export type WorkspaceResponse = z.infer<typeof WorkspaceResponseSchema>;
|
|
329
113
|
export type PaginationMetadata = z.infer<typeof PaginationMetadataSchema>;
|
|
330
114
|
export type ListWorkspaces = z.infer<typeof ListWorkspacesSchema>;
|
|
@@ -333,150 +117,64 @@ export type ListWorkspacesRequest = {
|
|
|
333
117
|
limit?: number;
|
|
334
118
|
};
|
|
335
119
|
declare const listWorkspaces: {
|
|
336
|
-
(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined): Promise<
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
role: z.ZodString;
|
|
361
|
-
is_default: z.ZodBoolean;
|
|
362
|
-
created_at: z.ZodString;
|
|
363
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
364
|
-
/**
|
|
365
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
366
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
367
|
-
*/
|
|
368
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
369
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
370
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
371
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
372
|
-
id: z.ZodString;
|
|
373
|
-
name: z.ZodString;
|
|
374
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
375
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
376
|
-
tier: z.ZodString;
|
|
377
|
-
role: z.ZodString;
|
|
378
|
-
is_default: z.ZodBoolean;
|
|
379
|
-
created_at: z.ZodString;
|
|
380
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
381
|
-
/**
|
|
382
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
383
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
384
|
-
*/
|
|
385
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
386
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
387
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
388
|
-
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
389
|
-
pagination: z.ZodObject<{
|
|
390
|
-
has_more: z.ZodBoolean;
|
|
391
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
392
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
393
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
394
|
-
has_more: z.ZodBoolean;
|
|
395
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
396
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
397
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
398
|
-
has_more: z.ZodBoolean;
|
|
399
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
400
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
401
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
402
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
120
|
+
(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined): Promise<{
|
|
121
|
+
[x: string]: unknown;
|
|
122
|
+
data: {
|
|
123
|
+
[x: string]: unknown;
|
|
124
|
+
id: string;
|
|
125
|
+
name: string;
|
|
126
|
+
slug: string | null;
|
|
127
|
+
tier: string;
|
|
128
|
+
role: string;
|
|
129
|
+
is_default: boolean;
|
|
130
|
+
created_at: string;
|
|
131
|
+
billing_status: "active" | "suspended" | "abandoned";
|
|
132
|
+
avatar_url?: string | null | undefined;
|
|
133
|
+
description?: string | null | undefined;
|
|
134
|
+
confidential_models_enabled?: boolean | undefined;
|
|
135
|
+
suspended_at?: string | null | undefined;
|
|
136
|
+
}[];
|
|
137
|
+
pagination: {
|
|
138
|
+
[x: string]: unknown;
|
|
139
|
+
has_more: boolean;
|
|
140
|
+
next_cursor: string | null;
|
|
141
|
+
total: number | null;
|
|
142
|
+
};
|
|
143
|
+
}>;
|
|
403
144
|
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined, parameters?: {
|
|
404
145
|
schema: T;
|
|
405
|
-
} | undefined): Promise<z.
|
|
146
|
+
} | undefined): Promise<z.core.output<T>>;
|
|
406
147
|
(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined, parameters?: {
|
|
407
148
|
schema: false;
|
|
408
149
|
} | undefined): Promise<unknown>;
|
|
409
150
|
}, safeListWorkspaces: {
|
|
410
|
-
(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined): Promise<import("../..").SafeResult<
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
role: z.ZodString;
|
|
435
|
-
is_default: z.ZodBoolean;
|
|
436
|
-
created_at: z.ZodString;
|
|
437
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
438
|
-
/**
|
|
439
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
440
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
441
|
-
*/
|
|
442
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
443
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
444
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
445
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
446
|
-
id: z.ZodString;
|
|
447
|
-
name: z.ZodString;
|
|
448
|
-
slug: z.ZodNullable<z.ZodString>;
|
|
449
|
-
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
450
|
-
tier: z.ZodString;
|
|
451
|
-
role: z.ZodString;
|
|
452
|
-
is_default: z.ZodBoolean;
|
|
453
|
-
created_at: z.ZodString;
|
|
454
|
-
confidential_models_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
455
|
-
/**
|
|
456
|
-
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
457
|
-
* an abandoned one is closed and read-only until its balance is settled.
|
|
458
|
-
*/
|
|
459
|
-
billing_status: z.ZodDefault<z.ZodEnum<["active", "suspended", "abandoned"]>>;
|
|
460
|
-
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
461
|
-
suspended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
462
|
-
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
463
|
-
pagination: z.ZodObject<{
|
|
464
|
-
has_more: z.ZodBoolean;
|
|
465
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
466
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
467
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
468
|
-
has_more: z.ZodBoolean;
|
|
469
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
470
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
471
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
472
|
-
has_more: z.ZodBoolean;
|
|
473
|
-
next_cursor: z.ZodNullable<z.ZodString>;
|
|
474
|
-
total: z.ZodNullable<z.ZodNumber>;
|
|
475
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
476
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
151
|
+
(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined): Promise<import("../..").SafeResult<{
|
|
152
|
+
[x: string]: unknown;
|
|
153
|
+
data: {
|
|
154
|
+
[x: string]: unknown;
|
|
155
|
+
id: string;
|
|
156
|
+
name: string;
|
|
157
|
+
slug: string | null;
|
|
158
|
+
tier: string;
|
|
159
|
+
role: string;
|
|
160
|
+
is_default: boolean;
|
|
161
|
+
created_at: string;
|
|
162
|
+
billing_status: "active" | "suspended" | "abandoned";
|
|
163
|
+
avatar_url?: string | null | undefined;
|
|
164
|
+
description?: string | null | undefined;
|
|
165
|
+
confidential_models_enabled?: boolean | undefined;
|
|
166
|
+
suspended_at?: string | null | undefined;
|
|
167
|
+
}[];
|
|
168
|
+
pagination: {
|
|
169
|
+
[x: string]: unknown;
|
|
170
|
+
has_more: boolean;
|
|
171
|
+
next_cursor: string | null;
|
|
172
|
+
total: number | null;
|
|
173
|
+
};
|
|
174
|
+
}>>;
|
|
477
175
|
<T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined, parameters?: {
|
|
478
176
|
schema: T;
|
|
479
|
-
} | undefined): Promise<import("../..").SafeResult<z.
|
|
177
|
+
} | undefined): Promise<import("../..").SafeResult<z.core.output<T>>>;
|
|
480
178
|
(client: Client<import("../..").ApiVersion>, params?: ListWorkspacesRequest | undefined, parameters?: {
|
|
481
179
|
schema: false;
|
|
482
180
|
} | undefined): Promise<import("../..").SafeResult<unknown>>;
|
package/dist/client.d.ts
CHANGED
|
@@ -6,6 +6,17 @@ import { PhalaCloudError } from "./utils/errors";
|
|
|
6
6
|
export type { SafeResult, FullResponse, RequestOptions, ApiVersion, DefaultApiVersion, } from "./types/client";
|
|
7
7
|
export declare const SUPPORTED_API_VERSIONS: readonly ["2025-10-28", "2026-01-21", "2026-05-22", "2026-06-23"];
|
|
8
8
|
export declare const DEFAULT_API_VERSION: DefaultApiVersion;
|
|
9
|
+
type BoundActions<A> = {
|
|
10
|
+
[K in keyof A]: A[K] extends (client: never, ...args: infer P) => infer R ? (...args: P) => R : never;
|
|
11
|
+
};
|
|
12
|
+
type ReboundActions<A> = {
|
|
13
|
+
[K in keyof A]: A[K] extends (...args: infer P) => unknown ? (...args: P) => unknown : unknown;
|
|
14
|
+
};
|
|
15
|
+
type VersionedExtension<C, V extends ApiVersion, NewV extends ApiVersion> = (C extends Pick<import("./create-client").Client<V>, "getAppInfo"> ? import("./create-client").Client<NewV> : Client<NewV>) & ReboundActions<Omit<C, keyof import("./create-client").Client<V>>>;
|
|
16
|
+
type ExtendedClient<C, V extends ApiVersion, A> = Omit<C, "withVersion" | "extend"> & BoundActions<A> & {
|
|
17
|
+
extend<B extends Record<string, unknown>>(actions: B | ((client: Client<ApiVersion>) => B)): ExtendedClient<Omit<C, "withVersion" | "extend"> & BoundActions<A>, V, B>;
|
|
18
|
+
withVersion<NewV extends ApiVersion>(version: NewV): ExtendedClient<VersionedExtension<Omit<C, "withVersion" | "extend">, V, NewV>, NewV, ReboundActions<A>>;
|
|
19
|
+
};
|
|
9
20
|
/**
|
|
10
21
|
* Client event types
|
|
11
22
|
*/
|
|
@@ -72,6 +83,8 @@ export declare class Client<V extends ApiVersion = DefaultApiVersion> {
|
|
|
72
83
|
*/
|
|
73
84
|
once<K extends keyof ClientEvents>(type: K, handler: Handler<ClientEvents[K]>): void;
|
|
74
85
|
once(type: "*", handler: Handler): void;
|
|
86
|
+
/** Decode only non-redirect responses, independently of user response hooks. */
|
|
87
|
+
private fetchData;
|
|
75
88
|
/**
|
|
76
89
|
* Generic request method (throws PhalaCloudError on error)
|
|
77
90
|
*/
|
|
@@ -163,7 +176,12 @@ export declare class Client<V extends ApiVersion = DefaultApiVersion> {
|
|
|
163
176
|
*/
|
|
164
177
|
withVersion<NewV extends ApiVersion>(version: NewV): Client<NewV>;
|
|
165
178
|
/**
|
|
166
|
-
* Extend client with additional actions
|
|
179
|
+
* Extend client with additional actions.
|
|
180
|
+
*
|
|
181
|
+
* A factory receives a client typed with the `ApiVersion` union. When
|
|
182
|
+
* `withVersion` creates a clone, it rebinds the actions and reruns the factory.
|
|
183
|
+
* Extension method return types become `unknown` on the clone because they
|
|
184
|
+
* may depend on the original version. Narrow the results before using them.
|
|
167
185
|
*
|
|
168
186
|
* @example
|
|
169
187
|
* ```typescript
|
|
@@ -174,9 +192,7 @@ export declare class Client<V extends ApiVersion = DefaultApiVersion> {
|
|
|
174
192
|
* await client.getCurrentUser() // Method call instead of function call
|
|
175
193
|
* ```
|
|
176
194
|
*/
|
|
177
|
-
extend<TActions extends Record<string, unknown>>(actions: TActions | ((client: Client<
|
|
178
|
-
[K in keyof TActions]: TActions[K] extends (client: Client<V>) => infer R ? () => R : TActions[K] extends (client: Client<V>, ...args: infer P) => infer R ? (...args: P) => R : never;
|
|
179
|
-
}>;
|
|
195
|
+
extend<TActions extends Record<string, unknown>>(actions: TActions | ((client: Client<ApiVersion>) => TActions)): Prettify<ExtendedClient<this, V, TActions>>;
|
|
180
196
|
}
|
|
181
197
|
/**
|
|
182
198
|
* Create a new HTTP client instance
|
|
@@ -219,4 +235,7 @@ export declare function createClient(config: ClientConfig<"2026-01-21"> & {
|
|
|
219
235
|
export declare function createClient(config: ClientConfig<"2025-10-28"> & {
|
|
220
236
|
version: "2025-10-28";
|
|
221
237
|
}): Client<"2025-10-28">;
|
|
238
|
+
export declare function createClient<V extends ApiVersion>(config: ClientConfig<V> & {
|
|
239
|
+
version: V;
|
|
240
|
+
}): Client<V>;
|
|
222
241
|
export declare function createClient(config?: ClientConfig): Client<DefaultApiVersion>;
|