@krovacloud/sdk 0.4.15 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,3160 +1,15 @@
1
- import { Client } from "openapi-fetch";
2
1
  /**
3
- * This file was auto-generated by openapi-typescript.
4
- * Do not make direct changes to the file.
5
- */
6
- interface paths {
7
- "/auth/cli/poll": {
8
- parameters: {
9
- query?: never;
10
- header?: never;
11
- path?: never;
12
- cookie?: never;
13
- };
14
- get?: never;
15
- put?: never;
16
- /**
17
- * Poll for CLI device-authorization approval (RFC 8628)
18
- * @description Public, unauthenticated. The CLI submits its deviceCode until the user approves or denies. On approval a real API key is minted ONCE, scoped to the approved Space and the approving user's membership, and returned a single time. Rate-limited per client IP.
19
- */
20
- post: {
21
- parameters: {
22
- query?: never;
23
- header?: never;
24
- path?: never;
25
- cookie?: never;
26
- };
27
- requestBody: {
28
- content: {
29
- "application/json": {
30
- /** @description The device code from /auth/cli/start. */
31
- deviceCode: string;
32
- };
33
- };
34
- };
35
- responses: {
36
- /** @description Approved — API key minted (returned once) */
37
- 200: {
38
- headers: {
39
- [name: string]: unknown;
40
- };
41
- content: {
42
- "application/json": {
43
- /** @description The full API key. Shown once and never returned again — store it securely. */
44
- apiKey: string;
45
- /** @description The Space the key is scoped to. */
46
- spaceId: string;
47
- };
48
- };
49
- };
50
- 400: components["responses"]["BadRequest"];
51
- /** @description The user denied the login request */
52
- 403: {
53
- headers: {
54
- [name: string]: unknown;
55
- };
56
- content?: never;
57
- };
58
- /** @description The device code expired, was already consumed, or is unknown */
59
- 410: {
60
- headers: {
61
- [name: string]: unknown;
62
- };
63
- content?: never;
64
- };
65
- /** @description Authorization still pending — keep polling at the given interval */
66
- 428: {
67
- headers: {
68
- [name: string]: unknown;
69
- };
70
- content?: never;
71
- };
72
- 429: components["responses"]["RateLimited"];
73
- };
74
- };
75
- delete?: never;
76
- options?: never;
77
- head?: never;
78
- patch?: never;
79
- trace?: never;
80
- };
81
- "/auth/cli/start": {
82
- parameters: {
83
- query?: never;
84
- header?: never;
85
- path?: never;
86
- cookie?: never;
87
- };
88
- get?: never;
89
- put?: never;
90
- /**
91
- * Begin a CLI device-authorization login (RFC 8628)
92
- * @description Public, unauthenticated. Mints a device code (returned once) and a short human user code, and returns the verification URIs the user opens in a browser to approve. The CLI then polls /auth/cli/poll. Rate-limited per client IP.
93
- */
94
- post: {
95
- parameters: {
96
- query?: never;
97
- header?: never;
98
- path?: never;
99
- cookie?: never;
100
- };
101
- requestBody?: never;
102
- responses: {
103
- /** @description Device-authorization request created */
104
- 200: {
105
- headers: {
106
- [name: string]: unknown;
107
- };
108
- content: {
109
- "application/json": {
110
- /** @description High-entropy code the CLI keeps secret and presents on each poll. Only its hash is stored server-side. */
111
- deviceCode: string;
112
- /** @description Seconds until the device code expires (~600). */
113
- expiresIn: number;
114
- /** @description Seconds to wait between polls. */
115
- interval: number;
116
- /** @description Short human-readable code (KROVA-XXXX-XXXX) the user confirms in the browser. */
117
- userCode: string;
118
- /**
119
- * Format: uri
120
- * @description Browser URL where the user approves.
121
- */
122
- verificationUri: string;
123
- /**
124
- * Format: uri
125
- * @description verificationUri with the user code pre-filled.
126
- */
127
- verificationUriComplete: string;
128
- };
129
- };
130
- };
131
- 429: components["responses"]["RateLimited"];
132
- /** @description Could not allocate a login code; retry */
133
- 503: {
134
- headers: {
135
- [name: string]: unknown;
136
- };
137
- content?: never;
138
- };
139
- };
140
- };
141
- delete?: never;
142
- options?: never;
143
- head?: never;
144
- patch?: never;
145
- trace?: never;
146
- };
147
- "/images": {
148
- parameters: {
149
- query?: never;
150
- header?: never;
151
- path?: never;
152
- cookie?: never;
153
- };
154
- /** List available OS images */
155
- get: {
156
- parameters: {
157
- query?: never;
158
- header?: never;
159
- path?: never;
160
- cookie?: never;
161
- };
162
- requestBody?: never;
163
- responses: {
164
- /** @description Image list */
165
- 200: {
166
- headers: {
167
- [name: string]: unknown;
168
- };
169
- content: {
170
- "application/json": {
171
- images: components["schemas"]["Image"][];
172
- };
173
- };
174
- };
175
- };
176
- };
177
- put?: never;
178
- post?: never;
179
- delete?: never;
180
- options?: never;
181
- head?: never;
182
- patch?: never;
183
- trace?: never;
184
- };
185
- "/pricing": {
186
- parameters: {
187
- query?: never;
188
- header?: never;
189
- path?: never;
190
- cookie?: never;
191
- };
192
- /** Per-resource hourly rates and volume pricing tiers */
193
- get: {
194
- parameters: {
195
- query?: never;
196
- header?: never;
197
- path?: never;
198
- cookie?: never;
199
- };
200
- requestBody?: never;
201
- responses: {
202
- /** @description Pricing data */
203
- 200: {
204
- headers: {
205
- [name: string]: unknown;
206
- };
207
- content: {
208
- "application/json": {
209
- currency: string;
210
- note: string;
211
- rates: {
212
- diskGbPerHour: number;
213
- ramGbPerHour: number;
214
- vcpuPerHour: number;
215
- };
216
- tiers: components["schemas"]["PricingTier"][];
217
- };
218
- };
219
- };
220
- };
221
- };
222
- put?: never;
223
- post?: never;
224
- delete?: never;
225
- options?: never;
226
- head?: never;
227
- patch?: never;
228
- trace?: never;
229
- };
230
- "/regions": {
231
- parameters: {
232
- query?: never;
233
- header?: never;
234
- path?: never;
235
- cookie?: never;
236
- };
237
- /** List regions with available capacity */
238
- get: {
239
- parameters: {
240
- query?: never;
241
- header?: never;
242
- path?: never;
243
- cookie?: never;
244
- };
245
- requestBody?: never;
246
- responses: {
247
- /** @description Region list */
248
- 200: {
249
- headers: {
250
- [name: string]: unknown;
251
- };
252
- content: {
253
- "application/json": {
254
- regions: components["schemas"]["Region"][];
255
- };
256
- };
257
- };
258
- };
259
- };
260
- put?: never;
261
- post?: never;
262
- delete?: never;
263
- options?: never;
264
- head?: never;
265
- patch?: never;
266
- trace?: never;
267
- };
268
- "/space": {
269
- parameters: {
270
- query?: never;
271
- header?: never;
272
- path?: never;
273
- cookie?: never;
274
- };
275
- /**
276
- * Resolve the space this API key is scoped to
277
- * @description Returns the single space the API key belongs to. Lets a client auto-resolve the space id from the key alone (no spaceId in the URL).
278
- */
279
- get: {
280
- parameters: {
281
- query?: never;
282
- header?: never;
283
- path?: never;
284
- cookie?: never;
285
- };
286
- requestBody?: never;
287
- responses: {
288
- /** @description The key's space */
289
- 200: {
290
- headers: {
291
- [name: string]: unknown;
292
- };
293
- content: {
294
- "application/json": components["schemas"]["Space"];
295
- };
296
- };
297
- 401: components["responses"]["Unauthorized"];
298
- 404: components["responses"]["NotFound"];
299
- };
300
- };
301
- put?: never;
302
- post?: never;
303
- delete?: never;
304
- options?: never;
305
- head?: never;
306
- patch?: never;
307
- trace?: never;
308
- };
309
- "/spaces/{spaceId}/backup-shares": {
310
- parameters: {
311
- query?: never;
312
- header?: never;
313
- path?: never;
314
- cookie?: never;
315
- };
316
- /** List pending backup shares into and out of this space */
317
- get: {
318
- parameters: {
319
- query?: never;
320
- header?: never;
321
- path: {
322
- spaceId: string;
323
- };
324
- cookie?: never;
325
- };
326
- requestBody?: never;
327
- responses: {
328
- /** @description `incoming` asks this space to accept a copy; `outgoing` was offered by this space */
329
- 200: {
330
- headers: {
331
- [name: string]: unknown;
332
- };
333
- content: {
334
- "application/json": {
335
- incoming: components["schemas"]["BackupShare"][];
336
- outgoing: components["schemas"]["BackupShare"][];
337
- };
338
- };
339
- };
340
- 403: components["responses"]["Forbidden"];
341
- };
342
- };
343
- put?: never;
344
- post?: never;
345
- delete?: never;
346
- options?: never;
347
- head?: never;
348
- patch?: never;
349
- trace?: never;
350
- };
351
- "/spaces/{spaceId}/backup-shares/{shareId}/accept": {
352
- parameters: {
353
- query?: never;
354
- header?: never;
355
- path?: never;
356
- cookie?: never;
357
- };
358
- get?: never;
359
- put?: never;
360
- /**
361
- * Accept a backup share offered to this space
362
- * @description Requires an API key of this space's owner, or of a member with `backup.manage`. Creates this space's own copy of the backup, billed for storage from now. Refused with 422 when the space cannot take it (no card, unverified owner, open abuse notice, no credit, or no backup allowance left on its plan).
363
- */
364
- post: {
365
- parameters: {
366
- query?: never;
367
- header?: never;
368
- path: {
369
- spaceId: string;
370
- shareId: string;
371
- };
372
- cookie?: never;
373
- };
374
- requestBody?: never;
375
- responses: {
376
- /** @description The share and the new copy */
377
- 200: {
378
- headers: {
379
- [name: string]: unknown;
380
- };
381
- content: {
382
- "application/json": {
383
- backup: components["schemas"]["Backup"];
384
- share: components["schemas"]["BackupShare"];
385
- };
386
- };
387
- };
388
- 403: components["responses"]["Forbidden"];
389
- /** @description The request is no longer pending, has expired, or this space already has a copy */
390
- 409: {
391
- headers: {
392
- [name: string]: unknown;
393
- };
394
- content?: never;
395
- };
396
- /** @description This space cannot take the copy right now */
397
- 422: {
398
- headers: {
399
- [name: string]: unknown;
400
- };
401
- content?: never;
402
- };
403
- 429: components["responses"]["RateLimited"];
404
- };
405
- };
406
- delete?: never;
407
- options?: never;
408
- head?: never;
409
- patch?: never;
410
- trace?: never;
411
- };
412
- "/spaces/{spaceId}/backup-shares/{shareId}/cancel": {
413
- parameters: {
414
- query?: never;
415
- header?: never;
416
- path?: never;
417
- cookie?: never;
418
- };
419
- get?: never;
420
- put?: never;
421
- /**
422
- * Withdraw a pending backup share offered by this space
423
- * @description Allowed for an API key of this space's owner, of a member with `backup.manage`, or of the member who raised the request.
424
- */
425
- post: {
426
- parameters: {
427
- query?: never;
428
- header?: never;
429
- path: {
430
- spaceId: string;
431
- shareId: string;
432
- };
433
- cookie?: never;
434
- };
435
- requestBody?: never;
436
- responses: {
437
- /** @description Canceled */
438
- 200: {
439
- headers: {
440
- [name: string]: unknown;
441
- };
442
- content: {
443
- "application/json": {
444
- share: components["schemas"]["BackupShare"];
445
- };
446
- };
447
- };
448
- 403: components["responses"]["Forbidden"];
449
- /** @description The request is no longer pending */
450
- 409: {
451
- headers: {
452
- [name: string]: unknown;
453
- };
454
- content?: never;
455
- };
456
- 429: components["responses"]["RateLimited"];
457
- };
458
- };
459
- delete?: never;
460
- options?: never;
461
- head?: never;
462
- patch?: never;
463
- trace?: never;
464
- };
465
- "/spaces/{spaceId}/backup-shares/{shareId}/decline": {
466
- parameters: {
467
- query?: never;
468
- header?: never;
469
- path?: never;
470
- cookie?: never;
471
- };
472
- get?: never;
473
- put?: never;
474
- /**
475
- * Decline a backup share offered to this space
476
- * @description Requires an API key of this space's owner, or of a member with `backup.manage`.
477
- */
478
- post: {
479
- parameters: {
480
- query?: never;
481
- header?: never;
482
- path: {
483
- spaceId: string;
484
- shareId: string;
485
- };
486
- cookie?: never;
487
- };
488
- requestBody?: never;
489
- responses: {
490
- /** @description Declined */
491
- 200: {
492
- headers: {
493
- [name: string]: unknown;
494
- };
495
- content: {
496
- "application/json": {
497
- share: components["schemas"]["BackupShare"];
498
- };
499
- };
500
- };
501
- 403: components["responses"]["Forbidden"];
502
- /** @description The request is no longer pending */
503
- 409: {
504
- headers: {
505
- [name: string]: unknown;
506
- };
507
- content?: never;
508
- };
509
- 429: components["responses"]["RateLimited"];
510
- };
511
- };
512
- delete?: never;
513
- options?: never;
514
- head?: never;
515
- patch?: never;
516
- trace?: never;
517
- };
518
- "/spaces/{spaceId}/backups": {
519
- parameters: {
520
- query?: never;
521
- header?: never;
522
- path?: never;
523
- cookie?: never;
524
- };
525
- /** List the space's backups, newest first (shared copies included) */
526
- get: {
527
- parameters: {
528
- query?: never;
529
- header?: never;
530
- path: {
531
- spaceId: string;
532
- };
533
- cookie?: never;
534
- };
535
- requestBody?: never;
536
- responses: {
537
- /** @description Backups */
538
- 200: {
539
- headers: {
540
- [name: string]: unknown;
541
- };
542
- content: {
543
- "application/json": {
544
- backups: components["schemas"]["Backup"][];
545
- };
546
- };
547
- };
548
- 403: components["responses"]["Forbidden"];
549
- };
550
- };
551
- put?: never;
552
- post?: never;
553
- delete?: never;
554
- options?: never;
555
- head?: never;
556
- patch?: never;
557
- trace?: never;
558
- };
559
- "/spaces/{spaceId}/backups/{backupId}": {
560
- parameters: {
561
- query?: never;
562
- header?: never;
563
- path?: never;
564
- cookie?: never;
565
- };
566
- /** Get one backup */
567
- get: {
568
- parameters: {
569
- query?: never;
570
- header?: never;
571
- path: {
572
- spaceId: string;
573
- backupId: string;
574
- };
575
- cookie?: never;
576
- };
577
- requestBody?: never;
578
- responses: {
579
- /** @description The backup */
580
- 200: {
581
- headers: {
582
- [name: string]: unknown;
583
- };
584
- content: {
585
- "application/json": {
586
- backup: components["schemas"]["Backup"];
587
- };
588
- };
589
- };
590
- 404: components["responses"]["NotFound"];
591
- };
592
- };
593
- put?: never;
594
- post?: never;
595
- delete?: never;
596
- options?: never;
597
- head?: never;
598
- patch?: never;
599
- trace?: never;
600
- };
601
- "/spaces/{spaceId}/backups/{backupId}/download": {
602
- parameters: {
603
- query?: never;
604
- header?: never;
605
- path?: never;
606
- cookie?: never;
607
- };
608
- /** Generate a presigned download URL for a backup .cube archive */
609
- get: {
610
- parameters: {
611
- query?: never;
612
- header?: never;
613
- path: {
614
- spaceId: string;
615
- backupId: string;
616
- };
617
- cookie?: never;
618
- };
619
- requestBody?: never;
620
- responses: {
621
- /** @description Presigned URL valid for 15 minutes */
622
- 200: {
623
- headers: {
624
- [name: string]: unknown;
625
- };
626
- content: {
627
- "application/json": {
628
- /** Format: date-time */
629
- expiresAt?: string;
630
- filename?: string;
631
- sizeBytes?: number | null;
632
- url?: string;
633
- };
634
- };
635
- };
636
- 404: components["responses"]["NotFound"];
637
- /** @description Backup is not in 'complete' status */
638
- 409: {
639
- headers: {
640
- [name: string]: unknown;
641
- };
642
- content?: never;
643
- };
644
- };
645
- };
646
- put?: never;
647
- post?: never;
648
- delete?: never;
649
- options?: never;
650
- head?: never;
651
- patch?: never;
652
- trace?: never;
653
- };
654
- "/spaces/{spaceId}/backups/{backupId}/shares": {
655
- parameters: {
656
- query?: never;
657
- header?: never;
658
- path?: never;
659
- cookie?: never;
660
- };
661
- get?: never;
662
- put?: never;
663
- /**
664
- * Offer a copy of this backup to another space
665
- * @description Requires `backup.manage`. Creates a pending share request that the destination space accepts within 48 hours: its owner, or a member there with `backup.manage`, in the dashboard or with an API key of their own. On acceptance the destination gets its own copy of the backup and pays backup storage for it from that moment; this space's backup is unchanged. A request made with an API key never completes immediately, even when the key's user owns both spaces.
666
- */
667
- post: {
668
- parameters: {
669
- query?: never;
670
- header?: {
671
- /** @description Optional unique key (max 255 chars). Replays return the original response and add header Idempotency-Replayed: true. Scoped per space; expires after 24h. */
672
- "Idempotency-Key"?: string;
673
- };
674
- path: {
675
- spaceId: string;
676
- backupId: string;
677
- };
678
- cookie?: never;
679
- };
680
- requestBody: {
681
- content: {
682
- "application/json": {
683
- destinationSpaceId: string;
684
- };
685
- };
686
- };
687
- responses: {
688
- /** @description Share requested */
689
- 201: {
690
- headers: {
691
- [name: string]: unknown;
692
- };
693
- content: {
694
- "application/json": {
695
- share: components["schemas"]["BackupShare"];
696
- };
697
- };
698
- };
699
- 400: components["responses"]["BadRequest"];
700
- 403: components["responses"]["Forbidden"];
701
- 404: components["responses"]["NotFound"];
702
- /** @description The backup is not complete, is being deleted, is already in that space, or already has a pending share request for it */
703
- 409: {
704
- headers: {
705
- [name: string]: unknown;
706
- };
707
- content?: never;
708
- };
709
- 429: components["responses"]["RateLimited"];
710
- };
711
- };
712
- delete?: never;
713
- options?: never;
714
- head?: never;
715
- patch?: never;
716
- trace?: never;
717
- };
718
- "/spaces/{spaceId}/cubes": {
719
- parameters: {
720
- query?: never;
721
- header?: never;
722
- path?: never;
723
- cookie?: never;
724
- };
725
- /** List Cubes in a Space */
726
- get: {
727
- parameters: {
728
- query?: never;
729
- header?: never;
730
- path: {
731
- spaceId: string;
732
- };
733
- cookie?: never;
734
- };
735
- requestBody?: never;
736
- responses: {
737
- /** @description Paginated Cube list */
738
- 200: {
739
- headers: {
740
- [name: string]: unknown;
741
- };
742
- content: {
743
- "application/json": {
744
- cubes: components["schemas"]["Cube"][];
745
- pagination: components["schemas"]["Pagination"];
746
- };
747
- };
748
- };
749
- 401: components["responses"]["Unauthorized"];
750
- 403: components["responses"]["Forbidden"];
751
- };
752
- };
753
- put?: never;
754
- /** Create a Cube */
755
- post: {
756
- parameters: {
757
- query?: never;
758
- header?: {
759
- /** @description Optional unique key (max 255 chars). Replays return the original response and add header Idempotency-Replayed: true. Scoped per space; expires after 24h. */
760
- "Idempotency-Key"?: string;
761
- };
762
- path: {
763
- spaceId: string;
764
- };
765
- cookie?: never;
766
- };
767
- requestBody: {
768
- content: {
769
- "application/json": {
770
- image: string;
771
- name: string;
772
- /** @description Region slug from /v1/regions (optional). */
773
- region?: string;
774
- resources: {
775
- diskGb: number;
776
- ramGb: number;
777
- vcpu: number;
778
- };
779
- /** @description SSH public key written to the Cube login user's authorized_keys at boot (~/.ssh/authorized_keys for the ubuntu or debian user; /root/.ssh/authorized_keys on Cubes created before the default-user change). GET /cubes/{cubeId}/ssh reports the login user for a given Cube. Must start with ssh-ed25519, ssh-rsa, ecdsa-sha2-*, ssh-dss, or sk-*@openssh.com. */
780
- sshPublicKey: string;
781
- /**
782
- * @description Create the Cube with termination protection already on, so it is never briefly deletable between create and a follow-up PATCH. Optional; anything other than a boolean is rejected with 400.
783
- * @default false
784
- */
785
- terminationProtection?: boolean;
786
- /** @description cloud-init script (max 16 KB, optional). */
787
- userData?: string;
788
- };
789
- };
790
- };
791
- responses: {
792
- /** @description Cube created */
793
- 201: {
794
- headers: {
795
- [name: string]: unknown;
796
- };
797
- content: {
798
- "application/json": {
799
- cube?: components["schemas"]["Cube"];
800
- };
801
- };
802
- };
803
- 400: components["responses"]["BadRequest"];
804
- 401: components["responses"]["Unauthorized"];
805
- 403: components["responses"]["Forbidden"];
806
- 429: components["responses"]["RateLimited"];
807
- };
808
- };
809
- delete?: never;
810
- options?: never;
811
- head?: never;
812
- patch?: never;
813
- trace?: never;
814
- };
815
- "/spaces/{spaceId}/cubes/imports": {
816
- parameters: {
817
- query?: never;
818
- header?: never;
819
- path?: never;
820
- cookie?: never;
821
- };
822
- get?: never;
823
- put?: never;
824
- /** Initiate a .cube archive import (browser-side multipart upload) */
825
- post: {
826
- parameters: {
827
- query?: never;
828
- header?: never;
829
- path: {
830
- spaceId: string;
831
- };
832
- cookie?: never;
833
- };
834
- requestBody: {
835
- content: {
836
- "application/json": {
837
- diskGbOverride?: number | null;
838
- expectedConfig?: {
839
- diskLimitGb?: number;
840
- ramMb?: number;
841
- vcpus?: number;
842
- } | null;
843
- fileSizeBytes: number;
844
- name: string;
845
- ramMbOverride?: number | null;
846
- region?: string | null;
847
- /**
848
- * @description What to do with SSH access on the imported rootfs. `replace` (default) writes `sshPublicKey` to the login user's authorized_keys and requires `sshPublicKey` to be set. `keep` leaves the image's own authorized_keys and sshd configuration completely untouched — nothing is written — so you must already hold a private key that the image accepts, or you will not be able to log in.
849
- * @default replace
850
- * @enum {string}
851
- */
852
- sshKeyMode?: "replace" | "keep";
853
- /** @description Public key to install when `sshKeyMode` is `replace`. Written to the login user's `~/.ssh/authorized_keys` — which user that is comes from the imported rootfs itself, so an image without a Krova default user keeps logging in as root. Ignored when `sshKeyMode` is `keep`. */
854
- sshPublicKey?: string | null;
855
- userData?: string | null;
856
- vcpusOverride?: number | null;
857
- };
858
- };
859
- };
860
- responses: {
861
- /** @description Import initiated; returns presigned part URLs */
862
- 201: {
863
- headers: {
864
- [name: string]: unknown;
865
- };
866
- content: {
867
- "application/json": {
868
- chunkSizeBytes?: number;
869
- /** Format: date-time */
870
- expiresAt?: string;
871
- importId?: string;
872
- key?: string;
873
- parts?: {
874
- partNumber?: number;
875
- url?: string;
876
- }[];
877
- uploadId?: string;
878
- };
879
- };
880
- };
881
- /** @description Invalid input */
882
- 400: {
883
- headers: {
884
- [name: string]: unknown;
885
- };
886
- content?: never;
887
- };
888
- /** @description Plan limit exceeded */
889
- 403: {
890
- headers: {
891
- [name: string]: unknown;
892
- };
893
- content?: never;
894
- };
895
- /** @description No active storage backend */
896
- 503: {
897
- headers: {
898
- [name: string]: unknown;
899
- };
900
- content?: never;
901
- };
902
- };
903
- };
904
- delete?: never;
905
- options?: never;
906
- head?: never;
907
- patch?: never;
908
- trace?: never;
909
- };
910
- "/spaces/{spaceId}/cubes/imports/{importId}": {
911
- parameters: {
912
- query?: never;
913
- header?: never;
914
- path?: never;
915
- cookie?: never;
916
- };
917
- /** Get the current state of an import */
918
- get: {
919
- parameters: {
920
- query?: never;
921
- header?: never;
922
- path: {
923
- spaceId: string;
924
- importId: string;
925
- };
926
- cookie?: never;
927
- };
928
- requestBody?: never;
929
- responses: {
930
- /** @description Current import state */
931
- 200: {
932
- headers: {
933
- [name: string]: unknown;
934
- };
935
- content: {
936
- "application/json": {
937
- import?: {
938
- completedAt?: string | null;
939
- createdAt?: string;
940
- cubeId?: string | null;
941
- error?: string | null;
942
- id?: string;
943
- name?: string;
944
- /** @enum {string} */
945
- status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired";
946
- updatedAt?: string;
947
- };
948
- };
949
- };
950
- };
951
- 404: components["responses"]["NotFound"];
952
- };
953
- };
954
- put?: never;
955
- post?: never;
956
- /** Cancel an in-flight upload (only allowed in 'uploading' state) */
957
- delete: {
958
- parameters: {
959
- query?: never;
960
- header?: never;
961
- path: {
962
- spaceId: string;
963
- importId: string;
964
- };
965
- cookie?: never;
966
- };
967
- requestBody?: never;
968
- responses: {
969
- /** @description Cancelled */
970
- 200: {
971
- headers: {
972
- [name: string]: unknown;
973
- };
974
- content: {
975
- "application/json": {
976
- success: boolean;
977
- };
978
- };
979
- };
980
- 404: components["responses"]["NotFound"];
981
- /** @description Cannot cancel an import past the 'uploading' state */
982
- 409: {
983
- headers: {
984
- [name: string]: unknown;
985
- };
986
- content?: never;
987
- };
988
- };
989
- };
990
- options?: never;
991
- head?: never;
992
- patch?: never;
993
- trace?: never;
994
- };
995
- "/spaces/{spaceId}/cubes/imports/{importId}/complete": {
996
- parameters: {
997
- query?: never;
998
- header?: never;
999
- path?: never;
1000
- cookie?: never;
1001
- };
1002
- get?: never;
1003
- put?: never;
1004
- /** Finalize a .cube import: complete multipart upload + create cube row + enqueue provisioning */
1005
- post: {
1006
- parameters: {
1007
- query?: never;
1008
- header?: never;
1009
- path: {
1010
- spaceId: string;
1011
- importId: string;
1012
- };
1013
- cookie?: never;
1014
- };
1015
- requestBody: {
1016
- content: {
1017
- "application/json": {
1018
- config: {
1019
- diskLimitGb: number;
1020
- imageId: string;
1021
- ramMb: number;
1022
- userData?: string | null;
1023
- vcpus: number;
1024
- };
1025
- parts: {
1026
- etag: string;
1027
- partNumber: number;
1028
- }[];
1029
- };
1030
- };
1031
- };
1032
- responses: {
1033
- /** @description Provisioning enqueued */
1034
- 200: {
1035
- headers: {
1036
- [name: string]: unknown;
1037
- };
1038
- content: {
1039
- "application/json": {
1040
- cubeId?: string;
1041
- importId?: string;
1042
- /** @enum {string} */
1043
- status?: "provisioning";
1044
- };
1045
- };
1046
- };
1047
- /** @description Invalid input */
1048
- 400: {
1049
- headers: {
1050
- [name: string]: unknown;
1051
- };
1052
- content?: never;
1053
- };
1054
- /** @description Plan limit exceeded */
1055
- 403: {
1056
- headers: {
1057
- [name: string]: unknown;
1058
- };
1059
- content?: never;
1060
- };
1061
- /** @description Import not in 'uploading' state */
1062
- 409: {
1063
- headers: {
1064
- [name: string]: unknown;
1065
- };
1066
- content?: never;
1067
- };
1068
- /** @description S3 finalization failed */
1069
- 502: {
1070
- headers: {
1071
- [name: string]: unknown;
1072
- };
1073
- content?: never;
1074
- };
1075
- /** @description Storage backend unavailable */
1076
- 503: {
1077
- headers: {
1078
- [name: string]: unknown;
1079
- };
1080
- content?: never;
1081
- };
1082
- };
1083
- };
1084
- delete?: never;
1085
- options?: never;
1086
- head?: never;
1087
- patch?: never;
1088
- trace?: never;
1089
- };
1090
- "/spaces/{spaceId}/cubes/{cubeId}": {
1091
- parameters: {
1092
- query?: never;
1093
- header?: never;
1094
- path?: never;
1095
- cookie?: never;
1096
- };
1097
- /** Get a Cube */
1098
- get: {
1099
- parameters: {
1100
- query?: never;
1101
- header?: never;
1102
- path: {
1103
- spaceId: string;
1104
- cubeId: string;
1105
- };
1106
- cookie?: never;
1107
- };
1108
- requestBody?: never;
1109
- responses: {
1110
- /** @description Cube */
1111
- 200: {
1112
- headers: {
1113
- [name: string]: unknown;
1114
- };
1115
- content: {
1116
- "application/json": {
1117
- cube: components["schemas"]["Cube"];
1118
- };
1119
- };
1120
- };
1121
- 404: components["responses"]["NotFound"];
1122
- };
1123
- };
1124
- put?: never;
1125
- post?: never;
1126
- /** Delete a Cube (asynchronous) */
1127
- delete: {
1128
- parameters: {
1129
- query?: never;
1130
- header?: never;
1131
- path: {
1132
- spaceId: string;
1133
- cubeId: string;
1134
- };
1135
- cookie?: never;
1136
- };
1137
- requestBody?: never;
1138
- responses: {
1139
- /** @description Deletion enqueued */
1140
- 200: {
1141
- headers: {
1142
- [name: string]: unknown;
1143
- };
1144
- content: {
1145
- "application/json": {
1146
- success: boolean;
1147
- };
1148
- };
1149
- };
1150
- 404: components["responses"]["NotFound"];
1151
- /** @description The Cube has termination protection on. Turn it off with PATCH before deleting. Power-off, wake, restart, restore, network-reset and snapshot operations are not termination and are never blocked by this. */
1152
- 409: {
1153
- headers: {
1154
- [name: string]: unknown;
1155
- };
1156
- content: {
1157
- "application/json": {
1158
- error: {
1159
- /** @enum {string} */
1160
- code: "termination_protected";
1161
- cube?: {
1162
- id?: string;
1163
- /** Format: date-time */
1164
- terminationProtectionChangedAt?: string | null;
1165
- terminationProtectionChangedBy?: string | null;
1166
- };
1167
- message: string;
1168
- };
1169
- };
1170
- };
1171
- };
1172
- 429: components["responses"]["RateLimited"];
1173
- };
1174
- };
1175
- options?: never;
1176
- head?: never;
1177
- /**
1178
- * Update a Cube (toggle termination protection)
1179
- * @description Idempotent. Termination protection is the only PATCHable field today: sending the value it already has returns the Cube unchanged and writes no audit row. Omitting it is a 400 rather than a no-op, so a typo in the field name cannot look like success. Rename and resize are not part of the public API.
1180
- */
1181
- patch: {
1182
- parameters: {
1183
- query?: never;
1184
- header?: never;
1185
- path: {
1186
- spaceId: string;
1187
- cubeId: string;
1188
- };
1189
- cookie?: never;
1190
- };
1191
- requestBody: {
1192
- content: {
1193
- "application/json": {
1194
- /** @description Turn protection on or off. Turning it on stamps `terminationProtectionChangedAt` and `terminationProtectionChangedBy`; turning it off clears both. */
1195
- terminationProtection: boolean;
1196
- };
1197
- };
1198
- };
1199
- responses: {
1200
- /** @description The updated Cube */
1201
- 200: {
1202
- headers: {
1203
- [name: string]: unknown;
1204
- };
1205
- content: {
1206
- "application/json": {
1207
- cube: components["schemas"]["Cube"];
1208
- };
1209
- };
1210
- };
1211
- 400: components["responses"]["BadRequest"];
1212
- 404: components["responses"]["NotFound"];
1213
- 429: components["responses"]["RateLimited"];
1214
- };
1215
- };
1216
- trace?: never;
1217
- };
1218
- "/spaces/{spaceId}/cubes/{cubeId}/domains": {
1219
- parameters: {
1220
- query?: never;
1221
- header?: never;
1222
- path?: never;
1223
- cookie?: never;
1224
- };
1225
- /** List custom domains attached to a Cube */
1226
- get: {
1227
- parameters: {
1228
- query?: never;
1229
- header?: never;
1230
- path: {
1231
- spaceId: string;
1232
- cubeId: string;
1233
- };
1234
- cookie?: never;
1235
- };
1236
- requestBody?: never;
1237
- responses: {
1238
- /** @description Domain list */
1239
- 200: {
1240
- headers: {
1241
- [name: string]: unknown;
1242
- };
1243
- content: {
1244
- "application/json": {
1245
- domains: components["schemas"]["Domain"][];
1246
- };
1247
- };
1248
- };
1249
- };
1250
- };
1251
- put?: never;
1252
- /**
1253
- * Attach a custom domain to a Cube
1254
- * @description Attaches a domain and optionally configures any per-domain proxy settings at the same time. Settings can also be changed later via PATCH.
1255
- */
1256
- post: {
1257
- parameters: {
1258
- query?: never;
1259
- header?: {
1260
- /** @description Optional unique key (max 255 chars). Replays return the original response and add header Idempotency-Replayed: true. Scoped per space; expires after 24h. */
1261
- "Idempotency-Key"?: string;
1262
- };
1263
- path: {
1264
- spaceId: string;
1265
- cubeId: string;
1266
- };
1267
- cookie?: never;
1268
- };
1269
- requestBody: {
1270
- content: {
1271
- "application/json": {
1272
- /** @description Plaintext Basic Auth password — bcrypt-hashed server-side, never stored or returned. Required when setting basicAuthUser. */
1273
- basicAuthPassword?: string;
1274
- /** @description HTTP Basic Auth username. Null/empty clears Basic Auth. Setting it requires basicAuthPassword. */
1275
- basicAuthUser?: string | null;
1276
- /** @description Accept a save that leaves domains on the same cube port with different proxyProtocol settings (for an app that handles both on one port, or mid-migration). Not stored. */
1277
- confirmMixedProxyProtocol?: boolean;
1278
- /** @description Per-domain CORS policy, applied at the edge. Null (default) = CORS disabled and no Access-Control-* header is emitted anywhere. When set, the proxy answers OPTIONS preflight itself (204, the cube is never involved) and adds the headers to normal AND error responses, so a cross-origin request to a failing or stopped cube is never CORS-masked. */
1279
- corsConfig?: {
1280
- /** @description Send Access-Control-Allow-Credentials: true. Rejected together with the "*" origin. */
1281
- allowCredentials?: boolean;
1282
- /** @description Allowed request headers. Omitted/empty = echo the preflight's Access-Control-Request-Headers. */
1283
- allowedHeaders?: string[];
1284
- /** @description Allowed methods. Omitted = GET, POST, PUT, PATCH, DELETE, OPTIONS. */
1285
- allowedMethods?: string[];
1286
- /** @description Exact scheme://host[:port] origins (no path, query or trailing slash), or the single-element wildcard ["*"]. "*" and allowCredentials are mutually exclusive. */
1287
- allowedOrigins: string[];
1288
- /** @description Response headers exposed to JS. Omitted/empty = none. */
1289
- exposedHeaders?: string[];
1290
- /** @description Preflight cache TTL. Default 600; 86400 is Chromium's hard cap. */
1291
- maxAgeSeconds?: number;
1292
- } | null;
1293
- /** @description The hostname to attach, e.g. app.example.com */
1294
- domain: string;
1295
- /** @description Visitor IP/CIDR allow-list (v4+v6). Non-empty ⇒ only these reach the app. Null/empty = open. */
1296
- ipAllowList?: string[] | null;
1297
- /** @description Visitor IP/CIDR deny-list (v4+v6) → 403. Null/empty = none. */
1298
- ipDenyList?: string[] | null;
1299
- /** @description Max request body size (MB). Null = unlimited (default). */
1300
- maxRequestBodyMb?: number | null;
1301
- /**
1302
- * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honored exactly. Applied as saved: if the cube does not serve this hostname over HTTPS, requests to the domain fail until you set it back to http.
1303
- * @enum {string}
1304
- */
1305
- originScheme?: "http" | "https";
1306
- /** @description Cube port the domain proxies to. */
1307
- port: number;
1308
- /**
1309
- * @description Send a PROXY protocol header (v1 text or v2 binary) at the start of every connection to the cube, so the app reads the visitor's address from the connection itself, as on a plain VPS. Null (default) = off. The app must accept PROXY protocol on this port, or every request to the domain fails; it is applied as saved. Every domain on the same cube port must use the same setting: a save that would mix them is refused with 409 unless confirmMixedProxyProtocol is true.
1310
- * @enum {string|null}
1311
- */
1312
- proxyProtocol?: "v1" | "v2" | null;
1313
- /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1314
- requestHeaderOverrides?: {
1315
- remove?: string[];
1316
- set?: {
1317
- [key: string]: string;
1318
- };
1319
- } | null;
1320
- /** @description Edge gzip/zstd compression. Default false (domains behind a CDN are already compressed there). */
1321
- responseCompression?: boolean;
1322
- /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1323
- responseHeaderOverrides?: {
1324
- remove?: string[];
1325
- set?: {
1326
- [key: string]: string;
1327
- };
1328
- } | null;
1329
- /** @description Seconds the app may take to send response headers (streaming unaffected). Default 60. */
1330
- responseHeaderTimeoutSecs?: number;
1331
- /**
1332
- * @description enforced = proxy sets platform security headers (HSTS, X-Frame-Options, …); app_managed = the app's own headers pass through. Default enforced.
1333
- * @enum {string}
1334
- */
1335
- securityHeadersMode?: "enforced" | "app_managed";
1336
- };
1337
- };
1338
- };
1339
- responses: {
1340
- /** @description Domain attached */
1341
- 201: {
1342
- headers: {
1343
- [name: string]: unknown;
1344
- };
1345
- content: {
1346
- "application/json": {
1347
- domain: components["schemas"]["Domain"];
1348
- records: components["schemas"]["DnsRecord"][];
1349
- };
1350
- };
1351
- };
1352
- 400: components["responses"]["BadRequest"];
1353
- /** @description Refused. Among other reasons (the domain is in use or is being removed; or, temporarily, the Cube is in the last stretch of a move to another server, refused with the error "This cube is being moved to another server. Try again in a minute." and accepted once the move ends): the save would leave domains on the same cube port with different proxyProtocol settings. Then `errorMeta.code` is `proxy_protocol_port_mismatch`, with `errorMeta.port` and `errorMeta.domains` naming the other domains. Change them together, or resend with confirmMixedProxyProtocol: true. */
1354
- 409: {
1355
- headers: {
1356
- [name: string]: unknown;
1357
- };
1358
- content?: never;
1359
- };
1360
- 429: components["responses"]["RateLimited"];
1361
- };
1362
- };
1363
- delete?: never;
1364
- options?: never;
1365
- head?: never;
1366
- patch?: never;
1367
- trace?: never;
1368
- };
1369
- "/spaces/{spaceId}/cubes/{cubeId}/domains/{mappingId}": {
1370
- parameters: {
1371
- query?: never;
1372
- header?: never;
1373
- path?: never;
1374
- cookie?: never;
1375
- };
1376
- get?: never;
1377
- put?: never;
1378
- post?: never;
1379
- /** Detach a custom domain */
1380
- delete: {
1381
- parameters: {
1382
- query?: never;
1383
- header?: never;
1384
- path: {
1385
- spaceId: string;
1386
- cubeId: string;
1387
- mappingId: string;
1388
- };
1389
- cookie?: never;
1390
- };
1391
- requestBody?: never;
1392
- responses: {
1393
- /** @description Detached */
1394
- 200: {
1395
- headers: {
1396
- [name: string]: unknown;
1397
- };
1398
- content: {
1399
- "application/json": {
1400
- success: boolean;
1401
- };
1402
- };
1403
- };
1404
- 404: components["responses"]["NotFound"];
1405
- /** @description Refused because the change conflicts with the Cube's current state, for example the port is already in use or the mapping is already being removed. One such conflict is temporary: in the last stretch of a move of the Cube to another server the change is refused with the error "This cube is being moved to another server. Try again in a minute." Nothing was changed then, and the same request is accepted once the move ends. */
1406
- 409: {
1407
- headers: {
1408
- [name: string]: unknown;
1409
- };
1410
- content?: never;
1411
- };
1412
- };
1413
- };
1414
- options?: never;
1415
- head?: never;
1416
- /**
1417
- * Update a custom domain's proxy settings
1418
- * @description Partial update — only the fields you send change; omitted fields are left as-is. The Basic Auth password is write-only and bcrypt-hashed server-side.
1419
- */
1420
- patch: {
1421
- parameters: {
1422
- query?: never;
1423
- header?: never;
1424
- path: {
1425
- spaceId: string;
1426
- cubeId: string;
1427
- mappingId: string;
1428
- };
1429
- cookie?: never;
1430
- };
1431
- requestBody: {
1432
- content: {
1433
- "application/json": {
1434
- /** @description Plaintext Basic Auth password — bcrypt-hashed server-side, never stored or returned. Required when setting basicAuthUser. */
1435
- basicAuthPassword?: string;
1436
- /** @description HTTP Basic Auth username. Null/empty clears Basic Auth. Setting it requires basicAuthPassword. */
1437
- basicAuthUser?: string | null;
1438
- /** @description Accept a save that leaves domains on the same cube port with different proxyProtocol settings (for an app that handles both on one port, or mid-migration). Not stored. */
1439
- confirmMixedProxyProtocol?: boolean;
1440
- /** @description Per-domain CORS policy, applied at the edge. Null (default) = CORS disabled and no Access-Control-* header is emitted anywhere. When set, the proxy answers OPTIONS preflight itself (204, the cube is never involved) and adds the headers to normal AND error responses, so a cross-origin request to a failing or stopped cube is never CORS-masked. */
1441
- corsConfig?: {
1442
- /** @description Send Access-Control-Allow-Credentials: true. Rejected together with the "*" origin. */
1443
- allowCredentials?: boolean;
1444
- /** @description Allowed request headers. Omitted/empty = echo the preflight's Access-Control-Request-Headers. */
1445
- allowedHeaders?: string[];
1446
- /** @description Allowed methods. Omitted = GET, POST, PUT, PATCH, DELETE, OPTIONS. */
1447
- allowedMethods?: string[];
1448
- /** @description Exact scheme://host[:port] origins (no path, query or trailing slash), or the single-element wildcard ["*"]. "*" and allowCredentials are mutually exclusive. */
1449
- allowedOrigins: string[];
1450
- /** @description Response headers exposed to JS. Omitted/empty = none. */
1451
- exposedHeaders?: string[];
1452
- /** @description Preflight cache TTL. Default 600; 86400 is Chromium's hard cap. */
1453
- maxAgeSeconds?: number;
1454
- } | null;
1455
- /** @description Visitor IP/CIDR allow-list (v4+v6). Non-empty ⇒ only these reach the app. Null/empty = open. */
1456
- ipAllowList?: string[] | null;
1457
- /** @description Visitor IP/CIDR deny-list (v4+v6) → 403. Null/empty = none. */
1458
- ipDenyList?: string[] | null;
1459
- /** @description Max request body size (MB). Null = unlimited (default). */
1460
- maxRequestBodyMb?: number | null;
1461
- /**
1462
- * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honored exactly. Applied as saved: if the cube does not serve this hostname over HTTPS, requests to the domain fail until you set it back to http.
1463
- * @enum {string}
1464
- */
1465
- originScheme?: "http" | "https";
1466
- /**
1467
- * @description Send a PROXY protocol header (v1 text or v2 binary) at the start of every connection to the cube, so the app reads the visitor's address from the connection itself, as on a plain VPS. Null (default) = off. The app must accept PROXY protocol on this port, or every request to the domain fails; it is applied as saved. Every domain on the same cube port must use the same setting: a save that would mix them is refused with 409 unless confirmMixedProxyProtocol is true.
1468
- * @enum {string|null}
1469
- */
1470
- proxyProtocol?: "v1" | "v2" | null;
1471
- /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1472
- requestHeaderOverrides?: {
1473
- remove?: string[];
1474
- set?: {
1475
- [key: string]: string;
1476
- };
1477
- } | null;
1478
- /** @description Edge gzip/zstd compression. Default false (domains behind a CDN are already compressed there). */
1479
- responseCompression?: boolean;
1480
- /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1481
- responseHeaderOverrides?: {
1482
- remove?: string[];
1483
- set?: {
1484
- [key: string]: string;
1485
- };
1486
- } | null;
1487
- /** @description Seconds the app may take to send response headers (streaming unaffected). Default 60. */
1488
- responseHeaderTimeoutSecs?: number;
1489
- /**
1490
- * @description enforced = proxy sets platform security headers (HSTS, X-Frame-Options, …); app_managed = the app's own headers pass through. Default enforced.
1491
- * @enum {string}
1492
- */
1493
- securityHeadersMode?: "enforced" | "app_managed";
1494
- };
1495
- };
1496
- };
1497
- responses: {
1498
- /** @description Settings updated */
1499
- 200: {
1500
- headers: {
1501
- [name: string]: unknown;
1502
- };
1503
- content: {
1504
- "application/json": {
1505
- domain: components["schemas"]["Domain"];
1506
- };
1507
- };
1508
- };
1509
- 400: components["responses"]["BadRequest"];
1510
- 404: components["responses"]["NotFound"];
1511
- /** @description Refused. Among other reasons (the domain is in use or is being removed; or, temporarily, the Cube is in the last stretch of a move to another server, refused with the error "This cube is being moved to another server. Try again in a minute." and accepted once the move ends): the save would leave domains on the same cube port with different proxyProtocol settings. Then `errorMeta.code` is `proxy_protocol_port_mismatch`, with `errorMeta.port` and `errorMeta.domains` naming the other domains. Change them together, or resend with confirmMixedProxyProtocol: true. */
1512
- 409: {
1513
- headers: {
1514
- [name: string]: unknown;
1515
- };
1516
- content?: never;
1517
- };
1518
- 429: components["responses"]["RateLimited"];
1519
- };
1520
- };
1521
- trace?: never;
1522
- };
1523
- "/spaces/{spaceId}/cubes/{cubeId}/domains/{mappingId}/records": {
1524
- parameters: {
1525
- query?: never;
1526
- header?: never;
1527
- path?: never;
1528
- cookie?: never;
1529
- };
1530
- /**
1531
- * DNS records this domain needs, with their live status
1532
- * @description Every record required for the domain to work, each checked against live DNS. Poll this after publishing them.
1533
- *
1534
- * `state` is per record: `found`, `missing` (not published yet — the expected state before you add it, never an error), `mismatch` (something else is there), or `unknown` (we could not check — never a statement about your DNS). `summary.complete` is true only when every record is `found`.
1535
- *
1536
- * A wildcard needs three records; an exact host needs one. Each call performs live DNS lookups and is rate limited.
1537
- */
1538
- get: {
1539
- parameters: {
1540
- query?: never;
1541
- header?: never;
1542
- path: {
1543
- spaceId: string;
1544
- cubeId: string;
1545
- mappingId: string;
1546
- };
1547
- cookie?: never;
1548
- };
1549
- requestBody?: never;
1550
- responses: {
1551
- /** @description Required records with live status */
1552
- 200: {
1553
- headers: {
1554
- [name: string]: unknown;
1555
- };
1556
- content: {
1557
- "application/json": {
1558
- /** Format: date-time */
1559
- checkedAt: string;
1560
- domain: string;
1561
- isWildcard: boolean;
1562
- records: components["schemas"]["DnsRecordStatus"][];
1563
- summary: {
1564
- complete: boolean;
1565
- found: number;
1566
- total: number;
1567
- };
1568
- };
1569
- };
1570
- };
1571
- 404: components["responses"]["NotFound"];
1572
- 429: components["responses"]["RateLimited"];
1573
- };
1574
- };
1575
- put?: never;
1576
- post?: never;
1577
- delete?: never;
1578
- options?: never;
1579
- head?: never;
1580
- patch?: never;
1581
- trace?: never;
1582
- };
1583
- "/spaces/{spaceId}/cubes/{cubeId}/power-off": {
1584
- parameters: {
1585
- query?: never;
1586
- header?: never;
1587
- path?: never;
1588
- cookie?: never;
1589
- };
1590
- get?: never;
1591
- put?: never;
1592
- /** Power off a running Cube */
1593
- post: {
1594
- parameters: {
1595
- query?: never;
1596
- header?: never;
1597
- path: {
1598
- spaceId: string;
1599
- cubeId: string;
1600
- };
1601
- cookie?: never;
1602
- };
1603
- requestBody?: never;
1604
- responses: {
1605
- /** @description Power off enqueued */
1606
- 200: {
1607
- headers: {
1608
- [name: string]: unknown;
1609
- };
1610
- content?: never;
1611
- };
1612
- 404: components["responses"]["NotFound"];
1613
- 429: components["responses"]["RateLimited"];
1614
- };
1615
- };
1616
- delete?: never;
1617
- options?: never;
1618
- head?: never;
1619
- patch?: never;
1620
- trace?: never;
1621
- };
1622
- "/spaces/{spaceId}/cubes/{cubeId}/restart": {
1623
- parameters: {
1624
- query?: never;
1625
- header?: never;
1626
- path?: never;
1627
- cookie?: never;
1628
- };
1629
- get?: never;
1630
- put?: never;
1631
- /**
1632
- * Restart a running Cube
1633
- * @description Cold-restarts the Cube: the hypervisor process is stopped and relaunched, so the Cube boots against the host's current kernel. This is how a Cube picks up a refreshed guest kernel after a platform image update — a `reboot` issued inside the Cube cannot do it, because the kernel is supplied externally by the host. Disk state is preserved; only the kernel changes. Cube must be `running` (a stopped Cube already picks up the latest kernel when started). Concurrent restarts of the same Cube are rejected with 409 rather than queued twice.
1634
- */
1635
- post: {
1636
- parameters: {
1637
- query?: never;
1638
- header?: never;
1639
- path: {
1640
- spaceId: string;
1641
- cubeId: string;
1642
- };
1643
- cookie?: never;
1644
- };
1645
- requestBody?: never;
1646
- responses: {
1647
- /** @description Restart enqueued */
1648
- 200: {
1649
- headers: {
1650
- [name: string]: unknown;
1651
- };
1652
- content?: never;
1653
- };
1654
- 404: components["responses"]["NotFound"];
1655
- /** @description Cube is not running, or a restart is already in progress */
1656
- 409: {
1657
- headers: {
1658
- [name: string]: unknown;
1659
- };
1660
- content?: never;
1661
- };
1662
- 429: components["responses"]["RateLimited"];
1663
- };
1664
- };
1665
- delete?: never;
1666
- options?: never;
1667
- head?: never;
1668
- patch?: never;
1669
- trace?: never;
1670
- };
1671
- "/spaces/{spaceId}/cubes/{cubeId}/restore": {
1672
- parameters: {
1673
- query?: never;
1674
- header?: never;
1675
- path?: never;
1676
- cookie?: never;
1677
- };
1678
- get?: never;
1679
- put?: never;
1680
- /** Restore a Cube from a snapshot */
1681
- post: {
1682
- parameters: {
1683
- query?: never;
1684
- header?: never;
1685
- path: {
1686
- spaceId: string;
1687
- cubeId: string;
1688
- };
1689
- cookie?: never;
1690
- };
1691
- requestBody: {
1692
- content: {
1693
- "application/json": {
1694
- snapshotId: string;
1695
- };
1696
- };
1697
- };
1698
- responses: {
1699
- /** @description Restore enqueued */
1700
- 200: {
1701
- headers: {
1702
- [name: string]: unknown;
1703
- };
1704
- content: {
1705
- "application/json": {
1706
- success: boolean;
1707
- };
1708
- };
1709
- };
1710
- 404: components["responses"]["NotFound"];
1711
- };
1712
- };
1713
- delete?: never;
1714
- options?: never;
1715
- head?: never;
1716
- patch?: never;
1717
- trace?: never;
1718
- };
1719
- "/spaces/{spaceId}/cubes/{cubeId}/snapshots": {
1720
- parameters: {
1721
- query?: never;
1722
- header?: never;
1723
- path?: never;
1724
- cookie?: never;
1725
- };
1726
- /** List snapshots for a Cube */
1727
- get: {
1728
- parameters: {
1729
- query?: never;
1730
- header?: never;
1731
- path: {
1732
- spaceId: string;
1733
- cubeId: string;
1734
- };
1735
- cookie?: never;
1736
- };
1737
- requestBody?: never;
1738
- responses: {
1739
- /** @description Snapshot list */
1740
- 200: {
1741
- headers: {
1742
- [name: string]: unknown;
1743
- };
1744
- content: {
1745
- "application/json": {
1746
- snapshots: components["schemas"]["Snapshot"][];
1747
- };
1748
- };
1749
- };
1750
- };
1751
- };
1752
- put?: never;
1753
- /** Create a snapshot */
1754
- post: {
1755
- parameters: {
1756
- query?: never;
1757
- header?: {
1758
- /** @description Optional unique key (max 255 chars). Replays return the original response and add header Idempotency-Replayed: true. Scoped per space; expires after 24h. */
1759
- "Idempotency-Key"?: string;
1760
- };
1761
- path: {
1762
- spaceId: string;
1763
- cubeId: string;
1764
- };
1765
- cookie?: never;
1766
- };
1767
- requestBody?: {
1768
- content: {
1769
- "application/json": {
1770
- name?: string;
1771
- };
1772
- };
1773
- };
1774
- responses: {
1775
- /** @description Snapshot enqueued */
1776
- 201: {
1777
- headers: {
1778
- [name: string]: unknown;
1779
- };
1780
- content: {
1781
- "application/json": {
1782
- snapshot: components["schemas"]["Snapshot"];
1783
- };
1784
- };
1785
- };
1786
- 429: components["responses"]["RateLimited"];
1787
- };
1788
- };
1789
- delete?: never;
1790
- options?: never;
1791
- head?: never;
1792
- patch?: never;
1793
- trace?: never;
1794
- };
1795
- "/spaces/{spaceId}/cubes/{cubeId}/snapshots/{snapshotId}": {
1796
- parameters: {
1797
- query?: never;
1798
- header?: never;
1799
- path?: never;
1800
- cookie?: never;
1801
- };
1802
- get?: never;
1803
- put?: never;
1804
- post?: never;
1805
- /** Delete a snapshot */
1806
- delete: {
1807
- parameters: {
1808
- query?: never;
1809
- header?: never;
1810
- path: {
1811
- spaceId: string;
1812
- cubeId: string;
1813
- snapshotId: string;
1814
- };
1815
- cookie?: never;
1816
- };
1817
- requestBody?: never;
1818
- responses: {
1819
- /** @description Deleted */
1820
- 200: {
1821
- headers: {
1822
- [name: string]: unknown;
1823
- };
1824
- content: {
1825
- "application/json": {
1826
- success: boolean;
1827
- };
1828
- };
1829
- };
1830
- 404: components["responses"]["NotFound"];
1831
- };
1832
- };
1833
- options?: never;
1834
- head?: never;
1835
- patch?: never;
1836
- trace?: never;
1837
- };
1838
- "/spaces/{spaceId}/cubes/{cubeId}/ssh": {
1839
- parameters: {
1840
- query?: never;
1841
- header?: never;
1842
- path?: never;
1843
- cookie?: never;
1844
- };
1845
- /**
1846
- * Get a Cube's SSH connection info
1847
- * @description Host (server public IPv4), host SSH port, login user, and the Cube's captured SSH host public keys. **Use `user` rather than assuming a username** — it is `ubuntu` or `debian` on Cubes created from images that ship a default user, and `root` on Cubes created before that change or imported from a rootfs without one. `hostKeys` is empty only until the reachability cron makes its first capture; clients fall back to trust-on-first-use until then, and pin strictly afterwards.
1848
- */
1849
- get: {
1850
- parameters: {
1851
- query?: never;
1852
- header?: never;
1853
- path: {
1854
- spaceId: string;
1855
- cubeId: string;
1856
- };
1857
- cookie?: never;
1858
- };
1859
- requestBody?: never;
1860
- responses: {
1861
- /** @description SSH connection info */
1862
- 200: {
1863
- headers: {
1864
- [name: string]: unknown;
1865
- };
1866
- content: {
1867
- "application/json": components["schemas"]["CubeSshInfo"];
1868
- };
1869
- };
1870
- 404: components["responses"]["NotFound"];
1871
- };
1872
- };
1873
- put?: never;
1874
- post?: never;
1875
- delete?: never;
1876
- options?: never;
1877
- head?: never;
1878
- patch?: never;
1879
- trace?: never;
1880
- };
1881
- "/spaces/{spaceId}/cubes/{cubeId}/ssh-port": {
1882
- parameters: {
1883
- query?: never;
1884
- header?: never;
1885
- path?: never;
1886
- cookie?: never;
1887
- };
1888
- get?: never;
1889
- /**
1890
- * Change a Cube's SSH port
1891
- * @description Sets the port INSIDE the Cube that SSH is forwarded to — NOT the host port you connect to. The host port is allocated by Krova and is unchanged by this call. Pointing this at a port nothing is listening on inside the Cube will make SSH unreachable; the default is 22. The change is applied atomically (the old port mapping is replaced).
1892
- */
1893
- put: {
1894
- parameters: {
1895
- query?: never;
1896
- header?: never;
1897
- path: {
1898
- spaceId: string;
1899
- cubeId: string;
1900
- };
1901
- cookie?: never;
1902
- };
1903
- requestBody: {
1904
- content: {
1905
- "application/json": {
1906
- /** @description The port inside the Cube that sshd listens on (default 22). This is the Cube side of the mapping, not the host port. */
1907
- cubePort: number;
1908
- };
1909
- };
1910
- };
1911
- responses: {
1912
- /** @description SSH port updated */
1913
- 200: {
1914
- headers: {
1915
- [name: string]: unknown;
1916
- };
1917
- content?: never;
1918
- };
1919
- 400: components["responses"]["BadRequest"];
1920
- 404: components["responses"]["NotFound"];
1921
- /** @description Refused because the change conflicts with the Cube's current state, for example the port is already in use or the mapping is already being removed. One such conflict is temporary: in the last stretch of a move of the Cube to another server the change is refused with the error "This cube is being moved to another server. Try again in a minute." Nothing was changed then, and the same request is accepted once the move ends. */
1922
- 409: {
1923
- headers: {
1924
- [name: string]: unknown;
1925
- };
1926
- content?: never;
1927
- };
1928
- 429: components["responses"]["RateLimited"];
1929
- };
1930
- };
1931
- post?: never;
1932
- delete?: never;
1933
- options?: never;
1934
- head?: never;
1935
- patch?: never;
1936
- trace?: never;
1937
- };
1938
- "/spaces/{spaceId}/cubes/{cubeId}/tcp-mappings": {
1939
- parameters: {
1940
- query?: never;
1941
- header?: never;
1942
- path?: never;
1943
- cookie?: never;
1944
- };
1945
- /** List TCP port forwards for a Cube */
1946
- get: {
1947
- parameters: {
1948
- query?: never;
1949
- header?: never;
1950
- path: {
1951
- spaceId: string;
1952
- cubeId: string;
1953
- };
1954
- cookie?: never;
1955
- };
1956
- requestBody?: never;
1957
- responses: {
1958
- /** @description TCP mapping list */
1959
- 200: {
1960
- headers: {
1961
- [name: string]: unknown;
1962
- };
1963
- content: {
1964
- "application/json": {
1965
- tcpMappings: components["schemas"]["TcpMapping"][];
1966
- };
1967
- };
1968
- };
1969
- };
1970
- };
1971
- put?: never;
1972
- /** Create a TCP port forward */
1973
- post: {
1974
- parameters: {
1975
- query?: never;
1976
- header?: {
1977
- /** @description Optional unique key (max 255 chars). Replays return the original response and add header Idempotency-Replayed: true. Scoped per space; expires after 24h. */
1978
- "Idempotency-Key"?: string;
1979
- };
1980
- path: {
1981
- spaceId: string;
1982
- cubeId: string;
1983
- };
1984
- cookie?: never;
1985
- };
1986
- requestBody: {
1987
- content: {
1988
- "application/json": {
1989
- cubePort: number;
1990
- /** @description Optional human label for the mapping. */
1991
- label?: string;
1992
- /**
1993
- * @description Also forward UDP on this port. Defaults to true. Always false for the platform SSH mapping. The allowlist, if you send one, applies to both protocols.
1994
- * @default true
1995
- */
1996
- udpEnabled?: boolean;
1997
- /**
1998
- * @deprecated
1999
- * @description DEPRECATED alias for `whitelistedIps`, accepted for backwards compatibility. `whitelistedIps` wins if both are sent. Use `whitelistedIps` in new code.
2000
- */
2001
- whitelistIps?: string[];
2002
- /** @description IPs/CIDRs allowed to reach the published port. Omit or send an empty array to leave the port open to the internet. */
2003
- whitelistedIps?: string[];
2004
- };
2005
- };
2006
- };
2007
- responses: {
2008
- /** @description Mapping created */
2009
- 201: {
2010
- headers: {
2011
- [name: string]: unknown;
2012
- };
2013
- content: {
2014
- "application/json": {
2015
- tcpMapping: components["schemas"]["TcpMapping"];
2016
- };
2017
- };
2018
- };
2019
- 400: components["responses"]["BadRequest"];
2020
- /** @description Refused because the change conflicts with the Cube's current state, for example the port is already in use or the mapping is already being removed. One such conflict is temporary: in the last stretch of a move of the Cube to another server the change is refused with the error "This cube is being moved to another server. Try again in a minute." Nothing was changed then, and the same request is accepted once the move ends. */
2021
- 409: {
2022
- headers: {
2023
- [name: string]: unknown;
2024
- };
2025
- content?: never;
2026
- };
2027
- 429: components["responses"]["RateLimited"];
2028
- };
2029
- };
2030
- delete?: never;
2031
- options?: never;
2032
- head?: never;
2033
- patch?: never;
2034
- trace?: never;
2035
- };
2036
- "/spaces/{spaceId}/cubes/{cubeId}/tcp-mappings/{mappingId}": {
2037
- parameters: {
2038
- query?: never;
2039
- header?: never;
2040
- path?: never;
2041
- cookie?: never;
2042
- };
2043
- get?: never;
2044
- put?: never;
2045
- post?: never;
2046
- /** Delete a TCP port forward */
2047
- delete: {
2048
- parameters: {
2049
- query?: never;
2050
- header?: never;
2051
- path: {
2052
- spaceId: string;
2053
- cubeId: string;
2054
- mappingId: string;
2055
- };
2056
- cookie?: never;
2057
- };
2058
- requestBody?: never;
2059
- responses: {
2060
- /** @description Deleted */
2061
- 200: {
2062
- headers: {
2063
- [name: string]: unknown;
2064
- };
2065
- content: {
2066
- "application/json": {
2067
- success: boolean;
2068
- };
2069
- };
2070
- };
2071
- 404: components["responses"]["NotFound"];
2072
- /** @description Refused because the change conflicts with the Cube's current state, for example the port is already in use or the mapping is already being removed. One such conflict is temporary: in the last stretch of a move of the Cube to another server the change is refused with the error "This cube is being moved to another server. Try again in a minute." Nothing was changed then, and the same request is accepted once the move ends. */
2073
- 409: {
2074
- headers: {
2075
- [name: string]: unknown;
2076
- };
2077
- content?: never;
2078
- };
2079
- };
2080
- };
2081
- options?: never;
2082
- head?: never;
2083
- patch?: never;
2084
- trace?: never;
2085
- };
2086
- "/spaces/{spaceId}/cubes/{cubeId}/wake": {
2087
- parameters: {
2088
- query?: never;
2089
- header?: never;
2090
- path?: never;
2091
- cookie?: never;
2092
- };
2093
- get?: never;
2094
- put?: never;
2095
- /** Start a stopped Cube */
2096
- post: {
2097
- parameters: {
2098
- query?: never;
2099
- header?: never;
2100
- path: {
2101
- spaceId: string;
2102
- cubeId: string;
2103
- };
2104
- cookie?: never;
2105
- };
2106
- requestBody?: never;
2107
- responses: {
2108
- /** @description Start enqueued */
2109
- 200: {
2110
- headers: {
2111
- [name: string]: unknown;
2112
- };
2113
- content?: never;
2114
- };
2115
- 404: components["responses"]["NotFound"];
2116
- 429: components["responses"]["RateLimited"];
2117
- };
2118
- };
2119
- delete?: never;
2120
- options?: never;
2121
- head?: never;
2122
- patch?: never;
2123
- trace?: never;
2124
- };
2125
- "/spaces/{spaceId}/webhooks": {
2126
- parameters: {
2127
- query?: never;
2128
- header?: never;
2129
- path?: never;
2130
- cookie?: never;
2131
- };
2132
- /** List webhook endpoints */
2133
- get: {
2134
- parameters: {
2135
- query?: never;
2136
- header?: never;
2137
- path: {
2138
- spaceId: string;
2139
- };
2140
- cookie?: never;
2141
- };
2142
- requestBody?: never;
2143
- responses: {
2144
- /** @description Webhook list */
2145
- 200: {
2146
- headers: {
2147
- [name: string]: unknown;
2148
- };
2149
- content?: never;
2150
- };
2151
- };
2152
- };
2153
- put?: never;
2154
- /** Create a webhook endpoint (signing secret returned once) */
2155
- post: {
2156
- parameters: {
2157
- query?: never;
2158
- header?: never;
2159
- path: {
2160
- spaceId: string;
2161
- };
2162
- cookie?: never;
2163
- };
2164
- requestBody: {
2165
- content: {
2166
- "application/json": {
2167
- events: ("cube.created" | "cube.running" | "cube.stopped" | "cube.error" | "cube.deleted" | "cube.cold_restarted" | "cube.transfer.started" | "cube.transfer.completed" | "cube.transfer.failed" | "cube.resize.started" | "cube.resize.completed" | "cube.resize.failed" | "resource.alert.memory" | "resource.alert.cpu" | "resource.alert.disk" | "domain.alert.error_4xx" | "domain.alert.error_5xx" | "cube.space_transferred" | "cube.space_transfer.requested" | "cube.space_transfer.accepted" | "cube.space_transfer.declined" | "cube.space_transfer.cancelled" | "cube.space_transfer.expired" | "snapshot.created" | "snapshot.restored" | "snapshot.deleted" | "snapshot.pinned" | "snapshot.promoted_to_backup" | "snapshot.exported" | "backup.created" | "backup.deleted" | "backup.redeployed" | "backup.share.requested" | "backup.share.accepted" | "backup.share.declined" | "backup.share.canceled" | "backup.share.expired" | "domain.added" | "domain.active" | "domain.removed" | "tcp_mapping.added" | "tcp_mapping.removed" | "tcp_mapping.updated" | "hosting.provisioned" | "hosting.suspended" | "hosting.unsuspended" | "hosting.deleted" | "hosting.plan_changed" | "hosting.renewed" | "hosting.cancellation_scheduled" | "hosting.suspended_for_non_payment" | "hosting.deleted_after_recovery" | "member.invited" | "member.joined" | "member.removed" | "member.role_changed")[];
2168
- /** Format: uri */
2169
- url: string;
2170
- };
2171
- };
2172
- };
2173
- responses: {
2174
- /** @description Webhook created (response includes secret) */
2175
- 201: {
2176
- headers: {
2177
- [name: string]: unknown;
2178
- };
2179
- content?: never;
2180
- };
2181
- 400: components["responses"]["BadRequest"];
2182
- 429: components["responses"]["RateLimited"];
2183
- };
2184
- };
2185
- delete?: never;
2186
- options?: never;
2187
- head?: never;
2188
- patch?: never;
2189
- trace?: never;
2190
- };
2191
- "/spaces/{spaceId}/webhooks/{endpointId}": {
2192
- parameters: {
2193
- query?: never;
2194
- header?: never;
2195
- path?: never;
2196
- cookie?: never;
2197
- };
2198
- /** Get a webhook (no secret) */
2199
- get: {
2200
- parameters: {
2201
- query?: never;
2202
- header?: never;
2203
- path: {
2204
- spaceId: string;
2205
- endpointId: string;
2206
- };
2207
- cookie?: never;
2208
- };
2209
- requestBody?: never;
2210
- responses: {
2211
- /** @description Webhook */
2212
- 200: {
2213
- headers: {
2214
- [name: string]: unknown;
2215
- };
2216
- content?: never;
2217
- };
2218
- };
2219
- };
2220
- put?: never;
2221
- post?: never;
2222
- /** Delete a webhook (cascades deliveries) */
2223
- delete: {
2224
- parameters: {
2225
- query?: never;
2226
- header?: never;
2227
- path: {
2228
- spaceId: string;
2229
- endpointId: string;
2230
- };
2231
- cookie?: never;
2232
- };
2233
- requestBody?: never;
2234
- responses: {
2235
- /** @description Deleted */
2236
- 200: {
2237
- headers: {
2238
- [name: string]: unknown;
2239
- };
2240
- content?: never;
2241
- };
2242
- 429: components["responses"]["RateLimited"];
2243
- };
2244
- };
2245
- options?: never;
2246
- head?: never;
2247
- patch?: never;
2248
- trace?: never;
2249
- };
2250
- "/spaces/{spaceId}/webhooks/{endpointId}/deliveries": {
2251
- parameters: {
2252
- query?: never;
2253
- header?: never;
2254
- path?: never;
2255
- cookie?: never;
2256
- };
2257
- /** Last 30 days of webhook delivery history (max 100) */
2258
- get: {
2259
- parameters: {
2260
- query?: {
2261
- limit?: number;
2262
- };
2263
- header?: never;
2264
- path: {
2265
- spaceId: string;
2266
- endpointId: string;
2267
- };
2268
- cookie?: never;
2269
- };
2270
- requestBody?: never;
2271
- responses: {
2272
- /** @description Delivery list */
2273
- 200: {
2274
- headers: {
2275
- [name: string]: unknown;
2276
- };
2277
- content?: never;
2278
- };
2279
- };
2280
- };
2281
- put?: never;
2282
- post?: never;
2283
- delete?: never;
2284
- options?: never;
2285
- head?: never;
2286
- patch?: never;
2287
- trace?: never;
2288
- };
2289
- }
2290
- interface components {
2291
- schemas: {
2292
- Backup: {
2293
- /** Format: date-time */
2294
- completedAt: string | null;
2295
- /** @description The Cube configuration captured with the backup, used by redeploy. A shared copy carries no domains. */
2296
- config: {
2297
- diskLimitGb: number | null;
2298
- domains: {
2299
- domain: string;
2300
- port: number;
2301
- }[];
2302
- imageId: string | null;
2303
- ramMb: number | null;
2304
- regionId: string | null;
2305
- regionName: string | null;
2306
- tcpPorts: {
2307
- cubePort: number;
2308
- label: string | null;
2309
- }[];
2310
- vcpus: number | null;
2311
- };
2312
- /** Format: date-time */
2313
- createdAt: string;
2314
- diskSizeGb: number;
2315
- id: string;
2316
- name: string;
2317
- originalCubeId: string;
2318
- originalCubeName: string;
2319
- redeployedCubeId: string | null;
2320
- /** @description Set on a shared copy: the backup it was shared from, which may since have been deleted. Null for a backup this space made itself. */
2321
- sharedFromBackupId: string | null;
2322
- sizeBytes: number | null;
2323
- /** @enum {string} */
2324
- status: "pending" | "creating" | "complete" | "failed";
2325
- };
2326
- BackupShare: {
2327
- /** @description The SOURCE backup being shared. */
2328
- backupId: string;
2329
- backupName: string;
2330
- /** @description The destination space's own copy, once the share is accepted. */
2331
- copyBackupId: string | null;
2332
- /** @description The other space in this share: the destination on an outgoing share, the source on an incoming one. */
2333
- counterpartySpaceName: string;
2334
- /** Format: date-time */
2335
- createdAt: string;
2336
- destinationSpaceId: string;
2337
- /** Format: date-time */
2338
- expiresAt: string;
2339
- id: string;
2340
- sourceSpaceId: string;
2341
- /** @enum {string} */
2342
- status: "pending" | "accepted" | "declined" | "canceled" | "expired";
2343
- };
2344
- Cube: {
2345
- costPerHour: number;
2346
- /** Format: date-time */
2347
- createdAt: string;
2348
- id: string;
2349
- image: string;
2350
- name: string;
2351
- publicIpv4: string | null;
2352
- resources: {
2353
- diskGb: number;
2354
- ramGb: number;
2355
- vcpu: number;
2356
- };
2357
- /** @description The hostname of the server currently hosting this Cube (e.g. `mango.krova.cloud`), shared by every Cube on that server. This is NOT the Cube's own SSH target — use `host` from GET .../ssh for that, which is the Cube's own stable hostname and survives migration to another server. Null when the Cube has no server assigned. Only present on the single-Cube GET; list and create responses omit it. */
2358
- serverDomain?: string | null;
2359
- sshUser: string;
2360
- /** @enum {string} */
2361
- state: "pending" | "booting" | "running" | "stopped" | "stopping" | "resizing" | "error" | "deleted";
2362
- /** @description Per-cube opt-in flag. When true, customer-initiated destroy paths return 409 with `error.code = "termination_protected"`. Power-off, wake, restart, restore, network-reset, and snapshot ops are NOT termination and remain allowed. Default false. */
2363
- terminationProtection: boolean;
2364
- /**
2365
- * Format: date-time
2366
- * @description ISO8601 timestamp of the most recent toggle of `terminationProtection`. Null when the flag has never been turned on.
2367
- */
2368
- terminationProtectionChangedAt: string | null;
2369
- /** @description Identifies the actor that last toggled the flag: `"user:<id>"` for a customer, `"admin:<id>"` for an operator, `"system:<job-name>"` for a worker-driven write. Null when the flag has never been turned on. */
2370
- terminationProtectionChangedBy: string | null;
2371
- /** Format: date-time */
2372
- updatedAt: string;
2373
- };
2374
- CubeSshInfo: {
2375
- host: string | null;
2376
- hostKeys: {
2377
- key: string;
2378
- type: string;
2379
- }[];
2380
- port: number;
2381
- user: string;
2382
- };
2383
- DnsRecord: {
2384
- host: string;
2385
- /** @enum {string} */
2386
- id: "ownership" | "routing" | "certificate";
2387
- mustBeGrey: boolean;
2388
- note?: string | null;
2389
- proxyOk: boolean;
2390
- /** @enum {string} */
2391
- purpose: "ownership" | "routing" | "certificate";
2392
- /** @enum {string} */
2393
- type: "CNAME" | "TXT" | "A";
2394
- value: string;
2395
- };
2396
- DnsRecordStatus: {
2397
- detail: string;
2398
- host: string;
2399
- id: string;
2400
- mustBeGrey?: boolean;
2401
- note?: string | null;
2402
- observed?: string[] | null;
2403
- proxyOk?: boolean;
2404
- purpose: string;
2405
- /** @enum {string} */
2406
- state: "found" | "missing" | "mismatch" | "unknown";
2407
- /** @enum {string} */
2408
- type: "CNAME" | "TXT" | "A";
2409
- value: string;
2410
- };
2411
- Domain: {
2412
- acmeDelegationTarget: string | null;
2413
- basicAuthEnabled: boolean;
2414
- basicAuthUser: string | null;
2415
- corsConfig: Record<string, never> | null;
2416
- /** Format: date-time */
2417
- createdAt: string;
2418
- cubeId: string;
2419
- domain: string;
2420
- id: string;
2421
- ingressStatus: string | null;
2422
- ipAllowList: string[] | null;
2423
- ipDenyList: string[] | null;
2424
- isWildcard: boolean;
2425
- maxRequestBodyMb: number | null;
2426
- /** @enum {string} */
2427
- originScheme: "http" | "https";
2428
- port: number | null;
2429
- /** @enum {string|null} */
2430
- proxyProtocol: "v1" | "v2" | null;
2431
- /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
2432
- requestHeaderOverrides: {
2433
- remove?: string[];
2434
- set?: {
2435
- [key: string]: string;
2436
- };
2437
- } | null;
2438
- responseCompression: boolean;
2439
- /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
2440
- responseHeaderOverrides: {
2441
- remove?: string[];
2442
- set?: {
2443
- [key: string]: string;
2444
- };
2445
- } | null;
2446
- responseHeaderTimeoutSecs: number;
2447
- /** @enum {string} */
2448
- securityHeadersMode: "enforced" | "app_managed";
2449
- status: string;
2450
- /** Format: date-time */
2451
- updatedAt: string;
2452
- /** @enum {string|null} */
2453
- wildcardCertState: "pending_delegation" | "issuing" | "ready" | "failed" | null;
2454
- };
2455
- Error: {
2456
- error: string;
2457
- };
2458
- Image: {
2459
- defaultUser: string;
2460
- description: string;
2461
- id: string;
2462
- name: string;
2463
- version: string;
2464
- };
2465
- Pagination: {
2466
- limit: number;
2467
- page: number;
2468
- total: number;
2469
- totalPages: number;
2470
- };
2471
- PricingTier: {
2472
- label: string;
2473
- maxVcpus: number | null;
2474
- minVcpus: number;
2475
- multiplier: number;
2476
- };
2477
- Region: {
2478
- id: string;
2479
- name: string;
2480
- slug: string;
2481
- };
2482
- Snapshot: {
2483
- /** Format: date-time */
2484
- createdAt: string;
2485
- cubeId: string;
2486
- id: string;
2487
- kind: string;
2488
- name: string;
2489
- sizeBytes: number | null;
2490
- status: string;
2491
- };
2492
- Space: {
2493
- /** Format: date-time */
2494
- createdAt: string;
2495
- id: string;
2496
- name: string;
2497
- tier: string;
2498
- };
2499
- TcpMapping: {
2500
- /** Format: date-time */
2501
- createdAt: string;
2502
- cubeId: string;
2503
- cubePort: number;
2504
- /** @description Where to connect for this mapping: `host:hostPort`. The Cube's own stable hostname, which survives migration to another server, falling back to the server's public IP when the Cube has no DNS record yet. Identical to `host` from GET .../ssh, and the same value for every mapping on a Cube. Null only when the Cube has no server assigned, in which case there is nowhere to connect. Do NOT use `serverDomain` from the Cube object — that is the current physical host and changes when the Cube moves. */
2505
- host?: string | null;
2506
- hostPort: number;
2507
- id: string;
2508
- isSsh: boolean;
2509
- label: string | null;
2510
- status: string;
2511
- /** @description Whether this mapping also forwards UDP on the same host port. True means TCP and UDP; false means TCP only. Always false for the platform SSH mapping. */
2512
- udpEnabled: boolean;
2513
- /** Format: date-time */
2514
- updatedAt: string;
2515
- whitelistedIps: {
2516
- cidr: string;
2517
- id: string;
2518
- }[];
2519
- };
2520
- Webhook: {
2521
- /** Format: date-time */
2522
- createdAt: string;
2523
- enabled: boolean;
2524
- events: string[];
2525
- id: string;
2526
- /** Format: date-time */
2527
- updatedAt: string;
2528
- /** Format: uri */
2529
- url: string;
2530
- };
2531
- WebhookDelivery: {
2532
- attempts: number;
2533
- /** Format: date-time */
2534
- createdAt: string;
2535
- event: string;
2536
- id: string;
2537
- /** Format: date-time */
2538
- lastAttemptAt: string | null;
2539
- responseStatus: number | null;
2540
- /** @enum {string} */
2541
- status: "pending" | "delivered" | "failed";
2542
- };
2543
- };
2544
- responses: {
2545
- /** @description Bad request */
2546
- BadRequest: {
2547
- headers: {
2548
- [name: string]: unknown;
2549
- };
2550
- content: {
2551
- "application/json": components["schemas"]["Error"];
2552
- };
2553
- };
2554
- /** @description Authenticated but lacks the required permission */
2555
- Forbidden: {
2556
- headers: {
2557
- [name: string]: unknown;
2558
- };
2559
- content: {
2560
- "application/json": components["schemas"]["Error"];
2561
- };
2562
- };
2563
- /** @description Resource not found */
2564
- NotFound: {
2565
- headers: {
2566
- [name: string]: unknown;
2567
- };
2568
- content: {
2569
- "application/json": components["schemas"]["Error"];
2570
- };
2571
- };
2572
- /** @description Rate limit exceeded (10 mutations / 60s) */
2573
- RateLimited: {
2574
- headers: {
2575
- [name: string]: unknown;
2576
- };
2577
- content: {
2578
- "application/json": components["schemas"]["Error"];
2579
- };
2580
- };
2581
- /** @description Missing or invalid API key */
2582
- Unauthorized: {
2583
- headers: {
2584
- [name: string]: unknown;
2585
- };
2586
- content: {
2587
- "application/json": components["schemas"]["Error"];
2588
- };
2589
- };
2590
- };
2591
- parameters: never;
2592
- requestBodies: never;
2593
- headers: never;
2594
- pathItems: never;
2595
- }
2596
- /** The Cube resource, as defined in the Krova Cloud OpenAPI spec. */
2597
- type Cube = components["schemas"]["Cube"];
2598
- /** A region with available capacity (from the catalog). */
2599
- type Region = components["schemas"]["Region"];
2600
- /** A selectable OS image (from the catalog). */
2601
- type Image = components["schemas"]["Image"];
2602
- /** A volume-pricing tier (from the catalog). */
2603
- type PricingTier = components["schemas"]["PricingTier"];
2604
- /** Pagination envelope returned alongside a Cube list. */
2605
- type Pagination = components["schemas"]["Pagination"];
2606
- /** A Space — the tenancy an API key is scoped to. */
2607
- type Space = components["schemas"]["Space"];
2608
- /** A Cube's SSH connection info (host, port, user, and pinned host keys). */
2609
- type CubeSshInfo = components["schemas"]["CubeSshInfo"];
2610
- /** A custom domain attached to a Cube. */
2611
- type Domain = components["schemas"]["Domain"];
2612
- /**
2613
- * One DNS record you must publish for a domain to work.
2614
- *
2615
- * An ordinary subdomain needs one CNAME. A wildcard needs three: an ownership
2616
- * TXT, the routing CNAME, and an `_acme-challenge` CNAME that lets Krova issue
2617
- * and renew its certificate.
2618
- *
2619
- * ⛔ `mustBeGrey` and `proxyOk` are deliberate OPPOSITES, and automation needs
2620
- * both. The routing record may sit behind Cloudflare's proxy (orange); the
2621
- * `_acme-challenge` record must not, because a proxied one answers with
2622
- * Cloudflare's addresses and the certificate authority finds nothing there.
2623
- */
2624
- type DnsRecord = components["schemas"]["DnsRecord"];
2625
- /**
2626
- * A {@link DnsRecord} plus what Krova can currently see in public DNS.
2627
- *
2628
- * ⛔ `state: "missing"` means NOT PUBLISHED YET — the expected state before you
2629
- * create the record, never an error. `state: "unknown"` means Krova could not
2630
- * complete the lookup, which is never a statement about your DNS. Surfacing
2631
- * either to your own users as a failure would be wrong.
2632
- */
2633
- type DnsRecordStatus = components["schemas"]["DnsRecordStatus"];
2634
- /** A snapshot of a Cube's disk. */
2635
- type Snapshot = components["schemas"]["Snapshot"];
2636
- /** A TCP port mapping exposing a Cube port on the host. */
2637
- type TcpMapping = components["schemas"]["TcpMapping"];
2638
- /**
2639
- * A backup: a Cube's disk and configuration, kept after the Cube is gone and
2640
- * redeployable as a new Cube. `sharedFromBackupId` is set on a copy another
2641
- * space shared with this one.
2642
- */
2643
- type Backup = components["schemas"]["Backup"];
2644
- /**
2645
- * A request to give another space its own copy of a backup.
2646
- *
2647
- * `counterpartySpaceName` is the other side: the destination on an outgoing
2648
- * share, the source on an incoming one. `copyBackupId` is set once accepted.
2649
- */
2650
- type BackupShare = components["schemas"]["BackupShare"];
2651
- /** Pending, unexpired backup shares into and out of a space. */
2652
- interface BackupShareList {
2653
- incoming: BackupShare[];
2654
- outgoing: BackupShare[];
2655
- }
2656
- /** An accepted share, and the destination space's new copy. */
2657
- interface AcceptedBackupShare {
2658
- share: BackupShare;
2659
- backup: Backup;
2660
- }
2661
- /** Request body for attaching a custom domain to a Cube. */
2662
- type CreateDomainInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/domains"]["post"]["requestBody"]>["content"]["application/json"];
2663
- /** Request body for updating a custom domain's proxy settings. */
2664
- type UpdateDomainInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/domains/{mappingId}"]["patch"]["requestBody"]>["content"]["application/json"];
2665
- /** Request body for creating a TCP port mapping. */
2666
- type CreateTcpMappingInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/tcp-mappings"]["post"]["requestBody"]>["content"]["application/json"];
2667
- /**
2668
- * Request body for `POST /spaces/{spaceId}/cubes` as defined in the OpenAPI
2669
- * spec, with `terminationProtection` intersected on because the bundled spec
2670
- * does not declare the field but the v1 API accepts it. A boolean `false` (or
2671
- * omission) leaves the Cube in the documented default-unprotected state; `true`
2672
- * opts the Cube out of customer-initiated deletion until the flag is toggled
2673
- * back via `cubes.setTerminationProtection`.
2674
- */
2675
- type CreateCubeInput = NonNullable<paths["/spaces/{spaceId}/cubes"]["post"]["requestBody"]>["content"]["application/json"] & {
2676
- /** Opt this Cube out of customer-initiated deletion (default `false`). */
2677
- terminationProtection?: boolean;
2678
- };
2679
- /**
2680
- * A webhook endpoint subscribed to Space events.
2681
- *
2682
- * ⛔ Runtime discrepancy: the bundled OpenAPI spec does not declare
2683
- * `description`, but `GET /spaces/{spaceId}/webhooks/{endpointId}` includes
2684
- * it as `string | null`. The schema-derived type is extended here so callers
2685
- * reading a single webhook see the field; it is optional so list responses
2686
- * (which omit it) still typecheck.
2687
- */
2688
- type Webhook = components["schemas"]["Webhook"] & {
2689
- description?: string | null;
2690
- };
2691
- /** A recorded webhook delivery attempt (last 30 days of history). */
2692
- type WebhookDelivery = components["schemas"]["WebhookDelivery"];
2693
- /**
2694
- * Request body for creating a webhook endpoint.
2695
- *
2696
- * Derived from `paths["/spaces/{spaceId}/webhooks"]["post"]` exactly like
2697
- * {@link CreateDomainInput}; `description` is intersected on because the
2698
- * bundled spec omits it but the runtime accepts it.
2699
- */
2700
- type CreateWebhookInput = NonNullable<paths["/spaces/{spaceId}/webhooks"]["post"]["requestBody"]>["content"]["application/json"] & {
2701
- /** Optional human-readable label shown on the endpoint. */
2702
- description?: string;
2703
- };
2704
- /** A webhook plus its signing secret. Returned ONLY by {@link KrovaClient.webhooks}.create. */
2705
- type WebhookWithSecret = Webhook & {
2706
- secret: string;
2707
- };
2708
- /** Default API base URL — the single `servers[0].url` from the OpenAPI spec. */
2709
- export declare const DEFAULT_BASE_URL = "https://krova.cloud/api/v1";
2710
- /**
2711
- * How the API key is presented to the server.
2712
- *
2713
- * - `"x-api-key"` (default) — `X-API-KEY: <key>`, matching the spec's
2714
- * `components.securitySchemes.ApiKeyAuth` (an `apiKey` header named
2715
- * `X-API-KEY`).
2716
- * - `"bearer"` — `Authorization: Bearer <key>`, for gateways that expect it.
2717
- */
2718
- type AuthScheme = "x-api-key" | "bearer";
2719
- interface KrovaClientOptions {
2720
- /**
2721
- * Your Krova Cloud API key (a `kro_...` token). Keys are scoped per Space
2722
- * and inherit the permissions of the membership that created them.
2723
- */
2724
- apiKey: string;
2725
- /** Override the API base URL. Defaults to {@link DEFAULT_BASE_URL}. */
2726
- baseUrl?: string;
2727
- /**
2728
- * Auth header scheme. Defaults to `"x-api-key"` (the spec's scheme).
2729
- */
2730
- authScheme?: AuthScheme;
2731
- /**
2732
- * Max automatic retries on retryable statuses (429, 503).
2733
- * Defaults to 2. Set to 0 to disable retries.
2734
- */
2735
- maxRetries?: number;
2736
- /**
2737
- * A custom `fetch` implementation (e.g. for tests or a proxy). Defaults to
2738
- * the global `fetch`.
2739
- */
2740
- fetch?: typeof fetch;
2741
- }
2742
- /**
2743
- * A typed client for the Krova Cloud API.
2
+ * `@krovacloud/sdk` — the official TypeScript SDK for the Krova Cloud API.
2744
3
  *
2745
4
  * @example
2746
5
  * ```ts
2747
- * const krova = new KrovaClient({ apiKey: "kro_..." });
6
+ * import { KrovaClient } from "@krovacloud/sdk";
7
+ *
8
+ * const krova = new KrovaClient({ apiKey: process.env.KROVA_API_KEY! });
2748
9
  * const cubes = await krova.cubes.list("space_123");
2749
10
  * ```
2750
11
  */
