@phala/cloud 0.6.4 → 0.6.6-beta.1
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 +6 -6
- package/dist/actions/api_tokens/revoke_current_api_token.d.ts +2 -2
- package/dist/actions/apps/app_launch_token.d.ts +4 -4
- package/dist/actions/apps/check_app_is_allowed.d.ts +4 -4
- package/dist/actions/apps/create_app_instance.d.ts +20 -20
- package/dist/actions/apps/get_app_attestation.d.ts +4 -4
- package/dist/actions/blockchains/abi/dstack_app.d.ts +403 -1
- package/dist/actions/blockchains/add_compose_hash.d.ts +7 -0
- package/dist/actions/blockchains/add_device.d.ts +7 -0
- package/dist/actions/blockchains/check_compose_hash_allowed.d.ts +4 -1
- package/dist/actions/blockchains/check_device_allowed.d.ts +5 -2
- package/dist/actions/blockchains/check_on_chain_prerequisites.d.ts +7 -2
- package/dist/actions/blockchains/epoch_compat.d.ts +106 -0
- package/dist/actions/blockchains/get_allowed_devices.d.ts +10 -2
- package/dist/actions/blockchains/remove_device.d.ts +7 -0
- package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +4 -4
- package/dist/actions/cvms/commit_cvm_update.d.ts +20 -20
- package/dist/actions/cvms/confirm_cvm_patch.d.ts +14 -14
- package/dist/actions/cvms/cvm_annotations.d.ts +10 -10
- package/dist/actions/cvms/delete_cvm.d.ts +2 -2
- package/dist/actions/cvms/get_available_os_images.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_attestation.d.ts +4 -4
- package/dist/actions/cvms/get_cvm_compose_file.d.ts +10 -10
- package/dist/actions/cvms/get_cvm_containers_stats.d.ts +4 -4
- package/dist/actions/cvms/get_cvm_docker_compose.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_info.d.ts +24 -8
- package/dist/actions/cvms/get_cvm_init_scripts.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_network.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_state.d.ts +6 -6
- package/dist/actions/cvms/get_cvm_stats.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_status_batch.d.ts +10 -10
- package/dist/actions/cvms/get_cvm_user_config.d.ts +4 -4
- package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +2 -2
- package/dist/actions/cvms/logs.d.ts +10 -9
- package/dist/actions/cvms/patch_cvm.d.ts +10 -10
- package/dist/actions/cvms/provision_cvm.d.ts +23 -20
- package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +49 -49
- package/dist/actions/cvms/put_cvm_init_scripts.d.ts +8 -8
- package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +25 -25
- package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +25 -25
- package/dist/actions/cvms/update_cvm_envs.d.ts +10 -10
- package/dist/actions/cvms/update_cvm_resources.d.ts +2 -2
- package/dist/actions/cvms/update_cvm_visibility.d.ts +14 -14
- package/dist/actions/cvms/update_docker_compose.d.ts +10 -10
- package/dist/actions/cvms/update_os_image.d.ts +8 -8
- package/dist/actions/cvms/update_prelaunch_script.d.ts +10 -10
- package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +2 -2
- package/dist/actions/cvms/watch_cvm_state.d.ts +2 -2
- package/dist/actions/domains/create_app_domain.d.ts +139 -0
- package/dist/actions/domains/delete_app_domain.d.ts +120 -0
- package/dist/actions/domains/get_app_domain_guide.d.ts +67 -0
- package/dist/actions/domains/list_app_domains.d.ts +107 -0
- package/dist/actions/domains/list_domains.d.ts +157 -0
- package/dist/actions/domains/merge_app_domain_ingress.d.ts +120 -0
- package/dist/actions/domains/preflight_app_domain.d.ts +110 -0
- package/dist/actions/domains/schemas.d.ts +82 -0
- package/dist/actions/domains/verify_app_domain.d.ts +142 -0
- package/dist/actions/get_available_nodes.d.ts +16 -16
- package/dist/actions/index.d.ts +11 -1
- package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +2 -2
- package/dist/actions/kms/get_kms_contract.d.ts +2 -2
- package/dist/actions/kms/get_kms_info.d.ts +2 -2
- package/dist/actions/kms/get_kms_list.d.ts +2 -2
- package/dist/actions/kms/get_kms_onchain_detail.d.ts +10 -10
- package/dist/actions/kms/list_kms_contract_nodes.d.ts +2 -2
- package/dist/actions/kms/list_kms_contracts.d.ts +2 -2
- package/dist/actions/kms/next_app_ids.d.ts +2 -2
- package/dist/actions/list-instance-types.d.ts +8 -8
- package/dist/actions/os_images/get_os_images.d.ts +2 -2
- package/dist/actions/ssh_keys/create_ssh_key.d.ts +6 -6
- package/dist/actions/ssh_keys/delete_ssh_key.d.ts +2 -2
- package/dist/actions/ssh_keys/get_cvm_ssh_keys.d.ts +2 -2
- package/dist/actions/ssh_keys/import_github_profile.d.ts +2 -2
- package/dist/actions/ssh_keys/sync_github_ssh_keys.d.ts +2 -2
- package/dist/actions/ssh_keys/update_cvm_ssh_keys.d.ts +8 -8
- package/dist/actions/workspaces/get_workspace.d.ts +8 -8
- package/dist/actions/workspaces/get_workspace_nodes.d.ts +12 -12
- package/dist/actions/workspaces/get_workspace_quotas.d.ts +2 -2
- package/dist/actions/workspaces/list_workspaces.d.ts +10 -10
- package/dist/client.d.ts +1 -1
- package/dist/create-client.d.ts +263 -134
- package/dist/index.js +2468 -1497
- package/dist/index.mjs +2447 -1520
- package/dist/types/app_compose.d.ts +2 -2
- package/dist/types/app_info_v20260121.d.ts +84 -36
- package/dist/types/client.d.ts +3 -3
- package/dist/types/cvm_info_v20251028.d.ts +1 -0
- package/dist/types/cvm_info_v20260121.d.ts +225 -22
- package/dist/types/version-mappings.d.ts +11 -11
- package/dist/utils/define-action.d.ts +4 -4
- package/dist/utils/errors.d.ts +4 -0
- package/dist/utils/network.d.ts +6 -6
- package/dist/version.d.ts +1 -0
- package/package.json +25 -12
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DeleteAppDomainRequestSchema: z.ZodObject<{
|
|
3
|
+
appId: z.ZodString;
|
|
4
|
+
domainId: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export type DeleteAppDomainRequest = z.infer<typeof DeleteAppDomainRequestSchema>;
|
|
7
|
+
export declare const DeleteAppDomainResponseSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
domain: z.ZodString;
|
|
10
|
+
port: z.ZodNumber;
|
|
11
|
+
dns_verified_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
dns_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
routing_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
14
|
+
fail: "fail";
|
|
15
|
+
ok: "ok";
|
|
16
|
+
skipped: "skipped";
|
|
17
|
+
}>>>;
|
|
18
|
+
routing_checked_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
dns_zone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
dns_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
created_at: z.ZodString;
|
|
22
|
+
expected_records: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
23
|
+
record_type: z.ZodString;
|
|
24
|
+
query_name: z.ZodString;
|
|
25
|
+
expected_value: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>>;
|
|
27
|
+
sync: z.ZodObject<{
|
|
28
|
+
nodes: z.ZodDefault<z.ZodArray<z.ZodUnknown>>;
|
|
29
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodUnknown>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type DeleteAppDomainResponse = z.infer<typeof DeleteAppDomainResponseSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* Unbind a custom domain from an app
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* await deleteAppDomain(client, { appId, domainId })
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* ## Safe Version
|
|
42
|
+
*
|
|
43
|
+
* Use `safeDeleteAppDomain` to get a `SafeResult` instead of an exception.
|
|
44
|
+
*/
|
|
45
|
+
declare const deleteAppDomain: {
|
|
46
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
47
|
+
appId: string;
|
|
48
|
+
domainId: string;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
id: string;
|
|
51
|
+
domain: string;
|
|
52
|
+
port: number;
|
|
53
|
+
dns_verified_at?: string | null | undefined;
|
|
54
|
+
dns_error?: string | null | undefined;
|
|
55
|
+
routing_status?: "fail" | "ok" | "skipped" | null | undefined;
|
|
56
|
+
routing_checked_at?: string | null | undefined;
|
|
57
|
+
dns_zone?: string | null | undefined;
|
|
58
|
+
dns_provider?: string | null | undefined;
|
|
59
|
+
created_at: string;
|
|
60
|
+
expected_records: {
|
|
61
|
+
record_type: string;
|
|
62
|
+
query_name: string;
|
|
63
|
+
expected_value: string;
|
|
64
|
+
}[];
|
|
65
|
+
sync: {
|
|
66
|
+
nodes: unknown[];
|
|
67
|
+
warnings: unknown[];
|
|
68
|
+
};
|
|
69
|
+
}>;
|
|
70
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
71
|
+
appId: string;
|
|
72
|
+
domainId: string;
|
|
73
|
+
}, parameters: {
|
|
74
|
+
schema: T;
|
|
75
|
+
}): Promise<z.infer<T>>;
|
|
76
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
77
|
+
appId: string;
|
|
78
|
+
domainId: string;
|
|
79
|
+
}, parameters: {
|
|
80
|
+
schema: false;
|
|
81
|
+
}): Promise<unknown>;
|
|
82
|
+
}, safeDeleteAppDomain: {
|
|
83
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
84
|
+
appId: string;
|
|
85
|
+
domainId: string;
|
|
86
|
+
}): Promise<import("../..").SafeResult<{
|
|
87
|
+
id: string;
|
|
88
|
+
domain: string;
|
|
89
|
+
port: number;
|
|
90
|
+
dns_verified_at?: string | null | undefined;
|
|
91
|
+
dns_error?: string | null | undefined;
|
|
92
|
+
routing_status?: "fail" | "ok" | "skipped" | null | undefined;
|
|
93
|
+
routing_checked_at?: string | null | undefined;
|
|
94
|
+
dns_zone?: string | null | undefined;
|
|
95
|
+
dns_provider?: string | null | undefined;
|
|
96
|
+
created_at: string;
|
|
97
|
+
expected_records: {
|
|
98
|
+
record_type: string;
|
|
99
|
+
query_name: string;
|
|
100
|
+
expected_value: string;
|
|
101
|
+
}[];
|
|
102
|
+
sync: {
|
|
103
|
+
nodes: unknown[];
|
|
104
|
+
warnings: unknown[];
|
|
105
|
+
};
|
|
106
|
+
}>>;
|
|
107
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
108
|
+
appId: string;
|
|
109
|
+
domainId: string;
|
|
110
|
+
}, parameters: {
|
|
111
|
+
schema: T;
|
|
112
|
+
}): Promise<import("../..").SafeResult<z.infer<T>>>;
|
|
113
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
114
|
+
appId: string;
|
|
115
|
+
domainId: string;
|
|
116
|
+
}, parameters: {
|
|
117
|
+
schema: false;
|
|
118
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
119
|
+
};
|
|
120
|
+
export { deleteAppDomain, safeDeleteAppDomain };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const GetAppDomainGuideRequestSchema: z.ZodObject<{
|
|
3
|
+
appId: z.ZodString;
|
|
4
|
+
}, z.core.$strict>;
|
|
5
|
+
export type GetAppDomainGuideRequest = z.infer<typeof GetAppDomainGuideRequestSchema>;
|
|
6
|
+
export declare const AppDomainGuideSchema: z.ZodObject<{
|
|
7
|
+
gateway_domain_suffix: z.ZodString;
|
|
8
|
+
app_id: z.ZodString;
|
|
9
|
+
txt_required: z.ZodBoolean;
|
|
10
|
+
ingress_configured: z.ZodBoolean;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type AppDomainGuide = z.infer<typeof AppDomainGuideSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the DNS guide for pointing a custom domain at an app
|
|
15
|
+
*
|
|
16
|
+
* The server answers 422 while the app's route cannot be determined yet.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const guide = await getAppDomainGuide(client, { appId })
|
|
21
|
+
* console.log(`CNAME target: gateway.${guide.gateway_domain_suffix}`)
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Safe Version
|
|
25
|
+
*
|
|
26
|
+
* Use `safeGetAppDomainGuide` to get a `SafeResult` instead of an exception.
|
|
27
|
+
*/
|
|
28
|
+
declare const getAppDomainGuide: {
|
|
29
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
30
|
+
appId: string;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
gateway_domain_suffix: string;
|
|
33
|
+
app_id: string;
|
|
34
|
+
txt_required: boolean;
|
|
35
|
+
ingress_configured: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
38
|
+
appId: string;
|
|
39
|
+
}, parameters: {
|
|
40
|
+
schema: T;
|
|
41
|
+
}): Promise<z.infer<T>>;
|
|
42
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
43
|
+
appId: string;
|
|
44
|
+
}, parameters: {
|
|
45
|
+
schema: false;
|
|
46
|
+
}): Promise<unknown>;
|
|
47
|
+
}, safeGetAppDomainGuide: {
|
|
48
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
49
|
+
appId: string;
|
|
50
|
+
}): Promise<import("../..").SafeResult<{
|
|
51
|
+
gateway_domain_suffix: string;
|
|
52
|
+
app_id: string;
|
|
53
|
+
txt_required: boolean;
|
|
54
|
+
ingress_configured: boolean;
|
|
55
|
+
}>>;
|
|
56
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
57
|
+
appId: string;
|
|
58
|
+
}, parameters: {
|
|
59
|
+
schema: T;
|
|
60
|
+
}): Promise<import("../..").SafeResult<z.infer<T>>>;
|
|
61
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
62
|
+
appId: string;
|
|
63
|
+
}, parameters: {
|
|
64
|
+
schema: false;
|
|
65
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
66
|
+
};
|
|
67
|
+
export { getAppDomainGuide, safeGetAppDomainGuide };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ListAppDomainsRequestSchema: z.ZodObject<{
|
|
3
|
+
appId: z.ZodString;
|
|
4
|
+
}, z.core.$strict>;
|
|
5
|
+
export type ListAppDomainsRequest = z.infer<typeof ListAppDomainsRequestSchema>;
|
|
6
|
+
export declare const ListAppDomainsResponseSchema: z.ZodObject<{
|
|
7
|
+
items: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
domain: z.ZodString;
|
|
10
|
+
port: z.ZodNumber;
|
|
11
|
+
dns_verified_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
dns_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
routing_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
14
|
+
fail: "fail";
|
|
15
|
+
ok: "ok";
|
|
16
|
+
skipped: "skipped";
|
|
17
|
+
}>>>;
|
|
18
|
+
routing_checked_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
dns_zone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
dns_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
created_at: z.ZodString;
|
|
22
|
+
expected_records: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
23
|
+
record_type: z.ZodString;
|
|
24
|
+
query_name: z.ZodString;
|
|
25
|
+
expected_value: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type ListAppDomainsResponse = z.infer<typeof ListAppDomainsResponseSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* List the custom domains bound to one app
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const { items } = await listAppDomains(client, { appId: '50b0e827cc6c53f4010b57e588a18c5ef9388cc1' })
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* ## Safe Version
|
|
39
|
+
*
|
|
40
|
+
* Use `safeListAppDomains` to get a `SafeResult` instead of an exception.
|
|
41
|
+
*/
|
|
42
|
+
declare const listAppDomains: {
|
|
43
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
44
|
+
appId: string;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
items: {
|
|
47
|
+
id: string;
|
|
48
|
+
domain: string;
|
|
49
|
+
port: number;
|
|
50
|
+
dns_verified_at?: string | null | undefined;
|
|
51
|
+
dns_error?: string | null | undefined;
|
|
52
|
+
routing_status?: "fail" | "ok" | "skipped" | null | undefined;
|
|
53
|
+
routing_checked_at?: string | null | undefined;
|
|
54
|
+
dns_zone?: string | null | undefined;
|
|
55
|
+
dns_provider?: string | null | undefined;
|
|
56
|
+
created_at: string;
|
|
57
|
+
expected_records: {
|
|
58
|
+
record_type: string;
|
|
59
|
+
query_name: string;
|
|
60
|
+
expected_value: string;
|
|
61
|
+
}[];
|
|
62
|
+
}[];
|
|
63
|
+
}>;
|
|
64
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
65
|
+
appId: string;
|
|
66
|
+
}, parameters: {
|
|
67
|
+
schema: T;
|
|
68
|
+
}): Promise<z.infer<T>>;
|
|
69
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
70
|
+
appId: string;
|
|
71
|
+
}, parameters: {
|
|
72
|
+
schema: false;
|
|
73
|
+
}): Promise<unknown>;
|
|
74
|
+
}, safeListAppDomains: {
|
|
75
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
76
|
+
appId: string;
|
|
77
|
+
}): Promise<import("../..").SafeResult<{
|
|
78
|
+
items: {
|
|
79
|
+
id: string;
|
|
80
|
+
domain: string;
|
|
81
|
+
port: number;
|
|
82
|
+
dns_verified_at?: string | null | undefined;
|
|
83
|
+
dns_error?: string | null | undefined;
|
|
84
|
+
routing_status?: "fail" | "ok" | "skipped" | null | undefined;
|
|
85
|
+
routing_checked_at?: string | null | undefined;
|
|
86
|
+
dns_zone?: string | null | undefined;
|
|
87
|
+
dns_provider?: string | null | undefined;
|
|
88
|
+
created_at: string;
|
|
89
|
+
expected_records: {
|
|
90
|
+
record_type: string;
|
|
91
|
+
query_name: string;
|
|
92
|
+
expected_value: string;
|
|
93
|
+
}[];
|
|
94
|
+
}[];
|
|
95
|
+
}>>;
|
|
96
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
97
|
+
appId: string;
|
|
98
|
+
}, parameters: {
|
|
99
|
+
schema: T;
|
|
100
|
+
}): Promise<import("../..").SafeResult<z.infer<T>>>;
|
|
101
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
102
|
+
appId: string;
|
|
103
|
+
}, parameters: {
|
|
104
|
+
schema: false;
|
|
105
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
106
|
+
};
|
|
107
|
+
export { listAppDomains, safeListAppDomains };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ListDomainsRequestSchema: z.ZodObject<{
|
|
3
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
page_size: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
app_id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type ListDomainsRequest = z.infer<typeof ListDomainsRequestSchema>;
|
|
9
|
+
export declare const ListDomainsResponseSchema: z.ZodObject<{
|
|
10
|
+
items: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
domain: z.ZodString;
|
|
13
|
+
port: z.ZodNumber;
|
|
14
|
+
dns_verified_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
dns_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
routing_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
17
|
+
fail: "fail";
|
|
18
|
+
ok: "ok";
|
|
19
|
+
skipped: "skipped";
|
|
20
|
+
}>>>;
|
|
21
|
+
routing_checked_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
dns_zone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
dns_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
created_at: z.ZodString;
|
|
25
|
+
expected_records: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
26
|
+
record_type: z.ZodString;
|
|
27
|
+
query_name: z.ZodString;
|
|
28
|
+
expected_value: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
app_id: z.ZodString;
|
|
31
|
+
app_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
page: z.ZodNumber;
|
|
34
|
+
page_size: z.ZodNumber;
|
|
35
|
+
total: z.ZodNumber;
|
|
36
|
+
total_pages: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type ListDomainsResponse = z.infer<typeof ListDomainsResponseSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* List the custom domains of the current workspace
|
|
41
|
+
*
|
|
42
|
+
* Each item is one (domain, app) binding. Pass `domain` for an exact lookup
|
|
43
|
+
* and `app_id` to narrow the list to one app.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { createClient, listDomains } from '@phala/cloud'
|
|
48
|
+
*
|
|
49
|
+
* const client = createClient()
|
|
50
|
+
* const { items } = await listDomains(client, { domain: 'app.example.com' })
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* ## Safe Version
|
|
54
|
+
*
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const result = await safeListDomains(client, { page: 1 })
|
|
57
|
+
* if (result.success) {
|
|
58
|
+
* console.log(result.data.total)
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare const listDomains: {
|
|
63
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: {
|
|
64
|
+
page?: number | undefined;
|
|
65
|
+
page_size?: number | undefined;
|
|
66
|
+
app_id?: string | undefined;
|
|
67
|
+
domain?: string | undefined;
|
|
68
|
+
} | undefined): Promise<{
|
|
69
|
+
items: {
|
|
70
|
+
id: string;
|
|
71
|
+
domain: string;
|
|
72
|
+
port: number;
|
|
73
|
+
dns_verified_at?: string | null | undefined;
|
|
74
|
+
dns_error?: string | null | undefined;
|
|
75
|
+
routing_status?: "fail" | "ok" | "skipped" | null | undefined;
|
|
76
|
+
routing_checked_at?: string | null | undefined;
|
|
77
|
+
dns_zone?: string | null | undefined;
|
|
78
|
+
dns_provider?: string | null | undefined;
|
|
79
|
+
created_at: string;
|
|
80
|
+
expected_records: {
|
|
81
|
+
record_type: string;
|
|
82
|
+
query_name: string;
|
|
83
|
+
expected_value: string;
|
|
84
|
+
}[];
|
|
85
|
+
app_id: string;
|
|
86
|
+
app_name?: string | null | undefined;
|
|
87
|
+
}[];
|
|
88
|
+
page: number;
|
|
89
|
+
page_size: number;
|
|
90
|
+
total: number;
|
|
91
|
+
total_pages: number;
|
|
92
|
+
}>;
|
|
93
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: {
|
|
94
|
+
page?: number | undefined;
|
|
95
|
+
page_size?: number | undefined;
|
|
96
|
+
app_id?: string | undefined;
|
|
97
|
+
domain?: string | undefined;
|
|
98
|
+
} | undefined, parameters?: {
|
|
99
|
+
schema: T;
|
|
100
|
+
} | undefined): Promise<z.infer<T>>;
|
|
101
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: {
|
|
102
|
+
page?: number | undefined;
|
|
103
|
+
page_size?: number | undefined;
|
|
104
|
+
app_id?: string | undefined;
|
|
105
|
+
domain?: string | undefined;
|
|
106
|
+
} | undefined, parameters?: {
|
|
107
|
+
schema: false;
|
|
108
|
+
} | undefined): Promise<unknown>;
|
|
109
|
+
}, safeListDomains: {
|
|
110
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: {
|
|
111
|
+
page?: number | undefined;
|
|
112
|
+
page_size?: number | undefined;
|
|
113
|
+
app_id?: string | undefined;
|
|
114
|
+
domain?: string | undefined;
|
|
115
|
+
} | undefined): Promise<import("../..").SafeResult<{
|
|
116
|
+
items: {
|
|
117
|
+
id: string;
|
|
118
|
+
domain: string;
|
|
119
|
+
port: number;
|
|
120
|
+
dns_verified_at?: string | null | undefined;
|
|
121
|
+
dns_error?: string | null | undefined;
|
|
122
|
+
routing_status?: "fail" | "ok" | "skipped" | null | undefined;
|
|
123
|
+
routing_checked_at?: string | null | undefined;
|
|
124
|
+
dns_zone?: string | null | undefined;
|
|
125
|
+
dns_provider?: string | null | undefined;
|
|
126
|
+
created_at: string;
|
|
127
|
+
expected_records: {
|
|
128
|
+
record_type: string;
|
|
129
|
+
query_name: string;
|
|
130
|
+
expected_value: string;
|
|
131
|
+
}[];
|
|
132
|
+
app_id: string;
|
|
133
|
+
app_name?: string | null | undefined;
|
|
134
|
+
}[];
|
|
135
|
+
page: number;
|
|
136
|
+
page_size: number;
|
|
137
|
+
total: number;
|
|
138
|
+
total_pages: number;
|
|
139
|
+
}>>;
|
|
140
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: {
|
|
141
|
+
page?: number | undefined;
|
|
142
|
+
page_size?: number | undefined;
|
|
143
|
+
app_id?: string | undefined;
|
|
144
|
+
domain?: string | undefined;
|
|
145
|
+
} | undefined, parameters?: {
|
|
146
|
+
schema: T;
|
|
147
|
+
} | undefined): Promise<import("../..").SafeResult<z.infer<T>>>;
|
|
148
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params?: {
|
|
149
|
+
page?: number | undefined;
|
|
150
|
+
page_size?: number | undefined;
|
|
151
|
+
app_id?: string | undefined;
|
|
152
|
+
domain?: string | undefined;
|
|
153
|
+
} | undefined, parameters?: {
|
|
154
|
+
schema: false;
|
|
155
|
+
} | undefined): Promise<import("../..").SafeResult<unknown>>;
|
|
156
|
+
};
|
|
157
|
+
export { listDomains, safeListDomains };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MergeAppDomainIngressRequestSchema: z.ZodObject<{
|
|
3
|
+
appId: z.ZodString;
|
|
4
|
+
domain: z.ZodString;
|
|
5
|
+
port: z.ZodNumber;
|
|
6
|
+
dns_provider: z.ZodOptional<z.ZodString>;
|
|
7
|
+
include_certbot_email: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
docker_compose_file: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type MergeAppDomainIngressRequest = z.infer<typeof MergeAppDomainIngressRequestSchema>;
|
|
11
|
+
export declare const MergeAppDomainIngressResponseSchema: z.ZodObject<{
|
|
12
|
+
docker_compose_file: z.ZodString;
|
|
13
|
+
already_configured: z.ZodBoolean;
|
|
14
|
+
required_env_keys: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
15
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
16
|
+
ingress_service_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
ingress_service: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
18
|
+
top_level_volumes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type MergeAppDomainIngressResponse = z.infer<typeof MergeAppDomainIngressResponseSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* Compute the dstack-ingress sidecar a compose file needs to serve a domain
|
|
23
|
+
*
|
|
24
|
+
* Without `docker_compose_file` the server merges into the app's stored
|
|
25
|
+
* compose. The app must exist and be routable, because it supplies the gateway
|
|
26
|
+
* domain.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const merge = await mergeAppDomainIngress(client, {
|
|
31
|
+
* appId,
|
|
32
|
+
* domain: 'app.example.com',
|
|
33
|
+
* port: 443,
|
|
34
|
+
* docker_compose_file: composeText,
|
|
35
|
+
* })
|
|
36
|
+
* if (!merge.already_configured) {
|
|
37
|
+
* console.log(merge.ingress_service_name, merge.required_env_keys)
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* ## Safe Version
|
|
42
|
+
*
|
|
43
|
+
* Use `safeMergeAppDomainIngress` to get a `SafeResult` instead of an exception.
|
|
44
|
+
*/
|
|
45
|
+
declare const mergeAppDomainIngress: {
|
|
46
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
47
|
+
appId: string;
|
|
48
|
+
domain: string;
|
|
49
|
+
port: number;
|
|
50
|
+
dns_provider?: string | undefined;
|
|
51
|
+
include_certbot_email?: boolean | undefined;
|
|
52
|
+
docker_compose_file?: string | undefined;
|
|
53
|
+
}): Promise<{
|
|
54
|
+
docker_compose_file: string;
|
|
55
|
+
already_configured: boolean;
|
|
56
|
+
required_env_keys: string[];
|
|
57
|
+
warnings: string[];
|
|
58
|
+
ingress_service_name?: string | null | undefined;
|
|
59
|
+
ingress_service?: Record<string, unknown> | null | undefined;
|
|
60
|
+
top_level_volumes: Record<string, unknown>;
|
|
61
|
+
}>;
|
|
62
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
63
|
+
appId: string;
|
|
64
|
+
domain: string;
|
|
65
|
+
port: number;
|
|
66
|
+
dns_provider?: string | undefined;
|
|
67
|
+
include_certbot_email?: boolean | undefined;
|
|
68
|
+
docker_compose_file?: string | undefined;
|
|
69
|
+
}, parameters: {
|
|
70
|
+
schema: T;
|
|
71
|
+
}): Promise<z.infer<T>>;
|
|
72
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
73
|
+
appId: string;
|
|
74
|
+
domain: string;
|
|
75
|
+
port: number;
|
|
76
|
+
dns_provider?: string | undefined;
|
|
77
|
+
include_certbot_email?: boolean | undefined;
|
|
78
|
+
docker_compose_file?: string | undefined;
|
|
79
|
+
}, parameters: {
|
|
80
|
+
schema: false;
|
|
81
|
+
}): Promise<unknown>;
|
|
82
|
+
}, safeMergeAppDomainIngress: {
|
|
83
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
84
|
+
appId: string;
|
|
85
|
+
domain: string;
|
|
86
|
+
port: number;
|
|
87
|
+
dns_provider?: string | undefined;
|
|
88
|
+
include_certbot_email?: boolean | undefined;
|
|
89
|
+
docker_compose_file?: string | undefined;
|
|
90
|
+
}): Promise<import("../..").SafeResult<{
|
|
91
|
+
docker_compose_file: string;
|
|
92
|
+
already_configured: boolean;
|
|
93
|
+
required_env_keys: string[];
|
|
94
|
+
warnings: string[];
|
|
95
|
+
ingress_service_name?: string | null | undefined;
|
|
96
|
+
ingress_service?: Record<string, unknown> | null | undefined;
|
|
97
|
+
top_level_volumes: Record<string, unknown>;
|
|
98
|
+
}>>;
|
|
99
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
100
|
+
appId: string;
|
|
101
|
+
domain: string;
|
|
102
|
+
port: number;
|
|
103
|
+
dns_provider?: string | undefined;
|
|
104
|
+
include_certbot_email?: boolean | undefined;
|
|
105
|
+
docker_compose_file?: string | undefined;
|
|
106
|
+
}, parameters: {
|
|
107
|
+
schema: T;
|
|
108
|
+
}): Promise<import("../..").SafeResult<z.infer<T>>>;
|
|
109
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
110
|
+
appId: string;
|
|
111
|
+
domain: string;
|
|
112
|
+
port: number;
|
|
113
|
+
dns_provider?: string | undefined;
|
|
114
|
+
include_certbot_email?: boolean | undefined;
|
|
115
|
+
docker_compose_file?: string | undefined;
|
|
116
|
+
}, parameters: {
|
|
117
|
+
schema: false;
|
|
118
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
119
|
+
};
|
|
120
|
+
export { mergeAppDomainIngress, safeMergeAppDomainIngress };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PreflightAppDomainRequestSchema: z.ZodObject<{
|
|
3
|
+
appId: z.ZodString;
|
|
4
|
+
domain: z.ZodString;
|
|
5
|
+
port: z.ZodNumber;
|
|
6
|
+
turnstile_token: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type PreflightAppDomainRequest = z.infer<typeof PreflightAppDomainRequestSchema>;
|
|
9
|
+
export declare const PreflightAppDomainResponseSchema: z.ZodObject<{
|
|
10
|
+
domain: z.ZodString;
|
|
11
|
+
port: z.ZodNumber;
|
|
12
|
+
is_valid: z.ZodBoolean;
|
|
13
|
+
records: z.ZodArray<z.ZodObject<{
|
|
14
|
+
record_type: z.ZodString;
|
|
15
|
+
query_name: z.ZodString;
|
|
16
|
+
expected_value: z.ZodString;
|
|
17
|
+
actual_value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
is_valid: z.ZodBoolean;
|
|
19
|
+
warning_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type PreflightAppDomainResponse = z.infer<typeof PreflightAppDomainResponseSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Check a domain's DNS against what the app expects, without binding it
|
|
25
|
+
*
|
|
26
|
+
* Shares a per-user throttle with `createAppDomain` and `verifyAppDomain`; a
|
|
27
|
+
* throttled request fails with HTTP 429.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const check = await preflightAppDomain(client, { appId, domain: 'app.example.com', port: 443 })
|
|
32
|
+
* console.log(check.is_valid)
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* ## Safe Version
|
|
36
|
+
*
|
|
37
|
+
* Use `safePreflightAppDomain` to get a `SafeResult` instead of an exception.
|
|
38
|
+
*/
|
|
39
|
+
declare const preflightAppDomain: {
|
|
40
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
41
|
+
appId: string;
|
|
42
|
+
domain: string;
|
|
43
|
+
port: number;
|
|
44
|
+
turnstile_token?: string | undefined;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
domain: string;
|
|
47
|
+
port: number;
|
|
48
|
+
is_valid: boolean;
|
|
49
|
+
records: {
|
|
50
|
+
record_type: string;
|
|
51
|
+
query_name: string;
|
|
52
|
+
expected_value: string;
|
|
53
|
+
actual_value?: string | null | undefined;
|
|
54
|
+
is_valid: boolean;
|
|
55
|
+
warning_message?: string | null | undefined;
|
|
56
|
+
}[];
|
|
57
|
+
}>;
|
|
58
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
59
|
+
appId: string;
|
|
60
|
+
domain: string;
|
|
61
|
+
port: number;
|
|
62
|
+
turnstile_token?: string | undefined;
|
|
63
|
+
}, parameters: {
|
|
64
|
+
schema: T;
|
|
65
|
+
}): Promise<z.infer<T>>;
|
|
66
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
67
|
+
appId: string;
|
|
68
|
+
domain: string;
|
|
69
|
+
port: number;
|
|
70
|
+
turnstile_token?: string | undefined;
|
|
71
|
+
}, parameters: {
|
|
72
|
+
schema: false;
|
|
73
|
+
}): Promise<unknown>;
|
|
74
|
+
}, safePreflightAppDomain: {
|
|
75
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
76
|
+
appId: string;
|
|
77
|
+
domain: string;
|
|
78
|
+
port: number;
|
|
79
|
+
turnstile_token?: string | undefined;
|
|
80
|
+
}): Promise<import("../..").SafeResult<{
|
|
81
|
+
domain: string;
|
|
82
|
+
port: number;
|
|
83
|
+
is_valid: boolean;
|
|
84
|
+
records: {
|
|
85
|
+
record_type: string;
|
|
86
|
+
query_name: string;
|
|
87
|
+
expected_value: string;
|
|
88
|
+
actual_value?: string | null | undefined;
|
|
89
|
+
is_valid: boolean;
|
|
90
|
+
warning_message?: string | null | undefined;
|
|
91
|
+
}[];
|
|
92
|
+
}>>;
|
|
93
|
+
<T extends z.ZodTypeAny>(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
94
|
+
appId: string;
|
|
95
|
+
domain: string;
|
|
96
|
+
port: number;
|
|
97
|
+
turnstile_token?: string | undefined;
|
|
98
|
+
}, parameters: {
|
|
99
|
+
schema: T;
|
|
100
|
+
}): Promise<import("../..").SafeResult<z.infer<T>>>;
|
|
101
|
+
(client: import("../..").BaseClient<import("../..").ApiVersion>, params: {
|
|
102
|
+
appId: string;
|
|
103
|
+
domain: string;
|
|
104
|
+
port: number;
|
|
105
|
+
turnstile_token?: string | undefined;
|
|
106
|
+
}, parameters: {
|
|
107
|
+
schema: false;
|
|
108
|
+
}): Promise<import("../..").SafeResult<unknown>>;
|
|
109
|
+
};
|
|
110
|
+
export { preflightAppDomain, safePreflightAppDomain };
|