mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-18 20:09:25 +00:00
feat: use session access_tokens
This commit is contained in:
parent
08cc97f557
commit
52f2235942
74 changed files with 413 additions and 440 deletions
3
.npmrc
3
.npmrc
|
|
@ -1 +1,2 @@
|
|||
shared-workspace-lockfile=false
|
||||
shared-workspace-lockfile=false
|
||||
package-manager-strict=false
|
||||
|
|
@ -4,7 +4,8 @@
|
|||
"react/no-unescaped-entities": "off",
|
||||
"@next/next/no-page-custom-font": "off",
|
||||
"@next/next/no-img-element": "off",
|
||||
"unused-imports/no-unused-imports": "warn"
|
||||
"unused-imports/no-unused-imports": "warn",
|
||||
"no-console": "warn"
|
||||
},
|
||||
"plugins": ["unused-imports"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,17 +52,17 @@ const EditActivity = async (params: any) => {
|
|||
const org = await getOrganizationContextInfoWithId(courseInfo.org_id, {
|
||||
revalidate: 180,
|
||||
tags: ['organizations'],
|
||||
})
|
||||
}, access_token)
|
||||
|
||||
return (
|
||||
<EditorOptionsProvider options={{ isEditable: true }}>
|
||||
<AIEditorProvider>
|
||||
<EditorWrapper
|
||||
org={org}
|
||||
course={courseInfo}
|
||||
activity={activity}
|
||||
content={activity.content}
|
||||
></EditorWrapper>
|
||||
<EditorWrapper
|
||||
org={org}
|
||||
course={courseInfo}
|
||||
activity={activity}
|
||||
content={activity.content}
|
||||
></EditorWrapper>
|
||||
</AIEditorProvider>
|
||||
</EditorOptionsProvider>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
'use client'
|
||||
import React from 'react'
|
||||
import { createNewOrganization } from '../../../services/organizations/orgs'
|
||||
|
||||
const Organizations = () => {
|
||||
const [name, setName] = React.useState('')
|
||||
const [description, setDescription] = React.useState('')
|
||||
const [email, setEmail] = React.useState('')
|
||||
const [slug, setSlug] = React.useState('')
|
||||
|
||||
const handleNameChange = (e: any) => {
|
||||
setName(e.target.value)
|
||||
}
|
||||
|
||||
const handleDescriptionChange = (e: any) => {
|
||||
setDescription(e.target.value)
|
||||
}
|
||||
|
||||
const handleEmailChange = (e: any) => {
|
||||
setEmail(e.target.value)
|
||||
}
|
||||
|
||||
const handleSlugChange = (e: any) => {
|
||||
setSlug(e.target.value)
|
||||
}
|
||||
|
||||
const handleSubmit = async (e: any) => {
|
||||
e.preventDefault()
|
||||
|
||||
let logo = ''
|
||||
const status = await createNewOrganization({
|
||||
name,
|
||||
description,
|
||||
email,
|
||||
logo,
|
||||
slug,
|
||||
default: false,
|
||||
})
|
||||
alert(JSON.stringify(status))
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="font-bold text-lg">New Organization</div>
|
||||
Name: <input onChange={handleNameChange} type="text" />
|
||||
<br />
|
||||
Description: <input onChange={handleDescriptionChange} type="text" />
|
||||
<br />
|
||||
Slug: <input onChange={handleSlugChange} type="text" />
|
||||
<br />
|
||||
Email Address: <input onChange={handleEmailChange} type="text" />
|
||||
<br />
|
||||
<button onClick={handleSubmit}>Create</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Organizations
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
'use client' //todo: use server components
|
||||
import Link from 'next/link'
|
||||
import React from 'react'
|
||||
import { deleteOrganizationFromBackend } from '@services/organizations/orgs'
|
||||
import useSWR, { mutate } from 'swr'
|
||||
import { swrFetcher } from '@services/utils/ts/requests'
|
||||
import { getAPIUrl, getUriWithOrg } from '@services/config/config'
|
||||
|
||||
const Organizations = () => {
|
||||
const { data: organizations, error } = useSWR(
|
||||
`${getAPIUrl()}orgs/user/page/1/limit/10`,
|
||||
swrFetcher
|
||||
)
|
||||
|
||||
async function deleteOrganization(org_id: any) {
|
||||
const response = await deleteOrganizationFromBackend(org_id)
|
||||
response &&
|
||||
mutate(
|
||||
`${getAPIUrl()}orgs/user/page/1/limit/10`,
|
||||
organizations.filter((org: any) => org.org_id !== org_id)
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="font-bold text-lg">
|
||||
Your Organizations{' '}
|
||||
<Link href="/organizations/new">
|
||||
<button className="bg-blue-500 text-white px-2 py-1 rounded-md hover:bg-blue-600 focus:outline-none">
|
||||
+
|
||||
</button>
|
||||
</Link>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
{error && <p className="text-red-500">Failed to load</p>}
|
||||
{!organizations ? (
|
||||
<p className="text-gray-500">Loading...</p>
|
||||
) : (
|
||||
<div>
|
||||
{organizations.map((org: any) => (
|
||||
<div
|
||||
key={org.org_id}
|
||||
className="flex items-center justify-between mb-4"
|
||||
>
|
||||
<Link href={getUriWithOrg(org.slug, '/')}>
|
||||
<h3 className="text-blue-500 cursor-pointer hover:underline">
|
||||
{org.name}
|
||||
</h3>
|
||||
</Link>
|
||||
<button
|
||||
onClick={() => deleteOrganization(org.org_id)}
|
||||
className="px-3 py-1 text-white bg-red-500 rounded-md hover:bg-red-600 focus:outline-none"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Organizations
|
||||
|
|
@ -6,7 +6,6 @@ import { getOrganizationContextInfo } from '@services/organizations/orgs'
|
|||
import { nextAuthOptions } from 'app/auth/options'
|
||||
import { Metadata } from 'next'
|
||||
import { getServerSession } from 'next-auth'
|
||||
import { cookies } from 'next/headers'
|
||||
import Link from 'next/link'
|
||||
|
||||
type MetadataProps = {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@ import GeneralWrapperStyled from '@components/StyledElements/Wrappers/GeneralWra
|
|||
import { getUriWithOrg } from '@services/config/config'
|
||||
import { getOrganizationContextInfo } from '@services/organizations/orgs'
|
||||
import { Metadata } from 'next'
|
||||
import { cookies } from 'next/headers'
|
||||
import Link from 'next/link'
|
||||
import { getAccessTokenFromRefreshTokenCookie } from '@services/auth/auth'
|
||||
import CollectionThumbnail from '@components/Objects/Thumbnails/CollectionThumbnail'
|
||||
import NewCollectionButton from '@components/StyledElements/Buttons/NewCollectionButton'
|
||||
import ContentPlaceHolderIfUserIsNotAdmin from '@components/ContentPlaceHolder'
|
||||
|
|
|
|||
|
|
@ -147,8 +147,7 @@ export function MarkStatus(props: {
|
|||
orgslug: string
|
||||
}) {
|
||||
const router = useRouter()
|
||||
const session = useLHSession()
|
||||
console.log(props.course.trail)
|
||||
const session = useLHSession() as any;
|
||||
|
||||
async function markActivityAsCompleteFront() {
|
||||
const trail = await markActivityAsComplete(
|
||||
|
|
@ -171,8 +170,6 @@ export function MarkStatus(props: {
|
|||
}
|
||||
}
|
||||
|
||||
console.log('isActivityCompleted', isActivityCompleted())
|
||||
|
||||
return (
|
||||
<>
|
||||
{isActivityCompleted() ? (
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
import { getActivityWithAuthHeader } from '@services/courses/activities'
|
||||
import { getCourseMetadata } from '@services/courses/courses'
|
||||
import { cookies } from 'next/headers'
|
||||
import ActivityClient from './activity'
|
||||
import { getOrganizationContextInfo } from '@services/organizations/orgs'
|
||||
import { Metadata } from 'next'
|
||||
import { getAccessTokenFromRefreshTokenCookie } from '@services/auth/auth'
|
||||
import { getServerSession } from 'next-auth'
|
||||
import { nextAuthOptions } from 'app/auth/options'
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import { useLHSession } from '@components/Contexts/LHSessionContext'
|
|||
const CourseClient = (props: any) => {
|
||||
const [user, setUser] = useState<any>({})
|
||||
const [learnings, setLearnings] = useState<any>([])
|
||||
const session = useLHSession()
|
||||
const session = useLHSession() as any;
|
||||
const courseuuid = props.courseuuid
|
||||
const orgslug = props.orgslug
|
||||
const course = props.course
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
import React from 'react'
|
||||
import CourseClient from './course'
|
||||
import { cookies } from 'next/headers'
|
||||
import { getCourseMetadata } from '@services/courses/courses'
|
||||
import { getOrganizationContextInfo } from '@services/organizations/orgs'
|
||||
import { Metadata } from 'next'
|
||||
import { getAccessTokenFromRefreshTokenCookie } from '@services/auth/auth'
|
||||
import { getCourseThumbnailMediaDirectory } from '@services/media/media'
|
||||
import { nextAuthOptions } from 'app/auth/options'
|
||||
import { getServerSession } from 'next-auth'
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ import React from 'react'
|
|||
import Courses from './courses'
|
||||
import { Metadata } from 'next'
|
||||
import { getOrganizationContextInfo } from '@services/organizations/orgs'
|
||||
import { cookies } from 'next/headers'
|
||||
import { getAccessTokenFromRefreshTokenCookie } from '@services/auth/auth'
|
||||
import { nextAuthOptions } from 'app/auth/options'
|
||||
import { getServerSession } from 'next-auth'
|
||||
import { getOrgCourses } from '@services/courses/courses'
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import React from 'react'
|
|||
import { Metadata } from 'next'
|
||||
import { getOrganizationContextInfo } from '@services/organizations/orgs'
|
||||
import Trail from './trail'
|
||||
import { getServerSession } from 'next-auth'
|
||||
import { nextAuthOptions } from 'app/auth/options'
|
||||
|
||||
type MetadataProps = {
|
||||
params: { orgslug: string }
|
||||
|
|
@ -11,11 +13,13 @@ type MetadataProps = {
|
|||
export async function generateMetadata({
|
||||
params,
|
||||
}: MetadataProps): Promise<Metadata> {
|
||||
const session = await getServerSession(nextAuthOptions)
|
||||
const access_token = session?.tokens?.access_token
|
||||
// Get Org context information
|
||||
const org = await getOrganizationContextInfo(params.orgslug, {
|
||||
revalidate: 1800,
|
||||
tags: ['organizations'],
|
||||
})
|
||||
}, access_token)
|
||||
return {
|
||||
title: 'Trail — ' + org.name,
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
'use client'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
import { useOrg } from '@components/Contexts/OrgContext'
|
||||
import PageLoading from '@components/Objects/Loaders/PageLoading'
|
||||
import TrailCourseElement from '@components/Pages/Trail/TrailCourseElement'
|
||||
|
|
@ -11,14 +12,16 @@ import useSWR from 'swr'
|
|||
|
||||
function Trail(params: any) {
|
||||
let orgslug = params.orgslug
|
||||
const session = useLHSession() as any
|
||||
const access_token = session.data.tokens.access_token;
|
||||
const org = useOrg() as any
|
||||
const orgID = org?.id
|
||||
const { data: trail, error: error } = useSWR(
|
||||
`${getAPIUrl()}trail/org/${orgID}/trail`,
|
||||
swrFetcher
|
||||
(url) => swrFetcher(url, access_token)
|
||||
)
|
||||
|
||||
useEffect(() => {}, [trail, org])
|
||||
useEffect(() => { }, [trail, org])
|
||||
|
||||
return (
|
||||
<GeneralWrapperStyled>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import Link from 'next/link'
|
|||
import { CourseOverviewTop } from '@components/Dashboard/UI/CourseOverviewTop'
|
||||
import { motion } from 'framer-motion'
|
||||
import EditCourseGeneral from '@components/Dashboard/Course/EditCourseGeneral/EditCourseGeneral'
|
||||
import { GalleryVerticalEnd, Info, Lock, UserRoundCog } from 'lucide-react'
|
||||
import { GalleryVerticalEnd, Info, UserRoundCog } from 'lucide-react'
|
||||
import EditCourseAccess from '@components/Dashboard/Course/EditCourseAccess/EditCourseAccess'
|
||||
|
||||
export type CourseOverviewParams = {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
import LeftMenu from '@components/Dashboard/UI/LeftMenu'
|
||||
import AdminAuthorization from '@components/Security/AdminAuthorization'
|
||||
import ClientComponentSkeleton from '@components/Utils/ClientComp'
|
||||
import { Metadata } from 'next'
|
||||
import { SessionProvider } from 'next-auth/react'
|
||||
import React from 'react'
|
||||
import ClientAdminLayout from './ClientAdminLayout'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
'use client'
|
||||
import LHSessionProvider from '@components/Contexts/LHSessionContext'
|
||||
import { OrgProvider } from '@components/Contexts/OrgContext'
|
||||
import Toast from '@components/StyledElements/Toast/Toast'
|
||||
import '@styles/globals.css'
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import React from 'react'
|
|||
import { AlertTriangle } from 'lucide-react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import Link from 'next/link'
|
||||
import { signIn, useSession } from "next-auth/react"
|
||||
import { signIn } from "next-auth/react"
|
||||
import { getUriWithOrg } from '@services/config/config'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ const validate = (values: any) => {
|
|||
const LoginClient = (props: LoginClientProps) => {
|
||||
const [isSubmitting, setIsSubmitting] = React.useState(false)
|
||||
const router = useRouter();
|
||||
const session = useLHSession();
|
||||
const session = useLHSession() as any;
|
||||
|
||||
const [error, setError] = React.useState('')
|
||||
const formik = useFormik({
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { getUriWithOrg } from '@services/config/config'
|
|||
import { useOrg } from '@components/Contexts/OrgContext'
|
||||
import { useRouter, useSearchParams } from 'next/navigation'
|
||||
import { useFormik } from 'formik'
|
||||
import { resetPassword, sendResetLink } from '@services/auth/auth'
|
||||
import { resetPassword } from '@services/auth/auth'
|
||||
|
||||
const validate = (values: any) => {
|
||||
const errors: any = {}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Link from 'next/link'
|
|||
import { getUriWithOrg } from '@services/config/config'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
import React, { useEffect } from 'react'
|
||||
import { MailWarning, Shield, Ticket, UserPlus } from 'lucide-react'
|
||||
import { MailWarning, Ticket, UserPlus } from 'lucide-react'
|
||||
import { useOrg } from '@components/Contexts/OrgContext'
|
||||
import UserAvatar from '@components/Objects/UserAvatar'
|
||||
import OpenSignUpComponent from './OpenSignup'
|
||||
|
|
@ -33,9 +33,6 @@ function SignUpClient(props: SignUpClientProps) {
|
|||
setJoinMethod(
|
||||
props.org?.config?.config?.GeneralConfig.users.signup_mechanism
|
||||
)
|
||||
console.log(
|
||||
props.org?.config?.config?.GeneralConfig.users.signup_mechanism
|
||||
)
|
||||
}
|
||||
if (inviteCodeParam) {
|
||||
setInviteCode(inviteCodeParam)
|
||||
|
|
|
|||
|
|
@ -13,17 +13,14 @@ function useGetAIFeatures(props: UseGetAIFeatures) {
|
|||
const config = org?.config?.config?.AIConfig
|
||||
|
||||
if (!config) {
|
||||
console.log('AI or Organization config is not defined.')
|
||||
return false
|
||||
}
|
||||
|
||||
if (!config.enabled) {
|
||||
console.log('AI is not enabled for this Organization.')
|
||||
return false
|
||||
}
|
||||
|
||||
if (!config.features[feature]) {
|
||||
console.log(`Feature ${feature} is not enabled for this Organization.`)
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import Modal from '@components/StyledElements/Modal/Modal'
|
|||
import { getAPIUrl } from '@services/config/config'
|
||||
import { unLinkResourcesToUserGroup } from '@services/usergroups/usergroups'
|
||||
import { swrFetcher } from '@services/utils/ts/requests'
|
||||
import { Globe, SquareUserRound, Users, UsersRound, X } from 'lucide-react'
|
||||
import { Globe, SquareUserRound, Users, X } from 'lucide-react'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
import React from 'react'
|
||||
import toast from 'react-hot-toast'
|
||||
|
|
@ -122,9 +122,11 @@ function EditCourseAccess(props: EditCourseAccessProps) {
|
|||
function UserGroupsSection({ usergroups }: { usergroups: any[] }) {
|
||||
const course = useCourse() as any
|
||||
const [userGroupModal, setUserGroupModal] = React.useState(false)
|
||||
const session = useLHSession() as any;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
|
||||
const removeUserGroupLink = async (usergroup_id: number) => {
|
||||
const res = await unLinkResourcesToUserGroup(usergroup_id, course.courseStructure.course_uuid)
|
||||
const res = await unLinkResourcesToUserGroup(usergroup_id, course.courseStructure.course_uuid,access_token)
|
||||
if (res.status === 200) {
|
||||
toast.success('Successfully unliked from usergroup')
|
||||
mutate(`${getAPIUrl()}usergroups/resource/${course.courseStructure.course_uuid}`)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import FormLayout, {
|
|||
} from '@components/StyledElements/Form/Form'
|
||||
import { useFormik } from 'formik'
|
||||
import { AlertTriangle } from 'lucide-react'
|
||||
import * as Switch from '@radix-ui/react-switch'
|
||||
import * as Form from '@radix-ui/react-form'
|
||||
import React from 'react'
|
||||
import { useCourse, useCourseDispatch } from '../../../Contexts/CourseContext'
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { mutate } from 'swr'
|
|||
|
||||
function ThumbnailUpdate() {
|
||||
const course = useCourse() as any
|
||||
const session = useLHSession()
|
||||
const session = useLHSession() as any;
|
||||
const org = useOrg() as any
|
||||
const [localThumbnail, setLocalThumbnail] = React.useState(null) as any
|
||||
const [isLoading, setIsLoading] = React.useState(false) as any
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import { UploadCloud } from 'lucide-react'
|
|||
import { revalidateTags } from '@services/utils/ts/requests'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { useOrg } from '@components/Contexts/OrgContext'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
|
||||
interface OrganizationValues {
|
||||
name: string
|
||||
|
|
@ -20,7 +21,9 @@ interface OrganizationValues {
|
|||
|
||||
function OrgEditGeneral(props: any) {
|
||||
const [selectedFile, setSelectedFile] = useState<File | null>(null)
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
const session = useLHSession() as any;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
const org = useOrg() as any
|
||||
// ...
|
||||
|
||||
|
|
@ -34,7 +37,7 @@ function OrgEditGeneral(props: any) {
|
|||
const uploadLogo = async () => {
|
||||
if (selectedFile) {
|
||||
let org_id = org.id
|
||||
await uploadOrganizationLogo(org_id, selectedFile)
|
||||
await uploadOrganizationLogo(org_id, selectedFile, access_token)
|
||||
setSelectedFile(null) // Reset the selected file
|
||||
await revalidateTags(['organizations'], org.slug)
|
||||
router.refresh()
|
||||
|
|
@ -51,14 +54,14 @@ function OrgEditGeneral(props: any) {
|
|||
|
||||
const updateOrg = async (values: OrganizationValues) => {
|
||||
let org_id = org.id
|
||||
await updateOrganization(org_id, values)
|
||||
await updateOrganization(org_id, values, access_token)
|
||||
|
||||
// Mutate the org
|
||||
await revalidateTags(['organizations'], org.slug)
|
||||
router.refresh()
|
||||
}
|
||||
|
||||
useEffect(() => {}, [org])
|
||||
useEffect(() => { }, [org])
|
||||
|
||||
return (
|
||||
<div className="ml-10 mr-10 mx-auto bg-white rounded-xl shadow-sm px-6 py-5">
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div className="ml-10 mr-10 mx-auto bg-white rounded-xl shadow-sm px-6 py-5">
|
||||
|
|
@ -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)
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div className="ml-10 mr-10 mx-auto bg-white rounded-xl shadow-sm px-6 py-5">
|
||||
|
|
|
|||
|
|
@ -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}`)
|
||||
|
|
|
|||
|
|
@ -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}`)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
|||
/>
|
||||
</div>
|
||||
<div
|
||||
className={`flex space-x-2 items-center -ml-[100px] ${
|
||||
aiChatBotState.isWaitingForResponse ? 'animate-pulse' : ''
|
||||
}`}
|
||||
className={`flex space-x-2 items-center -ml-[100px] ${aiChatBotState.isWaitingForResponse ? 'animate-pulse' : ''
|
||||
}`}
|
||||
>
|
||||
<Image
|
||||
className={`outline outline-1 outline-neutral-200/20 rounded-lg ${
|
||||
aiChatBotState.isWaitingForResponse ? 'animate-pulse' : ''
|
||||
}`}
|
||||
className={`outline outline-1 outline-neutral-200/20 rounded-lg ${aiChatBotState.isWaitingForResponse ? 'animate-pulse' : ''
|
||||
}`}
|
||||
width={24}
|
||||
src={learnhouseAI_icon}
|
||||
alt=""
|
||||
|
|
@ -244,12 +245,11 @@ function ActivityChatMessageBox(props: ActivityChatMessageBoxProps) {
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={`w-100 h-0.5 bg-white/5 rounded-full mx-auto mb-3 ${
|
||||
aiChatBotState.isWaitingForResponse ? 'animate-pulse' : ''
|
||||
}`}
|
||||
className={`w-100 h-0.5 bg-white/5 rounded-full mx-auto mb-3 ${aiChatBotState.isWaitingForResponse ? 'animate-pulse' : ''
|
||||
}`}
|
||||
></div>
|
||||
{aiChatBotState.messages.length > 0 &&
|
||||
!aiChatBotState.error.isError ? (
|
||||
!aiChatBotState.error.isError ? (
|
||||
<div className="flex-col h-[237px] w-full space-y-4 overflow-scroll scrollbar-w-2 scrollbar scrollbar-thumb-white/20 scrollbar-thumb-rounded-full scrollbar-track-rounded-full">
|
||||
{aiChatBotState.messages.map(
|
||||
(message: AIMessage, index: number) => {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ function DocumentPdfActivity({
|
|||
const org = useOrg() as any
|
||||
|
||||
React.useEffect(() => {
|
||||
console.log(activity)
|
||||
}, [activity, org])
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div className="flex space-x-2">
|
||||
<ToolTip sideOffset={10} slateBlack content={tooltipLabel}>
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<HTMLInputElement>) => {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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<HocuspocusProvider | null>(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: <b>Activity saved!</b>,
|
||||
error: <b>Could not save.</b>,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<NodeViewWrapper className="block-pdf">
|
||||
|
|
|
|||
|
|
@ -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!')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<NodeViewWrapper className="block-video">
|
||||
|
|
@ -98,7 +101,7 @@ function VideoBlockComponents(props: any) {
|
|||
)
|
||||
}
|
||||
const BlockVideoWrapper = styled.div`
|
||||
//border: ${(props) =>
|
||||
border: ${(props) =>
|
||||
props.contentEditable ? '2px dashed #713f1117' : 'none'};
|
||||
|
||||
// center
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
|
|
@ -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<any>) => {
|
||||
setVisibility(event.target.value)
|
||||
console.log(visibility)
|
||||
}
|
||||
|
||||
const handleTagsChange = (event: React.ChangeEvent<any>) => {
|
||||
|
|
|
|||
|
|
@ -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) {
|
|||
<h1 className=' font-medium'>Users that are not part of the UserGroup will no longer have access to this course</h1>
|
||||
</div>
|
||||
<div className='p-4 flex-row flex justify-between items-center'>
|
||||
|
||||
<div className='py-1'>
|
||||
<span className='px-3 text-gray-400 font-bold rounded-full py-1 bg-gray-100 mx-3'>UserGroup Name </span>
|
||||
<select
|
||||
onChange={(e) => setSelectedUserGroup(e.target.value)}
|
||||
defaultValue={selectedUserGroup}
|
||||
>
|
||||
{usergroups && usergroups.map((group: any) => (
|
||||
<option key={group.id} value={group.id}>{group.name}</option>
|
||||
))}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div className='py-3'>
|
||||
<button onClick={() => { handleLink() }} className='bg-green-700 text-white font-bold px-4 py-2 rounded-md shadow'>Link</button>
|
||||
<div className='py-1'>
|
||||
<span className='px-3 text-gray-400 font-bold rounded-full py-1 bg-gray-100 mx-3'>UserGroup Name </span>
|
||||
<select
|
||||
onChange={(e) => setSelectedUserGroup(e.target.value)}
|
||||
defaultValue={selectedUserGroup}
|
||||
>
|
||||
{usergroups && usergroups.map((group: any) => (
|
||||
<option key={group.id} value={group.id}>{group.name}</option>
|
||||
))}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div className='py-3'>
|
||||
<button onClick={() => { handleLink() }} className='bg-green-700 text-white font-bold px-4 py-2 rounded-md shadow'>Link</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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}`)
|
||||
|
|
|
|||
|
|
@ -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`)
|
||||
|
|
|
|||
|
|
@ -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`)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function CollectionThumbnail(props: PropsType) {
|
|||
href={getUriWithOrg(
|
||||
props.orgslug,
|
||||
'/collection/' +
|
||||
removeCollectionPrefix(props.collection.collection_uuid)
|
||||
removeCollectionPrefix(props.collection.collection_uuid)
|
||||
)}
|
||||
>
|
||||
<div
|
||||
|
|
@ -55,7 +55,7 @@ function CollectionThumbnail(props: PropsType) {
|
|||
href={getUriWithOrg(
|
||||
props.orgslug,
|
||||
'/collection/' +
|
||||
removeCollectionPrefix(props.collection.collection_uuid)
|
||||
removeCollectionPrefix(props.collection.collection_uuid)
|
||||
)}
|
||||
>
|
||||
<h1 className="font-bold text-md justify-center">
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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<AuthorizationProps> = ({ 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<AuthorizationProps> = ({ children, authorizat
|
|||
if (loading) {
|
||||
return (
|
||||
<div className="flex justify-center items-center h-screen">
|
||||
<h1 className="text-2xl">Loading...</h1>
|
||||
<PageLoading />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ export const HeaderProfileBox = () => {
|
|||
const session = useLHSession() as any
|
||||
const isUserAdmin = useAdminStatus() as any
|
||||
|
||||
useEffect(() => {
|
||||
console.log(session)
|
||||
}
|
||||
useEffect(() => {}
|
||||
, [session])
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import { getAPIUrl } from '@services/config/config'
|
||||
import {
|
||||
RequestBody,
|
||||
RequestBodyForm,
|
||||
RequestBodyFormWithAuthHeader,
|
||||
RequestBodyWithAuthHeader,
|
||||
errorHandling,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { getAPIUrl } from '@services/config/config'
|
||||
import {
|
||||
RequestBody,
|
||||
RequestBodyWithAuthHeader,
|
||||
getResponseMetadata,
|
||||
} from '@services/utils/ts/requests'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { getAPIUrl } from '@services/config/config'
|
||||
import {
|
||||
RequestBody,
|
||||
RequestBodyWithAuthHeader,
|
||||
getResponseMetadata,
|
||||
} from '@services/utils/ts/requests'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export const RequestBodyWithAuthHeader = (
|
|||
method: string,
|
||||
data: any,
|
||||
next: any,
|
||||
token: string
|
||||
token?: string
|
||||
) => {
|
||||
let HeadersConfig = new Headers(
|
||||
token
|
||||
|
|
|
|||
1
apps/web/types/next-auth.d.ts
vendored
1
apps/web/types/next-auth.d.ts
vendored
|
|
@ -1,3 +1,4 @@
|
|||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import type { NextAuthOptions } from 'next-auth/index';
|
||||
|
||||
// next-auth.d.ts
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
135
pnpm-lock.yaml
generated
135
pnpm-lock.yaml
generated
|
|
@ -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: {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue