@phala/cloud 0.2.5 → 0.2.9

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.
@@ -0,0 +1,447 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Patch CVM (unified update)
4
+ *
5
+ * Applies partial updates to a CVM via the unified PATCH endpoint. Only fields
6
+ * present in the request are applied (true PATCH semantics).
7
+ *
8
+ * For contract-owned KMS (ETHEREUM/BASE), compose-hash-affecting changes trigger
9
+ * a two-phase flow: the first call returns `{ requiresOnChainHash: true, ... }`
10
+ * with the compose hash to register on-chain. After registration, call
11
+ * `confirmCvmPatch` with the compose hash and transaction hash.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { createClient, patchCvm, confirmCvmPatch, addComposeHash } from '@phala/cloud'
16
+ *
17
+ * const client = createClient()
18
+ *
19
+ * // Simple update (non-on-chain KMS or non-compose-hash-affecting fields)
20
+ * const result = await patchCvm(client, {
21
+ * id: 'my-cvm',
22
+ * vcpu: 4,
23
+ * memory: 8192,
24
+ * })
25
+ * // result.requiresOnChainHash === false
26
+ * console.log(result.correlationId)
27
+ *
28
+ * // On-chain KMS compose update (two-phase)
29
+ * const result = await patchCvm(client, {
30
+ * id: 'my-cvm',
31
+ * docker_compose_file: newComposeYaml,
32
+ * })
33
+ *
34
+ * if (result.requiresOnChainHash) {
35
+ * const tx = await addComposeHash(client, {
36
+ * composeHash: result.composeHash,
37
+ * kmsContractAddress: result.kmsInfo.kms_contract_address,
38
+ * // ... wallet config
39
+ * })
40
+ * await confirmCvmPatch(client, {
41
+ * id: 'my-cvm',
42
+ * composeHash: result.composeHash,
43
+ * transactionHash: tx.transactionHash,
44
+ * })
45
+ * }
46
+ * ```
47
+ */
48
+ export declare const PatchCvmRequestSchema: z.ZodEffects<z.ZodObject<{
49
+ id: z.ZodOptional<z.ZodString>;
50
+ uuid: z.ZodOptional<z.ZodString>;
51
+ app_id: z.ZodOptional<z.ZodString>;
52
+ instance_id: z.ZodOptional<z.ZodString>;
53
+ name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
54
+ } & {
55
+ docker_compose_file: z.ZodOptional<z.ZodString>;
56
+ pre_launch_script: z.ZodOptional<z.ZodString>;
57
+ allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
58
+ public_logs: z.ZodOptional<z.ZodBoolean>;
59
+ public_sysinfo: z.ZodOptional<z.ZodBoolean>;
60
+ public_tcbinfo: z.ZodOptional<z.ZodBoolean>;
61
+ encrypted_env: z.ZodOptional<z.ZodString>;
62
+ user_config: z.ZodOptional<z.ZodString>;
63
+ gpus: z.ZodOptional<z.ZodObject<{
64
+ count: z.ZodNumber;
65
+ product_name: z.ZodOptional<z.ZodString>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ count: number;
68
+ product_name?: string | undefined;
69
+ }, {
70
+ count: number;
71
+ product_name?: string | undefined;
72
+ }>>;
73
+ vcpu: z.ZodOptional<z.ZodNumber>;
74
+ memory: z.ZodOptional<z.ZodNumber>;
75
+ disk_size: z.ZodOptional<z.ZodNumber>;
76
+ image: z.ZodOptional<z.ZodString>;
77
+ shutdown_timeout: z.ZodOptional<z.ZodNumber>;
78
+ allow_force_stop: z.ZodOptional<z.ZodBoolean>;
79
+ prepareOnly: z.ZodOptional<z.ZodBoolean>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ name?: string | undefined;
82
+ image?: string | undefined;
83
+ id?: string | undefined;
84
+ app_id?: string | undefined;
85
+ instance_id?: string | undefined;
86
+ vcpu?: number | undefined;
87
+ memory?: number | undefined;
88
+ disk_size?: number | undefined;
89
+ public_sysinfo?: boolean | undefined;
90
+ public_logs?: boolean | undefined;
91
+ gpus?: {
92
+ count: number;
93
+ product_name?: string | undefined;
94
+ } | undefined;
95
+ public_tcbinfo?: boolean | undefined;
96
+ uuid?: string | undefined;
97
+ allowed_envs?: string[] | undefined;
98
+ docker_compose_file?: string | undefined;
99
+ pre_launch_script?: string | undefined;
100
+ encrypted_env?: string | undefined;
101
+ user_config?: string | undefined;
102
+ shutdown_timeout?: number | undefined;
103
+ allow_force_stop?: boolean | undefined;
104
+ prepareOnly?: boolean | undefined;
105
+ }, {
106
+ name?: string | undefined;
107
+ image?: string | undefined;
108
+ id?: string | undefined;
109
+ app_id?: string | undefined;
110
+ instance_id?: string | undefined;
111
+ vcpu?: number | undefined;
112
+ memory?: number | undefined;
113
+ disk_size?: number | undefined;
114
+ public_sysinfo?: boolean | undefined;
115
+ public_logs?: boolean | undefined;
116
+ gpus?: {
117
+ count: number;
118
+ product_name?: string | undefined;
119
+ } | undefined;
120
+ public_tcbinfo?: boolean | undefined;
121
+ uuid?: string | undefined;
122
+ allowed_envs?: string[] | undefined;
123
+ docker_compose_file?: string | undefined;
124
+ pre_launch_script?: string | undefined;
125
+ encrypted_env?: string | undefined;
126
+ user_config?: string | undefined;
127
+ shutdown_timeout?: number | undefined;
128
+ allow_force_stop?: boolean | undefined;
129
+ prepareOnly?: boolean | undefined;
130
+ }>, any, any>;
131
+ export type PatchCvmRequest = z.input<typeof PatchCvmRequestSchema>;
132
+ declare const PatchCvmAcceptedSchema: z.ZodObject<{
133
+ requiresOnChainHash: z.ZodLiteral<false>;
134
+ correlationId: z.ZodString;
135
+ }, "strip", z.ZodTypeAny, {
136
+ requiresOnChainHash: false;
137
+ correlationId: string;
138
+ }, {
139
+ requiresOnChainHash: false;
140
+ correlationId: string;
141
+ }>;
142
+ declare const PatchCvmHashRequiredSchema: z.ZodObject<{
143
+ requiresOnChainHash: z.ZodLiteral<true>;
144
+ composeHash: z.ZodString;
145
+ appId: z.ZodString;
146
+ deviceId: z.ZodString;
147
+ kmsInfo: z.ZodEffects<z.ZodObject<{
148
+ id: z.ZodString;
149
+ slug: z.ZodNullable<z.ZodString>;
150
+ url: z.ZodString;
151
+ version: z.ZodString;
152
+ chain_id: z.ZodNullable<z.ZodNumber>;
153
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
154
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
155
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
156
+ id: z.ZodString;
157
+ slug: z.ZodNullable<z.ZodString>;
158
+ url: z.ZodString;
159
+ version: z.ZodString;
160
+ chain_id: z.ZodNullable<z.ZodNumber>;
161
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
162
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
163
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
164
+ id: z.ZodString;
165
+ slug: z.ZodNullable<z.ZodString>;
166
+ url: z.ZodString;
167
+ version: z.ZodString;
168
+ chain_id: z.ZodNullable<z.ZodNumber>;
169
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
170
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
171
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
172
+ id: z.ZodString;
173
+ slug: z.ZodNullable<z.ZodString>;
174
+ url: z.ZodString;
175
+ version: z.ZodString;
176
+ chain_id: z.ZodNullable<z.ZodNumber>;
177
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
178
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
179
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
180
+ id: z.ZodString;
181
+ slug: z.ZodNullable<z.ZodString>;
182
+ url: z.ZodString;
183
+ version: z.ZodString;
184
+ chain_id: z.ZodNullable<z.ZodNumber>;
185
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
186
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
187
+ }, z.ZodTypeAny, "passthrough">>;
188
+ commitToken: z.ZodOptional<z.ZodString>;
189
+ commitUrl: z.ZodOptional<z.ZodString>;
190
+ apiCommitUrl: z.ZodOptional<z.ZodString>;
191
+ onchainStatus: z.ZodOptional<z.ZodObject<{
192
+ compose_hash_allowed: z.ZodBoolean;
193
+ device_id_allowed: z.ZodBoolean;
194
+ is_allowed: z.ZodBoolean;
195
+ }, "strip", z.ZodTypeAny, {
196
+ compose_hash_allowed: boolean;
197
+ device_id_allowed: boolean;
198
+ is_allowed: boolean;
199
+ }, {
200
+ compose_hash_allowed: boolean;
201
+ device_id_allowed: boolean;
202
+ is_allowed: boolean;
203
+ }>>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ deviceId: string;
206
+ composeHash: string;
207
+ appId: string;
208
+ requiresOnChainHash: true;
209
+ kmsInfo: {
210
+ version: string;
211
+ id: string;
212
+ slug: string | null;
213
+ url: string;
214
+ chain_id: number | null;
215
+ kms_contract_address: `0x${string}`;
216
+ gateway_app_id: `0x${string}`;
217
+ } & {
218
+ [k: string]: unknown;
219
+ };
220
+ commitToken?: string | undefined;
221
+ commitUrl?: string | undefined;
222
+ apiCommitUrl?: string | undefined;
223
+ onchainStatus?: {
224
+ compose_hash_allowed: boolean;
225
+ device_id_allowed: boolean;
226
+ is_allowed: boolean;
227
+ } | undefined;
228
+ }, {
229
+ deviceId: string;
230
+ composeHash: string;
231
+ appId: string;
232
+ requiresOnChainHash: true;
233
+ kmsInfo: {
234
+ version: string;
235
+ id: string;
236
+ slug: string | null;
237
+ url: string;
238
+ chain_id: number | null;
239
+ kms_contract_address: string | null;
240
+ gateway_app_id: string | null;
241
+ } & {
242
+ [k: string]: unknown;
243
+ };
244
+ commitToken?: string | undefined;
245
+ commitUrl?: string | undefined;
246
+ apiCommitUrl?: string | undefined;
247
+ onchainStatus?: {
248
+ compose_hash_allowed: boolean;
249
+ device_id_allowed: boolean;
250
+ is_allowed: boolean;
251
+ } | undefined;
252
+ }>;
253
+ export declare const PatchCvmResultSchema: z.ZodDiscriminatedUnion<"requiresOnChainHash", [z.ZodObject<{
254
+ requiresOnChainHash: z.ZodLiteral<false>;
255
+ correlationId: z.ZodString;
256
+ }, "strip", z.ZodTypeAny, {
257
+ requiresOnChainHash: false;
258
+ correlationId: string;
259
+ }, {
260
+ requiresOnChainHash: false;
261
+ correlationId: string;
262
+ }>, z.ZodObject<{
263
+ requiresOnChainHash: z.ZodLiteral<true>;
264
+ composeHash: z.ZodString;
265
+ appId: z.ZodString;
266
+ deviceId: z.ZodString;
267
+ kmsInfo: z.ZodEffects<z.ZodObject<{
268
+ id: z.ZodString;
269
+ slug: z.ZodNullable<z.ZodString>;
270
+ url: z.ZodString;
271
+ version: z.ZodString;
272
+ chain_id: z.ZodNullable<z.ZodNumber>;
273
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
274
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
275
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
276
+ id: z.ZodString;
277
+ slug: z.ZodNullable<z.ZodString>;
278
+ url: z.ZodString;
279
+ version: z.ZodString;
280
+ chain_id: z.ZodNullable<z.ZodNumber>;
281
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
282
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
283
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
284
+ id: z.ZodString;
285
+ slug: z.ZodNullable<z.ZodString>;
286
+ url: z.ZodString;
287
+ version: z.ZodString;
288
+ chain_id: z.ZodNullable<z.ZodNumber>;
289
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
290
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
291
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
292
+ id: z.ZodString;
293
+ slug: z.ZodNullable<z.ZodString>;
294
+ url: z.ZodString;
295
+ version: z.ZodString;
296
+ chain_id: z.ZodNullable<z.ZodNumber>;
297
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
298
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
299
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
300
+ id: z.ZodString;
301
+ slug: z.ZodNullable<z.ZodString>;
302
+ url: z.ZodString;
303
+ version: z.ZodString;
304
+ chain_id: z.ZodNullable<z.ZodNumber>;
305
+ kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
306
+ gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
307
+ }, z.ZodTypeAny, "passthrough">>;
308
+ commitToken: z.ZodOptional<z.ZodString>;
309
+ commitUrl: z.ZodOptional<z.ZodString>;
310
+ apiCommitUrl: z.ZodOptional<z.ZodString>;
311
+ onchainStatus: z.ZodOptional<z.ZodObject<{
312
+ compose_hash_allowed: z.ZodBoolean;
313
+ device_id_allowed: z.ZodBoolean;
314
+ is_allowed: z.ZodBoolean;
315
+ }, "strip", z.ZodTypeAny, {
316
+ compose_hash_allowed: boolean;
317
+ device_id_allowed: boolean;
318
+ is_allowed: boolean;
319
+ }, {
320
+ compose_hash_allowed: boolean;
321
+ device_id_allowed: boolean;
322
+ is_allowed: boolean;
323
+ }>>;
324
+ }, "strip", z.ZodTypeAny, {
325
+ deviceId: string;
326
+ composeHash: string;
327
+ appId: string;
328
+ requiresOnChainHash: true;
329
+ kmsInfo: {
330
+ version: string;
331
+ id: string;
332
+ slug: string | null;
333
+ url: string;
334
+ chain_id: number | null;
335
+ kms_contract_address: `0x${string}`;
336
+ gateway_app_id: `0x${string}`;
337
+ } & {
338
+ [k: string]: unknown;
339
+ };
340
+ commitToken?: string | undefined;
341
+ commitUrl?: string | undefined;
342
+ apiCommitUrl?: string | undefined;
343
+ onchainStatus?: {
344
+ compose_hash_allowed: boolean;
345
+ device_id_allowed: boolean;
346
+ is_allowed: boolean;
347
+ } | undefined;
348
+ }, {
349
+ deviceId: string;
350
+ composeHash: string;
351
+ appId: string;
352
+ requiresOnChainHash: true;
353
+ kmsInfo: {
354
+ version: string;
355
+ id: string;
356
+ slug: string | null;
357
+ url: string;
358
+ chain_id: number | null;
359
+ kms_contract_address: string | null;
360
+ gateway_app_id: string | null;
361
+ } & {
362
+ [k: string]: unknown;
363
+ };
364
+ commitToken?: string | undefined;
365
+ commitUrl?: string | undefined;
366
+ apiCommitUrl?: string | undefined;
367
+ onchainStatus?: {
368
+ compose_hash_allowed: boolean;
369
+ device_id_allowed: boolean;
370
+ is_allowed: boolean;
371
+ } | undefined;
372
+ }>]>;
373
+ export type PatchCvmResult = z.infer<typeof PatchCvmResultSchema>;
374
+ export type PatchCvmAccepted = z.infer<typeof PatchCvmAcceptedSchema>;
375
+ export type PatchCvmHashRequired = z.infer<typeof PatchCvmHashRequiredSchema>;
376
+ declare const patchCvm: {
377
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any): Promise<{
378
+ requiresOnChainHash: false;
379
+ correlationId: string;
380
+ } | {
381
+ deviceId: string;
382
+ composeHash: string;
383
+ appId: string;
384
+ requiresOnChainHash: true;
385
+ kmsInfo: {
386
+ version: string;
387
+ id: string;
388
+ slug: string | null;
389
+ url: string;
390
+ chain_id: number | null;
391
+ kms_contract_address: `0x${string}`;
392
+ gateway_app_id: `0x${string}`;
393
+ } & {
394
+ [k: string]: unknown;
395
+ };
396
+ commitToken?: string | undefined;
397
+ commitUrl?: string | undefined;
398
+ apiCommitUrl?: string | undefined;
399
+ onchainStatus?: {
400
+ compose_hash_allowed: boolean;
401
+ device_id_allowed: boolean;
402
+ is_allowed: boolean;
403
+ } | undefined;
404
+ }>;
405
+ <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
406
+ schema: T;
407
+ } | undefined): Promise<z.TypeOf<T>>;
408
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
409
+ schema: false;
410
+ } | undefined): Promise<unknown>;
411
+ }, safePatchCvm: {
412
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any): Promise<import("../..").SafeResult<{
413
+ requiresOnChainHash: false;
414
+ correlationId: string;
415
+ } | {
416
+ deviceId: string;
417
+ composeHash: string;
418
+ appId: string;
419
+ requiresOnChainHash: true;
420
+ kmsInfo: {
421
+ version: string;
422
+ id: string;
423
+ slug: string | null;
424
+ url: string;
425
+ chain_id: number | null;
426
+ kms_contract_address: `0x${string}`;
427
+ gateway_app_id: `0x${string}`;
428
+ } & {
429
+ [k: string]: unknown;
430
+ };
431
+ commitToken?: string | undefined;
432
+ commitUrl?: string | undefined;
433
+ apiCommitUrl?: string | undefined;
434
+ onchainStatus?: {
435
+ compose_hash_allowed: boolean;
436
+ device_id_allowed: boolean;
437
+ is_allowed: boolean;
438
+ } | undefined;
439
+ }>>;
440
+ <T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
441
+ schema: T;
442
+ } | undefined): Promise<import("../..").SafeResult<z.TypeOf<T>>>;
443
+ (client: import("../..").BaseClient<import("../..").ApiVersion>, params?: any, parameters?: {
444
+ schema: false;
445
+ } | undefined): Promise<import("../..").SafeResult<unknown>>;
446
+ };
447
+ export { patchCvm, safePatchCvm };
@@ -357,6 +357,7 @@ export declare const ProvisionCvmComposeFileUpdateResultSchema: z.ZodObject<{
357
357
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
358
358
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
359
359
  }, z.ZodTypeAny, "passthrough">>>>;
360
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
360
361
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
361
362
  app_id: z.ZodNullable<z.ZodString>;
362
363
  device_id: z.ZodNullable<z.ZodString>;
@@ -402,6 +403,7 @@ export declare const ProvisionCvmComposeFileUpdateResultSchema: z.ZodObject<{
402
403
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
403
404
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
404
405
  }, z.ZodTypeAny, "passthrough">>>>;
406
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
405
407
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
406
408
  app_id: z.ZodNullable<z.ZodString>;
407
409
  device_id: z.ZodNullable<z.ZodString>;
@@ -447,6 +449,7 @@ export declare const ProvisionCvmComposeFileUpdateResultSchema: z.ZodObject<{
447
449
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
448
450
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
449
451
  }, z.ZodTypeAny, "passthrough">>>>;
452
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
450
453
  }, z.ZodTypeAny, "passthrough">>;
451
454
  export declare const ProvisionCvmComposeFileUpdateSchema: z.ZodObject<{
452
455
  app_id: z.ZodNullable<z.ZodString>;
@@ -493,6 +496,7 @@ export declare const ProvisionCvmComposeFileUpdateSchema: z.ZodObject<{
493
496
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
494
497
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
495
498
  }, z.ZodTypeAny, "passthrough">>>>;
499
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
496
500
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
497
501
  app_id: z.ZodNullable<z.ZodString>;
498
502
  device_id: z.ZodNullable<z.ZodString>;
@@ -538,6 +542,7 @@ export declare const ProvisionCvmComposeFileUpdateSchema: z.ZodObject<{
538
542
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
539
543
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
540
544
  }, z.ZodTypeAny, "passthrough">>>>;
545
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
541
546
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
542
547
  app_id: z.ZodNullable<z.ZodString>;
543
548
  device_id: z.ZodNullable<z.ZodString>;
@@ -583,6 +588,7 @@ export declare const ProvisionCvmComposeFileUpdateSchema: z.ZodObject<{
583
588
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
584
589
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
585
590
  }, z.ZodTypeAny, "passthrough">>>>;
591
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
586
592
  }, z.ZodTypeAny, "passthrough">>;
587
593
  export type ProvisionCvmComposeFileUpdateRequest = z.input<typeof ProvisionCvmComposeFileUpdateRequestSchema>;
588
594
  export type ProvisionCvmComposeFileUpdateResult = z.infer<typeof ProvisionCvmComposeFileUpdateResultSchema>;
@@ -663,6 +669,7 @@ declare const provisionCvmComposeFileUpdate: {
663
669
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
664
670
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
665
671
  }, z.ZodTypeAny, "passthrough">>>>;
672
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
666
673
  }, z.ZodTypeAny, "passthrough">>;
667
674
  <T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
668
675
  app_compose: {
@@ -785,6 +792,7 @@ declare const provisionCvmComposeFileUpdate: {
785
792
  kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
786
793
  gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
787
794
  }, z.ZodTypeAny, "passthrough">>>>;
795
+ compose_hash_registered: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
788
796
  }, z.ZodTypeAny, "passthrough">>>;
789
797
  <T extends z.ZodTypeAny>(client: Client<import("../..").ApiVersion>, params: {
790
798
  app_compose: {
@@ -9,6 +9,8 @@ export { removeDevice, safeRemoveDevice, type RemoveDeviceParameters, type Remov
9
9
  export { setAllowAnyDevice, safeSetAllowAnyDevice, type SetAllowAnyDeviceParameters, type SetAllowAnyDeviceReturnType, SetAllowAnyDeviceSchema, type SetAllowAnyDevice, type SetAllowAnyDeviceRequest, type SafeSetAllowAnyDeviceResult, } from "./blockchains/set_allow_any_device";
10
10
  export { getAllowedDevices, safeGetAllowedDevices, GetAllowedDevicesSchema, type GetAllowedDevices, type GetAllowedDevicesRequest, type SafeGetAllowedDevicesResult, } from "./blockchains/get_allowed_devices";
11
11
  export { checkDeviceAllowed, safeCheckDeviceAllowed, type CheckDeviceAllowedRequest, } from "./blockchains/check_device_allowed";
12
+ export { checkComposeHashAllowed, safeCheckComposeHashAllowed, type CheckComposeHashAllowedRequest, } from "./blockchains/check_compose_hash_allowed";
13
+ export { checkOnChainPrerequisites, safeCheckOnChainPrerequisites, type CheckOnChainPrerequisitesRequest, type OnChainPrerequisites, } from "./blockchains/check_on_chain_prerequisites";
12
14
  export { dstackAppAbi } from "./blockchains/abi/dstack_app";
13
15
  export { getCvmComposeFile, safeGetCvmComposeFile, type GetCvmComposeFileResult, GetCvmComposeFileRequestSchema, type GetCvmComposeFileRequest, } from "./cvms/get_cvm_compose_file";
14
16
  export { provisionCvmComposeFileUpdate, safeProvisionCvmComposeFileUpdate, ProvisionCvmComposeFileUpdateRequestSchema, type ProvisionCvmComposeFileUpdateRequest, ProvisionCvmComposeFileUpdateResultSchema, type ProvisionCvmComposeFileUpdateResult, } from "./cvms/provision_cvm_compose_file_update";
@@ -39,6 +41,9 @@ export { getCvmState, safeGetCvmState, CvmStateSchema, GetCvmStateRequestSchema,
39
41
  export { watchCvmState, WatchCvmStateRequestSchema, type WatchCvmStateRequest, type WatchCvmStateOptions, type SSEEvent, WatchAbortedError, MaxRetriesExceededError, } from "./cvms/watch_cvm_state";
40
42
  export { getCvmAttestation, safeGetCvmAttestation, CvmAttestationSchema, GetCvmAttestationRequestSchema, CertificateSubjectSchema, CertificateIssuerSchema, CertificateSchema, EventLogSchema, TcbInfoSchema, type GetCvmAttestationRequest, type CvmAttestation, } from "./cvms/get_cvm_attestation";
41
43
  export { getCvmDockerCompose, safeGetCvmDockerCompose, GetCvmDockerComposeRequestSchema, type GetCvmDockerComposeRequest, } from "./cvms/get_cvm_docker_compose";
44
+ export { patchCvm, safePatchCvm, PatchCvmRequestSchema, PatchCvmResultSchema, type PatchCvmRequest, type PatchCvmResult, type PatchCvmAccepted, type PatchCvmHashRequired, } from "./cvms/patch_cvm";
45
+ export { confirmCvmPatch, safeConfirmCvmPatch, ConfirmCvmPatchRequestSchema, type ConfirmCvmPatchRequest, type ConfirmCvmPatchResult, } from "./cvms/confirm_cvm_patch";
46
+ export { commitCvmUpdate, safeCommitCvmUpdate, CommitCvmUpdateRequestSchema, type CommitCvmUpdateRequest, type CommitCvmUpdateResult, } from "./cvms/commit_cvm_update";
42
47
  export { updateCvmResources, safeUpdateCvmResources, UpdateCvmResourcesRequestSchema, type UpdateCvmResourcesRequest, } from "./cvms/update_cvm_resources";
43
48
  export { updateCvmVisibility, safeUpdateCvmVisibility, UpdateCvmVisibilityRequestSchema, type UpdateCvmVisibilityRequest, } from "./cvms/update_cvm_visibility";
44
49
  export { refreshCvmInstanceId, safeRefreshCvmInstanceId, InstanceIdRefreshResultSchema, RefreshCvmInstanceIdRequestSchema, type InstanceIdRefreshResult, type RefreshCvmInstanceIdRequest, } from "./cvms/refresh_cvm_instance_id";
@@ -55,9 +60,13 @@ export { importGithubProfileSshKeys, safeImportGithubProfileSshKeys, ImportGithu
55
60
  export { createSshKey, safeCreateSshKey, CreateSshKeyRequestSchema, type CreateSshKeyRequest, } from "./ssh_keys/create_ssh_key";
56
61
  export { deleteSshKey, safeDeleteSshKey, DeleteSshKeyRequestSchema, type DeleteSshKeyRequest, } from "./ssh_keys/delete_ssh_key";
57
62
  export { syncGithubSshKeys, safeSyncGithubSshKeys, SyncGithubSshKeysResponseSchema, type SyncGithubSshKeysResponse, } from "./ssh_keys/sync_github_ssh_keys";
63
+ export { checkCvmIsAllowed, safeCheckCvmIsAllowed, IsAllowedResultSchema, CheckCvmIsAllowedRequestSchema, type IsAllowedResult, type CheckCvmIsAllowedRequest, } from "./cvms/check_cvm_is_allowed";
64
+ export { checkAppIsAllowed, safeCheckAppIsAllowed, CheckAppIsAllowedRequestSchema, type CheckAppIsAllowedRequest, } from "./apps/check_app_is_allowed";
65
+ export { checkAppCvmsIsAllowed, safeCheckAppCvmsIsAllowed, AppCvmsBatchIsAllowedResponseSchema, CheckAppCvmsIsAllowedRequestSchema, type AppCvmsBatchIsAllowedResponse, type CheckAppCvmsIsAllowedRequest, } from "./apps/check_app_cvms_is_allowed";
58
66
  export { getAppList, safeGetAppList, GetAppListRequestSchema, type GetAppListRequest, } from "./apps/get_app_list";
59
67
  export { getAppInfo, safeGetAppInfo, GetAppInfoRequestSchema, type GetAppInfoRequest, } from "./apps/get_app_info";
60
68
  export { getAppCvms, safeGetAppCvms, GetAppCvmsRequestSchema, type GetAppCvmsRequest, } from "./apps/get_app_cvms";
69
+ export { createAppInstance, safeCreateAppInstance, CreateAppInstanceRequestSchema, type CreateAppInstanceRequest, } from "./apps/create_app_instance";
61
70
  export { getAppDeviceAllowlist, safeGetAppDeviceAllowlist, GetAppDeviceAllowlistRequestSchema, type GetAppDeviceAllowlistRequest, type DeviceAllowlistResponse, type DeviceAllowlistItem, } from "./apps/get_app_device_allowlist";
62
71
  export { getAppRevisions, safeGetAppRevisions, GetAppRevisionsRequestSchema, type GetAppRevisionsRequest, } from "./apps/get_app_revisions";
63
72
  export { getAppRevisionDetail, safeGetAppRevisionDetail, GetAppRevisionDetailRequestSchema, type GetAppRevisionDetailRequest, } from "./apps/get_app_revision_detail";
package/dist/client.d.ts CHANGED
@@ -87,6 +87,11 @@ export declare class Client<V extends ApiVersion = DefaultApiVersion> {
87
87
  * Perform GET request (throws PhalaCloudError on error)
88
88
  */
89
89
  get<T = unknown>(request: FetchRequest, options?: Omit<FetchOptions, "method">): Promise<T>;
90
+ /**
91
+ * Build request options, stripping Content-Type when body is FormData
92
+ * so the browser/runtime sets the correct multipart boundary automatically.
93
+ */
94
+ private buildRequestOptions;
90
95
  /**
91
96
  * Perform POST request (throws PhalaCloudError on error)
92
97
  */