mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Working on role in workspace.
This commit is contained in:
+10
-6
@@ -117,14 +117,18 @@ export const {handlers, auth: baseAuth, signIn, signOut} = NextAuth({
|
||||
|
||||
const defaultOrganization = await prisma.organization.findUnique({
|
||||
where: {slug: "default"},
|
||||
include: {users: {}}
|
||||
});
|
||||
|
||||
await prisma.userOrganization.create({
|
||||
data: {
|
||||
userId: newUser.id,
|
||||
organizationId: defaultOrganization.id
|
||||
},
|
||||
});
|
||||
const organizationRole = defaultOrganization.users.length > 0 ? "member" : "admin"
|
||||
|
||||
await prisma.userOrganization.create({
|
||||
data: {
|
||||
userId: newUser.id,
|
||||
organizationId: defaultOrganization.id,
|
||||
role: organizationRole
|
||||
},
|
||||
});
|
||||
|
||||
return role !== "pending";
|
||||
|
||||
|
||||
@@ -32,10 +32,13 @@ export const registerUserAction = action
|
||||
where: {slug: "default"},
|
||||
});
|
||||
|
||||
const organizationRole = users.length > 0 ? "member" : "admin"
|
||||
|
||||
await prisma.userOrganization.create({
|
||||
data: {
|
||||
userId: newUser.id,
|
||||
organizationId: defaultOrganization.id
|
||||
organizationId: defaultOrganization.id,
|
||||
role:organizationRole
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {flexRender, Row, RowData} from "@tanstack/react-table";
|
||||
|
||||
import {User} from "@prisma/client";
|
||||
import {User, UserOrganization} from "@prisma/client";
|
||||
import {DataTableWithPagination} from "@/components/wrappers/common/table/data-table-with-pagination";
|
||||
import {Table, TableBody, TableCell, TableHead, TableHeader, TableRow} from "@/components/ui/table";
|
||||
import {cn} from "@/lib/utils";
|
||||
@@ -23,7 +23,7 @@ export const AdminUsersTable = (props: AdminUsersTableProps) => {
|
||||
<DataTableWithPagination
|
||||
columns={usersColumnsAdmin}
|
||||
data={users}
|
||||
DataTable={UsersDataTable}
|
||||
DataTable={UsersDataTableAdmin}
|
||||
dataTableProps={{currentUser}}
|
||||
/>
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@ export type usersDataTableProps = {
|
||||
table: any,
|
||||
}
|
||||
|
||||
export const UsersDataTable = ({currentUser, table}: usersDataTableProps) => {
|
||||
export const UsersDataTableAdmin = ({currentUser, table}: usersDataTableProps) => {
|
||||
|
||||
return (
|
||||
<div className="rounded-md border w-full ">
|
||||
@@ -62,22 +62,26 @@ export const UsersDataTable = ({currentUser, table}: usersDataTableProps) => {
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{table.getRowModel().rows?.length ? (
|
||||
table.getRowModel().rows.map((row: Row<User>) => (
|
||||
<TableRow
|
||||
className={cn(row.original.id === currentUser.id ? "opacity-40 pointer-events-none" : "")}
|
||||
key={row.id}
|
||||
data-state={row.getIsSelected() && "selected"}
|
||||
>
|
||||
{row.getVisibleCells().map((cell) => (
|
||||
<TableCell key={cell.id}>
|
||||
{flexRender(
|
||||
cell.column.columnDef.cell,
|
||||
cell.getContext(),
|
||||
)}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
))) : (
|
||||
table.getRowModel().rows.map((row: Row<User>) => {
|
||||
return(
|
||||
<TableRow
|
||||
className={cn((row.original.id) === currentUser.id ? "opacity-40 pointer-events-none" : "")}
|
||||
key={row.id}
|
||||
data-state={row.getIsSelected() && "selected"}
|
||||
>
|
||||
{row.getVisibleCells().map((cell) => (
|
||||
<TableCell key={cell.id}>
|
||||
{flexRender(
|
||||
cell.column.columnDef.cell,
|
||||
cell.getContext(),
|
||||
)}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
)
|
||||
}
|
||||
|
||||
)) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={table.getAllColumns().length} className="h-24 text-center">
|
||||
No results.
|
||||
|
||||
@@ -14,7 +14,7 @@ export const LoggedInButton = async () => {
|
||||
|
||||
|
||||
return (
|
||||
<LoggedInDropdown>
|
||||
<LoggedInDropdown user={user}>
|
||||
<SidebarMenuButton>
|
||||
<Avatar className="size-6">
|
||||
<AvatarFallback>{user.name?.[0]}</AvatarFallback>
|
||||
|
||||
@@ -5,8 +5,11 @@ import {DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger
|
||||
import {signOutAction} from "@/features/auth/auth.action";
|
||||
import {redirect} from "next/navigation";
|
||||
import {CircleUser, LogOut, ShieldHalf} from "lucide-react";
|
||||
import {User} from "@prisma/client";
|
||||
|
||||
export type LoggedInDropdownProps = PropsWithChildren<{}>
|
||||
export type LoggedInDropdownProps = PropsWithChildren<{
|
||||
user: User
|
||||
}>
|
||||
|
||||
export const LoggedInDropdown = (props: LoggedInDropdownProps) => {
|
||||
|
||||
@@ -27,14 +30,16 @@ export const LoggedInDropdown = (props: LoggedInDropdownProps) => {
|
||||
<span>Account</span>
|
||||
</div>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => {
|
||||
redirect("/dashboard/admin")
|
||||
}}>
|
||||
<div className="flex justify-start items-center gap-2">
|
||||
<ShieldHalf size={16}/>
|
||||
<span>Administration Panel</span>
|
||||
</div>
|
||||
</DropdownMenuItem>
|
||||
{props.user.role == "admin" ?
|
||||
<DropdownMenuItem onClick={() => {
|
||||
redirect("/dashboard/admin")
|
||||
}}>
|
||||
<div className="flex justify-start items-center gap-2">
|
||||
<ShieldHalf size={16}/>
|
||||
<span>Administration Panel</span>
|
||||
</div>
|
||||
</DropdownMenuItem>
|
||||
: null}
|
||||
<DropdownMenuItem onClick={() => {
|
||||
signOutAction()
|
||||
}}>
|
||||
|
||||
@@ -44,7 +44,8 @@ export const createOrganizationAction = userAction
|
||||
await prisma.userOrganization.create({
|
||||
data: {
|
||||
userId: ctx.user.id,
|
||||
organizationId: organization.id
|
||||
organizationId: organization.id,
|
||||
role: "admin"
|
||||
},
|
||||
});
|
||||
|
||||
@@ -113,6 +114,7 @@ export const updateOrganizationAction = userAction
|
||||
data: usersToAdd.map((userId) => ({
|
||||
userId: userId,
|
||||
organizationId: organization.id,
|
||||
role: "member"
|
||||
})),
|
||||
skipDuplicates: true, // Optional: to avoid duplicate insertion errors
|
||||
});
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ export const ButtonDeleteProject = (props: ButtonDeleteProjectProps) => {
|
||||
const mutation = useMutation({
|
||||
mutationFn: () => deleteProjectAction(props.projectId),
|
||||
onSuccess: async (result) => {
|
||||
router.push("/dashboard/projects")
|
||||
router.push("/dashboard")
|
||||
if(result.data.success) {
|
||||
toast.success(result.data.actionSuccess.message);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
"use client"
|
||||
|
||||
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs";
|
||||
import {DataTableWithPagination} from "@/components/wrappers/common/table/data-table-with-pagination";
|
||||
import {usersColumns} from "@/components/wrappers/dashboard/settings/SettingsUsersTab/columns-users-settings";
|
||||
import {User, Settings} from "@prisma/client";
|
||||
import {backupColumns} from "@/features/backup/columns";
|
||||
import {SettingsEmailTab} from "@/components/wrappers/dashboard/admin/AdminEmailTab/SettingsEmailTab";
|
||||
import {SettingsStorageTab} from "@/components/wrappers/dashboard/admin/AdminStorageTab/SettingsStorageTab";
|
||||
import {User, Settings, UserOrganization} from "@prisma/client";
|
||||
import {SettingsUsersTab} from "@/components/wrappers/dashboard/settings/SettingsUsersTab/SettingsUsersTab";
|
||||
|
||||
|
||||
export type SettingsTabsProps = {
|
||||
currentUser: User;
|
||||
users: User[];
|
||||
users: UserOrganization[];
|
||||
settings: Settings;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import {User} from "@prisma/client";
|
||||
import {User, UserOrganization} from "@prisma/client";
|
||||
import {DataTableWithPagination} from "@/components/wrappers/common/table/data-table-with-pagination";
|
||||
import {usersColumns} from "@/components/wrappers/dashboard/settings/SettingsUsersTab/columns-users-settings";
|
||||
import {UsersDataTable} from "@/components/wrappers/dashboard/admin/admin-user-table";
|
||||
import {Table, TableBody, TableCell, TableHead, TableHeader, TableRow} from "@/components/ui/table";
|
||||
import {flexRender, Row} from "@tanstack/react-table";
|
||||
import {cn} from "@/lib/utils";
|
||||
|
||||
|
||||
export type SettingsUsersTabProps = {
|
||||
currentUser: User;
|
||||
users: User[]
|
||||
users: UserOrganization[]
|
||||
}
|
||||
|
||||
export const SettingsUsersTab = (props: SettingsUsersTabProps) => {
|
||||
@@ -28,4 +30,68 @@ export const SettingsUsersTab = (props: SettingsUsersTabProps) => {
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type usersDataTableProps = {
|
||||
currentUser: User;
|
||||
table: any,
|
||||
}
|
||||
|
||||
export const UsersDataTable = ({currentUser, table}: usersDataTableProps) => {
|
||||
|
||||
return (
|
||||
<div className="rounded-md border w-full ">
|
||||
<Table className="w-full">
|
||||
<TableHeader>
|
||||
{table.getHeaderGroups().map((headerGroup) => (
|
||||
<TableRow key={headerGroup.id}>
|
||||
{headerGroup.headers.map((header) => {
|
||||
return (
|
||||
<TableHead key={header.id}>
|
||||
{header.isPlaceholder
|
||||
? null
|
||||
: flexRender(
|
||||
header.column.columnDef.header,
|
||||
header.getContext()
|
||||
)}
|
||||
</TableHead>
|
||||
)
|
||||
})}
|
||||
</TableRow>
|
||||
))}
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{table.getRowModel().rows?.length ? (
|
||||
table.getRowModel().rows.map((row: Row<UserOrganization>) => {
|
||||
return(
|
||||
<TableRow
|
||||
className={cn((row.original.userId) === currentUser.id ? "opacity-40 pointer-events-none" : "")}
|
||||
key={row.id}
|
||||
data-state={row.getIsSelected() && "selected"}
|
||||
>
|
||||
{row.getVisibleCells().map((cell) => (
|
||||
<TableCell key={cell.id}>
|
||||
{flexRender(
|
||||
cell.column.columnDef.cell,
|
||||
cell.getContext(),
|
||||
)}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
)
|
||||
}
|
||||
|
||||
)) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={table.getAllColumns().length} className="h-24 text-center">
|
||||
No results.
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
+18
-18
@@ -2,7 +2,7 @@
|
||||
|
||||
import {ColumnDef} from "@tanstack/react-table"
|
||||
import {Badge} from "@/components/ui/badge";
|
||||
import {User} from "@prisma/client";
|
||||
import {User, UserOrganization} from "@prisma/client";
|
||||
import {updateUserAction} from "@/components/wrappers/dashboard/profile/UserForm/user-form.action";
|
||||
import {useMutation} from "@tanstack/react-query";
|
||||
import {toast} from "sonner";
|
||||
@@ -12,7 +12,7 @@ import {Trash2} from "lucide-react";
|
||||
import {deleteUserAction} from "@/components/wrappers/dashboard/profile/ButtonDeleteAccount/delete-account.action";
|
||||
import {ButtonWithLoading} from "@/components/wrappers/common/button/button-with-loading";
|
||||
|
||||
export const usersColumns: ColumnDef<User>[] = [
|
||||
export const usersColumns: ColumnDef<UserOrganization>[] = [
|
||||
{
|
||||
accessorKey: "role",
|
||||
header: "Role",
|
||||
@@ -20,24 +20,24 @@ export const usersColumns: ColumnDef<User>[] = [
|
||||
const router = useRouter();
|
||||
const [role, setRole] = useState<string>(row.getValue("role"))
|
||||
|
||||
const updateMutation = useMutation({
|
||||
mutationFn: () => updateUserAction({id: row.original.id, data: {role: role}}),
|
||||
onSuccess: () => {
|
||||
toast.success(`User updated successfully.`);
|
||||
router.refresh()
|
||||
|
||||
},
|
||||
onError: () => {
|
||||
toast.error(`An error occurred while updating user information.`);
|
||||
},
|
||||
});
|
||||
// const updateMutation = useMutation({
|
||||
// mutationFn: () => updateUserAction({id: row.original.id, data: {role: role}}),
|
||||
// onSuccess: () => {
|
||||
// toast.success(`User updated successfully.`);
|
||||
// router.refresh()
|
||||
//
|
||||
// },
|
||||
// onError: () => {
|
||||
// toast.error(`An error occurred while updating user information.`);
|
||||
// },
|
||||
// });
|
||||
|
||||
const handleUpdateRole = async () => {
|
||||
const nextRole = role === "admin" ? "pending"
|
||||
: role === "pending" ? "user"
|
||||
const nextRole = role === "admin" ? "member"
|
||||
: role === "member" ? "user"
|
||||
: "admin";
|
||||
setRole(nextRole);
|
||||
await updateMutation.mutateAsync()
|
||||
// await updateMutation.mutateAsync()
|
||||
};
|
||||
|
||||
return <Badge
|
||||
@@ -47,11 +47,11 @@ export const usersColumns: ColumnDef<User>[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: "name",
|
||||
accessorKey: "user.name",
|
||||
header: "Name"
|
||||
},
|
||||
{
|
||||
accessorKey: "email",
|
||||
accessorKey: "user.email",
|
||||
header: "Email"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -7,9 +7,11 @@ import {cn} from "@/lib/utils";
|
||||
import {buttonVariants} from "@/components/ui/button";
|
||||
import {ChartArea, Layers, Settings, ShieldHalf} from "lucide-react";
|
||||
import {usePathname} from "next/navigation";
|
||||
import {UserOrganization} from "@prisma/client";
|
||||
|
||||
export type SidebarMenuCustomProps = {
|
||||
currentOrganizationSlug: string
|
||||
currentOrganizationSlug: string,
|
||||
currentOrganizationUser: UserOrganization,
|
||||
}
|
||||
|
||||
export const SidebarMenuCustom = (props: SidebarMenuCustomProps) => {
|
||||
@@ -27,13 +29,17 @@ export const SidebarMenuCustom = (props: SidebarMenuCustomProps) => {
|
||||
title: "Statistics",
|
||||
url: "statistics",
|
||||
icon: ChartArea,
|
||||
},
|
||||
{
|
||||
}
|
||||
]
|
||||
|
||||
if (props.currentOrganizationUser.role === "admin") {
|
||||
items.push({
|
||||
title: "Settings",
|
||||
url: "settings",
|
||||
icon: Settings,
|
||||
},
|
||||
]
|
||||
},)
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const currentUrl = pathname;
|
||||
|
||||
@@ -37,6 +37,15 @@ export async function AppSidebar() {
|
||||
})
|
||||
|
||||
|
||||
const currentOrganizationUser = await prisma.userOrganization.findFirst({
|
||||
where:{
|
||||
userId: user.id,
|
||||
organization:{
|
||||
slug: currentOrganizationSlug != "" ? currentOrganizationSlug : "default",
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return (
|
||||
<Sidebar collapsible="icon">
|
||||
@@ -57,7 +66,7 @@ export async function AppSidebar() {
|
||||
<SidebarGroup>
|
||||
<SidebarGroupLabel>Application</SidebarGroupLabel>
|
||||
<SidebarGroupContent>
|
||||
<SidebarMenuCustom currentOrganizationSlug={currentOrganizationSlug}/>
|
||||
<SidebarMenuCustom currentOrganizationUser={currentOrganizationUser} currentOrganizationSlug={currentOrganizationSlug}/>
|
||||
</SidebarGroupContent>
|
||||
</SidebarGroup>
|
||||
{user.role == "admin" ?
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import {redirect} from "next/navigation";
|
||||
import {signIn, signOut} from "@/auth/auth";
|
||||
import {getServerUrl} from "@/utils/get-server-url";
|
||||
import {deleteOrganizationCookie} from "@/features/dashboard/organization-cookie";
|
||||
//
|
||||
// const baseUrl = getServerUrl();
|
||||
// async function fetchCsrfToken() {
|
||||
@@ -35,13 +36,23 @@ import {getServerUrl} from "@/utils/get-server-url";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
export const signOutAction = async () => {
|
||||
// await manualSignOut()
|
||||
await signOut({redirectTo: '/', redirect: true})
|
||||
window.location.reload();
|
||||
}
|
||||
const deleteCookieResponse = await deleteOrganizationCookie();
|
||||
await signOut({ redirectTo: '/', redirect: true });
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
return deleteCookieResponse;
|
||||
};
|
||||
//
|
||||
// export const signOutAction = async () => {
|
||||
// // await manualSignOut()
|
||||
// await signOut({redirectTo: '/', redirect: true})
|
||||
// await deleteOrganizationCookie()
|
||||
// window.location.reload();
|
||||
// }
|
||||
export const signInAction = async (type: string, formData?: any) => {
|
||||
if (type === "google") {
|
||||
await signIn(type, {redirectTo: '/dashboard'})
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import {cookies} from 'next/headers';
|
||||
|
||||
|
||||
const COOKIE_NAME = 'PORTABASE_ORGANIZATION_SLUG';
|
||||
|
||||
export async function getCurrentOrganizationSlug() {
|
||||
@@ -11,4 +10,8 @@ export async function getCurrentOrganizationSlug() {
|
||||
|
||||
export async function setCurrentOrganizationSlug(slug: string) {
|
||||
return (await cookies()).set(COOKIE_NAME, slug).get(COOKIE_NAME)?.value;
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteOrganizationCookie() {
|
||||
return (await cookies()).delete(COOKIE_NAME);
|
||||
}
|
||||
|
||||
@@ -346,6 +346,9 @@ const metadata = {
|
||||
backLink: 'users',
|
||||
isRelationOwner: true,
|
||||
foreignKeyMapping: { "id": "organizationId" },
|
||||
}, role: {
|
||||
name: "role",
|
||||
type: "OrganizationRole",
|
||||
},
|
||||
}
|
||||
, uniqueConstraints: {
|
||||
|
||||
@@ -327,8 +327,9 @@ export function useSuspenseCountUserOrganization<TArgs extends Prisma.UserOrgani
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useSuspenseModelQuery<TQueryFnData, TData, TError>('UserOrganization', `${endpoint}/userOrganization/count`, args, options, fetch);
|
||||
}
|
||||
import type { OrganizationRole } from '@prisma/client';
|
||||
|
||||
export function useCheckUserOrganization<TError = DefaultError>(args: { operation: PolicyCrudKind; where?: { id?: string; userId?: string; organizationId?: string }; }, options?: (Omit<UseQueryOptions<boolean, TError, boolean>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
export function useCheckUserOrganization<TError = DefaultError>(args: { operation: PolicyCrudKind; where?: { id?: string; userId?: string; organizationId?: string; role?: OrganizationRole }; }, options?: (Omit<UseQueryOptions<boolean, TError, boolean>, 'queryKey'> & ExtraQueryOptions)) {
|
||||
const { endpoint, fetch } = getHooksContext();
|
||||
return useModelQuery<boolean, boolean, TError>('UserOrganization', `${endpoint}/userOrganization/check`, args, options, fetch);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,11 @@ components:
|
||||
- pending
|
||||
- user
|
||||
- admin
|
||||
OrganizationRole:
|
||||
type: string
|
||||
enum:
|
||||
- member
|
||||
- admin
|
||||
Dbms:
|
||||
type: string
|
||||
enum:
|
||||
@@ -119,6 +124,7 @@ components:
|
||||
- updatedAt
|
||||
- userId
|
||||
- organizationId
|
||||
- role
|
||||
ProjectScalarFieldEnum:
|
||||
type: string
|
||||
enum:
|
||||
@@ -434,6 +440,8 @@ components:
|
||||
$ref: "#/components/schemas/User"
|
||||
organization:
|
||||
$ref: "#/components/schemas/Organization"
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
required:
|
||||
- id
|
||||
- createdAt
|
||||
@@ -441,6 +449,7 @@ components:
|
||||
- organizationId
|
||||
- user
|
||||
- organization
|
||||
- role
|
||||
Project:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1823,6 +1832,10 @@ components:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/StringFilter"
|
||||
- type: string
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFilter"
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
user:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/UserScalarRelationFilter"
|
||||
@@ -1846,6 +1859,8 @@ components:
|
||||
$ref: "#/components/schemas/SortOrder"
|
||||
organizationId:
|
||||
$ref: "#/components/schemas/SortOrder"
|
||||
role:
|
||||
$ref: "#/components/schemas/SortOrder"
|
||||
user:
|
||||
$ref: "#/components/schemas/UserOrderByWithRelationInput"
|
||||
organization:
|
||||
@@ -1893,6 +1908,10 @@ components:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/StringFilter"
|
||||
- type: string
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFilter"
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
user:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/UserScalarRelationFilter"
|
||||
@@ -1943,6 +1962,10 @@ components:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/StringWithAggregatesFilter"
|
||||
- type: string
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleWithAggregatesFilter"
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
ProjectWhereInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -4093,11 +4116,14 @@ components:
|
||||
- type: "null"
|
||||
- type: string
|
||||
format: date-time
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
user:
|
||||
$ref: "#/components/schemas/UserCreateNestedOneWithoutOrganizationsInput"
|
||||
organization:
|
||||
$ref: "#/components/schemas/OrganizationCreateNestedOneWithoutUsersInput"
|
||||
required:
|
||||
- role
|
||||
- user
|
||||
- organization
|
||||
UserOrganizationUpdateInput:
|
||||
@@ -4118,6 +4144,10 @@ components:
|
||||
format: date-time
|
||||
- $ref: "#/components/schemas/NullableDateTimeFieldUpdateOperationsInput"
|
||||
- type: "null"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
user:
|
||||
$ref: "#/components/schemas/UserUpdateOneRequiredWithoutOrganizationsNestedInpu\
|
||||
t"
|
||||
@@ -4141,9 +4171,12 @@ components:
|
||||
type: string
|
||||
organizationId:
|
||||
type: string
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
required:
|
||||
- userId
|
||||
- organizationId
|
||||
- role
|
||||
UserOrganizationUpdateManyMutationInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -4162,6 +4195,10 @@ components:
|
||||
format: date-time
|
||||
- $ref: "#/components/schemas/NullableDateTimeFieldUpdateOperationsInput"
|
||||
- type: "null"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
ProjectCreateInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -5642,6 +5679,23 @@ components:
|
||||
properties:
|
||||
_count:
|
||||
$ref: "#/components/schemas/SortOrder"
|
||||
EnumOrganizationRoleFilter:
|
||||
type: object
|
||||
properties:
|
||||
equals:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
notIn:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
not:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/NestedEnumOrganizationRoleFilter"
|
||||
OrganizationScalarRelationFilter:
|
||||
type: object
|
||||
properties:
|
||||
@@ -5659,6 +5713,29 @@ components:
|
||||
required:
|
||||
- userId
|
||||
- organizationId
|
||||
EnumOrganizationRoleWithAggregatesFilter:
|
||||
type: object
|
||||
properties:
|
||||
equals:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
notIn:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
not:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/NestedEnumOrganizationRoleWithAggregatesFilter"
|
||||
_count:
|
||||
$ref: "#/components/schemas/NestedIntFilter"
|
||||
_min:
|
||||
$ref: "#/components/schemas/NestedEnumOrganizationRoleFilter"
|
||||
_max:
|
||||
$ref: "#/components/schemas/NestedEnumOrganizationRoleFilter"
|
||||
BoolFilter:
|
||||
type: object
|
||||
properties:
|
||||
@@ -7025,6 +7102,11 @@ components:
|
||||
$ref: "#/components/schemas/OrganizationCreateOrConnectWithoutUsersInput"
|
||||
connect:
|
||||
$ref: "#/components/schemas/OrganizationWhereUniqueInput"
|
||||
EnumOrganizationRoleFieldUpdateOperationsInput:
|
||||
type: object
|
||||
properties:
|
||||
set:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
UserUpdateOneRequiredWithoutOrganizationsNestedInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -8654,6 +8736,46 @@ components:
|
||||
$ref: "#/components/schemas/NestedBoolNullableFilter"
|
||||
_max:
|
||||
$ref: "#/components/schemas/NestedBoolNullableFilter"
|
||||
NestedEnumOrganizationRoleFilter:
|
||||
type: object
|
||||
properties:
|
||||
equals:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
notIn:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
not:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/NestedEnumOrganizationRoleFilter"
|
||||
NestedEnumOrganizationRoleWithAggregatesFilter:
|
||||
type: object
|
||||
properties:
|
||||
equals:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
notIn:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
not:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/NestedEnumOrganizationRoleWithAggregatesFilter"
|
||||
_count:
|
||||
$ref: "#/components/schemas/NestedIntFilter"
|
||||
_min:
|
||||
$ref: "#/components/schemas/NestedEnumOrganizationRoleFilter"
|
||||
_max:
|
||||
$ref: "#/components/schemas/NestedEnumOrganizationRoleFilter"
|
||||
NestedBoolFilter:
|
||||
type: object
|
||||
properties:
|
||||
@@ -9535,9 +9657,12 @@ components:
|
||||
- type: "null"
|
||||
- type: string
|
||||
format: date-time
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
organization:
|
||||
$ref: "#/components/schemas/OrganizationCreateNestedOneWithoutUsersInput"
|
||||
required:
|
||||
- role
|
||||
- organization
|
||||
UserOrganizationUncheckedCreateWithoutUserInput:
|
||||
type: object
|
||||
@@ -9554,8 +9679,11 @@ components:
|
||||
format: date-time
|
||||
organizationId:
|
||||
type: string
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
required:
|
||||
- organizationId
|
||||
- role
|
||||
UserOrganizationCreateOrConnectWithoutUserInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -9878,6 +10006,10 @@ components:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/StringFilter"
|
||||
- type: string
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFilter"
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
ProjectCreateWithoutOrganizationInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -9965,9 +10097,12 @@ components:
|
||||
- type: "null"
|
||||
- type: string
|
||||
format: date-time
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
user:
|
||||
$ref: "#/components/schemas/UserCreateNestedOneWithoutOrganizationsInput"
|
||||
required:
|
||||
- role
|
||||
- user
|
||||
UserOrganizationUncheckedCreateWithoutOrganizationInput:
|
||||
type: object
|
||||
@@ -9984,8 +10119,11 @@ components:
|
||||
format: date-time
|
||||
userId:
|
||||
type: string
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
required:
|
||||
- userId
|
||||
- role
|
||||
UserOrganizationCreateOrConnectWithoutOrganizationInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -12664,8 +12802,11 @@ components:
|
||||
format: date-time
|
||||
organizationId:
|
||||
type: string
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
required:
|
||||
- organizationId
|
||||
- role
|
||||
AccountUpdateWithoutUserInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -12960,6 +13101,10 @@ components:
|
||||
format: date-time
|
||||
- $ref: "#/components/schemas/NullableDateTimeFieldUpdateOperationsInput"
|
||||
- type: "null"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
organization:
|
||||
$ref: "#/components/schemas/OrganizationUpdateOneRequiredWithoutUsersNestedInpu\
|
||||
t"
|
||||
@@ -12985,6 +13130,10 @@ components:
|
||||
oneOf:
|
||||
- type: string
|
||||
- $ref: "#/components/schemas/StringFieldUpdateOperationsInput"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
UserOrganizationUncheckedUpdateManyWithoutUserInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -13007,6 +13156,10 @@ components:
|
||||
oneOf:
|
||||
- type: string
|
||||
- $ref: "#/components/schemas/StringFieldUpdateOperationsInput"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
ProjectCreateManyOrganizationInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -13044,8 +13197,11 @@ components:
|
||||
format: date-time
|
||||
userId:
|
||||
type: string
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
required:
|
||||
- userId
|
||||
- role
|
||||
ProjectUpdateWithoutOrganizationInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -13159,6 +13315,10 @@ components:
|
||||
format: date-time
|
||||
- $ref: "#/components/schemas/NullableDateTimeFieldUpdateOperationsInput"
|
||||
- type: "null"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
user:
|
||||
$ref: "#/components/schemas/UserUpdateOneRequiredWithoutOrganizationsNestedInpu\
|
||||
t"
|
||||
@@ -13184,6 +13344,10 @@ components:
|
||||
oneOf:
|
||||
- type: string
|
||||
- $ref: "#/components/schemas/StringFieldUpdateOperationsInput"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
UserOrganizationUncheckedUpdateManyWithoutOrganizationInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -13206,6 +13370,10 @@ components:
|
||||
oneOf:
|
||||
- type: string
|
||||
- $ref: "#/components/schemas/StringFieldUpdateOperationsInput"
|
||||
role:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
- $ref: "#/components/schemas/EnumOrganizationRoleFieldUpdateOperationsInput"
|
||||
DatabaseCreateManyProjectInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -14377,6 +14545,8 @@ components:
|
||||
oneOf:
|
||||
- type: boolean
|
||||
- $ref: "#/components/schemas/OrganizationArgs"
|
||||
role:
|
||||
type: boolean
|
||||
ProjectSelect:
|
||||
type: object
|
||||
properties:
|
||||
@@ -14897,6 +15067,8 @@ components:
|
||||
type: boolean
|
||||
organizationId:
|
||||
type: boolean
|
||||
role:
|
||||
type: boolean
|
||||
_all:
|
||||
type: boolean
|
||||
UserOrganizationMinAggregateInput:
|
||||
@@ -14912,6 +15084,8 @@ components:
|
||||
type: boolean
|
||||
organizationId:
|
||||
type: boolean
|
||||
role:
|
||||
type: boolean
|
||||
UserOrganizationMaxAggregateInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -14925,6 +15099,8 @@ components:
|
||||
type: boolean
|
||||
organizationId:
|
||||
type: boolean
|
||||
role:
|
||||
type: boolean
|
||||
ProjectCountAggregateInput:
|
||||
type: object
|
||||
properties:
|
||||
@@ -15674,6 +15850,8 @@ components:
|
||||
type: string
|
||||
organizationId:
|
||||
type: string
|
||||
role:
|
||||
$ref: "#/components/schemas/OrganizationRole"
|
||||
_count:
|
||||
oneOf:
|
||||
- type: "null"
|
||||
@@ -15691,6 +15869,7 @@ components:
|
||||
- createdAt
|
||||
- userId
|
||||
- organizationId
|
||||
- role
|
||||
AggregateProject:
|
||||
type: object
|
||||
properties:
|
||||
@@ -16666,6 +16845,8 @@ components:
|
||||
type: integer
|
||||
organizationId:
|
||||
type: integer
|
||||
role:
|
||||
type: integer
|
||||
_all:
|
||||
type: integer
|
||||
required:
|
||||
@@ -16674,6 +16855,7 @@ components:
|
||||
- updatedAt
|
||||
- userId
|
||||
- organizationId
|
||||
- role
|
||||
- _all
|
||||
UserOrganizationMinAggregateOutputType:
|
||||
type: object
|
||||
@@ -16700,6 +16882,10 @@ components:
|
||||
oneOf:
|
||||
- type: "null"
|
||||
- type: string
|
||||
role:
|
||||
oneOf:
|
||||
- type: "null"
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
UserOrganizationMaxAggregateOutputType:
|
||||
type: object
|
||||
properties:
|
||||
@@ -16725,6 +16911,10 @@ components:
|
||||
oneOf:
|
||||
- type: "null"
|
||||
- type: string
|
||||
role:
|
||||
oneOf:
|
||||
- type: "null"
|
||||
- $ref: "#/components/schemas/OrganizationRole"
|
||||
ProjectCountAggregateOutputType:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user