diff --git a/front/README.md b/front/README.md new file mode 100644 index 000000000..682829543 --- /dev/null +++ b/front/README.md @@ -0,0 +1,3 @@ +# Funkwhale Frontend + +Please follow the instructions in [Set up your development environment — funkwhale 1.4.0 documentation](https://docs.funkwhale.audio/developer/setup/index.html). diff --git a/front/src/composables/audio/player.ts b/front/src/composables/audio/player.ts index e9291b3f7..1591f84f0 100644 --- a/front/src/composables/audio/player.ts +++ b/front/src/composables/audio/player.ts @@ -43,7 +43,7 @@ export const isPlaying = ref(false) // Use Player export const usePlayer = createGlobalState(() => { const { currentSound } = useTracks() - const { playNext } = useQueue() + const { playNext, playPrevious } = useQueue() const pauseReason = ref(PauseReason.UserInput) @@ -228,6 +228,52 @@ export const usePlayer = createGlobalState(() => { watch(currentIndex, stopErrorTimeout) whenever(errored, startErrorTimeout) + // Mobile controls and lockscreen cover art + const updateMediaSession = () => { + if ('mediaSession' in navigator && currentTrack.value) { + navigator.mediaSession.metadata = new MediaMetadata({ + title: currentTrack.value.title, + artist: currentTrack.value.artistCredit?.map(ac => ac.credit).join(', ') || 'Unknown Artist', + album: currentTrack.value.albumTitle || 'Unknown Album', + artwork: [ + { src: currentTrack.value.coverUrl, sizes: '1200x1200', type: 'image/jpeg' } + ] + }) + + navigator.mediaSession.setActionHandler('play', () => { + isPlaying.value = true + }) + + navigator.mediaSession.setActionHandler('pause', () => { + isPlaying.value = false + }) + + navigator.mediaSession.setActionHandler('previoustrack', () => { + playPrevious() + }) + + navigator.mediaSession.setActionHandler('nexttrack', () => { + playNext() + }) + + navigator.mediaSession.setActionHandler('seekbackward', (details) => { + seekBy(details.seekOffset || -10) + }) + + navigator.mediaSession.setActionHandler('seekforward', (details) => { + seekBy(details.seekOffset || 10) + }) + } + } + + watch(currentTrack, () => { + updateMediaSession() + }) + + watch(isPlaying, () => { + navigator.mediaSession.playbackState = isPlaying.value ? 'playing' : 'paused' + }) + return { initializeFirstTrack, isPlaying, diff --git a/front/src/composables/audio/usePlayOptions.ts b/front/src/composables/audio/usePlayOptions.ts index 9c1e9fe1d..ab9ead3a5 100644 --- a/front/src/composables/audio/usePlayOptions.ts +++ b/front/src/composables/audio/usePlayOptions.ts @@ -1,7 +1,7 @@ import type { Track, Artist, Album, Playlist, Library, Channel, Actor } from '~/types' +import type { components } from '~/generated/types' import type { ContentFilter } from '~/store/moderation' -import { useCurrentElement } from '@vueuse/core' import { computed, markRaw, ref } from 'vue' import { i18n } from '~/init/locale' import { useStore } from '~/store' @@ -9,19 +9,18 @@ import { useStore } from '~/store' import { usePlayer } from '~/composables/audio/player' import { useQueue } from '~/composables/audio/queue' -import jQuery from 'jquery' import axios from 'axios' export interface PlayOptionsProps { isPlayable?: boolean tracks?: Track[] track?: Track | null - artist?: Artist | null + artist?: Artist | components["schemas"]["SimpleChannelArtist"] | components['schemas']['ArtistWithAlbums'] | null album?: Album | null playlist?: Playlist | null library?: Library | null channel?: Channel | null - account?: Actor | null + account?: Actor | components['schemas']['APIActor'] | null } export default (props: PlayOptionsProps) => { @@ -37,8 +36,12 @@ export default (props: PlayOptionsProps) => { if (props.track) { return props.track.uploads?.length > 0 } else if (props.artist) { + // TODO: Find out how to get tracks, album from Artist + + /* return props.artist.tracks_count > 0 || props.artist?.albums?.some((album) => album.is_playable === true) + */ } else if (props.tracks) { return props.tracks?.some((track) => (track.uploads?.length ?? 0) > 0) } @@ -150,18 +153,15 @@ export default (props: PlayOptionsProps) => { return tracks.filter(track => track.uploads?.length).map(markRaw) } - const el = useCurrentElement() - const enqueue = async () => { - jQuery(el.value).find('.ui.dropdown').dropdown('hide') + // const el = useCurrentElement() + const enqueue = async () => { const tracks = await getPlayableTracks() await addToQueue(...tracks) addMessage(tracks) } const enqueueNext = async (next = false) => { - jQuery(el.value).find('.ui.dropdown').dropdown('hide') - const tracks = await getPlayableTracks() const wasEmpty = queue.value.length === 0 @@ -177,9 +177,6 @@ export default (props: PlayOptionsProps) => { const replacePlay = async (index?: number) => { await clear() - - jQuery(el.value).find('.ui.dropdown').dropdown('hide') - const tracksToPlay = await getPlayableTracks() await addToQueue(...tracksToPlay) diff --git a/front/src/composables/locale/useSharedLabels.ts b/front/src/composables/locale/useSharedLabels.ts index fcbf13c7d..531f22388 100644 --- a/front/src/composables/locale/useSharedLabels.ts +++ b/front/src/composables/locale/useSharedLabels.ts @@ -1,4 +1,5 @@ -import type { PrivacyLevel, ImportStatus } from '~/types' +import type { ImportStatus } from '~/types' +import type { components } from '~/generated/types' import type { ScopeId } from '~/composables/auth/useScopes' import { i18n } from '~/init/locale' @@ -13,13 +14,15 @@ export default () => ({ choices: { me: t('composables.locale.useSharedLabels.fields.privacyLevel.choices.private'), instance: t('composables.locale.useSharedLabels.fields.privacyLevel.choices.instance'), + followers: t('composables.locale.useSharedLabels.fields.privacyLevel.choices.followers'), everyone: t('composables.locale.useSharedLabels.fields.privacyLevel.choices.public') - } as Record, + } satisfies Record, shortChoices: { me: t('composables.locale.useSharedLabels.fields.privacyLevel.shortChoices.private'), instance: t('composables.locale.useSharedLabels.fields.privacyLevel.shortChoices.instance'), + followers: t('composables.locale.useSharedLabels.fields.privacyLevel.choices.followers'), everyone: t('composables.locale.useSharedLabels.fields.privacyLevel.shortChoices.public') - } as Record + } satisfies Record }, import_status: { label: t('composables.locale.useSharedLabels.fields.importStatus.label'), diff --git a/front/src/composables/moderation/useEditConfigs.ts b/front/src/composables/moderation/useEditConfigs.ts index 27385d0d7..9a4df3068 100644 --- a/front/src/composables/moderation/useEditConfigs.ts +++ b/front/src/composables/moderation/useEditConfigs.ts @@ -16,7 +16,7 @@ export interface EditableConfigField extends ConfigField { id: EditObjectType } -export type EditObject = (Partial | Partial | Partial) & { attributed_to: Actor } +export type EditObject = (Partial | Partial | Partial) & { attributed_to?: Actor } export type EditObjectType = 'artist' | 'album' | 'track' type Configs = Record @@ -79,6 +79,7 @@ export default (): Configs => { description, { id: 'release_date', + // TODO: Change type to date and offer date select input in form type: 'text', required: false, label: t('composables.moderation.useEditConfigs.album.releaseDate'), diff --git a/front/src/composables/moderation/useReport.ts b/front/src/composables/moderation/useReport.ts index 634554509..c29737101 100644 --- a/front/src/composables/moderation/useReport.ts +++ b/front/src/composables/moderation/useReport.ts @@ -1,4 +1,5 @@ import type { Track, Artist, Album, Playlist, Library, Channel, Actor, ArtistCredit } from '~/types' +import type { components } from '~/generated/types' import { i18n } from '~/init/locale' @@ -8,11 +9,11 @@ const { t } = i18n.global interface Objects { track?: Track | null - album?: Album | null - artist?: Artist | null + album?: Album | components['schemas']['TrackAlbum'] | null + artist?: Artist | components['schemas']['ArtistWithAlbums'] | components["schemas"]["SimpleChannelArtist"] | null artistCredit?: ArtistCredit[] | null playlist?: Playlist | null - account?: Actor | null + account?: Actor | components['schemas']['APIActor'] | null library?: Library | null channel?: Channel | null } diff --git a/front/src/composables/navigation/usePage.ts b/front/src/composables/navigation/usePage.ts index cf16aa9eb..f86e2dfa0 100644 --- a/front/src/composables/navigation/usePage.ts +++ b/front/src/composables/navigation/usePage.ts @@ -4,10 +4,12 @@ import { ref } from 'vue' export default () => { const pageQuery = useRouteQuery('page', '1') - const page = ref() + const page = ref() syncRef(pageQuery, page, { transform: { ltr: (left) => +left, + // TODO: Why toString? + // @ts-expect-error string vs. number rtl: (right) => right.toString() } }) diff --git a/front/src/composables/onKeyboardShortcut.ts b/front/src/composables/onKeyboardShortcut.ts index b54d428d3..7b56c9159 100644 --- a/front/src/composables/onKeyboardShortcut.ts +++ b/front/src/composables/onKeyboardShortcut.ts @@ -20,7 +20,7 @@ useEventListener(window, 'keydown', (event) => { if (!event.key) return const target = event.target as HTMLElement - if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') return + if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) return current.add(event.key.toLowerCase()) diff --git a/front/src/composables/screen.ts b/front/src/composables/screen.ts new file mode 100644 index 000000000..539beb728 --- /dev/null +++ b/front/src/composables/screen.ts @@ -0,0 +1,17 @@ +import { + type MaybeRefOrGetter, + createGlobalState, + toValue, + useWindowSize +} from '@vueuse/core' +import { computed } from 'vue' + +const MOBILE_WIDTH = 640 + +export const useScreenSize = createGlobalState(() => + useWindowSize({ includeScrollbar: false }) +) +export const isMobileView = ( + width: MaybeRefOrGetter = useScreenSize().width +) => + computed(() => (toValue(width) ?? Number.POSITIVE_INFINITY) <= MOBILE_WIDTH) diff --git a/front/src/composables/useWebSocketHandler.ts b/front/src/composables/useWebSocketHandler.ts index d3e073378..8486e16bf 100644 --- a/front/src/composables/useWebSocketHandler.ts +++ b/front/src/composables/useWebSocketHandler.ts @@ -50,7 +50,7 @@ function useWebSocketHandler (eventName: 'mutation.created', handler: (event: Pe function useWebSocketHandler (eventName: 'mutation.updated', handler: (event: PendingReviewEdits) => void): stopFn function useWebSocketHandler (eventName: 'import.status_updated', handler: (event: ImportStatusWS) => void): stopFn function useWebSocketHandler (eventName: 'user_request.created', handler: (event: PendingReviewRequests) => void): stopFn -function useWebSocketHandler (eventName: 'Listen', handler: (event: ListenWS) => void): stopFn +function useWebSocketHandler (eventName: 'Listen', handler: (event: unknown) => void): stopFn function useWebSocketHandler (eventName: string, handler: (event: any) => void): stopFn { const id = `${+new Date() + Math.random()}` diff --git a/front/src/init/axios.ts b/front/src/init/axios.ts index 35d17deb1..526e77180 100644 --- a/front/src/init/axios.ts +++ b/front/src/init/axios.ts @@ -5,7 +5,6 @@ import { parseAPIErrors } from '~/utils' import { i18n } from './locale' import createAuthRefreshInterceptor from 'axios-auth-refresh' -import moment from 'moment' import axios from 'axios' import useLogger from '~/composables/useLogger' @@ -61,23 +60,31 @@ export const install: InitModule = ({ store, router }) => { break case 429: { - let message + let message = '' + + // TODO: Find out if the following fields are still relevant const rateLimitStatus: RateLimitStatus = { limit: error.response?.headers['x-ratelimit-limit'], - scope: error.response?.headers['x-ratelimit-scope'], + // 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'] + // resetSeconds: error.response?.headers['x-ratelimit-resetseconds'] + // The following fields were missing: + id: '', + rate: '', + description: '', + available: 0, + available_seconds: 0, + reset_seconds: 0 } - if (rateLimitStatus.availableSeconds) { - const tryAgain = moment().add(rateLimitStatus.availableSeconds, 's').toNow(true) - message = t('init.axios.rateLimitDelay', { delay: tryAgain }) - } else { - message = t('init.axios.rateLimitLater') - } + message = t('init.axios.rateLimitLater') + // if (rateLimitStatus.availableSeconds) { + // const tryAgain = moment().add(rateLimitStatus.availableSeconds, 's').toNow(true) + // message = t('init.axios.rateLimitDelay', { delay: tryAgain }) + // } error.backendErrors.push(message) error.isHandled = true diff --git a/front/src/init/webSocket.ts b/front/src/init/webSocket.ts index 8a2a04f0a..df81745eb 100644 --- a/front/src/init/webSocket.ts +++ b/front/src/init/webSocket.ts @@ -70,6 +70,8 @@ export const install: InitModule = ({ store }) => { const { current } = store.state.radios if (current.clientOnly) { + // TODO: Type this event + // @ts-expect-error untyped event await CLIENT_RADIOS[current.type].handleListen(current, event) } } diff --git a/front/src/locales.ts b/front/src/locales.ts index 490a2c530..80f7c89e5 100644 --- a/front/src/locales.ts +++ b/front/src/locales.ts @@ -1,6 +1,6 @@ import type { VueI18nOptions } from 'vue-i18n' -export type SupportedLanguages = 'ar' | 'ca' | 'cs' | 'de' | 'en_GB' | 'en_US' | 'eo' | 'es' | 'eu' | 'fr_FR' +export type SupportedLanguages = 'ar' | 'ca' | 'ca@valencia' | 'cs' | 'de' | 'en_GB' | 'en_US' | 'eo' | 'es' | 'eu' | 'fr_FR' | 'gl' | 'hu' | 'it' | 'ja_JP' | 'kab_DZ' | 'ko_KR' | 'nb_NO' | 'nl' | 'oc' | 'pl' | 'pt_BR' | 'pt_PT' | 'ru' | 'sq' | 'zh_Hans' | 'zh_Hant' | 'fa_IR' | 'ml' | 'sv' | 'el' | 'nn_NO' @@ -16,6 +16,9 @@ export const locales: Record = { ca: { label: 'Català' }, + 'ca@valencia': { + label: 'Català (Valencia)' + }, cs: { label: 'Čeština' }, diff --git a/front/src/ui/components/CoverArt.vue b/front/src/ui/components/CoverArt.vue new file mode 100644 index 000000000..c39529271 --- /dev/null +++ b/front/src/ui/components/CoverArt.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/front/src/ui/components/UploadGroupList.vue b/front/src/ui/components/UploadGroupList.vue new file mode 100644 index 000000000..3dcdef5ec --- /dev/null +++ b/front/src/ui/components/UploadGroupList.vue @@ -0,0 +1,232 @@ + + + + + diff --git a/front/src/ui/components/UploadList.vue b/front/src/ui/components/UploadList.vue new file mode 100644 index 000000000..a13db2021 --- /dev/null +++ b/front/src/ui/components/UploadList.vue @@ -0,0 +1,192 @@ + + + + + diff --git a/front/src/ui/components/UploadModal.vue b/front/src/ui/components/UploadModal.vue new file mode 100644 index 000000000..8dea6ebf5 --- /dev/null +++ b/front/src/ui/components/UploadModal.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/front/src/ui/components/UserMenu.vue b/front/src/ui/components/UserMenu.vue new file mode 100644 index 000000000..e118536a1 --- /dev/null +++ b/front/src/ui/components/UserMenu.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/front/src/ui/components/VerticalCollapse.vue b/front/src/ui/components/VerticalCollapse.vue new file mode 100644 index 000000000..83d8b6a7d --- /dev/null +++ b/front/src/ui/components/VerticalCollapse.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/front/src/ui/composables/bytes.ts b/front/src/ui/composables/bytes.ts new file mode 100644 index 000000000..56f015002 --- /dev/null +++ b/front/src/ui/composables/bytes.ts @@ -0,0 +1,7 @@ +export const bytesToHumanSize = (bytes: number) => { + const sizes = ['B', 'KB', 'MB', 'GB', 'TB'] + if (bytes === 0) return '0 B' + const i = Math.floor(Math.log(bytes) / Math.log(1024)) + if (i === 0) return `${bytes} ${sizes[i]}` + return `${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]}` +} diff --git a/front/src/ui/composables/metadata.ts b/front/src/ui/composables/metadata.ts new file mode 100644 index 000000000..7a75a17e5 --- /dev/null +++ b/front/src/ui/composables/metadata.ts @@ -0,0 +1,69 @@ +// TODO: use when Firefox issue is resolved, see: https://github.com/Borewit/music-metadata-browser/issues/948 +// import * as Metadata from 'music-metadata-browser' +// import type { ICommonTagsResult } from 'music-metadata-browser' +// +// export type Tags = ICommonTagsResult +// +// export const getCoverUrl = async (tags: ICommonTagsResult[] | undefined): Promise => { +// if (pictures.length === 0) return undefined +// +// const picture = Metadata.selectCover(pictures) +// +// return await new Promise((resolve, reject) => { +// const reader = Object.assign(new FileReader(), { +// onload: () => resolve(reader.result as string), +// onerror: () => reject(reader.error) +// }) +// +// reader.readAsDataURL(new File([picture.data], "", { type: picture.type })) +// }) +// } +// +// export const getTags = async (file: File) => { +// return Metadata.parseBlob(file).then(metadata => metadata.common) +// } + +// @ts-expect-error This is not installed...? +import * as jsmediaTags from 'jsmediatags/dist/jsmediatags.min.js' +// @ts-expect-error This is not installed...? +import type { ShortcutTags } from 'jsmediatags' + +const REQUIRED_TAGS = ['title', 'artist', 'album'] + +export type Tags = ShortcutTags + +export const getCoverUrl = async (tags: Tags): Promise => { + if (!tags.picture) return undefined + const { picture } = tags + + return await new Promise((resolve, reject) => { + const reader = Object.assign(new FileReader(), { + onload: () => resolve(reader.result as string), + onerror: () => reject(reader.error) + }) + + reader.readAsDataURL(new File([picture.data], '', { type: picture.type })) + }) +} + +export const getTags = async (file: File) => { + return new Promise((resolve, reject) => { + jsmediaTags.read(file, { + // @ts-expect-error Please type `tags` + onSuccess: ({ tags }) => { + if (tags.picture?.data) { + tags.picture.data = new Uint8Array(tags.picture.data) + } + + const missingTags = REQUIRED_TAGS.filter(tag => !tags[tag]) + if (missingTags.length > 0) { + return reject(new Error(`Missing tags: ${missingTags.join(', ')}`)) + } + + resolve(tags) + }, + // @ts-expect-error Please type `error` + onError: (error) => reject(error) + }) + }) +} diff --git a/front/src/ui/composables/useClient.ts.backup b/front/src/ui/composables/useClient.ts.backup new file mode 100644 index 000000000..1a6c76650 --- /dev/null +++ b/front/src/ui/composables/useClient.ts.backup @@ -0,0 +1,164 @@ +import type { paths } from '~/generated/types.ts' +import type { APIErrorResponse, BackendError, RateLimitStatus } from '~/types' + +import createClient from 'openapi-fetch' + +import { parseAPIErrors } from '~/utils' +import { i18n } from '~/init/locale' + +import moment from 'moment' + +import useLogger from '~/composables/useLogger' +import { useRouter } from 'vue-router' +import { useStore } from '~/store' + +// Note [WIP] that this module is Work in Progress! +// TODO: Replace all `axios` calls with this client + +const { t } = i18n.global +const logger = useLogger() +const store = useStore() +const router = useRouter() + +const prefix = '/api/v2/' as const + +const client = createClient({ baseUrl: `${store.state.instance.instanceUrl}${prefix}` }) +client.use({ + /* + TODO: Check if we need these: + axios.defaults.xsrfCookieName = 'csrftoken' + axios.defaults.xsrfHeaderName = 'X-CSRFToken' + */ + + async onRequest ({ request, options }) { + if (store.state.auth.oauth.accessToken) { + request.headers.set('Authorization', store.getters['auth/header']) + } + return request + }, + + async onResponse ({ request, response, options }) { + return response + }, + + async onError ({ error: unknownError }) { + const error = unknownError as BackendError + error.backendErrors = [] + error.isHandled = false + + if (store.state.auth.authenticated && !store.state.auth.oauth.accessToken && error.response?.status === 401) { + store.commit('auth/authenticated', false) + logger.warn('Received 401 response from API, redirecting to login form', router.currentRoute.value.fullPath) + await router.push({ name: 'login', query: { next: router.currentRoute.value.fullPath } }) + } + + switch (error.response?.status) { + case 404: + if (error.response?.data === 'Radio doesn\'t have more candidates') { + error.backendErrors.push(error.response.data) + break + } + + error.backendErrors.push('Resource not found') + error.isHandled = true + store.commit('ui/addMessage', { + // @ts-expect-error TS does not know about .data structure + content: error.response?.data?.detail ?? error.response?.data ?? 'Resource not found', + class: 'error' + }) + break + + case 403: + error.backendErrors.push('Permission denied') + break + + case 429: { + let message + const rateLimitStatus: RateLimitStatus = { + limit: error.response?.headers['x-ratelimit-limit'], + description: error.response?.headers['x-ratelimit-scope'], + remaining: error.response?.headers['x-ratelimit-remaining'], + duration: error.response?.headers['x-ratelimit-duration'], + available_seconds: parseInt(error.response?.headers['retry-after'] ?? '60'), + reset: error.response?.headers['x-ratelimit-reset'], + reset_seconds: error.response?.headers['x-ratelimit-resetseconds'], + /* The following threewere not defined. TODO: research correct values */ + id: '', + available: 100, + rate: '' + } + + if (rateLimitStatus.available_seconds) { + const tryAgain = moment().add(rateLimitStatus.available_seconds, 's').toNow(true) + message = t('init.axios.rateLimitDelay', { delay: tryAgain }) + } else { + message = t('init.axios.rateLimitLater') + } + + error.backendErrors.push(message) + error.isHandled = true + store.commit('ui/addMessage', { + content: message, + date: new Date(), + class: 'error' + }) + + logger.error('This client is rate-limited!', rateLimitStatus) + break + } + + case 500: + error.backendErrors.push('A server error occurred') + break + + default: + if (error.response?.data as object) { + const data = error.response?.data as Record + if (data?.detail) { + error.backendErrors.push(data.detail as string) + } else { + error.rawPayload = data as APIErrorResponse + const parsedErrors = parseAPIErrors(data as APIErrorResponse) + error.backendErrors = [...error.backendErrors, ...parsedErrors] + } + } + } + + if (error.backendErrors.length === 0) { + error.backendErrors.push('An unknown error occurred, ensure your are connected to the internet and your funkwhale instance is up and running') + } + + // Do something with response error + return Promise.reject(error) + } + + /* TODO: Check if we need to handle refreshAuth = async (failedRequest: AxiosError) */ +}) + +/** + * + * Returns `get` and `post` clients for the chosen path (endpoint). +```ts +const { get, post } = useClient('manage/tags'); + +const result0 = post({ name: 'test' }) +const result1 = get({ query: { q: 'test' } }) +``` + * + * @param path The path to create a client for. Check the `paths` type in '~/generated/types.ts' to find all available paths. + * @param variable + * +*/ +export const useClient = ({ + + get: client.GET, + + post: client.POST, + + put: client.PUT, + + patch: client.PATCH, + + delete: client.DELETE + +}) diff --git a/front/src/ui/layouts/constrained.vue b/front/src/ui/layouts/constrained.vue new file mode 100644 index 000000000..19ad5b3df --- /dev/null +++ b/front/src/ui/layouts/constrained.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/front/src/ui/layouts/default.vue b/front/src/ui/layouts/default.vue new file mode 100644 index 000000000..de9bacf21 --- /dev/null +++ b/front/src/ui/layouts/default.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/front/src/ui/pages/upload.vue b/front/src/ui/pages/upload.vue new file mode 100644 index 000000000..e3d08fe3e --- /dev/null +++ b/front/src/ui/pages/upload.vue @@ -0,0 +1,312 @@ + + + + + diff --git a/front/src/ui/pages/upload/all.vue b/front/src/ui/pages/upload/all.vue new file mode 100644 index 000000000..7cae73c72 --- /dev/null +++ b/front/src/ui/pages/upload/all.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/front/src/ui/pages/upload/files.vue b/front/src/ui/pages/upload/files.vue new file mode 100644 index 000000000..e69de29bb diff --git a/front/src/ui/pages/upload/history.vue b/front/src/ui/pages/upload/history.vue new file mode 100644 index 000000000..394f972d4 --- /dev/null +++ b/front/src/ui/pages/upload/history.vue @@ -0,0 +1,17 @@ + + + diff --git a/front/src/ui/pages/upload/index.vue b/front/src/ui/pages/upload/index.vue new file mode 100644 index 000000000..4361fd18d --- /dev/null +++ b/front/src/ui/pages/upload/index.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/front/src/ui/pages/upload/running.vue b/front/src/ui/pages/upload/running.vue new file mode 100644 index 000000000..64a32b019 --- /dev/null +++ b/front/src/ui/pages/upload/running.vue @@ -0,0 +1,12 @@ + + + diff --git a/front/src/ui/routes/auth.ts b/front/src/ui/routes/auth.ts new file mode 100644 index 000000000..33b64ccab --- /dev/null +++ b/front/src/ui/routes/auth.ts @@ -0,0 +1,68 @@ +import type { RouteRecordRaw } from 'vue-router' + +import { requireLoggedOut, requireLoggedIn } from '~/router/guards' + +export default [ + { + path: 'login', + name: 'login', + component: () => import('~/views/auth/Login.vue'), + props: route => ({ next: route.query.next || '/library' }), + beforeEnter: requireLoggedOut({ name: 'library.index' }) + }, + { + path: 'auth/password/reset', + name: 'auth.password-reset', + component: () => import('~/views/auth/PasswordReset.vue'), + props: route => ({ defaultEmail: route.query.email }) + }, + { + path: 'auth/callback', + name: 'auth.callback', + component: () => import('~/views/auth/Callback.vue'), + props: route => ({ + code: route.query.code, + state: route.query.state + }) + }, + { + path: 'auth/email/confirm', + name: 'auth.email-confirm', + component: () => import('~/views/auth/EmailConfirm.vue'), + props: route => ({ defaultKey: route.query.key }) + }, + { + path: 'auth/password/reset/confirm', + name: 'auth.password-reset-confirm', + component: () => import('~/views/auth/PasswordResetConfirm.vue'), + props: route => ({ + defaultUid: route.query.uid, + defaultToken: route.query.token + }) + }, + { + path: 'authorize', + name: 'authorize', + component: () => import('~/components/auth/Authorize.vue'), + props: route => ({ + clientId: route.query.client_id, + redirectUri: route.query.redirect_uri, + scope: route.query.scope, + responseType: route.query.response_type, + nonce: route.query.nonce, + state: route.query.state + }), + beforeEnter: requireLoggedIn() + }, + { + path: 'signup', + name: 'signup', + component: () => import('~/views/auth/Signup.vue'), + props: route => ({ defaultInvitation: route.query.invitation }) + }, + { + path: 'logout', + name: 'logout', + component: () => import('~/components/auth/Logout.vue') + } +] as RouteRecordRaw[] diff --git a/front/src/ui/routes/content.ts b/front/src/ui/routes/content.ts new file mode 100644 index 000000000..da745e6de --- /dev/null +++ b/front/src/ui/routes/content.ts @@ -0,0 +1,41 @@ +import type { RouteRecordRaw } from 'vue-router' + +export default [ + { + path: 'content', + component: () => import('~/views/content/Base.vue'), + children: [{ + path: '', + name: 'content.index', + component: () => import('~/views/content/Home.vue') + }] + }, + { + path: 'content/libraries/tracks', + component: () => import('~/views/content/Base.vue'), + children: [{ + path: '', + name: 'content.libraries.files', + component: () => import('~/views/content/libraries/Files.vue'), + props: route => ({ query: route.query.q }) + }] + }, + { + path: 'content/libraries', + component: () => import('~/views/content/Base.vue'), + children: [{ + path: '', + name: 'content.libraries.index', + component: () => import('~/views/content/libraries/Home.vue') + }] + }, + { + path: 'content/remote', + component: () => import('~/views/content/Base.vue'), + children: [{ + path: '', + name: 'content.remote.index', + component: () => import('~/views/content/remote/Home.vue') + }] + } +] as RouteRecordRaw[] diff --git a/front/src/ui/routes/index.ts b/front/src/ui/routes/index.ts new file mode 100644 index 000000000..d5ca54e5a --- /dev/null +++ b/front/src/ui/routes/index.ts @@ -0,0 +1,140 @@ +import type { RouteRecordRaw } from 'vue-router' + +import settings from './settings' +import library from './library' +import content from './content' +import manage from './manage' +import auth from './auth' +import user from './user' +import store from '~/store' +import { requireLoggedIn } from '~/router/guards' +import { useUploadsStore } from '~/ui/stores/upload' + +export default [ + { + path: '/', + name: 'root', + component: () => import('~/ui/layouts/constrained.vue'), + children: [ + { + path: '/', + name: 'index', + component: () => import('~/components/Home.vue'), + beforeEnter (to, from, next) { + if (store.state.auth.authenticated) return next('/library') + return next() + } + }, + { + path: '/index.html', + redirect: to => { + const { hash, query } = to + return { name: 'index', hash, query } + } + }, + { + path: 'upload', + name: 'upload', + component: () => import('~/ui/pages/upload.vue'), + children: [ + { + path: '', + name: 'upload.index', + component: () => import('~/ui/pages/upload/index.vue') + }, + + { + path: 'running', + name: 'upload.running', + component: () => import('~/ui/pages/upload/running.vue'), + beforeEnter: (_to, _from, next) => { + const uploads = useUploadsStore() + if (uploads.uploadGroups.length === 0) { + next('/upload') + } else { + next() + } + } + }, + + { + path: 'history', + name: 'upload.history', + component: () => import('~/ui/pages/upload/history.vue') + }, + + { + path: 'all', + name: 'upload.all', + component: () => import('~/ui/pages/upload/all.vue') + } + ] + }, + { + path: 'about', + name: 'about', + component: () => import('~/components/About.vue') + }, + { + // TODO (wvffle): Make it a child of /about to have the active style on the sidebar link + path: 'about/pod', + name: 'about-pod', + component: () => import('~/components/AboutPod.vue') + }, + { + path: 'notifications', + name: 'notifications', + component: () => import('~/views/Notifications.vue') + }, + { + path: 'search', + name: 'search', + component: () => import('~/views/Search.vue') + }, + ...auth, + ...settings, + ...user, + { + path: 'favorites', + name: 'favorites', + component: () => import('~/components/favorites/List.vue'), + props: route => ({ + defaultOrdering: route.query.ordering, + defaultPage: route.query.page ? +route.query.page : undefined + }), + beforeEnter: requireLoggedIn() + }, + ...content, + ...manage, + ...library, + { + path: 'channels/:id', + props: true, + component: () => import('~/views/channels/DetailBase.vue'), + children: [ + { + path: '', + name: 'channels.detail', + component: () => import('~/views/channels/DetailOverview.vue') + }, + { + path: 'episodes', + name: 'channels.detail.episodes', + component: () => import('~/views/channels/DetailEpisodes.vue') + } + ] + }, + { + path: 'subscriptions', + name: 'subscriptions', + component: () => import('~/views/channels/SubscriptionsList.vue'), + props: route => ({ defaultQuery: route.query.q }) + } + ] + }, + { + path: '/:pathMatch(.*)*', + name: '404', + component: () => import('~/components/PageNotFound.vue') + } +] as RouteRecordRaw[] diff --git a/front/src/ui/routes/library.ts b/front/src/ui/routes/library.ts new file mode 100644 index 000000000..770c1a2d5 --- /dev/null +++ b/front/src/ui/routes/library.ts @@ -0,0 +1,246 @@ +import type { RouteRecordRaw } from 'vue-router' + +export default [ + { + path: 'library', + component: () => import('~/components/library/Library.vue'), + children: [ + { + path: '', + component: () => import('~/components/library/Home.vue'), + name: 'library.index' + }, + { + path: 'me', + component: () => import('~/components/library/Home.vue'), + name: 'library.me', + props: () => ({ scope: 'me' }) + }, + { + path: 'artists/', + name: 'library.artists.browse', + component: () => import('~/components/library/Artists.vue'), + meta: { + paginateBy: 30 + } + }, + { + path: 'me/artists', + name: 'library.artists.me', + component: () => import('~/components/library/Artists.vue'), + props: { scope: 'me' }, + meta: { + paginateBy: 30 + } + }, + { + path: 'albums/', + name: 'library.albums.browse', + component: () => import('~/components/library/Albums.vue'), + meta: { + paginateBy: 30 + } + }, + { + path: 'me/albums', + name: 'library.albums.me', + component: () => import('~/components/library/Albums.vue'), + props: { scope: 'me' }, + meta: { + paginateBy: 30 + } + }, + { + path: 'podcasts/', + name: 'library.podcasts.browse', + component: () => import('~/components/library/Podcasts.vue'), + meta: { + paginateBy: 30 + } + }, + { + path: 'channels/', + name: 'library.channels.browse', + component: () => import('~/views/channels/List.vue'), + meta: { + paginateBy: 30 + } + }, + { + path: 'radios/', + name: 'library.radios.browse', + component: () => import('~/components/library/Radios.vue'), + meta: { + paginateBy: 12 + } + }, + { + path: 'me/radios/', + name: 'library.radios.me', + component: () => import('~/components/library/Radios.vue'), + props: { scope: 'me' }, + meta: { + paginateBy: 12 + } + }, + { + path: 'radios/build', + name: 'library.radios.build', + component: () => import('~/components/library/radios/Builder.vue'), + props: true + }, + { + path: 'radios/build/:id', + name: 'library.radios.edit', + component: () => import('~/components/library/radios/Builder.vue'), + props: true + }, + { + path: 'radios/:id', + name: 'library.radios.detail', + component: () => import('~/views/radios/Detail.vue'), + props: true + }, + { + path: 'playlists/', + name: 'library.playlists.browse', + component: () => import('~/views/playlists/List.vue'), + meta: { + paginateBy: 25 + } + }, + { + path: 'me/playlists/', + name: 'library.playlists.me', + component: () => import('~/views/playlists/List.vue'), + props: { scope: 'me' }, + meta: { + paginateBy: 25 + } + }, + { + path: 'playlists/:id', + name: 'library.playlists.detail', + component: () => import('~/views/playlists/Detail.vue'), + props: route => ({ + id: route.params.id, + defaultEdit: route.query.mode === 'edit' + }) + }, + { + path: 'tags/:id', + name: 'library.tags.detail', + component: () => import('~/components/library/TagDetail.vue'), + props: true + }, + { + path: 'artists/:id', + component: () => import('~/components/library/ArtistBase.vue'), + props: true, + children: [ + { + path: '', + name: 'library.artists.detail', + component: () => import('~/components/library/ArtistDetail.vue') + }, + { + path: 'edit', + name: 'library.artists.edit', + component: () => import('~/components/library/ArtistEdit.vue') + }, + { + path: 'edit/:editId', + name: 'library.artists.edit.detail', + component: () => import('~/components/library/EditDetail.vue'), + props: true + } + ] + }, + { + path: 'albums/:id', + component: () => import('~/components/library/AlbumBase.vue'), + props: true, + children: [ + { + path: '', + name: 'library.albums.detail', + component: () => import('~/components/library/AlbumDetail.vue') + }, + { + path: 'edit', + name: 'library.albums.edit', + component: () => import('~/components/library/AlbumEdit.vue') + }, + { + path: 'edit/:editId', + name: 'library.albums.edit.detail', + component: () => import('~/components/library/EditDetail.vue'), + props: true + } + ] + }, + { + path: 'tracks/:id', + component: () => import('~/components/library/TrackBase.vue'), + props: true, + children: [ + { + path: '', + name: 'library.tracks.detail', + component: () => import('~/components/library/TrackDetail.vue') + }, + { + path: 'edit', + name: 'library.tracks.edit', + component: () => import('~/components/library/TrackEdit.vue') + }, + { + path: 'edit/:editId', + name: 'library.tracks.edit.detail', + component: () => import('~/components/library/EditDetail.vue'), + props: true + } + ] + }, + { + path: 'uploads/:id', + name: 'library.uploads.detail', + props: true, + component: () => import('~/components/library/UploadDetail.vue') + }, + { + // browse a single library via it's uuid + path: ':id([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})', + props: true, + component: () => import('~/views/library/LibraryBase.vue'), + children: [ + { + path: '', + name: 'library.detail', + component: () => import('~/views/library/DetailOverview.vue') + }, + { + path: 'albums', + name: 'library.detail.albums', + component: () => import('~/views/library/DetailAlbums.vue') + }, + { + path: 'tracks', + name: 'library.detail.tracks', + component: () => import('~/views/library/DetailTracks.vue') + }, + { + path: 'edit', + name: 'library.detail.edit', + component: () => import('~/views/library/Edit.vue') + }, + { + path: 'upload', + name: 'library.detail.upload', + redirect: () => '/upload' + } + ] + } + ] + } +] as RouteRecordRaw[] diff --git a/front/src/ui/routes/manage.ts b/front/src/ui/routes/manage.ts new file mode 100644 index 000000000..5c8947d9c --- /dev/null +++ b/front/src/ui/routes/manage.ts @@ -0,0 +1,188 @@ +import type { RouteRecordRaw } from 'vue-router' + +import { hasPermissions } from '~/router/guards' + +export default [ + { + path: 'manage/settings', + name: 'manage.settings', + beforeEnter: hasPermissions('settings'), + component: () => import('~/views/admin/Settings.vue') + }, + { + path: 'manage/library', + beforeEnter: hasPermissions('library'), + component: () => import('~/views/admin/library/Base.vue'), + children: [ + { + path: 'edits', + name: 'manage.library.edits', + component: () => import('~/views/admin/library/EditsList.vue'), + props: route => ({ defaultQuery: route.query.q }) + }, + { + path: 'artists', + name: 'manage.library.artists', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'artists' }) + }, + { + path: 'artists/:id', + name: 'manage.library.artists.detail', + component: () => import('~/views/admin/library/ArtistDetail.vue'), + props: true + }, + { + path: 'channels', + name: 'manage.channels', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'channels' }) + }, + { + path: 'channels/:id', + name: 'manage.channels.detail', + component: () => import('~/views/admin/ChannelDetail.vue'), + props: true + }, + { + path: 'albums', + name: 'manage.library.albums', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'albums' }) + }, + { + path: 'albums/:id', + name: 'manage.library.albums.detail', + component: () => import('~/views/admin/library/AlbumDetail.vue'), + props: true + }, + { + path: 'tracks', + name: 'manage.library.tracks', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'tracks' }) + }, + { + path: 'tracks/:id', + name: 'manage.library.tracks.detail', + component: () => import('~/views/admin/library/TrackDetail.vue'), + props: true + }, + { + path: 'libraries', + name: 'manage.library.libraries', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'libraries' }) + }, + { + path: 'libraries/:id', + name: 'manage.library.libraries.detail', + component: () => import('~/views/admin/library/LibraryDetail.vue'), + props: true + }, + { + path: 'uploads', + name: 'manage.library.uploads', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'uploads' }) + }, + { + path: 'uploads/:id', + name: 'manage.library.uploads.detail', + component: () => import('~/views/admin/library/UploadDetail.vue'), + props: true + }, + { + path: 'tags', + name: 'manage.library.tags', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'tags' }) + }, + { + path: 'tags/:id', + name: 'manage.library.tags.detail', + component: () => import('~/views/admin/library/TagDetail.vue'), + props: true + } + ] + }, + { + path: 'manage/users', + beforeEnter: hasPermissions('settings'), + component: () => import('~/views/admin/users/Base.vue'), + children: [ + { + path: 'users', + name: 'manage.users.users.list', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ type: 'users' }) + }, + { + path: 'invitations', + name: 'manage.users.invitations.list', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ type: 'invitations' }) + } + ] + }, + { + path: 'manage/moderation', + beforeEnter: hasPermissions('moderation'), + component: () => import('~/views/admin/moderation/Base.vue'), + children: [ + { + path: 'domains', + name: 'manage.moderation.domains.list', + component: () => import('~/views/admin/moderation/DomainsList.vue') + }, + { + path: 'domains/:id', + name: 'manage.moderation.domains.detail', + component: () => import('~/views/admin/moderation/DomainsDetail.vue'), + props: true + }, + { + path: 'accounts', + name: 'manage.moderation.accounts.list', + component: () => import('~/views/admin/CommonList.vue'), + props: route => ({ defaultQuery: route.query.q, type: 'accounts' }) + }, + { + path: 'accounts/:id', + name: 'manage.moderation.accounts.detail', + component: () => import('~/views/admin/moderation/AccountsDetail.vue'), + props: true + }, + { + path: 'reports', + name: 'manage.moderation.reports.list', + component: () => import('~/views/admin/moderation/ReportsList.vue'), + props: route => ({ defaultQuery: route.query.q }), + meta: { + paginateBy: 25 + } + }, + { + path: 'reports/:id', + name: 'manage.moderation.reports.detail', + component: () => import('~/views/admin/moderation/ReportDetail.vue'), + props: true + }, + { + path: 'requests', + name: 'manage.moderation.requests.list', + component: () => import('~/views/admin/moderation/RequestsList.vue'), + props: route => ({ defaultQuery: route.query.q }), + meta: { + paginateBy: 25 + } + }, + { + path: 'requests/:id', + name: 'manage.moderation.requests.detail', + component: () => import('~/views/admin/moderation/RequestDetail.vue'), + props: true + } + ] + } +] as RouteRecordRaw[] diff --git a/front/src/ui/routes/settings.ts b/front/src/ui/routes/settings.ts new file mode 100644 index 000000000..61cd68d9f --- /dev/null +++ b/front/src/ui/routes/settings.ts @@ -0,0 +1,30 @@ +import type { RouteRecordRaw } from 'vue-router' + +export default [ + { + path: 'settings', + name: 'settings', + component: () => import('~/components/auth/Settings.vue') + }, + { + path: 'settings/applications/new', + name: 'settings.applications.new', + props: route => ({ + scopes: route.query.scopes, + name: route.query.name, + redirect_uris: route.query.redirect_uris + }), + component: () => import('~/components/auth/ApplicationNew.vue') + }, + { + path: 'settings/plugins', + name: 'settings.plugins', + component: () => import('~/views/auth/Plugins.vue') + }, + { + path: 'settings/applications/:id/edit', + name: 'settings.applications.edit', + component: () => import('~/components/auth/ApplicationEdit.vue'), + props: true + } +] as RouteRecordRaw[] diff --git a/front/src/ui/routes/user.ts b/front/src/ui/routes/user.ts new file mode 100644 index 000000000..16a8b8990 --- /dev/null +++ b/front/src/ui/routes/user.ts @@ -0,0 +1,39 @@ +import type { RouteRecordRaw } from 'vue-router' + +import store from '~/store' + +export default [ + { suffix: '.full', path: '@:username@:domain' }, + { suffix: '', path: '@:username' } +].map((route) => { + return { + path: route.path, + name: `profile${route.suffix}`, + component: () => import('~/views/auth/ProfileBase.vue'), + beforeEnter (to, from, next) { + if (!store.state.auth.authenticated && to.query.domain && store.getters['instance/domain'] !== to.query.domain) { + return next({ name: 'login', query: { next: to.fullPath } }) + } + + next() + }, + props: true, + children: [ + { + path: '', + name: `profile${route.suffix}.overview`, + component: () => import('~/views/auth/ProfileOverview.vue') + }, + { + path: 'activity', + name: `profile${route.suffix}.activity`, + component: () => import('~/views/auth/ProfileActivity.vue') + }, + { + path: 'manageUploads', + name: `profile${route.suffix}.manageUploads`, + component: () => import('~/views/auth/ManageUploads.vue') + } + ] + } +}) as RouteRecordRaw[] diff --git a/front/src/ui/stores/upload.ts b/front/src/ui/stores/upload.ts new file mode 100644 index 000000000..2b3badcd8 --- /dev/null +++ b/front/src/ui/stores/upload.ts @@ -0,0 +1,258 @@ +import { defineStore, acceptHMRUpdate } from 'pinia' +import { computed, reactive, readonly, ref, markRaw, toRaw, unref, watch } from 'vue' +import { whenever, useWebWorker } from '@vueuse/core' +import { nanoid } from 'nanoid' +import axios from 'axios' + +import FileMetadataParserWorker from '~/ui/workers/file-metadata-parser.ts?worker' +import type { MetadataParsingResult } from '~/ui/workers/file-metadata-parser' + +import type { Tags } from '~/ui/composables/metadata' +import useLogger from '~/composables/useLogger' +import useWebSocketHandler from '~/composables/useWebSocketHandler' + +export type UploadGroupType = 'music-library' | 'music-channel' | 'podcast-channel' +export type FailReason = 'missing-tags' | 'upload-failed' | 'upload-cancelled' | 'import-failed' + +export class UploadGroupEntry { + id = nanoid() + abortController = new AbortController() + progress = 0 + guid?: string + + error?: Error + failReason?: FailReason + importedAt?: Date + + metadata?: { + tags: Tags, + coverUrl?: string + } + + constructor (public file: File, public uploadGroup: UploadGroup) { + UploadGroup.entries[this.id] = this + } + + async upload () { + if (!this.metadata) return + + const body = new FormData() + body.append('metadata', JSON.stringify({ + title: this.metadata.tags.title, + album: { name: this.metadata.tags.album }, + artist: { name: this.metadata.tags.artist } + })) + + body.append('target', JSON.stringify({ + library: this.uploadGroup.targetGUID + })) + + body.append('audioFile', this.file) + + const logger = useLogger() + const { data } = await axios.post(this.uploadGroup.uploadUrl, body, { + headers: { 'Content-Type': 'multipart/form-data' }, + signal: this.abortController.signal, + onUploadProgress: (e) => { + // NOTE: If e.total is absent, we use the file size instead. This is only an approximation, as e.total is the total size of the request, not just the file. + // see: https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/total + this.progress = Math.floor(e.loaded / (e.total ?? this.file.size) * 100) + } + }) + + logger.info(`[${this.id}] upload complete!`) + this.guid = data.guid + } + + fail (reason: FailReason, error: Error) { + this.error = error + this.failReason = reason + this.importedAt = new Date() + } + + cancel (reason: FailReason = 'upload-cancelled', error: Error = new Error('Upload cancelled')) { + this.fail(reason, error) + this.abortController.abort() + } + + retry () { + this.error = undefined + this.failReason = undefined + this.importedAt = undefined + this.progress = 0 + this.abortController = new AbortController() + + if (!this.metadata) { + this.fail('missing-tags', new Error('Missing metadata')) + return + } + + uploadQueue.push(this) + } +} + +export class UploadGroup { + static entries = reactive(Object.create(null)) + + queue: UploadGroupEntry[] = [] + createdAt = new Date() + + constructor ( + public guid: string, + public type: UploadGroupType, + public targetGUID: string, + public uploadUrl: string + ) { } + + get progress () { + return this.queue.reduce((total, entry) => total + entry.progress, 0) / this.queue.length + } + + get failedCount () { + return this.queue.filter((entry) => entry.failReason).length + } + + get importedCount () { + return this.queue.filter((entry) => entry.importedAt && !entry.failReason).length + } + + get processingCount () { + return this.queue.filter((entry) => !entry.importedAt && !entry.failReason).length + } + + queueUpload (file: File) { + const entry = new UploadGroupEntry(file, this) + this.queue.push(entry) + + const { id, metadata } = entry + if (!metadata) { + const logger = useLogger() + logger.log('sending message to worker', id) + retrieveMetadata({ id, file }) + } + + uploadQueue.push(entry) + } + + cancel () { + for (const entry of this.queue) { + if (entry.importedAt) continue + entry.cancel() + } + } + + retry () { + for (const entry of this.queue) { + if (!entry.failReason) continue + entry.retry() + } + } +} + +const uploadQueue: UploadGroupEntry[] = reactive([]) +const uploadGroups: UploadGroup[] = reactive([]) +const currentUploadGroup = ref() +const currentIndex = ref(0) + +// Remove the upload group from the list if there are no uploads +watch(currentUploadGroup, (_, from) => { + if (from && from.queue.length === 0) { + const index = uploadGroups.indexOf(from) + if (index === -1) return + uploadGroups.splice(index, 1) + } +}) + +// Tag extraction with a Web Worker +const { post: retrieveMetadata, data: workerMetadata } = useWebWorker(() => new FileMetadataParserWorker()) +whenever(workerMetadata, (reactiveData) => { + const data = toRaw(unref(reactiveData)) + const entry = UploadGroup.entries[data.id] + if (!entry) return + + if (data.status === 'success') { + entry.metadata = { + tags: markRaw(data.tags), + coverUrl: data.coverUrl + } + } else { + entry.cancel('missing-tags', data.error) + const logger = useLogger() + logger.warn(`Failed to parse metadata for file ${entry.file.name}:`, data.error) + } +}) + +export const useUploadsStore = defineStore('uploads', () => { + const logger = useLogger() + + useWebSocketHandler('import.status_updated', (event) => { + for (const group of uploadGroups) { + const upload = group.queue.find(entry => entry.guid === event.upload.uuid) + if (!upload) continue + + if (event.new_status !== 'errored') { + // TODO: Find out what other field to use here + // @ts-expect-error wrong field + upload.importedAt = event.upload.import_date + } else { + // TODO: Add second parameter `error` + // @ts-expect-error missing parameter + upload.fail('import-failed') + } + break + } + }) + + const createUploadGroup = async (type: UploadGroupType, targetGUID: string) => { + const { data } = await axios.post('/api/v2/upload-groups', { baseUrl: '/' }) + const uploadGroup = new UploadGroup(data.guid, type, targetGUID, data.uploadUrl) + uploadGroups.push(uploadGroup) + currentUploadGroup.value = uploadGroup + } + + const currentUpload = computed(() => uploadQueue[currentIndex.value]) + const isUploading = computed(() => !!currentUpload.value) + const currentUploadWithMetadata = computed(() => currentUpload.value?.metadata ? currentUpload.value : undefined) + + // Upload the file whenever it is available + whenever(currentUploadWithMetadata, (entry) => entry.upload().catch((error) => { + // The tags were missing, so we have cancelled the upload + if (error.code === 'ERR_CANCELED') { + return + } + + entry.fail('upload-failed', error) + logger.error(error) + }).finally(() => { + // Move to the next upload despite failing + currentIndex.value += 1 + })) + + // Prevent the user from leaving the page while uploading + window.addEventListener('beforeunload', (event) => { + if (isUploading.value) { + event.preventDefault() + return (event.returnValue = 'The upload is still in progress. Are you sure you want to leave?') + } + }) + + const progress = computed(() => { + return uploadGroups.reduce((acc, group) => acc + group.progress, 0) / uploadGroups.length + }) + + // Return public API + return { + isUploading, + currentIndex: readonly(currentIndex), + currentUpload, + queue: readonly(uploadQueue), + uploadGroups, + createUploadGroup, + currentUploadGroup, + progress + } +}) + +if (import.meta.hot) { + import.meta.hot.accept(acceptHMRUpdate(useUploadsStore, import.meta.hot)) +} diff --git a/front/src/ui/workers/file-metadata-parser.ts b/front/src/ui/workers/file-metadata-parser.ts new file mode 100644 index 000000000..f3cbeceef --- /dev/null +++ b/front/src/ui/workers/file-metadata-parser.ts @@ -0,0 +1,33 @@ +/// + +import { getCoverUrl, getTags, type Tags } from '~/ui/composables/metadata' + +export interface MetadataParsingSuccess { + id: string + status: 'success' + tags: Tags + coverUrl: string | undefined +} + +export interface MetadataParsingFailure { + id: string + status: 'failure' + error: Error +} + +export type MetadataParsingResult = MetadataParsingSuccess | MetadataParsingFailure + +const parse = async (id: string, file: File) => { + try { + const tags = await getTags(file) + const coverUrl = await getCoverUrl(tags) + + postMessage({ id, status: 'success', tags, coverUrl }) + } catch (error) { + postMessage({ id, status: 'failure', error }) + } +} + +addEventListener('message', async (event) => { + parse(event.data.id, event.data.file) +}) diff --git a/front/src/utils/color.ts b/front/src/utils/color.ts index b30b73856..5ab2d8147 100644 --- a/front/src/utils/color.ts +++ b/front/src/utils/color.ts @@ -1,5 +1,5 @@ // java String#hashCode -export function hashCode (str: string) { +export function hashCode (str = 'default') { let hash = 0 for (let i = 0; i < str.length; i++) { hash = str.charCodeAt(i) + ((hash << 5) - hash) diff --git a/front/src/utils/event-validators.ts b/front/src/utils/event-validators.ts new file mode 100644 index 000000000..ddc8a30e5 --- /dev/null +++ b/front/src/utils/event-validators.ts @@ -0,0 +1,5 @@ +export const preventNonNumeric = (e: KeyboardEvent) => { + if (!e.key.match(/![0-9]$/)) { + e.preventDefault() + } +} diff --git a/front/src/utils/filters.ts b/front/src/utils/filters.ts index 90520b5b5..d0771b81a 100644 --- a/front/src/utils/filters.ts +++ b/front/src/utils/filters.ts @@ -24,7 +24,7 @@ export function humanSize (bytes: number, isSI = true) { const threshold = isSI ? 1000 : 1024 if (Math.abs(bytes) < threshold) { - return `${bytes} B` + return `${Math.floor(bytes)}` } const units = HUMAN_UNITS[isSI ? 'SI' : 'powerOf2'] diff --git a/front/src/utils/fomantic.ts b/front/src/utils/fomantic.ts deleted file mode 100644 index b56083b11..000000000 --- a/front/src/utils/fomantic.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -import $ from 'jquery' - -export const setupDropdown = (selector: string | HTMLElement = '.ui.dropdown', el: Element = document.body) => { - const $dropdown = typeof selector === 'string' - ? $(el).find(selector) - : $(selector) - - $dropdown.dropdown({ - selectOnKeydown: false, - action (text: unknown, value: unknown, $el: JQuery) { - // used to ensure focusing the dropdown and clicking via keyboard - // works as expected - $el[0]?.click() - - $dropdown.dropdown('hide') - } - }) - - return $dropdown -} diff --git a/front/src/utils/utils.ts b/front/src/utils/utils.ts index d11fbb921..848103ce4 100644 --- a/front/src/utils/utils.ts +++ b/front/src/utils/utils.ts @@ -1,4 +1,5 @@ import type { Track, Album, ArtistCredit, QueueItemSource } from '~/types' +import type { components } from '~/generated/types' import { useStore } from '~/store' import type { QueueTrack } from '~/composables/audio/queue' @@ -30,8 +31,7 @@ export function generateTrackCreditStringFromQueue (track: QueueTrack | QueueIte export function getArtistCoverUrl (artistCredits: ArtistCredit[]): string | undefined { for (const artistCredit of artistCredits) { - const cover = artistCredit.artist.cover - const mediumSquareCrop = cover?.urls?.medium_square_crop + const mediumSquareCrop = getSimpleArtistCoverUrl(artistCredit.artist, 'medium_square_crop') if (mediumSquareCrop) { return store.getters['instance/absoluteUrl'](mediumSquareCrop) @@ -39,3 +39,17 @@ export function getArtistCoverUrl (artistCredits: ArtistCredit[]): string | unde } return undefined } + +const getSimpleArtistCover = (artist: components['schemas']['SimpleChannelArtist'] | components['schemas']['Artist'] | components['schemas']['ArtistWithAlbums']) => + (field: 'original' | 'small_square_crop' | 'medium_square_crop' | 'large_square_crop') => + artist.cover + ? (field in artist.cover ? artist.cover.urls[field] : null) + : null + +/** Returns the absolute Url of this artist's cover on this instance + * + * @param artist: a simple artist + * @param field: the size you want +*/ +export const getSimpleArtistCoverUrl = (artist: components['schemas']['SimpleChannelArtist'] | components['schemas']['Artist'] | components['schemas']['ArtistWithAlbums'], field: 'original' | 'small_square_crop' | 'medium_square_crop' | 'large_square_crop') => + store.getters['instance/absoluteUrl'](getSimpleArtistCover(artist)(field)) diff --git a/front/test/msw-server.ts b/front/test/msw-server.ts index f2bc1b08d..d44258ede 100644 --- a/front/test/msw-server.ts +++ b/front/test/msw-server.ts @@ -1508,7 +1508,7 @@ export function getGetAlbums200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -1528,7 +1528,7 @@ export function getGetAlbums200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -1536,10 +1536,10 @@ export function getGetAlbums200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -1577,7 +1577,7 @@ export function getGetAlbums200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), release_date: faker.date.past(), creation_date: faker.date.past(), @@ -1612,7 +1612,7 @@ export function getGetAlbum200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -1632,7 +1632,7 @@ export function getGetAlbum200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -1640,10 +1640,10 @@ export function getGetAlbum200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -1679,7 +1679,7 @@ export function getGetAlbum200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), release_date: faker.date.past(), creation_date: faker.date.past(), @@ -1782,7 +1782,7 @@ export function getGetAlbumLibraries200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), actor: { fid: faker.internet.url(), url: faker.internet.url(), @@ -1811,7 +1811,7 @@ export function getGetAlbumLibraries200Response() { privacy_level: faker.helpers.arrayElement(["me", "instance", "everyone"]), follow: { creation_date: faker.date.past(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), approved: faker.datatype.boolean(), modification_date: faker.date.past(), @@ -1837,7 +1837,7 @@ export function getGetAlbumMutations200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -1882,7 +1882,7 @@ export function getGetAlbumMutations200Response() { export function getCreateAlbumMutation200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -1938,7 +1938,7 @@ export function getGetArtists200Response() { ].map((_) => ({ tracks_count: faker.number.int({ min: undefined, max: undefined }), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -1950,7 +1950,7 @@ export function getGetArtists200Response() { is_local: faker.datatype.boolean(), id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: faker.number.int({ min: undefined, max: undefined }), release_date: faker.date.past(), @@ -1993,13 +1993,13 @@ export function getGetArtists200Response() { tracks_count: faker.number.int({ min: undefined, max: undefined }), id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), content_category: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2018,7 +2018,7 @@ export function getGetArtist200Response() { ].map((_) => ({ tracks_count: faker.number.int({ min: undefined, max: undefined }), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2030,7 +2030,7 @@ export function getGetArtist200Response() { is_local: faker.datatype.boolean(), id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: faker.number.int({ min: undefined, max: undefined }), release_date: faker.date.past(), @@ -2071,13 +2071,13 @@ export function getGetArtist200Response() { tracks_count: faker.number.int({ min: undefined, max: undefined }), id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), content_category: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2182,7 +2182,7 @@ export function getGetArtistLibraries200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), actor: { fid: faker.internet.url(), url: faker.internet.url(), @@ -2211,7 +2211,7 @@ export function getGetArtistLibraries200Response() { privacy_level: faker.helpers.arrayElement(["me", "instance", "everyone"]), follow: { creation_date: faker.date.past(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), approved: faker.datatype.boolean(), modification_date: faker.date.past(), @@ -2237,7 +2237,7 @@ export function getGetArtistMutations200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -2282,7 +2282,7 @@ export function getGetArtistMutations200Response() { export function getCreateArtistMutation200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -2325,7 +2325,7 @@ export function getCreateArtistMutation200Response() { export function getCreateAttachment201Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2337,7 +2337,7 @@ export function getCreateAttachment201Response() { export function getGetAttachment200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2349,7 +2349,7 @@ export function getGetAttachment200Response() { export function getGetAttachmentProxy200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2434,7 +2434,7 @@ export function getGetChannels200Response() { results: [ ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), @@ -2454,7 +2454,7 @@ export function getGetChannels200Response() { html: faker.lorem.slug(1), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2462,7 +2462,7 @@ export function getGetChannels200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), tracks_count: faker.number.int({ min: undefined, max: undefined }), tags: [ ...new Array( @@ -2548,7 +2548,7 @@ export function getCreateChannel201Response() { export function getGetChannel200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), @@ -2568,7 +2568,7 @@ export function getGetChannel200Response() { html: faker.lorem.slug(1), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2576,7 +2576,7 @@ export function getGetChannel200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), tracks_count: faker.number.int({ min: undefined, max: undefined }), tags: [ ...new Array( @@ -2682,7 +2682,7 @@ export function getPartialUpdateChannel200Response() { export function getGetChannelRss200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), @@ -2702,7 +2702,7 @@ export function getGetChannelRss200Response() { html: faker.lorem.slug(1), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2710,7 +2710,7 @@ export function getGetChannelRss200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), tracks_count: faker.number.int({ min: undefined, max: undefined }), tags: [ ...new Array( @@ -2772,7 +2772,7 @@ export function getGetChannelRss200Response() { export function getSubscribeChannel200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), @@ -2792,7 +2792,7 @@ export function getSubscribeChannel200Response() { html: faker.lorem.slug(1), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2800,7 +2800,7 @@ export function getSubscribeChannel200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), tracks_count: faker.number.int({ min: undefined, max: undefined }), tags: [ ...new Array( @@ -2862,7 +2862,7 @@ export function getSubscribeChannel200Response() { export function getGetChannelMetadataChoices200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), @@ -2882,7 +2882,7 @@ export function getGetChannelMetadataChoices200Response() { html: faker.lorem.slug(1), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2890,7 +2890,7 @@ export function getGetChannelMetadataChoices200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), tracks_count: faker.number.int({ min: undefined, max: undefined }), tags: [ ...new Array( @@ -2952,7 +2952,7 @@ export function getGetChannelMetadataChoices200Response() { export function getSubscribeChannelRss200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), @@ -2972,7 +2972,7 @@ export function getSubscribeChannelRss200Response() { html: faker.lorem.slug(1), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -2980,7 +2980,7 @@ export function getSubscribeChannelRss200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), tracks_count: faker.number.int({ min: undefined, max: undefined }), tags: [ ...new Array( @@ -3055,7 +3055,7 @@ export function getGetFavoriteTracks200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -3068,7 +3068,7 @@ export function getGetFavoriteTracks200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -3088,7 +3088,7 @@ export function getGetFavoriteTracks200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -3096,17 +3096,17 @@ export function getGetFavoriteTracks200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -3126,7 +3126,7 @@ export function getGetFavoriteTracks200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -3134,11 +3134,11 @@ export function getGetFavoriteTracks200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -3155,7 +3155,7 @@ export function getGetFavoriteTracks200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -3193,7 +3193,7 @@ export function getGetFavoriteTracks200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -3203,7 +3203,7 @@ export function getGetFavoriteTracks200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -3287,7 +3287,7 @@ export function getGetFederationActor200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -3306,7 +3306,7 @@ export function getGetFederationActor200Response() { html: faker.lorem.slug(1), }, icon: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -3319,7 +3319,7 @@ export function getGetFederationActor200Response() { export function getGetFederationActorLibrary200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), name: faker.person.fullName(), description: faker.lorem.slug(1), @@ -3478,7 +3478,7 @@ export function getGetFederationLibraryFollows200Response() { full_username: faker.person.fullName(), is_local: faker.datatype.boolean(), }, - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: faker.lorem.slug(1), approved: faker.datatype.boolean(), })), @@ -3509,7 +3509,7 @@ export function getCreateFederationLibraryFollow201Response() { full_username: faker.person.fullName(), is_local: faker.datatype.boolean(), }, - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: faker.lorem.slug(1), approved: faker.datatype.boolean(), }; @@ -3539,7 +3539,7 @@ export function getGetFederationLibraryFollow200Response() { full_username: faker.person.fullName(), is_local: faker.datatype.boolean(), }, - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: faker.lorem.slug(1), approved: faker.datatype.boolean(), }; @@ -3569,7 +3569,7 @@ export function getRejectFederationLibraryFollow200Response() { full_username: faker.person.fullName(), is_local: faker.datatype.boolean(), }, - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: faker.lorem.slug(1), approved: faker.datatype.boolean(), }; @@ -3599,7 +3599,7 @@ export function getGetAllFederationLibraryFollows200Response() { full_username: faker.person.fullName(), is_local: faker.datatype.boolean(), }, - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: faker.lorem.slug(1), approved: faker.datatype.boolean(), }; @@ -3616,7 +3616,7 @@ export function getGetFederationInboxes200Response() { id: faker.number.int({ min: undefined, max: undefined }), type: faker.helpers.arrayElement(["to", "cc"]), activity: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), actor: { fid: faker.internet.url(), @@ -3664,7 +3664,7 @@ export function getGetFederationInbox200Response() { id: faker.number.int({ min: undefined, max: undefined }), type: faker.helpers.arrayElement(["to", "cc"]), activity: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), actor: { fid: faker.internet.url(), @@ -3711,7 +3711,7 @@ export function getUpdateFederationInbox200Response() { id: faker.number.int({ min: undefined, max: undefined }), type: faker.helpers.arrayElement(["to", "cc"]), activity: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), actor: { fid: faker.internet.url(), @@ -3758,7 +3758,7 @@ export function getPartialUpdateFederationInbox200Response() { id: faker.number.int({ min: undefined, max: undefined }), type: faker.helpers.arrayElement(["to", "cc"]), activity: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), actor: { fid: faker.internet.url(), @@ -3805,7 +3805,7 @@ export function getCreateFederationInboxAction200Response() { id: faker.number.int({ min: undefined, max: undefined }), type: faker.helpers.arrayElement(["to", "cc"]), activity: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), actor: { fid: faker.internet.url(), @@ -3850,7 +3850,7 @@ export function getCreateFederationInboxAction200Response() { export function getGetFederationLibrary200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), actor: { fid: faker.internet.url(), url: faker.internet.url(), @@ -3879,7 +3879,7 @@ export function getGetFederationLibrary200Response() { privacy_level: faker.helpers.arrayElement(["me", "instance", "everyone"]), follow: { creation_date: faker.date.past(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), approved: faker.datatype.boolean(), modification_date: faker.date.past(), @@ -3898,7 +3898,7 @@ export function getGetFederationLibrary200Response() { export function getCreateFederationLibraryScan200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), actor: { fid: faker.internet.url(), url: faker.internet.url(), @@ -3927,7 +3927,7 @@ export function getCreateFederationLibraryScan200Response() { privacy_level: faker.helpers.arrayElement(["me", "instance", "everyone"]), follow: { creation_date: faker.date.past(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), approved: faker.datatype.boolean(), modification_date: faker.date.past(), @@ -3946,7 +3946,7 @@ export function getCreateFederationLibraryScan200Response() { export function getCreateFederationLibraryFetch200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), actor: { fid: faker.internet.url(), url: faker.internet.url(), @@ -3975,7 +3975,7 @@ export function getCreateFederationLibraryFetch200Response() { privacy_level: faker.helpers.arrayElement(["me", "instance", "everyone"]), follow: { creation_date: faker.date.past(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), approved: faker.datatype.boolean(), modification_date: faker.date.past(), @@ -4006,7 +4006,7 @@ export function getGetHistoryListenings200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4019,7 +4019,7 @@ export function getGetHistoryListenings200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -4039,7 +4039,7 @@ export function getGetHistoryListenings200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4047,17 +4047,17 @@ export function getGetHistoryListenings200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -4077,7 +4077,7 @@ export function getGetHistoryListenings200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4085,11 +4085,11 @@ export function getGetHistoryListenings200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4106,7 +4106,7 @@ export function getGetHistoryListenings200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -4144,7 +4144,7 @@ export function getGetHistoryListenings200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -4154,7 +4154,7 @@ export function getGetHistoryListenings200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4208,7 +4208,7 @@ export function getGetHistoryListening200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4221,7 +4221,7 @@ export function getGetHistoryListening200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -4241,7 +4241,7 @@ export function getGetHistoryListening200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4249,17 +4249,17 @@ export function getGetHistoryListening200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -4279,7 +4279,7 @@ export function getGetHistoryListening200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4287,11 +4287,11 @@ export function getGetHistoryListening200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4308,7 +4308,7 @@ export function getGetHistoryListening200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -4346,7 +4346,7 @@ export function getGetHistoryListening200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -4356,7 +4356,7 @@ export function getGetHistoryListening200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -4594,7 +4594,7 @@ export function getGetLibraries200Response() { results: [ ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), name: faker.person.fullName(), description: faker.lorem.slug(1), @@ -4629,7 +4629,7 @@ export function getGetLibraries200Response() { export function getCreateLibrary201Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), name: faker.person.fullName(), description: faker.lorem.slug(1), @@ -4663,7 +4663,7 @@ export function getCreateLibrary201Response() { export function getGetLibrary200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), name: faker.person.fullName(), description: faker.lorem.slug(1), @@ -4697,7 +4697,7 @@ export function getGetLibrary200Response() { export function getUpdateLibrary200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), name: faker.person.fullName(), description: faker.lorem.slug(1), @@ -4731,7 +4731,7 @@ export function getUpdateLibrary200Response() { export function getPartialUpdateLibrary200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), name: faker.person.fullName(), description: faker.lorem.slug(1), @@ -4793,7 +4793,7 @@ export function getGetLibraryFollows200Response() { full_username: faker.person.fullName(), is_local: faker.datatype.boolean(), }, - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: faker.lorem.slug(1), approved: faker.datatype.boolean(), })), @@ -5063,12 +5063,12 @@ export function getAdminGetChannels200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5106,7 +5106,7 @@ export function getAdminGetChannels200Response() { ).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5182,12 +5182,12 @@ export function getAdminGetChannels200Response() { export function getAdminGetChannel200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5225,7 +5225,7 @@ export function getAdminGetChannel200Response() { ).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5300,12 +5300,12 @@ export function getAdminGetChannel200Response() { export function getAdminGetChannelStats200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5343,7 +5343,7 @@ export function getAdminGetChannelStats200Response() { ).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5576,12 +5576,12 @@ export function getAdminGetAlbums200Response() { ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5595,7 +5595,7 @@ export function getAdminGetAlbums200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5639,12 +5639,12 @@ export function getAdminGetAlbum200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5658,7 +5658,7 @@ export function getAdminGetAlbum200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5699,12 +5699,12 @@ export function getAdminGetLibraryAlbumStats200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5718,7 +5718,7 @@ export function getAdminGetLibraryAlbumStats200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5759,12 +5759,12 @@ export function getAdminCreateAlbumAction200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5778,7 +5778,7 @@ export function getAdminCreateAlbumAction200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5825,7 +5825,7 @@ export function getAdminGetArtists200Response() { ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5863,7 +5863,7 @@ export function getAdminGetArtists200Response() { ).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5885,7 +5885,7 @@ export function getAdminGetArtist200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5921,7 +5921,7 @@ export function getAdminGetArtist200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5938,7 +5938,7 @@ export function getAdminGetLibraryArtistStats200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -5974,7 +5974,7 @@ export function getAdminGetLibraryArtistStats200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -5991,7 +5991,7 @@ export function getAdminCreateArtistAction200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6027,7 +6027,7 @@ export function getAdminCreateArtistAction200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6049,7 +6049,7 @@ export function getAdminGetLibraries200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6093,7 +6093,7 @@ export function getAdminGetLibraries200Response() { export function getAdminGetLibrary200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6136,7 +6136,7 @@ export function getAdminGetLibrary200Response() { export function getAdminUpdateLibrary200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6179,7 +6179,7 @@ export function getAdminUpdateLibrary200Response() { export function getAdminPartialUpdateLibrary200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6222,7 +6222,7 @@ export function getAdminPartialUpdateLibrary200Response() { export function getAdminGetLibraryStats200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6265,7 +6265,7 @@ export function getAdminGetLibraryStats200Response() { export function getAdminCreateLibraryAction200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6315,7 +6315,7 @@ export function getAdminGetTracks200Response() { ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), position: faker.number.int({ min: 0, max: 2147483647 }), @@ -6327,7 +6327,7 @@ export function getAdminGetTracks200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6336,12 +6336,12 @@ export function getAdminGetTracks200Response() { album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6355,7 +6355,7 @@ export function getAdminGetTracks200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6394,7 +6394,7 @@ export function getAdminGetTracks200Response() { ).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6410,7 +6410,7 @@ export function getAdminGetTrack200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), position: faker.number.int({ min: 0, max: 2147483647 }), @@ -6422,7 +6422,7 @@ export function getAdminGetTrack200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6431,12 +6431,12 @@ export function getAdminGetTrack200Response() { album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6450,7 +6450,7 @@ export function getAdminGetTrack200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6487,7 +6487,7 @@ export function getAdminGetTrack200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6502,7 +6502,7 @@ export function getAdminGetTrackStats200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), position: faker.number.int({ min: 0, max: 2147483647 }), @@ -6514,7 +6514,7 @@ export function getAdminGetTrackStats200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6523,12 +6523,12 @@ export function getAdminGetTrackStats200Response() { album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6542,7 +6542,7 @@ export function getAdminGetTrackStats200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6579,7 +6579,7 @@ export function getAdminGetTrackStats200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6594,7 +6594,7 @@ export function getAdminCreateTrackAction200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), position: faker.number.int({ min: 0, max: 2147483647 }), @@ -6606,7 +6606,7 @@ export function getAdminCreateTrackAction200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6615,12 +6615,12 @@ export function getAdminCreateTrackAction200Response() { album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6634,7 +6634,7 @@ export function getAdminCreateTrackAction200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), domain: faker.lorem.slug(1), @@ -6671,7 +6671,7 @@ export function getAdminCreateTrackAction200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => faker.lorem.slug(1)), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -6691,7 +6691,7 @@ export function getAdminGetUploads200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), domain: faker.lorem.slug(1), is_local: faker.datatype.boolean(), @@ -6727,7 +6727,7 @@ export function getAdminGetUploads200Response() { track: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), position: faker.number.int({ min: 0, max: 2147483647 }), @@ -6739,7 +6739,7 @@ export function getAdminGetUploads200Response() { }, library: { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6786,7 +6786,7 @@ export function getAdminGetUploads200Response() { export function getAdminGetUpload200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), domain: faker.lorem.slug(1), is_local: faker.datatype.boolean(), @@ -6822,7 +6822,7 @@ export function getAdminGetUpload200Response() { track: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), position: faker.number.int({ min: 0, max: 2147483647 }), @@ -6834,7 +6834,7 @@ export function getAdminGetUpload200Response() { }, library: { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6876,7 +6876,7 @@ export function getAdminGetUpload200Response() { export function getAdminCreateUploadAction200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), domain: faker.lorem.slug(1), is_local: faker.datatype.boolean(), @@ -6912,7 +6912,7 @@ export function getAdminCreateUploadAction200Response() { track: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), position: faker.number.int({ min: 0, max: 2147483647 }), @@ -6924,7 +6924,7 @@ export function getAdminCreateUploadAction200Response() { }, library: { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), url: faker.internet.url(), name: faker.person.fullName(), @@ -6972,7 +6972,7 @@ export function getModerationGetInstancePolicies200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["domain", "actor"]), id: faker.lorem.slug(1), @@ -6992,7 +6992,7 @@ export function getModerationGetInstancePolicies200Response() { export function getModerationCreateInstancePolicy201Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["domain", "actor"]), id: faker.lorem.slug(1), @@ -7011,7 +7011,7 @@ export function getModerationCreateInstancePolicy201Response() { export function getModerationGetInstancePolicy200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["domain", "actor"]), id: faker.lorem.slug(1), @@ -7030,7 +7030,7 @@ export function getModerationGetInstancePolicy200Response() { export function getModerationUpdateInstancePolicy200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["domain", "actor"]), id: faker.lorem.slug(1), @@ -7049,7 +7049,7 @@ export function getModerationUpdateInstancePolicy200Response() { export function getModerationPartialUpdateInstancePolicy200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["domain", "actor"]), id: faker.lorem.slug(1), @@ -7074,7 +7074,7 @@ export function getModerationGetNotes200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), summary: faker.lorem.slug(1), author: { @@ -7112,7 +7112,7 @@ export function getModerationGetNotes200Response() { export function getModerationCreateNote201Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), summary: faker.lorem.slug(1), author: { @@ -7149,7 +7149,7 @@ export function getModerationCreateNote201Response() { export function getModerationGetNote200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), summary: faker.lorem.slug(1), author: { @@ -7192,7 +7192,7 @@ export function getModerationGetReports200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), creation_date: faker.date.past(), handled_date: faker.date.past(), @@ -7293,7 +7293,7 @@ export function getModerationGetReports200Response() { ).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), summary: faker.lorem.slug(1), author: { @@ -7329,7 +7329,7 @@ export function getModerationGetReports200Response() { export function getModerationGetReport200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), creation_date: faker.date.past(), handled_date: faker.date.past(), @@ -7428,7 +7428,7 @@ export function getModerationGetReport200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), summary: faker.lorem.slug(1), author: { @@ -7463,7 +7463,7 @@ export function getModerationGetReport200Response() { export function getModerationUpdateReport200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), creation_date: faker.date.past(), handled_date: faker.date.past(), @@ -7562,7 +7562,7 @@ export function getModerationUpdateReport200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), summary: faker.lorem.slug(1), author: { @@ -7597,7 +7597,7 @@ export function getModerationUpdateReport200Response() { export function getModerationPartialUpdateReport200Response() { return { id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), creation_date: faker.date.past(), handled_date: faker.date.past(), @@ -7696,7 +7696,7 @@ export function getModerationPartialUpdateReport200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ id: faker.number.int({ min: undefined, max: undefined }), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), summary: faker.lorem.slug(1), author: { @@ -8340,7 +8340,7 @@ export function getGetModerationContentFilters200Response() { results: [ ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["artist"]), id: faker.lorem.slug(1), @@ -8352,7 +8352,7 @@ export function getGetModerationContentFilters200Response() { export function getCreateModerationContentFilter201Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["artist"]), id: faker.lorem.slug(1), @@ -8363,7 +8363,7 @@ export function getCreateModerationContentFilter201Response() { export function getGetModerationContentFilter200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), target: { type: faker.helpers.arrayElement(["artist"]), id: faker.lorem.slug(1), @@ -8374,7 +8374,7 @@ export function getGetModerationContentFilter200Response() { export function getCreateModerationReport201Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), summary: faker.lorem.slug(1), creation_date: faker.date.past(), handled_date: faker.date.past(), @@ -8402,7 +8402,7 @@ export function getGetMutations200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -8447,7 +8447,7 @@ export function getGetMutations200Response() { export function getGetMutation200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -8491,7 +8491,7 @@ export function getGetMutation200Response() { export function getApproveMutation200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -8535,7 +8535,7 @@ export function getApproveMutation200Response() { export function getRejectMutation200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -8694,7 +8694,7 @@ export function getGetPlaylists200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -8754,7 +8754,7 @@ export function getCreatePlaylist201Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -8811,7 +8811,7 @@ export function getGetPlaylist200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -8868,7 +8868,7 @@ export function getUpdatePlaylist200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -8925,7 +8925,7 @@ export function getPartialUpdatePlaylist200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -8982,7 +8982,7 @@ export function getAddToPlaylist200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9039,7 +9039,7 @@ export function getReorderTrackInPlaylist200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9096,7 +9096,7 @@ export function getRemoveFromPlaylist2200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9176,7 +9176,7 @@ export function getGetRadios200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9205,7 +9205,7 @@ export function getCreateRadio201Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9233,7 +9233,7 @@ export function getGetRadio200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9261,7 +9261,7 @@ export function getUpdateRadio200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9289,7 +9289,7 @@ export function getPartialUpdateRadio200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9310,7 +9310,7 @@ export function getGetRadioTrack200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -9330,7 +9330,7 @@ export function getGetRadioTrack200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9338,17 +9338,17 @@ export function getGetRadioTrack200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -9368,7 +9368,7 @@ export function getGetRadioTrack200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9376,11 +9376,11 @@ export function getGetRadioTrack200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9395,7 +9395,7 @@ export function getGetRadioTrack200Response() { uploads: [ ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -9431,7 +9431,7 @@ export function getGetRadioTrack200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -9441,7 +9441,7 @@ export function getGetRadioTrack200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9474,7 +9474,7 @@ export function getValidateRadio200Response() { name: faker.person.fullName(), date_joined: faker.date.past(), avatar: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9561,7 +9561,7 @@ export function getGetSearchResults200Response() { ].map((_) => ({ tracks_count: faker.number.int({ min: undefined, max: undefined }), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9573,7 +9573,7 @@ export function getGetSearchResults200Response() { is_local: faker.datatype.boolean(), id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: faker.number.int({ min: undefined, max: undefined }), release_date: faker.date.past(), @@ -9616,13 +9616,13 @@ export function getGetSearchResults200Response() { tracks_count: faker.number.int({ min: undefined, max: undefined }), id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), content_category: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9637,7 +9637,7 @@ export function getGetSearchResults200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -9657,7 +9657,7 @@ export function getGetSearchResults200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9665,17 +9665,17 @@ export function getGetSearchResults200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -9695,7 +9695,7 @@ export function getGetSearchResults200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9703,11 +9703,11 @@ export function getGetSearchResults200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9724,7 +9724,7 @@ export function getGetSearchResults200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -9762,7 +9762,7 @@ export function getGetSearchResults200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -9772,7 +9772,7 @@ export function getGetSearchResults200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9788,7 +9788,7 @@ export function getGetSearchResults200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -9808,7 +9808,7 @@ export function getGetSearchResults200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9816,10 +9816,10 @@ export function getGetSearchResults200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9857,7 +9857,7 @@ export function getGetSearchResults200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), release_date: faker.date.past(), creation_date: faker.date.past(), @@ -9887,7 +9887,7 @@ export function getGetSubscriptions200Response() { ].map((_) => ({ approved: faker.datatype.boolean(), fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), })), }; @@ -9897,7 +9897,7 @@ export function getGetSubscription200Response() { return { approved: faker.datatype.boolean(), fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), creation_date: faker.date.past(), }; } @@ -9907,8 +9907,8 @@ export function getGetAllSubscriptions200Response() { results: [ ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), - channel: faker.datatype.uuid(), + uuid: faker.string.uuid(), + channel: faker.string.uuid(), })), count: faker.number.int({ min: undefined, max: undefined }), }; @@ -9958,7 +9958,7 @@ export function getGetTracks200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -9978,7 +9978,7 @@ export function getGetTracks200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -9986,17 +9986,17 @@ export function getGetTracks200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10016,7 +10016,7 @@ export function getGetTracks200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10024,11 +10024,11 @@ export function getGetTracks200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10045,7 +10045,7 @@ export function getGetTracks200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -10083,7 +10083,7 @@ export function getGetTracks200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -10093,7 +10093,7 @@ export function getGetTracks200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10111,7 +10111,7 @@ export function getGetTrack200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10131,7 +10131,7 @@ export function getGetTrack200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10139,17 +10139,17 @@ export function getGetTrack200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10169,7 +10169,7 @@ export function getGetTrack200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10177,11 +10177,11 @@ export function getGetTrack200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10196,7 +10196,7 @@ export function getGetTrack200Response() { uploads: [ ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -10232,7 +10232,7 @@ export function getGetTrack200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -10242,7 +10242,7 @@ export function getGetTrack200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10348,7 +10348,7 @@ export function getGetTrackLibraries200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), actor: { fid: faker.internet.url(), url: faker.internet.url(), @@ -10377,7 +10377,7 @@ export function getGetTrackLibraries200Response() { privacy_level: faker.helpers.arrayElement(["me", "instance", "everyone"]), follow: { creation_date: faker.date.past(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), fid: faker.internet.url(), approved: faker.datatype.boolean(), modification_date: faker.date.past(), @@ -10403,7 +10403,7 @@ export function getGetTrackMutations200Response() { ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -10448,7 +10448,7 @@ export function getGetTrackMutations200Response() { export function getCreateTrackMutation200Response() { return { fid: faker.internet.url(), - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), type: faker.lorem.slug(1), creation_date: faker.date.past(), applied_date: faker.date.past(), @@ -10497,7 +10497,7 @@ export function getGetUploads200Response() { results: [ ...new Array(faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH })).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), filename: faker.person.fullName(), creation_date: faker.date.past(), mimetype: faker.lorem.slug(1), @@ -10505,7 +10505,7 @@ export function getGetUploads200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10525,7 +10525,7 @@ export function getGetUploads200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10533,17 +10533,17 @@ export function getGetUploads200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10563,7 +10563,7 @@ export function getGetUploads200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10571,11 +10571,11 @@ export function getGetUploads200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10592,7 +10592,7 @@ export function getGetUploads200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -10630,7 +10630,7 @@ export function getGetUploads200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -10640,7 +10640,7 @@ export function getGetUploads200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10680,7 +10680,7 @@ export function getGetUploads200Response() { export function getCreateUpload201Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), filename: faker.person.fullName(), creation_date: faker.date.past(), mimetype: faker.lorem.slug(1), @@ -10688,7 +10688,7 @@ export function getCreateUpload201Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10708,7 +10708,7 @@ export function getCreateUpload201Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10716,17 +10716,17 @@ export function getCreateUpload201Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10746,7 +10746,7 @@ export function getCreateUpload201Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10754,11 +10754,11 @@ export function getCreateUpload201Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10775,7 +10775,7 @@ export function getCreateUpload201Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -10813,7 +10813,7 @@ export function getCreateUpload201Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -10823,7 +10823,7 @@ export function getCreateUpload201Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10862,7 +10862,7 @@ export function getCreateUpload201Response() { export function getGetUpload200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), filename: faker.person.fullName(), creation_date: faker.date.past(), mimetype: faker.lorem.slug(1), @@ -10870,7 +10870,7 @@ export function getGetUpload200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10890,7 +10890,7 @@ export function getGetUpload200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10898,17 +10898,17 @@ export function getGetUpload200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -10928,7 +10928,7 @@ export function getGetUpload200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10936,11 +10936,11 @@ export function getGetUpload200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -10957,7 +10957,7 @@ export function getGetUpload200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -10995,7 +10995,7 @@ export function getGetUpload200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -11005,7 +11005,7 @@ export function getGetUpload200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11044,7 +11044,7 @@ export function getGetUpload200Response() { export function getUpdateUpload200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), filename: faker.person.fullName(), creation_date: faker.date.past(), mimetype: faker.lorem.slug(1), @@ -11052,7 +11052,7 @@ export function getUpdateUpload200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -11072,7 +11072,7 @@ export function getUpdateUpload200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11080,17 +11080,17 @@ export function getUpdateUpload200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -11110,7 +11110,7 @@ export function getUpdateUpload200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11118,11 +11118,11 @@ export function getUpdateUpload200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11139,7 +11139,7 @@ export function getUpdateUpload200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -11177,7 +11177,7 @@ export function getUpdateUpload200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -11187,7 +11187,7 @@ export function getUpdateUpload200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11226,7 +11226,7 @@ export function getUpdateUpload200Response() { export function getPartialUpdateUpload200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), filename: faker.person.fullName(), creation_date: faker.date.past(), mimetype: faker.lorem.slug(1), @@ -11234,7 +11234,7 @@ export function getPartialUpdateUpload200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -11254,7 +11254,7 @@ export function getPartialUpdateUpload200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11262,17 +11262,17 @@ export function getPartialUpdateUpload200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -11292,7 +11292,7 @@ export function getPartialUpdateUpload200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11300,11 +11300,11 @@ export function getPartialUpdateUpload200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11321,7 +11321,7 @@ export function getPartialUpdateUpload200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -11359,7 +11359,7 @@ export function getPartialUpdateUpload200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -11369,7 +11369,7 @@ export function getPartialUpdateUpload200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11413,7 +11413,7 @@ export function getGetUploadMetadata200Response() { disc_number: faker.lorem.slug(1), copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), tags: faker.lorem.slug(1), description: faker.lorem.slug(1), album: faker.lorem.slug(1), @@ -11424,7 +11424,7 @@ export function getGetUploadMetadata200Response() { export function getCreateUploadAction200Response() { return { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), filename: faker.person.fullName(), creation_date: faker.date.past(), mimetype: faker.lorem.slug(1), @@ -11432,7 +11432,7 @@ export function getCreateUploadAction200Response() { artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -11452,7 +11452,7 @@ export function getCreateUploadAction200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11460,17 +11460,17 @@ export function getCreateUploadAction200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, album: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), artist: { id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), name: faker.person.fullName(), creation_date: faker.date.past(), modification_date: faker.date.past(), @@ -11490,7 +11490,7 @@ export function getCreateUploadAction200Response() { html: faker.lorem.slug(1), }, attachment_cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11498,11 +11498,11 @@ export function getCreateUploadAction200Response() { .map((_) => ({ [faker.lorem.word()]: null })) .reduce((acc, next) => Object.assign(acc, next), {}), }, - channel: faker.datatype.uuid(), + channel: faker.string.uuid(), }, release_date: faker.date.past(), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), @@ -11519,7 +11519,7 @@ export function getCreateUploadAction200Response() { faker.number.int({ min: 1, max: MAX_ARRAY_LENGTH }), ).keys(), ].map((_) => ({ - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), listen_url: faker.internet.url(), size: faker.number.int({ min: undefined, max: undefined }), duration: faker.number.int({ min: undefined, max: undefined }), @@ -11557,7 +11557,7 @@ export function getCreateUploadAction200Response() { }, id: faker.number.int({ min: undefined, max: undefined }), fid: faker.internet.url(), - mbid: faker.datatype.uuid(), + mbid: faker.string.uuid(), title: faker.lorem.slug(1), creation_date: faker.date.past(), is_local: faker.datatype.boolean(), @@ -11567,7 +11567,7 @@ export function getCreateUploadAction200Response() { copyright: faker.lorem.slug(1), license: faker.lorem.slug(1), cover: { - uuid: faker.datatype.uuid(), + uuid: faker.string.uuid(), size: faker.number.int({ min: undefined, max: undefined }), mimetype: faker.lorem.slug(1), creation_date: faker.date.past(), diff --git a/front/test/specs/views/admin/library.test.ts b/front/test/specs/views/admin/library.test.ts deleted file mode 100644 index dca3aaa2f..000000000 --- a/front/test/specs/views/admin/library.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import DangerousButton from '~/components/common/DangerousButton.vue' -import AlbumDetail from '~/views/admin/library/AlbumDetail.vue' -import SanitizedHtml from '~/components/SanitizedHtml.vue' -import HumanDate from '~/components/common/HumanDate.vue' - -import { shallowMount } from '@vue/test-utils' -import { vi } from 'vitest' - -import router from '~/router' -import store from '~/store' - -describe('views/admin/library', () => { - describe('Album details', () => { - it('displays default cover', async () => { - const wrapper = shallowMount(AlbumDetail, { - props: { id: 1 }, - directives: { - dropdown: () => null, - title: () => null, - lazy: () => null - }, - global: { - stubs: { DangerousButton, HumanDate, SanitizedHtml }, - plugins: [router, store] - } - }) - - await vi.waitUntil(() => wrapper.find('img').exists()) - expect(wrapper.find('img').attributes('src')).to.include('default-cover') - }) - }) -})