From 416e3b788b3970e707fcc251b9db78b25d244409 Mon Sep 17 00:00:00 2001 From: Filip Naumovski Date: Mon, 10 Jul 2023 20:14:37 +0200 Subject: [PATCH] feat: refactor profiles calls to services and controllers --- package.json | 2 +- src/containers/AppRoutes/AppRoutes.tsx | 4 +- src/containers/Profiles/CreateProfile.tsx | 23 ++--- src/containers/Profiles/DeleteProfile.tsx | 9 +- src/containers/Profiles/EditProfile.tsx | 33 +++---- src/containers/Profiles/Profiles.tsx | 16 ++-- src/services/cleeng.account.service.ts | 12 +-- src/services/inplayer.account.service.ts | 83 +++++++++++------- src/stores/AccountController.ts | 44 ++++++++-- types/account.d.ts | 45 ++++------ yarn.lock | 101 ++++++++++++++++------ 11 files changed, 234 insertions(+), 138 deletions(-) diff --git a/package.json b/package.json index e0352847c..6f3476e41 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "dependencies": { "@adyen/adyen-web": "^5.42.1", "@codeceptjs/allure-legacy": "^1.0.2", - "@inplayer-org/inplayer.js": "^3.13.12", + "@inplayer-org/inplayer.js": "^3.13.13", "classnames": "^2.3.1", "date-fns": "^2.28.0", "dompurify": "^2.3.8", diff --git a/src/containers/AppRoutes/AppRoutes.tsx b/src/containers/AppRoutes/AppRoutes.tsx index 0048ff837..750d75239 100644 --- a/src/containers/AppRoutes/AppRoutes.tsx +++ b/src/containers/AppRoutes/AppRoutes.tsx @@ -25,8 +25,8 @@ export default function AppRoutes() { const userModal = useQueryParam('u'); const { accessModel } = useConfigStore(({ config, accessModel }) => ({ config, accessModel }), shallow); - const { canManageProfiles, profile } = useAccountStore(({ canManageProfiles, profile }) => ({ canManageProfiles, profile }), shallow); - const shouldManageProfiles = canManageProfiles && !profile && (accessModel === 'SVOD' || accessModel === 'AUTHVOD') && !userModal; + const { canManageProfiles, profile, user } = useAccountStore(({ canManageProfiles, profile, user }) => ({ canManageProfiles, profile, user }), shallow); + const shouldManageProfiles = !!user && canManageProfiles && !profile && (accessModel === 'SVOD' || accessModel === 'AUTHVOD') && !userModal; return ( diff --git a/src/containers/Profiles/CreateProfile.tsx b/src/containers/Profiles/CreateProfile.tsx index c32005f7a..53cdb7dbd 100644 --- a/src/containers/Profiles/CreateProfile.tsx +++ b/src/containers/Profiles/CreateProfile.tsx @@ -6,10 +6,9 @@ import profileStyles from './Profiles.module.scss'; import Form from './Form'; import styles from '#src/pages/User/User.module.scss'; -import { createProfile } from '#src/services/inplayer.account.service'; import { useAccountStore } from '#src/stores/AccountStore'; -import type { ProfilePayload, ListProfiles } from '#types/account'; -import { listProfiles } from '#src/stores/AccountController'; +import type { ProfilePayload, ListProfilesResponse } from '#types/account'; +import { createProfile, listProfiles } from '#src/stores/AccountController'; import LoadingOverlay from '#src/components/LoadingOverlay/LoadingOverlay'; import type { UseFormOnSubmitHandler } from '#src/hooks/useForm'; @@ -30,28 +29,30 @@ const CreateProfile = () => { }, [canManageProfiles, navigate]); // this is only needed so we can set different avatar url which will be temporary - const { data, isLoading }: UseQueryResult = useQuery(['listProfiles'], () => listProfiles(null), { staleTime: 0 }); + const { data, isLoading }: UseQueryResult = useQuery(['listProfiles'], () => listProfiles(), { staleTime: 0 }); const activeProfiles = data?.collection?.length || 0; const initialValues = { name: '', adult: true, avatar_url: '', - pin: null, + pin: undefined, }; const createProfileHandler: UseFormOnSubmitHandler = async (formData, { setSubmitting, setErrors }) => { try { - const profile = await createProfile(null, true, { - name: formData.name, - adult: formData.adult, - avatar_url: AVATARS[activeProfiles], - }); + const profile = ( + await createProfile({ + name: formData.name, + adult: formData.adult, + avatar_url: AVATARS[activeProfiles], + }) + )?.responseData; if (profile?.id) { setSubmitting(false); navigate('/u/profiles'); } else { - setErrors({ form: profile?.message || 'Something went wrong. Please try again later.' }); + setErrors({ form: 'Something went wrong. Please try again later.' }); setSubmitting(false); } } catch { diff --git a/src/containers/Profiles/DeleteProfile.tsx b/src/containers/Profiles/DeleteProfile.tsx index d727d5ff2..c66440f3f 100644 --- a/src/containers/Profiles/DeleteProfile.tsx +++ b/src/containers/Profiles/DeleteProfile.tsx @@ -7,8 +7,8 @@ import Button from '#src/components/Button/Button'; import Dialog from '#src/components/Dialog/Dialog'; import { removeQueryParam } from '#src/utils/location'; import useQueryParam from '#src/hooks/useQueryParam'; -import { deleteProfile } from '#src/services/inplayer.account.service'; import LoadingOverlay from '#src/components/LoadingOverlay/LoadingOverlay'; +import { deleteProfile } from '#src/stores/AccountController'; const DeleteProfile = () => { const navigate = useNavigate(); @@ -25,8 +25,11 @@ const DeleteProfile = () => { const deleteHandler = async () => { try { setIsDeleting(true); - const profile = await deleteProfile(null, true, id); - if (profile.code === 200) { + if (!id) { + return; + } + const response = await deleteProfile({ id }); + if (response?.errors.length === 0) { closeHandler(); setIsDeleting(false); navigate('/u/profiles'); diff --git a/src/containers/Profiles/EditProfile.tsx b/src/containers/Profiles/EditProfile.tsx index ab05acf2e..e5036b409 100644 --- a/src/containers/Profiles/EditProfile.tsx +++ b/src/containers/Profiles/EditProfile.tsx @@ -1,5 +1,5 @@ import React, { useMemo, useState } from 'react'; -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery } from 'react-query'; import { useLocation, useNavigate, useParams } from 'react-router'; import profileStyles from './Profiles.module.scss'; @@ -7,13 +7,13 @@ import Form from './Form'; import DeleteProfile from './DeleteProfile'; import styles from '#src/pages/User/User.module.scss'; -import { getProfileDetails, updateProfile } from '#src/services/inplayer.account.service'; -import type { Profile, ProfilePayload } from '#types/account'; +import type { ProfilePayload } from '#types/account'; import LoadingOverlay from '#src/components/LoadingOverlay/LoadingOverlay'; import type { UseFormOnSubmitHandler } from '#src/hooks/useForm'; import Button from '#src/components/Button/Button'; import { addQueryParam } from '#src/utils/location'; import FormFeedback from '#src/components/FormFeedback/FormFeedback'; +import { getProfileDetails, updateProfile } from '#src/stores/AccountController'; const EditProfile = () => { const { id } = useParams(); @@ -21,39 +21,42 @@ const EditProfile = () => { const navigate = useNavigate(); const [fullName, setFullName] = useState(''); - const { - data: profileDetails, - isLoading, - isFetching, - }: UseQueryResult = useQuery(['getProfileDetails'], () => getProfileDetails(null, true, id), { + const { data, isLoading, isFetching } = useQuery(['getProfileDetails'], () => getProfileDetails({ id: id || '' }), { staleTime: 0, }); + const profileDetails = data?.responseData; + const initialValues = useMemo(() => { return { id: profileDetails?.id || '', name: profileDetails?.name || '', adult: profileDetails?.adult ?? true, avatar_url: profileDetails?.avatar_url || '', - pin: null, + pin: undefined, }; }, [profileDetails]); + if (!id) { + navigate('/u/profiles'); + } + const updateProfileHandler: UseFormOnSubmitHandler = async (formData, { setErrors, setSubmitting }) => { try { - const adult = formData.adult.toString() === 'true' ? true : false; - const profile = await updateProfile(null, true, { - id: formData.id, + const response = await updateProfile({ + id: id, name: formData.name, - adult, - avatar_url: formData.avatar_url, + adult: formData.adult, + avatar_url: formData.avatar_url || profileDetails?.avatar_url, }); + const profile = response?.responseData; + if (profile?.id) { setSubmitting(false); navigate('/u/profiles'); } else { - setErrors({ form: profile?.message || 'Something went wrong. Please try again later.' }); + setErrors({ form: 'Something went wrong. Please try again later.' }); setSubmitting(false); } } catch { diff --git a/src/containers/Profiles/Profiles.tsx b/src/containers/Profiles/Profiles.tsx index 60a69022a..41c49eb6b 100644 --- a/src/containers/Profiles/Profiles.tsx +++ b/src/containers/Profiles/Profiles.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react'; import { useNavigate } from 'react-router'; -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery } from 'react-query'; import shallow from 'zustand/shallow'; import styles from './Profiles.module.scss'; @@ -8,11 +8,10 @@ import styles from './Profiles.module.scss'; import * as persist from '#src/utils/persist'; import ProfileBox from '#src/components/ProfileBox/ProfileBox'; import { useAccountStore } from '#src/stores/AccountStore'; -import { initializeAccount, listProfiles } from '#src/stores/AccountController'; -import type { AuthData, ListProfiles, Profile } from '#types/account'; +import { enterProfile, initializeAccount, listProfiles } from '#src/stores/AccountController'; +import type { AuthData, Profile } from '#types/account'; import AddNewProfile from '#src/components/ProfileBox/AddNewProfile'; import LoadingOverlay from '#src/components/LoadingOverlay/LoadingOverlay'; -import { enterProfile } from '#src/services/inplayer.account.service'; import Button from '#src/components/Button/Button'; import { useFavoritesStore } from '#src/stores/FavoritesStore'; import { useWatchHistoryStore } from '#src/stores/WatchHistoryStore'; @@ -34,16 +33,17 @@ const Profiles = ({ editMode = false }: Props) => { if (!canManageProfiles) navigate('/'); }, [canManageProfiles, navigate]); - const { data, isLoading, isFetching }: UseQueryResult = useQuery(['listProfiles'], () => listProfiles(null), { + const { data, isLoading, isFetching } = useQuery(['listProfiles'], listProfiles, { staleTime: 0, }); - const activeProfiles = data?.collection?.length || 0; + const activeProfiles = data?.responseData.collection.length || 0; const canAddNew = activeProfiles < MAX_PROFILES; const handleProfileSelection = async (id: string) => { try { useAccountStore.setState({ loading: true }); - const profile = await enterProfile(null, true, { id }); + const response = await enterProfile({ id }); + const profile = response?.responseData; if (profile?.credentials?.access_token) { const authData: AuthData = { @@ -82,7 +82,7 @@ const Profiles = ({ editMode = false }: Props) => {

{!editMode ? 'Who’s watching?' : 'Manage profiles'}

)}
- {data?.collection?.map((profile: Profile) => ( + {data?.responseData.collection?.map((profile: Profile) => ( navigate(`/u/profiles/edit/${profile.id}`)} diff --git a/src/services/cleeng.account.service.ts b/src/services/cleeng.account.service.ts index ef04c4b12..57066cc52 100644 --- a/src/services/cleeng.account.service.ts +++ b/src/services/cleeng.account.service.ts @@ -257,9 +257,9 @@ export const canUpdatePaymentMethod = true; export const canShowReceipts = true; export const canManageProfiles = false; -export const listProfiles = async () => { - return { - canManageProfiles: false, - collection: [], - }; -}; +export const listProfiles = () => null; +export const createProfile = () => null; +export const enterProfile = () => null; +export const updateProfile = () => null; +export const getProfileDetails = () => null; +export const deleteProfile = () => null; diff --git a/src/services/inplayer.account.service.ts b/src/services/inplayer.account.service.ts index 87dae123e..4d6f7cc72 100644 --- a/src/services/inplayer.account.service.ts +++ b/src/services/inplayer.account.service.ts @@ -1,19 +1,15 @@ import InPlayer, { AccountData, Env, RegisterField, UpdateAccountData, FavoritesData, WatchHistory } from '@inplayer-org/inplayer.js'; import i18next from 'i18next'; -import { get, performDelete, post, put } from './inplayer.service'; - import type { AuthData, Capture, ChangePassword, ChangePasswordWithOldPassword, Consent, - ProfilePayload, Customer, CustomerConsent, EnterProfile, - EnterProfilePayload, DeleteAccount, ExportAccountData, ExternalData, @@ -22,7 +18,6 @@ import type { GetCustomerConsentsResponse, GetPublisherConsents, Login, - Profile, Register, ResetPassword, UpdateCaptureAnswers, @@ -30,6 +25,11 @@ import type { UpdateCustomerArgs, UpdateCustomerConsents, UpdatePersonalShelves, + DeleteProfile, + GetProfileDetails, + UpdateProfile, + CreateProfile, + ListProfiles, } from '#types/account'; import type { Config } from '#types/Config'; import type { InPlayerAuthData, InPlayerError } from '#types/inplayer'; @@ -43,8 +43,12 @@ enum InPlayerEnv { Daily = 'daily', } +// TODO: remove ignore +// @ts-ignore export const initialize = async (config: Config, _logoutFn: () => Promise) => { - const env: string = config.integrations?.jwp?.useSandbox ? InPlayerEnv.Development : InPlayerEnv.Production; + // TODO: Remove this when feature flag exists in dev database + // const env: string = config.integrations?.jwp?.useSandbox ? InPlayerEnv.Development : InPlayerEnv.Production; + const env: string = InPlayerEnv.Daily; InPlayer.setConfig(env as Env); const queryParams = new URLSearchParams(window.location.href.split('#')[1]); const token = queryParams.get('token'); @@ -338,61 +342,82 @@ export const updatePersonalShelves: UpdatePersonalShelves = async (payload) => { } }; -export const listProfiles = async (auth: AuthData | null) => { +export const listProfiles: ListProfiles = async () => { try { - const response = await get(true, `/v2/accounts/profiles`, auth?.jwt); + const response = await InPlayer.Account.getProfiles(); return { - canManageProfiles: true, - collection: response as Profile[], + responseData: { + canManageProfiles: true, + collection: response.data, + }, + errors: [], }; } catch { - return { - canManageProfiles: false, - collection: [], - }; + throw new Error('Unable to fetch profiles.'); } }; -export const createProfile = async (auth: AuthData | null, sandbox: boolean, payload: ProfilePayload) => { +export const createProfile: CreateProfile = async (payload) => { try { - const response = await post(sandbox, `/v2/accounts/profiles`, JSON.stringify(payload), auth?.jwt); - return response; + const response = await InPlayer.Account.createProfile(payload.name, payload.adult, payload.avatar_url, payload.pin); + return { + responseData: response.data, + errors: [], + }; } catch { throw new Error('Unable to create profile.'); } }; -export const updateProfile = async (auth: AuthData | null, sandbox: boolean, payload: ProfilePayload) => { +export const updateProfile: UpdateProfile = async (payload) => { try { - const response = await put(sandbox, `/v2/accounts/profiles/${payload.id}`, JSON.stringify(payload), auth?.jwt); - return response; + if (!payload.id) { + throw new Error('Profile id is required.'); + } + const response = await InPlayer.Account.updateProfile(payload.id, payload.name, payload.avatar_url, payload.adult); + return { + responseData: response.data, + errors: [], + }; } catch { throw new Error('Unable to update profile.'); } }; -export const enterProfile = async (auth: AuthData | null, sandbox: boolean, payload: EnterProfilePayload): Promise => { +export const enterProfile: EnterProfile = async ({ id, pin }) => { try { - const response = await post(sandbox, `/v2/accounts/profiles/${payload.id}/token`, JSON.stringify(payload), auth?.jwt); - return response; + const response = await InPlayer.Account.enterProfile(id, pin); + return { + responseData: response.data, + errors: [], + }; } catch { throw new Error('Unable to enter profile.'); } }; -export const getProfileDetails = async (auth: AuthData | null, sandbox: boolean, id: string = ''): Promise => { +export const getProfileDetails: GetProfileDetails = async ({ id }) => { try { - const response = await get(sandbox, `/v2/accounts/profiles/${id}`, auth?.jwt); - return response; + const response = await InPlayer.Account.getProfileDetails(id); + return { + responseData: response.data, + errors: [], + }; } catch { throw new Error('Unable to get profile details.'); } }; -export const deleteProfile = async (auth: AuthData | null, sandbox: boolean, id: string = '') => { +export const deleteProfile: DeleteProfile = async ({ id }) => { try { - const response = await performDelete(sandbox, `/v2/accounts/profiles/${id}`, auth?.jwt); - return response; + await InPlayer.Account.deleteProfile(id); + return { + responseData: { + message: 'Profile deleted successfully', + code: 200, + }, + errors: [], + }; } catch { throw new Error('Unable to delete profile.'); } diff --git a/src/stores/AccountController.ts b/src/stores/AccountController.ts index b683f025e..625e99ead 100644 --- a/src/stores/AccountController.ts +++ b/src/stores/AccountController.ts @@ -6,15 +6,17 @@ import * as persist from '#src/utils/persist'; import { useFavoritesStore } from '#src/stores/FavoritesStore'; import { useWatchHistoryStore } from '#src/stores/WatchHistoryStore'; import type { - AuthData, Capture, Customer, CustomerConsent, EmailConfirmPasswordInput, + EnterProfilePayload, FirstLastNameInput, GetCaptureStatusResponse, GetCustomerConsentsResponse, GetPublisherConsentsResponse, + ProfileDetailsPayload, + ProfilePayload, } from '#types/account'; import type { Offer } from '#types/checkout'; import { useAccountStore } from '#src/stores/AccountStore'; @@ -138,10 +140,39 @@ export const getAccount = async () => { }); }; -export const listProfiles = async (auth: AuthData | null) => { - return await useService(async ({ accountService }) => { - const response = await accountService.listProfiles(auth); - return response; +export const listProfiles = async () => { + return await useService(async ({ accountService, sandbox }) => { + return await accountService.listProfiles(undefined, sandbox ?? true); + }); +}; + +export const createProfile = async ({ name, adult, avatar_url, pin }: ProfilePayload) => { + return await useService(async ({ accountService, sandbox }) => { + return await accountService.createProfile({ name, adult, avatar_url, pin }, sandbox ?? true); + }); +}; + +export const updateProfile = async ({ id, name, adult, avatar_url, pin }: ProfilePayload) => { + return await useService(async ({ accountService, sandbox }) => { + return await accountService.updateProfile({ id, name, adult, avatar_url, pin }, sandbox ?? true); + }); +}; + +export const enterProfile = async ({ id, pin }: EnterProfilePayload) => { + return await useService(async ({ accountService, sandbox }) => { + return await accountService.enterProfile({ id, pin }, sandbox ?? true); + }); +}; + +export const deleteProfile = async ({ id }: ProfileDetailsPayload) => { + return await useService(async ({ accountService, sandbox }) => { + return await accountService.deleteProfile({ id }, sandbox ?? true); + }); +}; + +export const getProfileDetails = async ({ id }: ProfileDetailsPayload) => { + return await useService(async ({ accountService, sandbox }) => { + return await accountService.getProfileDetails({ id }, sandbox ?? true); }); }; @@ -511,7 +542,8 @@ export async function getMediaItems(watchlistId: string | undefined | null, medi } async function afterLogin(user: Customer, customerConsents: CustomerConsent[] | null, accessModel: string, shouldSubscriptionReload: boolean = true) { - const { canManageProfiles } = await listProfiles(null); + const response = await listProfiles(); + const canManageProfiles = response?.responseData?.canManageProfiles ?? false; useAccountStore.setState({ user, canManageProfiles, diff --git a/types/account.d.ts b/types/account.d.ts index 29e2553d2..8f41c6d46 100644 --- a/types/account.d.ts +++ b/types/account.d.ts @@ -1,4 +1,4 @@ -import type { CommonResponse } from '@inplayer-org/inplayer.js'; +import type { CommonResponse, ProfilesData } from '@inplayer-org/inplayer.js'; import type { SerializedWatchHistoryItem } from './watchHistory'; import type { SerializedFavorite } from './favorite'; @@ -309,29 +309,14 @@ export type UpdatePersonalShelvesArgs = { }; }; -export type Profile = { - id: string; - name: string; - avatar_url: string; - adult: boolean; - account_id?: number; - default?: boolean; - pin_required?: boolean; - created_at?: number; - updated_at?: number; -}; - -export type ListProfiles = { - canManageProfiles: boolean; - collection: Profile[]; -}; +export type Profile = ProfilesData; export type ProfilePayload = { id?: string; name: string; adult: boolean; avatar_url?: string; - pin?: number | null; + pin?: number; }; export type EnterProfilePayload = { @@ -339,17 +324,13 @@ export type EnterProfilePayload = { pin?: number; }; -export type EnterProfile = { +export type ProfileDetailsPayload = { id: string; - name: string; - account_id: number; - adult: boolean; - avatar_url: string; - pin_required: boolean; - credentials: { - access_token: string; - expires: number; - }; +}; + +export type ListProfilesResponse = { + canManageProfiles: boolean; + collection: ProfilesData[]; }; export type FirstLastNameInput = { @@ -386,5 +367,11 @@ type ChangePassword = EnvironmentServiceRequest>; type UpdatePersonalShelves = EnvironmentServiceRequest>; type GetLocales = EmptyServiceRequest; -type ExportAccountData = AuthServiceRequest; +type ExportAccountData = EnvironmentServiceRequest; type DeleteAccount = EnvironmentServiceRequest; +type ListProfiles = EnvironmentServiceRequest; +type CreateProfile = EnvironmentServiceRequest; +type UpdateProfile = EnvironmentServiceRequest; +type EnterProfile = EnvironmentServiceRequest; +type GetProfileDetails = EnvironmentServiceRequest; +type DeleteProfile = EnvironmentServiceRequest; diff --git a/yarn.lock b/yarn.lock index b73d83327..89db37b61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1732,10 +1732,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@inplayer-org/inplayer.js@^3.13.12": - version "3.13.12" - resolved "https://registry.yarnpkg.com/@inplayer-org/inplayer.js/-/inplayer.js-3.13.12.tgz#6a8ff6516ff92fd1a38ef4e2854de512c29ad44b" - integrity sha512-NYmpZINBxu/vR4eTFtT84NfN0TcHH1Tplf+j36lQeiSa6Xj0mN6BlTUpZYXVseuOb9SePvGUbPyjXBCIAhALrg== +"@inplayer-org/inplayer.js@^3.13.13": + version "3.13.13" + resolved "https://registry.yarnpkg.com/@inplayer-org/inplayer.js/-/inplayer.js-3.13.13.tgz#b64dfee35e488037f64608a8264aecc6e85252da" + integrity sha512-LnyriDdasvRy1CUv2Zg0THRs48s+LffhnHO7hEf4K7gOl5DaFmkf16OM1uOBuOjL4xzHGgFR3IfPz7Pay3uzsA== dependencies: aws-iot-device-sdk "^2.2.6" axios "^0.21.2" @@ -3576,7 +3576,7 @@ compare-func@^2.0.0: concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== concat-stream@^2.0.0, concat-stream@~2.0.0: version "2.0.0" @@ -3683,9 +3683,9 @@ core-js-pure@^3.25.1, core-js-pure@^3.25.3: integrity sha512-p/npFUJXXBkCCTIlEGBdghofn00jWG6ZOtdoIXSJmAu2QBvN0IqpZXWweOytcwE6cfx8ZvVUy1vw8zxhe4Y2vg== core-js@^3.19.2: - version "3.22.3" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.3.tgz#498c41d997654cb00e81c7a54b44f0ab21ab01d5" - integrity sha512-1t+2a/d2lppW1gkLXx3pKPVGbBdxXAkqztvWb1EJ8oF8O2gIGiytzflNiFEehYwVK/t2ryUsGBoOFFvNx95mbg== + version "3.31.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.31.1.tgz#f2b0eea9be9da0def2c5fece71064a7e5d687653" + integrity sha512-2sKLtfq1eFST7l7v62zaqXacPc7uG8ZAya8ogijLhTtaKNcpzpB4TMoTw2Si+8GYKRwFPMMtUT0263QFWFfqyQ== core-util-is@~1.0.0: version "1.0.3" @@ -3897,14 +3897,14 @@ de-indent@^1.0.2: resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0= -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1: +debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.2.0, debug@^4.3.1: version "4.3.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" -debug@4.3.4, debug@^4.3.2, debug@^4.3.4: +debug@4.3.4, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -4981,7 +4981,7 @@ fs-tree-diff@^2.0.1: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: version "2.3.2" @@ -5013,7 +5013,17 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + +get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -5094,7 +5104,7 @@ glob-stream@^6.1.0: to-absolute-glob "^2.0.0" unique-stream "^2.0.2" -glob@7.2.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@7.2.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -5117,6 +5127,18 @@ glob@^6.0.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.6: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + global-dirs@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" @@ -5226,7 +5248,12 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.1, has-symbols@^1.0.2: +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -5507,7 +5534,7 @@ indent-string@^4.0.0: inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" @@ -5857,7 +5884,7 @@ is-wsl@^2.2.0: isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isexe@^2.0.0: version "2.0.0" @@ -6645,7 +6672,7 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -"minimatch@2 || 3", minimatch@5.0.1, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.2: +"minimatch@2 || 3", minimatch@5.0.1, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -6673,12 +6700,12 @@ minimist@1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -minimist@^1.1.0: +minimist@^1.1.0, minimist@^1.2.5: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.6: version "1.2.7" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== @@ -6988,11 +7015,16 @@ object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.11.0, object-inspect@^1.9.0: +object-inspect@^1.11.0: version "1.12.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== +object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -7051,7 +7083,7 @@ oblivious-set@1.0.0: once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" @@ -7271,7 +7303,7 @@ path-exists@^4.0.0: path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-key@^2.0.1: version "2.0.1" @@ -7962,7 +7994,7 @@ read@^2.1.0: dependencies: mute-stream "~1.0.0" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0: +readable-stream@3: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -7971,7 +8003,20 @@ readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stre string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +readable-stream@^2.0.0, readable-stream@^2.3.3: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^2.0.1, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -7984,7 +8029,7 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.5, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.6.0: +readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== @@ -9326,7 +9371,7 @@ typedarray-to-buffer@^3.1.5: typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== typescript@^4.2.4, typescript@^4.3.4: version "4.6.2" @@ -9481,7 +9526,7 @@ use-debounce@^7.0.1: util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== uuid@9.0.0, uuid@^9.0: version "9.0.0" @@ -10062,7 +10107,7 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: version "3.0.3"