@krovacloud/sdk 0.4.13 → 0.4.15

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,5 +1,4 @@
1
1
  import { Client } from "openapi-fetch";
2
- //#region src/generated/types.d.ts
3
2
  /**
4
3
  * This file was auto-generated by openapi-typescript.
5
4
  * Do not make direct changes to the file.
@@ -307,6 +306,298 @@ interface paths {
307
306
  patch?: never;
308
307
  trace?: never;
309
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
+ };
310
601
  "/spaces/{spaceId}/backups/{backupId}/download": {
311
602
  parameters: {
312
603
  query?: never;
@@ -360,6 +651,70 @@ interface paths {
360
651
  patch?: never;
361
652
  trace?: never;
362
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
+ };
363
718
  "/spaces/{spaceId}/cubes": {
364
719
  parameters: {
365
720
  query?: never;
@@ -995,7 +1350,7 @@ interface paths {
995
1350
  };
996
1351
  };
997
1352
  400: components["responses"]["BadRequest"];
998
- /** @description Refused. Among other reasons (the domain is in use, or is being removed): 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. */
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. */
999
1354
  409: {
1000
1355
  headers: {
1001
1356
  [name: string]: unknown;
@@ -1047,6 +1402,13 @@ interface paths {
1047
1402
  };
1048
1403
  };
1049
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
+ };
1050
1412
  };
1051
1413
  };
1052
1414
  options?: never;
@@ -1146,7 +1508,7 @@ interface paths {
1146
1508
  };
1147
1509
  400: components["responses"]["BadRequest"];
1148
1510
  404: components["responses"]["NotFound"];
1149
- /** @description Refused. Among other reasons (the domain is in use, or is being removed): 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. */
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. */
1150
1512
  409: {
1151
1513
  headers: {
1152
1514
  [name: string]: unknown;
@@ -1556,6 +1918,13 @@ interface paths {
1556
1918
  };
1557
1919
  400: components["responses"]["BadRequest"];
1558
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
+ };
1559
1928
  429: components["responses"]["RateLimited"];
1560
1929
  };
1561
1930
  };
@@ -1648,6 +2017,13 @@ interface paths {
1648
2017
  };
1649
2018
  };
1650
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
+ };
1651
2027
  429: components["responses"]["RateLimited"];
1652
2028
  };
1653
2029
  };
@@ -1693,6 +2069,13 @@ interface paths {
1693
2069
  };
1694
2070
  };
1695
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
+ };
1696
2079
  };
1697
2080
  };
1698
2081
  options?: never;
