@phala/cloud 0.5.0 → 0.6.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/dist/actions/cvms/get_cvm_init_scripts.d.ts +6 -1
- package/dist/actions/cvms/log-time.d.ts +5 -0
- package/dist/actions/cvms/logs.d.ts +64 -0
- package/dist/actions/cvms/patch_cvm.d.ts +7 -0
- package/dist/actions/cvms/provision_cvm.d.ts +3 -0
- package/dist/actions/cvms/put_cvm_init_scripts.d.ts +150 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/create-client.d.ts +129 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1066 -344
- package/dist/index.mjs +1052 -344
- package/dist/types/app_info_v20260121.d.ts +12 -0
- package/dist/types/cvm_info_v20251028.d.ts +1 -1
- package/dist/types/cvm_info_v20260121.d.ts +7 -0
- package/dist/user-agent.d.ts +30 -0
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ export declare const CvmInitScriptsSchema: z.ZodObject<{
|
|
|
19
19
|
selectable: z.ZodBoolean;
|
|
20
20
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
21
|
}, z.core.$strip>>;
|
|
22
|
+
has_custom_scripts: z.ZodBoolean;
|
|
22
23
|
}, z.core.$strip>;
|
|
23
24
|
export type CvmInitScript = z.infer<typeof CvmInitScriptSchema>;
|
|
24
25
|
export type CvmInitScripts = z.infer<typeof CvmInitScriptsSchema>;
|
|
@@ -43,7 +44,9 @@ export type GetCvmInitScriptsRequest = CvmIdInput;
|
|
|
43
44
|
*
|
|
44
45
|
* Returns every platform init script in its fixed run order: whether the CVM's
|
|
45
46
|
* current compose runs it, and whether the caller could select it (with the
|
|
46
|
-
* reason when not).
|
|
47
|
+
* reason when not). has_custom_scripts is true when the compose also runs a
|
|
48
|
+
* script that is not a platform script. Change the selection with
|
|
49
|
+
* `patchCvm({ init_scripts })` or replace raw scripts with `putCvmInitScripts`.
|
|
47
50
|
*
|
|
48
51
|
* @example
|
|
49
52
|
* ```typescript
|
|
@@ -61,6 +64,7 @@ declare const getCvmInitScripts: {
|
|
|
61
64
|
selectable: boolean;
|
|
62
65
|
reason?: string | null | undefined;
|
|
63
66
|
}[];
|
|
67
|
+
has_custom_scripts: boolean;
|
|
64
68
|
}>;
|
|
65
69
|
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
66
70
|
schema: T;
|
|
@@ -76,6 +80,7 @@ declare const getCvmInitScripts: {
|
|
|
76
80
|
selectable: boolean;
|
|
77
81
|
reason?: string | null | undefined;
|
|
78
82
|
}[];
|
|
83
|
+
has_custom_scripts: boolean;
|
|
79
84
|
}>>;
|
|
80
85
|
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: CvmIdInput, parameters: {
|
|
81
86
|
schema: T;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Client } from "../../client";
|
|
2
|
+
import { type CvmIdInput } from "../../types/cvm_id";
|
|
3
|
+
import { ResourceError } from "../../utils/errors";
|
|
4
|
+
export { resolveLogTimeWindow } from "./log-time";
|
|
5
|
+
/** API version that introduced CVMInfo.logs. Pinned so older clients still get URLs. */
|
|
6
|
+
export declare const CVM_LOGS_INFO_API_VERSION = "2026-01-21";
|
|
7
|
+
export type CvmLogChannel = "serial" | "stdout" | "stderr";
|
|
8
|
+
export type CvmLogFormat = "text" | "ndjson";
|
|
9
|
+
export type LogChannel = "stdout" | "stderr";
|
|
10
|
+
export type CvmLogSource = {
|
|
11
|
+
type: "node";
|
|
12
|
+
channel: CvmLogChannel;
|
|
13
|
+
} | {
|
|
14
|
+
type: "container";
|
|
15
|
+
name?: string;
|
|
16
|
+
matchContainerIdPrefix?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export interface CvmLogsOptions {
|
|
19
|
+
tail?: number | "all";
|
|
20
|
+
since?: string | number;
|
|
21
|
+
until?: string | number;
|
|
22
|
+
timestamps?: boolean;
|
|
23
|
+
ansi?: boolean;
|
|
24
|
+
format?: CvmLogFormat;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}
|
|
27
|
+
export interface CvmLogEntry {
|
|
28
|
+
channel: LogChannel;
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
/** Structured log-gateway error. Extends ResourceError so callers can use the SDK error hierarchy. */
|
|
32
|
+
export declare class LogAccessError extends ResourceError {
|
|
33
|
+
readonly code?: string;
|
|
34
|
+
readonly httpStatus?: number;
|
|
35
|
+
readonly suggestions: string[];
|
|
36
|
+
constructor(options: {
|
|
37
|
+
message: string;
|
|
38
|
+
code?: string;
|
|
39
|
+
httpStatus?: number;
|
|
40
|
+
suggestions?: readonly string[];
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Get a presigned CVM-level log URL for a given node channel. */
|
|
44
|
+
export declare function getCvmLogEndpoint(client: Client, id: CvmIdInput | string, channel: CvmLogChannel): Promise<string>;
|
|
45
|
+
export declare function fetchCvmChannelLogs(client: Client, id: CvmIdInput | string, channel: CvmLogChannel, options?: CvmLogsOptions): Promise<string>;
|
|
46
|
+
export declare function streamCvmChannelLogs(client: Client, id: CvmIdInput | string, channel: CvmLogChannel, onData: (data: string) => void, options?: CvmLogsOptions, signal?: AbortSignal): Promise<void>;
|
|
47
|
+
export declare function fetchContainerLogsEntries(client: Client, id: CvmIdInput | string, options?: CvmLogsOptions & {
|
|
48
|
+
container?: string;
|
|
49
|
+
matchContainerIdPrefix?: boolean;
|
|
50
|
+
}): Promise<CvmLogEntry[]>;
|
|
51
|
+
export declare function fetchContainerLogs(client: Client, id: CvmIdInput | string, options?: CvmLogsOptions & {
|
|
52
|
+
container?: string;
|
|
53
|
+
matchContainerIdPrefix?: boolean;
|
|
54
|
+
}): Promise<string>;
|
|
55
|
+
export declare function streamContainerLogsEntries(client: Client, id: CvmIdInput | string, onEntry: (entry: CvmLogEntry) => void, options?: CvmLogsOptions & {
|
|
56
|
+
container?: string;
|
|
57
|
+
matchContainerIdPrefix?: boolean;
|
|
58
|
+
}, signal?: AbortSignal): Promise<void>;
|
|
59
|
+
export declare function streamContainerLogs(client: Client, id: CvmIdInput | string, onData: (data: string) => void, options?: CvmLogsOptions & {
|
|
60
|
+
container?: string;
|
|
61
|
+
matchContainerIdPrefix?: boolean;
|
|
62
|
+
}, signal?: AbortSignal): Promise<void>;
|
|
63
|
+
export declare function fetchCvmLogs(client: Client, id: CvmIdInput | string, source: CvmLogSource, options?: CvmLogsOptions): Promise<string | CvmLogEntry[]>;
|
|
64
|
+
export declare function followCvmLogs(client: Client, id: CvmIdInput | string, source: CvmLogSource, options?: CvmLogsOptions): AsyncGenerator<string | CvmLogEntry>;
|
|
@@ -208,6 +208,7 @@ export declare const PatchCvmRequestSchema: z.ZodObject<{
|
|
|
208
208
|
docker_cleanup: "docker_cleanup";
|
|
209
209
|
env_merge: "env_merge";
|
|
210
210
|
}>>>;
|
|
211
|
+
init_script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
211
212
|
confirm_data_wipe: z.ZodOptional<z.ZodBoolean>;
|
|
212
213
|
encrypted_env: z.ZodOptional<z.ZodString>;
|
|
213
214
|
user_config: z.ZodOptional<z.ZodString>;
|
|
@@ -380,6 +381,7 @@ declare const patchCvm: {
|
|
|
380
381
|
features?: string[] | null | undefined;
|
|
381
382
|
} | undefined;
|
|
382
383
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
384
|
+
init_script?: string[] | undefined;
|
|
383
385
|
confirm_data_wipe?: boolean | undefined;
|
|
384
386
|
encrypted_env?: string | undefined;
|
|
385
387
|
user_config?: string | undefined;
|
|
@@ -479,6 +481,7 @@ declare const patchCvm: {
|
|
|
479
481
|
features?: string[] | null | undefined;
|
|
480
482
|
} | undefined;
|
|
481
483
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
484
|
+
init_script?: string[] | undefined;
|
|
482
485
|
confirm_data_wipe?: boolean | undefined;
|
|
483
486
|
encrypted_env?: string | undefined;
|
|
484
487
|
user_config?: string | undefined;
|
|
@@ -553,6 +556,7 @@ declare const patchCvm: {
|
|
|
553
556
|
features?: string[] | null | undefined;
|
|
554
557
|
} | undefined;
|
|
555
558
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
559
|
+
init_script?: string[] | undefined;
|
|
556
560
|
confirm_data_wipe?: boolean | undefined;
|
|
557
561
|
encrypted_env?: string | undefined;
|
|
558
562
|
user_config?: string | undefined;
|
|
@@ -628,6 +632,7 @@ declare const patchCvm: {
|
|
|
628
632
|
features?: string[] | null | undefined;
|
|
629
633
|
} | undefined;
|
|
630
634
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
635
|
+
init_script?: string[] | undefined;
|
|
631
636
|
confirm_data_wipe?: boolean | undefined;
|
|
632
637
|
encrypted_env?: string | undefined;
|
|
633
638
|
user_config?: string | undefined;
|
|
@@ -727,6 +732,7 @@ declare const patchCvm: {
|
|
|
727
732
|
features?: string[] | null | undefined;
|
|
728
733
|
} | undefined;
|
|
729
734
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
735
|
+
init_script?: string[] | undefined;
|
|
730
736
|
confirm_data_wipe?: boolean | undefined;
|
|
731
737
|
encrypted_env?: string | undefined;
|
|
732
738
|
user_config?: string | undefined;
|
|
@@ -801,6 +807,7 @@ declare const patchCvm: {
|
|
|
801
807
|
features?: string[] | null | undefined;
|
|
802
808
|
} | undefined;
|
|
803
809
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
810
|
+
init_script?: string[] | undefined;
|
|
804
811
|
confirm_data_wipe?: boolean | undefined;
|
|
805
812
|
encrypted_env?: string | undefined;
|
|
806
813
|
user_config?: string | undefined;
|
|
@@ -281,6 +281,7 @@ export declare const ProvisionCvmRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
281
281
|
target: z.ZodString;
|
|
282
282
|
verity_root: z.ZodString;
|
|
283
283
|
}, z.core.$strip>>>>;
|
|
284
|
+
init_script: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
284
285
|
}, z.core.$loose>>;
|
|
285
286
|
compose_file_raw: z.ZodOptional<z.ZodString>;
|
|
286
287
|
init_scripts: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
@@ -370,6 +371,7 @@ export declare const ProvisionCvmRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
370
371
|
target: string;
|
|
371
372
|
verity_root: string;
|
|
372
373
|
}[] | null | undefined;
|
|
374
|
+
init_script?: string | string[] | undefined;
|
|
373
375
|
} | undefined;
|
|
374
376
|
compose_file_raw?: string | undefined;
|
|
375
377
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
@@ -449,6 +451,7 @@ export declare const ProvisionCvmRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
449
451
|
target: string;
|
|
450
452
|
verity_root: string;
|
|
451
453
|
}[] | null | undefined;
|
|
454
|
+
init_script?: string | string[] | undefined;
|
|
452
455
|
} | undefined;
|
|
453
456
|
compose_file_raw?: string | undefined;
|
|
454
457
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type PatchCvmResult } from "./patch_cvm";
|
|
3
|
+
export declare const PutCvmInitScriptsRequestSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodOptional<z.ZodString>;
|
|
5
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
6
|
+
app_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
instance_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
name: z.ZodOptional<z.ZodString>;
|
|
9
|
+
scripts: z.ZodArray<z.ZodString>;
|
|
10
|
+
prepareOnly: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type PutCvmInitScriptsRequest = z.input<typeof PutCvmInitScriptsRequestSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Replace a CVM's raw init scripts
|
|
15
|
+
*
|
|
16
|
+
* System admins only. An empty list clears them. Same on-chain two-phase
|
|
17
|
+
* result as `patchCvm`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { createClient, putCvmInitScripts } from '@phala/cloud'
|
|
22
|
+
*
|
|
23
|
+
* const client = createClient()
|
|
24
|
+
* await putCvmInitScripts(client, {
|
|
25
|
+
* id: 'my-cvm',
|
|
26
|
+
* scripts: ['echo custom\\n'],
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const putCvmInitScripts: {
|
|
31
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
32
|
+
scripts: string[];
|
|
33
|
+
id?: string | undefined;
|
|
34
|
+
uuid?: string | undefined;
|
|
35
|
+
app_id?: string | undefined;
|
|
36
|
+
instance_id?: string | undefined;
|
|
37
|
+
name?: string | undefined;
|
|
38
|
+
prepareOnly?: boolean | undefined;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
requiresOnChainHash: false;
|
|
41
|
+
correlationId: string;
|
|
42
|
+
} | {
|
|
43
|
+
requiresOnChainHash: true;
|
|
44
|
+
composeHash: string;
|
|
45
|
+
appId: string;
|
|
46
|
+
deviceId: string;
|
|
47
|
+
kmsInfo: {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
id: string;
|
|
50
|
+
slug: string | null;
|
|
51
|
+
url: string;
|
|
52
|
+
version: string;
|
|
53
|
+
chain_id: number | null;
|
|
54
|
+
kms_contract_address: `0x${string}`;
|
|
55
|
+
gateway_app_id: `0x${string}`;
|
|
56
|
+
k256_pubkey?: string | null | undefined;
|
|
57
|
+
};
|
|
58
|
+
commitToken?: string | undefined;
|
|
59
|
+
commitUrl?: string | undefined;
|
|
60
|
+
apiCommitUrl?: string | undefined;
|
|
61
|
+
onchainStatus?: {
|
|
62
|
+
compose_hash_allowed: boolean;
|
|
63
|
+
device_id_allowed: boolean;
|
|
64
|
+
is_allowed: boolean;
|
|
65
|
+
} | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
68
|
+
scripts: string[];
|
|
69
|
+
id?: string | undefined;
|
|
70
|
+
uuid?: string | undefined;
|
|
71
|
+
app_id?: string | undefined;
|
|
72
|
+
instance_id?: string | undefined;
|
|
73
|
+
name?: string | undefined;
|
|
74
|
+
prepareOnly?: boolean | undefined;
|
|
75
|
+
}, parameters: {
|
|
76
|
+
schema: T;
|
|
77
|
+
}): Promise<z.core.output<T>>;
|
|
78
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
79
|
+
scripts: string[];
|
|
80
|
+
id?: string | undefined;
|
|
81
|
+
uuid?: string | undefined;
|
|
82
|
+
app_id?: string | undefined;
|
|
83
|
+
instance_id?: string | undefined;
|
|
84
|
+
name?: string | undefined;
|
|
85
|
+
prepareOnly?: boolean | undefined;
|
|
86
|
+
}, parameters: {
|
|
87
|
+
schema: false;
|
|
88
|
+
}): Promise<unknown>;
|
|
89
|
+
}, safePutCvmInitScripts: {
|
|
90
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
91
|
+
scripts: string[];
|
|
92
|
+
id?: string | undefined;
|
|
93
|
+
uuid?: string | undefined;
|
|
94
|
+
app_id?: string | undefined;
|
|
95
|
+
instance_id?: string | undefined;
|
|
96
|
+
name?: string | undefined;
|
|
97
|
+
prepareOnly?: boolean | undefined;
|
|
98
|
+
}): Promise<import("../..").SafeResult<{
|
|
99
|
+
requiresOnChainHash: false;
|
|
100
|
+
correlationId: string;
|
|
101
|
+
} | {
|
|
102
|
+
requiresOnChainHash: true;
|
|
103
|
+
composeHash: string;
|
|
104
|
+
appId: string;
|
|
105
|
+
deviceId: string;
|
|
106
|
+
kmsInfo: {
|
|
107
|
+
[x: string]: unknown;
|
|
108
|
+
id: string;
|
|
109
|
+
slug: string | null;
|
|
110
|
+
url: string;
|
|
111
|
+
version: string;
|
|
112
|
+
chain_id: number | null;
|
|
113
|
+
kms_contract_address: `0x${string}`;
|
|
114
|
+
gateway_app_id: `0x${string}`;
|
|
115
|
+
k256_pubkey?: string | null | undefined;
|
|
116
|
+
};
|
|
117
|
+
commitToken?: string | undefined;
|
|
118
|
+
commitUrl?: string | undefined;
|
|
119
|
+
apiCommitUrl?: string | undefined;
|
|
120
|
+
onchainStatus?: {
|
|
121
|
+
compose_hash_allowed: boolean;
|
|
122
|
+
device_id_allowed: boolean;
|
|
123
|
+
is_allowed: boolean;
|
|
124
|
+
} | undefined;
|
|
125
|
+
}>>;
|
|
126
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
127
|
+
scripts: string[];
|
|
128
|
+
id?: string | undefined;
|
|
129
|
+
uuid?: string | undefined;
|
|
130
|
+
app_id?: string | undefined;
|
|
131
|
+
instance_id?: string | undefined;
|
|
132
|
+
name?: string | undefined;
|
|
133
|
+
prepareOnly?: boolean | undefined;
|
|
134
|
+
}, parameters: {
|
|
135
|
+
schema: T;
|
|
136
|
+
}): Promise<import("../..").SafeResult<z.core.output<T>>>;
|
|
137
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
138
|
+
scripts: string[];
|
|
139
|
+
id?: string | undefined;
|
|
140
|
+
uuid?: string | undefined;
|
|
141
|
+
app_id?: string | undefined;
|
|
142
|
+
instance_id?: string | undefined;
|
|
143
|
+
name?: string | undefined;
|
|
144
|
+
prepareOnly?: boolean | undefined;
|
|
145
|
+
}, parameters: {
|
|
146
|
+
schema: false;
|
|
147
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
148
|
+
};
|
|
149
|
+
export { putCvmInitScripts, safePutCvmInitScripts };
|
|
150
|
+
export type { PatchCvmResult as PutCvmInitScriptsResult };
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export { getCvmStatusBatch, safeGetCvmStatusBatch, CvmResourceUsageSchema, CvmSt
|
|
|
64
64
|
export { getCvmUserConfig, safeGetCvmUserConfig, CvmUserConfigSchema, GetCvmUserConfigRequestSchema, type CvmUserConfig, type GetCvmUserConfigRequest, } from "./cvms/get_cvm_user_config";
|
|
65
65
|
export { getCvmAnnotations, safeGetCvmAnnotations, updateCvmAnnotations, safeUpdateCvmAnnotations, CvmAnnotationsSchema, GetCvmAnnotationsRequestSchema, UpdateCvmAnnotationsRequestSchema, type CvmAnnotations, type GetCvmAnnotationsRequest, type UpdateCvmAnnotationsRequest, } from "./cvms/cvm_annotations";
|
|
66
66
|
export { getCvmInitScripts, safeGetCvmInitScripts, CvmInitScriptSchema, CvmInitScriptsSchema, GetCvmInitScriptsRequestSchema, type CvmInitScript, type CvmInitScripts, type GetCvmInitScriptsRequest, } from "./cvms/get_cvm_init_scripts";
|
|
67
|
+
export { putCvmInitScripts, safePutCvmInitScripts, PutCvmInitScriptsRequestSchema, type PutCvmInitScriptsRequest, type PutCvmInitScriptsResult, } from "./cvms/put_cvm_init_scripts";
|
|
67
68
|
export { listSshKeys, safeListSshKeys, SshKeySchema, ListSshKeysResponseSchema, type SshKey, type ListSshKeysResponse, } from "./ssh_keys/list_ssh_keys";
|
|
68
69
|
export { importGithubProfileSshKeys, safeImportGithubProfileSshKeys, ImportGithubProfileRequestSchema, ImportGithubProfileResponseSchema, type ImportGithubProfileRequest, type ImportGithubProfileResponse, } from "./ssh_keys/import_github_profile";
|
|
69
70
|
export { createSshKey, safeCreateSshKey, CreateSshKeyRequestSchema, type CreateSshKeyRequest, } from "./ssh_keys/create_ssh_key";
|
package/dist/create-client.d.ts
CHANGED
|
@@ -277,6 +277,7 @@ declare const additionalActions: {
|
|
|
277
277
|
features?: string[] | null | undefined;
|
|
278
278
|
} | undefined;
|
|
279
279
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
280
|
+
init_script?: string[] | undefined;
|
|
280
281
|
confirm_data_wipe?: boolean | undefined;
|
|
281
282
|
encrypted_env?: string | undefined;
|
|
282
283
|
user_config?: string | undefined;
|
|
@@ -376,6 +377,7 @@ declare const additionalActions: {
|
|
|
376
377
|
features?: string[] | null | undefined;
|
|
377
378
|
} | undefined;
|
|
378
379
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
380
|
+
init_script?: string[] | undefined;
|
|
379
381
|
confirm_data_wipe?: boolean | undefined;
|
|
380
382
|
encrypted_env?: string | undefined;
|
|
381
383
|
user_config?: string | undefined;
|
|
@@ -450,6 +452,7 @@ declare const additionalActions: {
|
|
|
450
452
|
features?: string[] | null | undefined;
|
|
451
453
|
} | undefined;
|
|
452
454
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
455
|
+
init_script?: string[] | undefined;
|
|
453
456
|
confirm_data_wipe?: boolean | undefined;
|
|
454
457
|
encrypted_env?: string | undefined;
|
|
455
458
|
user_config?: string | undefined;
|
|
@@ -526,6 +529,7 @@ declare const additionalActions: {
|
|
|
526
529
|
features?: string[] | null | undefined;
|
|
527
530
|
} | undefined;
|
|
528
531
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
532
|
+
init_script?: string[] | undefined;
|
|
529
533
|
confirm_data_wipe?: boolean | undefined;
|
|
530
534
|
encrypted_env?: string | undefined;
|
|
531
535
|
user_config?: string | undefined;
|
|
@@ -625,6 +629,7 @@ declare const additionalActions: {
|
|
|
625
629
|
features?: string[] | null | undefined;
|
|
626
630
|
} | undefined;
|
|
627
631
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
632
|
+
init_script?: string[] | undefined;
|
|
628
633
|
confirm_data_wipe?: boolean | undefined;
|
|
629
634
|
encrypted_env?: string | undefined;
|
|
630
635
|
user_config?: string | undefined;
|
|
@@ -699,6 +704,7 @@ declare const additionalActions: {
|
|
|
699
704
|
features?: string[] | null | undefined;
|
|
700
705
|
} | undefined;
|
|
701
706
|
init_scripts?: ("docker_cleanup" | "env_merge")[] | undefined;
|
|
707
|
+
init_script?: string[] | undefined;
|
|
702
708
|
confirm_data_wipe?: boolean | undefined;
|
|
703
709
|
encrypted_env?: string | undefined;
|
|
704
710
|
user_config?: string | undefined;
|
|
@@ -1079,6 +1085,7 @@ declare const additionalActions: {
|
|
|
1079
1085
|
selectable: boolean;
|
|
1080
1086
|
reason?: string | null | undefined;
|
|
1081
1087
|
}[];
|
|
1088
|
+
has_custom_scripts: boolean;
|
|
1082
1089
|
}>;
|
|
1083
1090
|
<T extends z.ZodTypeAny>(client: BaseClient<ApiVersion>, params: import("./types").CvmIdInput, parameters: {
|
|
1084
1091
|
schema: T;
|
|
@@ -1095,6 +1102,7 @@ declare const additionalActions: {
|
|
|
1095
1102
|
selectable: boolean;
|
|
1096
1103
|
reason?: string | null | undefined;
|
|
1097
1104
|
}[];
|
|
1105
|
+
has_custom_scripts: boolean;
|
|
1098
1106
|
}>>;
|
|
1099
1107
|
<T extends z.ZodTypeAny>(client: BaseClient<ApiVersion>, params: import("./types").CvmIdInput, parameters: {
|
|
1100
1108
|
schema: T;
|
|
@@ -1103,6 +1111,126 @@ declare const additionalActions: {
|
|
|
1103
1111
|
schema: false;
|
|
1104
1112
|
}): Promise<SafeResult<unknown>>;
|
|
1105
1113
|
};
|
|
1114
|
+
putCvmInitScripts: {
|
|
1115
|
+
(client: BaseClient<ApiVersion>, params: {
|
|
1116
|
+
scripts: string[];
|
|
1117
|
+
id?: string | undefined;
|
|
1118
|
+
uuid?: string | undefined;
|
|
1119
|
+
app_id?: string | undefined;
|
|
1120
|
+
instance_id?: string | undefined;
|
|
1121
|
+
name?: string | undefined;
|
|
1122
|
+
prepareOnly?: boolean | undefined;
|
|
1123
|
+
}): Promise<{
|
|
1124
|
+
requiresOnChainHash: false;
|
|
1125
|
+
correlationId: string;
|
|
1126
|
+
} | {
|
|
1127
|
+
requiresOnChainHash: true;
|
|
1128
|
+
composeHash: string;
|
|
1129
|
+
appId: string;
|
|
1130
|
+
deviceId: string;
|
|
1131
|
+
kmsInfo: {
|
|
1132
|
+
[x: string]: unknown;
|
|
1133
|
+
id: string;
|
|
1134
|
+
slug: string | null;
|
|
1135
|
+
url: string;
|
|
1136
|
+
version: string;
|
|
1137
|
+
chain_id: number | null;
|
|
1138
|
+
kms_contract_address: `0x${string}`;
|
|
1139
|
+
gateway_app_id: `0x${string}`;
|
|
1140
|
+
k256_pubkey?: string | null | undefined;
|
|
1141
|
+
};
|
|
1142
|
+
commitToken?: string | undefined;
|
|
1143
|
+
commitUrl?: string | undefined;
|
|
1144
|
+
apiCommitUrl?: string | undefined;
|
|
1145
|
+
onchainStatus?: {
|
|
1146
|
+
compose_hash_allowed: boolean;
|
|
1147
|
+
device_id_allowed: boolean;
|
|
1148
|
+
is_allowed: boolean;
|
|
1149
|
+
} | undefined;
|
|
1150
|
+
}>;
|
|
1151
|
+
<T extends z.ZodTypeAny>(client: BaseClient<ApiVersion>, params: {
|
|
1152
|
+
scripts: string[];
|
|
1153
|
+
id?: string | undefined;
|
|
1154
|
+
uuid?: string | undefined;
|
|
1155
|
+
app_id?: string | undefined;
|
|
1156
|
+
instance_id?: string | undefined;
|
|
1157
|
+
name?: string | undefined;
|
|
1158
|
+
prepareOnly?: boolean | undefined;
|
|
1159
|
+
}, parameters: {
|
|
1160
|
+
schema: T;
|
|
1161
|
+
}): Promise<z.core.output<T>>;
|
|
1162
|
+
(client: BaseClient<ApiVersion>, params: {
|
|
1163
|
+
scripts: string[];
|
|
1164
|
+
id?: string | undefined;
|
|
1165
|
+
uuid?: string | undefined;
|
|
1166
|
+
app_id?: string | undefined;
|
|
1167
|
+
instance_id?: string | undefined;
|
|
1168
|
+
name?: string | undefined;
|
|
1169
|
+
prepareOnly?: boolean | undefined;
|
|
1170
|
+
}, parameters: {
|
|
1171
|
+
schema: false;
|
|
1172
|
+
}): Promise<unknown>;
|
|
1173
|
+
};
|
|
1174
|
+
safePutCvmInitScripts: {
|
|
1175
|
+
(client: BaseClient<ApiVersion>, params: {
|
|
1176
|
+
scripts: string[];
|
|
1177
|
+
id?: string | undefined;
|
|
1178
|
+
uuid?: string | undefined;
|
|
1179
|
+
app_id?: string | undefined;
|
|
1180
|
+
instance_id?: string | undefined;
|
|
1181
|
+
name?: string | undefined;
|
|
1182
|
+
prepareOnly?: boolean | undefined;
|
|
1183
|
+
}): Promise<SafeResult<{
|
|
1184
|
+
requiresOnChainHash: false;
|
|
1185
|
+
correlationId: string;
|
|
1186
|
+
} | {
|
|
1187
|
+
requiresOnChainHash: true;
|
|
1188
|
+
composeHash: string;
|
|
1189
|
+
appId: string;
|
|
1190
|
+
deviceId: string;
|
|
1191
|
+
kmsInfo: {
|
|
1192
|
+
[x: string]: unknown;
|
|
1193
|
+
id: string;
|
|
1194
|
+
slug: string | null;
|
|
1195
|
+
url: string;
|
|
1196
|
+
version: string;
|
|
1197
|
+
chain_id: number | null;
|
|
1198
|
+
kms_contract_address: `0x${string}`;
|
|
1199
|
+
gateway_app_id: `0x${string}`;
|
|
1200
|
+
k256_pubkey?: string | null | undefined;
|
|
1201
|
+
};
|
|
1202
|
+
commitToken?: string | undefined;
|
|
1203
|
+
commitUrl?: string | undefined;
|
|
1204
|
+
apiCommitUrl?: string | undefined;
|
|
1205
|
+
onchainStatus?: {
|
|
1206
|
+
compose_hash_allowed: boolean;
|
|
1207
|
+
device_id_allowed: boolean;
|
|
1208
|
+
is_allowed: boolean;
|
|
1209
|
+
} | undefined;
|
|
1210
|
+
}>>;
|
|
1211
|
+
<T extends z.ZodTypeAny>(client: BaseClient<ApiVersion>, params: {
|
|
1212
|
+
scripts: string[];
|
|
1213
|
+
id?: string | undefined;
|
|
1214
|
+
uuid?: string | undefined;
|
|
1215
|
+
app_id?: string | undefined;
|
|
1216
|
+
instance_id?: string | undefined;
|
|
1217
|
+
name?: string | undefined;
|
|
1218
|
+
prepareOnly?: boolean | undefined;
|
|
1219
|
+
}, parameters: {
|
|
1220
|
+
schema: T;
|
|
1221
|
+
}): Promise<SafeResult<z.core.output<T>>>;
|
|
1222
|
+
(client: BaseClient<ApiVersion>, params: {
|
|
1223
|
+
scripts: string[];
|
|
1224
|
+
id?: string | undefined;
|
|
1225
|
+
uuid?: string | undefined;
|
|
1226
|
+
app_id?: string | undefined;
|
|
1227
|
+
instance_id?: string | undefined;
|
|
1228
|
+
name?: string | undefined;
|
|
1229
|
+
prepareOnly?: boolean | undefined;
|
|
1230
|
+
}, parameters: {
|
|
1231
|
+
schema: false;
|
|
1232
|
+
}): Promise<SafeResult<unknown>>;
|
|
1233
|
+
};
|
|
1106
1234
|
setAppLaunchToken: {
|
|
1107
1235
|
(client: BaseClient<ApiVersion>, params: {
|
|
1108
1236
|
appId: string;
|
|
@@ -1781,7 +1909,7 @@ declare const onChainActions: {
|
|
|
1781
1909
|
type OnChainActions = typeof onChainActions;
|
|
1782
1910
|
type VersionedAppAction = "getAppList" | "safeGetAppList" | "getAppInfo" | "safeGetAppInfo" | "getAppCvms" | "safeGetAppCvms" | "replicateCvm" | "safeReplicateCvm";
|
|
1783
1911
|
type SimpleAdditionalAction = "revokeCurrentApiToken" | "safeRevokeCurrentApiToken";
|
|
1784
|
-
type SchemaAction = "getWorkspaceNodes" | "safeGetWorkspaceNodes" | "getWorkspaceQuotas" | "safeGetWorkspaceQuotas" | "patchCvm" | "safePatchCvm" | "confirmCvmPatch" | "safeConfirmCvmPatch" | "commitCvmUpdate" | "safeCommitCvmUpdate" | "getCvmStatusBatch" | "safeGetCvmStatusBatch" | "getCvmUserConfig" | "safeGetCvmUserConfig" | "getCvmAnnotations" | "safeGetCvmAnnotations" | "updateCvmAnnotations" | "safeUpdateCvmAnnotations" | "getCvmInitScripts" | "safeGetCvmInitScripts" | "setAppLaunchToken" | "safeSetAppLaunchToken" | "clearAppLaunchToken" | "safeClearAppLaunchToken" | "getCvmSshKeys" | "safeGetCvmSshKeys" | "updateCvmSshKeys" | "safeUpdateCvmSshKeys" | "checkAppIsAllowed" | "safeCheckAppIsAllowed" | "createAppInstance" | "safeCreateAppInstance" | "getAppAttestation" | "safeGetAppAttestation";
|
|
1912
|
+
type SchemaAction = "getWorkspaceNodes" | "safeGetWorkspaceNodes" | "getWorkspaceQuotas" | "safeGetWorkspaceQuotas" | "patchCvm" | "safePatchCvm" | "confirmCvmPatch" | "safeConfirmCvmPatch" | "commitCvmUpdate" | "safeCommitCvmUpdate" | "getCvmStatusBatch" | "safeGetCvmStatusBatch" | "getCvmUserConfig" | "safeGetCvmUserConfig" | "getCvmAnnotations" | "safeGetCvmAnnotations" | "updateCvmAnnotations" | "safeUpdateCvmAnnotations" | "getCvmInitScripts" | "safeGetCvmInitScripts" | "putCvmInitScripts" | "safePutCvmInitScripts" | "setAppLaunchToken" | "safeSetAppLaunchToken" | "clearAppLaunchToken" | "safeClearAppLaunchToken" | "getCvmSshKeys" | "safeGetCvmSshKeys" | "updateCvmSshKeys" | "safeUpdateCvmSshKeys" | "checkAppIsAllowed" | "safeCheckAppIsAllowed" | "createAppInstance" | "safeCreateAppInstance" | "getAppAttestation" | "safeGetAppAttestation";
|
|
1785
1913
|
type SchemaBoundAction<F, Safe extends boolean> = F extends {
|
|
1786
1914
|
(client: never, ...args: infer P): infer R;
|
|
1787
1915
|
(client: never, ...args: never[]): unknown;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { createClient, type Client } from "./create-client";
|
|
|
3
3
|
export * from "./types";
|
|
4
4
|
export * from "./credentials";
|
|
5
5
|
export * from "./actions";
|
|
6
|
+
export { LogAccessError, fetchCvmLogs, followCvmLogs, fetchCvmChannelLogs, streamCvmChannelLogs, fetchContainerLogs, fetchContainerLogsEntries, streamContainerLogs, streamContainerLogsEntries, getCvmLogEndpoint, resolveLogTimeWindow, type CvmLogChannel, type CvmLogEntry, type CvmLogFormat, type CvmLogSource, type CvmLogsOptions, type LogChannel, } from "./actions/cvms/logs";
|
|
6
7
|
export * from "./utils";
|
|
7
8
|
export { defineAction, defineSimpleAction } from "./utils/define-action";
|
|
8
9
|
export { parseEnv, parseEnvVars } from "./parse_dotenv";
|