latitudesh-typescript-sdk 0.8.0 → 0.8.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.
Files changed (103) hide show
  1. package/bin/mcp-server.js +234 -104
  2. package/bin/mcp-server.js.map +17 -17
  3. package/dist/commonjs/funcs/virtualMachinesList.d.ts +4 -2
  4. package/dist/commonjs/funcs/virtualMachinesList.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/virtualMachinesList.js +40 -7
  6. package/dist/commonjs/funcs/virtualMachinesList.js.map +1 -1
  7. package/dist/commonjs/lib/config.d.ts +3 -3
  8. package/dist/commonjs/lib/config.js +3 -3
  9. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  10. package/dist/commonjs/mcp-server/server.js +1 -1
  11. package/dist/commonjs/mcp-server/tools/virtualMachinesList.js +1 -1
  12. package/dist/commonjs/mcp-server/tools/virtualMachinesList.js.map +1 -1
  13. package/dist/commonjs/models/billingusage.d.ts +74 -8
  14. package/dist/commonjs/models/billingusage.d.ts.map +1 -1
  15. package/dist/commonjs/models/billingusage.js +83 -9
  16. package/dist/commonjs/models/billingusage.js.map +1 -1
  17. package/dist/commonjs/models/eventdata.d.ts +16 -16
  18. package/dist/commonjs/models/eventdata.d.ts.map +1 -1
  19. package/dist/commonjs/models/eventdata.js +16 -16
  20. package/dist/commonjs/models/eventdata.js.map +1 -1
  21. package/dist/commonjs/models/operations/indexvirtualmachine.d.ts +29 -0
  22. package/dist/commonjs/models/operations/indexvirtualmachine.d.ts.map +1 -1
  23. package/dist/commonjs/models/operations/indexvirtualmachine.js +38 -1
  24. package/dist/commonjs/models/operations/indexvirtualmachine.js.map +1 -1
  25. package/dist/commonjs/models/project.d.ts +57 -13
  26. package/dist/commonjs/models/project.d.ts.map +1 -1
  27. package/dist/commonjs/models/project.js +48 -11
  28. package/dist/commonjs/models/project.js.map +1 -1
  29. package/dist/commonjs/models/projectinclude.d.ts +6 -0
  30. package/dist/commonjs/models/projectinclude.d.ts.map +1 -1
  31. package/dist/commonjs/models/projectinclude.js +8 -0
  32. package/dist/commonjs/models/projectinclude.js.map +1 -1
  33. package/dist/commonjs/models/virtualmachineattributes.d.ts +14 -14
  34. package/dist/commonjs/models/virtualmachineattributes.d.ts.map +1 -1
  35. package/dist/commonjs/models/virtualmachineattributes.js +7 -15
  36. package/dist/commonjs/models/virtualmachineattributes.js.map +1 -1
  37. package/dist/commonjs/models/virtualmachines.d.ts +3 -11
  38. package/dist/commonjs/models/virtualmachines.d.ts.map +1 -1
  39. package/dist/commonjs/models/virtualmachines.js +4 -15
  40. package/dist/commonjs/models/virtualmachines.js.map +1 -1
  41. package/dist/commonjs/sdk/virtualmachines.d.ts +4 -1
  42. package/dist/commonjs/sdk/virtualmachines.d.ts.map +1 -1
  43. package/dist/commonjs/sdk/virtualmachines.js +2 -1
  44. package/dist/commonjs/sdk/virtualmachines.js.map +1 -1
  45. package/dist/esm/funcs/virtualMachinesList.d.ts +4 -2
  46. package/dist/esm/funcs/virtualMachinesList.d.ts.map +1 -1
  47. package/dist/esm/funcs/virtualMachinesList.js +40 -7
  48. package/dist/esm/funcs/virtualMachinesList.js.map +1 -1
  49. package/dist/esm/lib/config.d.ts +3 -3
  50. package/dist/esm/lib/config.js +3 -3
  51. package/dist/esm/mcp-server/mcp-server.js +1 -1
  52. package/dist/esm/mcp-server/server.js +1 -1
  53. package/dist/esm/mcp-server/tools/virtualMachinesList.js +1 -1
  54. package/dist/esm/mcp-server/tools/virtualMachinesList.js.map +1 -1
  55. package/dist/esm/models/billingusage.d.ts +74 -8
  56. package/dist/esm/models/billingusage.d.ts.map +1 -1
  57. package/dist/esm/models/billingusage.js +76 -8
  58. package/dist/esm/models/billingusage.js.map +1 -1
  59. package/dist/esm/models/eventdata.d.ts +16 -16
  60. package/dist/esm/models/eventdata.d.ts.map +1 -1
  61. package/dist/esm/models/eventdata.js +16 -16
  62. package/dist/esm/models/eventdata.js.map +1 -1
  63. package/dist/esm/models/operations/indexvirtualmachine.d.ts +29 -0
  64. package/dist/esm/models/operations/indexvirtualmachine.d.ts.map +1 -1
  65. package/dist/esm/models/operations/indexvirtualmachine.js +35 -0
  66. package/dist/esm/models/operations/indexvirtualmachine.js.map +1 -1
  67. package/dist/esm/models/project.d.ts +57 -13
  68. package/dist/esm/models/project.d.ts.map +1 -1
  69. package/dist/esm/models/project.js +45 -10
  70. package/dist/esm/models/project.js.map +1 -1
  71. package/dist/esm/models/projectinclude.d.ts +6 -0
  72. package/dist/esm/models/projectinclude.d.ts.map +1 -1
  73. package/dist/esm/models/projectinclude.js +8 -0
  74. package/dist/esm/models/projectinclude.js.map +1 -1
  75. package/dist/esm/models/virtualmachineattributes.d.ts +14 -14
  76. package/dist/esm/models/virtualmachineattributes.d.ts.map +1 -1
  77. package/dist/esm/models/virtualmachineattributes.js +6 -14
  78. package/dist/esm/models/virtualmachineattributes.js.map +1 -1
  79. package/dist/esm/models/virtualmachines.d.ts +3 -11
  80. package/dist/esm/models/virtualmachines.d.ts.map +1 -1
  81. package/dist/esm/models/virtualmachines.js +3 -12
  82. package/dist/esm/models/virtualmachines.js.map +1 -1
  83. package/dist/esm/sdk/virtualmachines.d.ts +4 -1
  84. package/dist/esm/sdk/virtualmachines.d.ts.map +1 -1
  85. package/dist/esm/sdk/virtualmachines.js +2 -1
  86. package/dist/esm/sdk/virtualmachines.js.map +1 -1
  87. package/jsr.json +1 -1
  88. package/package.json +3 -3
  89. package/src/funcs/virtualMachinesList.ts +102 -31
  90. package/src/lib/config.ts +3 -3
  91. package/src/mcp-server/mcp-server.ts +1 -1
  92. package/src/mcp-server/server.ts +1 -1
  93. package/src/mcp-server/tools/virtualMachinesList.ts +1 -1
  94. package/src/models/billingusage.ts +189 -16
  95. package/src/models/eventdata.ts +32 -32
  96. package/src/models/operations/indexvirtualmachine.ts +81 -0
  97. package/src/models/project.ts +128 -23
  98. package/src/models/projectinclude.ts +14 -0
  99. package/src/models/virtualmachineattributes.ts +20 -24
  100. package/src/models/virtualmachines.ts +10 -39
  101. package/src/sdk/virtualmachines.ts +5 -2
  102. package/tests/integration/helpers/mock-data.ts +6 -2
  103. package/tests/integration/projects.test.ts +3 -1
