@homeflare/alchemy 0.14.0 → 0.19.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/README.md +29 -0
- package/dist/linux/directory-lifecycle.d.ts +50 -0
- package/dist/linux/directory-lifecycle.d.ts.map +1 -0
- package/dist/linux/directory.d.ts +19 -0
- package/dist/linux/directory.d.ts.map +1 -0
- package/dist/linux/fake-linux-host.d.ts +35 -0
- package/dist/linux/fake-linux-host.d.ts.map +1 -0
- package/dist/linux/fake-systemd.d.ts +34 -0
- package/dist/linux/fake-systemd.d.ts.map +1 -0
- package/dist/linux/index.d.ts +27 -0
- package/dist/linux/index.d.ts.map +1 -0
- package/dist/linux/index.js +1554 -0
- package/dist/linux/index.js.map +37 -0
- package/dist/linux/providers.d.ts +17 -0
- package/dist/linux/providers.d.ts.map +1 -0
- package/dist/linux/region.d.ts +43 -0
- package/dist/linux/region.d.ts.map +1 -0
- package/dist/linux/remote-file-form.d.ts +47 -0
- package/dist/linux/remote-file-form.d.ts.map +1 -0
- package/dist/linux/remote-file-lifecycle.d.ts +36 -0
- package/dist/linux/remote-file-lifecycle.d.ts.map +1 -0
- package/dist/linux/remote-file-plan.d.ts +33 -0
- package/dist/linux/remote-file-plan.d.ts.map +1 -0
- package/dist/linux/remote-file.d.ts +28 -0
- package/dist/linux/remote-file.d.ts.map +1 -0
- package/dist/linux/ssh-command.d.ts +68 -0
- package/dist/linux/ssh-command.d.ts.map +1 -0
- package/dist/linux/ssh-runner.d.ts +22 -0
- package/dist/linux/ssh-runner.d.ts.map +1 -0
- package/dist/linux/ssh-scripts.d.ts +27 -0
- package/dist/linux/ssh-scripts.d.ts.map +1 -0
- package/dist/linux/systemctl.d.ts +67 -0
- package/dist/linux/systemctl.d.ts.map +1 -0
- package/dist/linux/unit-form.d.ts +78 -0
- package/dist/linux/unit-form.d.ts.map +1 -0
- package/dist/linux/unit-handlers.d.ts +15 -0
- package/dist/linux/unit-handlers.d.ts.map +1 -0
- package/dist/linux/unit-lifecycle.d.ts +44 -0
- package/dist/linux/unit-lifecycle.d.ts.map +1 -0
- package/dist/linux/unit-settle.d.ts +31 -0
- package/dist/linux/unit-settle.d.ts.map +1 -0
- package/dist/linux/unit.d.ts +35 -0
- package/dist/linux/unit.d.ts.map +1 -0
- package/dist/netbox/client.d.ts +52 -0
- package/dist/netbox/client.d.ts.map +1 -0
- package/dist/netbox/constraint-guard.d.ts +26 -0
- package/dist/netbox/constraint-guard.d.ts.map +1 -0
- package/dist/netbox/constraints.d.ts +76 -0
- package/dist/netbox/constraints.d.ts.map +1 -0
- package/dist/netbox/generated/constraints/index.d.ts +19 -0
- package/dist/netbox/generated/constraints/index.d.ts.map +1 -0
- package/dist/netbox/generated/constraints/netbox-ipam.d.ts +21 -0
- package/dist/netbox/generated/constraints/netbox-ipam.d.ts.map +1 -0
- package/dist/netbox/index.d.ts +17 -0
- package/dist/netbox/index.d.ts.map +1 -0
- package/dist/netbox/index.js +331 -0
- package/dist/netbox/index.js.map +18 -0
- package/dist/netbox/prefix-form.d.ts +54 -0
- package/dist/netbox/prefix-form.d.ts.map +1 -0
- package/dist/netbox/prefix.d.ts +80 -0
- package/dist/netbox/prefix.d.ts.map +1 -0
- package/dist/netbox/resource.d.ts +94 -0
- package/dist/netbox/resource.d.ts.map +1 -0
- package/dist/netbox/values.d.ts +24 -0
- package/dist/netbox/values.d.ts.map +1 -0
- package/dist/openbao/index.d.ts +10 -3
- package/dist/openbao/index.d.ts.map +1 -1
- package/dist/proxmox/acl.d.ts.map +1 -1
- package/dist/proxmox/api-token-form.d.ts.map +1 -1
- package/dist/proxmox/apply-endpoints.d.ts +30 -0
- package/dist/proxmox/apply-endpoints.d.ts.map +1 -0
- package/dist/proxmox/backup-job.d.ts.map +1 -1
- package/dist/proxmox/ceph-daemon-form.d.ts +29 -1
- package/dist/proxmox/ceph-daemon-form.d.ts.map +1 -1
- package/dist/proxmox/ceph-daemon.d.ts.map +1 -1
- package/dist/proxmox/ceph-flag.d.ts.map +1 -1
- package/dist/proxmox/ceph-fs.d.ts.map +1 -1
- package/dist/proxmox/ceph-osd-write.d.ts +19 -0
- package/dist/proxmox/ceph-osd-write.d.ts.map +1 -1
- package/dist/proxmox/ceph-pool.d.ts.map +1 -1
- package/dist/proxmox/constraint-guard.d.ts +28 -0
- package/dist/proxmox/constraint-guard.d.ts.map +1 -0
- package/dist/proxmox/constraints.d.ts +94 -0
- package/dist/proxmox/constraints.d.ts.map +1 -0
- package/dist/proxmox/firewall-alias.d.ts.map +1 -1
- package/dist/proxmox/generated/constraints/index.d.ts +19 -0
- package/dist/proxmox/generated/constraints/index.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pbs-config.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pbs-config.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-access.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-access.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-backup.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-backup.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-ceph.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-ceph.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-firewall.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-firewall.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-ha.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-ha.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-metrics.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-metrics.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-notifications.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-notifications.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-replication.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-replication.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-cluster-sdn.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-cluster-sdn.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-nodes-ceph.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-nodes-ceph.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-nodes-disks.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-nodes-disks.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-nodes-lxc.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-nodes-lxc.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-nodes-network.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-nodes-network.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-nodes-qemu.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-nodes-qemu.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-pools.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-pools.d.ts.map +1 -0
- package/dist/proxmox/generated/constraints/pve-storage.d.ts +23 -0
- package/dist/proxmox/generated/constraints/pve-storage.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/access-users.d.ts +137 -0
- package/dist/proxmox/generated/pbs/access-users.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/access.d.ts +171 -0
- package/dist/proxmox/generated/pbs/access.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/admin-datastore-store.d.ts +252 -0
- package/dist/proxmox/generated/pbs/admin-datastore-store.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/admin-metrics.d.ts +147 -0
- package/dist/proxmox/generated/pbs/admin-metrics.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/admin.d.ts +217 -0
- package/dist/proxmox/generated/pbs/admin.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/backup.d.ts +114 -0
- package/dist/proxmox/generated/pbs/backup.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-access-pam.d.ts +218 -0
- package/dist/proxmox/generated/pbs/config-access-pam.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-access.d.ts +203 -0
- package/dist/proxmox/generated/pbs/config-access.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-datastore.d.ts +195 -0
- package/dist/proxmox/generated/pbs/config-datastore.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-media-pool.d.ts +207 -0
- package/dist/proxmox/generated/pbs/config-media-pool.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-notifications-matchers.d.ts +159 -0
- package/dist/proxmox/generated/pbs/config-notifications-matchers.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-notifications.d.ts +199 -0
- package/dist/proxmox/generated/pbs/config-notifications.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-remote.d.ts +175 -0
- package/dist/proxmox/generated/pbs/config-remote.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-sync.d.ts +145 -0
- package/dist/proxmox/generated/pbs/config-sync.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-tape.d.ts +200 -0
- package/dist/proxmox/generated/pbs/config-tape.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config-verify.d.ts +77 -0
- package/dist/proxmox/generated/pbs/config-verify.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/config.d.ts +119 -0
- package/dist/proxmox/generated/pbs/config.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/nodes-node-dns.d.ts +178 -0
- package/dist/proxmox/generated/pbs/nodes-node-dns.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/nodes-node-services.d.ts +205 -0
- package/dist/proxmox/generated/pbs/nodes-node-services.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/nodes-node.d.ts +166 -0
- package/dist/proxmox/generated/pbs/nodes-node.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/nodes.d.ts +171 -0
- package/dist/proxmox/generated/pbs/nodes.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/ping.d.ts +18 -0
- package/dist/proxmox/generated/pbs/ping.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/pull.d.ts +37 -0
- package/dist/proxmox/generated/pbs/pull.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/push.d.ts +36 -0
- package/dist/proxmox/generated/pbs/push.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/reader.d.ts +41 -0
- package/dist/proxmox/generated/pbs/reader.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/root.d.ts +16 -0
- package/dist/proxmox/generated/pbs/root.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/status.d.ts +54 -0
- package/dist/proxmox/generated/pbs/status.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/tape-drive.d.ts +181 -0
- package/dist/proxmox/generated/pbs/tape-drive.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/tape-media.d.ts +126 -0
- package/dist/proxmox/generated/pbs/tape-media.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/tape.d.ts +90 -0
- package/dist/proxmox/generated/pbs/tape.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs/version.d.ts +20 -0
- package/dist/proxmox/generated/pbs/version.d.ts.map +1 -0
- package/dist/proxmox/generated/pbs.d.ts +44 -662
- package/dist/proxmox/generated/pbs.d.ts.map +1 -1
- package/dist/proxmox/generated/pve/access-roles.d.ts +164 -0
- package/dist/proxmox/generated/pve/access-roles.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/access-users.d.ts +152 -0
- package/dist/proxmox/generated/pve/access-users.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/access.d.ts +221 -0
- package/dist/proxmox/generated/pve/access.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-acme-plugins-id.d.ts +45 -0
- package/dist/proxmox/generated/pve/cluster-acme-plugins-id.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-acme-plugins.d.ts +47 -0
- package/dist/proxmox/generated/pve/cluster-acme-plugins.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-acme-tos.d.ts +240 -0
- package/dist/proxmox/generated/pve/cluster-acme-tos.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-bulk-action.d.ts +200 -0
- package/dist/proxmox/generated/pve/cluster-bulk-action.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-firewall-refs.d.ts +109 -0
- package/dist/proxmox/generated/pve/cluster-firewall-refs.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-firewall.d.ts +225 -0
- package/dist/proxmox/generated/pve/cluster-firewall.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-ha.d.ts +199 -0
- package/dist/proxmox/generated/pve/cluster-ha.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-jobs.d.ts +183 -0
- package/dist/proxmox/generated/pve/cluster-jobs.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-metrics.d.ts +110 -0
- package/dist/proxmox/generated/pve/cluster-metrics.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-notifications-endpoints.d.ts +224 -0
- package/dist/proxmox/generated/pve/cluster-notifications-endpoints.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-notifications.d.ts +91 -0
- package/dist/proxmox/generated/pve/cluster-notifications.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-options.d.ts +85 -0
- package/dist/proxmox/generated/pve/cluster-options.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-qemu-custom-cpu-models-cputype.d.ts +48 -0
- package/dist/proxmox/generated/pve/cluster-qemu-custom-cpu-models-cputype.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-qemu-custom-cpu-models.d.ts +45 -0
- package/dist/proxmox/generated/pve/cluster-qemu-custom-cpu-models.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-replication.d.ts +130 -0
- package/dist/proxmox/generated/pve/cluster-replication.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-sdn-fabrics.d.ts +220 -0
- package/dist/proxmox/generated/pve/cluster-sdn-fabrics.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-sdn-ipams.d.ts +229 -0
- package/dist/proxmox/generated/pve/cluster-sdn-ipams.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-sdn-vnets-vnet.d.ts +229 -0
- package/dist/proxmox/generated/pve/cluster-sdn-vnets-vnet.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-sdn-vnets.d.ts +51 -0
- package/dist/proxmox/generated/pve/cluster-sdn-vnets.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-sdn-zones.d.ts +225 -0
- package/dist/proxmox/generated/pve/cluster-sdn-zones.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster-sdn.d.ts +202 -0
- package/dist/proxmox/generated/pve/cluster-sdn.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/cluster.d.ts +69 -0
- package/dist/proxmox/generated/pve/cluster.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-ceph.d.ts +167 -0
- package/dist/proxmox/generated/pve/nodes-node-ceph.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-config.d.ts +43 -0
- package/dist/proxmox/generated/pve/nodes-node-config.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-disks.d.ts +225 -0
- package/dist/proxmox/generated/pve/nodes-node-disks.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-firewall.d.ts +145 -0
- package/dist/proxmox/generated/pve/nodes-node-firewall.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-hardware.d.ts +195 -0
- package/dist/proxmox/generated/pve/nodes-node-hardware.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-firewall.d.ts +191 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-firewall.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-move-volume.d.ts +33 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-move-volume.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-mtunnel.d.ts +56 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-mtunnel.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-resize.d.ts +28 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-resize.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-rrd.d.ts +186 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid-rrd.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid.d.ts +191 -0
- package/dist/proxmox/generated/pve/nodes-node-lxc-vmid.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-network.d.ts +150 -0
- package/dist/proxmox/generated/pve/nodes-node-network.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-config.d.ts +301 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-config.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-dbus-vmstate.d.ts +170 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-dbus-vmstate.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-firewall-rules.d.ts +144 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-firewall-rules.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-move-disk.d.ts +34 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-move-disk.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-mtunnel.d.ts +137 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-mtunnel.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-status.d.ts +179 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid-status.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid.d.ts +143 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu-vmid.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu.d.ts +158 -0
- package/dist/proxmox/generated/pve/nodes-node-qemu.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-replication.d.ts +187 -0
- package/dist/proxmox/generated/pve/nodes-node-replication.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-services.d.ts +115 -0
- package/dist/proxmox/generated/pve/nodes-node-services.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-storage-storage.d.ts +202 -0
- package/dist/proxmox/generated/pve/nodes-node-storage-storage.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-storage.d.ts +40 -0
- package/dist/proxmox/generated/pve/nodes-node-storage.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-subscription.d.ts +173 -0
- package/dist/proxmox/generated/pve/nodes-node-subscription.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node-vzdump.d.ts +97 -0
- package/dist/proxmox/generated/pve/nodes-node-vzdump.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes-node.d.ts +207 -0
- package/dist/proxmox/generated/pve/nodes-node.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/nodes.d.ts +236 -0
- package/dist/proxmox/generated/pve/nodes.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/pools.d.ts +82 -0
- package/dist/proxmox/generated/pve/pools.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/storage.d.ts +159 -0
- package/dist/proxmox/generated/pve/storage.d.ts.map +1 -0
- package/dist/proxmox/generated/pve/version.d.ts +21 -0
- package/dist/proxmox/generated/pve/version.d.ts.map +1 -0
- package/dist/proxmox/generated/pve.d.ts +69 -4766
- package/dist/proxmox/generated/pve.d.ts.map +1 -1
- package/dist/proxmox/group.d.ts.map +1 -1
- package/dist/proxmox/ha-resource.d.ts.map +1 -1
- package/dist/proxmox/ha-rule.d.ts.map +1 -1
- package/dist/proxmox/index.d.ts +6 -1
- package/dist/proxmox/index.d.ts.map +1 -1
- package/dist/proxmox/index.js +1483 -300
- package/dist/proxmox/index.js.map +70 -45
- package/dist/proxmox/lxc-lifecycle.d.ts.map +1 -1
- package/dist/proxmox/metric-server-form.d.ts +11 -0
- package/dist/proxmox/metric-server-form.d.ts.map +1 -1
- package/dist/proxmox/metric-server.d.ts.map +1 -1
- package/dist/proxmox/network-apply.d.ts.map +1 -1
- package/dist/proxmox/node-network-form.d.ts +15 -0
- package/dist/proxmox/node-network-form.d.ts.map +1 -1
- package/dist/proxmox/node-network.d.ts.map +1 -1
- package/dist/proxmox/notification-matcher.d.ts.map +1 -1
- package/dist/proxmox/notification-target-endpoint.d.ts +26 -0
- package/dist/proxmox/notification-target-endpoint.d.ts.map +1 -0
- package/dist/proxmox/notification-target-form.d.ts +7 -0
- package/dist/proxmox/notification-target-form.d.ts.map +1 -1
- package/dist/proxmox/notification-target.d.ts.map +1 -1
- package/dist/proxmox/pbs-datastore-endpoint.d.ts +22 -0
- package/dist/proxmox/pbs-datastore-endpoint.d.ts.map +1 -0
- package/dist/proxmox/pbs-datastore.d.ts.map +1 -1
- package/dist/proxmox/pbs-notification-matcher.d.ts.map +1 -1
- package/dist/proxmox/pbs-notification-target-endpoint.d.ts +29 -0
- package/dist/proxmox/pbs-notification-target-endpoint.d.ts.map +1 -0
- package/dist/proxmox/pbs-notification-target-lifecycle.d.ts.map +1 -1
- package/dist/proxmox/pbs-prune-job.d.ts.map +1 -1
- package/dist/proxmox/pbs-sync-job-form.d.ts.map +1 -1
- package/dist/proxmox/pbs-verify-job.d.ts.map +1 -1
- package/dist/proxmox/pool.d.ts.map +1 -1
- package/dist/proxmox/provision-baseline.d.ts +30 -5
- package/dist/proxmox/provision-baseline.d.ts.map +1 -1
- package/dist/proxmox/qemu.d.ts +10 -0
- package/dist/proxmox/qemu.d.ts.map +1 -1
- package/dist/proxmox/replication-job.d.ts.map +1 -1
- package/dist/proxmox/resource-guard.d.ts +15 -0
- package/dist/proxmox/resource-guard.d.ts.map +1 -0
- package/dist/proxmox/resource-spec.d.ts +131 -0
- package/dist/proxmox/resource-spec.d.ts.map +1 -0
- package/dist/proxmox/resource.d.ts +17 -90
- package/dist/proxmox/resource.d.ts.map +1 -1
- package/dist/proxmox/role.d.ts.map +1 -1
- package/dist/proxmox/sdn-apply.d.ts.map +1 -1
- package/dist/proxmox/sdn-subnet.d.ts.map +1 -1
- package/dist/proxmox/sdn-vnet.d.ts.map +1 -1
- package/dist/proxmox/sdn-zone.d.ts.map +1 -1
- package/dist/proxmox/storage.d.ts.map +1 -1
- package/dist/proxmox/user.d.ts.map +1 -1
- package/dist/proxmox/zfs-pool-write.d.ts +11 -0
- package/dist/proxmox/zfs-pool-write.d.ts.map +1 -1
- package/dist/proxmox/zfs-pool.d.ts.map +1 -1
- package/docs/linux-host-measured.md +56 -0
- package/docs/linux-host.md +186 -0
- package/docs/netbox.md +103 -0
- package/docs/provision-baseline.md +34 -7
- package/docs/proxmox-lxc.md +40 -0
- package/package.json +9 -1
- package/src/linux/directory-lifecycle.ts +220 -0
- package/src/linux/directory.test.ts +132 -0
- package/src/linux/directory.ts +71 -0
- package/src/linux/fake-linux-host.ts +197 -0
- package/src/linux/fake-systemd.ts +103 -0
- package/src/linux/index.ts +32 -0
- package/src/linux/providers.ts +26 -0
- package/src/linux/region.test.ts +89 -0
- package/src/linux/region.ts +118 -0
- package/src/linux/remote-file-form.ts +96 -0
- package/src/linux/remote-file-lifecycle.test.ts +191 -0
- package/src/linux/remote-file-lifecycle.ts +161 -0
- package/src/linux/remote-file-plan.ts +154 -0
- package/src/linux/remote-file.ts +88 -0
- package/src/linux/ssh-command.test.ts +140 -0
- package/src/linux/ssh-command.ts +99 -0
- package/src/linux/ssh-runner.ts +188 -0
- package/src/linux/ssh-scripts.ts +105 -0
- package/src/linux/systemctl.ts +145 -0
- package/src/linux/unit-form.ts +183 -0
- package/src/linux/unit-handlers.ts +73 -0
- package/src/linux/unit-lifecycle.test.ts +220 -0
- package/src/linux/unit-lifecycle.ts +193 -0
- package/src/linux/unit-settle.ts +110 -0
- package/src/linux/unit.ts +81 -0
- package/src/netbox/client.test.ts +67 -0
- package/src/netbox/client.ts +146 -0
- package/src/netbox/constraint-guard.ts +57 -0
- package/src/netbox/constraints.test.ts +114 -0
- package/src/netbox/constraints.ts +152 -0
- package/src/netbox/generated/constraints/index.ts +23 -0
- package/src/netbox/generated/constraints/netbox-ipam.ts +32 -0
- package/src/netbox/index.ts +34 -0
- package/src/netbox/prefix-form.test.ts +127 -0
- package/src/netbox/prefix-form.ts +84 -0
- package/src/netbox/prefix.ts +136 -0
- package/src/netbox/resource.ts +208 -0
- package/src/netbox/values.test.ts +66 -0
- package/src/netbox/values.ts +40 -0
- package/src/openbao/index-types.test.ts +87 -0
- package/src/openbao/index.ts +15 -3
- package/src/proxmox/acl.ts +2 -0
- package/src/proxmox/api-token-form.ts +5 -0
- package/src/proxmox/apply-endpoints.ts +34 -0
- package/src/proxmox/backup-job.ts +2 -0
- package/src/proxmox/ceph-daemon-form.ts +56 -2
- package/src/proxmox/ceph-daemon.ts +10 -21
- package/src/proxmox/ceph-flag.ts +1 -0
- package/src/proxmox/ceph-fs.ts +1 -0
- package/src/proxmox/ceph-osd-write.ts +30 -4
- package/src/proxmox/ceph-pool.ts +10 -0
- package/src/proxmox/constraint-guard.ts +53 -0
- package/src/proxmox/constraints-dialect.test.ts +165 -0
- package/src/proxmox/constraints-forms.test.ts +220 -0
- package/src/proxmox/constraints-host-forms.test.ts +132 -0
- package/src/proxmox/constraints-live.test.ts +155 -0
- package/src/proxmox/constraints-node-forms.test.ts +188 -0
- package/src/proxmox/constraints-required.test.ts +172 -0
- package/src/proxmox/constraints.test.ts +205 -0
- package/src/proxmox/constraints.ts +160 -0
- package/src/proxmox/firewall-alias.ts +5 -0
- package/src/proxmox/generated/constraints/index.ts +55 -0
- package/src/proxmox/generated/constraints/pbs-config.ts +203 -0
- package/src/proxmox/generated/constraints/pve-access.ts +69 -0
- package/src/proxmox/generated/constraints/pve-cluster-backup.ts +74 -0
- package/src/proxmox/generated/constraints/pve-cluster-ceph.ts +27 -0
- package/src/proxmox/generated/constraints/pve-cluster-firewall.ts +35 -0
- package/src/proxmox/generated/constraints/pve-cluster-ha.ts +55 -0
- package/src/proxmox/generated/constraints/pve-cluster-metrics.ts +59 -0
- package/src/proxmox/generated/constraints/pve-cluster-notifications.ts +80 -0
- package/src/proxmox/generated/constraints/pve-cluster-replication.ts +43 -0
- package/src/proxmox/generated/constraints/pve-cluster-sdn.ts +90 -0
- package/src/proxmox/generated/constraints/pve-nodes-ceph.ts +57 -0
- package/src/proxmox/generated/constraints/pve-nodes-disks.ts +31 -0
- package/src/proxmox/generated/constraints/pve-nodes-lxc.ts +82 -0
- package/src/proxmox/generated/constraints/pve-nodes-network.ts +77 -0
- package/src/proxmox/generated/constraints/pve-nodes-qemu.ts +125 -0
- package/src/proxmox/generated/constraints/pve-pools.ts +31 -0
- package/src/proxmox/generated/constraints/pve-storage.ts +80 -0
- package/src/proxmox/generated/pbs/access-users.ts +137 -0
- package/src/proxmox/generated/pbs/access.ts +232 -0
- package/src/proxmox/generated/pbs/admin-datastore-store.ts +238 -0
- package/src/proxmox/generated/pbs/admin-metrics.ts +147 -0
- package/src/proxmox/generated/pbs/admin.ts +225 -0
- package/src/proxmox/generated/pbs/backup.ts +121 -0
- package/src/proxmox/generated/pbs/config-access-pam.ts +228 -0
- package/src/proxmox/generated/pbs/config-access.ts +228 -0
- package/src/proxmox/generated/pbs/config-datastore.ts +217 -0
- package/src/proxmox/generated/pbs/config-media-pool.ts +232 -0
- package/src/proxmox/generated/pbs/config-notifications-matchers.ts +187 -0
- package/src/proxmox/generated/pbs/config-notifications.ts +221 -0
- package/src/proxmox/generated/pbs/config-remote.ts +192 -0
- package/src/proxmox/generated/pbs/config-sync.ts +167 -0
- package/src/proxmox/generated/pbs/config-tape.ts +226 -0
- package/src/proxmox/generated/pbs/config-verify.ts +87 -0
- package/src/proxmox/generated/pbs/config.ts +135 -0
- package/src/proxmox/generated/pbs/nodes-node-dns.ts +229 -0
- package/src/proxmox/generated/pbs/nodes-node-services.ts +181 -0
- package/src/proxmox/generated/pbs/nodes-node.ts +244 -0
- package/src/proxmox/generated/pbs/nodes.ts +160 -0
- package/src/proxmox/generated/pbs/ping.ts +16 -0
- package/src/proxmox/generated/pbs/pull.ts +37 -0
- package/src/proxmox/generated/pbs/push.ts +36 -0
- package/src/proxmox/generated/pbs/reader.ts +41 -0
- package/src/proxmox/generated/pbs/root.ts +16 -0
- package/src/proxmox/generated/pbs/status.ts +50 -0
- package/src/proxmox/generated/pbs/tape-drive.ts +220 -0
- package/src/proxmox/generated/pbs/tape-media.ts +133 -0
- package/src/proxmox/generated/pbs/tape.ts +92 -0
- package/src/proxmox/generated/pbs/version.ts +16 -0
- package/src/proxmox/generated/pbs.ts +44 -787
- package/src/proxmox/generated/pve/access-roles.ts +168 -0
- package/src/proxmox/generated/pve/access-users.ts +155 -0
- package/src/proxmox/generated/pve/access.ts +217 -0
- package/src/proxmox/generated/pve/cluster-acme-plugins-id.ts +367 -0
- package/src/proxmox/generated/pve/cluster-acme-plugins.ts +366 -0
- package/src/proxmox/generated/pve/cluster-acme-tos.ts +232 -0
- package/src/proxmox/generated/pve/cluster-bulk-action.ts +227 -0
- package/src/proxmox/generated/pve/cluster-firewall-refs.ts +110 -0
- package/src/proxmox/generated/pve/cluster-firewall.ts +236 -0
- package/src/proxmox/generated/pve/cluster-ha.ts +203 -0
- package/src/proxmox/generated/pve/cluster-jobs.ts +190 -0
- package/src/proxmox/generated/pve/cluster-metrics.ts +116 -0
- package/src/proxmox/generated/pve/cluster-notifications-endpoints.ts +244 -0
- package/src/proxmox/generated/pve/cluster-notifications.ts +99 -0
- package/src/proxmox/generated/pve/cluster-options.ts +189 -0
- package/src/proxmox/generated/pve/cluster-qemu-custom-cpu-models-cputype.ts +272 -0
- package/src/proxmox/generated/pve/cluster-qemu-custom-cpu-models.ts +268 -0
- package/src/proxmox/generated/pve/cluster-replication.ts +127 -0
- package/src/proxmox/generated/pve/cluster-sdn-fabrics.ts +218 -0
- package/src/proxmox/generated/pve/cluster-sdn-ipams.ts +229 -0
- package/src/proxmox/generated/pve/cluster-sdn-vnets-vnet.ts +245 -0
- package/src/proxmox/generated/pve/cluster-sdn-vnets.ts +49 -0
- package/src/proxmox/generated/pve/cluster-sdn-zones.ts +224 -0
- package/src/proxmox/generated/pve/cluster-sdn.ts +201 -0
- package/src/proxmox/generated/pve/cluster.ts +71 -0
- package/src/proxmox/generated/pve/nodes-node-ceph.ts +167 -0
- package/src/proxmox/generated/pve/nodes-node-config.ts +56 -0
- package/src/proxmox/generated/pve/nodes-node-disks.ts +237 -0
- package/src/proxmox/generated/pve/nodes-node-firewall.ts +239 -0
- package/src/proxmox/generated/pve/nodes-node-hardware.ts +215 -0
- package/src/proxmox/generated/pve/nodes-node-lxc-vmid-firewall.ts +232 -0
- package/src/proxmox/generated/pve/nodes-node-lxc-vmid-move-volume.ts +1059 -0
- package/src/proxmox/generated/pve/nodes-node-lxc-vmid-mtunnel.ts +49 -0
- package/src/proxmox/generated/pve/nodes-node-lxc-vmid-resize.ts +285 -0
- package/src/proxmox/generated/pve/nodes-node-lxc-vmid-rrd.ts +184 -0
- package/src/proxmox/generated/pve/nodes-node-lxc-vmid.ts +240 -0
- package/src/proxmox/generated/pve/nodes-node-network.ts +234 -0
- package/src/proxmox/generated/pve/nodes-node-qemu-vmid-config.ts +441 -0
- package/src/proxmox/generated/pve/nodes-node-qemu-vmid-dbus-vmstate.ts +215 -0
- package/src/proxmox/generated/pve/nodes-node-qemu-vmid-firewall-rules.ts +145 -0
- package/src/proxmox/generated/pve/nodes-node-qemu-vmid-move-disk.ts +664 -0
- package/src/proxmox/generated/pve/nodes-node-qemu-vmid-mtunnel.ts +188 -0
- package/src/proxmox/generated/pve/nodes-node-qemu-vmid-status.ts +233 -0
- package/src/proxmox/generated/pve/nodes-node-qemu-vmid.ts +187 -0
- package/src/proxmox/generated/pve/nodes-node-qemu.ts +204 -0
- package/src/proxmox/generated/pve/nodes-node-replication.ts +187 -0
- package/src/proxmox/generated/pve/nodes-node-services.ts +221 -0
- package/src/proxmox/generated/pve/nodes-node-storage-storage.ts +226 -0
- package/src/proxmox/generated/pve/nodes-node-storage.ts +40 -0
- package/src/proxmox/generated/pve/nodes-node-subscription.ts +168 -0
- package/src/proxmox/generated/pve/nodes-node-vzdump.ts +96 -0
- package/src/proxmox/generated/pve/nodes-node.ts +211 -0
- package/src/proxmox/generated/pve/nodes.ts +235 -0
- package/src/proxmox/generated/pve/pools.ts +78 -0
- package/src/proxmox/generated/pve/storage.ts +213 -0
- package/src/proxmox/generated/pve/version.ts +21 -0
- package/src/proxmox/generated/pve.ts +69 -7403
- package/src/proxmox/group.ts +2 -0
- package/src/proxmox/ha-resource.ts +5 -0
- package/src/proxmox/ha-rule.ts +2 -0
- package/src/proxmox/index.ts +12 -0
- package/src/proxmox/lxc-interior.test.ts +77 -0
- package/src/proxmox/lxc-lifecycle.ts +48 -9
- package/src/proxmox/metric-server-form.ts +10 -0
- package/src/proxmox/metric-server.ts +11 -2
- package/src/proxmox/network-apply.ts +4 -0
- package/src/proxmox/node-network-form.ts +19 -0
- package/src/proxmox/node-network.ts +9 -3
- package/src/proxmox/notification-matcher.ts +5 -0
- package/src/proxmox/notification-target-endpoint.ts +46 -0
- package/src/proxmox/notification-target-form.ts +11 -0
- package/src/proxmox/notification-target.ts +5 -2
- package/src/proxmox/pbs-datastore-endpoint.ts +29 -0
- package/src/proxmox/pbs-datastore.ts +8 -1
- package/src/proxmox/pbs-notification-matcher.ts +5 -0
- package/src/proxmox/pbs-notification-target-endpoint.ts +45 -0
- package/src/proxmox/pbs-notification-target-lifecycle.ts +16 -14
- package/src/proxmox/pbs-prune-job.ts +2 -0
- package/src/proxmox/pbs-sync-job-form.ts +2 -0
- package/src/proxmox/pbs-verify-job.ts +2 -0
- package/src/proxmox/pool.ts +2 -0
- package/src/proxmox/provision-baseline.test.ts +38 -0
- package/src/proxmox/provision-baseline.ts +73 -14
- package/src/proxmox/provision-bootstrap.test.ts +51 -0
- package/src/proxmox/qemu.ts +9 -1
- package/src/proxmox/replication-job.ts +5 -0
- package/src/proxmox/resource-guard.ts +61 -0
- package/src/proxmox/resource-spec.ts +129 -0
- package/src/proxmox/resource.ts +52 -93
- package/src/proxmox/role.ts +2 -0
- package/src/proxmox/sdn-apply.ts +4 -0
- package/src/proxmox/sdn-subnet.ts +5 -0
- package/src/proxmox/sdn-vnet.ts +2 -0
- package/src/proxmox/sdn-zone.ts +2 -0
- package/src/proxmox/storage.ts +2 -0
- package/src/proxmox/user.ts +2 -0
- package/src/proxmox/zfs-pool-write.ts +12 -0
- package/src/proxmox/zfs-pool.ts +2 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One authenticated call to the NetBox REST API at `/api`.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ `Authorization: Token <value>`, NOT `Bearer`. NetBox is Django REST Framework using DRF's own
|
|
5
|
+
* `TokenAuthentication`. MEASURED on this estate's own instance while it was up: `Bearer`
|
|
6
|
+
* returns 401 and `Token` returns 200. ⛔ A wrong scheme and a wrong credential are
|
|
7
|
+
* indistinguishable in the response, which is why this is written down rather than inferred.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ NETBOX DOES NOT WRAP A DETAIL RESPONSE THE WAY PVE DOES — a GET of one object returns the
|
|
10
|
+
* object. A LIST, however, IS wrapped: `{count, next, previous, results: [...]}`. A caller that
|
|
11
|
+
* treats a list like a detail sees `undefined` and calls a healthy object absent, which plans a
|
|
12
|
+
* create over something that already exists.
|
|
13
|
+
*
|
|
14
|
+
* ⛔ THE TOKEN IS NEVER A PROP. It is read from `NETBOX_TOKEN` at call time only. Alchemy persists
|
|
15
|
+
* attributes unencrypted; nothing stored here may be a credential.
|
|
16
|
+
*/
|
|
17
|
+
import * as Effect from 'effect/Effect';
|
|
18
|
+
import * as HttpClient from 'effect/unstable/http/HttpClient';
|
|
19
|
+
/**
|
|
20
|
+
* The instance, from `NETBOX_URL`. Trailing slash stripped.
|
|
21
|
+
*
|
|
22
|
+
* ⛔ NO DEFAULT HOSTNAME AND NO DEFAULT PORT. A published package that fell back to a loopback
|
|
23
|
+
* address would let a consumer who forgot the variable watch every call fail against a machine
|
|
24
|
+
* that is not theirs, instead of being told which variable is missing.
|
|
25
|
+
* ⚠️ Read at CALL time, never at module scope — a value captured at import is pinned to whatever
|
|
26
|
+
* the first isolate saw.
|
|
27
|
+
*/
|
|
28
|
+
export declare const apiBase: () => string;
|
|
29
|
+
export declare class NetboxError extends Error {
|
|
30
|
+
readonly status: number;
|
|
31
|
+
readonly method: string;
|
|
32
|
+
readonly path: string;
|
|
33
|
+
constructor(status: number, method: string, path: string, detail: string);
|
|
34
|
+
}
|
|
35
|
+
/** A NetBox list response. ⚠️ Paginated: `next` is a URL, not a cursor to guess at. */
|
|
36
|
+
export interface NetboxList<T> {
|
|
37
|
+
readonly count: number;
|
|
38
|
+
readonly next: string | null;
|
|
39
|
+
readonly results: readonly T[];
|
|
40
|
+
}
|
|
41
|
+
export type NetboxRow = Record<string, unknown>;
|
|
42
|
+
/** One JSON call. Returns the parsed body, or `undefined` when the response is empty (DELETE). */
|
|
43
|
+
export declare const netbox: <T>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, body?: Record<string, unknown>) => Effect.Effect<T, NetboxError, HttpClient.HttpClient>;
|
|
44
|
+
/**
|
|
45
|
+
* The single row a filtered list returns, or `undefined`.
|
|
46
|
+
*
|
|
47
|
+
* ⛔ MORE THAN ONE MATCH IS A DEFECT, NOT A REASON TO TAKE THE FIRST. A `locate` filter that is
|
|
48
|
+
* not unique would let adopt bind to whichever row NetBox happened to order first, and the next
|
|
49
|
+
* plan would bind to the other one and report drift that is not there.
|
|
50
|
+
*/
|
|
51
|
+
export declare const soleMatch: <T>(rows: readonly T[], describe: string) => T | undefined;
|
|
52
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/netbox/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAK9D;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,QAAO,MAQ1B,CAAC;AAEF,qBAAa,WAAY,SAAQ,KAAK;IAElC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAHvB,YACW,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EAIf;CACF;AAkBD,uFAAuF;AACvF,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;CAChC;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhD,kGAAkG;AAClG,eAAO,MAAM,MAAM,GAAI,CAAC,UACd,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,QAC7C,MAAM,SACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,yDA8C5B,CAAC;AAEL;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,QAAQ,SAAS,CAAC,EAAE,YAAY,MAAM,KAAG,CAAC,GAAG,SAQvE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generated tables, looked up by endpoint, and the refusal that stops a plan.
|
|
3
|
+
*
|
|
4
|
+
* ★ ONE FILE BETWEEN THE PROVIDERS AND THE GENERATED DATA, so `resource.ts` gains three lines
|
|
5
|
+
* rather than an import of the generated module and a merge, and so a family that writes its
|
|
6
|
+
* own handlers reaches the same check by the same name.
|
|
7
|
+
*
|
|
8
|
+
* ⛔ AN UNKNOWN KEY IS A DEFECT, NOT A REASON TO SKIP THE CHECK. Silently passing would put us
|
|
9
|
+
* back where this started: a declaration nothing checked, and a plan that says so in no way at
|
|
10
|
+
* all. The generator resolves every key in its source scan against the vendor document, so a
|
|
11
|
+
* key that is absent here means the tables were not regenerated — which the message says.
|
|
12
|
+
*/
|
|
13
|
+
import * as Effect from 'effect/Effect';
|
|
14
|
+
import { type EndpointConstraints, type EndpointKey, type NetboxBody } from './constraints.ts';
|
|
15
|
+
import { NETBOX_CONSTRAINTS } from './generated/constraints/index.ts';
|
|
16
|
+
export { NETBOX_CONSTRAINTS };
|
|
17
|
+
export declare const constraintsFor: (key: EndpointKey) => EndpointConstraints;
|
|
18
|
+
/** Every vendor rule this body breaks. Pure — a test calls it with a literal body. */
|
|
19
|
+
export declare const bodyViolations: (key: EndpointKey, body: NetboxBody, presence: boolean) => readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* ⛔ `Effect.die`, NOT `Effect.fail`. A declaration the vendor would reject is a DEFECT in the
|
|
22
|
+
* stack file, not a recoverable condition: there is no retry and no fallback that makes a
|
|
23
|
+
* 201-character description legal.
|
|
24
|
+
*/
|
|
25
|
+
export declare const guardBody: (key: EndpointKey | undefined, body: NetboxBody, presence: boolean) => Effect.Effect<void>;
|
|
26
|
+
//# sourceMappingURL=constraint-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraint-guard.d.ts","sourceRoot":"","sources":["../../src/netbox/constraint-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,UAAU,EAGhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,eAAO,MAAM,cAAc,QAAS,WAAW,KAAG,mBASjD,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,cAAc,QACpB,WAAW,QACV,UAAU,YACN,OAAO,KAChB,SAAS,MAAM,EAAyD,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,SAAS,QACf,WAAW,GAAG,SAAS,QACtB,UAAU,YACN,OAAO,KAChB,MAAM,CAAC,MAAM,CAAC,IAAI,CAKjB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetBox's own rules, checked here, before the request is built.
|
|
3
|
+
*
|
|
4
|
+
* 🔴 THE INCIDENT THIS PATTERN EXISTS FOR, 2026-09-22 (Proxmox, not NetBox). `homeflare-proxmox`'s
|
|
5
|
+
* first `deploy:pbs` adopted ten objects and then failed its one create:
|
|
6
|
+
* `comment: value may only be 128 characters long`. Half a deploy in, on the server, from a
|
|
7
|
+
* limit the vendor publishes in its own schema and the generated type did not carry. Plan was
|
|
8
|
+
* green, `bun run check` was green, the adopt verifier was green. ★ NetBox gets the same
|
|
9
|
+
* treatment BEFORE its first write rather than after it.
|
|
10
|
+
*
|
|
11
|
+
* ★ SO THE TABLE IS GENERATED AND THIS FILE IS THE READER. `generated/constraints/*` is emitted
|
|
12
|
+
* from NetBox's own OpenAPI document by `bun codegen/netbox.ts`; nothing here is hand-typed,
|
|
13
|
+
* because a hand-typed limit is tribal knowledge that does not run.
|
|
14
|
+
*
|
|
15
|
+
* ⛔ A SEPARATE READER FROM `../proxmox/constraints.ts`, AND IT IS NOT DUPLICATION. That one
|
|
16
|
+
* checks a `PveForm` — every value already a string, because PVE takes form encoding. A NetBox
|
|
17
|
+
* body is JSON: a number stays a number, a boolean stays a boolean, a foreign key is an
|
|
18
|
+
* integer, and `String(value)` on any of them would make `minimum: 0` pass for `false` and
|
|
19
|
+
* `maxLength` meaningless. Sharing one reader would mean stringifying at the door, which is
|
|
20
|
+
* exactly the mangling the Proxmox version's own ⛔ warns about.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ WHAT IT DELIBERATELY DOES NOT ENFORCE, so nobody reads a green plan as more than it is:
|
|
23
|
+
* - a `format` NAME (`uri`, `email`, `date-time`): a validator DRF implements server-side.
|
|
24
|
+
* Recorded, never checked.
|
|
25
|
+
* - a pattern the generator could not carry faithfully (codegen/py-pattern.ts). Recorded
|
|
26
|
+
* verbatim as `patternSource`, never checked.
|
|
27
|
+
* - UNIQUENESS, VRF containment, custom-field validators, and every other rule that lives in
|
|
28
|
+
* Django rather than in the schema. Those still arrive as a server-side 400.
|
|
29
|
+
* Each is a fact in the table rather than a guess, which is the rule this follows: if the
|
|
30
|
+
* vendor did not state it, it is not enforced and the table says so.
|
|
31
|
+
*/
|
|
32
|
+
export interface ParamConstraint {
|
|
33
|
+
readonly type?: string;
|
|
34
|
+
/** From the schema's `required` array. ⚠️ Checked on CREATE only — see `violations`. */
|
|
35
|
+
readonly required?: boolean;
|
|
36
|
+
readonly maxLength?: number;
|
|
37
|
+
readonly minLength?: number;
|
|
38
|
+
readonly minimum?: number;
|
|
39
|
+
readonly maximum?: number;
|
|
40
|
+
readonly enum?: readonly string[];
|
|
41
|
+
/** A JavaScript-safe translation. Absent when Python's dialect could not be carried over. */
|
|
42
|
+
readonly pattern?: string;
|
|
43
|
+
/** The vendor's own spelling, always — what a violation message quotes, and the audit trail. */
|
|
44
|
+
readonly patternSource?: string;
|
|
45
|
+
/** DRF's server-side validator name. Recorded so a reader knows what is NOT checked here. */
|
|
46
|
+
readonly format?: string;
|
|
47
|
+
readonly default?: string;
|
|
48
|
+
}
|
|
49
|
+
export type EndpointConstraints = Readonly<Record<string, ParamConstraint>>;
|
|
50
|
+
/** `netbox:POST /api/ipam/prefixes/` — exactly how the generated tables key an endpoint. */
|
|
51
|
+
export type EndpointKey = string;
|
|
52
|
+
/** A NetBox request body: JSON, with the types the schema declares. */
|
|
53
|
+
export type NetboxBody = Record<string, unknown>;
|
|
54
|
+
export interface ViolationOptions {
|
|
55
|
+
/**
|
|
56
|
+
* Check that every schema-required property is present.
|
|
57
|
+
*
|
|
58
|
+
* ⛔ CREATE ONLY. A NetBox update is a PATCH and is deliberately PARTIAL — it carries the fields
|
|
59
|
+
* that changed and nothing else — so requiring presence there would refuse every ordinary
|
|
60
|
+
* edit.
|
|
61
|
+
*/
|
|
62
|
+
readonly presence?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Every vendor rule this body breaks, in the order the properties are declared. Pure: no network,
|
|
66
|
+
* no clock, no environment — so `diff` can call it and a test can call it with a literal.
|
|
67
|
+
*
|
|
68
|
+
* ⚠️ A KEY THE TABLE DOES NOT MENTION IS NOT AN ERROR. The table carries the constrained
|
|
69
|
+
* properties, not every property, and a body may legitimately send an unconstrained one.
|
|
70
|
+
* ⚠️ `null` IS A VALUE, NOT AN ABSENCE. NetBox uses explicit `null` to CLEAR a nullable foreign
|
|
71
|
+
* key, so it must not trip the presence check — and no string or number rule applies to it.
|
|
72
|
+
*/
|
|
73
|
+
export declare const violations: (table: EndpointConstraints, body: NetboxBody, options?: ViolationOptions) => readonly string[];
|
|
74
|
+
/** The message a plan dies with. ⛔ Names the endpoint, because the rule belongs to the vendor. */
|
|
75
|
+
export declare const refusal: (endpoint: EndpointKey, found: readonly string[]) => string;
|
|
76
|
+
//# sourceMappingURL=constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../src/netbox/constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AAE5E,4FAA4F;AAC5F,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAkDD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,UACd,mBAAmB,QACpB,UAAU,YACP,gBAAgB,KACxB,SAAS,MAAM,EAejB,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,OAAO,aAAc,WAAW,SAAS,SAAS,MAAM,EAAE,KAAG,MAGG,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every generated NetBox constraint table, merged — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/netbox.ts
|
|
5
|
+
*
|
|
6
|
+
* ⚠️ EVERY KEY IS PREFIXED `netbox:` FOR THE SAME REASON THE PROXMOX TABLES ARE PREFIXED. One
|
|
7
|
+
* estate runs several vendors and the reader is shared; an unprefixed `POST /api/…` would be
|
|
8
|
+
* one vendor away from colliding.
|
|
9
|
+
*/
|
|
10
|
+
import type { EndpointConstraints } from '../../constraints.ts';
|
|
11
|
+
export declare const NETBOX_CONSTRAINTS: Readonly<Record<string, EndpointConstraints>>;
|
|
12
|
+
/**
|
|
13
|
+
* sha256 of the merged table, truncated.
|
|
14
|
+
*
|
|
15
|
+
* ★ A DIGEST OF THE DATA, NOT OF THE FILE TEXT, so reformatting is not a stale generation while
|
|
16
|
+
* changing a 200 to a 201 by hand is. `tests/netbox-manifest.test.ts` recomputes it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const NETBOX_CONSTRAINTS_DIGEST = "1de1cebe7491d94f";
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/netbox/generated/constraints/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAE5E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated NetBox REST API (OpenAPI 3.0.3) request-body constraints for `/api/ipam` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/netbox.ts
|
|
5
|
+
* Manifest entry: `netbox-openapi` — NetBox REST API (OpenAPI 3.0.3) 4.7.0
|
|
6
|
+
* sha256 be7f971179b1d6ba, vendor repository, pinned to the release tag
|
|
7
|
+
* contrib/openapi.json in netbox-community/netbox, at tag v4.7.0
|
|
8
|
+
*
|
|
9
|
+
* 2 of this product's 949 POST/PUT/PATCH/DELETE endpoints are tabled across all
|
|
10
|
+
* areas: the ones this package writes to, named in its own source. Every other vendor write
|
|
11
|
+
* endpoint is UNTABLED and therefore unchecked at plan time.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ A `patternSource` with no `pattern` beside it could NOT be carried into a JavaScript
|
|
14
|
+
* RegExp faithfully — Python's `\w` is Unicode and JavaScript's is ASCII
|
|
15
|
+
* (codegen/py-pattern.ts). It is recorded and NOT enforced.
|
|
16
|
+
* ⚠️ A FOREIGN KEY CARRIES ONLY ITS TYPE. `tenant`, `vlan`, `role` and friends are
|
|
17
|
+
* `integer|object` in the schema, and the related object's own rules do not govern them.
|
|
18
|
+
*/
|
|
19
|
+
import type { EndpointConstraints } from '../../constraints.ts';
|
|
20
|
+
export declare const NETBOX_IPAM_CONSTRAINTS: Readonly<Record<string, EndpointConstraints>>;
|
|
21
|
+
//# sourceMappingURL=netbox-ipam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"netbox-ipam.d.ts","sourceRoot":"","sources":["../../../../src/netbox/generated/constraints/netbox-ipam.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAWjF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetBox providers for Alchemy.
|
|
3
|
+
*
|
|
4
|
+
* ⛔ THIS BARREL IS THE PUBLIC API, AND IT IS DELIBERATELY SMALLER THAN THE DIRECTORY. These are
|
|
5
|
+
* the symbols a real stack consumes; the rest of the files are internals a provider needs but a
|
|
6
|
+
* consumer should not depend on. An `export *` here would publish every helper as API and make
|
|
7
|
+
* the next refactor a breaking change.
|
|
8
|
+
* ★ The constraint reader IS exported, because a consumer writing its own family needs the same
|
|
9
|
+
* guard — and because a table nobody can reach is a table nobody uses.
|
|
10
|
+
*/
|
|
11
|
+
export { NetboxError, apiBase } from './client.ts';
|
|
12
|
+
export { NETBOX_CONSTRAINTS, bodyViolations, constraintsFor, guardBody, } from './constraint-guard.ts';
|
|
13
|
+
export { type EndpointConstraints, type EndpointKey, type NetboxBody, type ParamConstraint, refusal, violations, } from './constraints.ts';
|
|
14
|
+
export { NETBOX_CONSTRAINTS_DIGEST } from './generated/constraints/index.ts';
|
|
15
|
+
export { NetboxPrefix, NetboxPrefixProvider, type PrefixAttributes, type PrefixProps, type PrefixStatus, } from './prefix.ts';
|
|
16
|
+
export { type NetboxRequirements, type NetboxSpec, netboxHandlers } from './resource.ts';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/netbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,OAAO,EACP,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
// src/netbox/client.ts
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
4
|
+
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
|
|
5
|
+
var PATH_PREFIX = "/api";
|
|
6
|
+
var apiBase = () => {
|
|
7
|
+
const raw = process.env["NETBOX_URL"];
|
|
8
|
+
if (raw === undefined || raw.trim() === "") {
|
|
9
|
+
throw new Error("NETBOX_URL is not set. Point it at your NetBox instance, e.g. https://netbox.example.com");
|
|
10
|
+
}
|
|
11
|
+
return raw.trim().replace(/\/$/, "");
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
class NetboxError extends Error {
|
|
15
|
+
status;
|
|
16
|
+
method;
|
|
17
|
+
path;
|
|
18
|
+
constructor(status, method, path, detail) {
|
|
19
|
+
super(`NetBox ${method} ${path} -> ${String(status)}: ${detail}`);
|
|
20
|
+
this.status = status;
|
|
21
|
+
this.method = method;
|
|
22
|
+
this.path = path;
|
|
23
|
+
this.name = "NetboxError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
var token = () => Effect.gen(function* () {
|
|
27
|
+
const raw = process.env["NETBOX_TOKEN"];
|
|
28
|
+
if (raw === undefined || raw.trim() === "") {
|
|
29
|
+
return yield* Effect.fail(new NetboxError(0, "GET", "", "NETBOX_TOKEN is unset. Mint a scoped token and export it — never store it in Alchemy props."));
|
|
30
|
+
}
|
|
31
|
+
return raw.trim();
|
|
32
|
+
});
|
|
33
|
+
var netbox = (method, path, body) => Effect.gen(function* () {
|
|
34
|
+
const credential = yield* token();
|
|
35
|
+
const url = `${apiBase()}${PATH_PREFIX}/${path.replace(/^\//, "")}`;
|
|
36
|
+
const client = yield* HttpClient.HttpClient;
|
|
37
|
+
const request = HttpClientRequest.make(method)(url).pipe(HttpClientRequest.setHeaders({
|
|
38
|
+
Accept: "application/json",
|
|
39
|
+
Authorization: `Token ${credential}`
|
|
40
|
+
}), body === undefined ? (self) => self : HttpClientRequest.bodyText(JSON.stringify(body), "application/json"));
|
|
41
|
+
const response = yield* client.execute(request).pipe(Effect.mapError((cause) => new NetboxError(0, method, path, String(cause))));
|
|
42
|
+
if (response.status < 200 || response.status >= 300) {
|
|
43
|
+
const detail = yield* response.text.pipe(Effect.orElseSucceed(() => ""));
|
|
44
|
+
return yield* Effect.fail(new NetboxError(response.status, method, path, detail.slice(0, 300)));
|
|
45
|
+
}
|
|
46
|
+
const text = yield* response.text.pipe(Effect.mapError((cause) => new NetboxError(0, method, path, String(cause))));
|
|
47
|
+
return text === "" ? undefined : JSON.parse(text);
|
|
48
|
+
});
|
|
49
|
+
var soleMatch = (rows, describe) => {
|
|
50
|
+
if (rows.length > 1) {
|
|
51
|
+
throw new Error(`${describe} matched ${String(rows.length)} NetBox objects. An object's identity must be ` + "unique; narrow it (the VRF, the site, the tenant) rather than taking the first row.");
|
|
52
|
+
}
|
|
53
|
+
return rows[0];
|
|
54
|
+
};
|
|
55
|
+
// src/netbox/constraint-guard.ts
|
|
56
|
+
import * as Effect2 from "effect/Effect";
|
|
57
|
+
|
|
58
|
+
// src/netbox/constraints.ts
|
|
59
|
+
var lengthOf = (value) => [...value].length;
|
|
60
|
+
var checkString = (name, value, rule) => {
|
|
61
|
+
const out = [];
|
|
62
|
+
if (rule.maxLength !== undefined && lengthOf(value) > rule.maxLength) {
|
|
63
|
+
out.push(`${name}: at most ${String(rule.maxLength)} characters`);
|
|
64
|
+
}
|
|
65
|
+
if (rule.minLength !== undefined && lengthOf(value) < rule.minLength) {
|
|
66
|
+
out.push(`${name}: at least ${String(rule.minLength)} characters`);
|
|
67
|
+
}
|
|
68
|
+
if (rule.enum !== undefined && !rule.enum.includes(value)) {
|
|
69
|
+
out.push(`${name}: must be one of ${rule.enum.join(", ")}`);
|
|
70
|
+
}
|
|
71
|
+
if (rule.pattern !== undefined && !new RegExp(rule.pattern).test(value)) {
|
|
72
|
+
out.push(`${name}: must match ${rule.patternSource ?? rule.pattern}`);
|
|
73
|
+
}
|
|
74
|
+
return out;
|
|
75
|
+
};
|
|
76
|
+
var checkNumber = (name, value, rule) => {
|
|
77
|
+
const out = [];
|
|
78
|
+
if (!Number.isFinite(value))
|
|
79
|
+
return out;
|
|
80
|
+
if (rule.minimum !== undefined && value < rule.minimum) {
|
|
81
|
+
out.push(`${name}: at least ${String(rule.minimum)}`);
|
|
82
|
+
}
|
|
83
|
+
if (rule.maximum !== undefined && value > rule.maximum) {
|
|
84
|
+
out.push(`${name}: at most ${String(rule.maximum)}`);
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
};
|
|
88
|
+
var checkValue = (name, value, rule) => {
|
|
89
|
+
if (typeof value === "string")
|
|
90
|
+
return checkString(name, value, rule);
|
|
91
|
+
if (typeof value === "number")
|
|
92
|
+
return checkNumber(name, value, rule);
|
|
93
|
+
return [];
|
|
94
|
+
};
|
|
95
|
+
var violations = (table, body, options = {}) => {
|
|
96
|
+
const out = [];
|
|
97
|
+
for (const [name, rule] of Object.entries(table)) {
|
|
98
|
+
if (!Object.hasOwn(body, name)) {
|
|
99
|
+
if (options.presence === true && rule.required === true)
|
|
100
|
+
out.push(`${name}: required`);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const value = body[name];
|
|
104
|
+
for (const item of Array.isArray(value) ? value : [value]) {
|
|
105
|
+
out.push(...checkValue(name, item, rule));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
};
|
|
110
|
+
var refusal = (endpoint, found) => `${endpoint} would be rejected by the vendor:
|
|
111
|
+
- ${found.join(`
|
|
112
|
+
- `)}
|
|
113
|
+
` + "These are NetBox's own limits, read from its published OpenAPI document " + "(packages/alchemy/src/netbox/generated/constraints). Fix the declaration.";
|
|
114
|
+
|
|
115
|
+
// src/netbox/generated/constraints/netbox-ipam.ts
|
|
116
|
+
var NETBOX_IPAM_CONSTRAINTS = {
|
|
117
|
+
"netbox:PATCH /api/ipam/prefixes/{id}/": {
|
|
118
|
+
description: { maxLength: 200, type: "string" },
|
|
119
|
+
prefix: { minLength: 1, type: "string" },
|
|
120
|
+
status: { enum: ["container", "active", "reserved", "deprecated"], type: "string" }
|
|
121
|
+
},
|
|
122
|
+
"netbox:POST /api/ipam/prefixes/": {
|
|
123
|
+
description: { maxLength: 200, type: "string" },
|
|
124
|
+
prefix: { minLength: 1, required: true, type: "string" },
|
|
125
|
+
status: { enum: ["container", "active", "reserved", "deprecated"], type: "string" }
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/netbox/generated/constraints/index.ts
|
|
130
|
+
var NETBOX_CONSTRAINTS = {
|
|
131
|
+
...NETBOX_IPAM_CONSTRAINTS
|
|
132
|
+
};
|
|
133
|
+
var NETBOX_CONSTRAINTS_DIGEST = "1de1cebe7491d94f";
|
|
134
|
+
|
|
135
|
+
// src/netbox/constraint-guard.ts
|
|
136
|
+
var constraintsFor = (key) => {
|
|
137
|
+
const table = NETBOX_CONSTRAINTS[key];
|
|
138
|
+
if (table === undefined) {
|
|
139
|
+
throw new Error(`no vendor constraint table for '${key}'. It is named in this package but not generated: ` + "run `bun codegen/netbox.ts` (see codegen/README.md).");
|
|
140
|
+
}
|
|
141
|
+
return table;
|
|
142
|
+
};
|
|
143
|
+
var bodyViolations = (key, body, presence) => violations(constraintsFor(key), body, { presence });
|
|
144
|
+
var guardBody = (key, body, presence) => Effect2.suspend(() => {
|
|
145
|
+
if (key === undefined)
|
|
146
|
+
return Effect2.void;
|
|
147
|
+
const found = bodyViolations(key, body, presence);
|
|
148
|
+
return found.length === 0 ? Effect2.void : Effect2.die(new Error(refusal(key, found)));
|
|
149
|
+
});
|
|
150
|
+
// src/netbox/prefix.ts
|
|
151
|
+
import { Resource } from "alchemy";
|
|
152
|
+
import * as Provider from "alchemy/Provider";
|
|
153
|
+
import * as Effect4 from "effect/Effect";
|
|
154
|
+
|
|
155
|
+
// src/netbox/prefix-form.ts
|
|
156
|
+
var DEFAULT_STATUS = "active";
|
|
157
|
+
var settled = (props) => ({
|
|
158
|
+
isPool: props.isPool ?? false,
|
|
159
|
+
markUtilized: props.markUtilized ?? false,
|
|
160
|
+
status: props.status ?? DEFAULT_STATUS
|
|
161
|
+
});
|
|
162
|
+
var prefixBody = (props) => {
|
|
163
|
+
const fixed = settled(props);
|
|
164
|
+
const out = {
|
|
165
|
+
is_pool: fixed.isPool,
|
|
166
|
+
mark_utilized: fixed.markUtilized,
|
|
167
|
+
prefix: props.prefix,
|
|
168
|
+
status: fixed.status
|
|
169
|
+
};
|
|
170
|
+
if (props.description !== undefined)
|
|
171
|
+
out["description"] = props.description;
|
|
172
|
+
if (props.comments !== undefined)
|
|
173
|
+
out["comments"] = props.comments;
|
|
174
|
+
if (props.vrf !== undefined)
|
|
175
|
+
out["vrf"] = props.vrf;
|
|
176
|
+
if (props.tenant !== undefined)
|
|
177
|
+
out["tenant"] = props.tenant;
|
|
178
|
+
if (props.vlan !== undefined)
|
|
179
|
+
out["vlan"] = props.vlan;
|
|
180
|
+
return out;
|
|
181
|
+
};
|
|
182
|
+
var prefixMatches = (attributes, props) => {
|
|
183
|
+
const fixed = settled(props);
|
|
184
|
+
return attributes.status === fixed.status && attributes.isPool === fixed.isPool && attributes.markUtilized === fixed.markUtilized && (props.description === undefined || attributes.description === props.description) && (props.comments === undefined || attributes.comments === props.comments) && (props.tenant === undefined || attributes.tenant === props.tenant) && (props.vlan === undefined || attributes.vlan === props.vlan);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// src/netbox/resource.ts
|
|
188
|
+
import { isResolved } from "alchemy/Diff";
|
|
189
|
+
import * as Effect3 from "effect/Effect";
|
|
190
|
+
var absentOn404 = (io) => io.pipe(Effect3.catchIf((cause) => cause instanceof NetboxError && cause.status === 404, () => Effect3.succeed(undefined)));
|
|
191
|
+
var LOCATE_PAGE = 20;
|
|
192
|
+
var query = (pairs) => new URLSearchParams([
|
|
193
|
+
...pairs.map(([k, v]) => [k, v]),
|
|
194
|
+
["limit", String(LOCATE_PAGE)]
|
|
195
|
+
]).toString();
|
|
196
|
+
var netboxOperations = (spec) => {
|
|
197
|
+
const fetchLive = (props) => absentOn404(netbox("GET", `${spec.collection}/?${query(spec.locate(props))}`)).pipe(Effect3.map((list) => {
|
|
198
|
+
if (list !== undefined && list.count > LOCATE_PAGE) {
|
|
199
|
+
throw new Error(`${spec.describe(props)}: the locate filter matched ${String(list.count)} rows, more ` + `than the ${String(LOCATE_PAGE)}-row page this reads. That is not a natural key — ` + "narrow the filter rather than paging through candidates.");
|
|
200
|
+
}
|
|
201
|
+
const rows = list?.results ?? [];
|
|
202
|
+
const narrow = spec.identifies;
|
|
203
|
+
return soleMatch(narrow === undefined ? rows : rows.filter((row) => narrow(row, props)), spec.describe(props));
|
|
204
|
+
}));
|
|
205
|
+
const objectPath = (live) => `${spec.collection}/${String(live["id"])}`;
|
|
206
|
+
const read = (props) => fetchLive(props).pipe(Effect3.map((live) => live === undefined ? undefined : spec.attributes(live, props)));
|
|
207
|
+
return {
|
|
208
|
+
read,
|
|
209
|
+
diff: (news, output) => Effect3.gen(function* () {
|
|
210
|
+
if (output === undefined || !isResolved(news))
|
|
211
|
+
return;
|
|
212
|
+
const live = yield* read(news);
|
|
213
|
+
if (live === undefined)
|
|
214
|
+
return { action: "update" };
|
|
215
|
+
if (spec.matches(live, news))
|
|
216
|
+
return { action: "noop" };
|
|
217
|
+
return spec.updateBody === undefined ? { action: "replace" } : { action: "update" };
|
|
218
|
+
}),
|
|
219
|
+
reconcile: (news) => Effect3.gen(function* () {
|
|
220
|
+
const before = yield* fetchLive(news);
|
|
221
|
+
if (before === undefined) {
|
|
222
|
+
const body = spec.createBody(news);
|
|
223
|
+
yield* guardBody(spec.endpoint.create, body, true);
|
|
224
|
+
yield* netbox("POST", `${spec.collection}/`, body);
|
|
225
|
+
} else if (spec.updateBody !== undefined) {
|
|
226
|
+
const mapped = spec.attributes(before, news);
|
|
227
|
+
if (mapped !== undefined && !spec.matches(mapped, news)) {
|
|
228
|
+
const body = spec.updateBody(news);
|
|
229
|
+
yield* guardBody(spec.endpoint.update, body, false);
|
|
230
|
+
if (Object.keys(body).length > 0) {
|
|
231
|
+
yield* netbox("PATCH", `${objectPath(before)}/`, body);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const after = yield* read(news);
|
|
236
|
+
if (after === undefined) {
|
|
237
|
+
return yield* Effect3.die(new Error(`${spec.describe(news)}: the write returned no error but the object is still ` + "absent. NetBox returns the object it wrote — read back rather than trusting the " + "status code."));
|
|
238
|
+
}
|
|
239
|
+
return after;
|
|
240
|
+
}),
|
|
241
|
+
destroy: (olds) => Effect3.gen(function* () {
|
|
242
|
+
const live = yield* fetchLive(olds);
|
|
243
|
+
if (live === undefined)
|
|
244
|
+
return;
|
|
245
|
+
yield* netbox("DELETE", `${objectPath(live)}/`);
|
|
246
|
+
})
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
var netboxHandlers = (spec) => {
|
|
250
|
+
const ops = netboxOperations(spec);
|
|
251
|
+
return {
|
|
252
|
+
list: () => Effect3.succeed([]),
|
|
253
|
+
read: ({ olds }) => ops.read(olds),
|
|
254
|
+
diff: ({ news, output }) => ops.diff(news, output),
|
|
255
|
+
reconcile: ({ news }) => ops.reconcile(news),
|
|
256
|
+
delete: ({ olds }) => ops.destroy(olds)
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/netbox/values.ts
|
|
261
|
+
var text = (value) => typeof value === "string" ? value : "";
|
|
262
|
+
var choice = (value) => {
|
|
263
|
+
if (typeof value === "string")
|
|
264
|
+
return value;
|
|
265
|
+
if (typeof value === "object" && value !== null && "value" in value) {
|
|
266
|
+
return text(value.value);
|
|
267
|
+
}
|
|
268
|
+
return "";
|
|
269
|
+
};
|
|
270
|
+
var fk = (value) => {
|
|
271
|
+
if (typeof value === "number")
|
|
272
|
+
return value;
|
|
273
|
+
if (typeof value === "object" && value !== null && "id" in value) {
|
|
274
|
+
const id = value.id;
|
|
275
|
+
return typeof id === "number" ? id : undefined;
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// src/netbox/prefix.ts
|
|
281
|
+
var NetboxPrefix = Resource("Netbox.Prefix", {
|
|
282
|
+
defaultRemovalPolicy: "retain"
|
|
283
|
+
});
|
|
284
|
+
var handlers = netboxHandlers({
|
|
285
|
+
attributes: (live, props) => {
|
|
286
|
+
const id = live["id"];
|
|
287
|
+
if (typeof id !== "number")
|
|
288
|
+
return;
|
|
289
|
+
return {
|
|
290
|
+
comments: text(live["comments"]),
|
|
291
|
+
description: text(live["description"]),
|
|
292
|
+
isPool: live["is_pool"] === true,
|
|
293
|
+
markUtilized: live["mark_utilized"] === true,
|
|
294
|
+
prefix: text(live["prefix"]) || props.prefix,
|
|
295
|
+
prefixId: id,
|
|
296
|
+
status: choice(live["status"]),
|
|
297
|
+
tenant: fk(live["tenant"]),
|
|
298
|
+
vlan: fk(live["vlan"]),
|
|
299
|
+
vrf: fk(live["vrf"])
|
|
300
|
+
};
|
|
301
|
+
},
|
|
302
|
+
collection: "ipam/prefixes",
|
|
303
|
+
createBody: prefixBody,
|
|
304
|
+
describe: (props) => `ipam/prefixes ${props.prefix}`,
|
|
305
|
+
endpoint: {
|
|
306
|
+
create: "netbox:POST /api/ipam/prefixes/",
|
|
307
|
+
update: "netbox:PATCH /api/ipam/prefixes/{id}/"
|
|
308
|
+
},
|
|
309
|
+
identifies: (live, props) => fk(live["vrf"]) === props.vrf,
|
|
310
|
+
locate: (props) => [["prefix", props.prefix]],
|
|
311
|
+
matches: prefixMatches,
|
|
312
|
+
updateBody: prefixBody
|
|
313
|
+
});
|
|
314
|
+
var NetboxPrefixProvider = () => Provider.effect(NetboxPrefix, Effect4.succeed(NetboxPrefix.Provider.of(handlers)));
|
|
315
|
+
export {
|
|
316
|
+
NETBOX_CONSTRAINTS,
|
|
317
|
+
NETBOX_CONSTRAINTS_DIGEST,
|
|
318
|
+
NetboxError,
|
|
319
|
+
NetboxPrefix,
|
|
320
|
+
NetboxPrefixProvider,
|
|
321
|
+
apiBase,
|
|
322
|
+
bodyViolations,
|
|
323
|
+
constraintsFor,
|
|
324
|
+
guardBody,
|
|
325
|
+
netboxHandlers,
|
|
326
|
+
refusal,
|
|
327
|
+
violations
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
//# debugId=8207BD9178A5636864756E2164756E21
|
|
331
|
+
//# sourceMappingURL=index.js.map
|