phala 1.1.5 → 1.1.6
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/api/index.d.ts +36 -33
- package/dist/api/index.js +36 -25
- package/dist/index.js +195 -168
- package/package.json +2 -2
package/dist/api/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { CvmInfoDetailV20260121 } from '@phala/cloud';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { CvmLegacyDetail } from '@phala/cloud';
|
|
3
|
-
export { CvmLegacyDetail as CvmInfoResponse } from '@phala/cloud';
|
|
4
3
|
|
|
5
4
|
declare const dockerConfigSchema: z.ZodObject<{
|
|
6
5
|
password: z.ZodString;
|
|
@@ -123,10 +122,10 @@ declare const postCvmResponseSchema: z.ZodObject<{
|
|
|
123
122
|
created_at: z.ZodString;
|
|
124
123
|
encrypted_env_pubkey: z.ZodNullable<z.ZodString>;
|
|
125
124
|
}, "strip", z.ZodTypeAny, {
|
|
126
|
-
status?: string;
|
|
127
125
|
name?: string;
|
|
128
126
|
vcpu?: number;
|
|
129
127
|
memory?: number;
|
|
128
|
+
status?: string;
|
|
130
129
|
id?: number;
|
|
131
130
|
app_id?: string;
|
|
132
131
|
instance_id?: string;
|
|
@@ -148,10 +147,10 @@ declare const postCvmResponseSchema: z.ZodObject<{
|
|
|
148
147
|
created_at?: string;
|
|
149
148
|
encrypted_env_pubkey?: string;
|
|
150
149
|
}, {
|
|
151
|
-
status?: string;
|
|
152
150
|
name?: string;
|
|
153
151
|
vcpu?: number;
|
|
154
152
|
memory?: number;
|
|
153
|
+
status?: string;
|
|
155
154
|
id?: number;
|
|
156
155
|
app_id?: string;
|
|
157
156
|
instance_id?: string;
|
|
@@ -307,10 +306,10 @@ declare const replicateCvmResponseSchema: z.ZodObject<{
|
|
|
307
306
|
created_at: z.ZodString;
|
|
308
307
|
encrypted_env_pubkey: z.ZodNullable<z.ZodString>;
|
|
309
308
|
}, "strip", z.ZodTypeAny, {
|
|
310
|
-
status?: string;
|
|
311
309
|
name?: string;
|
|
312
310
|
vcpu?: number;
|
|
313
311
|
memory?: number;
|
|
312
|
+
status?: string;
|
|
314
313
|
id?: number;
|
|
315
314
|
app_id?: string;
|
|
316
315
|
instance_id?: string;
|
|
@@ -332,10 +331,10 @@ declare const replicateCvmResponseSchema: z.ZodObject<{
|
|
|
332
331
|
created_at?: string;
|
|
333
332
|
encrypted_env_pubkey?: string;
|
|
334
333
|
}, {
|
|
335
|
-
status?: string;
|
|
336
334
|
name?: string;
|
|
337
335
|
vcpu?: number;
|
|
338
336
|
memory?: number;
|
|
337
|
+
status?: string;
|
|
339
338
|
id?: number;
|
|
340
339
|
app_id?: string;
|
|
341
340
|
instance_id?: string;
|
|
@@ -775,7 +774,6 @@ interface PubkeyResponse {
|
|
|
775
774
|
app_env_encrypt_pubkey: string;
|
|
776
775
|
app_id_salt: string;
|
|
777
776
|
}
|
|
778
|
-
|
|
779
777
|
interface UpgradeResponse {
|
|
780
778
|
detail?: string;
|
|
781
779
|
[key: string]: unknown;
|
|
@@ -802,7 +800,7 @@ interface CvmComposeConfigResponse {
|
|
|
802
800
|
* @param appId App ID (with or without app_ prefix)
|
|
803
801
|
* @returns CVM details
|
|
804
802
|
*/
|
|
805
|
-
declare function getCvmByAppId(appId: string): Promise<
|
|
803
|
+
declare function getCvmByAppId(appId: string): Promise<CvmInfoDetailV20260121>;
|
|
806
804
|
/**
|
|
807
805
|
* Get CVM compose configuration
|
|
808
806
|
*/
|
|
@@ -813,30 +811,6 @@ declare function getCvmComposeConfig(cvmId: string): Promise<CvmComposeConfigRes
|
|
|
813
811
|
* @returns Network information
|
|
814
812
|
*/
|
|
815
813
|
declare function getCvmNetwork(appId: string): Promise<GetCvmNetworkResponse>;
|
|
816
|
-
/**
|
|
817
|
-
* Start a CVM
|
|
818
|
-
* @param appId App ID (with or without app_ prefix)
|
|
819
|
-
* @returns Success status
|
|
820
|
-
*/
|
|
821
|
-
declare function startCvm(appId: string): Promise<PostCvmResponse>;
|
|
822
|
-
/**
|
|
823
|
-
* Stop a CVM
|
|
824
|
-
* @param appId App ID (with or without app_ prefix)
|
|
825
|
-
* @returns Success status
|
|
826
|
-
*/
|
|
827
|
-
declare function stopCvm(appId: string): Promise<PostCvmResponse>;
|
|
828
|
-
/**
|
|
829
|
-
* Restart a CVM
|
|
830
|
-
* @param appId App ID (with or without app_ prefix)
|
|
831
|
-
* @returns Success status
|
|
832
|
-
*/
|
|
833
|
-
declare function restartCvm(appId: string): Promise<PostCvmResponse>;
|
|
834
|
-
/**
|
|
835
|
-
* Delete a CVM
|
|
836
|
-
* @param appId App ID (with or without app_ prefix)
|
|
837
|
-
* @returns Success status
|
|
838
|
-
*/
|
|
839
|
-
declare function deleteCvm(appId: string): Promise<boolean>;
|
|
840
814
|
/**
|
|
841
815
|
* Presents a list of CVMs to the user and allows them to select one
|
|
842
816
|
* @returns The selected CVM app ID or undefined if no CVMs exist
|
|
@@ -913,9 +887,29 @@ declare function getTeepods(v03x_only?: boolean): Promise<TeepodResponse>;
|
|
|
913
887
|
interface SerialLogsOptions {
|
|
914
888
|
tail?: number;
|
|
915
889
|
timestamps?: boolean;
|
|
890
|
+
/** RFC3339 timestamp or relative time (backend-dependent) */
|
|
891
|
+
since?: string;
|
|
892
|
+
/** RFC3339 timestamp or relative time (backend-dependent) */
|
|
893
|
+
until?: string;
|
|
894
|
+
/** Ask backend to return human-readable text output (recommended default). */
|
|
895
|
+
text?: boolean;
|
|
896
|
+
/** Ask backend to omit metadata wrappers if supported. */
|
|
897
|
+
bare?: boolean;
|
|
898
|
+
}
|
|
899
|
+
type LogChannel = "stdout" | "stderr";
|
|
900
|
+
interface LogEntry {
|
|
901
|
+
channel: LogChannel;
|
|
902
|
+
message: string;
|
|
916
903
|
}
|
|
917
904
|
interface ContainerLogsOptions extends SerialLogsOptions {
|
|
918
905
|
container?: string;
|
|
906
|
+
/**
|
|
907
|
+
* Whether to allow matching a container by its ID prefix.
|
|
908
|
+
*
|
|
909
|
+
* - cvms logs: true (default, for backward compatibility)
|
|
910
|
+
* - logs: false (only match by container name)
|
|
911
|
+
*/
|
|
912
|
+
matchContainerIdPrefix?: boolean;
|
|
919
913
|
}
|
|
920
914
|
/** Fetch serial logs from a CVM */
|
|
921
915
|
declare function fetchSerialLogs(appId: string, options?: SerialLogsOptions): Promise<string>;
|
|
@@ -925,6 +919,15 @@ declare function fetchSerialLogs(appId: string, options?: SerialLogsOptions): Pr
|
|
|
925
919
|
* otherwise fetches from the first container with a log endpoint.
|
|
926
920
|
*/
|
|
927
921
|
declare function fetchContainerLogs(appId: string, options?: ContainerLogsOptions): Promise<string>;
|
|
922
|
+
/**
|
|
923
|
+
* Fetch container logs as structured entries.
|
|
924
|
+
*
|
|
925
|
+
* This is useful when you want to route container stderr to process.stderr
|
|
926
|
+
* (like docker does internally).
|
|
927
|
+
*/
|
|
928
|
+
declare function fetchContainerLogsEntries(appId: string, options?: ContainerLogsOptions): Promise<LogEntry[]>;
|
|
929
|
+
/** Stream container logs as structured entries. */
|
|
930
|
+
declare function streamContainerLogsEntries(appId: string, onEntry: (entry: LogEntry) => void, options?: ContainerLogsOptions, signal?: AbortSignal): Promise<void>;
|
|
928
931
|
/** Stream serial logs from a CVM */
|
|
929
932
|
declare function streamSerialLogs(appId: string, onData: (data: string) => void, options?: SerialLogsOptions, signal?: AbortSignal): Promise<void>;
|
|
930
933
|
/**
|
|
@@ -934,4 +937,4 @@ declare function streamSerialLogs(appId: string, onData: (data: string) => void,
|
|
|
934
937
|
*/
|
|
935
938
|
declare function streamContainerLogs(appId: string, onData: (data: string) => void, options?: ContainerLogsOptions, signal?: AbortSignal): Promise<void>;
|
|
936
939
|
|
|
937
|
-
export { type AvailableNodesResponse, type CertificateInfo, type CertificateNameInfo, type ComposeFile, type ContainerLogsOptions, type CvmAttestationResponse, type CvmComposeConfigResponse, type CvmListResponse, type DockerConfig, type EncryptedEnvItem, type GetCvmNetworkResponse, type Image, type KmsListItem, type PostCvmResponse, type PubkeyResponse, type ReplicateCvmResponse, type ResizeCvmPayload, type SerialLogsOptions, type TCBEventLogEntry, type TCBInfo, type TEEPod, type TeepodResponse, type UpgradeResponse, type UserInfoResponse, type VMConfig, composeFileSchema, createCvm, cvmAttestationResponseSchema,
|
|
940
|
+
export { type AvailableNodesResponse, type CertificateInfo, type CertificateNameInfo, type ComposeFile, type ContainerLogsOptions, type CvmAttestationResponse, type CvmComposeConfigResponse, type CvmListResponse, type DockerConfig, type EncryptedEnvItem, type GetCvmNetworkResponse, type Image, type KmsListItem, type LogChannel, type LogEntry, type PostCvmResponse, type PubkeyResponse, type ReplicateCvmResponse, type ResizeCvmPayload, type SerialLogsOptions, type TCBEventLogEntry, type TCBInfo, type TEEPod, type TeepodResponse, type UpgradeResponse, type UserInfoResponse, type VMConfig, composeFileSchema, createCvm, cvmAttestationResponseSchema, dockerConfigSchema, encryptedEnvItemSchema, fetchContainerLogs, fetchContainerLogsEntries, fetchSerialLogs, getCvmAttestation, getCvmByAppId, getCvmComposeConfig, getCvmNetwork, getCvmNetworkResponseSchema, getPubkeyFromCvm, getTeepods, imageSchema, postCvmResponseSchema, replicateCvm, replicateCvmResponseSchema, resizeCvm, selectCvm, streamContainerLogs, streamContainerLogsEntries, streamSerialLogs, teepodSchema, upgradeCvm };
|