diff --git a/.changeset/few-deers-appear.md b/.changeset/few-deers-appear.md new file mode 100644 index 000000000..b79a94259 --- /dev/null +++ b/.changeset/few-deers-appear.md @@ -0,0 +1,7 @@ +--- +'@siafoundation/renterd-types': minor +'@siafoundation/renterd-js': minor +'@siafoundation/renterd-react': minor +--- + +All query parameters are now lowercased for API consistency. diff --git a/apps/renterd-e2e/src/fixtures/files.ts b/apps/renterd-e2e/src/fixtures/files.ts index c53dc6c52..c3908de47 100644 --- a/apps/renterd-e2e/src/fixtures/files.ts +++ b/apps/renterd-e2e/src/fixtures/files.ts @@ -97,8 +97,10 @@ export async function createDirectoryIfNotExists(page: Page, name: string) { } } -export async function fileInList(page: Page, path: string) { - await expect(page.getByTestId('filesTable').getByTestId(path)).toBeVisible() +export async function fileInList(page: Page, path: string, timeout?: number) { + await expect(page.getByTestId('filesTable').getByTestId(path)).toBeVisible({ + timeout, + }) } export async function fileNotInList(page: Page, path: string) { diff --git a/apps/renterd-e2e/src/specs/files.spec.ts b/apps/renterd-e2e/src/specs/files.spec.ts index 6400a29f8..a73aa9dd4 100644 --- a/apps/renterd-e2e/src/specs/files.spec.ts +++ b/apps/renterd-e2e/src/specs/files.spec.ts @@ -88,8 +88,8 @@ test('can create directory, upload file, rename file, navigate, delete a file, d path.join(__dirname, originalFileName), originalFileName ) - await fileInList(page, originalFilePath) await expect(page.getByText('100%')).toBeVisible() + await fileInList(page, originalFilePath) // Rename file. await openFileContextMenu(page, originalFilePath) @@ -111,8 +111,8 @@ test('can create directory, upload file, rename file, navigate, delete a file, d path.join(__dirname, originalFileName), originalFileName ) - await fileInList(page, originalFilePath) await expect(page.getByText('100%')).toBeVisible() + await fileInList(page, originalFilePath) // Clean up the directory. await navigateToParentDirectory(page) diff --git a/apps/renterd/components/Hosts/HostContextMenuFromKey.tsx b/apps/renterd/components/Hosts/HostContextMenuFromKey.tsx index 250ee967d..7b53f391d 100644 --- a/apps/renterd/components/Hosts/HostContextMenuFromKey.tsx +++ b/apps/renterd/components/Hosts/HostContextMenuFromKey.tsx @@ -41,7 +41,7 @@ export function HostContextMenuFromKey({ // Only trigger a fetch when the dropdown is opened function HostContextMenuFromKeyContent({ hostKey }: { hostKey: string }) { const host = useHost({ - params: { hostKey }, + params: { hostkey: hostKey }, }) return ( diff --git a/apps/renterd/contexts/alerts/data.tsx b/apps/renterd/contexts/alerts/data.tsx index 6b22ea6b4..3cc8be58b 100644 --- a/apps/renterd/contexts/alerts/data.tsx +++ b/apps/renterd/contexts/alerts/data.tsx @@ -94,7 +94,7 @@ export const dataFields: Record< }, hostKey: { render: function HostField({ value }: { value: string }) { - const host = useHost({ params: { hostKey: value } }) + const host = useHost({ params: { hostkey: value } }) if (!host.data) { return null } diff --git a/apps/renterd/contexts/contracts/useContractMetrics.tsx b/apps/renterd/contexts/contracts/useContractMetrics.tsx index ec73860c0..0a3286412 100644 --- a/apps/renterd/contexts/contracts/useContractMetrics.tsx +++ b/apps/renterd/contexts/contracts/useContractMetrics.tsx @@ -42,7 +42,7 @@ export function useContractMetrics({ n: periods, } if (contractId) { - p.contractID = contractId + p.contractid = contractId } return p }, [start, interval, periods, contractId]) diff --git a/apps/renterd/contexts/filesDirectory/dataset.tsx b/apps/renterd/contexts/filesDirectory/dataset.tsx index 1a51519d3..f1355702e 100644 --- a/apps/renterd/contexts/filesDirectory/dataset.tsx +++ b/apps/renterd/contexts/filesDirectory/dataset.tsx @@ -33,8 +33,8 @@ export function useDataset() { const p: ObjectsParams = { prefix, bucket: pathParams.bucket, - sortBy: sortField, - sortDir: sortDirection, + sortby: sortField, + sortdir: sortDirection, limit, delimiter: '/', } diff --git a/apps/renterd/contexts/filesFlat/dataset.tsx b/apps/renterd/contexts/filesFlat/dataset.tsx index aa25d3c71..6f6badf71 100644 --- a/apps/renterd/contexts/filesFlat/dataset.tsx +++ b/apps/renterd/contexts/filesFlat/dataset.tsx @@ -30,8 +30,8 @@ export function useDataset({ sortDirection, sortField }: Props) { const p: ObjectsParams = { prefix, bucket: activeBucketName, - sortBy: sortField, - sortDir: sortDirection, + sortby: sortField, + sortdir: sortDirection, limit, delimiter: '', } diff --git a/apps/renterd/lib/multipartUpload.ts b/apps/renterd/lib/multipartUpload.ts index f89091e47..1575fa349 100644 --- a/apps/renterd/lib/multipartUpload.ts +++ b/apps/renterd/lib/multipartUpload.ts @@ -296,7 +296,7 @@ export class MultipartUpload { key: this.#key.slice(1), bucket: this.#bucket, uploadid: this.#uploadId, - offset: partOffset, + encryptionoffset: partOffset, partnumber: partNumber, } as MultipartUploadPartParams, payload: partData, diff --git a/internal/cluster/go.mod b/internal/cluster/go.mod index 26fd8b08f..a5321eeef 100644 --- a/internal/cluster/go.mod +++ b/internal/cluster/go.mod @@ -3,7 +3,7 @@ module go.sia.tech/web/cluster go 1.23.0 require ( - go.sia.tech/cluster v0.0.0-20240924203221-6c140b264895 + go.sia.tech/cluster v0.0.0-20241001143852-ff111abcfa0a go.sia.tech/core v0.4.6 go.sia.tech/coreutils v0.3.2 go.uber.org/zap v1.27.0 @@ -32,8 +32,8 @@ require ( go.sia.tech/gofakes3 v0.0.5 // indirect go.sia.tech/hostd v1.1.3-0.20240903081107-6e044db95238 // indirect go.sia.tech/jape v0.12.1 // indirect - go.sia.tech/mux v1.2.0 // indirect - go.sia.tech/renterd v1.1.0-beta.4.0.20240924124211-9a4e6a3aab98 // indirect + go.sia.tech/mux v1.3.0 // indirect + go.sia.tech/renterd v1.1.0-beta.4.0.20240928114638-ea7682e6e3e6 // indirect go.sia.tech/walletd v0.8.1-0.20240830193535-90d18cf2393c // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.27.0 // indirect diff --git a/internal/cluster/go.sum b/internal/cluster/go.sum index 08f0d0064..e5e66fd9e 100644 --- a/internal/cluster/go.sum +++ b/internal/cluster/go.sum @@ -53,8 +53,8 @@ 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.0.0-20240924203221-6c140b264895 h1:w6B8UG81XnKPiDheqTulctR7itjihOMK9q57gY5vEjk= -go.sia.tech/cluster v0.0.0-20240924203221-6c140b264895/go.mod h1:tmQVXHTsEC8fEEi8qkqvEmUMSABchg6fUf8UqM/XkE8= +go.sia.tech/cluster v0.0.0-20241001143852-ff111abcfa0a h1:ualMBOboRG2z81q1s0S2XJPLOgeb8fkSoR7myFO0io8= +go.sia.tech/cluster v0.0.0-20241001143852-ff111abcfa0a/go.mod h1:z8E+KNJJ0Ly+uncjy9fu1sJ+nLdTqkYFkzZjAiFBqo4= go.sia.tech/core v0.4.6 h1:QLm97a7GWBonfnMEOokqWRAqsWCUPL7kzo6k3Adwx8E= go.sia.tech/core v0.4.6/go.mod h1:Zuq0Tn2aIXJyO0bjGu8cMeVWe+vwQnUfZhG1LCmjD5c= go.sia.tech/coreutils v0.3.2 h1:3gJqvs18n1FVZmcrnfIYyzS+rBu06OtIscDDAfUAYQI= @@ -65,10 +65,10 @@ go.sia.tech/hostd v1.1.3-0.20240903081107-6e044db95238 h1:DP9o+TnNeS34EmxZ/zqZ4p go.sia.tech/hostd v1.1.3-0.20240903081107-6e044db95238/go.mod h1:InmB5LdO6EP+ZW9uolUCO+zh+zVdbJF3iCgU7xokJxQ= 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.2.0 h1:ofa1Us9mdymBbGMY2XH/lSpY8itFsKIo/Aq8zwe+GHU= -go.sia.tech/mux v1.2.0/go.mod h1:Yyo6wZelOYTyvrHmJZ6aQfRoer3o4xyKQ4NmQLJrBSo= -go.sia.tech/renterd v1.1.0-beta.4.0.20240924124211-9a4e6a3aab98 h1:pFS8D7Zq0nrFVYbO9X4PAn5XQAhjaiZ6hlUJBKZDlJM= -go.sia.tech/renterd v1.1.0-beta.4.0.20240924124211-9a4e6a3aab98/go.mod h1:SYRD/Xs7JHpdnhQ8VWMNZpNu63x6G+g0kaJfdSFTGhw= +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.4.0.20240928114638-ea7682e6e3e6 h1:FBr4KhMYDVyrd+rehZ07fy/OButdxutnUNCTmzL0a10= +go.sia.tech/renterd v1.1.0-beta.4.0.20240928114638-ea7682e6e3e6/go.mod h1:1WelcQsJZlpHiu61rmJ2BLOqZDwtxAuI0el6/Y7naYQ= go.sia.tech/walletd v0.8.1-0.20240830193535-90d18cf2393c h1:auulu0mwWRJK+OZRKoo+PQJNGFGubP2XGb8H4IWt2mc= go.sia.tech/walletd v0.8.1-0.20240830193535-90d18cf2393c/go.mod h1:B5p/myztKW86MaL69hT3wfnuzhLW3CZCWQ2WJiLqbbU= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= diff --git a/libs/renterd-types/src/bus.ts b/libs/renterd-types/src/bus.ts index 5170c97ed..9718f8582 100644 --- a/libs/renterd-types/src/bus.ts +++ b/libs/renterd-types/src/bus.ts @@ -42,12 +42,12 @@ export const busWalletSendRoute = '/bus/wallet/send' export const busWalletPrepareFormRoute = '/bus/wallet/prepare/form' export const busWalletPrepareRenewRoute = '/bus/wallet/prepare/renew' export const busHostsRoute = '/bus/hosts' -export const busHostHostKeyRoute = '/bus/host/:hostKey' -export const busHostsHostKeyRoute = '/bus/hosts/:hostKey' +export const busHostHostKeyRoute = '/bus/host/:hostkey' +export const busHostsHostKeyRoute = '/bus/hosts/:hostkey' export const busHostsBlocklistRoute = '/bus/hosts/blocklist' export const busHostsAllowlistRoute = '/bus/hosts/allowlist' export const busHostPublicKeyResetlostsectorsRoute = - '/bus/host/:publicKey/resetlostsectors' + '/bus/host/:publickey/resetlostsectors' export const busContractsRoute = '/bus/contracts' export const busContractIdAcquireRoute = '/bus/contract/:id/acquire' export const busContractIdReleaseRoute = '/bus/contract/:id/release' @@ -239,11 +239,11 @@ export type HostsPayload = { } export type HostsResponse = Host[] -export type HostParams = { hostKey: string } +export type HostParams = { hostkey: string } export type HostPayload = Host export type HostResponse = Host -export type HostInteractionParams = { hostKey: string } +export type HostInteractionParams = { hostkey: string } export type HostInteractionPayload = { timestamp: string type: string @@ -405,10 +405,10 @@ export type ObjectsParams = { delimiter?: string limit?: number marker?: string - sortBy?: 'name' | 'health' | 'size' - sortDir?: 'asc' | 'desc' + sortby?: 'name' | 'health' | 'size' + sortdir?: 'asc' | 'desc' substring?: string - slabEncryptionKey?: string + slabencryptionkey?: string } export type ObjectsPayload = void export type ObjectsResponse = { @@ -518,8 +518,8 @@ export type ContractMetric = { } export type ContractMetricsParams = MetricsParams & { - contractID?: string - hostKey?: string + contractid?: string + hostkey?: string } export type ContractMetricsPayload = void export type ContractMetricsResponse = ContractMetric[] diff --git a/libs/renterd-types/src/worker.ts b/libs/renterd-types/src/worker.ts index 155b530dd..0338f837d 100644 --- a/libs/renterd-types/src/worker.ts +++ b/libs/renterd-types/src/worker.ts @@ -37,7 +37,7 @@ export type MultipartUploadPartParams = { key: string uploadid: string partnumber: number - offset: number + encryptionoffset: number bucket?: string contractset?: string minshards?: number