latitudesh-typescript-sdk 0.8.0 → 0.8.2
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/bin/mcp-server.js +252 -113
- package/bin/mcp-server.js.map +19 -19
- package/dist/commonjs/funcs/virtualMachinesList.d.ts +4 -2
- package/dist/commonjs/funcs/virtualMachinesList.d.ts.map +1 -1
- package/dist/commonjs/funcs/virtualMachinesList.js +40 -7
- package/dist/commonjs/funcs/virtualMachinesList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/virtualMachinesList.js +1 -1
- package/dist/commonjs/mcp-server/tools/virtualMachinesList.js.map +1 -1
- package/dist/commonjs/models/billingusage.d.ts +74 -8
- package/dist/commonjs/models/billingusage.d.ts.map +1 -1
- package/dist/commonjs/models/billingusage.js +83 -9
- package/dist/commonjs/models/billingusage.js.map +1 -1
- package/dist/commonjs/models/eventdata.d.ts +18 -18
- package/dist/commonjs/models/eventdata.d.ts.map +1 -1
- package/dist/commonjs/models/eventdata.js +18 -18
- package/dist/commonjs/models/eventdata.js.map +1 -1
- package/dist/commonjs/models/operations/indexvirtualmachine.d.ts +29 -0
- package/dist/commonjs/models/operations/indexvirtualmachine.d.ts.map +1 -1
- package/dist/commonjs/models/operations/indexvirtualmachine.js +38 -1
- package/dist/commonjs/models/operations/indexvirtualmachine.js.map +1 -1
- package/dist/commonjs/models/project.d.ts +57 -13
- package/dist/commonjs/models/project.d.ts.map +1 -1
- package/dist/commonjs/models/project.js +48 -11
- package/dist/commonjs/models/project.js.map +1 -1
- package/dist/commonjs/models/projectinclude.d.ts +6 -0
- package/dist/commonjs/models/projectinclude.d.ts.map +1 -1
- package/dist/commonjs/models/projectinclude.js +8 -0
- package/dist/commonjs/models/projectinclude.js.map +1 -1
- package/dist/commonjs/models/virtualmachineattributes.d.ts +14 -14
- package/dist/commonjs/models/virtualmachineattributes.d.ts.map +1 -1
- package/dist/commonjs/models/virtualmachineattributes.js +7 -15
- package/dist/commonjs/models/virtualmachineattributes.js.map +1 -1
- package/dist/commonjs/models/virtualmachinepayload.d.ts +21 -0
- package/dist/commonjs/models/virtualmachinepayload.d.ts.map +1 -1
- package/dist/commonjs/models/virtualmachinepayload.js +15 -1
- package/dist/commonjs/models/virtualmachinepayload.js.map +1 -1
- package/dist/commonjs/models/virtualmachines.d.ts +3 -11
- package/dist/commonjs/models/virtualmachines.d.ts.map +1 -1
- package/dist/commonjs/models/virtualmachines.js +4 -15
- package/dist/commonjs/models/virtualmachines.js.map +1 -1
- package/dist/commonjs/models/virtualmachineupdatepayload.d.ts +5 -5
- package/dist/commonjs/models/virtualmachineupdatepayload.d.ts.map +1 -1
- package/dist/commonjs/models/virtualmachineupdatepayload.js +6 -7
- package/dist/commonjs/models/virtualmachineupdatepayload.js.map +1 -1
- package/dist/commonjs/sdk/virtualmachines.d.ts +4 -1
- package/dist/commonjs/sdk/virtualmachines.d.ts.map +1 -1
- package/dist/commonjs/sdk/virtualmachines.js +2 -1
- package/dist/commonjs/sdk/virtualmachines.js.map +1 -1
- package/dist/esm/funcs/virtualMachinesList.d.ts +4 -2
- package/dist/esm/funcs/virtualMachinesList.d.ts.map +1 -1
- package/dist/esm/funcs/virtualMachinesList.js +40 -7
- package/dist/esm/funcs/virtualMachinesList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/virtualMachinesList.js +1 -1
- package/dist/esm/mcp-server/tools/virtualMachinesList.js.map +1 -1
- package/dist/esm/models/billingusage.d.ts +74 -8
- package/dist/esm/models/billingusage.d.ts.map +1 -1
- package/dist/esm/models/billingusage.js +76 -8
- package/dist/esm/models/billingusage.js.map +1 -1
- package/dist/esm/models/eventdata.d.ts +18 -18
- package/dist/esm/models/eventdata.d.ts.map +1 -1
- package/dist/esm/models/eventdata.js +18 -18
- package/dist/esm/models/eventdata.js.map +1 -1
- package/dist/esm/models/operations/indexvirtualmachine.d.ts +29 -0
- package/dist/esm/models/operations/indexvirtualmachine.d.ts.map +1 -1
- package/dist/esm/models/operations/indexvirtualmachine.js +35 -0
- package/dist/esm/models/operations/indexvirtualmachine.js.map +1 -1
- package/dist/esm/models/project.d.ts +57 -13
- package/dist/esm/models/project.d.ts.map +1 -1
- package/dist/esm/models/project.js +45 -10
- package/dist/esm/models/project.js.map +1 -1
- package/dist/esm/models/projectinclude.d.ts +6 -0
- package/dist/esm/models/projectinclude.d.ts.map +1 -1
- package/dist/esm/models/projectinclude.js +8 -0
- package/dist/esm/models/projectinclude.js.map +1 -1
- package/dist/esm/models/virtualmachineattributes.d.ts +14 -14
- package/dist/esm/models/virtualmachineattributes.d.ts.map +1 -1
- package/dist/esm/models/virtualmachineattributes.js +6 -14
- package/dist/esm/models/virtualmachineattributes.js.map +1 -1
- package/dist/esm/models/virtualmachinepayload.d.ts +21 -0
- package/dist/esm/models/virtualmachinepayload.d.ts.map +1 -1
- package/dist/esm/models/virtualmachinepayload.js +14 -0
- package/dist/esm/models/virtualmachinepayload.js.map +1 -1
- package/dist/esm/models/virtualmachines.d.ts +3 -11
- package/dist/esm/models/virtualmachines.d.ts.map +1 -1
- package/dist/esm/models/virtualmachines.js +3 -12
- package/dist/esm/models/virtualmachines.js.map +1 -1
- package/dist/esm/models/virtualmachineupdatepayload.d.ts +5 -5
- package/dist/esm/models/virtualmachineupdatepayload.d.ts.map +1 -1
- package/dist/esm/models/virtualmachineupdatepayload.js +5 -6
- package/dist/esm/models/virtualmachineupdatepayload.js.map +1 -1
- package/dist/esm/sdk/virtualmachines.d.ts +4 -1
- package/dist/esm/sdk/virtualmachines.d.ts.map +1 -1
- package/dist/esm/sdk/virtualmachines.js +2 -1
- package/dist/esm/sdk/virtualmachines.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/virtualMachinesList.ts +102 -31
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/virtualMachinesList.ts +1 -1
- package/src/models/billingusage.ts +189 -16
- package/src/models/eventdata.ts +36 -36
- package/src/models/operations/indexvirtualmachine.ts +81 -0
- package/src/models/project.ts +128 -23
- package/src/models/projectinclude.ts +14 -0
- package/src/models/virtualmachineattributes.ts +20 -24
- package/src/models/virtualmachinepayload.ts +31 -0
- package/src/models/virtualmachines.ts +10 -39
- package/src/models/virtualmachineupdatepayload.ts +13 -9
- package/src/sdk/virtualmachines.ts +5 -2
- package/tests/integration/helpers/mock-data.ts +6 -2
- package/tests/integration/projects.test.ts +3 -1
|
@@ -28,18 +28,6 @@ export type VirtualMachineAttributesType = ClosedEnum<
|
|
|
28
28
|
typeof VirtualMachineAttributesType
|
|
29
29
|
>;
|
|
30
30
|
|
|
31
|
-
export const VirtualMachineAttributesStatus = {
|
|
32
|
-
Running: "Running",
|
|
33
|
-
ConfiguringNetwork: "Configuring network",
|
|
34
|
-
Starting: "Starting",
|
|
35
|
-
Scheduling: "Scheduling",
|
|
36
|
-
Scheduled: "Scheduled",
|
|
37
|
-
Destroying: "Destroying",
|
|
38
|
-
} as const;
|
|
39
|
-
export type VirtualMachineAttributesStatus = ClosedEnum<
|
|
40
|
-
typeof VirtualMachineAttributesStatus
|
|
41
|
-
>;
|
|
42
|
-
|
|
43
31
|
/**
|
|
44
32
|
* Features supported by this operating system
|
|
45
33
|
*/
|
|
@@ -56,6 +44,14 @@ export type VirtualMachineAttributesFeatures = {
|
|
|
56
44
|
* Whether user data is supported
|
|
57
45
|
*/
|
|
58
46
|
userData?: boolean | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Whether rescue mode is supported
|
|
49
|
+
*/
|
|
50
|
+
rescue?: boolean | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Whether workflow is supported
|
|
53
|
+
*/
|
|
54
|
+
workflow?: boolean | undefined;
|
|
59
55
|
};
|
|
60
56
|
|
|
61
57
|
/**
|
|
@@ -138,7 +134,10 @@ export type VirtualMachineAttributesTag = {
|
|
|
138
134
|
export type VirtualMachineAttributesAttributes = {
|
|
139
135
|
name?: string | undefined;
|
|
140
136
|
createdAt?: string | undefined;
|
|
141
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Current lifecycle status of the VM, derived from the underlying KubeVirt phase/printable status and capitalized. This is an open set that may grow over time — do not treat it as a closed enum. Known values include: Running, Starting, Stopped, Stopping, Failed, Off, Error, Rebooting, Deleting, Destroying, Configuring network, Scheduling, Scheduled, Provisioning.
|
|
139
|
+
*/
|
|
140
|
+
status?: string | undefined;
|
|
142
141
|
primaryIpv4?: string | null | undefined;
|
|
143
142
|
/**
|
|
144
143
|
* The operating system installed on the virtual machine
|
|
@@ -180,15 +179,6 @@ export const VirtualMachineAttributesType$outboundSchema: z.ZodNativeEnum<
|
|
|
180
179
|
typeof VirtualMachineAttributesType
|
|
181
180
|
> = VirtualMachineAttributesType$inboundSchema;
|
|
182
181
|
|
|
183
|
-
/** @internal */
|
|
184
|
-
export const VirtualMachineAttributesStatus$inboundSchema: z.ZodNativeEnum<
|
|
185
|
-
typeof VirtualMachineAttributesStatus
|
|
186
|
-
> = z.nativeEnum(VirtualMachineAttributesStatus);
|
|
187
|
-
/** @internal */
|
|
188
|
-
export const VirtualMachineAttributesStatus$outboundSchema: z.ZodNativeEnum<
|
|
189
|
-
typeof VirtualMachineAttributesStatus
|
|
190
|
-
> = VirtualMachineAttributesStatus$inboundSchema;
|
|
191
|
-
|
|
192
182
|
/** @internal */
|
|
193
183
|
export const VirtualMachineAttributesFeatures$inboundSchema: z.ZodType<
|
|
194
184
|
VirtualMachineAttributesFeatures,
|
|
@@ -198,6 +188,8 @@ export const VirtualMachineAttributesFeatures$inboundSchema: z.ZodType<
|
|
|
198
188
|
raid: z.boolean().optional(),
|
|
199
189
|
ssh_keys: z.boolean().optional(),
|
|
200
190
|
user_data: z.boolean().optional(),
|
|
191
|
+
rescue: z.boolean().optional(),
|
|
192
|
+
workflow: z.boolean().optional(),
|
|
201
193
|
}).transform((v) => {
|
|
202
194
|
return remap$(v, {
|
|
203
195
|
"ssh_keys": "sshKeys",
|
|
@@ -209,6 +201,8 @@ export type VirtualMachineAttributesFeatures$Outbound = {
|
|
|
209
201
|
raid?: boolean | undefined;
|
|
210
202
|
ssh_keys?: boolean | undefined;
|
|
211
203
|
user_data?: boolean | undefined;
|
|
204
|
+
rescue?: boolean | undefined;
|
|
205
|
+
workflow?: boolean | undefined;
|
|
212
206
|
};
|
|
213
207
|
|
|
214
208
|
/** @internal */
|
|
@@ -220,6 +214,8 @@ export const VirtualMachineAttributesFeatures$outboundSchema: z.ZodType<
|
|
|
220
214
|
raid: z.boolean().optional(),
|
|
221
215
|
sshKeys: z.boolean().optional(),
|
|
222
216
|
userData: z.boolean().optional(),
|
|
217
|
+
rescue: z.boolean().optional(),
|
|
218
|
+
workflow: z.boolean().optional(),
|
|
223
219
|
}).transform((v) => {
|
|
224
220
|
return remap$(v, {
|
|
225
221
|
sshKeys: "ssh_keys",
|
|
@@ -570,7 +566,7 @@ export const VirtualMachineAttributesAttributes$inboundSchema: z.ZodType<
|
|
|
570
566
|
> = z.object({
|
|
571
567
|
name: z.string().optional(),
|
|
572
568
|
created_at: z.string().optional(),
|
|
573
|
-
status:
|
|
569
|
+
status: z.string().optional(),
|
|
574
570
|
primary_ipv4: z.nullable(z.string()).optional(),
|
|
575
571
|
operating_system: z.nullable(
|
|
576
572
|
z.lazy(() => VirtualMachineAttributesOperatingSystem$inboundSchema),
|
|
@@ -627,7 +623,7 @@ export const VirtualMachineAttributesAttributes$outboundSchema: z.ZodType<
|
|
|
627
623
|
> = z.object({
|
|
628
624
|
name: z.string().optional(),
|
|
629
625
|
createdAt: z.string().optional(),
|
|
630
|
-
status:
|
|
626
|
+
status: z.string().optional(),
|
|
631
627
|
primaryIpv4: z.nullable(z.string()).optional(),
|
|
632
628
|
operatingSystem: z.nullable(
|
|
633
629
|
z.lazy(() => VirtualMachineAttributesOperatingSystem$outboundSchema),
|
|
@@ -16,6 +16,21 @@ export type VirtualMachinePayloadType = ClosedEnum<
|
|
|
16
16
|
typeof VirtualMachinePayloadType
|
|
17
17
|
>;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Billing cycle for the VM. The supported set is validated per-project (on_demand vs reserved). Defaults to the project's default billing when omitted.
|
|
21
|
+
*/
|
|
22
|
+
export const VirtualMachinePayloadBilling = {
|
|
23
|
+
Hourly: "hourly",
|
|
24
|
+
Monthly: "monthly",
|
|
25
|
+
Yearly: "yearly",
|
|
26
|
+
} as const;
|
|
27
|
+
/**
|
|
28
|
+
* Billing cycle for the VM. The supported set is validated per-project (on_demand vs reserved). Defaults to the project's default billing when omitted.
|
|
29
|
+
*/
|
|
30
|
+
export type VirtualMachinePayloadBilling = ClosedEnum<
|
|
31
|
+
typeof VirtualMachinePayloadBilling
|
|
32
|
+
>;
|
|
33
|
+
|
|
19
34
|
/**
|
|
20
35
|
* A user data record reference (encoded id_hash, e.g. 'ud_xxx', or raw integer id) to apply as cloud-init configuration
|
|
21
36
|
*/
|
|
@@ -23,6 +38,10 @@ export type UserDataUnion = number | string;
|
|
|
23
38
|
|
|
24
39
|
export type VirtualMachinePayloadAttributes = {
|
|
25
40
|
name?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Billing cycle for the VM. The supported set is validated per-project (on_demand vs reserved). Defaults to the project's default billing when omitted.
|
|
43
|
+
*/
|
|
44
|
+
billing?: VirtualMachinePayloadBilling | undefined;
|
|
26
45
|
/**
|
|
27
46
|
* The plan ID or Slug for the Virtual Machine
|
|
28
47
|
*/
|
|
@@ -65,6 +84,15 @@ export const VirtualMachinePayloadType$outboundSchema: z.ZodNativeEnum<
|
|
|
65
84
|
typeof VirtualMachinePayloadType
|
|
66
85
|
> = VirtualMachinePayloadType$inboundSchema;
|
|
67
86
|
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const VirtualMachinePayloadBilling$inboundSchema: z.ZodNativeEnum<
|
|
89
|
+
typeof VirtualMachinePayloadBilling
|
|
90
|
+
> = z.nativeEnum(VirtualMachinePayloadBilling);
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const VirtualMachinePayloadBilling$outboundSchema: z.ZodNativeEnum<
|
|
93
|
+
typeof VirtualMachinePayloadBilling
|
|
94
|
+
> = VirtualMachinePayloadBilling$inboundSchema;
|
|
95
|
+
|
|
68
96
|
/** @internal */
|
|
69
97
|
export const UserDataUnion$inboundSchema: z.ZodType<
|
|
70
98
|
UserDataUnion,
|
|
@@ -101,6 +129,7 @@ export const VirtualMachinePayloadAttributes$inboundSchema: z.ZodType<
|
|
|
101
129
|
unknown
|
|
102
130
|
> = z.object({
|
|
103
131
|
name: z.string().default("my-vm"),
|
|
132
|
+
billing: VirtualMachinePayloadBilling$inboundSchema.optional(),
|
|
104
133
|
plan: z.nullable(z.string()).optional(),
|
|
105
134
|
ssh_keys: z.nullable(z.array(z.string())).optional(),
|
|
106
135
|
project: z.string().default("my-project"),
|
|
@@ -118,6 +147,7 @@ export const VirtualMachinePayloadAttributes$inboundSchema: z.ZodType<
|
|
|
118
147
|
/** @internal */
|
|
119
148
|
export type VirtualMachinePayloadAttributes$Outbound = {
|
|
120
149
|
name: string;
|
|
150
|
+
billing?: string | undefined;
|
|
121
151
|
plan?: string | null | undefined;
|
|
122
152
|
ssh_keys?: Array<string> | null | undefined;
|
|
123
153
|
project: string;
|
|
@@ -134,6 +164,7 @@ export const VirtualMachinePayloadAttributes$outboundSchema: z.ZodType<
|
|
|
134
164
|
VirtualMachinePayloadAttributes
|
|
135
165
|
> = z.object({
|
|
136
166
|
name: z.string().default("my-vm"),
|
|
167
|
+
billing: VirtualMachinePayloadBilling$outboundSchema.optional(),
|
|
137
168
|
plan: z.nullable(z.string()).optional(),
|
|
138
169
|
sshKeys: z.nullable(z.array(z.string())).optional(),
|
|
139
170
|
project: z.string().default("my-project"),
|
|
@@ -6,6 +6,12 @@ import * as z from "zod/v3";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
PaginationMeta,
|
|
11
|
+
PaginationMeta$inboundSchema,
|
|
12
|
+
PaginationMeta$Outbound,
|
|
13
|
+
PaginationMeta$outboundSchema,
|
|
14
|
+
} from "./paginationmeta.js";
|
|
9
15
|
import {
|
|
10
16
|
VirtualMachineAttributes,
|
|
11
17
|
VirtualMachineAttributes$inboundSchema,
|
|
@@ -13,46 +19,11 @@ import {
|
|
|
13
19
|
VirtualMachineAttributes$outboundSchema,
|
|
14
20
|
} from "./virtualmachineattributes.js";
|
|
15
21
|
|
|
16
|
-
export type VirtualMachinesMeta = {};
|
|
17
|
-
|
|
18
22
|
export type VirtualMachines = {
|
|
19
23
|
data?: Array<VirtualMachineAttributes> | undefined;
|
|
20
|
-
meta?:
|
|
24
|
+
meta?: PaginationMeta | undefined;
|
|
21
25
|
};
|
|
22
26
|
|
|
23
|
-
/** @internal */
|
|
24
|
-
export const VirtualMachinesMeta$inboundSchema: z.ZodType<
|
|
25
|
-
VirtualMachinesMeta,
|
|
26
|
-
z.ZodTypeDef,
|
|
27
|
-
unknown
|
|
28
|
-
> = z.object({});
|
|
29
|
-
/** @internal */
|
|
30
|
-
export type VirtualMachinesMeta$Outbound = {};
|
|
31
|
-
|
|
32
|
-
/** @internal */
|
|
33
|
-
export const VirtualMachinesMeta$outboundSchema: z.ZodType<
|
|
34
|
-
VirtualMachinesMeta$Outbound,
|
|
35
|
-
z.ZodTypeDef,
|
|
36
|
-
VirtualMachinesMeta
|
|
37
|
-
> = z.object({});
|
|
38
|
-
|
|
39
|
-
export function virtualMachinesMetaToJSON(
|
|
40
|
-
virtualMachinesMeta: VirtualMachinesMeta,
|
|
41
|
-
): string {
|
|
42
|
-
return JSON.stringify(
|
|
43
|
-
VirtualMachinesMeta$outboundSchema.parse(virtualMachinesMeta),
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
export function virtualMachinesMetaFromJSON(
|
|
47
|
-
jsonString: string,
|
|
48
|
-
): SafeParseResult<VirtualMachinesMeta, SDKValidationError> {
|
|
49
|
-
return safeParse(
|
|
50
|
-
jsonString,
|
|
51
|
-
(x) => VirtualMachinesMeta$inboundSchema.parse(JSON.parse(x)),
|
|
52
|
-
`Failed to parse 'VirtualMachinesMeta' from JSON`,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
27
|
/** @internal */
|
|
57
28
|
export const VirtualMachines$inboundSchema: z.ZodType<
|
|
58
29
|
VirtualMachines,
|
|
@@ -60,12 +31,12 @@ export const VirtualMachines$inboundSchema: z.ZodType<
|
|
|
60
31
|
unknown
|
|
61
32
|
> = z.object({
|
|
62
33
|
data: z.array(VirtualMachineAttributes$inboundSchema).optional(),
|
|
63
|
-
meta:
|
|
34
|
+
meta: PaginationMeta$inboundSchema.optional(),
|
|
64
35
|
});
|
|
65
36
|
/** @internal */
|
|
66
37
|
export type VirtualMachines$Outbound = {
|
|
67
38
|
data?: Array<VirtualMachineAttributes$Outbound> | undefined;
|
|
68
|
-
meta?:
|
|
39
|
+
meta?: PaginationMeta$Outbound | undefined;
|
|
69
40
|
};
|
|
70
41
|
|
|
71
42
|
/** @internal */
|
|
@@ -75,7 +46,7 @@ export const VirtualMachines$outboundSchema: z.ZodType<
|
|
|
75
46
|
VirtualMachines
|
|
76
47
|
> = z.object({
|
|
77
48
|
data: z.array(VirtualMachineAttributes$outboundSchema).optional(),
|
|
78
|
-
meta:
|
|
49
|
+
meta: PaginationMeta$outboundSchema.optional(),
|
|
79
50
|
});
|
|
80
51
|
|
|
81
52
|
export function virtualMachinesToJSON(
|
|
@@ -18,7 +18,7 @@ export type VirtualMachineUpdatePayloadType = ClosedEnum<
|
|
|
18
18
|
/**
|
|
19
19
|
* Target billing cycle. Upgrades only (hourly → monthly → yearly); downgrades and reserved-project changes return 422.
|
|
20
20
|
*/
|
|
21
|
-
export const
|
|
21
|
+
export const VirtualMachineUpdatePayloadBilling = {
|
|
22
22
|
Hourly: "hourly",
|
|
23
23
|
Monthly: "monthly",
|
|
24
24
|
Yearly: "yearly",
|
|
@@ -26,7 +26,9 @@ export const BillingEnum = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Target billing cycle. Upgrades only (hourly → monthly → yearly); downgrades and reserved-project changes return 422.
|
|
28
28
|
*/
|
|
29
|
-
export type
|
|
29
|
+
export type VirtualMachineUpdatePayloadBilling = ClosedEnum<
|
|
30
|
+
typeof VirtualMachineUpdatePayloadBilling
|
|
31
|
+
>;
|
|
30
32
|
|
|
31
33
|
export type VirtualMachineUpdatePayloadAttributes = {
|
|
32
34
|
/**
|
|
@@ -40,7 +42,7 @@ export type VirtualMachineUpdatePayloadAttributes = {
|
|
|
40
42
|
/**
|
|
41
43
|
* Target billing cycle. Upgrades only (hourly → monthly → yearly); downgrades and reserved-project changes return 422.
|
|
42
44
|
*/
|
|
43
|
-
billing?:
|
|
45
|
+
billing?: VirtualMachineUpdatePayloadBilling | undefined;
|
|
44
46
|
/**
|
|
45
47
|
* Target plan slug for a vertical upgrade. Upgrades only (cpu, memory, and/or storage must scale up; nothing may shrink). The VM is powered off to apply the new resources and powered back on. Must be sent on its own (cannot be combined with name, tags, or billing). Returns 202 Accepted.
|
|
46
48
|
*/
|
|
@@ -67,11 +69,13 @@ export const VirtualMachineUpdatePayloadType$outboundSchema: z.ZodNativeEnum<
|
|
|
67
69
|
> = VirtualMachineUpdatePayloadType$inboundSchema;
|
|
68
70
|
|
|
69
71
|
/** @internal */
|
|
70
|
-
export const
|
|
71
|
-
|
|
72
|
+
export const VirtualMachineUpdatePayloadBilling$inboundSchema: z.ZodNativeEnum<
|
|
73
|
+
typeof VirtualMachineUpdatePayloadBilling
|
|
74
|
+
> = z.nativeEnum(VirtualMachineUpdatePayloadBilling);
|
|
72
75
|
/** @internal */
|
|
73
|
-
export const
|
|
74
|
-
|
|
76
|
+
export const VirtualMachineUpdatePayloadBilling$outboundSchema: z.ZodNativeEnum<
|
|
77
|
+
typeof VirtualMachineUpdatePayloadBilling
|
|
78
|
+
> = VirtualMachineUpdatePayloadBilling$inboundSchema;
|
|
75
79
|
|
|
76
80
|
/** @internal */
|
|
77
81
|
export const VirtualMachineUpdatePayloadAttributes$inboundSchema: z.ZodType<
|
|
@@ -81,7 +85,7 @@ export const VirtualMachineUpdatePayloadAttributes$inboundSchema: z.ZodType<
|
|
|
81
85
|
> = z.object({
|
|
82
86
|
name: z.string().optional(),
|
|
83
87
|
tags: z.nullable(z.array(z.string())).optional(),
|
|
84
|
-
billing:
|
|
88
|
+
billing: VirtualMachineUpdatePayloadBilling$inboundSchema.optional(),
|
|
85
89
|
plan: z.string().optional(),
|
|
86
90
|
});
|
|
87
91
|
/** @internal */
|
|
@@ -100,7 +104,7 @@ export const VirtualMachineUpdatePayloadAttributes$outboundSchema: z.ZodType<
|
|
|
100
104
|
> = z.object({
|
|
101
105
|
name: z.string().optional(),
|
|
102
106
|
tags: z.nullable(z.array(z.string())).optional(),
|
|
103
|
-
billing:
|
|
107
|
+
billing: VirtualMachineUpdatePayloadBilling$outboundSchema.optional(),
|
|
104
108
|
plan: z.string().optional(),
|
|
105
109
|
});
|
|
106
110
|
|
|
@@ -16,6 +16,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
|
16
16
|
import * as models from "../models/index.js";
|
|
17
17
|
import * as operations from "../models/operations/index.js";
|
|
18
18
|
import { unwrapAsync } from "../types/fp.js";
|
|
19
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
19
20
|
|
|
20
21
|
export class VirtualMachines extends ClientSDK {
|
|
21
22
|
/**
|
|
@@ -44,8 +45,10 @@ export class VirtualMachines extends ClientSDK {
|
|
|
44
45
|
async list(
|
|
45
46
|
request?: operations.IndexVirtualMachineRequest | undefined,
|
|
46
47
|
options?: RequestOptions,
|
|
47
|
-
): Promise<
|
|
48
|
-
|
|
48
|
+
): Promise<
|
|
49
|
+
PageIterator<operations.IndexVirtualMachineResponse, { page: number }>
|
|
50
|
+
> {
|
|
51
|
+
return unwrapResultIterator(virtualMachinesList(
|
|
49
52
|
this,
|
|
50
53
|
request,
|
|
51
54
|
options,
|
|
@@ -137,10 +137,12 @@ export const mockProject = {
|
|
|
137
137
|
cost: '0.00',
|
|
138
138
|
environment: 'Development',
|
|
139
139
|
stats: {
|
|
140
|
+
databases: 0,
|
|
140
141
|
ip_addresses: 2,
|
|
141
142
|
prefixes: 0,
|
|
142
143
|
servers: 1,
|
|
143
|
-
|
|
144
|
+
storages: 0,
|
|
145
|
+
virtual_machines: 0,
|
|
144
146
|
vlans: 1,
|
|
145
147
|
},
|
|
146
148
|
billing: {
|
|
@@ -168,10 +170,12 @@ export const mockProjectList = {
|
|
|
168
170
|
cost: '150.00',
|
|
169
171
|
environment: 'Production',
|
|
170
172
|
stats: {
|
|
173
|
+
databases: 0,
|
|
171
174
|
ip_addresses: 10,
|
|
172
175
|
prefixes: 1,
|
|
173
176
|
servers: 5,
|
|
174
|
-
|
|
177
|
+
storages: 2,
|
|
178
|
+
virtual_machines: 1,
|
|
175
179
|
vlans: 3,
|
|
176
180
|
},
|
|
177
181
|
billing: {
|
|
@@ -471,7 +471,9 @@ describe('Projects - Core CRUD Operations', () => {
|
|
|
471
471
|
expect(project.attributes.stats.ipAddresses).toBe(2);
|
|
472
472
|
expect(project.attributes.stats.servers).toBe(1);
|
|
473
473
|
expect(project.attributes.stats.vlans).toBe(1);
|
|
474
|
-
expect(project.attributes.stats.
|
|
474
|
+
expect(project.attributes.stats.storages).toBe(0);
|
|
475
|
+
expect(project.attributes.stats.virtualMachines).toBe(0);
|
|
476
|
+
expect(project.attributes.stats.databases).toBe(0);
|
|
475
477
|
expect(project.attributes.stats.prefixes).toBe(0);
|
|
476
478
|
});
|
|
477
479
|
});
|