@homeflare/distilled-proxmox 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +27 -5
  2. package/dist/config-not-found.test.js +29 -0
  3. package/dist/config-not-found.test.js.map +1 -1
  4. package/dist/lxc-config-errors.test.d.ts +2 -0
  5. package/dist/lxc-config-errors.test.d.ts.map +1 -0
  6. package/dist/lxc-config-errors.test.js +48 -0
  7. package/dist/lxc-config-errors.test.js.map +1 -0
  8. package/dist/network-changes.test.d.ts +2 -0
  9. package/dist/network-changes.test.d.ts.map +1 -0
  10. package/dist/network-changes.test.js +42 -0
  11. package/dist/network-changes.test.js.map +1 -0
  12. package/dist/protocol.d.ts.map +1 -1
  13. package/dist/protocol.js +24 -9
  14. package/dist/protocol.js.map +1 -1
  15. package/dist/qemu-config-absence.test.d.ts +2 -0
  16. package/dist/qemu-config-absence.test.d.ts.map +1 -0
  17. package/dist/qemu-config-absence.test.js +41 -0
  18. package/dist/qemu-config-absence.test.js.map +1 -0
  19. package/dist/replication-firewall-errors.test.d.ts +2 -0
  20. package/dist/replication-firewall-errors.test.d.ts.map +1 -0
  21. package/dist/replication-firewall-errors.test.js +76 -0
  22. package/dist/replication-firewall-errors.test.js.map +1 -0
  23. package/dist/services/cluster.d.ts +25 -5
  24. package/dist/services/cluster.d.ts.map +1 -1
  25. package/dist/services/cluster.js +24 -5
  26. package/dist/services/cluster.js.map +1 -1
  27. package/dist/services/nodes.d.ts +44 -8
  28. package/dist/services/nodes.d.ts.map +1 -1
  29. package/dist/services/nodes.js +49 -8
  30. package/dist/services/nodes.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/config-not-found.test.ts +49 -0
  33. package/src/lxc-config-errors.test.ts +100 -0
  34. package/src/network-changes.test.ts +60 -0
  35. package/src/protocol.ts +26 -9
  36. package/src/qemu-config-absence.test.ts +75 -0
  37. package/src/replication-firewall-errors.test.ts +126 -0
  38. package/src/services/cluster.ts +51 -10
  39. package/src/services/nodes.ts +81 -16
@@ -30,6 +30,38 @@ export class ClusterNodeUnreachable extends /*@__PURE__*/ /*@__PURE__*/ T.applyE
30
30
  message: S.String,
31
31
  }).pipe(C.withServerError), [{ status: 595 }]) {
32
32
  }
33
+ /** The requested container config is absent on this node. VM IDs are cluster-wide: callers must still check whether another node or QEMU guest holds the ID before creating. Also raised by PUT (update_vm) and DELETE (destroy_vm), which both call the same load_config first. This GET requires VM.Audit on /vms/{vmid}; retain its credential for any permission-filtered cluster index read. */
34
+ export class LxcConfigNotFound extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
35
+ /*@__PURE__*/ S.TaggedError()("LxcConfigNotFound", {
36
+ message: S.String,
37
+ }).pipe(C.withBadRequestError), [
38
+ {
39
+ status: 500,
40
+ message: {
41
+ matches: "^Configuration file 'nodes/[^/']+/lxc/[0-9]+\\.conf' does not exist\\n?$",
42
+ },
43
+ },
44
+ ]) {
45
+ }
46
+ /** qemu-server PVE/API2/Qemu.pm vm_config GET and destroy_vm both call QemuConfig->load_config. pve-guest-common AbstractConfig.pm load_config dies when the cfs file is missing: Configuration file '$cfspath' does not exist. QemuConfig's path is nodes/$node/qemu-server/$vmid.conf, HTTP 500. A missing file on this node is not a free cluster-wide vmid. */
47
+ export class QemuConfigNotFound extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
48
+ /*@__PURE__*/ S.TaggedError()("QemuConfigNotFound", {
49
+ message: S.String,
50
+ }).pipe(C.withBadRequestError), [
51
+ {
52
+ status: 500,
53
+ message: {
54
+ matches: "^Configuration file 'nodes/[^/']+/qemu-server/[0-9]+\\.conf' does not exist\\n?$",
55
+ },
56
+ },
57
+ ]) {
58
+ }
59
+ /** pve-manager 9.2.11, PVE/API2/Network.pm. GET (network_config) and PUT (update_network) both raise HTTP 400 with exactly errors.iface = interface does not exist -- verified against the live n2 source on 2026-09-25. DELETE (delete_network) raises it too but is left untyped: no generated deleteNodeNetwork2 caller exists yet. Only the exact sole-field detail is normalized for operation matching; all other validation errors remain ParameterVerificationFailed. Attached to GET and PUT. */
60
+ export class NetworkInterfaceNotFound extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
61
+ /*@__PURE__*/ S.TaggedError()("NetworkInterfaceNotFound", {
62
+ message: S.String,
63
+ }).pipe(C.withBadRequestError), [{ status: 400, message: { matches: "^interface does not exist$" } }]) {
64
+ }
33
65
  export const CloneNodesLxcRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
34
66
  node: S.String.pipe(T.Label()),