2751
- export declare class KrovaClient {
2752
- /**
2753
- * The underlying openapi-fetch client — a fully typed escape hatch to every
2754
- * path in the spec. Returns `{ data, error, response }` and never throws.
2755
- *
2756
- * @example
2757
- * ```ts
2758
- * const { data, error } = await krova.raw.GET(
2759
- * "/spaces/{spaceId}/cubes/{cubeId}",
2760
- * { params: { path: { spaceId, cubeId } } },
2761
- * );
2762
- * ```
2763
- */
2764
- readonly raw: Client<paths>;
2765
- /** The resolved base URL in use. */
2766
- readonly baseUrl: string;
2767
- constructor(options: KrovaClientOptions);
2768
- readonly cubes: {
2769
- /** List Cubes in a Space, with pagination metadata. */
2770
- list: (spaceId: string) => Promise<{
2771
- cubes: {
2772
- costPerHour: number;
2773
- createdAt: string;
2774
- id: string;
2775
- image: string;
2776
- name: string;
2777
- publicIpv4: string | null;
2778
- resources: {
2779
- diskGb: number;
2780
- ramGb: number;
2781
- vcpu: number;
2782
- };
2783
- serverDomain?: string | null;
2784
- sshUser: string;
2785
- state: "pending" | "booting" | "running" | "stopped" | "stopping" | "resizing" | "error" | "deleted";
2786
- terminationProtection: boolean;
2787
- terminationProtectionChangedAt: string | null;
2788
- terminationProtectionChangedBy: string | null;
2789
- updatedAt: string;
2790
- }[];
2791
- pagination: {
2792
- limit: number;
2793
- page: number;
2794
- total: number;
2795
- totalPages: number;
2796
- };
2797
- }>;
2798
- /**
2799
- * Create a Cube. Returns the created {@link Cube}.
2800
- *
2801
- * Set `terminationProtection: true` to opt the Cube out of
2802
- * customer-initiated deletion. The flag is per-Cube; power-off, wake,
2803
- * restart, snapshot, and restore remain allowed regardless.
2804
- *
2805
- * @param spaceId Target Space id.
2806
- * @param body Cube spec — `{ name, image, resources, sshPublicKey, terminationProtection?, ... }`.
2807
- * @param opts Optional `idempotencyKey` (max 255 chars, scoped per space).
2808
- */
2809
- create: (spaceId: string, body: CreateCubeInput, opts?: {
2810
- idempotencyKey?: string;
2811
- }) => Promise<Cube>;
2812
- /** Get a single Cube. Returns the {@link Cube}. */
2813
- get: (spaceId: string, cubeId: string) => Promise<Cube>;
2814
- /**
2815
- * Update the IN-CUBE port that SSH is forwarded to.
2816
- *
2817
- * `cubePort` is the port **inside** the Cube that sshd listens on — NOT the
2818
- * host port you connect to. The host port is allocated by Krova and is not
2819
- * changed by this call. Pointing this at a port nothing is listening on
2820
- * inside the Cube will silently make SSH unreachable; the default is 22.
2821
- *
2822
- * The Krova Cloud API exposes no general Cube-mutation endpoint; the only
2823
- * mutable Cube field over the API is this port, via
2824
- * `PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port`. This helper maps to that
2825
- * endpoint. (Compute resize / rename are not part of the public API.)
2826
- */
2827
- update: (spaceId: string, cubeId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/ssh-port"]["put"]["requestBody"]>["content"]["application/json"]) => Promise<unknown>;
2828
- /**
2829
- * Toggle a Cube's termination-protection flag.
2830
- *
2831
- * The v1 API exposes `PATCH /spaces/{spaceId}/cubes/{cubeId}` with body
2832
- * `{ terminationProtection: boolean }`. The call is idempotent: passing the
2833
- * current value is a no-op server-side (no audit row is written).
2834
- *
2835
- * Returns the updated {@link Cube}, including `terminationProtection`,
2836
- * `terminationProtectionChangedAt`, and `terminationProtectionChangedBy`.
2837
- */
2838
- setTerminationProtection: (spaceId: string, cubeId: string, enabled: boolean) => Promise<Cube>;
2839
- /**
2840
- * Delete a Cube (asynchronous — deletion is enqueued).
2841
- *
2842
- * Throws {@link TerminationProtectedError} when the server returns `409`
2843
- * with `error.code = "termination_protected"` — the Cube had its
2844
- * termination-protection flag set and must be unprotected first. Any other
2845
- * non-2xx response surfaces as a plain {@link KrovaError}.
2846
- */
2847
- delete: (spaceId: string, cubeId: string) => Promise<{
2848
- success: boolean;
2849
- }>;
2850
- /** Power off a running Cube (asynchronous — power-off is enqueued). The Cube
2851
- * becomes `stopped` (its host RAM is freed); start it again with `wake`. */
2852
- powerOff: (spaceId: string, cubeId: string) => Promise<unknown>;
2853
- /** Start a stopped Cube (asynchronous — start is enqueued). */
2854
- /**
2855
- * Restart a Cube (COLD restart).
2856
- *
2857
- * The hypervisor process is stopped and relaunched, so the Cube boots
2858
- * against the host's current kernel. This is the only way a Cube picks up a
2859
- * refreshed guest kernel after a platform image update — a `reboot` issued
2860
- * INSIDE the Cube cannot do it, because Firecracker treats a guest reboot as
2861
- * a shutdown and the kernel is supplied externally by the host.
2862
- *
2863
- * Disk state is preserved; only the kernel changes. The Cube must be
2864
- * `running`. Concurrent restarts of the same Cube are rejected (409) rather
2865
- * than queued twice.
2866
- */
2867
- restart: (spaceId: string, cubeId: string) => Promise<unknown>;
2868
- wake: (spaceId: string, cubeId: string) => Promise<unknown>;
2869
- /**
2870
- * Get a Cube's SSH connection info — host, port, login user, and (when
2871
- * available) the pinned host public keys for strict host-key verification.
2872
- */
2873
- ssh: (spaceId: string, cubeId: string) => Promise<CubeSshInfo>;
2874
- /**
2875
- * Restore a Cube's disk from one of its {@link Snapshot}s (asynchronous —
2876
- * the restore is enqueued). The Cube's current disk is replaced.
2877
- */
2878
- restore: (spaceId: string, cubeId: string, snapshotId: string) => Promise<{
2879
- success: boolean;
2880
- }>;
2881
- };
2882
- /**
2883
- * Resolve the {@link Space} this API key is scoped to — so you don't have to
2884
- * hardcode a `spaceId`. Handy right after constructing the client:
2885
- *
2886
- * @example
2887
- * ```ts
2888
- * const space = await krova.getSpace();
2889
- * const cubes = await krova.cubes.list(space.id);
2890
- * ```
2891
- */
2892
- getSpace(): Promise<Space>;
2893
- readonly domains: {
2894
- /** List the custom domains attached to a Cube. */
2895
- list: (spaceId: string, cubeId: string) => Promise<Domain[]>;
2896
- /**
2897
- * Attach a custom domain to a Cube. `domain` + `port` are required.
2898
- *
2899
- * Returns the domain AND the DNS records you must publish for it to work —
2900
- * so you can create them in the same run, without a second call and without
2901
- * hard-coding record shapes. A wildcard needs three; an exact host needs one.
2902
- *
2903
- * ⛔ BREAKING in 0.4.0: this used to resolve to `Domain`. It now resolves to
2904
- * `{ domain, records }`, because for a wildcard two of the three records
2905
- * (the ownership TXT and the `_acme-challenge` delegation) were not
2906
- * derivable from anything the SDK returned — an integration had to read
2907
- * them out of the docs and hope they still matched the server.
2908
- */
2909
- create: (spaceId: string, cubeId: string, body: CreateDomainInput) => Promise<{
2910
- domain: Domain;
2911
- records: DnsRecord[];
2912
- }>;
2913
- /**
2914
- * The DNS records a domain needs, each checked against live DNS.
2915
- *
2916
- * Poll this after publishing them: `summary.complete` turns true only once
2917
- * every record is `found`. Each call performs real DNS lookups and is rate
2918
- * limited, so poll on an interval rather than in a tight loop.
2919
- */
2920
- records: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
2921
- domain: string;
2922
- isWildcard: boolean;
2923
- records: DnsRecordStatus[];
2924
- summary: {
2925
- found: number;
2926
- total: number;
2927
- complete: boolean;
2928
- };
2929
- checkedAt: string;
2930
- }>;
2931
- /** Update a domain's per-domain proxy settings. */
2932
- update: (spaceId: string, cubeId: string, mappingId: string, body: UpdateDomainInput) => Promise<Domain>;
2933
- /** Detach a custom domain from a Cube. */
2934
- delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
2935
- success: boolean;
2936
- } | undefined>;
2937
- };
2938
- readonly snapshots: {
2939
- /** List a Cube's snapshots. */
2940
- list: (spaceId: string, cubeId: string) => Promise<Snapshot[]>;
2941
- /** Create a snapshot of a Cube's disk (asynchronous — enqueued). */
2942
- create: (spaceId: string, cubeId: string, body?: {
2943
- name?: string;
2944
- }) => Promise<Snapshot>;
2945
- /** Delete a snapshot. */
2946
- delete: (spaceId: string, cubeId: string, snapshotId: string) => Promise<{
2947
- success: boolean;
2948
- }>;
2949
- };
2950
- readonly tcpMappings: {
2951
- /** List a Cube's TCP port mappings. */
2952
- list: (spaceId: string, cubeId: string) => Promise<TcpMapping[]>;
2953
- /**
2954
- * Create a TCP port mapping exposing a Cube port on the host. `cubePort` is
2955
- * required; `whitelistedIps` optionally restricts who can reach it.
2956
- *
2957
- * ⛔ Send `whitelistedIps`, not `whitelistIps`. The published spec named
2958
- * the field `whitelistIps` while the server has always read
2959
- * `whitelistedIps`, so every allow-listed mapping created through this SDK
2960
- * was silently published WORLD-OPEN, with a 201 and no error (reproduced
2961
- * on production 2026-09-02). The server now accepts both, so an older
2962
- * client keeps working, but `whitelistIps` is deprecated.
2963
- *
2964
- * **Omitting the allow-list leaves the port open to the internet.** That is
2965
- * the documented behaviour, not an oversight — but it means a typo in the
2966
- * field name fails OPEN, which is exactly how the original defect survived.
2967
- *
2968
- * `udpEnabled` optionally forwards UDP traffic on the same host port
2969
- * alongside TCP. It is optional and the server defaults it to `true` when
2970
- * omitted — so leave it unset to get UDP forwarding, and pass `false`
2971
- * only to explicitly disable it.
2972
- */
2973
- create: (spaceId: string, cubeId: string, body: CreateTcpMappingInput) => Promise<TcpMapping>;
2974
- /** Delete a TCP port mapping. */
2975
- delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
2976
- success: boolean;
2977
- } | undefined>;
2978
- };
2979
- readonly imports: {
2980
- /**
2981
- * Start importing a `.cube` archive into a new Cube. Returns the multipart
2982
- * upload target (`importId`, `uploadId`, presigned `parts`, …). Upload the
2983
- * archive to those URLs, then call {@link imports.complete}.
2984
- */
2985
- create: (spaceId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
2986
- chunkSizeBytes?: number;
2987
- expiresAt?: string;
2988
- importId?: string;
2989
- key?: string;
2990
- parts?: {
2991
- partNumber?: number;
2992
- url?: string;
2993
- }[] | undefined;
2994
- uploadId?: string;
2995
- } | undefined>;
2996
- /** Get an in-progress or completed import by id. */
2997
- get: (spaceId: string, importId: string) => Promise<{
2998
- import?: {
2999
- completedAt?: string | null;
3000
- createdAt?: string;
3001
- cubeId?: string | null;
3002
- error?: string | null;
3003
- id?: string;
3004
- name?: string;
3005
- status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired";
3006
- updatedAt?: string;
3007
- } | undefined;
3008
- }>;
3009
- /**
3010
- * Finish an import after the archive has been uploaded — provisions the
3011
- * Cube. Pass the uploaded `parts` (partNumber + etag) and the resolved
3012
- * `config`.
3013
- */
3014
- complete: (spaceId: string, importId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports/{importId}/complete"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
3015
- cubeId?: string;
3016
- importId?: string;
3017
- status?: "provisioning";
3018
- } | undefined>;
3019
- /** Cancel an in-progress import. */
3020
- cancel: (spaceId: string, importId: string) => Promise<{
3021
- success: boolean;
3022
- } | undefined>;
3023
- };
3024
- readonly backups: {
3025
- /** List the space's backups, newest first, including copies shared into it. */
3026
- list: (spaceId: string) => Promise<Backup[]>;
3027
- /** Get one backup. */
3028
- get: (spaceId: string, backupId: string) => Promise<Backup>;
3029
- /** Get a time-limited download URL for a backup `.cube` archive. */
3030
- download: (spaceId: string, backupId: string) => Promise<{
3031
- expiresAt?: string;
3032
- filename?: string;
3033
- sizeBytes?: number | null;
3034
- url?: string;
3035
- } | undefined>;
3036
- /**
3037
- * Offer a copy of a backup to another space. Returns the pending
3038
- * {@link BackupShare}.
3039
- *
3040
- * Nothing is copied until the destination accepts: its owner, or a member
3041
- * there with `backup.manage`, within 48 hours. The accepted copy is the
3042
- * destination's own and is billed to it; this space's backup and bill are
3043
- * unchanged. Through the API a share is always a request, even when your
3044
- * user owns both spaces.
3045
- *
3046
- * A refusal at this step never says anything about the destination's
3047
- * billing or verification; those are checked when it accepts.
3048
- *
3049
- * @param spaceId The space that holds the backup.
3050
- * @param backupId The backup to share.
3051
- * @param body `{ destinationSpaceId }`.
3052
- * @param opts Optional `idempotencyKey` (max 255 chars, scoped per space).
3053
- */
3054
- share: (spaceId: string, backupId: string, body: {
3055
- destinationSpaceId: string;
3056
- }, opts?: {
3057
- idempotencyKey?: string;
3058
- }) => Promise<BackupShare>;
3059
- };
3060
- readonly backupShares: {
3061
- /** Pending, unexpired shares into (`incoming`) and out of (`outgoing`) a space. */
3062
- list: (spaceId: string) => Promise<BackupShareList>;
3063
- /**
3064
- * Accept a share offered to this space. Returns the share and the space's
3065
- * new copy of the backup.
3066
- *
3067
- * The copy is billed to this space from now, so only a key of the space's
3068
- * owner, or of a member holding `backup.manage`, may accept. A space that
3069
- * cannot take the copy (no card or credit, owner not verified, an open abuse
3070
- * notice, or no backup allowance left on its plan) is refused with a 422.
3071
- */
3072
- accept: (spaceId: string, shareId: string) => Promise<AcceptedBackupShare>;
3073
- /** Decline a share offered to this space. Same permission as {@link accept}. */
3074
- decline: (spaceId: string, shareId: string) => Promise<BackupShare>;
3075
- /**
3076
- * Withdraw a pending share this space offered. Allowed for a key of the
3077
- * space's owner, of a member holding `backup.manage`, or of the member who
3078
- * raised the request.
3079
- */
3080
- cancel: (spaceId: string, shareId: string) => Promise<BackupShare>;
3081
- };
3082
- readonly webhooks: {
3083
- /** List webhook endpoints in a Space. */
3084
- list: (spaceId: string) => Promise<Webhook[]>;
3085
- /** Get a single webhook endpoint by id. Does NOT include the signing secret. */
3086
- get: (spaceId: string, endpointId: string) => Promise<Webhook>;
3087
- /**
3088
- * Create a webhook endpoint. Returns the endpoint AND its signing secret.
3089
- *
3090
- * ⛔ The signing secret is shown ONLY at creation. Persist it immediately;
3091
- * you cannot retrieve it later — `webhooks.get` deliberately omits it.
3092
- * Losing the secret means every subsequent delivery will fail signature
3093
- * verification, and you will have to delete the endpoint and create a new
3094
- * one. An automation that swallows this helper's return value will lose
3095
- * the secret on the next request, so the response is checked here and
3096
- * throws if the server omits either the webhook or the secret.
3097
- *
3098
- * @param spaceId Target Space id.
3099
- * @param body Webhook spec — `{ url, events, description? }`.
3100
- */
3101
- create: (spaceId: string, body: CreateWebhookInput) => Promise<WebhookWithSecret>;
3102
- /**
3103
- * Delete a webhook endpoint (cascades delivery history).
3104
- *
3105
- * Resolves on any 2xx; the response body is intentionally not parsed
3106
- * because the server returns `{ success: true }` but the caller does not
3107
- * need it.
3108
- */
3109
- delete: (spaceId: string, endpointId: string) => Promise<void>;
3110
- /**
3111
- * List recent deliveries for a webhook endpoint (last 30 days, max 100).
3112
- *
3113
- * @param spaceId Target Space id.
3114
- * @param endpointId Webhook endpoint id.
3115
- * @param opts Optional `limit` (1..100). Omit to let the server default to 50.
3116
- */
3117
- deliveries: (spaceId: string, endpointId: string, opts?: {
3118
- limit?: number;
3119
- }) => Promise<WebhookDelivery[]>;
3120
- };
3121
- readonly catalog: {
3122
- /** List regions with available capacity. */
3123
- regions: () => Promise<{
3124
- regions: {
3125
- id: string;
3126
- name: string;
3127
- slug: string;
3128
- }[];
3129
- }>;
3130
- /** List available OS images. */
3131
- images: () => Promise<{
3132
- images: {
3133
- defaultUser: string;
3134
- description: string;
3135
- id: string;
3136
- name: string;
3137
- version: string;
3138
- }[];
3139
- }>;
3140
- /** Per-resource hourly rates and volume pricing tiers. */
3141
- pricing: () => Promise<{
3142
- currency: string;
3143
- note: string;
3144
- rates: {
3145
- diskGbPerHour: number;
3146
- ramGbPerHour: number;
3147
- vcpuPerHour: number;
3148
- };
3149
- tiers: {
3150
- label: string;
3151
- maxVcpus: number | null;
3152
- minVcpus: number;
3153
- multiplier: number;
3154
- }[];
3155
- }>;
3156
- };
3157
- }
12
+ import { C as components, S as UpdateDomainInput, _ as PricingTier, a as BackupShareList, b as Space, c as CreateTcpMappingInput, d as DEFAULT_BASE_URL, f as Domain, g as Pagination, h as KrovaClientOptions, i as BackupShare, l as Cube, m as KrovaClient, n as AuthScheme, o as CreateCubeInput, p as Image, r as Backup, s as CreateDomainInput, t as AcceptedBackupShare, u as CubeSshInfo, v as Region, w as paths, x as TcpMapping, y as Snapshot } from "./client-DeW56829.cjs";
3158
13
  /**
3159
14
  * The error body shape returned by the Krova Cloud API.
3160
15
  *
@@ -3262,5 +117,4 @@ export declare class TerminationProtectedError extends KrovaError {
3262
117
  * missing optional fields.
3263
118
  */
3264
119
  export declare function terminationProtectedFrom(response: Response, cubeId: string, body: unknown): TerminationProtectedError | null;
3265
- export type { AcceptedBackupShare, AuthScheme, Backup, BackupShare, BackupShareList, CreateCubeInput, CreateDomainInput, CreateTcpMappingInput, Cube, CubeSshInfo, Domain, Image, KrovaClientOptions, KrovaErrorBody, Pagination, PricingTier, Region, Snapshot, Space, TcpMapping, UpdateDomainInput, components, paths };
3266
- //# sourceMappingURL=index.d.cts.map
120
+ export { type AcceptedBackupShare, type AuthScheme, type Backup, type BackupShare, type BackupShareList, type CreateCubeInput, type CreateDomainInput, type CreateTcpMappingInput, type Cube, type CubeSshInfo, DEFAULT_BASE_URL, type Domain, type Image, KrovaClient, type KrovaClientOptions, type KrovaErrorBody, type Pagination, type PricingTier, type Region, type Snapshot, type Space, type TcpMapping, type UpdateDomainInput, type components, type paths };