Skip to content

Commit

Permalink
refactor(renterd-libs): move autopilot routes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 3, 2024
1 parent a95d6cc commit b90fb55
Show file tree
Hide file tree
Showing 20 changed files with 127 additions and 118 deletions.
7 changes: 7 additions & 0 deletions .changeset/selfish-queens-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@siafoundation/renterd-js': minor
'@siafoundation/renterd-react': minor
'@siafoundation/renterd-types': minor
---

The host checks field is now just HostAutopilotChecks.
7 changes: 7 additions & 0 deletions .changeset/ten-lies-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@siafoundation/renterd-js': minor
'@siafoundation/renterd-react': minor
'@siafoundation/renterd-types': minor
---

Autopilot config routes moved to the bus.
7 changes: 7 additions & 0 deletions .changeset/violet-peas-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@siafoundation/renterd-js': minor
'@siafoundation/renterd-react': minor
'@siafoundation/renterd-types': minor
---

Removed the autopilotID parameter from the hosts API.
2 changes: 1 addition & 1 deletion apps/hostd-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
// "cd internal/cluster && go get -u go.sia.tech/hostd@master",
"cd internal/cluster && go get -u go.sia.tech/hostd@master",
"cd internal/cluster && go get -u go.sia.tech/renterd@dev",
"cd internal/cluster && go get -u go.sia.tech/walletd@master",
"cd internal/cluster && go mod tidy",
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
// "cd internal/cluster && go get -u go.sia.tech/hostd@master",
"cd internal/cluster && go get -u go.sia.tech/hostd@master",
"cd internal/cluster && go get -u go.sia.tech/renterd@dev",
"cd internal/cluster && go get -u go.sia.tech/walletd@master",
"cd internal/cluster && go mod tidy",
Expand Down
7 changes: 1 addition & 6 deletions apps/renterd/contexts/hosts/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ import { objectEntries } from '@siafoundation/design-system'
export function useDataset({
response,
allContracts,
autopilotID,
allowlist,
blocklist,
isAllowlistActive,
geoHosts,
onHostSelect,
}: {
response: ReturnType<typeof useHosts>
autopilotID?: string
allContracts: ContractData[]
allowlist: ReturnType<typeof useHostsAllowlist>
blocklist: ReturnType<typeof useHostsBlocklist>
Expand All @@ -47,16 +45,13 @@ export function useDataset({
blocklist: block,
isAllowlistActive,
}),
...getAutopilotFields(
autopilotID ? host.checks?.[autopilotID] : undefined
),
...getAutopilotFields(host.checks),
location: sch?.location,
countryCode: sch?.country_code,
}
})
}, [
onHostSelect,
autopilotID,
response.data,
allContracts,
allowlist.data,
Expand Down
1 change: 0 additions & 1 deletion apps/renterd/contexts/hosts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ function useHostsMain() {
const dataset = useDataset({
response,
allContracts,
autopilotID: autopilotState.data?.id,
allowlist,
blocklist,
isAllowlistActive,
Expand Down
2 changes: 1 addition & 1 deletion apps/walletd-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
// "cd internal/cluster && go get -u go.sia.tech/hostd@master",
"cd internal/cluster && go get -u go.sia.tech/hostd@master",
"cd internal/cluster && go get -u go.sia.tech/renterd@dev",
"cd internal/cluster && go get -u go.sia.tech/walletd@master",
"cd internal/cluster && go mod tidy",
Expand Down
27 changes: 13 additions & 14 deletions internal/cluster/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ go 1.23.1
toolchain go1.23.2

require (
go.sia.tech/cluster v0.1.3-0.20241108192158-4ddce3247904
go.sia.tech/core v0.6.1
go.sia.tech/coreutils v0.6.0
go.sia.tech/cluster v0.1.3-0.20241203203049-cb265a6a0e92
go.sia.tech/core v0.6.2
go.sia.tech/coreutils v0.7.0
go.uber.org/zap v1.27.0
)

require (
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/cloudflare/cloudflare-go v0.107.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.6 // indirect
github.com/cloudflare/cloudflare-go v0.110.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/gotd/contrib v0.20.0 // indirect
Expand All @@ -30,18 +30,17 @@ require (
github.com/shopspring/decimal v1.4.0 // indirect
go.etcd.io/bbolt v1.3.11 // indirect
go.sia.tech/gofakes3 v0.0.5 // indirect
go.sia.tech/hostd v1.1.3-0.20241101150257-8319b75af8b2 // indirect
go.sia.tech/hostd v1.1.3-0.20241126153600-d590d9259987 // indirect
go.sia.tech/jape v0.12.1 // indirect
go.sia.tech/mux v1.3.0 // indirect
go.sia.tech/renterd v1.1.0-beta.5.0.20241108111642-4b0f42a3d24f // indirect
go.sia.tech/walletd v0.8.1-0.20241101091153-465e9da22d82 // indirect
go.sia.tech/renterd v1.1.0-beta.5.0.20241203123141-50c650a896c2 // indirect
go.sia.tech/walletd v0.8.1-0.20241120185708-2f26e9b843f1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.7.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.8.0 // indirect
golang.org/x/tools v0.23.0 // indirect
lukechampine.com/frand v1.5.1 // indirect
nhooyr.io/websocket v1.8.17 // indirect
)
58 changes: 28 additions & 30 deletions internal/cluster/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/cloudflare/cloudflare-go v0.107.0 h1:cMDIw2tzt6TXCJyMFVyP+BPOVkIfMvcKjhMNSNvuEPc=
github.com/cloudflare/cloudflare-go v0.107.0/go.mod h1:5cYGzVBqNTLxMYSLdVjuSs5LJL517wJDSvMPWUrzHzc=
github.com/cloudflare/cloudflare-go v0.110.0 h1:aBKKUXwRWqErd4rITsnCLESOacxxset/BcpdXn23900=
github.com/cloudflare/cloudflare-go v0.110.0/go.mod h1:2ZZ+EkmThmd6pkZ56UKGXWpz2wsjeqoTg93P4+VSmMg=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc=
github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc=
github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA=
github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
Expand Down Expand Up @@ -49,50 +49,50 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
go.sia.tech/cluster v0.1.3-0.20241108192158-4ddce3247904 h1:NXbmfgBU4sPOF0lczIGECDR6cPNXata4g17HKt+Sy8U=
go.sia.tech/cluster v0.1.3-0.20241108192158-4ddce3247904/go.mod h1:HcpoIxTf1TXUccc0YIwyxD/3WBNRXLs6SpwG7WHdBK4=
go.sia.tech/core v0.6.1 h1:eaExM2E2eNr43su2XDkY5J24E3F54YGS7hcC3WtVjVk=
go.sia.tech/core v0.6.1/go.mod h1:P3C1BWa/7J4XgdzWuaYHBvLo2RzZ0UBaJM4TG1GWB2g=
go.sia.tech/coreutils v0.6.0 h1:r0IZt+aVdGG2uIHl7OtaWRYdVx4NQ7ezRoSGa0Ej8GY=
go.sia.tech/coreutils v0.6.0/go.mod h1:XlsnogeYU/Tdjzp/HUNAj5T7tZCdmeBHIBjymbPC+uQ=
go.sia.tech/cluster v0.1.3-0.20241203203049-cb265a6a0e92 h1:3sYU7m4E1W1NbKBrIWlanDMPZz6iPa+TcThgLmDbo2g=
go.sia.tech/cluster v0.1.3-0.20241203203049-cb265a6a0e92/go.mod h1:MhFF2XgK4XaoPJ9Gm7rJaKPhulYM+BhrBztQoOV94hc=
go.sia.tech/core v0.6.2 h1:8NEjxyD93A+EhZopsBy/LvuHH+zUSjRNKnf9rXgtIwU=
go.sia.tech/core v0.6.2/go.mod h1:4v+aT/33857tMfqa5j5OYlAoLsoIrd4d7qMlgeP+VGk=
go.sia.tech/coreutils v0.7.0 h1:YpgOUD4vrpDz0KC7FJz+UCOaKaqV5EkX3gMUUmJoz5s=
go.sia.tech/coreutils v0.7.0/go.mod h1:eMoqzqO4opKQ6n9tTTxHQmccfNlj+8RFOYuDSL/Qd4g=
go.sia.tech/gofakes3 v0.0.5 h1:vFhVBUFbKE9ZplvLE2w4TQxFMQyF8qvgxV4TaTph+Vw=
go.sia.tech/gofakes3 v0.0.5/go.mod h1:LXEzwGw+OHysWLmagleCttX93cJZlT9rBu/icOZjQ54=
go.sia.tech/hostd v1.1.3-0.20241101150257-8319b75af8b2 h1:6fogOsOr7efjeDHCO0mqIibEa5cOagSSo3JXe1fuifM=
go.sia.tech/hostd v1.1.3-0.20241101150257-8319b75af8b2/go.mod h1:096sIYupHRUGkVyAe6i511la7wQo5LfRHGNUSMIKcT4=
go.sia.tech/hostd v1.1.3-0.20241126153600-d590d9259987 h1:PBPbQ6SyZu9CEMgKo1Vou7PLDIJH4/X1Yoxqf1hPfE8=
go.sia.tech/hostd v1.1.3-0.20241126153600-d590d9259987/go.mod h1:mlX0X3KpJd/YcOSFZdY1HdEma9UHkN1W5OgHYqyVhbU=
go.sia.tech/jape v0.12.1 h1:xr+o9V8FO8ScRqbSaqYf9bjj1UJ2eipZuNcI1nYousU=
go.sia.tech/jape v0.12.1/go.mod h1:wU+h6Wh5olDjkPXjF0tbZ1GDgoZ6VTi4naFw91yyWC4=
go.sia.tech/mux v1.3.0 h1:hgR34IEkqvfBKUJkAzGi31OADeW2y7D6Bmy/Jcbop9c=
go.sia.tech/mux v1.3.0/go.mod h1:I46++RD4beqA3cW9Xm9SwXbezwPqLvHhVs9HLpDtt58=
go.sia.tech/renterd v1.1.0-beta.5.0.20241108111642-4b0f42a3d24f h1:xLuQwVkhpxNltC7BmDqgdOCVIC5Ja9LDD+jvXgs4UeY=
go.sia.tech/renterd v1.1.0-beta.5.0.20241108111642-4b0f42a3d24f/go.mod h1:RF1WAXIjAevzbW6NSAkPX5XFYP1xPSiVQTMGPL24h3o=
go.sia.tech/walletd v0.8.1-0.20241101091153-465e9da22d82 h1:b48uOxKkBhexR8/1bYLNscYyD8weMYWltj46wsNVhkY=
go.sia.tech/walletd v0.8.1-0.20241101091153-465e9da22d82/go.mod h1:eowElIUuv8MVsyFBbOtLytJgm0ztzQBJ9QF7ZAiIK6g=
go.sia.tech/renterd v1.1.0-beta.5.0.20241203123141-50c650a896c2 h1:NOuw/yVzBKn3hhOK/RJIIsKsLoOI2tzgogu6mjLSfIw=
go.sia.tech/renterd v1.1.0-beta.5.0.20241203123141-50c650a896c2/go.mod h1:TBO18j+T36sPlOdnIndHdLcKiojpXHtyqNYm+CvI0ew=
go.sia.tech/walletd v0.8.1-0.20241120185708-2f26e9b843f1 h1:YWyRj37ZhPsHtLKgJq3gAo0zCWYl3fM24WVIBTS//yA=
go.sia.tech/walletd v0.8.1-0.20241120185708-2f26e9b843f1/go.mod h1:IMK3pD/UVpTHrExrOJLvaNSuE6lJ0pxcAvwpQ977aCM=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20190829051458-42f498d34c4d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
Expand All @@ -106,5 +106,3 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
lukechampine.com/frand v1.5.1 h1:fg0eRtdmGFIxhP5zQJzM1lFDbD6CUfu/f+7WgAZd5/w=
lukechampine.com/frand v1.5.1/go.mod h1:4VstaWc2plN4Mjr10chUD46RAVGWhpkZ5Nja8+Azp0Q=
nhooyr.io/websocket v1.8.17 h1:KEVeLJkUywCKVsnLIDlD/5gtayKp8VoCkksHCGGfT9Y=
nhooyr.io/websocket v1.8.17/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=
1 change: 0 additions & 1 deletion libs/clusterd/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export async function waitForContracts({
await mine(1)
const hosts = await bus.hosts({
data: {
autopilotID: 'autopilot',
filterMode: 'allowed',
usabilityMode: 'usable',
limit: 50,
Expand Down
1 change: 0 additions & 1 deletion libs/renterd-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export async function example() {

const hosts = await bus.hosts({
data: {
autopilotID: 'autopilot',
filterMode: 'allowed',
usabilityMode: 'usable',
addressContains: 'example.com',
Expand Down
20 changes: 2 additions & 18 deletions libs/renterd-js/src/autopilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@ import {
AutopilotConfigEvaluateParams,
AutopilotConfigEvaluatePayload,
AutopilotConfigEvaluateResponse,
AutopilotConfigParams,
AutopilotConfigPayload,
AutopilotConfigResponse,
AutopilotConfigUpdateParams,
AutopilotConfigUpdatePayload,
AutopilotConfigUpdateResponse,
AutopilotStateParams,
AutopilotStatePayload,
AutopilotStateResponse,
AutopilotTriggerParams,
AutopilotTriggerPayload,
AutopilotTriggerResponse,
autopilotConfigRoute,
autopilotStateRoute,
autopilotTriggerRoute,
autopilotConfigEvaluateRoute,
} from '@siafoundation/renterd-types'
import { buildRequestHandler, initAxios } from '@siafoundation/request'

Expand All @@ -35,21 +29,11 @@ export function Autopilot({
AutopilotStatePayload,
AutopilotStateResponse
>(axios, 'get', autopilotStateRoute),
config: buildRequestHandler<
AutopilotConfigParams,
AutopilotConfigPayload,
AutopilotConfigResponse
>(axios, 'get', autopilotConfigRoute),
configUpdate: buildRequestHandler<
AutopilotConfigUpdateParams,
AutopilotConfigUpdatePayload,
AutopilotConfigUpdateResponse
>(axios, 'put', autopilotConfigRoute),
configEvaluate: buildRequestHandler<
AutopilotConfigEvaluateParams,
AutopilotConfigEvaluatePayload,
AutopilotConfigEvaluateResponse
>(axios, 'post', autopilotConfigRoute),
>(axios, 'post', autopilotConfigEvaluateRoute),
trigger: buildRequestHandler<
AutopilotTriggerParams,
AutopilotTriggerPayload,
Expand Down
17 changes: 17 additions & 0 deletions libs/renterd-js/src/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ import {
HostScanPayload,
HostScanResponse,
busHostHostKeyScanRoute,
AutopilotConfigParams,
AutopilotConfigPayload,
AutopilotConfigResponse,
AutopilotConfigUpdateParams,
AutopilotConfigUpdatePayload,
AutopilotConfigUpdateResponse,
busAutopilotRoute,
} from '@siafoundation/renterd-types'
import { buildRequestHandler, initAxios } from '@siafoundation/request'

Expand Down Expand Up @@ -598,5 +605,15 @@ export function Bus({ api, password }: { api: string; password?: string }) {
MultipartUploadAddPartPayload,
MultipartUploadAddPartResponse
>(axios, 'post', busMultipartPartRoute),
autopilotConfig: buildRequestHandler<
AutopilotConfigParams,
AutopilotConfigPayload,
AutopilotConfigResponse
>(axios, 'get', busAutopilotRoute),
autopilotConfigUpdate: buildRequestHandler<
AutopilotConfigUpdateParams,
AutopilotConfigUpdatePayload,
AutopilotConfigUpdateResponse
>(axios, 'put', busAutopilotRoute),
}
}
1 change: 0 additions & 1 deletion libs/renterd-js/src/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export async function example() {

const hosts = await bus.hosts({
data: {
autopilotID: 'autopilot-id',
filterMode: 'allowed',
usabilityMode: 'usable',
addressContains: 'example.com',
Expand Down
Loading

0 comments on commit b90fb55

Please sign in to comment.