35
67
  vmid: S.String.pipe(T.Label()),
@@ -5109,7 +5141,16 @@ export const ListNodeNetworkResponseBodyItem = /*@__PURE__*/ S.suspend(() => S.S
5109
5141
  identifier: "ListNodeNetworkResponseBodyItem",
5110
5142
  });
5111
5143
  export const ListNodeNetworkResponseBodyList = /*@__PURE__*/ S.Array(ListNodeNetworkResponseBodyItem);
5112
- export const ListNodeNetworkResponse = /*@__PURE__*/ S.suspend(() => ListNodeNetworkResponseBodyList.pipe(T.RawResponseRoot())).annotate({
5144
+ export const ListNodeNetworkPendingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
5145
+ data: ListNodeNetworkResponseBodyList,
5146
+ changes: S.String,
5147
+ })).annotate({
5148
+ identifier: "ListNodeNetworkPendingResponse",
5149
+ });
5150
+ export const ListNodeNetworkResponse = /*@__PURE__*/ S.suspend(() => S.Union([
5151
+ ListNodeNetworkResponseBodyList.pipe(T.RawResponseRoot()),
5152
+ ListNodeNetworkPendingResponse,
5153
+ ])).annotate({
5113
5154
  identifier: "ListNodeNetworkResponse",
5114
5155
  });
5115
5156
  export const ListNodeQemuRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
@@ -8039,7 +8080,7 @@ export const deleteNodeFirewallRule = /*@__PURE__*/ API.make(() => ({
8039
8080
  export const deleteNodeLxc = /*@__PURE__*/ API.make(() => ({
8040
8081
  input: DeleteNodeLxcRequest,
8041
8082
  output: DeleteNodeLxcResponse,
8042
- errors: [],
8083
+ errors: [LxcConfigNotFound],
8043
8084
  protocol: ProxmoxProtocol,
8044
8085
  retry: Retry.Retry,
8045
8086
  }));
@@ -8103,7 +8144,7 @@ export const deleteNodeNetwork2 = /*@__PURE__*/ API.make(() => ({
8103
8144
  export const deleteNodeQemu = /*@__PURE__*/ API.make(() => ({
8104
8145
  input: DeleteNodeQemuRequest,
8105
8146
  output: DeleteNodeQemuResponse,
8106
- errors: [],
8147
+ errors: [QemuConfigNotFound],
8107
8148
  protocol: ProxmoxProtocol,
8108
8149
  retry: Retry.Retry,
8109
8150
  }));
@@ -8407,7 +8448,7 @@ export const getNodeLxc = /*@__PURE__*/ API.make(() => ({
8407
8448
  export const getNodeLxcConfig = /*@__PURE__*/ API.make(() => ({
8408
8449
  input: GetNodeLxcConfigRequest,
8409
8450
  output: GetNodeLxcConfigResponse,
8410
- errors: [],
8451
+ errors: [LxcConfigNotFound],
8411
8452
  protocol: ProxmoxProtocol,
8412
8453
  retry: Retry.Retry,
8413
8454
  }));
@@ -8518,7 +8559,7 @@ export const getNodeLxcVncwebsocket = /*@__PURE__*/ API.make(() => ({
8518
8559
  export const getNodeNetwork = /*@__PURE__*/ API.make(() => ({
8519
8560
  input: GetNodeNetworkRequest,
8520
8561
  output: GetNodeNetworkResponse,
8521
- errors: [],
8562
+ errors: [NetworkInterfaceNotFound],
8522
8563
  protocol: ProxmoxProtocol,
8523
8564
  retry: Retry.Retry,
8524
8565
  }));
@@ -8646,7 +8687,7 @@ export const getNodeQemuCloudinitDump = /*@__PURE__*/ API.make(() => ({
8646
8687
  export const getNodeQemuConfig = /*@__PURE__*/ API.make(() => ({
8647
8688
  input: GetNodeQemuConfigRequest,
8648
8689
  output: GetNodeQemuConfigResponse,
8649
- errors: [],
8690
+ errors: [QemuConfigNotFound],
8650
8691
  protocol: ProxmoxProtocol,
8651
8692
  retry: Retry.Retry,
8652
8693
  }));
@@ -9818,7 +9859,7 @@ export const putNodeFirewallRule = /*@__PURE__*/ API.make(() => ({
9818
9859
  export const putNodeLxcConfig = /*@__PURE__*/ API.make(() => ({
9819
9860
  input: PutNodeLxcConfigRequest,
9820
9861
  output: PutNodeLxcConfigResponse,
9821
- errors: [],
9862
+ errors: [LxcConfigNotFound],
9822
9863
  protocol: ProxmoxProtocol,
9823
9864
  retry: Retry.Retry,
9824
9865
  }));
@@ -9882,7 +9923,7 @@ export const putNodeNetwork = /*@__PURE__*/ API.make(() => ({
9882
9923
  export const putNodeNetwork2 = /*@__PURE__*/ API.make(() => ({
9883
9924
  input: PutNodeNetwork2Request,
9884
9925
  output: PutNodeNetwork2Response,
9885
- errors: [],
9926
+ errors: [NetworkInterfaceNotFound],
9886
9927
  protocol: ProxmoxProtocol,
9887
9928
  retry: Retry.Retry,
9888
9929
  }));