@krovacloud/sdk 0.2.0 → 0.3.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/CHANGELOG.md +12 -0
- package/README.md +46 -1
- package/dist/index.cjs +188 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +171 -13
- package/dist/index.d.ts +171 -13
- package/dist/index.js +188 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -664,7 +664,11 @@ interface paths {
|
|
|
664
664
|
headers: {
|
|
665
665
|
[name: string]: unknown;
|
|
666
666
|
};
|
|
667
|
-
content
|
|
667
|
+
content: {
|
|
668
|
+
"application/json": {
|
|
669
|
+
domains: components["schemas"]["Domain"][];
|
|
670
|
+
};
|
|
671
|
+
};
|
|
668
672
|
};
|
|
669
673
|
};
|
|
670
674
|
};
|
|
@@ -735,7 +739,11 @@ interface paths {
|
|
|
735
739
|
headers: {
|
|
736
740
|
[name: string]: unknown;
|
|
737
741
|
};
|
|
738
|
-
content
|
|
742
|
+
content: {
|
|
743
|
+
"application/json": {
|
|
744
|
+
domain: components["schemas"]["Domain"];
|
|
745
|
+
};
|
|
746
|
+
};
|
|
739
747
|
};
|
|
740
748
|
400: components["responses"]["BadRequest"];
|
|
741
749
|
429: components["responses"]["RateLimited"];
|
|
@@ -776,7 +784,11 @@ interface paths {
|
|
|
776
784
|
headers: {
|
|
777
785
|
[name: string]: unknown;
|
|
778
786
|
};
|
|
779
|
-
content
|
|
787
|
+
content: {
|
|
788
|
+
"application/json": {
|
|
789
|
+
success: boolean;
|
|
790
|
+
};
|
|
791
|
+
};
|
|
780
792
|
};
|
|
781
793
|
404: components["responses"]["NotFound"];
|
|
782
794
|
};
|
|
@@ -843,7 +855,11 @@ interface paths {
|
|
|
843
855
|
headers: {
|
|
844
856
|
[name: string]: unknown;
|
|
845
857
|
};
|
|
846
|
-
content
|
|
858
|
+
content: {
|
|
859
|
+
"application/json": {
|
|
860
|
+
domain: components["schemas"]["Domain"];
|
|
861
|
+
};
|
|
862
|
+
};
|
|
847
863
|
};
|
|
848
864
|
400: components["responses"]["BadRequest"];
|
|
849
865
|
404: components["responses"]["NotFound"];
|
|
@@ -877,7 +893,11 @@ interface paths {
|
|
|
877
893
|
headers: {
|
|
878
894
|
[name: string]: unknown;
|
|
879
895
|
};
|
|
880
|
-
content
|
|
896
|
+
content: {
|
|
897
|
+
"application/json": {
|
|
898
|
+
tcpMappings: components["schemas"]["TcpMapping"][];
|
|
899
|
+
};
|
|
900
|
+
};
|
|
881
901
|
};
|
|
882
902
|
};
|
|
883
903
|
};
|
|
@@ -910,7 +930,11 @@ interface paths {
|
|
|
910
930
|
headers: {
|
|
911
931
|
[name: string]: unknown;
|
|
912
932
|
};
|
|
913
|
-
content
|
|
933
|
+
content: {
|
|
934
|
+
"application/json": {
|
|
935
|
+
tcpMapping: components["schemas"]["TcpMapping"];
|
|
936
|
+
};
|
|
937
|
+
};
|
|
914
938
|
};
|
|
915
939
|
400: components["responses"]["BadRequest"];
|
|
916
940
|
429: components["responses"]["RateLimited"];
|
|
@@ -951,7 +975,11 @@ interface paths {
|
|
|
951
975
|
headers: {
|
|
952
976
|
[name: string]: unknown;
|
|
953
977
|
};
|
|
954
|
-
content
|
|
978
|
+
content: {
|
|
979
|
+
"application/json": {
|
|
980
|
+
success: boolean;
|
|
981
|
+
};
|
|
982
|
+
};
|
|
955
983
|
};
|
|
956
984
|
404: components["responses"]["NotFound"];
|
|
957
985
|
};
|
|
@@ -986,7 +1014,11 @@ interface paths {
|
|
|
986
1014
|
headers: {
|
|
987
1015
|
[name: string]: unknown;
|
|
988
1016
|
};
|
|
989
|
-
content
|
|
1017
|
+
content: {
|
|
1018
|
+
"application/json": {
|
|
1019
|
+
snapshots: components["schemas"]["Snapshot"][];
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
990
1022
|
};
|
|
991
1023
|
};
|
|
992
1024
|
};
|
|
@@ -1018,7 +1050,11 @@ interface paths {
|
|
|
1018
1050
|
headers: {
|
|
1019
1051
|
[name: string]: unknown;
|
|
1020
1052
|
};
|
|
1021
|
-
content
|
|
1053
|
+
content: {
|
|
1054
|
+
"application/json": {
|
|
1055
|
+
snapshot: components["schemas"]["Snapshot"];
|
|
1056
|
+
};
|
|
1057
|
+
};
|
|
1022
1058
|
};
|
|
1023
1059
|
429: components["responses"]["RateLimited"];
|
|
1024
1060
|
};
|
|
@@ -1058,7 +1094,11 @@ interface paths {
|
|
|
1058
1094
|
headers: {
|
|
1059
1095
|
[name: string]: unknown;
|
|
1060
1096
|
};
|
|
1061
|
-
content
|
|
1097
|
+
content: {
|
|
1098
|
+
"application/json": {
|
|
1099
|
+
success: boolean;
|
|
1100
|
+
};
|
|
1101
|
+
};
|
|
1062
1102
|
};
|
|
1063
1103
|
404: components["responses"]["NotFound"];
|
|
1064
1104
|
};
|
|
@@ -1101,7 +1141,11 @@ interface paths {
|
|
|
1101
1141
|
headers: {
|
|
1102
1142
|
[name: string]: unknown;
|
|
1103
1143
|
};
|
|
1104
|
-
content
|
|
1144
|
+
content: {
|
|
1145
|
+
"application/json": {
|
|
1146
|
+
success: boolean;
|
|
1147
|
+
};
|
|
1148
|
+
};
|
|
1105
1149
|
};
|
|
1106
1150
|
404: components["responses"]["NotFound"];
|
|
1107
1151
|
};
|
|
@@ -1322,7 +1366,11 @@ interface paths {
|
|
|
1322
1366
|
headers: {
|
|
1323
1367
|
[name: string]: unknown;
|
|
1324
1368
|
};
|
|
1325
|
-
content
|
|
1369
|
+
content: {
|
|
1370
|
+
"application/json": {
|
|
1371
|
+
success: boolean;
|
|
1372
|
+
};
|
|
1373
|
+
};
|
|
1326
1374
|
};
|
|
1327
1375
|
404: components["responses"]["NotFound"];
|
|
1328
1376
|
/** @description Cannot cancel an import past the 'uploading' state */
|
|
@@ -1815,6 +1863,18 @@ type Pagination = components["schemas"]["Pagination"];
|
|
|
1815
1863
|
type Space = components["schemas"]["Space"];
|
|
1816
1864
|
/** A Cube's SSH connection info (host, port, user, and pinned host keys). */
|
|
1817
1865
|
type CubeSshInfo = components["schemas"]["CubeSshInfo"];
|
|
1866
|
+
/** A custom domain attached to a Cube. */
|
|
1867
|
+
type Domain = components["schemas"]["Domain"];
|
|
1868
|
+
/** A snapshot of a Cube's disk. */
|
|
1869
|
+
type Snapshot = components["schemas"]["Snapshot"];
|
|
1870
|
+
/** A TCP port mapping exposing a Cube port on the host. */
|
|
1871
|
+
type TcpMapping = components["schemas"]["TcpMapping"];
|
|
1872
|
+
/** Request body for attaching a custom domain to a Cube. */
|
|
1873
|
+
type CreateDomainInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/domains"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1874
|
+
/** Request body for updating a custom domain's proxy settings. */
|
|
1875
|
+
type UpdateDomainInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/domains/{mappingId}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
1876
|
+
/** Request body for creating a TCP port mapping. */
|
|
1877
|
+
type CreateTcpMappingInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/tcp-mappings"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1818
1878
|
/** Default API base URL — the single `servers[0].url` from the OpenAPI spec. */
|
|
1819
1879
|
declare const DEFAULT_BASE_URL = "https://krova.cloud/api/v1";
|
|
1820
1880
|
/**
|
|
@@ -1934,6 +1994,13 @@ declare class KrovaClient {
|
|
|
1934
1994
|
* available) the pinned host public keys for strict host-key verification.
|
|
1935
1995
|
*/
|
|
1936
1996
|
ssh: (spaceId: string, cubeId: string) => Promise<CubeSshInfo>;
|
|
1997
|
+
/**
|
|
1998
|
+
* Restore a Cube's disk from one of its {@link Snapshot}s (asynchronous —
|
|
1999
|
+
* the restore is enqueued). The Cube's current disk is replaced.
|
|
2000
|
+
*/
|
|
2001
|
+
restore: (spaceId: string, cubeId: string, snapshotId: string) => Promise<{
|
|
2002
|
+
success: boolean;
|
|
2003
|
+
}>;
|
|
1937
2004
|
};
|
|
1938
2005
|
/**
|
|
1939
2006
|
* Resolve the {@link Space} this API key is scoped to — so you don't have to
|
|
@@ -1946,6 +2013,97 @@ declare class KrovaClient {
|
|
|
1946
2013
|
* ```
|
|
1947
2014
|
*/
|
|
1948
2015
|
getSpace(): Promise<Space>;
|
|
2016
|
+
readonly domains: {
|
|
2017
|
+
/** List the custom domains attached to a Cube. */
|
|
2018
|
+
list: (spaceId: string, cubeId: string) => Promise<Domain[]>;
|
|
2019
|
+
/** Attach a custom domain to a Cube. `domain` + `port` are required. */
|
|
2020
|
+
create: (spaceId: string, cubeId: string, body: CreateDomainInput) => Promise<Domain>;
|
|
2021
|
+
/** Update a domain's per-domain proxy settings. */
|
|
2022
|
+
update: (spaceId: string, cubeId: string, mappingId: string, body: UpdateDomainInput) => Promise<Domain>;
|
|
2023
|
+
/** Detach a custom domain from a Cube. */
|
|
2024
|
+
delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
|
|
2025
|
+
success: boolean;
|
|
2026
|
+
}>;
|
|
2027
|
+
};
|
|
2028
|
+
readonly snapshots: {
|
|
2029
|
+
/** List a Cube's snapshots. */
|
|
2030
|
+
list: (spaceId: string, cubeId: string) => Promise<Snapshot[]>;
|
|
2031
|
+
/** Create a snapshot of a Cube's disk (asynchronous — enqueued). */
|
|
2032
|
+
create: (spaceId: string, cubeId: string, body?: {
|
|
2033
|
+
name?: string;
|
|
2034
|
+
}) => Promise<Snapshot>;
|
|
2035
|
+
/** Delete a snapshot. */
|
|
2036
|
+
delete: (spaceId: string, cubeId: string, snapshotId: string) => Promise<{
|
|
2037
|
+
success: boolean;
|
|
2038
|
+
}>;
|
|
2039
|
+
};
|
|
2040
|
+
readonly tcpMappings: {
|
|
2041
|
+
/** List a Cube's TCP port mappings. */
|
|
2042
|
+
list: (spaceId: string, cubeId: string) => Promise<TcpMapping[]>;
|
|
2043
|
+
/**
|
|
2044
|
+
* Create a TCP port mapping exposing a Cube port on the host. `cubePort` is
|
|
2045
|
+
* required; `whitelistIps` optionally restricts who can reach it.
|
|
2046
|
+
*/
|
|
2047
|
+
create: (spaceId: string, cubeId: string, body: CreateTcpMappingInput) => Promise<TcpMapping>;
|
|
2048
|
+
/** Delete a TCP port mapping. */
|
|
2049
|
+
delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
|
|
2050
|
+
success: boolean;
|
|
2051
|
+
}>;
|
|
2052
|
+
};
|
|
2053
|
+
readonly imports: {
|
|
2054
|
+
/**
|
|
2055
|
+
* Start importing a `.cube` archive into a new Cube. Returns the multipart
|
|
2056
|
+
* upload target (`importId`, `uploadId`, presigned `parts`, …). Upload the
|
|
2057
|
+
* archive to those URLs, then call {@link imports.complete}.
|
|
2058
|
+
*/
|
|
2059
|
+
create: (spaceId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2060
|
+
importId?: string | undefined;
|
|
2061
|
+
uploadId?: string | undefined;
|
|
2062
|
+
key?: string | undefined;
|
|
2063
|
+
chunkSizeBytes?: number | undefined;
|
|
2064
|
+
parts?: {
|
|
2065
|
+
partNumber?: number | undefined;
|
|
2066
|
+
url?: string | undefined;
|
|
2067
|
+
}[] | undefined;
|
|
2068
|
+
expiresAt?: string | undefined;
|
|
2069
|
+
} | undefined>;
|
|
2070
|
+
/** Get an in-progress or completed import by id. */
|
|
2071
|
+
get: (spaceId: string, importId: string) => Promise<{
|
|
2072
|
+
import?: {
|
|
2073
|
+
id?: string | undefined;
|
|
2074
|
+
name?: string | undefined;
|
|
2075
|
+
status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired" | undefined;
|
|
2076
|
+
cubeId?: string | null | undefined;
|
|
2077
|
+
error?: string | null | undefined;
|
|
2078
|
+
createdAt?: string | undefined;
|
|
2079
|
+
updatedAt?: string | undefined;
|
|
2080
|
+
completedAt?: string | null | undefined;
|
|
2081
|
+
} | undefined;
|
|
2082
|
+
}>;
|
|
2083
|
+
/**
|
|
2084
|
+
* Finish an import after the archive has been uploaded — provisions the
|
|
2085
|
+
* Cube. Pass the uploaded `parts` (partNumber + etag) and the resolved
|
|
2086
|
+
* `config`.
|
|
2087
|
+
*/
|
|
2088
|
+
complete: (spaceId: string, importId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports/{importId}/complete"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2089
|
+
importId?: string | undefined;
|
|
2090
|
+
cubeId?: string | undefined;
|
|
2091
|
+
status?: "provisioning" | undefined;
|
|
2092
|
+
} | undefined>;
|
|
2093
|
+
/** Cancel an in-progress import. */
|
|
2094
|
+
cancel: (spaceId: string, importId: string) => Promise<{
|
|
2095
|
+
success: boolean;
|
|
2096
|
+
} | undefined>;
|
|
2097
|
+
};
|
|
2098
|
+
readonly backups: {
|
|
2099
|
+
/** Get a time-limited download URL for a backup `.cube` archive. */
|
|
2100
|
+
download: (spaceId: string, backupId: string) => Promise<{
|
|
2101
|
+
url?: string | undefined;
|
|
2102
|
+
filename?: string | undefined;
|
|
2103
|
+
sizeBytes?: number | null | undefined;
|
|
2104
|
+
expiresAt?: string | undefined;
|
|
2105
|
+
} | undefined>;
|
|
2106
|
+
};
|
|
1949
2107
|
readonly catalog: {
|
|
1950
2108
|
/** List regions with available capacity. */
|
|
1951
2109
|
regions: () => Promise<{
|
|
@@ -2033,4 +2191,4 @@ declare class KrovaError extends Error {
|
|
|
2033
2191
|
*/
|
|
2034
2192
|
declare function krovaErrorFrom(response: Response, body: KrovaErrorBody | undefined): KrovaError;
|
|
2035
2193
|
|
|
2036
|
-
export { type AuthScheme, type Cube, type CubeSshInfo, DEFAULT_BASE_URL, type Image, KrovaClient, type KrovaClientOptions, KrovaError, type KrovaErrorBody, type Pagination, type PricingTier, type Region, type Space, type components, krovaErrorFrom, type paths };
|
|
2194
|
+
export { type AuthScheme, type CreateDomainInput, type CreateTcpMappingInput, type Cube, type CubeSshInfo, DEFAULT_BASE_URL, type Domain, type Image, KrovaClient, type KrovaClientOptions, KrovaError, type KrovaErrorBody, type Pagination, type PricingTier, type Region, type Snapshot, type Space, type TcpMapping, type UpdateDomainInput, type components, krovaErrorFrom, type paths };
|
package/dist/index.d.ts
CHANGED
|
@@ -664,7 +664,11 @@ interface paths {
|
|
|
664
664
|
headers: {
|
|
665
665
|
[name: string]: unknown;
|
|
666
666
|
};
|
|
667
|
-
content
|
|
667
|
+
content: {
|
|
668
|
+
"application/json": {
|
|
669
|
+
domains: components["schemas"]["Domain"][];
|
|
670
|
+
};
|
|
671
|
+
};
|
|
668
672
|
};
|
|
669
673
|
};
|
|
670
674
|
};
|
|
@@ -735,7 +739,11 @@ interface paths {
|
|
|
735
739
|
headers: {
|
|
736
740
|
[name: string]: unknown;
|
|
737
741
|
};
|
|
738
|
-
content
|
|
742
|
+
content: {
|
|
743
|
+
"application/json": {
|
|
744
|
+
domain: components["schemas"]["Domain"];
|
|
745
|
+
};
|
|
746
|
+
};
|
|
739
747
|
};
|
|
740
748
|
400: components["responses"]["BadRequest"];
|
|
741
749
|
429: components["responses"]["RateLimited"];
|
|
@@ -776,7 +784,11 @@ interface paths {
|
|
|
776
784
|
headers: {
|
|
777
785
|
[name: string]: unknown;
|
|
778
786
|
};
|
|
779
|
-
content
|
|
787
|
+
content: {
|
|
788
|
+
"application/json": {
|
|
789
|
+
success: boolean;
|
|
790
|
+
};
|
|
791
|
+
};
|
|
780
792
|
};
|
|
781
793
|
404: components["responses"]["NotFound"];
|
|
782
794
|
};
|
|
@@ -843,7 +855,11 @@ interface paths {
|
|
|
843
855
|
headers: {
|
|
844
856
|
[name: string]: unknown;
|
|
845
857
|
};
|
|
846
|
-
content
|
|
858
|
+
content: {
|
|
859
|
+
"application/json": {
|
|
860
|
+
domain: components["schemas"]["Domain"];
|
|
861
|
+
};
|
|
862
|
+
};
|
|
847
863
|
};
|
|
848
864
|
400: components["responses"]["BadRequest"];
|
|
849
865
|
404: components["responses"]["NotFound"];
|
|
@@ -877,7 +893,11 @@ interface paths {
|
|
|
877
893
|
headers: {
|
|
878
894
|
[name: string]: unknown;
|
|
879
895
|
};
|
|
880
|
-
content
|
|
896
|
+
content: {
|
|
897
|
+
"application/json": {
|
|
898
|
+
tcpMappings: components["schemas"]["TcpMapping"][];
|
|
899
|
+
};
|
|
900
|
+
};
|
|
881
901
|
};
|
|
882
902
|
};
|
|
883
903
|
};
|
|
@@ -910,7 +930,11 @@ interface paths {
|
|
|
910
930
|
headers: {
|
|
911
931
|
[name: string]: unknown;
|
|
912
932
|
};
|
|
913
|
-
content
|
|
933
|
+
content: {
|
|
934
|
+
"application/json": {
|
|
935
|
+
tcpMapping: components["schemas"]["TcpMapping"];
|
|
936
|
+
};
|
|
937
|
+
};
|
|
914
938
|
};
|
|
915
939
|
400: components["responses"]["BadRequest"];
|
|
916
940
|
429: components["responses"]["RateLimited"];
|
|
@@ -951,7 +975,11 @@ interface paths {
|
|
|
951
975
|
headers: {
|
|
952
976
|
[name: string]: unknown;
|
|
953
977
|
};
|
|
954
|
-
content
|
|
978
|
+
content: {
|
|
979
|
+
"application/json": {
|
|
980
|
+
success: boolean;
|
|
981
|
+
};
|
|
982
|
+
};
|
|
955
983
|
};
|
|
956
984
|
404: components["responses"]["NotFound"];
|
|
957
985
|
};
|
|
@@ -986,7 +1014,11 @@ interface paths {
|
|
|
986
1014
|
headers: {
|
|
987
1015
|
[name: string]: unknown;
|
|
988
1016
|
};
|
|
989
|
-
content
|
|
1017
|
+
content: {
|
|
1018
|
+
"application/json": {
|
|
1019
|
+
snapshots: components["schemas"]["Snapshot"][];
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
990
1022
|
};
|
|
991
1023
|
};
|
|
992
1024
|
};
|
|
@@ -1018,7 +1050,11 @@ interface paths {
|
|
|
1018
1050
|
headers: {
|
|
1019
1051
|
[name: string]: unknown;
|
|
1020
1052
|
};
|
|
1021
|
-
content
|
|
1053
|
+
content: {
|
|
1054
|
+
"application/json": {
|
|
1055
|
+
snapshot: components["schemas"]["Snapshot"];
|
|
1056
|
+
};
|
|
1057
|
+
};
|
|
1022
1058
|
};
|
|
1023
1059
|
429: components["responses"]["RateLimited"];
|
|
1024
1060
|
};
|
|
@@ -1058,7 +1094,11 @@ interface paths {
|
|
|
1058
1094
|
headers: {
|
|
1059
1095
|
[name: string]: unknown;
|
|
1060
1096
|
};
|
|
1061
|
-
content
|
|
1097
|
+
content: {
|
|
1098
|
+
"application/json": {
|
|
1099
|
+
success: boolean;
|
|
1100
|
+
};
|
|
1101
|
+
};
|
|
1062
1102
|
};
|
|
1063
1103
|
404: components["responses"]["NotFound"];
|
|
1064
1104
|
};
|
|
@@ -1101,7 +1141,11 @@ interface paths {
|
|
|
1101
1141
|
headers: {
|
|
1102
1142
|
[name: string]: unknown;
|
|
1103
1143
|
};
|
|
1104
|
-
content
|
|
1144
|
+
content: {
|
|
1145
|
+
"application/json": {
|
|
1146
|
+
success: boolean;
|
|
1147
|
+
};
|
|
1148
|
+
};
|
|
1105
1149
|
};
|
|
1106
1150
|
404: components["responses"]["NotFound"];
|
|
1107
1151
|
};
|
|
@@ -1322,7 +1366,11 @@ interface paths {
|
|
|
1322
1366
|
headers: {
|
|
1323
1367
|
[name: string]: unknown;
|
|
1324
1368
|
};
|
|
1325
|
-
content
|
|
1369
|
+
content: {
|
|
1370
|
+
"application/json": {
|
|
1371
|
+
success: boolean;
|
|
1372
|
+
};
|
|
1373
|
+
};
|
|
1326
1374
|
};
|
|
1327
1375
|
404: components["responses"]["NotFound"];
|
|
1328
1376
|
/** @description Cannot cancel an import past the 'uploading' state */
|
|
@@ -1815,6 +1863,18 @@ type Pagination = components["schemas"]["Pagination"];
|
|
|
1815
1863
|
type Space = components["schemas"]["Space"];
|
|
1816
1864
|
/** A Cube's SSH connection info (host, port, user, and pinned host keys). */
|
|
1817
1865
|
type CubeSshInfo = components["schemas"]["CubeSshInfo"];
|
|
1866
|
+
/** A custom domain attached to a Cube. */
|
|
1867
|
+
type Domain = components["schemas"]["Domain"];
|
|
1868
|
+
/** A snapshot of a Cube's disk. */
|
|
1869
|
+
type Snapshot = components["schemas"]["Snapshot"];
|
|
1870
|
+
/** A TCP port mapping exposing a Cube port on the host. */
|
|
1871
|
+
type TcpMapping = components["schemas"]["TcpMapping"];
|
|
1872
|
+
/** Request body for attaching a custom domain to a Cube. */
|
|
1873
|
+
type CreateDomainInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/domains"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1874
|
+
/** Request body for updating a custom domain's proxy settings. */
|
|
1875
|
+
type UpdateDomainInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/domains/{mappingId}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
1876
|
+
/** Request body for creating a TCP port mapping. */
|
|
1877
|
+
type CreateTcpMappingInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/tcp-mappings"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1818
1878
|
/** Default API base URL — the single `servers[0].url` from the OpenAPI spec. */
|
|
1819
1879
|
declare const DEFAULT_BASE_URL = "https://krova.cloud/api/v1";
|
|
1820
1880
|
/**
|
|
@@ -1934,6 +1994,13 @@ declare class KrovaClient {
|
|
|
1934
1994
|
* available) the pinned host public keys for strict host-key verification.
|
|
1935
1995
|
*/
|
|
1936
1996
|
ssh: (spaceId: string, cubeId: string) => Promise<CubeSshInfo>;
|
|
1997
|
+
/**
|
|
1998
|
+
* Restore a Cube's disk from one of its {@link Snapshot}s (asynchronous —
|
|
1999
|
+
* the restore is enqueued). The Cube's current disk is replaced.
|
|
2000
|
+
*/
|
|
2001
|
+
restore: (spaceId: string, cubeId: string, snapshotId: string) => Promise<{
|
|
2002
|
+
success: boolean;
|
|
2003
|
+
}>;
|
|
1937
2004
|
};
|
|
1938
2005
|
/**
|
|
1939
2006
|
* Resolve the {@link Space} this API key is scoped to — so you don't have to
|
|
@@ -1946,6 +2013,97 @@ declare class KrovaClient {
|
|
|
1946
2013
|
* ```
|
|
1947
2014
|
*/
|
|
1948
2015
|
getSpace(): Promise<Space>;
|
|
2016
|
+
readonly domains: {
|
|
2017
|
+
/** List the custom domains attached to a Cube. */
|
|
2018
|
+
list: (spaceId: string, cubeId: string) => Promise<Domain[]>;
|
|
2019
|
+
/** Attach a custom domain to a Cube. `domain` + `port` are required. */
|
|
2020
|
+
create: (spaceId: string, cubeId: string, body: CreateDomainInput) => Promise<Domain>;
|
|
2021
|
+
/** Update a domain's per-domain proxy settings. */
|
|
2022
|
+
update: (spaceId: string, cubeId: string, mappingId: string, body: UpdateDomainInput) => Promise<Domain>;
|
|
2023
|
+
/** Detach a custom domain from a Cube. */
|
|
2024
|
+
delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
|
|
2025
|
+
success: boolean;
|
|
2026
|
+
}>;
|
|
2027
|
+
};
|
|
2028
|
+
readonly snapshots: {
|
|
2029
|
+
/** List a Cube's snapshots. */
|
|
2030
|
+
list: (spaceId: string, cubeId: string) => Promise<Snapshot[]>;
|
|
2031
|
+
/** Create a snapshot of a Cube's disk (asynchronous — enqueued). */
|
|
2032
|
+
create: (spaceId: string, cubeId: string, body?: {
|
|
2033
|
+
name?: string;
|
|
2034
|
+
}) => Promise<Snapshot>;
|
|
2035
|
+
/** Delete a snapshot. */
|
|
2036
|
+
delete: (spaceId: string, cubeId: string, snapshotId: string) => Promise<{
|
|
2037
|
+
success: boolean;
|
|
2038
|
+
}>;
|
|
2039
|
+
};
|
|
2040
|
+
readonly tcpMappings: {
|
|
2041
|
+
/** List a Cube's TCP port mappings. */
|
|
2042
|
+
list: (spaceId: string, cubeId: string) => Promise<TcpMapping[]>;
|
|
2043
|
+
/**
|
|
2044
|
+
* Create a TCP port mapping exposing a Cube port on the host. `cubePort` is
|
|
2045
|
+
* required; `whitelistIps` optionally restricts who can reach it.
|
|
2046
|
+
*/
|
|
2047
|
+
create: (spaceId: string, cubeId: string, body: CreateTcpMappingInput) => Promise<TcpMapping>;
|
|
2048
|
+
/** Delete a TCP port mapping. */
|
|
2049
|
+
delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
|
|
2050
|
+
success: boolean;
|
|
2051
|
+
}>;
|
|
2052
|
+
};
|
|
2053
|
+
readonly imports: {
|
|
2054
|
+
/**
|
|
2055
|
+
* Start importing a `.cube` archive into a new Cube. Returns the multipart
|
|
2056
|
+
* upload target (`importId`, `uploadId`, presigned `parts`, …). Upload the
|
|
2057
|
+
* archive to those URLs, then call {@link imports.complete}.
|
|
2058
|
+
*/
|
|
2059
|
+
create: (spaceId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2060
|
+
importId?: string | undefined;
|
|
2061
|
+
uploadId?: string | undefined;
|
|
2062
|
+
key?: string | undefined;
|
|
2063
|
+
chunkSizeBytes?: number | undefined;
|
|
2064
|
+
parts?: {
|
|
2065
|
+
partNumber?: number | undefined;
|
|
2066
|
+
url?: string | undefined;
|
|
2067
|
+
}[] | undefined;
|
|
2068
|
+
expiresAt?: string | undefined;
|
|
2069
|
+
} | undefined>;
|
|
2070
|
+
/** Get an in-progress or completed import by id. */
|
|
2071
|
+
get: (spaceId: string, importId: string) => Promise<{
|
|
2072
|
+
import?: {
|
|
2073
|
+
id?: string | undefined;
|
|
2074
|
+
name?: string | undefined;
|
|
2075
|
+
status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired" | undefined;
|
|
2076
|
+
cubeId?: string | null | undefined;
|
|
2077
|
+
error?: string | null | undefined;
|
|
2078
|
+
createdAt?: string | undefined;
|
|
2079
|
+
updatedAt?: string | undefined;
|
|
2080
|
+
completedAt?: string | null | undefined;
|
|
2081
|
+
} | undefined;
|
|
2082
|
+
}>;
|
|
2083
|
+
/**
|
|
2084
|
+
* Finish an import after the archive has been uploaded — provisions the
|
|
2085
|
+
* Cube. Pass the uploaded `parts` (partNumber + etag) and the resolved
|
|
2086
|
+
* `config`.
|
|
2087
|
+
*/
|
|
2088
|
+
complete: (spaceId: string, importId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports/{importId}/complete"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2089
|
+
importId?: string | undefined;
|
|
2090
|
+
cubeId?: string | undefined;
|
|
2091
|
+
status?: "provisioning" | undefined;
|
|
2092
|
+
} | undefined>;
|
|
2093
|
+
/** Cancel an in-progress import. */
|
|
2094
|
+
cancel: (spaceId: string, importId: string) => Promise<{
|
|
2095
|
+
success: boolean;
|
|
2096
|
+
} | undefined>;
|
|
2097
|
+
};
|
|
2098
|
+
readonly backups: {
|
|
2099
|
+
/** Get a time-limited download URL for a backup `.cube` archive. */
|
|
2100
|
+
download: (spaceId: string, backupId: string) => Promise<{
|
|
2101
|
+
url?: string | undefined;
|
|
2102
|
+
filename?: string | undefined;
|
|
2103
|
+
sizeBytes?: number | null | undefined;
|
|
2104
|
+
expiresAt?: string | undefined;
|
|
2105
|
+
} | undefined>;
|
|
2106
|
+
};
|
|
1949
2107
|
readonly catalog: {
|
|
1950
2108
|
/** List regions with available capacity. */
|
|
1951
2109
|
regions: () => Promise<{
|
|
@@ -2033,4 +2191,4 @@ declare class KrovaError extends Error {
|
|
|
2033
2191
|
*/
|
|
2034
2192
|
declare function krovaErrorFrom(response: Response, body: KrovaErrorBody | undefined): KrovaError;
|
|
2035
2193
|
|
|
2036
|
-
export { type AuthScheme, type Cube, type CubeSshInfo, DEFAULT_BASE_URL, type Image, KrovaClient, type KrovaClientOptions, KrovaError, type KrovaErrorBody, type Pagination, type PricingTier, type Region, type Space, type components, krovaErrorFrom, type paths };
|
|
2194
|
+
export { type AuthScheme, type CreateDomainInput, type CreateTcpMappingInput, type Cube, type CubeSshInfo, DEFAULT_BASE_URL, type Domain, type Image, KrovaClient, type KrovaClientOptions, KrovaError, type KrovaErrorBody, type Pagination, type PricingTier, type Region, type Snapshot, type Space, type TcpMapping, type UpdateDomainInput, type components, krovaErrorFrom, type paths };
|