@@ -9,6 +9,8 @@ import { ClosedEnum } from "../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../types/fp.js";
10
10
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
11
11
 
12
+ export type BillingUsageMeta = {};
13
+
12
14
  /**
13
15
  * The project in which the returned usage belongs to
14
16
  */
@@ -57,6 +59,7 @@ export const BillingUsageUnit = {
57
59
  Quantity: "quantity",
58
60
  Hour: "hour",
59
61
  Minute: "minute",
62
+ Gb: "GB",
60
63
  } as const;
61
64
  export type BillingUsageUnit = ClosedEnum<typeof BillingUsageUnit>;
62
65
 
@@ -66,13 +69,28 @@ export const UsageType = {
66
69
  } as const;
67
70
  export type UsageType = ClosedEnum<typeof UsageType>;
68
71
 
69
- export type Metadata = {
70
- id?: string | null | undefined;
71
- hostname?: string | null | undefined;
72
- plan?: string | null | undefined;
72
+ export type BillingUsageServer = {
73
+ id?: string | undefined;
74
+ hostname?: string | undefined;
75
+ plan?: string | undefined;
73
76
  tags?: Array<string> | undefined;
74
77
  };
75
78
 
79
+ export type Bucket = {
80
+ id?: string | undefined;
81
+ name?: string | undefined;
82
+ location?: string | null | undefined;
83
+ };
84
+
85
+ export type Metadata = {
86
+ servers?: Array<BillingUsageServer> | undefined;
87
+ bucket?: Bucket | undefined;
88
+ /**
89
+ * For products priced per divided unit (e.g. $0.01 per 1000 API calls), the divisor applied to the quantity before pricing. Omitted for products that are not priced by divided units.
90
+ */
91
+ billingUnitDivisor?: number | null | undefined;
92
+ };
93
+
76
94
  export type Product = {
77
95
  id?: string | undefined;
78
96
  resource?: string | undefined;
@@ -85,12 +103,20 @@ export type Product = {
85
103
  start?: Date | undefined;
86
104
  end?: Date | null | undefined;
87
105
  unit?: BillingUsageUnit | undefined;
106
+ /**
107
+ * The unit amount of the product in cents
108
+ */
109
+ unitAmount?: number | undefined;
88
110
  /**
89
111
  * The unit price of the product in cents
90
112
  */
91
113
  unitPrice?: number | undefined;
92
114
  usageType?: UsageType | undefined;
93
115
  quantity?: number | undefined;
116
+ /**
117
+ * The total usage amount of the product in cents
118
+ */
119
+ amount?: number | undefined;
94
120
  /**
95
121
  * The total usage price of the product in cents
96
122
  */
@@ -111,6 +137,10 @@ export type BillingUsageAttributes = {
111
137
  * The available credit balance in cents
112
138
  */
113
139
  availableCreditBalance?: number | undefined;
140
+ /**
141
+ * The total usage amount in cents
142
+ */
143
+ amount?: number | undefined;
114
144
  /**
115
145
  * The total usage price in cents
116
146
  */
@@ -124,13 +154,48 @@ export type BillingUsageAttributes = {
124
154
 
125
155
  export type BillingUsageData = {
126
156
  id?: string | undefined;
157
+ type?: string | undefined;
127
158
  attributes?: BillingUsageAttributes | undefined;
128
159
  };
129
160
 
130
161
  export type BillingUsage = {
162
+ meta?: BillingUsageMeta | undefined;
131
163
  data?: BillingUsageData | undefined;
132
164
  };
133
165
 
166
+ /** @internal */
167
+ export const BillingUsageMeta$inboundSchema: z.ZodType<
168
+ BillingUsageMeta,
169
+ z.ZodTypeDef,
170
+ unknown
171
+ > = z.object({});
172
+ /** @internal */
173
+ export type BillingUsageMeta$Outbound = {};
174
+
175
+ /** @internal */
176
+ export const BillingUsageMeta$outboundSchema: z.ZodType<
177
+ BillingUsageMeta$Outbound,
178
+ z.ZodTypeDef,
179
+ BillingUsageMeta
180
+ > = z.object({});
181
+
182
+ export function billingUsageMetaToJSON(
183
+ billingUsageMeta: BillingUsageMeta,
184
+ ): string {
185
+ return JSON.stringify(
186
+ BillingUsageMeta$outboundSchema.parse(billingUsageMeta),
187
+ );
188
+ }
189
+ export function billingUsageMetaFromJSON(
190
+ jsonString: string,
191
+ ): SafeParseResult<BillingUsageMeta, SDKValidationError> {
192
+ return safeParse(
193
+ jsonString,
194
+ (x) => BillingUsageMeta$inboundSchema.parse(JSON.parse(x)),
195
+ `Failed to parse 'BillingUsageMeta' from JSON`,
196
+ );
197
+ }
198
+
134
199
  /** @internal */
135
200
  export const BillingUsageProject$inboundSchema: z.ZodType<
136
201
  BillingUsageProject,
@@ -279,23 +344,111 @@ export const UsageType$inboundSchema: z.ZodNativeEnum<typeof UsageType> = z
279
344
  export const UsageType$outboundSchema: z.ZodNativeEnum<typeof UsageType> =
280
345
  UsageType$inboundSchema;
281
346
 
347
+ /** @internal */
348
+ export const BillingUsageServer$inboundSchema: z.ZodType<
349
+ BillingUsageServer,
350
+ z.ZodTypeDef,
351
+ unknown
352
+ > = z.object({
353
+ id: z.string().optional(),
354
+ hostname: z.string().optional(),
355
+ plan: z.string().optional(),
356
+ tags: z.array(z.string()).optional(),
357
+ });
358
+ /** @internal */
359
+ export type BillingUsageServer$Outbound = {
360
+ id?: string | undefined;
361
+ hostname?: string | undefined;
362
+ plan?: string | undefined;
363
+ tags?: Array<string> | undefined;
364
+ };
365
+
366
+ /** @internal */
367
+ export const BillingUsageServer$outboundSchema: z.ZodType<
368
+ BillingUsageServer$Outbound,
369
+ z.ZodTypeDef,
370
+ BillingUsageServer
371
+ > = z.object({
372
+ id: z.string().optional(),
373
+ hostname: z.string().optional(),
374
+ plan: z.string().optional(),
375
+ tags: z.array(z.string()).optional(),
376
+ });
377
+
378
+ export function billingUsageServerToJSON(
379
+ billingUsageServer: BillingUsageServer,
380
+ ): string {
381
+ return JSON.stringify(
382
+ BillingUsageServer$outboundSchema.parse(billingUsageServer),
383
+ );
384
+ }
385
+ export function billingUsageServerFromJSON(
386
+ jsonString: string,
387
+ ): SafeParseResult<BillingUsageServer, SDKValidationError> {
388
+ return safeParse(
389
+ jsonString,
390
+ (x) => BillingUsageServer$inboundSchema.parse(JSON.parse(x)),
391
+ `Failed to parse 'BillingUsageServer' from JSON`,
392
+ );
393
+ }
394
+
395
+ /** @internal */
396
+ export const Bucket$inboundSchema: z.ZodType<Bucket, z.ZodTypeDef, unknown> = z
397
+ .object({
398
+ id: z.string().optional(),
399
+ name: z.string().optional(),
400
+ location: z.nullable(z.string()).optional(),
401
+ });
402
+ /** @internal */
403
+ export type Bucket$Outbound = {
404
+ id?: string | undefined;
405
+ name?: string | undefined;
406
+ location?: string | null | undefined;
407
+ };
408
+
409
+ /** @internal */
410
+ export const Bucket$outboundSchema: z.ZodType<
411
+ Bucket$Outbound,
412
+ z.ZodTypeDef,
413
+ Bucket
414
+ > = z.object({
415
+ id: z.string().optional(),
416
+ name: z.string().optional(),
417
+ location: z.nullable(z.string()).optional(),
418
+ });
419
+
420
+ export function bucketToJSON(bucket: Bucket): string {
421
+ return JSON.stringify(Bucket$outboundSchema.parse(bucket));
422
+ }
423
+ export function bucketFromJSON(
424
+ jsonString: string,
425
+ ): SafeParseResult<Bucket, SDKValidationError> {
426
+ return safeParse(
427
+ jsonString,
428
+ (x) => Bucket$inboundSchema.parse(JSON.parse(x)),
429
+ `Failed to parse 'Bucket' from JSON`,
430
+ );
431
+ }
432
+
282
433
  /** @internal */
283
434
  export const Metadata$inboundSchema: z.ZodType<
284
435
  Metadata,
285
436
  z.ZodTypeDef,
286
437
  unknown
287
438
  > = z.object({
288
- id: z.nullable(z.string()).optional(),
289
- hostname: z.nullable(z.string()).optional(),
290
- plan: z.nullable(z.string()).optional(),
291
- tags: z.array(z.string()).optional(),
439
+ servers: z.array(z.lazy(() => BillingUsageServer$inboundSchema)).optional(),
440
+ bucket: z.lazy(() => Bucket$inboundSchema).optional(),
441
+ billing_unit_divisor: z.nullable(z.number().int()).optional(),
442
+ }).transform((v) => {
443
+ return remap$(v, {
444
+ "billing_unit_divisor": "billingUnitDivisor",
445
+ });
292
446
  });
293
447
  /** @internal */
294
448
  export type Metadata$Outbound = {
295
- id?: string | null | undefined;
296
- hostname?: string | null | undefined;
297
- plan?: string | null | undefined;
298
- tags?: Array<string> | undefined;
449
+ servers?: Array<BillingUsageServer$Outbound> | undefined;
450
+ bucket?: Bucket$Outbound | undefined;
451
+ billing_unit_divisor?: number | null | undefined;
299
452
  };
300
453
 
301
454
  /** @internal */
@@ -304,10 +457,13 @@ export const Metadata$outboundSchema: z.ZodType<
304
457
  z.ZodTypeDef,
305
458
  Metadata
306
459
  > = z.object({
307
- id: z.nullable(z.string()).optional(),
308
- hostname: z.nullable(z.string()).optional(),
309
- plan: z.nullable(z.string()).optional(),
310
- tags: z.array(z.string()).optional(),
460
+ servers: z.array(z.lazy(() => BillingUsageServer$outboundSchema)).optional(),
461
+ bucket: z.lazy(() => Bucket$outboundSchema).optional(),
462
+ billingUnitDivisor: z.nullable(z.number().int()).optional(),
463
+ }).transform((v) => {
464
+ return remap$(v, {
465
+ billingUnitDivisor: "billing_unit_divisor",
466
+ });
311
467
  });
312
468
 
313
469
  export function metadataToJSON(metadata: Metadata): string {
@@ -340,14 +496,17 @@ export const Product$inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown> =
340
496
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
341
497
  ).optional(),
342
498
  unit: BillingUsageUnit$inboundSchema.optional(),
499
+ unit_amount: z.number().optional(),
343
500
  unit_price: z.number().optional(),
344
501
  usage_type: UsageType$inboundSchema.optional(),
345
502
  quantity: z.number().optional(),
503
+ amount: z.number().optional(),
346
504
  price: z.number().optional(),
347
505
  metadata: z.lazy(() => Metadata$inboundSchema).optional(),
348
506
  }).transform((v) => {
349
507
  return remap$(v, {
350
508
  "amount_without_discount": "amountWithoutDiscount",
509
+ "unit_amount": "unitAmount",
351
510
  "unit_price": "unitPrice",
352
511
  "usage_type": "usageType",
353
512
  });
@@ -365,9 +524,11 @@ export type Product$Outbound = {
365
524
  start?: string | undefined;
366
525
  end?: string | null | undefined;
367
526
  unit?: string | undefined;
527
+ unit_amount?: number | undefined;
368
528
  unit_price?: number | undefined;
369
529
  usage_type?: string | undefined;
370
530
  quantity?: number | undefined;
531
+ amount?: number | undefined;
371
532
  price?: number | undefined;
372
533
  metadata?: Metadata$Outbound | undefined;
373
534
  };
@@ -389,14 +550,17 @@ export const Product$outboundSchema: z.ZodType<
389
550
  start: z.date().transform(v => v.toISOString()).optional(),
390
551
  end: z.nullable(z.date().transform(v => v.toISOString())).optional(),
391
552
  unit: BillingUsageUnit$outboundSchema.optional(),
553
+ unitAmount: z.number().optional(),
392
554
  unitPrice: z.number().optional(),
393
555
  usageType: UsageType$outboundSchema.optional(),
394
556
  quantity: z.number().optional(),
557
+ amount: z.number().optional(),
395
558
  price: z.number().optional(),
396
559
  metadata: z.lazy(() => Metadata$outboundSchema).optional(),
397
560
  }).transform((v) => {
398
561
  return remap$(v, {
399
562
  amountWithoutDiscount: "amount_without_discount",
563
+ unitAmount: "unit_amount",
400
564
  unitPrice: "unit_price",
401
565
  usageType: "usage_type",
402
566
  });
@@ -424,6 +588,7 @@ export const BillingUsageAttributes$inboundSchema: z.ZodType<
424
588
  project: z.lazy(() => BillingUsageProject$inboundSchema).optional(),
425
589
  period: z.lazy(() => Period$inboundSchema).optional(),
426
590
  available_credit_balance: z.number().int().optional(),
591
+ amount: z.number().optional(),
427
592
  price: z.number().optional(),
428
593
  threshold: z.nullable(z.number()).optional(),
429
594
  products: z.array(z.lazy(() => Product$inboundSchema)).optional(),
@@ -437,6 +602,7 @@ export type BillingUsageAttributes$Outbound = {
437
602
  project?: BillingUsageProject$Outbound | undefined;
438
603
  period?: Period$Outbound | undefined;
439
604
  available_credit_balance?: number | undefined;
605
+ amount?: number | undefined;
440
606
  price?: number | undefined;
441
607
  threshold?: number | null | undefined;
442
608
  products?: Array<Product$Outbound> | undefined;
@@ -451,6 +617,7 @@ export const BillingUsageAttributes$outboundSchema: z.ZodType<
451
617
  project: z.lazy(() => BillingUsageProject$outboundSchema).optional(),
452
618
  period: z.lazy(() => Period$outboundSchema).optional(),
453
619
  availableCreditBalance: z.number().int().optional(),
620
+ amount: z.number().optional(),
454
621
  price: z.number().optional(),
455
622
  threshold: z.nullable(z.number()).optional(),
456
623
  products: z.array(z.lazy(() => Product$outboundSchema)).optional(),
@@ -484,11 +651,13 @@ export const BillingUsageData$inboundSchema: z.ZodType<
484
651
  unknown
485
652
  > = z.object({
486
653
  id: z.string().optional(),
654
+ type: z.string().optional(),
487
655
  attributes: z.lazy(() => BillingUsageAttributes$inboundSchema).optional(),
488
656
  });
489
657
  /** @internal */
490
658
  export type BillingUsageData$Outbound = {
491
659
  id?: string | undefined;
660
+ type?: string | undefined;
492
661
  attributes?: BillingUsageAttributes$Outbound | undefined;
493
662
  };
494
663
 
@@ -499,6 +668,7 @@ export const BillingUsageData$outboundSchema: z.ZodType<
499
668
  BillingUsageData
500
669
  > = z.object({
501
670
  id: z.string().optional(),
671
+ type: z.string().optional(),
502
672
  attributes: z.lazy(() => BillingUsageAttributes$outboundSchema).optional(),
503
673
  });
504
674
 
@@ -525,10 +695,12 @@ export const BillingUsage$inboundSchema: z.ZodType<
525
695
  z.ZodTypeDef,
526
696
  unknown
527
697
  > = z.object({
698
+ meta: z.lazy(() => BillingUsageMeta$inboundSchema).optional(),
528
699
  data: z.lazy(() => BillingUsageData$inboundSchema).optional(),
529
700
  });
530
701
  /** @internal */
531
702
  export type BillingUsage$Outbound = {
703
+ meta?: BillingUsageMeta$Outbound | undefined;
532
704
  data?: BillingUsageData$Outbound | undefined;
533
705
  };
534
706
 
@@ -538,6 +710,7 @@ export const BillingUsage$outboundSchema: z.ZodType<
538
710
  z.ZodTypeDef,
539
711
  BillingUsage
540
712
  > = z.object({
713
+ meta: z.lazy(() => BillingUsageMeta$outboundSchema).optional(),
541
714
  data: z.lazy(() => BillingUsageData$outboundSchema).optional(),
542
715
  });
543
716
 
@@ -15,20 +15,20 @@ 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 = {
@@ -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 {
@@ -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
+ }