@phala/cloud 0.1.1-beta.1 → 0.1.1-beta.3

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.
@@ -10,6 +10,8 @@ export declare const LooseAppComposeSchema: z.ZodObject<{
10
10
  public_sysinfo: z.ZodOptional<z.ZodBoolean>;
11
11
  tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
12
12
  pre_launch_script: z.ZodOptional<z.ZodString>;
13
+ env_pubkey: z.ZodOptional<z.ZodString>;
14
+ salt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
13
15
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14
16
  allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
17
  docker_compose_file: z.ZodString;
@@ -21,6 +23,8 @@ export declare const LooseAppComposeSchema: z.ZodObject<{
21
23
  public_sysinfo: z.ZodOptional<z.ZodBoolean>;
22
24
  tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
23
25
  pre_launch_script: z.ZodOptional<z.ZodString>;
26
+ env_pubkey: z.ZodOptional<z.ZodString>;
27
+ salt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
24
28
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
25
29
  allowed_envs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
30
  docker_compose_file: z.ZodString;
@@ -32,5 +36,7 @@ export declare const LooseAppComposeSchema: z.ZodObject<{
32
36
  public_sysinfo: z.ZodOptional<z.ZodBoolean>;
33
37
  tproxy_enabled: z.ZodOptional<z.ZodBoolean>;
34
38
  pre_launch_script: z.ZodOptional<z.ZodString>;
39
+ env_pubkey: z.ZodOptional<z.ZodString>;
40
+ salt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
41
  }, z.ZodTypeAny, "passthrough">>;
36
42
  export type LooseAppCompose = z.infer<typeof LooseAppComposeSchema>;
@@ -0,0 +1,110 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * CVM ID object schema - use this with .extend() to add more fields
4
+ * This schema does NOT include the refine validation, allowing you to extend first
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const MySchema = CvmIdObjectSchema.extend({
9
+ * name: z.string()
10
+ * }).refine(
11
+ * (data) => !!(data.id || data.uuid || data.app_id || data.instance_id),
12
+ * "One of id, uuid, app_id, or instance_id must be provided"
13
+ * );
14
+ * ```
15
+ */
16
+ export declare const CvmIdObjectSchema: z.ZodObject<{
17
+ /** Direct CVM ID (any format) */
18
+ id: z.ZodOptional<z.ZodString>;
19
+ /** UUID format (with or without dashes) */
20
+ uuid: z.ZodOptional<z.ZodString>;
21
+ /** App ID (40 characters, optionally prefixed with 'app_id_') */
22
+ app_id: z.ZodOptional<z.ZodString>;
23
+ /** Instance ID (40 characters, optionally prefixed with 'instance_') */
24
+ instance_id: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ id?: string | undefined;
27
+ app_id?: string | undefined;
28
+ instance_id?: string | undefined;
29
+ uuid?: string | undefined;
30
+ }, {
31
+ id?: string | undefined;
32
+ app_id?: string | undefined;
33
+ instance_id?: string | undefined;
34
+ uuid?: string | undefined;
35
+ }>;
36
+ /**
37
+ * Helper function to add CVM ID validation refine to any schema
38
+ */
39
+ export declare const refineCvmId: <T extends z.ZodTypeAny>(schema: T) => z.ZodEffects<T, any, any>;
40
+ /**
41
+ * Base CVM ID Schema with validation
42
+ * For extending with additional fields, use CvmIdObjectSchema.extend() then call refineCvmId()
43
+ */
44
+ export declare const CvmIdBaseSchema: z.ZodEffects<z.ZodObject<{
45
+ /** Direct CVM ID (any format) */
46
+ id: z.ZodOptional<z.ZodString>;
47
+ /** UUID format (with or without dashes) */
48
+ uuid: z.ZodOptional<z.ZodString>;
49
+ /** App ID (40 characters, optionally prefixed with 'app_id_') */
50
+ app_id: z.ZodOptional<z.ZodString>;
51
+ /** Instance ID (40 characters, optionally prefixed with 'instance_') */
52
+ instance_id: z.ZodOptional<z.ZodString>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ id?: string | undefined;
55
+ app_id?: string | undefined;
56
+ instance_id?: string | undefined;
57
+ uuid?: string | undefined;
58
+ }, {
59
+ id?: string | undefined;
60
+ app_id?: string | undefined;
61
+ instance_id?: string | undefined;
62
+ uuid?: string | undefined;
63
+ }>, any, any>;
64
+ /**
65
+ * CVM ID Schema - supports multiple identifier formats
66
+ * Automatically transforms to the correct format for API calls
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * const result1 = CvmIdSchema.parse({ id: "cvm-123" });
71
+ * const result2 = CvmIdSchema.parse({ uuid: "550e8400-e29b-41d4-a716-446655440000" });
72
+ * ```
73
+ */
74
+ export declare const CvmIdSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
75
+ /** Direct CVM ID (any format) */
76
+ id: z.ZodOptional<z.ZodString>;
77
+ /** UUID format (with or without dashes) */
78
+ uuid: z.ZodOptional<z.ZodString>;
79
+ /** App ID (40 characters, optionally prefixed with 'app_id_') */
80
+ app_id: z.ZodOptional<z.ZodString>;
81
+ /** Instance ID (40 characters, optionally prefixed with 'instance_') */
82
+ instance_id: z.ZodOptional<z.ZodString>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ id?: string | undefined;
85
+ app_id?: string | undefined;
86
+ instance_id?: string | undefined;
87
+ uuid?: string | undefined;
88
+ }, {
89
+ id?: string | undefined;
90
+ app_id?: string | undefined;
91
+ instance_id?: string | undefined;
92
+ uuid?: string | undefined;
93
+ }>, any, any>, {
94
+ cvmId: string;
95
+ }, any>;
96
+ /**
97
+ * Input type for CVM ID
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * const identifier: CvmIdInput = { id: "cvm-123" };
102
+ * const identifier2: CvmIdInput = { uuid: "550e8400-e29b-41d4-a716-446655440000" };
103
+ * ```
104
+ */
105
+ export type CvmIdInput = {
106
+ id?: string;
107
+ uuid?: string;
108
+ app_id?: string;
109
+ instance_id?: string;
110
+ };