@@ -1781,7 +2164,7 @@ interface paths {
1781
2164
  requestBody: {
1782
2165
  content: {
1783
2166
  "application/json": {
1784
- 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" | "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")[];
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")[];
1785
2168
  /** Format: uri */
1786
2169
  url: string;
1787
2170
  };
@@ -1906,6 +2289,58 @@ interface paths {
1906
2289
  }
1907
2290
  interface components {
1908
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
+ };
1909
2344
  Cube: {
1910
2345
  costPerHour: number;
1911
2346
  /** Format: date-time */
@@ -2158,8 +2593,6 @@ interface components {
2158
2593
  headers: never;
2159
2594
  pathItems: never;
2160
2595
  }
2161
- //#endregion
2162
- //#region src/client.d.ts
2163
2596
  /** The Cube resource, as defined in the Krova Cloud OpenAPI spec. */
2164
2597
  type Cube = components["schemas"]["Cube"];
2165
2598
  /** A region with available capacity (from the catalog). */
@@ -2202,6 +2635,29 @@ type DnsRecordStatus = components["schemas"]["DnsRecordStatus"];
2202
2635
  type Snapshot = components["schemas"]["Snapshot"];
2203
2636
  /** A TCP port mapping exposing a Cube port on the host. */
2204
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
+ }
2205
2661
  /** Request body for attaching a custom domain to a Cube. */
2206
2662
  type CreateDomainInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/domains"]["post"]["requestBody"]>["content"]["application/json"];
2207
2663
  /** Request body for updating a custom domain's proxy settings. */
@@ -2250,7 +2706,7 @@ type WebhookWithSecret = Webhook & {
2250
2706
  secret: string;
2251
2707
  };
2252
2708
  /** Default API base URL — the single `servers[0].url` from the OpenAPI spec. */
2253
- declare const DEFAULT_BASE_URL = "https://krova.cloud/api/v1";
2709
+ export declare const DEFAULT_BASE_URL = "https://krova.cloud/api/v1";
2254
2710
  /**
2255
2711
  * How the API key is presented to the server.
2256
2712
  *
@@ -2292,7 +2748,7 @@ interface KrovaClientOptions {
2292
2748
  * const cubes = await krova.cubes.list("space_123");
2293
2749
  * ```
2294
2750
  */
2295
- declare class KrovaClient {
2751
+ export declare class KrovaClient {
2296
2752
  /**
2297
2753
  * The underlying openapi-fetch client — a fully typed escape hatch to every
2298
2754
  * path in the spec. Returns `{ data, error, response }` and never throws.
@@ -2477,7 +2933,7 @@ declare class KrovaClient {
2477
2933
  /** Detach a custom domain from a Cube. */
2478
2934
  delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
2479
2935
  success: boolean;
2480
- }>;
2936
+ } | undefined>;
2481
2937
  };
2482
2938
  readonly snapshots: {
2483
2939
  /** List a Cube's snapshots. */
@@ -2518,7 +2974,7 @@ declare class KrovaClient {
2518
2974
  /** Delete a TCP port mapping. */
2519
2975
  delete: (spaceId: string, cubeId: string, mappingId: string) => Promise<{
2520
2976
  success: boolean;
2521
- }>;
2977
+ } | undefined>;
2522
2978
  };
2523
2979
  readonly imports: {
2524
2980
  /**
@@ -2566,6 +3022,10 @@ declare class KrovaClient {
2566
3022
  } | undefined>;
2567
3023
  };
2568
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>;
2569
3029
  /** Get a time-limited download URL for a backup `.cube` archive. */
2570
3030
  download: (spaceId: string, backupId: string) => Promise<{
2571
3031
  expiresAt?: string;
@@ -2573,6 +3033,51 @@ declare class KrovaClient {
2573
3033
  sizeBytes?: number | null;
2574
3034
  url?: string;
2575
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>;
2576
3081
  };
2577
3082
  readonly webhooks: {
2578
3083
  /** List webhook endpoints in a Space. */
@@ -2650,8 +3155,6 @@ declare class KrovaClient {
2650
3155
  }>;
2651
3156
  };
2652
3157
  }
2653
- //#endregion
2654
- //#region src/error.d.ts
2655
3158
  /**
2656
3159
  * The error body shape returned by the Krova Cloud API.
2657
3160
  *
@@ -2669,7 +3172,7 @@ interface KrovaErrorBody {
2669
3172
  * `{ data, error, response }`. The helpers wrap that and throw `KrovaError`
2670
3173
  * so callers can `try/catch`.
2671
3174
  */
2672
- declare class KrovaError extends Error {
3175
+ export declare class KrovaError extends Error {
2673
3176
  /** HTTP status code of the failing response. */
2674
3177
  readonly status: number;
2675
3178
  /**
@@ -2709,7 +3212,7 @@ declare class KrovaError extends Error {
2709
3212
  * {@link KrovaError.body} never advertises a `string` that is not there. A
2710
3213
  * caller that needs the raw payload of some other shape has `response`.
2711
3214
  */
2712
- declare function krovaErrorFrom(response: Response, body: unknown): KrovaError;
3215
+ export declare function krovaErrorFrom(response: Response, body: unknown): KrovaError;
2713
3216
  /**
2714
3217
  * Thrown by `client.cubes.delete` when the server rejects a delete with
2715
3218
  * `409` and `error.code = "termination_protected"`.
@@ -2722,7 +3225,7 @@ declare function krovaErrorFrom(response: Response, body: unknown): KrovaError;
2722
3225
  * which case the SDK falls back to the id the call was made with and leaves
2723
3226
  * the two timestamps `null`.
2724
3227
  */
2725
- declare class TerminationProtectedError extends KrovaError {
3228
+ export declare class TerminationProtectedError extends KrovaError {
2726
3229
  /** The id of the Cube the customer tried to delete. */
2727
3230
  readonly cubeId: string;
2728
3231
  /**
@@ -2758,7 +3261,6 @@ declare class TerminationProtectedError extends KrovaError {
2758
3261
  * generic `Error` schema — so the cast is best-effort and we tolerate
2759
3262
  * missing optional fields.
2760
3263
  */
2761
- declare function terminationProtectedFrom(response: Response, cubeId: string, body: unknown): TerminationProtectedError | null;
2762
- //#endregion
2763
- export { type AuthScheme, type CreateCubeInput, type CreateDomainInput, type CreateTcpMappingInput, type Cube, type CubeSshInfo, DEFAULT_BASE_URL, type Domain, type Image, KrovaClient, type KrovaClientOptions, KrovaError, type KrovaErrorBody, type Pagination, type PricingTier, type Region, type Snapshot, type Space, type TcpMapping, TerminationProtectedError, type UpdateDomainInput, type components, krovaErrorFrom, type paths, terminationProtectedFrom };
3264
+ 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 };
2764
3266
  //# sourceMappingURL=index.d.cts.map