From 6455e21cf2873a71103f0feeaa034bfb6b9e6f86 Mon Sep 17 00:00:00 2001 From: wvffle Date: Sat, 26 Nov 2022 12:15:32 +0000 Subject: [PATCH] Update axios --- front/package.json | 3 +-- front/src/components/library/Albums.vue | 5 ++--- front/src/components/library/Artists.vue | 5 ++--- front/src/components/library/Podcasts.vue | 5 ++--- front/src/init/axios.ts | 2 +- front/src/types.ts | 12 ++++++------ front/src/views/channels/DetailOverview.vue | 5 ++--- front/yarn.lock | 19 ++----------------- 8 files changed, 18 insertions(+), 38 deletions(-) diff --git a/front/package.json b/front/package.json index 0c948bfb1..43116ca50 100644 --- a/front/package.json +++ b/front/package.json @@ -26,7 +26,7 @@ "@vueuse/integrations": "9.6.0", "@vueuse/math": "9.6.0", "@vueuse/router": "9.6.0", - "axios": "0.27.2", + "axios": "1.2.0", "axios-auth-refresh": "3.3.4", "butterchurn": "3.0.0-beta.4", "butterchurn-presets": "3.0.0-beta.4", @@ -40,7 +40,6 @@ "lodash-es": "4.17.21", "lru-cache": "7.14.1", "moment": "2.29.4", - "qs": "6.11.0", "showdown": "2.1.0", "standardized-audio-context": "25.3.35", "text-clipper": "2.2.0", diff --git a/front/src/components/library/Albums.vue b/front/src/components/library/Albums.vue index 53acdbd0a..c1d1ea918 100644 --- a/front/src/components/library/Albums.vue +++ b/front/src/components/library/Albums.vue @@ -13,7 +13,6 @@ import { useStore } from '~/store' import axios from 'axios' import $ from 'jquery' -import qs from 'qs' import TagsSelector from '~/components/library/TagsSelector.vue' import AlbumCard from '~/components/audio/album/Card.vue' @@ -77,8 +76,8 @@ const fetchData = async () => { try { const response = await axios.get('albums/', { params, - paramsSerializer: function (params) { - return qs.stringify(params, { indices: false }) + paramsSerializer: { + indexes: null } }) diff --git a/front/src/components/library/Artists.vue b/front/src/components/library/Artists.vue index 3ee3ff1f1..168693c01 100644 --- a/front/src/components/library/Artists.vue +++ b/front/src/components/library/Artists.vue @@ -13,7 +13,6 @@ import { useStore } from '~/store' import axios from 'axios' import $ from 'jquery' -import qs from 'qs' import TagsSelector from '~/components/library/TagsSelector.vue' import ArtistCard from '~/components/audio/artist/Card.vue' @@ -78,8 +77,8 @@ const fetchData = async () => { try { const response = await axios.get('artists/', { params, - paramsSerializer: function (params) { - return qs.stringify(params, { indices: false }) + paramsSerializer: { + indexes: null } }) diff --git a/front/src/components/library/Podcasts.vue b/front/src/components/library/Podcasts.vue index 9617dfb49..0a3ae2cb0 100644 --- a/front/src/components/library/Podcasts.vue +++ b/front/src/components/library/Podcasts.vue @@ -13,7 +13,6 @@ import { useStore } from '~/store' import axios from 'axios' import $ from 'jquery' -import qs from 'qs' import TagsSelector from '~/components/library/TagsSelector.vue' import RemoteSearchForm from '~/components/RemoteSearchForm.vue' @@ -79,8 +78,8 @@ const fetchData = async () => { try { const response = await axios.get('artists/', { params, - paramsSerializer: function (params) { - return qs.stringify(params, { indices: false }) + paramsSerializer: { + indexes: null } }) diff --git a/front/src/init/axios.ts b/front/src/init/axios.ts index f24941bb1..6532dca4e 100644 --- a/front/src/init/axios.ts +++ b/front/src/init/axios.ts @@ -65,7 +65,7 @@ export const install: InitModule = ({ store, router }) => { scope: error.response?.headers['x-ratelimit-scope'], remaining: error.response?.headers['x-ratelimit-remaining'], duration: error.response?.headers['x-ratelimit-duration'], - availableSeconds: parseInt(error.response?.headers['retry-after'] ?? 60), + availableSeconds: parseInt(error.response?.headers['retry-after'] ?? '60'), reset: error.response?.headers['x-ratelimit-reset'], resetSeconds: error.response?.headers['x-ratelimit-resetseconds'] } diff --git a/front/src/types.ts b/front/src/types.ts index fd5b0c98e..a6d95ed8c 100644 --- a/front/src/types.ts +++ b/front/src/types.ts @@ -227,13 +227,13 @@ export interface BackendResponse { } export interface RateLimitStatus { - limit: string - scope: string - remaining: string - duration: string + limit?: string + scope?: string + remaining?: string + duration?: string availableSeconds: number - reset: string - resetSeconds: string + reset?: string + resetSeconds?: string } // WebSocket stuff diff --git a/front/src/views/channels/DetailOverview.vue b/front/src/views/channels/DetailOverview.vue index c5537a6dd..9a1ecbd9a 100644 --- a/front/src/views/channels/DetailOverview.vue +++ b/front/src/views/channels/DetailOverview.vue @@ -6,7 +6,6 @@ import { whenever } from '@vueuse/core' import { useStore } from '~/store' import axios from 'axios' -import qs from 'qs' import ChannelEntries from '~/components/audio/ChannelEntries.vue' import ChannelSeries from '~/components/audio/ChannelSeries.vue' @@ -64,8 +63,8 @@ const fetchPendingUploads = async () => { try { const response = await axios.get('uploads/', { params: { channel: props.object.uuid, import_status: ['pending', 'skipped', 'errored'], include_channels: 'true' }, - paramsSerializer: function (params) { - return qs.stringify(params, { indices: false }) + paramsSerializer: { + indexes: null } }) diff --git a/front/yarn.lock b/front/yarn.lock index 191f97216..8a00ac4eb 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -2078,15 +2078,7 @@ axios-auth-refresh@3.3.4: resolved "https://registry.yarnpkg.com/axios-auth-refresh/-/axios-auth-refresh-3.3.4.tgz#95a2b1dc89a566b67ba525fb54de2f9dd7b65d20" integrity sha512-cGq3bZu+lip5j+byaQRZaZ3wpCUxs93jGV0614VYP5k2H1vbdoaw6HGazaUJxcRsFMctR3DItCAx1Dn7KerlcA== -axios@0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - -axios@>=0.13.0: +axios@1.2.0, axios@>=0.13.0: version "1.2.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.0.tgz#1cb65bd75162c70e9f8d118a905126c4a201d383" integrity sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw== @@ -3306,7 +3298,7 @@ focus-trap@7.1.0: dependencies: tabbable "^6.0.1" -follow-redirects@^1.14.9, follow-redirects@^1.15.0: +follow-redirects@^1.15.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== @@ -4603,13 +4595,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"