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
package/src/models/eventdata.ts
CHANGED
|
@@ -15,24 +15,24 @@ export const EventDataType = {
|
|
|
15
15
|
export type EventDataType = ClosedEnum<typeof EventDataType>;
|
|
16
16
|
|
|
17
17
|
export type Author = {
|
|
18
|
-
id?: string | undefined;
|
|
19
|
-
name?: string | undefined;
|
|
20
|
-
email?: string | undefined;
|
|
18
|
+
id?: string | null | undefined;
|
|
19
|
+
name?: string | null | undefined;
|
|
20
|
+
email?: string | null | undefined;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export type EventDataProject = {
|
|
24
|
-
id?: string | undefined;
|
|
25
|
-
name?: string | undefined;
|
|
26
|
-
slug?: string | undefined;
|
|
24
|
+
id?: string | null | undefined;
|
|
25
|
+
name?: string | null | undefined;
|
|
26
|
+
slug?: string | null | undefined;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export type EventDataTeam = {
|
|
30
|
-
id?: string | undefined;
|
|
31
|
-
name?: string | undefined;
|
|
30
|
+
id?: string | null | undefined;
|
|
31
|
+
name?: string | null | undefined;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export type Target = {
|
|
35
|
-
id?: string | undefined;
|
|
35
|
+
id?: string | null | undefined;
|
|
36
36
|
name?: string | undefined;
|
|
37
37
|
};
|
|
38
38
|
|
|
@@ -72,15 +72,15 @@ export const EventDataType$outboundSchema: z.ZodNativeEnum<
|
|
|
72
72
|
/** @internal */
|
|
73
73
|
export const Author$inboundSchema: z.ZodType<Author, z.ZodTypeDef, unknown> = z
|
|
74
74
|
.object({
|
|
75
|
-
id: z.string().optional(),
|
|
76
|
-
name: z.string().optional(),
|
|
77
|
-
email: z.string().optional(),
|
|
75
|
+
id: z.nullable(z.string()).optional(),
|
|
76
|
+
name: z.nullable(z.string()).optional(),
|
|
77
|
+
email: z.nullable(z.string()).optional(),
|
|
78
78
|
});
|
|
79
79
|
/** @internal */
|
|
80
80
|
export type Author$Outbound = {
|
|
81
|
-
id?: string | undefined;
|
|
82
|
-
name?: string | undefined;
|
|
83
|
-
email?: string | undefined;
|
|
81
|
+
id?: string | null | undefined;
|
|
82
|
+
name?: string | null | undefined;
|
|
83
|
+
email?: string | null | undefined;
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
/** @internal */
|
|
@@ -89,9 +89,9 @@ export const Author$outboundSchema: z.ZodType<
|
|
|
89
89
|
z.ZodTypeDef,
|
|
90
90
|
Author
|
|
91
91
|
> = z.object({
|
|
92
|
-
id: z.string().optional(),
|
|
93
|
-
name: z.string().optional(),
|
|
94
|
-
email: z.string().optional(),
|
|
92
|
+
id: z.nullable(z.string()).optional(),
|
|
93
|
+
name: z.nullable(z.string()).optional(),
|
|
94
|
+
email: z.nullable(z.string()).optional(),
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
export function authorToJSON(author: Author): string {
|
|
@@ -113,15 +113,15 @@ export const EventDataProject$inboundSchema: z.ZodType<
|
|
|
113
113
|
z.ZodTypeDef,
|
|
114
114
|
unknown
|
|
115
115
|
> = z.object({
|
|
116
|
-
id: z.string().optional(),
|
|
117
|
-
name: z.string().optional(),
|
|
118
|
-
slug: z.string().optional(),
|
|
116
|
+
id: z.nullable(z.string()).optional(),
|
|
117
|
+
name: z.nullable(z.string()).optional(),
|
|
118
|
+
slug: z.nullable(z.string()).optional(),
|
|
119
119
|
});
|
|
120
120
|
/** @internal */
|
|
121
121
|
export type EventDataProject$Outbound = {
|
|
122
|
-
id?: string | undefined;
|
|
123
|
-
name?: string | undefined;
|
|
124
|
-
slug?: string | undefined;
|
|
122
|
+
id?: string | null | undefined;
|
|
123
|
+
name?: string | null | undefined;
|
|
124
|
+
slug?: string | null | undefined;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
/** @internal */
|
|
@@ -130,9 +130,9 @@ export const EventDataProject$outboundSchema: z.ZodType<
|
|
|
130
130
|
z.ZodTypeDef,
|
|
131
131
|
EventDataProject
|
|
132
132
|
> = z.object({
|
|
133
|
-
id: z.string().optional(),
|
|
134
|
-
name: z.string().optional(),
|
|
135
|
-
slug: z.string().optional(),
|
|
133
|
+
id: z.nullable(z.string()).optional(),
|
|
134
|
+
name: z.nullable(z.string()).optional(),
|
|
135
|
+
slug: z.nullable(z.string()).optional(),
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
export function eventDataProjectToJSON(
|
|
@@ -158,13 +158,13 @@ export const EventDataTeam$inboundSchema: z.ZodType<
|
|
|
158
158
|
z.ZodTypeDef,
|
|
159
159
|
unknown
|
|
160
160
|
> = z.object({
|
|
161
|
-
id: z.string().optional(),
|
|
162
|
-
name: z.string().optional(),
|
|
161
|
+
id: z.nullable(z.string()).optional(),
|
|
162
|
+
name: z.nullable(z.string()).optional(),
|
|
163
163
|
});
|
|
164
164
|
/** @internal */
|
|
165
165
|
export type EventDataTeam$Outbound = {
|
|
166
|
-
id?: string | undefined;
|
|
167
|
-
name?: string | undefined;
|
|
166
|
+
id?: string | null | undefined;
|
|
167
|
+
name?: string | null | undefined;
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
/** @internal */
|
|
@@ -173,8 +173,8 @@ export const EventDataTeam$outboundSchema: z.ZodType<
|
|
|
173
173
|
z.ZodTypeDef,
|
|
174
174
|
EventDataTeam
|
|
175
175
|
> = z.object({
|
|
176
|
-
id: z.string().optional(),
|
|
177
|
-
name: z.string().optional(),
|
|
176
|
+
id: z.nullable(z.string()).optional(),
|
|
177
|
+
name: z.nullable(z.string()).optional(),
|
|
178
178
|
});
|
|
179
179
|
|
|
180
180
|
export function eventDataTeamToJSON(eventDataTeam: EventDataTeam): string {
|
|
@@ -193,12 +193,12 @@ export function eventDataTeamFromJSON(
|
|
|
193
193
|
/** @internal */
|
|
194
194
|
export const Target$inboundSchema: z.ZodType<Target, z.ZodTypeDef, unknown> = z
|
|
195
195
|
.object({
|
|
196
|
-
id: z.string().optional(),
|
|
196
|
+
id: z.nullable(z.string()).optional(),
|
|
197
197
|
name: z.string().optional(),
|
|
198
198
|
});
|
|
199
199
|
/** @internal */
|
|
200
200
|
export type Target$Outbound = {
|
|
201
|
-
id?: string | undefined;
|
|
201
|
+
id?: string | null | undefined;
|
|
202
202
|
name?: string | undefined;
|
|
203
203
|
};
|
|
204
204
|
|
|
@@ -208,7 +208,7 @@ export const Target$outboundSchema: z.ZodType<
|
|
|
208
208
|
z.ZodTypeDef,
|
|
209
209
|
Target
|
|
210
210
|
> = z.object({
|
|
211
|
-
id: z.string().optional(),
|
|
211
|
+
id: z.nullable(z.string()).optional(),
|
|
212
212
|
name: z.string().optional(),
|
|
213
213
|
});
|
|
214
214
|
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
10
11
|
|
|
11
12
|
export type IndexVirtualMachineRequest = {
|
|
12
13
|
/**
|
|
@@ -25,6 +26,22 @@ export type IndexVirtualMachineRequest = {
|
|
|
25
26
|
* Comma-separated sort fields. Prefix a field with `-` for descending order. Supported fields: created_at, name, hostname, status. Example: `sort=status,-created_at` sorts by status ascending, then by creation date descending.
|
|
26
27
|
*/
|
|
27
28
|
sort?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Number of items to return per page
|
|
31
|
+
*/
|
|
32
|
+
pageSize?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Page number to return (starts at 1)
|
|
35
|
+
*/
|
|
36
|
+
pageNumber?: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Request aggregate stats in the response `meta`. Use `count` to get the total number of records, returned as `meta.stats.total.count`.
|
|
39
|
+
*/
|
|
40
|
+
statsTotal?: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type IndexVirtualMachineResponse = {
|
|
44
|
+
result: models.VirtualMachines;
|
|
28
45
|
};
|
|
29
46
|
|
|
30
47
|
/** @internal */
|
|
@@ -37,11 +54,17 @@ export const IndexVirtualMachineRequest$inboundSchema: z.ZodType<
|
|
|
37
54
|
"filter[tags]": z.string().optional(),
|
|
38
55
|
"extra_fields[virtual_machines]": z.string().optional(),
|
|
39
56
|
sort: z.string().optional(),
|
|
57
|
+
"page[size]": z.number().int().default(20),
|
|
58
|
+
"page[number]": z.number().int().default(1),
|
|
59
|
+
"stats[total]": z.string().optional(),
|
|
40
60
|
}).transform((v) => {
|
|
41
61
|
return remap$(v, {
|
|
42
62
|
"filter[project]": "filterProject",
|
|
43
63
|
"filter[tags]": "filterTags",
|
|
44
64
|
"extra_fields[virtual_machines]": "extraFieldsVirtualMachines",
|
|
65
|
+
"page[size]": "pageSize",
|
|
66
|
+
"page[number]": "pageNumber",
|
|
67
|
+
"stats[total]": "statsTotal",
|
|
45
68
|
});
|
|
46
69
|
});
|
|
47
70
|
/** @internal */
|
|
@@ -50,6 +73,9 @@ export type IndexVirtualMachineRequest$Outbound = {
|
|
|
50
73
|
"filter[tags]"?: string | undefined;
|
|
51
74
|
"extra_fields[virtual_machines]"?: string | undefined;
|
|
52
75
|
sort?: string | undefined;
|
|
76
|
+
"page[size]": number;
|
|
77
|
+
"page[number]": number;
|
|
78
|
+
"stats[total]"?: string | undefined;
|
|
53
79
|
};
|
|
54
80
|
|
|
55
81
|
/** @internal */
|
|
@@ -62,11 +88,17 @@ export const IndexVirtualMachineRequest$outboundSchema: z.ZodType<
|
|
|
62
88
|
filterTags: z.string().optional(),
|
|
63
89
|
extraFieldsVirtualMachines: z.string().optional(),
|
|
64
90
|
sort: z.string().optional(),
|
|
91
|
+
pageSize: z.number().int().default(20),
|
|
92
|
+
pageNumber: z.number().int().default(1),
|
|
93
|
+
statsTotal: z.string().optional(),
|
|
65
94
|
}).transform((v) => {
|
|
66
95
|
return remap$(v, {
|
|
67
96
|
filterProject: "filter[project]",
|
|
68
97
|
filterTags: "filter[tags]",
|
|
69
98
|
extraFieldsVirtualMachines: "extra_fields[virtual_machines]",
|
|
99
|
+
pageSize: "page[size]",
|
|
100
|
+
pageNumber: "page[number]",
|
|
101
|
+
statsTotal: "stats[total]",
|
|
70
102
|
});
|
|
71
103
|
});
|
|
72
104
|
|
|
@@ -86,3 +118,52 @@ export function indexVirtualMachineRequestFromJSON(
|
|
|
86
118
|
`Failed to parse 'IndexVirtualMachineRequest' from JSON`,
|
|
87
119
|
);
|
|
88
120
|
}
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export const IndexVirtualMachineResponse$inboundSchema: z.ZodType<
|
|
124
|
+
IndexVirtualMachineResponse,
|
|
125
|
+
z.ZodTypeDef,
|
|
126
|
+
unknown
|
|
127
|
+
> = z.object({
|
|
128
|
+
Result: models.VirtualMachines$inboundSchema,
|
|
129
|
+
}).transform((v) => {
|
|
130
|
+
return remap$(v, {
|
|
131
|
+
"Result": "result",
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
/** @internal */
|
|
135
|
+
export type IndexVirtualMachineResponse$Outbound = {
|
|
136
|
+
Result: models.VirtualMachines$Outbound;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/** @internal */
|
|
140
|
+
export const IndexVirtualMachineResponse$outboundSchema: z.ZodType<
|
|
141
|
+
IndexVirtualMachineResponse$Outbound,
|
|
142
|
+
z.ZodTypeDef,
|
|
143
|
+
IndexVirtualMachineResponse
|
|
144
|
+
> = z.object({
|
|
145
|
+
result: models.VirtualMachines$outboundSchema,
|
|
146
|
+
}).transform((v) => {
|
|
147
|
+
return remap$(v, {
|
|
148
|
+
result: "Result",
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export function indexVirtualMachineResponseToJSON(
|
|
153
|
+
indexVirtualMachineResponse: IndexVirtualMachineResponse,
|
|
154
|
+
): string {
|
|
155
|
+
return JSON.stringify(
|
|
156
|
+
IndexVirtualMachineResponse$outboundSchema.parse(
|
|
157
|
+
indexVirtualMachineResponse,
|
|
158
|
+
),
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
export function indexVirtualMachineResponseFromJSON(
|
|
162
|
+
jsonString: string,
|
|
163
|
+
): SafeParseResult<IndexVirtualMachineResponse, SDKValidationError> {
|
|
164
|
+
return safeParse(
|
|
165
|
+
jsonString,
|
|
166
|
+
(x) => IndexVirtualMachineResponse$inboundSchema.parse(JSON.parse(x)),
|
|
167
|
+
`Failed to parse 'IndexVirtualMachineResponse' from JSON`,
|
|
168
|
+
);
|
|
169
|
+
}
|
package/src/models/project.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
9
10
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
11
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
12
|
import {
|
|
@@ -15,6 +16,13 @@ import {
|
|
|
15
16
|
TeamInclude$outboundSchema,
|
|
16
17
|
} from "./teaminclude.js";
|
|
17
18
|
|
|
19
|
+
export const ProjectType = {
|
|
20
|
+
Projects: "projects",
|
|
21
|
+
} as const;
|
|
22
|
+
export type ProjectType = ClosedEnum<typeof ProjectType>;
|
|
23
|
+
|
|
24
|
+
export type ProjectTag = {};
|
|
25
|
+
|
|
18
26
|
export const BillingType = {
|
|
19
27
|
Yearly: "Yearly",
|
|
20
28
|
Monthly: "Monthly",
|
|
@@ -22,22 +30,26 @@ export const BillingType = {
|
|
|
22
30
|
Normal: "Normal",
|
|
23
31
|
Custom: "Custom",
|
|
24
32
|
} as const;
|
|
25
|
-
export type BillingType =
|
|
33
|
+
export type BillingType = OpenEnum<typeof BillingType>;
|
|
26
34
|
|
|
27
35
|
export const BillingMethod = {
|
|
28
36
|
Normal: "Normal",
|
|
29
37
|
NinetyFivethPercentile: "95th percentile",
|
|
30
38
|
} as const;
|
|
31
|
-
export type BillingMethod =
|
|
39
|
+
export type BillingMethod = OpenEnum<typeof BillingMethod>;
|
|
32
40
|
|
|
33
41
|
export const Environment = {
|
|
34
42
|
Development: "Development",
|
|
35
43
|
Staging: "Staging",
|
|
36
44
|
Production: "Production",
|
|
37
45
|
} as const;
|
|
38
|
-
export type Environment =
|
|
46
|
+
export type Environment = OpenEnum<typeof Environment>;
|
|
39
47
|
|
|
40
48
|
export type ProjectStats = {
|
|
49
|
+
/**
|
|
50
|
+
* The number of database servers assigned to the project
|
|
51
|
+
*/
|
|
52
|
+
databases?: number | undefined;
|
|
41
53
|
/**
|
|
42
54
|
* The number of IP addresses assigned to the project
|
|
43
55
|
*/
|
|
@@ -51,9 +63,13 @@ export type ProjectStats = {
|
|
|
51
63
|
*/
|
|
52
64
|
servers?: number | undefined;
|
|
53
65
|
/**
|
|
54
|
-
* The number of
|
|
66
|
+
* The number of storages assigned to the project
|
|
55
67
|
*/
|
|
56
|
-
|
|
68
|
+
storages?: number | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The number of active virtual machines assigned to the project
|
|
71
|
+
*/
|
|
72
|
+
virtualMachines?: number | undefined;
|
|
57
73
|
/**
|
|
58
74
|
* The number of VLANs assigned to the project
|
|
59
75
|
*/
|
|
@@ -67,6 +83,10 @@ export type ProjectBilling = {
|
|
|
67
83
|
};
|
|
68
84
|
|
|
69
85
|
export type ProjectAttributes = {
|
|
86
|
+
/**
|
|
87
|
+
* The tags assigned to the project
|
|
88
|
+
*/
|
|
89
|
+
tags?: Array<ProjectTag> | undefined;
|
|
70
90
|
/**
|
|
71
91
|
* The project name
|
|
72
92
|
*/
|
|
@@ -82,7 +102,15 @@ export type ProjectAttributes = {
|
|
|
82
102
|
billingType?: BillingType | null | undefined;
|
|
83
103
|
billingMethod?: BillingMethod | null | undefined;
|
|
84
104
|
cost?: string | null | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Whether bandwidth quota alerts are enabled for the project
|
|
107
|
+
*/
|
|
108
|
+
bandwidthAlert?: boolean | null | undefined;
|
|
85
109
|
environment?: Environment | null | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* The project provisioning model, either on_demand (pay-as-you-go, hourly or monthly billing) or reserved (annual contract with yearly billing). Defaults to on_demand.
|
|
112
|
+
*/
|
|
113
|
+
provisioningType?: string | null | undefined;
|
|
86
114
|
stats?: ProjectStats | undefined;
|
|
87
115
|
billing?: ProjectBilling | undefined;
|
|
88
116
|
team?: TeamInclude | undefined;
|
|
@@ -95,31 +123,84 @@ export type Project = {
|
|
|
95
123
|
* The project ID
|
|
96
124
|
*/
|
|
97
125
|
id?: string | undefined;
|
|
126
|
+
type?: ProjectType | undefined;
|
|
98
127
|
attributes?: ProjectAttributes | undefined;
|
|
99
128
|
};
|
|
100
129
|
|
|
101
130
|
/** @internal */
|
|
102
|
-
export const
|
|
103
|
-
.nativeEnum(
|
|
131
|
+
export const ProjectType$inboundSchema: z.ZodNativeEnum<typeof ProjectType> = z
|
|
132
|
+
.nativeEnum(ProjectType);
|
|
104
133
|
/** @internal */
|
|
105
|
-
export const
|
|
106
|
-
|
|
134
|
+
export const ProjectType$outboundSchema: z.ZodNativeEnum<typeof ProjectType> =
|
|
135
|
+
ProjectType$inboundSchema;
|
|
107
136
|
|
|
108
137
|
/** @internal */
|
|
109
|
-
export const
|
|
110
|
-
|
|
111
|
-
|
|
138
|
+
export const ProjectTag$inboundSchema: z.ZodType<
|
|
139
|
+
ProjectTag,
|
|
140
|
+
z.ZodTypeDef,
|
|
141
|
+
unknown
|
|
142
|
+
> = z.object({});
|
|
112
143
|
/** @internal */
|
|
113
|
-
export
|
|
114
|
-
typeof BillingMethod
|
|
115
|
-
> = BillingMethod$inboundSchema;
|
|
144
|
+
export type ProjectTag$Outbound = {};
|
|
116
145
|
|
|
117
146
|
/** @internal */
|
|
118
|
-
export const
|
|
119
|
-
|
|
147
|
+
export const ProjectTag$outboundSchema: z.ZodType<
|
|
148
|
+
ProjectTag$Outbound,
|
|
149
|
+
z.ZodTypeDef,
|
|
150
|
+
ProjectTag
|
|
151
|
+
> = z.object({});
|
|
152
|
+
|
|
153
|
+
export function projectTagToJSON(projectTag: ProjectTag): string {
|
|
154
|
+
return JSON.stringify(ProjectTag$outboundSchema.parse(projectTag));
|
|
155
|
+
}
|
|
156
|
+
export function projectTagFromJSON(
|
|
157
|
+
jsonString: string,
|
|
158
|
+
): SafeParseResult<ProjectTag, SDKValidationError> {
|
|
159
|
+
return safeParse(
|
|
160
|
+
jsonString,
|
|
161
|
+
(x) => ProjectTag$inboundSchema.parse(JSON.parse(x)),
|
|
162
|
+
`Failed to parse 'ProjectTag' from JSON`,
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** @internal */
|
|
167
|
+
export const BillingType$inboundSchema: z.ZodType<
|
|
168
|
+
BillingType,
|
|
169
|
+
z.ZodTypeDef,
|
|
170
|
+
unknown
|
|
171
|
+
> = openEnums.inboundSchema(BillingType);
|
|
172
|
+
/** @internal */
|
|
173
|
+
export const BillingType$outboundSchema: z.ZodType<
|
|
174
|
+
string,
|
|
175
|
+
z.ZodTypeDef,
|
|
176
|
+
BillingType
|
|
177
|
+
> = openEnums.outboundSchema(BillingType);
|
|
178
|
+
|
|
179
|
+
/** @internal */
|
|
180
|
+
export const BillingMethod$inboundSchema: z.ZodType<
|
|
181
|
+
BillingMethod,
|
|
182
|
+
z.ZodTypeDef,
|
|
183
|
+
unknown
|
|
184
|
+
> = openEnums.inboundSchema(BillingMethod);
|
|
185
|
+
/** @internal */
|
|
186
|
+
export const BillingMethod$outboundSchema: z.ZodType<
|
|
187
|
+
string,
|
|
188
|
+
z.ZodTypeDef,
|
|
189
|
+
BillingMethod
|
|
190
|
+
> = openEnums.outboundSchema(BillingMethod);
|
|
191
|
+
|
|
120
192
|
/** @internal */
|
|
121
|
-
export const Environment$
|
|
122
|
-
Environment
|
|
193
|
+
export const Environment$inboundSchema: z.ZodType<
|
|
194
|
+
Environment,
|
|
195
|
+
z.ZodTypeDef,
|
|
196
|
+
unknown
|
|
197
|
+
> = openEnums.inboundSchema(Environment);
|
|
198
|
+
/** @internal */
|
|
199
|
+
export const Environment$outboundSchema: z.ZodType<
|
|
200
|
+
string,
|
|
201
|
+
z.ZodTypeDef,
|
|
202
|
+
Environment
|
|
203
|
+
> = openEnums.outboundSchema(Environment);
|
|
123
204
|
|
|
124
205
|
/** @internal */
|
|
125
206
|
export const ProjectStats$inboundSchema: z.ZodType<
|
|
@@ -127,22 +208,27 @@ export const ProjectStats$inboundSchema: z.ZodType<
|
|
|
127
208
|
z.ZodTypeDef,
|
|
128
209
|
unknown
|
|
129
210
|
> = z.object({
|
|
211
|
+
databases: z.number().optional(),
|
|
130
212
|
ip_addresses: z.number().optional(),
|
|
131
213
|
prefixes: z.number().optional(),
|
|
132
214
|
servers: z.number().optional(),
|
|
133
|
-
|
|
215
|
+
storages: z.number().optional(),
|
|
216
|
+
virtual_machines: z.number().optional(),
|
|
134
217
|
vlans: z.number().optional(),
|
|
135
218
|
}).transform((v) => {
|
|
136
219
|
return remap$(v, {
|
|
137
220
|
"ip_addresses": "ipAddresses",
|
|
221
|
+
"virtual_machines": "virtualMachines",
|
|
138
222
|
});
|
|
139
223
|
});
|
|
140
224
|
/** @internal */
|
|
141
225
|
export type ProjectStats$Outbound = {
|
|
226
|
+
databases?: number | undefined;
|
|
142
227
|
ip_addresses?: number | undefined;
|
|
143
228
|
prefixes?: number | undefined;
|
|
144
229
|
servers?: number | undefined;
|
|
145
|
-
|
|
230
|
+
storages?: number | undefined;
|
|
231
|
+
virtual_machines?: number | undefined;
|
|
146
232
|
vlans?: number | undefined;
|
|
147
233
|
};
|
|
148
234
|
|
|
@@ -152,14 +238,17 @@ export const ProjectStats$outboundSchema: z.ZodType<
|
|
|
152
238
|
z.ZodTypeDef,
|
|
153
239
|
ProjectStats
|
|
154
240
|
> = z.object({
|
|
241
|
+
databases: z.number().optional(),
|
|
155
242
|
ipAddresses: z.number().optional(),
|
|
156
243
|
prefixes: z.number().optional(),
|
|
157
244
|
servers: z.number().optional(),
|
|
158
|
-
|
|
245
|
+
storages: z.number().optional(),
|
|
246
|
+
virtualMachines: z.number().optional(),
|
|
159
247
|
vlans: z.number().optional(),
|
|
160
248
|
}).transform((v) => {
|
|
161
249
|
return remap$(v, {
|
|
162
250
|
ipAddresses: "ip_addresses",
|
|
251
|
+
virtualMachines: "virtual_machines",
|
|
163
252
|
});
|
|
164
253
|
});
|
|
165
254
|
|
|
@@ -231,13 +320,16 @@ export const ProjectAttributes$inboundSchema: z.ZodType<
|
|
|
231
320
|
z.ZodTypeDef,
|
|
232
321
|
unknown
|
|
233
322
|
> = z.object({
|
|
323
|
+
tags: z.array(z.lazy(() => ProjectTag$inboundSchema)).optional(),
|
|
234
324
|
name: z.string().optional(),
|
|
235
325
|
slug: z.string().optional(),
|
|
236
326
|
description: z.nullable(z.string()).optional(),
|
|
237
327
|
billing_type: z.nullable(BillingType$inboundSchema).optional(),
|
|
238
328
|
billing_method: z.nullable(BillingMethod$inboundSchema).optional(),
|
|
239
329
|
cost: z.nullable(z.string()).optional(),
|
|
330
|
+
bandwidth_alert: z.nullable(z.boolean()).optional(),
|
|
240
331
|
environment: z.nullable(Environment$inboundSchema).optional(),
|
|
332
|
+
provisioning_type: z.nullable(z.string()).optional(),
|
|
241
333
|
stats: z.lazy(() => ProjectStats$inboundSchema).optional(),
|
|
242
334
|
billing: z.lazy(() => ProjectBilling$inboundSchema).optional(),
|
|
243
335
|
team: TeamInclude$inboundSchema.optional(),
|
|
@@ -247,19 +339,24 @@ export const ProjectAttributes$inboundSchema: z.ZodType<
|
|
|
247
339
|
return remap$(v, {
|
|
248
340
|
"billing_type": "billingType",
|
|
249
341
|
"billing_method": "billingMethod",
|
|
342
|
+
"bandwidth_alert": "bandwidthAlert",
|
|
343
|
+
"provisioning_type": "provisioningType",
|
|
250
344
|
"created_at": "createdAt",
|
|
251
345
|
"updated_at": "updatedAt",
|
|
252
346
|
});
|
|
253
347
|
});
|
|
254
348
|
/** @internal */
|
|
255
349
|
export type ProjectAttributes$Outbound = {
|
|
350
|
+
tags?: Array<ProjectTag$Outbound> | undefined;
|
|
256
351
|
name?: string | undefined;
|
|
257
352
|
slug?: string | undefined;
|
|
258
353
|
description?: string | null | undefined;
|
|
259
354
|
billing_type?: string | null | undefined;
|
|
260
355
|
billing_method?: string | null | undefined;
|
|
261
356
|
cost?: string | null | undefined;
|
|
357
|
+
bandwidth_alert?: boolean | null | undefined;
|
|
262
358
|
environment?: string | null | undefined;
|
|
359
|
+
provisioning_type?: string | null | undefined;
|
|
263
360
|
stats?: ProjectStats$Outbound | undefined;
|
|
264
361
|
billing?: ProjectBilling$Outbound | undefined;
|
|
265
362
|
team?: TeamInclude$Outbound | undefined;
|
|
@@ -273,13 +370,16 @@ export const ProjectAttributes$outboundSchema: z.ZodType<
|
|
|
273
370
|
z.ZodTypeDef,
|
|
274
371
|
ProjectAttributes
|
|
275
372
|
> = z.object({
|
|
373
|
+
tags: z.array(z.lazy(() => ProjectTag$outboundSchema)).optional(),
|
|
276
374
|
name: z.string().optional(),
|
|
277
375
|
slug: z.string().optional(),
|
|
278
376
|
description: z.nullable(z.string()).optional(),
|
|
279
377
|
billingType: z.nullable(BillingType$outboundSchema).optional(),
|
|
280
378
|
billingMethod: z.nullable(BillingMethod$outboundSchema).optional(),
|
|
281
379
|
cost: z.nullable(z.string()).optional(),
|
|
380
|
+
bandwidthAlert: z.nullable(z.boolean()).optional(),
|
|
282
381
|
environment: z.nullable(Environment$outboundSchema).optional(),
|
|
382
|
+
provisioningType: z.nullable(z.string()).optional(),
|
|
283
383
|
stats: z.lazy(() => ProjectStats$outboundSchema).optional(),
|
|
284
384
|
billing: z.lazy(() => ProjectBilling$outboundSchema).optional(),
|
|
285
385
|
team: TeamInclude$outboundSchema.optional(),
|
|
@@ -289,6 +389,8 @@ export const ProjectAttributes$outboundSchema: z.ZodType<
|
|
|
289
389
|
return remap$(v, {
|
|
290
390
|
billingType: "billing_type",
|
|
291
391
|
billingMethod: "billing_method",
|
|
392
|
+
bandwidthAlert: "bandwidth_alert",
|
|
393
|
+
provisioningType: "provisioning_type",
|
|
292
394
|
createdAt: "created_at",
|
|
293
395
|
updatedAt: "updated_at",
|
|
294
396
|
});
|
|
@@ -315,11 +417,13 @@ export function projectAttributesFromJSON(
|
|
|
315
417
|
export const Project$inboundSchema: z.ZodType<Project, z.ZodTypeDef, unknown> =
|
|
316
418
|
z.object({
|
|
317
419
|
id: z.string().optional(),
|
|
420
|
+
type: ProjectType$inboundSchema.optional(),
|
|
318
421
|
attributes: z.lazy(() => ProjectAttributes$inboundSchema).optional(),
|
|
319
422
|
});
|
|
320
423
|
/** @internal */
|
|
321
424
|
export type Project$Outbound = {
|
|
322
425
|
id?: string | undefined;
|
|
426
|
+
type?: string | undefined;
|
|
323
427
|
attributes?: ProjectAttributes$Outbound | undefined;
|
|
324
428
|
};
|
|
325
429
|
|
|
@@ -330,6 +434,7 @@ export const Project$outboundSchema: z.ZodType<
|
|
|
330
434
|
Project
|
|
331
435
|
> = z.object({
|
|
332
436
|
id: z.string().optional(),
|
|
437
|
+
type: ProjectType$outboundSchema.optional(),
|
|
333
438
|
attributes: z.lazy(() => ProjectAttributes$outboundSchema).optional(),
|
|
334
439
|
});
|
|
335
440
|
|
|
@@ -15,9 +15,12 @@ export type ProjectIncludeBilling = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export type ProjectIncludeStats = {
|
|
18
|
+
databases?: number | undefined;
|
|
18
19
|
ipAddresses?: number | undefined;
|
|
19
20
|
prefixes?: number | undefined;
|
|
20
21
|
servers?: number | undefined;
|
|
22
|
+
storages?: number | undefined;
|
|
23
|
+
virtualMachines?: number | undefined;
|
|
21
24
|
vlans?: number | undefined;
|
|
22
25
|
};
|
|
23
26
|
|
|
@@ -94,20 +97,27 @@ export const ProjectIncludeStats$inboundSchema: z.ZodType<
|
|
|
94
97
|
z.ZodTypeDef,
|
|
95
98
|
unknown
|
|
96
99
|
> = z.object({
|
|
100
|
+
databases: z.number().int().optional(),
|
|
97
101
|
ip_addresses: z.number().int().optional(),
|
|
98
102
|
prefixes: z.number().int().optional(),
|
|
99
103
|
servers: z.number().int().optional(),
|
|
104
|
+
storages: z.number().int().optional(),
|
|
105
|
+
virtual_machines: z.number().int().optional(),
|
|
100
106
|
vlans: z.number().int().optional(),
|
|
101
107
|
}).transform((v) => {
|
|
102
108
|
return remap$(v, {
|
|
103
109
|
"ip_addresses": "ipAddresses",
|
|
110
|
+
"virtual_machines": "virtualMachines",
|
|
104
111
|
});
|
|
105
112
|
});
|
|
106
113
|
/** @internal */
|
|
107
114
|
export type ProjectIncludeStats$Outbound = {
|
|
115
|
+
databases?: number | undefined;
|
|
108
116
|
ip_addresses?: number | undefined;
|
|
109
117
|
prefixes?: number | undefined;
|
|
110
118
|
servers?: number | undefined;
|
|
119
|
+
storages?: number | undefined;
|
|
120
|
+
virtual_machines?: number | undefined;
|
|
111
121
|
vlans?: number | undefined;
|
|
112
122
|
};
|
|
113
123
|
|
|
@@ -117,13 +127,17 @@ export const ProjectIncludeStats$outboundSchema: z.ZodType<
|
|
|
117
127
|
z.ZodTypeDef,
|
|
118
128
|
ProjectIncludeStats
|
|
119
129
|
> = z.object({
|
|
130
|
+
databases: z.number().int().optional(),
|
|
120
131
|
ipAddresses: z.number().int().optional(),
|
|
121
132
|
prefixes: z.number().int().optional(),
|
|
122
133
|
servers: z.number().int().optional(),
|
|
134
|
+
storages: z.number().int().optional(),
|
|
135
|
+
virtualMachines: z.number().int().optional(),
|
|
123
136
|
vlans: z.number().int().optional(),
|
|
124
137
|
}).transform((v) => {
|
|
125
138
|
return remap$(v, {
|
|
126
139
|
ipAddresses: "ip_addresses",
|
|
140
|
+
virtualMachines: "virtual_machines",
|
|
127
141
|
});
|
|
128
142
|
});
|
|
129
143
|
|