@infrapilot-jur/sdk 0.2.17 → 0.4.0
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/CHANGELOG.md +45 -0
- package/README.md +27 -3
- package/dist/index.cjs +118 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +529 -11
- package/dist/index.d.ts +529 -11
- package/dist/index.js +118 -40
- package/dist/index.js.map +1 -1
- package/docs/MIGRATION-0.3.md +30 -0
- package/docs/operation-coverage.md +4 -4
- package/package.json +2 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
Domain detail / observability under `infra.node.kvm` (OpenAPI `0.2.15`):
|
|
8
|
+
|
|
9
|
+
- `get(uuid)` → `GET /node/kvm/{uuid}` (`kvmDomain`)
|
|
10
|
+
- `cpu(uuid)` → `GET /node/kvm/{uuid}/cpu` (`kvmDomainCPU`)
|
|
11
|
+
- `memory(uuid)` → `GET /node/kvm/{uuid}/memory` (`kvmDomainMemory`)
|
|
12
|
+
- `disks(uuid)` → `GET /node/kvm/{uuid}/disks` (`kvmDomainDisks`)
|
|
13
|
+
- `network(uuid)` → `GET /node/kvm/{uuid}/network` (`kvmDomainNetwork`)
|
|
14
|
+
- `config(uuid)` → `GET /node/kvm/{uuid}/config` (`kvmDomainConfig`)
|
|
15
|
+
|
|
16
|
+
Existing `list` / `start` / `stop` / `reboot` are unchanged.
|
|
17
|
+
|
|
18
|
+
## 0.3.0
|
|
19
|
+
|
|
20
|
+
### BREAKING CHANGE
|
|
21
|
+
|
|
22
|
+
KVM methods moved under a nested namespace. HTTP and OpenAPI contracts are unchanged.
|
|
23
|
+
|
|
24
|
+
- `node.kvm()` → `node.kvm.list()`
|
|
25
|
+
- `node.kvmStart(uuid)` → `node.kvm.start(uuid)`
|
|
26
|
+
- `node.kvmStop(uuid)` → `node.kvm.stop(uuid)`
|
|
27
|
+
- `node.kvmReboot(uuid)` → `node.kvm.reboot(uuid)`
|
|
28
|
+
|
|
29
|
+
See [docs/MIGRATION-0.3.md](docs/MIGRATION-0.3.md).
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- `NodeKvmResource` (`infra.node.kvm`) as the extensible KVM surface.
|
|
34
|
+
|
|
35
|
+
## 0.2.17
|
|
36
|
+
|
|
37
|
+
- Power actions use libvirt domain **UUID** path params (`/node/kvm/{uuid}/…`).
|
|
38
|
+
|
|
39
|
+
## 0.2.16
|
|
40
|
+
|
|
41
|
+
- `memory_used_bytes` on `NodeKvmDomain` (DomainMemoryStats).
|
|
42
|
+
|
|
43
|
+
## 0.2.15
|
|
44
|
+
|
|
45
|
+
- `node.kvmStart` / `kvmStop` / `kvmReboot` (`kvm:power`).
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@infrapilot-jur/sdk`
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for the InfraPilot **domains** node API (OpenAPI `0.2.
|
|
3
|
+
TypeScript SDK for the InfraPilot **domains** node API (OpenAPI `0.2.15`, package `0.4.0`).
|
|
4
4
|
|
|
5
5
|
Lives in the monorepo at `sdks/typescript/`. Types are generated from
|
|
6
6
|
`services/domains/docs/openapi.yaml`.
|
|
@@ -83,6 +83,15 @@ const infra = new InfraPilot({
|
|
|
83
83
|
|
|
84
84
|
await infra.auth.me();
|
|
85
85
|
await infra.domains.list();
|
|
86
|
+
|
|
87
|
+
const kvm = await infra.node.kvm.list();
|
|
88
|
+
const detail = await infra.node.kvm.get(kvm.domains[0].uuid);
|
|
89
|
+
await infra.node.kvm.cpu(detail.uuid);
|
|
90
|
+
await infra.node.kvm.memory(detail.uuid);
|
|
91
|
+
await infra.node.kvm.disks(detail.uuid);
|
|
92
|
+
await infra.node.kvm.network(detail.uuid);
|
|
93
|
+
await infra.node.kvm.config(detail.uuid);
|
|
94
|
+
await infra.node.kvm.start(detail.uuid);
|
|
86
95
|
```
|
|
87
96
|
|
|
88
97
|
`authMode: "bearer"` remains for automation that already holds a bootstrap or `infra_live_*` key.
|
|
@@ -97,7 +106,22 @@ await infra.domains.list();
|
|
|
97
106
|
- `infra.auth` — `GET /api/v1/auth/me`
|
|
98
107
|
- `infra.clients` — admin client management
|
|
99
108
|
- `infra.apiKeys` — admin API key create/list/update/revoke/rotate
|
|
100
|
-
- `infra.node` — local node identity, capabilities, resources,
|
|
109
|
+
- `infra.node` — local node identity, capabilities, resources, processes, network, services
|
|
110
|
+
- `infra.node.kvm` — nested KVM surface: `list` / `get` / `cpu` / `memory` / `disks` / `network` / `config` / `start` / `stop` / `reboot` (UUID)
|
|
111
|
+
|
|
112
|
+
## Migration (0.2 → 0.3)
|
|
113
|
+
|
|
114
|
+
See [docs/MIGRATION-0.3.md](docs/MIGRATION-0.3.md). Short form:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
BREAKING CHANGE
|
|
118
|
+
node.kvm() → node.kvm.list()
|
|
119
|
+
node.kvmStart(uuid) → node.kvm.start(uuid)
|
|
120
|
+
node.kvmStop(uuid) → node.kvm.stop(uuid)
|
|
121
|
+
node.kvmReboot(uuid) → node.kvm.reboot(uuid)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
HTTP endpoints and OpenAPI operationIds are unchanged.
|
|
101
125
|
|
|
102
126
|
## Behavior
|
|
103
127
|
|
|
@@ -108,7 +132,7 @@ await infra.domains.list();
|
|
|
108
132
|
- HTTP errors expose optional `code` and `retryAfter` (from `429` + `Retry-After`)
|
|
109
133
|
- Partial PATCH supported (`DomainUpdateInput`, client/key updates)
|
|
110
134
|
- Discriminated preview (`create` | `update` | `delete`)
|
|
111
|
-
-
|
|
135
|
+
- OpenAPI operationIds stable across 0.2.x → 0.3.0; v0.3.0 nests KVM under `node.kvm.*`
|
|
112
136
|
|
|
113
137
|
## Develop
|
|
114
138
|
|
package/dist/index.cjs
CHANGED
|
@@ -601,84 +601,89 @@ var DomainsResource = class {
|
|
|
601
601
|
};
|
|
602
602
|
};
|
|
603
603
|
|
|
604
|
-
// src/resources/
|
|
605
|
-
var
|
|
604
|
+
// src/resources/kvm.ts
|
|
605
|
+
var NodeKvmResource = class {
|
|
606
606
|
constructor(client, timeoutMs) {
|
|
607
607
|
this.client = client;
|
|
608
608
|
this.timeoutMs = timeoutMs;
|
|
609
609
|
}
|
|
610
610
|
client;
|
|
611
611
|
timeoutMs;
|
|
612
|
-
|
|
612
|
+
list(ctx) {
|
|
613
613
|
return execute(
|
|
614
|
-
"
|
|
614
|
+
"getNodeKvm",
|
|
615
615
|
this.timeoutMs,
|
|
616
616
|
ctx,
|
|
617
|
-
(signal, headers) => this.client.GET("/api/v1/node", buildInit(signal, headers))
|
|
617
|
+
(signal, headers) => this.client.GET("/api/v1/node/kvm", buildInit(signal, headers))
|
|
618
618
|
);
|
|
619
619
|
}
|
|
620
|
-
|
|
620
|
+
get(uuid, ctx) {
|
|
621
621
|
return execute(
|
|
622
|
-
"
|
|
622
|
+
"kvmDomain",
|
|
623
623
|
this.timeoutMs,
|
|
624
624
|
ctx,
|
|
625
|
-
(signal, headers) => this.client.
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
return execute(
|
|
630
|
-
"getNodeCapabilities",
|
|
631
|
-
this.timeoutMs,
|
|
632
|
-
ctx,
|
|
633
|
-
(signal, headers) => this.client.GET("/api/v1/node/capabilities", buildInit(signal, headers))
|
|
625
|
+
(signal, headers) => this.client.GET(
|
|
626
|
+
"/api/v1/node/kvm/{uuid}",
|
|
627
|
+
buildInit(signal, headers, { params: { path: { uuid } } })
|
|
628
|
+
)
|
|
634
629
|
);
|
|
635
630
|
}
|
|
636
|
-
|
|
631
|
+
cpu(uuid, ctx) {
|
|
637
632
|
return execute(
|
|
638
|
-
"
|
|
633
|
+
"kvmDomainCPU",
|
|
639
634
|
this.timeoutMs,
|
|
640
635
|
ctx,
|
|
641
|
-
(signal, headers) => this.client.GET(
|
|
636
|
+
(signal, headers) => this.client.GET(
|
|
637
|
+
"/api/v1/node/kvm/{uuid}/cpu",
|
|
638
|
+
buildInit(signal, headers, { params: { path: { uuid } } })
|
|
639
|
+
)
|
|
642
640
|
);
|
|
643
641
|
}
|
|
644
|
-
|
|
645
|
-
const query = {};
|
|
646
|
-
if (params?.limit !== void 0) query.limit = params.limit;
|
|
642
|
+
memory(uuid, ctx) {
|
|
647
643
|
return execute(
|
|
648
|
-
"
|
|
644
|
+
"kvmDomainMemory",
|
|
649
645
|
this.timeoutMs,
|
|
650
646
|
ctx,
|
|
651
647
|
(signal, headers) => this.client.GET(
|
|
652
|
-
"/api/v1/node/
|
|
653
|
-
buildInit(signal, headers, { params: {
|
|
648
|
+
"/api/v1/node/kvm/{uuid}/memory",
|
|
649
|
+
buildInit(signal, headers, { params: { path: { uuid } } })
|
|
654
650
|
)
|
|
655
651
|
);
|
|
656
652
|
}
|
|
657
|
-
|
|
653
|
+
disks(uuid, ctx) {
|
|
658
654
|
return execute(
|
|
659
|
-
"
|
|
655
|
+
"kvmDomainDisks",
|
|
660
656
|
this.timeoutMs,
|
|
661
657
|
ctx,
|
|
662
|
-
(signal, headers) => this.client.GET(
|
|
658
|
+
(signal, headers) => this.client.GET(
|
|
659
|
+
"/api/v1/node/kvm/{uuid}/disks",
|
|
660
|
+
buildInit(signal, headers, { params: { path: { uuid } } })
|
|
661
|
+
)
|
|
663
662
|
);
|
|
664
663
|
}
|
|
665
|
-
|
|
664
|
+
network(uuid, ctx) {
|
|
666
665
|
return execute(
|
|
667
|
-
"
|
|
666
|
+
"kvmDomainNetwork",
|
|
668
667
|
this.timeoutMs,
|
|
669
668
|
ctx,
|
|
670
|
-
(signal, headers) => this.client.GET(
|
|
669
|
+
(signal, headers) => this.client.GET(
|
|
670
|
+
"/api/v1/node/kvm/{uuid}/network",
|
|
671
|
+
buildInit(signal, headers, { params: { path: { uuid } } })
|
|
672
|
+
)
|
|
671
673
|
);
|
|
672
674
|
}
|
|
673
|
-
|
|
675
|
+
config(uuid, ctx) {
|
|
674
676
|
return execute(
|
|
675
|
-
"
|
|
677
|
+
"kvmDomainConfig",
|
|
676
678
|
this.timeoutMs,
|
|
677
679
|
ctx,
|
|
678
|
-
(signal, headers) => this.client.GET(
|
|
680
|
+
(signal, headers) => this.client.GET(
|
|
681
|
+
"/api/v1/node/kvm/{uuid}/config",
|
|
682
|
+
buildInit(signal, headers, { params: { path: { uuid } } })
|
|
683
|
+
)
|
|
679
684
|
);
|
|
680
685
|
}
|
|
681
|
-
|
|
686
|
+
start(uuid, ctx) {
|
|
682
687
|
return execute(
|
|
683
688
|
"startNodeKvmDomain",
|
|
684
689
|
this.timeoutMs,
|
|
@@ -689,7 +694,7 @@ var NodeResource = class {
|
|
|
689
694
|
)
|
|
690
695
|
);
|
|
691
696
|
}
|
|
692
|
-
|
|
697
|
+
stop(uuid, ctx) {
|
|
693
698
|
return execute(
|
|
694
699
|
"stopNodeKvmDomain",
|
|
695
700
|
this.timeoutMs,
|
|
@@ -700,7 +705,7 @@ var NodeResource = class {
|
|
|
700
705
|
)
|
|
701
706
|
);
|
|
702
707
|
}
|
|
703
|
-
|
|
708
|
+
reboot(uuid, ctx) {
|
|
704
709
|
return execute(
|
|
705
710
|
"rebootNodeKvmDomain",
|
|
706
711
|
this.timeoutMs,
|
|
@@ -713,6 +718,79 @@ var NodeResource = class {
|
|
|
713
718
|
}
|
|
714
719
|
};
|
|
715
720
|
|
|
721
|
+
// src/resources/node.ts
|
|
722
|
+
var NodeResource = class {
|
|
723
|
+
constructor(client, timeoutMs) {
|
|
724
|
+
this.client = client;
|
|
725
|
+
this.timeoutMs = timeoutMs;
|
|
726
|
+
this.kvm = new NodeKvmResource(client, timeoutMs);
|
|
727
|
+
}
|
|
728
|
+
client;
|
|
729
|
+
timeoutMs;
|
|
730
|
+
kvm;
|
|
731
|
+
get(ctx) {
|
|
732
|
+
return execute(
|
|
733
|
+
"getNode",
|
|
734
|
+
this.timeoutMs,
|
|
735
|
+
ctx,
|
|
736
|
+
(signal, headers) => this.client.GET("/api/v1/node", buildInit(signal, headers))
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
update(body, ctx) {
|
|
740
|
+
return execute(
|
|
741
|
+
"updateNode",
|
|
742
|
+
this.timeoutMs,
|
|
743
|
+
ctx,
|
|
744
|
+
(signal, headers) => this.client.PATCH("/api/v1/node", buildInit(signal, headers, { body }))
|
|
745
|
+
);
|
|
746
|
+
}
|
|
747
|
+
capabilities(ctx) {
|
|
748
|
+
return execute(
|
|
749
|
+
"getNodeCapabilities",
|
|
750
|
+
this.timeoutMs,
|
|
751
|
+
ctx,
|
|
752
|
+
(signal, headers) => this.client.GET("/api/v1/node/capabilities", buildInit(signal, headers))
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
resources(ctx) {
|
|
756
|
+
return execute(
|
|
757
|
+
"getNodeResources",
|
|
758
|
+
this.timeoutMs,
|
|
759
|
+
ctx,
|
|
760
|
+
(signal, headers) => this.client.GET("/api/v1/node/resources", buildInit(signal, headers))
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
processes(params, ctx) {
|
|
764
|
+
const query = {};
|
|
765
|
+
if (params?.limit !== void 0) query.limit = params.limit;
|
|
766
|
+
return execute(
|
|
767
|
+
"getNodeProcesses",
|
|
768
|
+
this.timeoutMs,
|
|
769
|
+
ctx,
|
|
770
|
+
(signal, headers) => this.client.GET(
|
|
771
|
+
"/api/v1/node/processes",
|
|
772
|
+
buildInit(signal, headers, { params: { query } })
|
|
773
|
+
)
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
network(ctx) {
|
|
777
|
+
return execute(
|
|
778
|
+
"getNodeNetwork",
|
|
779
|
+
this.timeoutMs,
|
|
780
|
+
ctx,
|
|
781
|
+
(signal, headers) => this.client.GET("/api/v1/node/network", buildInit(signal, headers))
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
services(ctx) {
|
|
785
|
+
return execute(
|
|
786
|
+
"getNodeServices",
|
|
787
|
+
this.timeoutMs,
|
|
788
|
+
ctx,
|
|
789
|
+
(signal, headers) => this.client.GET("/api/v1/node/services", buildInit(signal, headers))
|
|
790
|
+
);
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
|
|
716
794
|
// src/resources/operations.ts
|
|
717
795
|
var OperationsResource = class {
|
|
718
796
|
constructor(client, timeoutMs) {
|
|
@@ -828,14 +906,15 @@ var InfraPilot = class _InfraPilot {
|
|
|
828
906
|
|
|
829
907
|
// src/generated/meta.ts
|
|
830
908
|
var openapiSourcePath = "../../services/domains/docs/openapi.yaml";
|
|
831
|
-
var openapiSha256 = "
|
|
832
|
-
var generatedAt = "2026-12-02T12:
|
|
909
|
+
var openapiSha256 = "945e763c9d6b89ebd8376b4e6d0c87aabf28b13e4c13aac77c81ad0d2079e065";
|
|
910
|
+
var generatedAt = "2026-12-02T12:54:52.286Z";
|
|
833
911
|
|
|
834
912
|
exports.AuthErrorCodes = AuthErrorCodes;
|
|
835
913
|
exports.InfraPilot = InfraPilot;
|
|
836
914
|
exports.InfraPilotError = InfraPilotError;
|
|
837
915
|
exports.InfraPilotHttpError = InfraPilotHttpError;
|
|
838
916
|
exports.InfraPilotTransportError = InfraPilotTransportError;
|
|
917
|
+
exports.NodeKvmResource = NodeKvmResource;
|
|
839
918
|
exports.generatedAt = generatedAt;
|
|
840
919
|
exports.openapiSha256 = openapiSha256;
|
|
841
920
|
exports.openapiSourcePath = openapiSourcePath;
|