diff --git a/apps/web/components/Dashboard/UserAccount/UserEditGeneral/UserEditGeneral.tsx b/apps/web/components/Dashboard/UserAccount/UserEditGeneral/UserEditGeneral.tsx
index aa74203a..eb465d22 100644
--- a/apps/web/components/Dashboard/UserAccount/UserEditGeneral/UserEditGeneral.tsx
+++ b/apps/web/components/Dashboard/UserAccount/UserEditGeneral/UserEditGeneral.tsx
@@ -14,7 +14,8 @@ import UserAvatar from '@components/Objects/UserAvatar'
import { updateUserAvatar } from '@services/users/users'
function UserEditGeneral() {
- const session = useLHSession() as any
+ const session = useLHSession() as any;
+ const access_token = session.data.tokens.access_token;
const [localAvatar, setLocalAvatar] = React.useState(null) as any
const [isLoading, setIsLoading] = React.useState(false) as any
const [error, setError] = React.useState() as any
@@ -24,7 +25,7 @@ function UserEditGeneral() {
const file = event.target.files[0]
setLocalAvatar(file)
setIsLoading(true)
- const res = await updateUserAvatar(session.data.user_uuid, file)
+ const res = await updateUserAvatar(session.data.user_uuid, file, access_token)
// wait for 1 second to show loading animation
await new Promise((r) => setTimeout(r, 1500))
if (res.success === false) {
@@ -36,7 +37,7 @@ function UserEditGeneral() {
}
}
- useEffect(() => {}, [session, session.data])
+ useEffect(() => { }, [session, session.data])
return (
@@ -53,7 +54,7 @@ function UserEditGeneral() {
onSubmit={(values, { setSubmitting }) => {
setTimeout(() => {
setSubmitting(false)
- updateProfile(values, session.data.user.id)
+ updateProfile(values, session.data.user.id, access_token)
}, 400)
}}
>
diff --git a/apps/web/components/Dashboard/UserAccount/UserEditPassword/UserEditPassword.tsx b/apps/web/components/Dashboard/UserAccount/UserEditPassword/UserEditPassword.tsx
index e57d0302..3f8a80b4 100644
--- a/apps/web/components/Dashboard/UserAccount/UserEditPassword/UserEditPassword.tsx
+++ b/apps/web/components/Dashboard/UserAccount/UserEditPassword/UserEditPassword.tsx
@@ -5,13 +5,14 @@ import React, { useEffect } from 'react'
function UserEditPassword() {
const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const updatePasswordUI = async (values: any) => {
let user_id = session.data.user.id
- await updatePassword(user_id, values)
+ await updatePassword(user_id, values, access_token)
}
- useEffect(() => {}, [session])
+ useEffect(() => { }, [session])
return (
diff --git a/apps/web/components/Dashboard/Users/OrgAccess/OrgAccess.tsx b/apps/web/components/Dashboard/Users/OrgAccess/OrgAccess.tsx
index 82273e35..fd5a86b6 100644
--- a/apps/web/components/Dashboard/Users/OrgAccess/OrgAccess.tsx
+++ b/apps/web/components/Dashboard/Users/OrgAccess/OrgAccess.tsx
@@ -3,27 +3,28 @@ import PageLoading from '@components/Objects/Loaders/PageLoading'
import ConfirmationModal from '@components/StyledElements/ConfirmationModal/ConfirmationModal'
import { getAPIUrl, getUriWithOrg } from '@services/config/config'
import { swrFetcher } from '@services/utils/ts/requests'
-import { Globe, Shield, Ticket, User, UserSquare, Users, X } from 'lucide-react'
+import { Globe, Ticket, UserSquare, Users, X } from 'lucide-react'
import Link from 'next/link'
import React, { useEffect } from 'react'
import useSWR, { mutate } from 'swr'
import dayjs from 'dayjs'
import {
changeSignupMechanism,
- createInviteCode,
deleteInviteCode,
} from '@services/organizations/invites'
-import Toast from '@components/StyledElements/Toast/Toast'
import toast from 'react-hot-toast'
import { useRouter } from 'next/navigation'
import Modal from '@components/StyledElements/Modal/Modal'
import OrgInviteCodeGenerate from '@components/Objects/Modals/Dash/OrgAccess/OrgInviteCodeGenerate'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
function OrgAccess() {
const org = useOrg() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const { data: invites } = useSWR(
org ? `${getAPIUrl()}orgs/${org?.id}/invites` : null,
- swrFetcher
+ (url) => swrFetcher(url, access_token)
)
const [isLoading, setIsLoading] = React.useState(false)
const [joinMethod, setJoinMethod] = React.useState('closed')
@@ -40,10 +41,8 @@ function OrgAccess() {
}
}
-
-
async function deleteInvite(invite: any) {
- let res = await deleteInviteCode(org.id, invite.invite_code_uuid)
+ let res = await deleteInviteCode(org.id, invite.invite_code_uuid, access_token)
if (res.status == 200) {
mutate(`${getAPIUrl()}orgs/${org.id}/invites`)
} else {
@@ -52,7 +51,7 @@ function OrgAccess() {
}
async function changeJoinMethod(method: 'open' | 'inviteOnly') {
- let res = await changeSignupMechanism(org.id, method)
+ let res = await changeSignupMechanism(org.id, method, access_token)
if (res.status == 200) {
router.refresh()
mutate(`${getAPIUrl()}orgs/slug/${org?.slug}`)
diff --git a/apps/web/components/Dashboard/Users/OrgUserGroups/OrgUserGroups.tsx b/apps/web/components/Dashboard/Users/OrgUserGroups/OrgUserGroups.tsx
index 8a874b95..4d357dd4 100644
--- a/apps/web/components/Dashboard/Users/OrgUserGroups/OrgUserGroups.tsx
+++ b/apps/web/components/Dashboard/Users/OrgUserGroups/OrgUserGroups.tsx
@@ -1,4 +1,5 @@
'use client'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useOrg } from '@components/Contexts/OrgContext'
import AddUserGroup from '@components/Objects/Modals/Dash/OrgUserGroups/AddUserGroup'
import ManageUsers from '@components/Objects/Modals/Dash/OrgUserGroups/ManageUsers'
@@ -14,17 +15,19 @@ import useSWR, { mutate } from 'swr'
function OrgUserGroups() {
const org = useOrg() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const [userGroupManagementModal, setUserGroupManagementModal] = React.useState(false)
const [createUserGroupModal, setCreateUserGroupModal] = React.useState(false)
const [selectedUserGroup, setSelectedUserGroup] = React.useState(null) as any
const { data: usergroups } = useSWR(
org ? `${getAPIUrl()}usergroups/org/${org.id}` : null,
- swrFetcher
+ (url) => swrFetcher(url, access_token)
)
const deleteUserGroupUI = async (usergroup_id: any) => {
- const res = await deleteUserGroup(usergroup_id)
+ const res = await deleteUserGroup(usergroup_id, access_token)
if (res.status == 200) {
mutate(`${getAPIUrl()}usergroups/org/${org.id}`)
}
diff --git a/apps/web/components/Dashboard/Users/OrgUsers/OrgUsers.tsx b/apps/web/components/Dashboard/Users/OrgUsers/OrgUsers.tsx
index 1b394e36..6048816d 100644
--- a/apps/web/components/Dashboard/Users/OrgUsers/OrgUsers.tsx
+++ b/apps/web/components/Dashboard/Users/OrgUsers/OrgUsers.tsx
@@ -1,3 +1,4 @@
+import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useOrg } from '@components/Contexts/OrgContext'
import PageLoading from '@components/Objects/Loaders/PageLoading'
import RolesUpdate from '@components/Objects/Modals/Dash/OrgUsers/RolesUpdate'
@@ -14,9 +15,11 @@ import useSWR, { mutate } from 'swr'
function OrgUsers() {
const org = useOrg() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const { data: orgUsers } = useSWR(
org ? `${getAPIUrl()}orgs/${org?.id}/users` : null,
- swrFetcher
+ (url) => swrFetcher(url, access_token)
)
const [rolesModal, setRolesModal] = React.useState(false)
const [selectedUser, setSelectedUser] = React.useState(null) as any
@@ -28,7 +31,7 @@ function OrgUsers() {
}
const handleRemoveUser = async (user_id: any) => {
- const res = await removeUserFromOrg(org.id, user_id)
+ const res = await removeUserFromOrg(org.id, user_id,access_token)
if (res.status === 200) {
await mutate(`${getAPIUrl()}orgs/${org.id}/users`)
} else {
@@ -39,7 +42,6 @@ function OrgUsers() {
useEffect(() => {
if (orgUsers) {
setIsLoading(false)
- console.log(orgUsers)
}
}, [org, orgUsers])
diff --git a/apps/web/components/Dashboard/Users/OrgUsersAdd/OrgUsersAdd.tsx b/apps/web/components/Dashboard/Users/OrgUsersAdd/OrgUsersAdd.tsx
index d0217849..08bac53b 100644
--- a/apps/web/components/Dashboard/Users/OrgUsersAdd/OrgUsersAdd.tsx
+++ b/apps/web/components/Dashboard/Users/OrgUsersAdd/OrgUsersAdd.tsx
@@ -1,3 +1,4 @@
+import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useOrg } from '@components/Contexts/OrgContext'
import PageLoading from '@components/Objects/Loaders/PageLoading'
import Toast from '@components/StyledElements/Toast/Toast'
@@ -5,20 +6,22 @@ import ToolTip from '@components/StyledElements/Tooltip/Tooltip'
import { getAPIUrl } from '@services/config/config'
import { inviteBatchUsers } from '@services/organizations/invites'
import { swrFetcher } from '@services/utils/ts/requests'
-import { Info, Shield, UserPlus } from 'lucide-react'
+import { Info, UserPlus } from 'lucide-react'
import React, { useEffect } from 'react'
import toast from 'react-hot-toast'
import useSWR, { mutate } from 'swr'
function OrgUsersAdd() {
const org = useOrg() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const [isLoading, setIsLoading] = React.useState(false)
const [invitedUsers, setInvitedUsers] = React.useState('');
const [selectedInviteCode, setSelectedInviteCode] = React.useState('');
async function sendInvites() {
setIsLoading(true)
- let res = await inviteBatchUsers(org.id, invitedUsers, selectedInviteCode)
+ let res = await inviteBatchUsers(org.id, invitedUsers, selectedInviteCode,access_token)
if (res.status == 200) {
mutate(`${getAPIUrl()}orgs/${org?.id}/invites/users`)
setIsLoading(false)
@@ -31,18 +34,17 @@ function OrgUsersAdd() {
const { data: invites } = useSWR(
org ? `${getAPIUrl()}orgs/${org?.id}/invites` : null,
- swrFetcher
+ (url) => swrFetcher(url, access_token)
)
const { data: invited_users } = useSWR(
org ? `${getAPIUrl()}orgs/${org?.id}/invites/users` : null,
- swrFetcher
+ (url) => swrFetcher(url, access_token)
)
useEffect(() => {
if (invites) {
setSelectedInviteCode(invites?.[0]?.invite_code_uuid)
}
- console.log('dev,',selectedInviteCode)
}
, [invites, invited_users])
diff --git a/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx b/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx
index 057cb986..a0a00582 100644
--- a/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx
+++ b/apps/web/components/Objects/Activities/AI/AIActivityAsk.tsx
@@ -75,6 +75,7 @@ type ActivityChatMessageBoxProps = {
function ActivityChatMessageBox(props: ActivityChatMessageBoxProps) {
const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const aiChatBotState = useAIChatBot() as AIChatBotStateTypes
const dispatchAIChatBot = useAIChatBotDispatch() as any
@@ -115,7 +116,8 @@ function ActivityChatMessageBox(props: ActivityChatMessageBoxProps) {
const response = await sendActivityAIChatMessage(
message,
aiChatBotState.aichat_uuid,
- props.activity.activity_uuid
+ props.activity.activity_uuid,
+ access_token
)
if (response.success == false) {
await dispatchAIChatBot({ type: 'setIsNoLongerWaitingForResponse' })
@@ -143,8 +145,9 @@ function ActivityChatMessageBox(props: ActivityChatMessageBoxProps) {
})
await dispatchAIChatBot({ type: 'setIsWaitingForResponse' })
const response = await startActivityAIChatSession(
- message,
+ message,access_token,
props.activity.activity_uuid
+
)
if (response.success == false) {
await dispatchAIChatBot({ type: 'setIsNoLongerWaitingForResponse' })
@@ -219,14 +222,12 @@ function ActivityChatMessageBox(props: ActivityChatMessageBoxProps) {
/>
{aiChatBotState.messages.length > 0 &&
- !aiChatBotState.error.isError ? (
+ !aiChatBotState.error.isError ? (
{aiChatBotState.messages.map(
(message: AIMessage, index: number) => {
diff --git a/apps/web/components/Objects/Activities/DocumentPdf/DocumentPdf.tsx b/apps/web/components/Objects/Activities/DocumentPdf/DocumentPdf.tsx
index 2dc84193..0e753369 100644
--- a/apps/web/components/Objects/Activities/DocumentPdf/DocumentPdf.tsx
+++ b/apps/web/components/Objects/Activities/DocumentPdf/DocumentPdf.tsx
@@ -12,7 +12,6 @@ function DocumentPdfActivity({
const org = useOrg() as any
React.useEffect(() => {
- console.log(activity)
}, [activity, org])
return (
diff --git a/apps/web/components/Objects/Activities/DynamicCanva/AI/AICanvaToolkit.tsx b/apps/web/components/Objects/Activities/DynamicCanva/AI/AICanvaToolkit.tsx
index 040041a5..7792e1ee 100644
--- a/apps/web/components/Objects/Activities/DynamicCanva/AI/AICanvaToolkit.tsx
+++ b/apps/web/components/Objects/Activities/DynamicCanva/AI/AICanvaToolkit.tsx
@@ -15,6 +15,7 @@ import {
startActivityAIChatSession,
} from '@services/ai/ai'
import useGetAIFeatures from '../../../../AI/Hooks/useGetAIFeatures'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
type AICanvaToolkitProps = {
editor: Editor
@@ -92,6 +93,8 @@ function AIActionButton(props: {
label: string
activity: any
}) {
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const dispatchAIChatBot = useAIChatBotDispatch() as any
const aiChatBotState = useAIChatBot() as AIChatBotStateTypes
@@ -132,7 +135,7 @@ function AIActionButton(props: {
const response = await sendActivityAIChatMessage(
message,
aiChatBotState.aichat_uuid,
- props.activity.activity_uuid
+ props.activity.activity_uuid, access_token
)
if (response.success == false) {
await dispatchAIChatBot({ type: 'setIsNoLongerWaitingForResponse' })
@@ -160,8 +163,7 @@ function AIActionButton(props: {
})
await dispatchAIChatBot({ type: 'setIsWaitingForResponse' })
const response = await startActivityAIChatSession(
- message,
- props.activity.activity_uuid
+ message, access_token
)
if (response.success == false) {
await dispatchAIChatBot({ type: 'setIsNoLongerWaitingForResponse' })
@@ -193,10 +195,10 @@ function AIActionButton(props: {
props.label === 'Explain'
? 'Explain a word or a sentence with AI'
: props.label === 'Summarize'
- ? 'Summarize a long paragraph or text with AI'
- : props.label === 'Translate'
- ? 'Translate to different languages with AI'
- : 'Give examples to understand better with AI'
+ ? 'Summarize a long paragraph or text with AI'
+ : props.label === 'Translate'
+ ? 'Translate to different languages with AI'
+ : 'Give examples to understand better with AI'
return (
diff --git a/apps/web/components/Objects/Activities/Video/Video.tsx b/apps/web/components/Objects/Activities/Video/Video.tsx
index f2d205d8..e523f43b 100644
--- a/apps/web/components/Objects/Activities/Video/Video.tsx
+++ b/apps/web/components/Objects/Activities/Video/Video.tsx
@@ -7,22 +7,6 @@ function VideoActivity({ activity, course }: { activity: any; course: any }) {
const org = useOrg() as any
const [videoId, setVideoId] = React.useState('')
- function getYouTubeEmbed(url: any) {
- // Extract video ID from the YouTube URL
- var videoId = url.match(
- /(?:\?v=|\/embed\/|\/\d\/|\/vi\/|\/v\/|https?:\/\/(?:www\.)?youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([^#\&\?\/]+)/
- )[1]
-
- // Create the embed object
- var embedObject = {
- videoId: videoId,
- width: 560,
- height: 315,
- }
-
- return embedObject
- }
-
React.useEffect(() => {
if (activity && activity.content && activity.content.uri) {
var getYouTubeID = require('get-youtube-id');
diff --git a/apps/web/components/Objects/CourseUpdates/CourseUpdates.tsx b/apps/web/components/Objects/CourseUpdates/CourseUpdates.tsx
index 33e96b5b..62085e29 100644
--- a/apps/web/components/Objects/CourseUpdates/CourseUpdates.tsx
+++ b/apps/web/components/Objects/CourseUpdates/CourseUpdates.tsx
@@ -38,7 +38,6 @@ function CourseUpdates() {
// if user clicks outside the model, close the model
React.useLayoutEffect(() => {
function handleClickOutside(event: any) {
- console.log(event.target.id)
if (event.target.closest('.bg-white') || event.target.id === 'delete-update-button') return;
setIsModelOpen(false);
}
diff --git a/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx b/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx
index 1807c4ab..fd287fe0 100644
--- a/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx
+++ b/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx
@@ -24,6 +24,7 @@ import {
startActivityAIChatSession,
} from '@services/ai/ai'
import useGetAIFeatures from '@components/AI/Hooks/useGetAIFeatures'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
type AIEditorToolkitProps = {
editor: Editor
@@ -32,11 +33,11 @@ type AIEditorToolkitProps = {
type AIPromptsLabels = {
label:
- | 'Writer'
- | 'ContinueWriting'
- | 'MakeLonger'
- | 'GenerateQuiz'
- | 'Translate'
+ | 'Writer'
+ | 'ContinueWriting'
+ | 'MakeLonger'
+ | 'GenerateQuiz'
+ | 'Translate'
selection: string
}
@@ -141,6 +142,8 @@ function AIEditorToolkit(props: AIEditorToolkitProps) {
const UserFeedbackModal = (props: AIEditorToolkitProps) => {
const dispatchAIEditor = useAIEditorDispatch() as any
const aiEditorState = useAIEditor() as AIEditorStateTypes
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const handleChange = async (event: React.ChangeEvent) => {
await dispatchAIEditor({
@@ -159,7 +162,7 @@ const UserFeedbackModal = (props: AIEditorToolkitProps) => {
const response = await sendActivityAIChatMessage(
message,
aiEditorState.aichat_uuid,
- props.activity.activity_uuid
+ props.activity.activity_uuid, access_token
)
if (response.success === false) {
await dispatchAIEditor({ type: 'setIsNoLongerWaitingForResponse' })
@@ -191,7 +194,7 @@ const UserFeedbackModal = (props: AIEditorToolkitProps) => {
})
await dispatchAIEditor({ type: 'setIsWaitingForResponse' })
const response = await startActivityAIChatSession(
- message,
+ message, access_token,
props.activity.activity_uuid
)
if (response.success === false) {
diff --git a/apps/web/components/Objects/Editor/Editor.tsx b/apps/web/components/Objects/Editor/Editor.tsx
index 1a31c0e4..d66d92d5 100644
--- a/apps/web/components/Objects/Editor/Editor.tsx
+++ b/apps/web/components/Objects/Editor/Editor.tsx
@@ -44,8 +44,6 @@ import { CourseProvider } from '@components/Contexts/CourseContext'
import { useLHSession } from '@components/Contexts/LHSessionContext'
import AIEditorToolkit from './AI/AIEditorToolkit'
import useGetAIFeatures from '@components/AI/Hooks/useGetAIFeatures'
-import UserAvatar from '../UserAvatar'
-import randomColor from 'randomcolor'
import Collaboration from '@tiptap/extension-collaboration'
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
import ActiveAvatars from './ActiveAvatars'
diff --git a/apps/web/components/Objects/Editor/EditorWrapper.tsx b/apps/web/components/Objects/Editor/EditorWrapper.tsx
index 2e3a8f59..d6502d58 100644
--- a/apps/web/components/Objects/Editor/EditorWrapper.tsx
+++ b/apps/web/components/Objects/Editor/EditorWrapper.tsx
@@ -25,6 +25,7 @@ interface EditorWrapperProps {
function EditorWrapper(props: EditorWrapperProps): JSX.Element {
const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
// Define provider in the state
const [provider, setProvider] = React.useState(null);
const [thisPageColor, setThisPageColor] = useState(randomColor({ luminosity: 'light' }) as string)
@@ -79,7 +80,7 @@ function EditorWrapper(props: EditorWrapperProps): JSX.Element {
}
});
- toast.promise(updateActivity(activity, activity.activity_uuid), {
+ toast.promise(updateActivity(activity, activity.activity_uuid,access_token), {
loading: 'Saving...',
success: Activity saved!,
error: Could not save.,
diff --git a/apps/web/components/Objects/Editor/Extensions/Image/ImageBlockComponent.tsx b/apps/web/components/Objects/Editor/Extensions/Image/ImageBlockComponent.tsx
index 426dcfdb..1f1beca7 100644
--- a/apps/web/components/Objects/Editor/Extensions/Image/ImageBlockComponent.tsx
+++ b/apps/web/components/Objects/Editor/Extensions/Image/ImageBlockComponent.tsx
@@ -9,11 +9,14 @@ import { getActivityBlockMediaDirectory } from '@services/media/media'
import { useOrg } from '@components/Contexts/OrgContext'
import { useCourse } from '@components/Contexts/CourseContext'
import { useEditorProvider } from '@components/Contexts/Editor/EditorContext'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
function ImageBlockComponent(props: any) {
const org = useOrg() as any
const course = useCourse() as any
const editorState = useEditorProvider() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const isEditable = editorState.isEditable
const [image, setImage] = React.useState(null)
@@ -36,7 +39,7 @@ function ImageBlockComponent(props: any) {
setIsLoading(true)
let object = await uploadNewImageFile(
image,
- props.extension.options.activity.activity_uuid
+ props.extension.options.activity.activity_uuid,access_token
)
setIsLoading(false)
setblockObject(object)
diff --git a/apps/web/components/Objects/Editor/Extensions/PDF/PDFBlockComponent.tsx b/apps/web/components/Objects/Editor/Extensions/PDF/PDFBlockComponent.tsx
index c0e11903..c6c61fbe 100644
--- a/apps/web/components/Objects/Editor/Extensions/PDF/PDFBlockComponent.tsx
+++ b/apps/web/components/Objects/Editor/Extensions/PDF/PDFBlockComponent.tsx
@@ -8,10 +8,13 @@ import { getActivityBlockMediaDirectory } from '@services/media/media'
import { useOrg } from '@components/Contexts/OrgContext'
import { useCourse } from '@components/Contexts/CourseContext'
import { useEditorProvider } from '@components/Contexts/Editor/EditorContext'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
function PDFBlockComponent(props: any) {
const org = useOrg() as any
const course = useCourse() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const [pdf, setPDF] = React.useState(null)
const [isLoading, setIsLoading] = React.useState(false)
const [blockObject, setblockObject] = React.useState(
@@ -32,7 +35,7 @@ function PDFBlockComponent(props: any) {
setIsLoading(true)
let object = await uploadNewPDFFile(
pdf,
- props.extension.options.activity.activity_uuid
+ props.extension.options.activity.activity_uuid, access_token
)
setIsLoading(false)
setblockObject(object)
@@ -41,7 +44,7 @@ function PDFBlockComponent(props: any) {
})
}
- useEffect(() => {}, [course, org])
+ useEffect(() => { }, [course, org])
return (
diff --git a/apps/web/components/Objects/Editor/Extensions/Quiz/QuizBlockComponent.tsx b/apps/web/components/Objects/Editor/Extensions/Quiz/QuizBlockComponent.tsx
index 26d0dfa4..a33aab0e 100644
--- a/apps/web/components/Objects/Editor/Extensions/Quiz/QuizBlockComponent.tsx
+++ b/apps/web/components/Objects/Editor/Extensions/Quiz/QuizBlockComponent.tsx
@@ -86,10 +86,8 @@ function QuizBlockComponent(props: any) {
if (allCorrect) {
setSubmissionMessage('All answers are correct!')
- console.log('All answers are correct!')
} else {
setSubmissionMessage('Some answers are incorrect!')
- console.log('Some answers are incorrect!')
}
}
diff --git a/apps/web/components/Objects/Editor/Extensions/Video/VideoBlockComponent.tsx b/apps/web/components/Objects/Editor/Extensions/Video/VideoBlockComponent.tsx
index 42063263..f90923bd 100644
--- a/apps/web/components/Objects/Editor/Extensions/Video/VideoBlockComponent.tsx
+++ b/apps/web/components/Objects/Editor/Extensions/Video/VideoBlockComponent.tsx
@@ -8,6 +8,7 @@ import { UploadIcon } from '@radix-ui/react-icons'
import { useOrg } from '@components/Contexts/OrgContext'
import { useCourse } from '@components/Contexts/CourseContext'
import { useEditorProvider } from '@components/Contexts/Editor/EditorContext'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
function VideoBlockComponents(props: any) {
const org = useOrg() as any
@@ -15,6 +16,8 @@ function VideoBlockComponents(props: any) {
const editorState = useEditorProvider() as any
const isEditable = editorState.isEditable
const [video, setVideo] = React.useState(null)
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const [isLoading, setIsLoading] = React.useState(false)
const [blockObject, setblockObject] = React.useState(
props.node.attrs.blockObject
@@ -32,7 +35,7 @@ function VideoBlockComponents(props: any) {
setIsLoading(true)
let object = await uploadNewVideoFile(
video,
- props.extension.options.activity.activity_uuid
+ props.extension.options.activity.activity_uuid, access_token
)
setIsLoading(false)
setblockObject(object)
@@ -41,7 +44,7 @@ function VideoBlockComponents(props: any) {
})
}
- useEffect(() => {}, [course, org])
+ useEffect(() => { }, [course, org])
return (
@@ -98,7 +101,7 @@ function VideoBlockComponents(props: any) {
)
}
const BlockVideoWrapper = styled.div`
- //border: ${(props) =>
+ border: ${(props) =>
props.contentEditable ? '2px dashed #713f1117' : 'none'};
// center
diff --git a/apps/web/components/Objects/Menu/Menu.tsx b/apps/web/components/Objects/Menu/Menu.tsx
index 8bf3df13..1b77a619 100644
--- a/apps/web/components/Objects/Menu/Menu.tsx
+++ b/apps/web/components/Objects/Menu/Menu.tsx
@@ -1,12 +1,10 @@
'use client'
import React from 'react'
import Link from 'next/link'
-import { getAPIUrl, getUriWithOrg } from '@services/config/config'
+import { getUriWithOrg } from '@services/config/config'
import { HeaderProfileBox } from '@components/Security/HeaderProfileBox'
import MenuLinks from './MenuLinks'
import { getOrgLogoMediaDirectory } from '@services/media/media'
-import useSWR from 'swr'
-import { swrFetcher } from '@services/utils/ts/requests'
import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useOrg } from '@components/Contexts/OrgContext'
diff --git a/apps/web/components/Objects/Modals/Course/Create/CreateCourse.tsx b/apps/web/components/Objects/Modals/Course/Create/CreateCourse.tsx
index 2c68a242..51bfe5f5 100644
--- a/apps/web/components/Objects/Modals/Course/Create/CreateCourse.tsx
+++ b/apps/web/components/Objects/Modals/Course/Create/CreateCourse.tsx
@@ -19,7 +19,7 @@ import { useLHSession } from '@components/Contexts/LHSessionContext'
function CreateCourseModal({ closeModal, orgslug }: any) {
const [isSubmitting, setIsSubmitting] = useState(false)
- const session = useLHSession()
+ const session = useLHSession() as any;
const [name, setName] = React.useState('')
const [description, setDescription] = React.useState('')
const [learnings, setLearnings] = React.useState('')
@@ -55,7 +55,6 @@ function CreateCourseModal({ closeModal, orgslug }: any) {
const handleVisibilityChange = (event: React.ChangeEvent) => {
setVisibility(event.target.value)
- console.log(visibility)
}
const handleTagsChange = (event: React.ChangeEvent) => {
diff --git a/apps/web/components/Objects/Modals/Dash/EditCourseAccess/LinkToUserGroup.tsx b/apps/web/components/Objects/Modals/Dash/EditCourseAccess/LinkToUserGroup.tsx
index 56976fba..6cefeeda 100644
--- a/apps/web/components/Objects/Modals/Dash/EditCourseAccess/LinkToUserGroup.tsx
+++ b/apps/web/components/Objects/Modals/Dash/EditCourseAccess/LinkToUserGroup.tsx
@@ -1,10 +1,11 @@
'use client';
import { useCourse } from '@components/Contexts/CourseContext';
+import { useLHSession } from '@components/Contexts/LHSessionContext';
import { useOrg } from '@components/Contexts/OrgContext';
import { getAPIUrl } from '@services/config/config';
import { linkResourcesToUserGroup } from '@services/usergroups/usergroups';
import { swrFetcher } from '@services/utils/ts/requests';
-import { AlertTriangle, Info } from 'lucide-react';
+import { Info } from 'lucide-react';
import React, { useEffect } from 'react'
import toast from 'react-hot-toast';
import useSWR, { mutate } from 'swr'
@@ -17,6 +18,8 @@ type LinkToUserGroupProps = {
function LinkToUserGroup(props: LinkToUserGroupProps) {
const course = useCourse() as any
const org = useOrg() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const courseStructure = course.courseStructure
const { data: usergroups } = useSWR(
@@ -27,8 +30,7 @@ function LinkToUserGroup(props: LinkToUserGroupProps) {
const handleLink = async () => {
- console.log('selectedUserGroup', selectedUserGroup)
- const res = await linkResourcesToUserGroup(selectedUserGroup, courseStructure.course_uuid)
+ const res = await linkResourcesToUserGroup(selectedUserGroup, courseStructure.course_uuid, access_token)
if (res.status === 200) {
props.setUserGroupModal(false)
toast.success('Successfully linked to usergroup')
@@ -37,7 +39,6 @@ function LinkToUserGroup(props: LinkToUserGroupProps) {
else {
toast.error('Error ' + res.status + ': ' + res.data.detail)
}
-
}
useEffect(() => {
@@ -54,25 +55,25 @@ function LinkToUserGroup(props: LinkToUserGroupProps) {
Users that are not part of the UserGroup will no longer have access to this course
-
-
- UserGroup Name
-
-
-
-
+
+ UserGroup Name
+
+
+
+
+
-
-
+
)
}
diff --git a/apps/web/components/Objects/Modals/Dash/OrgAccess/OrgInviteCodeGenerate.tsx b/apps/web/components/Objects/Modals/Dash/OrgAccess/OrgInviteCodeGenerate.tsx
index 5197de72..06834009 100644
--- a/apps/web/components/Objects/Modals/Dash/OrgAccess/OrgInviteCodeGenerate.tsx
+++ b/apps/web/components/Objects/Modals/Dash/OrgAccess/OrgInviteCodeGenerate.tsx
@@ -2,7 +2,7 @@ import { useOrg } from '@components/Contexts/OrgContext'
import { getAPIUrl } from '@services/config/config'
import { createInviteCode, createInviteCodeWithUserGroup } from '@services/organizations/invites'
import { swrFetcher } from '@services/utils/ts/requests'
-import { Shield, Ticket } from 'lucide-react'
+import { Ticket } from 'lucide-react'
import { useLHSession } from '@components/Contexts/LHSessionContext'
import React, { useEffect } from 'react'
import toast from 'react-hot-toast'
@@ -14,7 +14,8 @@ type OrgInviteCodeGenerateProps = {
function OrgInviteCodeGenerate(props: OrgInviteCodeGenerateProps) {
const org = useOrg() as any
- const session = useLHSession()
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const [usergroup_id, setUsergroup_id] = React.useState(0);
const { data: usergroups } = useSWR(
org ? `${getAPIUrl()}usergroups/org/${org.id}` : null,
diff --git a/apps/web/components/Objects/Modals/Dash/OrgUserGroups/AddUserGroup.tsx b/apps/web/components/Objects/Modals/Dash/OrgUserGroups/AddUserGroup.tsx
index e7e4f28b..df4677bd 100644
--- a/apps/web/components/Objects/Modals/Dash/OrgUserGroups/AddUserGroup.tsx
+++ b/apps/web/components/Objects/Modals/Dash/OrgUserGroups/AddUserGroup.tsx
@@ -14,13 +14,16 @@ import { BarLoader } from 'react-spinners'
import { createUserGroup } from '@services/usergroups/usergroups'
import { mutate } from 'swr'
import { getAPIUrl } from '@services/config/config'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
type AddUserGroupProps = {
setCreateUserGroupModal: any
}
function AddUserGroup(props: AddUserGroupProps) {
- const org = useOrg() as any
+ const org = useOrg() as any;
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const [userGroupName, setUserGroupName] = React.useState('')
const [userGroupDescription, setUserGroupDescription] = React.useState('')
const [isSubmitting, setIsSubmitting] = React.useState(false)
@@ -42,7 +45,7 @@ function AddUserGroup(props: AddUserGroupProps) {
description: userGroupDescription,
org_id: org.id
}
- const res = await createUserGroup(obj)
+ const res = await createUserGroup(obj, access_token)
if (res.status == 200) {
setIsSubmitting(false)
mutate(`${getAPIUrl()}usergroups/org/${org.id}`)
diff --git a/apps/web/components/Objects/Modals/Dash/OrgUserGroups/ManageUsers.tsx b/apps/web/components/Objects/Modals/Dash/OrgUserGroups/ManageUsers.tsx
index ce7d35e2..71eb8390 100644
--- a/apps/web/components/Objects/Modals/Dash/OrgUserGroups/ManageUsers.tsx
+++ b/apps/web/components/Objects/Modals/Dash/OrgUserGroups/ManageUsers.tsx
@@ -1,3 +1,4 @@
+import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useOrg } from '@components/Contexts/OrgContext'
import { getAPIUrl } from '@services/config/config'
import { linkUserToUserGroup, unLinkUserToUserGroup } from '@services/usergroups/usergroups'
@@ -14,6 +15,8 @@ type ManageUsersProps = {
function ManageUsers(props: ManageUsersProps) {
const org = useOrg() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const { data: OrgUsers } = useSWR(
org ? `${getAPIUrl()}orgs/${org.id}/users` : null,
swrFetcher
@@ -31,7 +34,7 @@ function ManageUsers(props: ManageUsersProps) {
}
const handleLinkUser = async (user_id: any) => {
- const res = await linkUserToUserGroup(props.usergroup_id, user_id)
+ const res = await linkUserToUserGroup(props.usergroup_id, user_id,access_token)
if (res.status === 200) {
toast.success('User linked successfully')
mutate(`${getAPIUrl()}usergroups/${props.usergroup_id}/users`)
@@ -41,7 +44,7 @@ function ManageUsers(props: ManageUsersProps) {
}
const handleUnlinkUser = async (user_id: any) => {
- const res = await unLinkUserToUserGroup(props.usergroup_id, user_id)
+ const res = await unLinkUserToUserGroup(props.usergroup_id, user_id,access_token)
if (res.status === 200) {
toast.success('User unlinked successfully')
mutate(`${getAPIUrl()}usergroups/${props.usergroup_id}/users`)
diff --git a/apps/web/components/Objects/Modals/Dash/OrgUsers/RolesUpdate.tsx b/apps/web/components/Objects/Modals/Dash/OrgUsers/RolesUpdate.tsx
index 3ee7e6ef..1712ab19 100644
--- a/apps/web/components/Objects/Modals/Dash/OrgUsers/RolesUpdate.tsx
+++ b/apps/web/components/Objects/Modals/Dash/OrgUsers/RolesUpdate.tsx
@@ -1,4 +1,5 @@
'use client'
+import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useOrg } from '@components/Contexts/OrgContext'
import FormLayout, {
ButtonBlack,
@@ -22,6 +23,8 @@ interface Props {
function RolesUpdate(props: Props) {
const org = useOrg() as any
+ const session = useLHSession() as any
+ const access_token = session.data.tokens.access_token;
const [isSubmitting, setIsSubmitting] = React.useState(false)
const [assignedRole, setAssignedRole] = React.useState(
props.alreadyAssignedRole
@@ -36,7 +39,7 @@ function RolesUpdate(props: Props) {
const handleSubmit = async (e: any) => {
e.preventDefault()
setIsSubmitting(true)
- const res = await updateUserRole(org.id, props.user.user.id, assignedRole)
+ const res = await updateUserRole(org.id, props.user.user.id, assignedRole,access_token)
if (res.status === 200) {
await mutate(`${getAPIUrl()}orgs/${org.id}/users`)
diff --git a/apps/web/components/Objects/Thumbnails/CollectionThumbnail.tsx b/apps/web/components/Objects/Thumbnails/CollectionThumbnail.tsx
index 73ff2554..df27f05a 100644
--- a/apps/web/components/Objects/Thumbnails/CollectionThumbnail.tsx
+++ b/apps/web/components/Objects/Thumbnails/CollectionThumbnail.tsx
@@ -34,7 +34,7 @@ function CollectionThumbnail(props: PropsType) {
href={getUriWithOrg(
props.orgslug,
'/collection/' +
- removeCollectionPrefix(props.collection.collection_uuid)
+ removeCollectionPrefix(props.collection.collection_uuid)
)}
>
@@ -75,7 +75,7 @@ function CollectionThumbnail(props: PropsType) {
const CollectionAdminEditsArea = (props: any) => {
const router = useRouter()
- const session = useLHSession() ;
+ const session = useLHSession() as any;
const deleteCollectionUI = async (collectionId: number) => {
await deleteCollection(collectionId, session.data?.tokens?.access_token)
diff --git a/apps/web/components/Objects/Thumbnails/CourseThumbnail.tsx b/apps/web/components/Objects/Thumbnails/CourseThumbnail.tsx
index c9373eb5..174b63ae 100644
--- a/apps/web/components/Objects/Thumbnails/CourseThumbnail.tsx
+++ b/apps/web/components/Objects/Thumbnails/CourseThumbnail.tsx
@@ -25,7 +25,7 @@ function removeCoursePrefix(course_uuid: string) {
function CourseThumbnail(props: PropsType) {
const router = useRouter()
const org = useOrg() as any
- const session = useLHSession();
+ const session = useLHSession() as any;
async function deleteCourses(course_uuid: any) {
await deleteCourseFromBackend(course_uuid, session.data?.tokens?.access_token)
diff --git a/apps/web/components/Security/AdminAuthorization.tsx b/apps/web/components/Security/AdminAuthorization.tsx
index 05a7737e..7840317f 100644
--- a/apps/web/components/Security/AdminAuthorization.tsx
+++ b/apps/web/components/Security/AdminAuthorization.tsx
@@ -1,9 +1,9 @@
'use client';
import React, { useEffect, useState, useCallback, useMemo } from 'react';
-import { useOrg } from '@components/Contexts/OrgContext';
import { useLHSession } from '@components/Contexts/LHSessionContext';
import useAdminStatus from '@components/Hooks/useAdminStatus';
import { usePathname, useRouter } from 'next/navigation';
+import PageLoading from '@components/Objects/Loaders/PageLoading';
type AuthorizationProps = {
children: React.ReactNode;
@@ -30,10 +30,19 @@ const AdminAuthorization: React.FC = ({ children, authorizat
const isUserAuthenticated = useMemo(() => session.status === 'authenticated', [session.status]);
const checkPathname = useCallback((pattern: string, pathname: string) => {
- const regexPattern = new RegExp(`^${pattern.replace(/\//g, '\\/').replace(/\*/g, '.*')}$`);
+ // Ensure the inputs are strings
+ if (typeof pattern !== 'string' || typeof pathname !== 'string') {
+ return false;
+ }
+
+ // Convert pattern to a regex pattern
+ const regexPattern = new RegExp(`^${pattern.replace(/[\/.*+?^${}()|[\]\\]/g, '\\$&').replace(/\\\*/g, '.*')}$`);
+
+ // Test the pathname against the regex pattern
return regexPattern.test(pathname);
}, []);
+
const isAdminPath = useMemo(() => ADMIN_PATHS.some(path => checkPathname(path, pathname)), [pathname, checkPathname]);
const authorizeUser = useCallback(() => {
@@ -69,7 +78,7 @@ const AdminAuthorization: React.FC = ({ children, authorizat
if (loading) {
return (
);
}
diff --git a/apps/web/components/Security/HeaderProfileBox.tsx b/apps/web/components/Security/HeaderProfileBox.tsx
index f6427c0f..0bd3ca53 100644
--- a/apps/web/components/Security/HeaderProfileBox.tsx
+++ b/apps/web/components/Security/HeaderProfileBox.tsx
@@ -11,9 +11,7 @@ export const HeaderProfileBox = () => {
const session = useLHSession() as any
const isUserAdmin = useAdminStatus() as any
- useEffect(() => {
- console.log(session)
- }
+ useEffect(() => {}
, [session])
return (
diff --git a/apps/web/services/ai/ai.ts b/apps/web/services/ai/ai.ts
index 4d1542ce..e9707f6e 100644
--- a/apps/web/services/ai/ai.ts
+++ b/apps/web/services/ai/ai.ts
@@ -1,9 +1,10 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody } from '@services/utils/ts/requests'
+import { RequestBodyWithAuthHeader } from '@services/utils/ts/requests'
export async function startActivityAIChatSession(
message: string,
- activity_uuid: string
+ access_token: string,
+ activity_uuid?: string
) {
const data = {
message,
@@ -11,7 +12,7 @@ export async function startActivityAIChatSession(
}
const result = await fetch(
`${getAPIUrl()}ai/start/activity_chat_session`,
- RequestBody('POST', data, null)
+ RequestBodyWithAuthHeader('POST', data, null, access_token)
)
const json = await result.json()
if (result.status === 200) {
@@ -34,7 +35,8 @@ export async function startActivityAIChatSession(
export async function sendActivityAIChatMessage(
message: string,
aichat_uuid: string,
- activity_uuid: string
+ activity_uuid: string,
+ access_token: string
) {
const data = {
aichat_uuid,
@@ -43,7 +45,7 @@ export async function sendActivityAIChatMessage(
}
const result = await fetch(
`${getAPIUrl()}ai/send/activity_chat_message`,
- RequestBody('POST', data, null)
+ RequestBodyWithAuthHeader('POST', data, null, access_token)
)
const json = await result.json()
diff --git a/apps/web/services/blocks/Image/images.ts b/apps/web/services/blocks/Image/images.ts
index 6a578adf..454d87fa 100644
--- a/apps/web/services/blocks/Image/images.ts
+++ b/apps/web/services/blocks/Image/images.ts
@@ -1,7 +1,16 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody, RequestBodyForm } from '@services/utils/ts/requests'
+import {
+ RequestBody,
+ RequestBodyForm,
+ RequestBodyFormWithAuthHeader,
+ RequestBodyWithAuthHeader,
+} from '@services/utils/ts/requests'
-export async function uploadNewImageFile(file: any, activity_uuid: string) {
+export async function uploadNewImageFile(
+ file: any,
+ activity_uuid: string,
+ access_token: string
+) {
// Send file thumbnail as form data
const formData = new FormData()
formData.append('file_object', file)
@@ -9,17 +18,17 @@ export async function uploadNewImageFile(file: any, activity_uuid: string) {
return fetch(
`${getAPIUrl()}blocks/image`,
- RequestBodyForm('POST', formData, null)
+ RequestBodyFormWithAuthHeader('POST', formData, null, access_token)
)
.then((result) => result.json())
.catch((error) => console.log('error', error))
}
-export async function getImageFile(file_id: string) {
+export async function getImageFile(file_id: string, access_token: string) {
// todo : add course id to url
return fetch(
`${getAPIUrl()}blocks/image?file_id=${file_id}`,
- RequestBody('GET', null, null)
+ RequestBodyWithAuthHeader('GET', null, null, access_token)
)
.then((result) => result.json())
.catch((error) => console.log('error', error))
diff --git a/apps/web/services/blocks/Pdf/pdf.ts b/apps/web/services/blocks/Pdf/pdf.ts
index 06b053c7..99c1e3f0 100644
--- a/apps/web/services/blocks/Pdf/pdf.ts
+++ b/apps/web/services/blocks/Pdf/pdf.ts
@@ -1,7 +1,16 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody, RequestBodyForm } from '@services/utils/ts/requests'
+import {
+ RequestBody,
+ RequestBodyForm,
+ RequestBodyFormWithAuthHeader,
+ RequestBodyWithAuthHeader,
+} from '@services/utils/ts/requests'
-export async function uploadNewPDFFile(file: any, activity_uuid: string) {
+export async function uploadNewPDFFile(
+ file: any,
+ activity_uuid: string,
+ access_token: string
+) {
// Send file thumbnail as form data
const formData = new FormData()
formData.append('file_object', file)
@@ -9,17 +18,17 @@ export async function uploadNewPDFFile(file: any, activity_uuid: string) {
return fetch(
`${getAPIUrl()}blocks/pdf`,
- RequestBodyForm('POST', formData, null)
+ RequestBodyFormWithAuthHeader('POST', formData, null, access_token)
)
.then((result) => result.json())
.catch((error) => console.log('error', error))
}
-export async function getPDFFile(file_id: string) {
+export async function getPDFFile(file_id: string, access_token: string) {
// todo : add course id to url
return fetch(
`${getAPIUrl()}blocks/pdf?file_id=${file_id}`,
- RequestBody('GET', null, null)
+ RequestBodyWithAuthHeader('GET', null, null, access_token)
)
.then((result) => result.json())
.catch((error) => console.log('error', error))
diff --git a/apps/web/services/blocks/Quiz/quiz.ts b/apps/web/services/blocks/Quiz/quiz.ts
index 0928ffd5..5d4eb093 100644
--- a/apps/web/services/blocks/Quiz/quiz.ts
+++ b/apps/web/services/blocks/Quiz/quiz.ts
@@ -1,10 +1,10 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody } from '@services/utils/ts/requests'
+import { RequestBody, RequestBodyWithAuthHeader } from '@services/utils/ts/requests'
-export async function submitQuizBlock(activity_id: string, data: any) {
+export async function submitQuizBlock(activity_id: string, data: any,access_token:string) {
const result: any = await fetch(
`${getAPIUrl()}blocks/quiz/${activity_id}"`,
- RequestBody('POST', data, null)
+ RequestBodyWithAuthHeader('POST', data, null,access_token)
)
.then((result) => result.json())
.catch((error) => console.log('error', error))
diff --git a/apps/web/services/blocks/Video/video.ts b/apps/web/services/blocks/Video/video.ts
index fff4a502..ff8e9bd6 100644
--- a/apps/web/services/blocks/Video/video.ts
+++ b/apps/web/services/blocks/Video/video.ts
@@ -1,7 +1,16 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody, RequestBodyForm } from '@services/utils/ts/requests'
+import {
+ RequestBody,
+ RequestBodyForm,
+ RequestBodyFormWithAuthHeader,
+ RequestBodyWithAuthHeader,
+} from '@services/utils/ts/requests'
-export async function uploadNewVideoFile(file: any, activity_uuid: string) {
+export async function uploadNewVideoFile(
+ file: any,
+ activity_uuid: string,
+ access_token: string
+) {
// Send file thumbnail as form data
const formData = new FormData()
formData.append('file_object', file)
@@ -9,17 +18,17 @@ export async function uploadNewVideoFile(file: any, activity_uuid: string) {
return fetch(
`${getAPIUrl()}blocks/video`,
- RequestBodyForm('POST', formData, null)
+ RequestBodyFormWithAuthHeader('POST', formData, null, access_token)
)
.then((result) => result.json())
- .catch((error) => console.log('error', error))
+ .catch((error) => console.error('error', error))
}
-export async function getVideoFile(file_id: string) {
+export async function getVideoFile(file_id: string, access_token: string) {
return fetch(
`${getAPIUrl()}blocks/video?file_id=${file_id}`,
- RequestBody('GET', null, null)
+ RequestBodyWithAuthHeader('GET', null, null, access_token)
)
.then((result) => result.json())
- .catch((error) => console.log('error', error))
+ .catch((error) => console.error('error', error))
}
diff --git a/apps/web/services/courses/activity.ts b/apps/web/services/courses/activity.ts
index b571741d..35240cf5 100644
--- a/apps/web/services/courses/activity.ts
+++ b/apps/web/services/courses/activity.ts
@@ -1,4 +1,4 @@
-import { RequestBody, RequestBodyWithAuthHeader, errorHandling } from '@services/utils/ts/requests'
+import { RequestBodyWithAuthHeader, errorHandling } from '@services/utils/ts/requests'
import { getAPIUrl } from '@services/config/config'
/*
diff --git a/apps/web/services/courses/collections.ts b/apps/web/services/courses/collections.ts
index 5439f61a..93051fbf 100644
--- a/apps/web/services/courses/collections.ts
+++ b/apps/web/services/courses/collections.ts
@@ -23,7 +23,6 @@ export async function deleteCollection(
// Create a new collection
export async function createCollection(collection: any, access_token: any) {
- console.log(collection)
const result: any = await fetch(
`${getAPIUrl()}collections/`,
RequestBodyWithAuthHeader('POST', collection, null, access_token)
diff --git a/apps/web/services/courses/courses.ts b/apps/web/services/courses/courses.ts
index 40dbeaf8..7c9313ed 100644
--- a/apps/web/services/courses/courses.ts
+++ b/apps/web/services/courses/courses.ts
@@ -1,7 +1,5 @@
import { getAPIUrl } from '@services/config/config'
import {
- RequestBody,
- RequestBodyForm,
RequestBodyFormWithAuthHeader,
RequestBodyWithAuthHeader,
errorHandling,
diff --git a/apps/web/services/courses/updates.ts b/apps/web/services/courses/updates.ts
index 061d6a33..440ae0fd 100644
--- a/apps/web/services/courses/updates.ts
+++ b/apps/web/services/courses/updates.ts
@@ -1,6 +1,5 @@
import { getAPIUrl } from '@services/config/config'
import {
- RequestBody,
RequestBodyWithAuthHeader,
getResponseMetadata,
} from '@services/utils/ts/requests'
diff --git a/apps/web/services/organizations/invites.ts b/apps/web/services/organizations/invites.ts
index 8207f538..dd082d1f 100644
--- a/apps/web/services/organizations/invites.ts
+++ b/apps/web/services/organizations/invites.ts
@@ -1,6 +1,5 @@
import { getAPIUrl } from '@services/config/config'
import {
- RequestBody,
RequestBodyWithAuthHeader,
getResponseMetadata,
} from '@services/utils/ts/requests'
diff --git a/apps/web/services/organizations/orgs.ts b/apps/web/services/organizations/orgs.ts
index a08e38cf..e8cd4771 100644
--- a/apps/web/services/organizations/orgs.ts
+++ b/apps/web/services/organizations/orgs.ts
@@ -1,6 +1,6 @@
import { getAPIUrl } from '@services/config/config'
import {
- RequestBody,
+ RequestBodyWithAuthHeader,
errorHandling,
getResponseMetadata,
} from '@services/utils/ts/requests'
@@ -10,37 +10,48 @@ import {
GET requests are called from the frontend using SWR (https://swr.vercel.app/)
*/
-export async function createNewOrganization(body: any) {
+export async function createNewOrganization(body: any, access_token: string) {
const result = await fetch(
`${getAPIUrl()}orgs/`,
- RequestBody('POST', body, null)
+ RequestBodyWithAuthHeader('POST', body, null,access_token)
)
const res = await errorHandling(result)
return res
}
-export async function deleteOrganizationFromBackend(org_id: any) {
+export async function deleteOrganizationFromBackend(
+ org_id: any,
+ access_token: string
+) {
const result = await fetch(
`${getAPIUrl()}orgs/${org_id}`,
- RequestBody('DELETE', null, null)
+ RequestBodyWithAuthHeader('DELETE', null, null, access_token)
)
const res = await errorHandling(result)
return res
}
-export async function getOrganizationContextInfo(org_slug: any, next: any) {
+export async function getOrganizationContextInfo(
+ org_slug: any,
+ next: any,
+ access_token?: string
+) {
const result = await fetch(
`${getAPIUrl()}orgs/slug/${org_slug}`,
- RequestBody('GET', null, next)
+ RequestBodyWithAuthHeader('GET', null, next, access_token)
)
const res = await errorHandling(result)
return res
}
-export async function getOrganizationContextInfoWithId(org_id: any, next: any) {
+export async function getOrganizationContextInfoWithId(
+ org_id: any,
+ next: any,
+ access_token: string
+) {
const result = await fetch(
`${getAPIUrl()}orgs/${org_id}`,
- RequestBody('GET', null, next)
+ RequestBodyWithAuthHeader('GET', null, next, access_token)
)
const res = await errorHandling(result)
return res
@@ -64,10 +75,14 @@ export async function getOrganizationContextInfoWithoutCredentials(
return res
}
-export function getOrganizationContextInfoNoAsync(org_slug: any, next: any) {
+export function getOrganizationContextInfoNoAsync(
+ org_slug: any,
+ next: any,
+ access_token: string
+) {
const result = fetch(
`${getAPIUrl()}orgs/slug/${org_slug}`,
- RequestBody('GET', null, next)
+ RequestBodyWithAuthHeader('GET', null, next, access_token)
)
return result
}
@@ -75,20 +90,25 @@ export function getOrganizationContextInfoNoAsync(org_slug: any, next: any) {
export async function updateUserRole(
org_id: any,
user_id: any,
- role_uuid: any
+ role_uuid: any,
+ access_token: string
) {
const result = await fetch(
`${getAPIUrl()}orgs/${org_id}/users/${user_id}/role/${role_uuid}`,
- RequestBody('PUT', null, null)
+ RequestBodyWithAuthHeader('PUT', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
}
-export async function removeUserFromOrg(org_id: any, user_id: any) {
+export async function removeUserFromOrg(
+ org_id: any,
+ user_id: any,
+ access_token: any
+) {
const result = await fetch(
`${getAPIUrl()}orgs/${org_id}/users/${user_id}`,
- RequestBody('DELETE', null, null)
+ RequestBodyWithAuthHeader('DELETE', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
diff --git a/apps/web/services/settings/org.ts b/apps/web/services/settings/org.ts
index 7aaedb5c..c74450eb 100644
--- a/apps/web/services/settings/org.ts
+++ b/apps/web/services/settings/org.ts
@@ -1,8 +1,8 @@
import { getAPIUrl } from '@services/config/config'
import {
- RequestBody,
errorHandling,
- RequestBodyForm,
+ RequestBodyWithAuthHeader,
+ RequestBodyFormWithAuthHeader,
} from '@services/utils/ts/requests'
/*
@@ -10,22 +10,30 @@ import {
GET requests are called from the frontend using SWR (https://swr.vercel.app/)
*/
-export async function updateOrganization(org_id: string, data: any) {
+export async function updateOrganization(
+ org_id: string,
+ data: any,
+ access_token: string
+) {
const result: any = await fetch(
`${getAPIUrl()}orgs/` + org_id,
- RequestBody('PUT', data, null)
+ RequestBodyWithAuthHeader('PUT', data, null, access_token)
)
const res = await errorHandling(result)
return res
}
-export async function uploadOrganizationLogo(org_id: string, logo_file: any) {
+export async function uploadOrganizationLogo(
+ org_id: string,
+ logo_file: any,
+ access_token: string
+) {
// Send file thumbnail as form data
const formData = new FormData()
formData.append('logo_file', logo_file)
const result: any = await fetch(
`${getAPIUrl()}orgs/` + org_id + '/logo',
- RequestBodyForm('PUT', formData, null)
+ RequestBodyFormWithAuthHeader('PUT', formData, null, access_token)
)
const res = await errorHandling(result)
return res
diff --git a/apps/web/services/settings/password.ts b/apps/web/services/settings/password.ts
index b5ff0331..9bf84618 100644
--- a/apps/web/services/settings/password.ts
+++ b/apps/web/services/settings/password.ts
@@ -1,15 +1,22 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody, errorHandling } from '@services/utils/ts/requests'
+import {
+ RequestBodyWithAuthHeader,
+ errorHandling,
+} from '@services/utils/ts/requests'
/*
This file includes only POST, PUT, DELETE requests
GET requests are called from the frontend using SWR (https://swr.vercel.app/)
*/
-export async function updatePassword(user_id: string, data: any) {
+export async function updatePassword(
+ user_id: string,
+ data: any,
+ access_token: any
+) {
const result: any = await fetch(
`${getAPIUrl()}users/change_password/` + user_id,
- RequestBody('PUT', data, null)
+ RequestBodyWithAuthHeader('PUT', data, null, access_token)
)
const res = await errorHandling(result)
return res
diff --git a/apps/web/services/settings/profile.ts b/apps/web/services/settings/profile.ts
index 10fec223..68bd5d57 100644
--- a/apps/web/services/settings/profile.ts
+++ b/apps/web/services/settings/profile.ts
@@ -1,15 +1,22 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody, errorHandling } from '@services/utils/ts/requests'
+import {
+ RequestBodyWithAuthHeader,
+ errorHandling,
+} from '@services/utils/ts/requests'
/*
This file includes only POST, PUT, DELETE requests
GET requests are called from the frontend using SWR (https://swr.vercel.app/)
*/
-export async function updateProfile(data: any, user_id: number) {
+export async function updateProfile(
+ data: any,
+ user_id: number,
+ access_token: string
+) {
const result: any = await fetch(
`${getAPIUrl()}users/` + user_id,
- RequestBody('PUT', data, null)
+ RequestBodyWithAuthHeader('PUT', data, null, access_token)
)
const res = await errorHandling(result)
return res
diff --git a/apps/web/services/usergroups/usergroups.ts b/apps/web/services/usergroups/usergroups.ts
index c4eaa599..b7f9e50c 100644
--- a/apps/web/services/usergroups/usergroups.ts
+++ b/apps/web/services/usergroups/usergroups.ts
@@ -1,46 +1,60 @@
import { getAPIUrl } from '@services/config/config'
-import { RequestBody, getResponseMetadata } from '@services/utils/ts/requests'
+import {
+ RequestBodyWithAuthHeader,
+ getResponseMetadata,
+} from '@services/utils/ts/requests'
-export async function getUserGroups(org_id: any) {
+export async function getUserGroups(org_id: any, access_token: string) {
const result: any = await fetch(
`${getAPIUrl()}usergroups/org/${org_id}`,
- RequestBody('GET', null, null)
+ RequestBodyWithAuthHeader('GET', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
}
-export async function createUserGroup(body: any) {
+export async function createUserGroup(body: any, access_token: string) {
const result: any = await fetch(
`${getAPIUrl()}usergroups/`,
- RequestBody('POST', body, null)
+ RequestBodyWithAuthHeader('POST', body, null, access_token)
)
const res = await getResponseMetadata(result)
return res
}
-export async function linkUserToUserGroup(usergroup_id: any, user_id: any) {
+export async function linkUserToUserGroup(
+ usergroup_id: any,
+ user_id: any,
+ access_token: string
+) {
const result: any = await fetch(
`${getAPIUrl()}usergroups/${usergroup_id}/add_users?user_ids=${user_id}`,
- RequestBody('POST', null, null)
+ RequestBodyWithAuthHeader('POST', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
}
-export async function unLinkUserToUserGroup(usergroup_id: any, user_id: any) {
+export async function unLinkUserToUserGroup(
+ usergroup_id: any,
+ user_id: any,
+ access_token: string
+) {
const result: any = await fetch(
`${getAPIUrl()}usergroups/${usergroup_id}/remove_users?user_ids=${user_id}`,
- RequestBody('DELETE', null, null)
+ RequestBodyWithAuthHeader('DELETE', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
}
-export async function deleteUserGroup(usergroup_id: number) {
+export async function deleteUserGroup(
+ usergroup_id: number,
+ access_token: string
+) {
const result: any = await fetch(
`${getAPIUrl()}usergroups/${usergroup_id}`,
- RequestBody('DELETE', null, null)
+ RequestBodyWithAuthHeader('DELETE', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
@@ -48,11 +62,12 @@ export async function deleteUserGroup(usergroup_id: number) {
export async function linkResourcesToUserGroup(
usergroup_id: any,
- resource_uuids: any
+ resource_uuids: any,
+ access_token: string
) {
const result: any = await fetch(
`${getAPIUrl()}usergroups/${usergroup_id}/add_resources?resource_uuids=${resource_uuids}`,
- RequestBody('POST', null, null)
+ RequestBodyWithAuthHeader('POST', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
@@ -60,11 +75,12 @@ export async function linkResourcesToUserGroup(
export async function unLinkResourcesToUserGroup(
usergroup_id: any,
- resource_uuids: any
+ resource_uuids: any,
+ access_token: string
) {
const result: any = await fetch(
`${getAPIUrl()}usergroups/${usergroup_id}/remove_resources?resource_uuids=${resource_uuids}`,
- RequestBody('DELETE', null, null)
+ RequestBodyWithAuthHeader('DELETE', null, null, access_token)
)
const res = await getResponseMetadata(result)
return res
diff --git a/apps/web/services/users/users.ts b/apps/web/services/users/users.ts
index 468ad56c..7596e208 100644
--- a/apps/web/services/users/users.ts
+++ b/apps/web/services/users/users.ts
@@ -1,7 +1,7 @@
import { getAPIUrl } from '@services/config/config'
import {
RequestBody,
- RequestBodyForm,
+ RequestBodyFormWithAuthHeader,
errorHandling,
getResponseMetadata,
} from '@services/utils/ts/requests'
@@ -15,12 +15,16 @@ export async function getUser(user_id: string) {
return res
}
-export async function updateUserAvatar(user_uuid: any, avatar_file: any) {
+export async function updateUserAvatar(
+ user_uuid: any,
+ avatar_file: any,
+ access_token: any
+) {
const formData = new FormData()
formData.append('avatar_file', avatar_file)
const result: any = await fetch(
`${getAPIUrl()}users/update_avatar/${user_uuid}`,
- RequestBodyForm('PUT', formData, null)
+ RequestBodyFormWithAuthHeader('PUT', formData, null, access_token)
)
const res = await getResponseMetadata(result)
return res
diff --git a/apps/web/services/utils/ts/requests.ts b/apps/web/services/utils/ts/requests.ts
index 1ac8fd8b..0c68a945 100644
--- a/apps/web/services/utils/ts/requests.ts
+++ b/apps/web/services/utils/ts/requests.ts
@@ -20,7 +20,7 @@ export const RequestBodyWithAuthHeader = (
method: string,
data: any,
next: any,
- token: string
+ token?: string
) => {
let HeadersConfig = new Headers(
token
diff --git a/apps/web/types/next-auth.d.ts b/apps/web/types/next-auth.d.ts
index 5287cbc2..ece81eac 100644
--- a/apps/web/types/next-auth.d.ts
+++ b/apps/web/types/next-auth.d.ts
@@ -1,3 +1,4 @@
+// eslint-disable-next-line unused-imports/no-unused-imports
import type { NextAuthOptions } from 'next-auth/index';
// next-auth.d.ts
diff --git a/package.json b/package.json
index 7174e3cc..6043f5a9 100644
--- a/package.json
+++ b/package.json
@@ -2,15 +2,15 @@
"private": true,
"scripts": {
"build": "turbo run build",
- "start" : "turbo run start",
+ "start": "turbo run start",
"dev": "turbo run dev",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"devDependencies": {
"eslint": "^8.57.0",
- "prettier": "^3.2.5",
- "turbo": "^1.13.2"
+ "prettier": "^3.3.0",
+ "turbo": "^1.13.3"
},
"packageManager": "pnpm@9.0.6"
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f7c0cf81..a5b4d0ae 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -12,18 +12,14 @@ importers:
specifier: ^8.57.0
version: 8.57.0
prettier:
- specifier: ^3.2.5
- version: 3.2.5
+ specifier: ^3.3.0
+ version: 3.3.0
turbo:
- specifier: ^1.13.2
- version: 1.13.2
+ specifier: ^1.13.3
+ version: 1.13.3
packages:
- '@aashutoshrathi/word-wrap@1.2.6':
- resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==}
- engines: {node: '>=0.10.0'}
-
'@eslint-community/eslint-utils@4.4.0':
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -50,8 +46,8 @@ packages:
resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
engines: {node: '>=12.22'}
- '@humanwhocodes/object-schema@2.0.2':
- resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==}
+ '@humanwhocodes/object-schema@2.0.3':
+ resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}
'@nodelib/fs.scandir@2.1.5':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
@@ -73,8 +69,8 @@ packages:
peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
- acorn@8.10.0:
- resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==}
+ acorn@8.11.3:
+ resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==}
engines: {node: '>=0.4.0'}
hasBin: true
@@ -120,8 +116,8 @@ packages:
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
engines: {node: '>= 8'}
- debug@4.3.4:
- resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
+ debug@4.3.5:
+ resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
@@ -209,6 +205,7 @@ packages:
glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
+ deprecated: Glob versions prior to v9 are no longer supported
globals@13.24.0:
resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
@@ -235,6 +232,7 @@ packages:
inflight@1.0.6:
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
+ deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
inherits@2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
@@ -293,8 +291,8 @@ packages:
once@1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
- optionator@0.9.3:
- resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==}
+ optionator@0.9.4:
+ resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
engines: {node: '>= 0.8.0'}
p-limit@3.1.0:
@@ -325,13 +323,13 @@ packages:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
- prettier@3.2.5:
- resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==}
+ prettier@3.3.0:
+ resolution: {integrity: sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==}
engines: {node: '>=14'}
hasBin: true
- punycode@2.3.0:
- resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
+ punycode@2.3.1:
+ resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
queue-microtask@1.2.3:
@@ -347,6 +345,7 @@ packages:
rimraf@3.0.2:
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
+ deprecated: Rimraf versions prior to v4 are no longer supported
hasBin: true
run-parallel@1.2.0:
@@ -375,38 +374,38 @@ packages:
text-table@0.2.0:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
- turbo-darwin-64@1.13.2:
- resolution: {integrity: sha512-CCSuD8CfmtncpohCuIgq7eAzUas0IwSbHfI8/Q3vKObTdXyN8vAo01gwqXjDGpzG9bTEVedD0GmLbD23dR0MLA==}
+ turbo-darwin-64@1.13.3:
+ resolution: {integrity: sha512-glup8Qx1qEFB5jerAnXbS8WrL92OKyMmg5Hnd4PleLljAeYmx+cmmnsmLT7tpaVZIN58EAAwu8wHC6kIIqhbWA==}
cpu: [x64]
os: [darwin]
- turbo-darwin-arm64@1.13.2:
- resolution: {integrity: sha512-0HySm06/D2N91rJJ89FbiI/AodmY8B3WDSFTVEpu2+8spUw7hOJ8okWOT0e5iGlyayUP9gr31eOeL3VFZkpfCw==}
+ turbo-darwin-arm64@1.13.3:
+ resolution: {integrity: sha512-/np2xD+f/+9qY8BVtuOQXRq5f9LehCFxamiQnwdqWm5iZmdjygC5T3uVSYuagVFsZKMvX3ycySwh8dylGTl6lg==}
cpu: [arm64]
os: [darwin]
- turbo-linux-64@1.13.2:
- resolution: {integrity: sha512-7HnibgbqZrjn4lcfIouzlPu8ZHSBtURG4c7Bedu7WJUDeZo+RE1crlrQm8wuwO54S0siYqUqo7GNHxu4IXbioQ==}
+ turbo-linux-64@1.13.3:
+ resolution: {integrity: sha512-G+HGrau54iAnbXLfl+N/PynqpDwi/uDzb6iM9hXEDG+yJnSJxaHMShhOkXYJPk9offm9prH33Khx2scXrYVW1g==}
cpu: [x64]
os: [linux]
- turbo-linux-arm64@1.13.2:
- resolution: {integrity: sha512-sUq4dbpk6SNKg/Hkwn256Vj2AEYSQdG96repio894h5/LEfauIK2QYiC/xxAeW3WBMc6BngmvNyURIg7ltrePg==}
+ turbo-linux-arm64@1.13.3:
+ resolution: {integrity: sha512-qWwEl5VR02NqRyl68/3pwp3c/olZuSp+vwlwrunuoNTm6JXGLG5pTeme4zoHNnk0qn4cCX7DFrOboArlYxv0wQ==}
cpu: [arm64]
os: [linux]
- turbo-windows-64@1.13.2:
- resolution: {integrity: sha512-DqzhcrciWq3dpzllJR2VVIyOhSlXYCo4mNEWl98DJ3FZ08PEzcI3ceudlH6F0t/nIcfSItK1bDP39cs7YoZHEA==}
+ turbo-windows-64@1.13.3:
+ resolution: {integrity: sha512-Nudr4bRChfJzBPzEmpVV85VwUYRCGKecwkBFpbp2a4NtrJ3+UP1VZES653ckqCu2FRyRuS0n03v9euMbAvzH+Q==}
cpu: [x64]
os: [win32]
- turbo-windows-arm64@1.13.2:
- resolution: {integrity: sha512-WnPMrwfCXxK69CdDfS1/j2DlzcKxSmycgDAqV0XCYpK/812KB0KlvsVAt5PjEbZGXkY88pCJ1BLZHAjF5FcbqA==}
+ turbo-windows-arm64@1.13.3:
+ resolution: {integrity: sha512-ouJCgsVLd3icjRLmRvHQDDZnmGzT64GBupM1Y+TjtYn2LVaEBoV6hicFy8x5DUpnqdLy+YpCzRMkWlwhmkX7sQ==}
cpu: [arm64]
os: [win32]
- turbo@1.13.2:
- resolution: {integrity: sha512-rX/d9f4MgRT3yK6cERPAkfavIxbpBZowDQpgvkYwGMGDQ0Nvw1nc0NVjruE76GrzXQqoxR1UpnmEP54vBARFHQ==}
+ turbo@1.13.3:
+ resolution: {integrity: sha512-n17HJv4F4CpsYTvKzUJhLbyewbXjq1oLCi90i5tW1TiWDz16ML1eDG7wi5dHaKxzh5efIM56SITnuVbMq5dk4g==}
hasBin: true
type-check@0.4.0:
@@ -425,6 +424,10 @@ packages:
engines: {node: '>= 8'}
hasBin: true
+ word-wrap@1.2.5:
+ resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
+ engines: {node: '>=0.10.0'}
+
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
@@ -434,8 +437,6 @@ packages:
snapshots:
- '@aashutoshrathi/word-wrap@1.2.6': {}
-
'@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)':
dependencies:
eslint: 8.57.0
@@ -446,7 +447,7 @@ snapshots:
'@eslint/eslintrc@2.1.4':
dependencies:
ajv: 6.12.6
- debug: 4.3.4
+ debug: 4.3.5
espree: 9.6.1
globals: 13.24.0
ignore: 5.3.1
@@ -461,15 +462,15 @@ snapshots:
'@humanwhocodes/config-array@0.11.14':
dependencies:
- '@humanwhocodes/object-schema': 2.0.2
- debug: 4.3.4
+ '@humanwhocodes/object-schema': 2.0.3
+ debug: 4.3.5
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
'@humanwhocodes/module-importer@1.0.1': {}
- '@humanwhocodes/object-schema@2.0.2': {}
+ '@humanwhocodes/object-schema@2.0.3': {}
'@nodelib/fs.scandir@2.1.5':
dependencies:
@@ -485,11 +486,11 @@ snapshots:
'@ungap/structured-clone@1.2.0': {}
- acorn-jsx@5.3.2(acorn@8.10.0):
+ acorn-jsx@5.3.2(acorn@8.11.3):
dependencies:
- acorn: 8.10.0
+ acorn: 8.11.3
- acorn@8.10.0: {}
+ acorn@8.11.3: {}
ajv@6.12.6:
dependencies:
@@ -534,7 +535,7 @@ snapshots:
shebang-command: 2.0.0
which: 2.0.2
- debug@4.3.4:
+ debug@4.3.5:
dependencies:
ms: 2.1.2
@@ -566,7 +567,7 @@ snapshots:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
- debug: 4.3.4
+ debug: 4.3.5
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
@@ -590,7 +591,7 @@ snapshots:
lodash.merge: 4.6.2
minimatch: 3.1.2
natural-compare: 1.4.0
- optionator: 0.9.3
+ optionator: 0.9.4
strip-ansi: 6.0.1
text-table: 0.2.0
transitivePeerDependencies:
@@ -598,8 +599,8 @@ snapshots:
espree@9.6.1:
dependencies:
- acorn: 8.10.0
- acorn-jsx: 5.3.2(acorn@8.10.0)
+ acorn: 8.11.3
+ acorn-jsx: 5.3.2(acorn@8.11.3)
eslint-visitor-keys: 3.4.3
esquery@1.5.0:
@@ -727,14 +728,14 @@ snapshots:
dependencies:
wrappy: 1.0.2
- optionator@0.9.3:
+ optionator@0.9.4:
dependencies:
- '@aashutoshrathi/word-wrap': 1.2.6
deep-is: 0.1.4
fast-levenshtein: 2.0.6
levn: 0.4.1
prelude-ls: 1.2.1
type-check: 0.4.0
+ word-wrap: 1.2.5
p-limit@3.1.0:
dependencies:
@@ -756,9 +757,9 @@ snapshots:
prelude-ls@1.2.1: {}
- prettier@3.2.5: {}
+ prettier@3.3.0: {}
- punycode@2.3.0: {}
+ punycode@2.3.1: {}
queue-microtask@1.2.3: {}
@@ -792,32 +793,32 @@ snapshots:
text-table@0.2.0: {}
- turbo-darwin-64@1.13.2:
+ turbo-darwin-64@1.13.3:
optional: true
- turbo-darwin-arm64@1.13.2:
+ turbo-darwin-arm64@1.13.3:
optional: true
- turbo-linux-64@1.13.2:
+ turbo-linux-64@1.13.3:
optional: true
- turbo-linux-arm64@1.13.2:
+ turbo-linux-arm64@1.13.3:
optional: true
- turbo-windows-64@1.13.2:
+ turbo-windows-64@1.13.3:
optional: true
- turbo-windows-arm64@1.13.2:
+ turbo-windows-arm64@1.13.3:
optional: true
- turbo@1.13.2:
+ turbo@1.13.3:
optionalDependencies:
- turbo-darwin-64: 1.13.2
- turbo-darwin-arm64: 1.13.2
- turbo-linux-64: 1.13.2
- turbo-linux-arm64: 1.13.2
- turbo-windows-64: 1.13.2
- turbo-windows-arm64: 1.13.2
+ turbo-darwin-64: 1.13.3
+ turbo-darwin-arm64: 1.13.3
+ turbo-linux-64: 1.13.3
+ turbo-linux-arm64: 1.13.3
+ turbo-windows-64: 1.13.3
+ turbo-windows-arm64: 1.13.3
type-check@0.4.0:
dependencies:
@@ -827,12 +828,14 @@ snapshots:
uri-js@4.4.1:
dependencies:
- punycode: 2.3.0
+ punycode: 2.3.1
which@2.0.2:
dependencies:
isexe: 2.0.0
+ word-wrap@1.2.5: {}
+
wrappy@1.0.2: {}
yocto-queue@0.1.0: {}