Compare commits
23 Commits
log-filter
...
better-out
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e20fa31ca | ||
|
|
48a8e64be1 | ||
|
|
f3a5f11195 | ||
|
|
da5cbaf4dc | ||
|
|
acf74909c9 | ||
|
|
edac8da4a8 | ||
|
|
687f3dd85f | ||
|
|
0cef3ab5bd | ||
|
|
756b3185de | ||
|
|
3776ffc4c3 | ||
|
|
82549122e1 | ||
|
|
56a96a7db6 | ||
|
|
1596b15727 | ||
|
|
70d4a5bd9a | ||
|
|
c6ec901374 | ||
|
|
ad7665664a | ||
|
|
108e3d1e85 | ||
|
|
76f600722a | ||
|
|
d9a0e4581f | ||
|
|
b9251ad93c | ||
|
|
809ef04dc1 | ||
|
|
0fba2c9ee7 | ||
|
|
ac2ca0f617 |
@@ -34,3 +34,9 @@ GITHUB_CLIENT_SECRET="your_secret"
|
||||
|
||||
OPENPIPE_BASE_URL="http://localhost:3000/api/v1"
|
||||
OPENPIPE_API_KEY="your_key"
|
||||
|
||||
SENDER_EMAIL="placeholder"
|
||||
SMTP_HOST="placeholder"
|
||||
SMTP_PORT="placeholder"
|
||||
SMTP_LOGIN="placeholder"
|
||||
SMTP_PASSWORD="placeholder"
|
||||
|
||||
1
app/@types/nextjs-routes.d.ts
vendored
1
app/@types/nextjs-routes.d.ts
vendored
@@ -23,6 +23,7 @@ declare module "nextjs-routes" {
|
||||
| DynamicRoute<"/experiments/[id]", { "id": string }>
|
||||
| StaticRoute<"/experiments">
|
||||
| StaticRoute<"/">
|
||||
| DynamicRoute<"/invitations/[invitationToken]", { "invitationToken": string }>
|
||||
| StaticRoute<"/project/settings">
|
||||
| StaticRoute<"/request-logs">
|
||||
| StaticRoute<"/sentry-example-page">
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"@monaco-editor/loader": "^1.3.3",
|
||||
"@next-auth/prisma-adapter": "^1.0.5",
|
||||
"@prisma/client": "^4.14.0",
|
||||
"@sendinblue/client": "^3.3.1",
|
||||
"@sentry/nextjs": "^7.61.0",
|
||||
"@t3-oss/env-nextjs": "^0.3.1",
|
||||
"@tabler/icons-react": "^2.22.0",
|
||||
@@ -66,11 +67,13 @@
|
||||
"kysely": "^0.26.1",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lucide-react": "^0.265.0",
|
||||
"marked": "^7.0.3",
|
||||
"next": "^13.4.2",
|
||||
"next-auth": "^4.22.1",
|
||||
"next-query-params": "^4.2.3",
|
||||
"nextjs-cors": "^2.1.2",
|
||||
"nextjs-routes": "^2.0.1",
|
||||
"nodemailer": "^6.9.4",
|
||||
"openai": "4.0.0-beta.7",
|
||||
"openpipe": "workspace:*",
|
||||
"pg": "^8.11.2",
|
||||
@@ -114,6 +117,7 @@
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/lodash-es": "^4.17.8",
|
||||
"@types/node": "^18.16.0",
|
||||
"@types/nodemailer": "^6.4.9",
|
||||
"@types/pg": "^8.10.2",
|
||||
"@types/pluralize": "^0.0.30",
|
||||
"@types/prismjs": "^1.26.0",
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "UserInvitation" (
|
||||
"id" UUID NOT NULL,
|
||||
"projectId" UUID NOT NULL,
|
||||
"email" TEXT NOT NULL,
|
||||
"role" "ProjectUserRole" NOT NULL,
|
||||
"invitationToken" TEXT NOT NULL,
|
||||
"senderId" UUID NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "UserInvitation_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "UserInvitation_invitationToken_key" ON "UserInvitation"("invitationToken");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "UserInvitation_projectId_email_key" ON "UserInvitation"("projectId", "email");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "UserInvitation" ADD CONSTRAINT "UserInvitation_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "UserInvitation" ADD CONSTRAINT "UserInvitation_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -207,13 +207,14 @@ model Project {
|
||||
personalProjectUserId String? @unique @db.Uuid
|
||||
personalProjectUser User? @relation(fields: [personalProjectUserId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
projectUsers ProjectUser[]
|
||||
experiments Experiment[]
|
||||
datasets Dataset[]
|
||||
loggedCalls LoggedCall[]
|
||||
apiKeys ApiKey[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
projectUsers ProjectUser[]
|
||||
projectUserInvitations UserInvitation[]
|
||||
experiments Experiment[]
|
||||
datasets Dataset[]
|
||||
loggedCalls LoggedCall[]
|
||||
apiKeys ApiKey[]
|
||||
}
|
||||
|
||||
enum ProjectUserRole {
|
||||
@@ -390,16 +391,33 @@ model User {
|
||||
|
||||
role UserRole @default(USER)
|
||||
|
||||
accounts Account[]
|
||||
sessions Session[]
|
||||
projectUsers ProjectUser[]
|
||||
projects Project[]
|
||||
worldChampEntrant WorldChampEntrant?
|
||||
accounts Account[]
|
||||
sessions Session[]
|
||||
projectUsers ProjectUser[]
|
||||
projects Project[]
|
||||
worldChampEntrant WorldChampEntrant?
|
||||
sentUserInvitations UserInvitation[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
}
|
||||
|
||||
model UserInvitation {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
|
||||
projectId String @db.Uuid
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
email String
|
||||
role ProjectUserRole
|
||||
invitationToken String @unique
|
||||
senderId String @db.Uuid
|
||||
sender User @relation(fields: [senderId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([projectId, email])
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model VerificationToken {
|
||||
identifier String
|
||||
token String @unique
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Textarea, type TextareaProps } from "@chakra-ui/react";
|
||||
import ResizeTextarea from "react-textarea-autosize";
|
||||
import React, { useLayoutEffect, useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
export const AutoResizeTextarea: React.ForwardRefRenderFunction<
|
||||
HTMLTextAreaElement,
|
||||
TextareaProps & { minRows?: number }
|
||||
> = ({ minRows = 1, overflowY = "hidden", ...props }, ref) => {
|
||||
const [isRerendered, setIsRerendered] = useState(false);
|
||||
useLayoutEffect(() => setIsRerendered(true), []);
|
||||
useEffect(() => setIsRerendered(true), []);
|
||||
|
||||
return (
|
||||
<Textarea
|
||||
|
||||
@@ -87,7 +87,7 @@ export const ModelStatsCard = ({
|
||||
label="Price"
|
||||
info={
|
||||
<Text>
|
||||
${model.pricePerSecond.toFixed(3)}
|
||||
${model.pricePerSecond.toFixed(4)}
|
||||
<Text color="gray.500"> / second</Text>
|
||||
</Text>
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { HStack, Icon, IconButton, Tooltip, Text } from "@chakra-ui/react";
|
||||
import { HStack, Icon, IconButton, Tooltip, Text, type StackProps } from "@chakra-ui/react";
|
||||
import { useState } from "react";
|
||||
import { MdContentCopy } from "react-icons/md";
|
||||
import { useHandledAsyncCallback } from "~/utils/hooks";
|
||||
|
||||
const CopiableCode = ({ code }: { code: string }) => {
|
||||
const CopiableCode = ({ code, ...rest }: { code: string } & StackProps) => {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const [copyToClipboard] = useHandledAsyncCallback(async () => {
|
||||
await navigator.clipboard.writeText(code);
|
||||
setCopied(true);
|
||||
}, [code]);
|
||||
|
||||
return (
|
||||
<HStack
|
||||
backgroundColor="blackAlpha.800"
|
||||
@@ -18,9 +19,19 @@ const CopiableCode = ({ code }: { code: string }) => {
|
||||
padding={3}
|
||||
w="full"
|
||||
justifyContent="space-between"
|
||||
alignItems="flex-start"
|
||||
{...rest}
|
||||
>
|
||||
<Text fontFamily="inconsolata" fontWeight="bold" letterSpacing={0.5} overflowX="auto">
|
||||
<Text
|
||||
fontFamily="inconsolata"
|
||||
fontWeight="bold"
|
||||
letterSpacing={0.5}
|
||||
overflowX="auto"
|
||||
whiteSpace="pre-wrap"
|
||||
>
|
||||
{code}
|
||||
{/* Necessary for trailing newline to actually be displayed */}
|
||||
{code.endsWith("\n") ? "\n" : ""}
|
||||
</Text>
|
||||
<Tooltip closeOnClick={false} label={copied ? "Copied!" : "Copy to clipboard"}>
|
||||
<IconButton
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { HStack, Icon, IconButton, Spinner, Tooltip, useDisclosure } from "@chakra-ui/react";
|
||||
import { BsArrowClockwise, BsInfoCircle } from "react-icons/bs";
|
||||
import { useExperimentAccess } from "~/utils/hooks";
|
||||
import ExpandedModal from "./PromptModal";
|
||||
import PromptModal from "./PromptModal";
|
||||
import { type RouterOutputs } from "~/utils/api";
|
||||
|
||||
export const CellOptions = ({
|
||||
@@ -32,7 +32,7 @@ export const CellOptions = ({
|
||||
variant="ghost"
|
||||
/>
|
||||
</Tooltip>
|
||||
<ExpandedModal cell={cell} disclosure={modalDisclosure} />
|
||||
<PromptModal cell={cell} disclosure={modalDisclosure} />
|
||||
</>
|
||||
)}
|
||||
{canModify && (
|
||||
29
app/src/components/OutputsTable/OutputCell/CellWrapper.tsx
Normal file
29
app/src/components/OutputsTable/OutputCell/CellWrapper.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { type StackProps, VStack } from "@chakra-ui/react";
|
||||
import { type RouterOutputs } from "~/utils/api";
|
||||
import { type Scenario } from "../types";
|
||||
import { CellOptions } from "./CellOptions";
|
||||
import { OutputStats } from "./OutputStats";
|
||||
|
||||
const CellWrapper: React.FC<
|
||||
StackProps & {
|
||||
cell: RouterOutputs["scenarioVariantCells"]["get"] | undefined;
|
||||
hardRefetching: boolean;
|
||||
hardRefetch: () => void;
|
||||
mostRecentResponse:
|
||||
| NonNullable<RouterOutputs["scenarioVariantCells"]["get"]>["modelResponses"][0]
|
||||
| undefined;
|
||||
scenario: Scenario;
|
||||
}
|
||||
> = ({ children, cell, hardRefetching, hardRefetch, mostRecentResponse, scenario, ...props }) => (
|
||||
<VStack w="full" alignItems="flex-start" {...props} px={2} py={2} h="100%">
|
||||
{cell && (
|
||||
<CellOptions refetchingOutput={hardRefetching} refetchOutput={hardRefetch} cell={cell} />
|
||||
)}
|
||||
<VStack w="full" alignItems="flex-start" maxH={500} overflowY="auto" flex={1}>
|
||||
{children}
|
||||
</VStack>
|
||||
{mostRecentResponse && <OutputStats modelResponse={mostRecentResponse} scenario={scenario} />}
|
||||
</VStack>
|
||||
);
|
||||
|
||||
export default CellWrapper;
|
||||
@@ -1,17 +1,16 @@
|
||||
import { api } from "~/utils/api";
|
||||
import { type PromptVariant, type Scenario } from "../types";
|
||||
import { type StackProps, Text, VStack } from "@chakra-ui/react";
|
||||
import { useScenarioVars, useHandledAsyncCallback } from "~/utils/hooks";
|
||||
import { Text } from "@chakra-ui/react";
|
||||
import stringify from "json-stringify-pretty-compact";
|
||||
import { Fragment, useEffect, useState, type ReactElement } from "react";
|
||||
import SyntaxHighlighter from "react-syntax-highlighter";
|
||||
import { docco } from "react-syntax-highlighter/dist/cjs/styles/hljs";
|
||||
import stringify from "json-stringify-pretty-compact";
|
||||
import { type ReactElement, useState, useEffect, Fragment, useCallback } from "react";
|
||||
import useSocket from "~/utils/useSocket";
|
||||
import { OutputStats } from "./OutputStats";
|
||||
import { RetryCountdown } from "./RetryCountdown";
|
||||
import frontendModelProviders from "~/modelProviders/frontendModelProviders";
|
||||
import { api } from "~/utils/api";
|
||||
import { useHandledAsyncCallback, useScenarioVars } from "~/utils/hooks";
|
||||
import useSocket from "~/utils/useSocket";
|
||||
import { type PromptVariant, type Scenario } from "../types";
|
||||
import CellWrapper from "./CellWrapper";
|
||||
import { ResponseLog } from "./ResponseLog";
|
||||
import { CellOptions } from "./TopActions";
|
||||
import { RetryCountdown } from "./RetryCountdown";
|
||||
|
||||
const WAITING_MESSAGE_INTERVAL = 20000;
|
||||
|
||||
@@ -72,35 +71,26 @@ export default function OutputCell({
|
||||
|
||||
const mostRecentResponse = cell?.modelResponses[cell.modelResponses.length - 1];
|
||||
|
||||
const CellWrapper = useCallback(
|
||||
({ children, ...props }: StackProps) => (
|
||||
<VStack w="full" alignItems="flex-start" {...props} px={2} py={2} h="100%">
|
||||
{cell && (
|
||||
<CellOptions refetchingOutput={hardRefetching} refetchOutput={hardRefetch} cell={cell} />
|
||||
)}
|
||||
<VStack w="full" alignItems="flex-start" maxH={500} overflowY="auto" flex={1}>
|
||||
{children}
|
||||
</VStack>
|
||||
{mostRecentResponse && (
|
||||
<OutputStats modelResponse={mostRecentResponse} scenario={scenario} />
|
||||
)}
|
||||
</VStack>
|
||||
),
|
||||
[hardRefetching, hardRefetch, mostRecentResponse, scenario, cell],
|
||||
);
|
||||
const wrapperProps: Parameters<typeof CellWrapper>[0] = {
|
||||
cell,
|
||||
hardRefetching,
|
||||
hardRefetch,
|
||||
mostRecentResponse,
|
||||
scenario,
|
||||
};
|
||||
|
||||
if (!vars) return null;
|
||||
|
||||
if (!cell && !fetchingOutput)
|
||||
return (
|
||||
<CellWrapper>
|
||||
<CellWrapper {...wrapperProps}>
|
||||
<Text color="gray.500">Error retrieving output</Text>
|
||||
</CellWrapper>
|
||||
);
|
||||
|
||||
if (cell && cell.errorMessage) {
|
||||
return (
|
||||
<CellWrapper>
|
||||
<CellWrapper {...wrapperProps}>
|
||||
<Text color="red.500">{cell.errorMessage}</Text>
|
||||
</CellWrapper>
|
||||
);
|
||||
@@ -112,7 +102,12 @@ export default function OutputCell({
|
||||
|
||||
if (showLogs)
|
||||
return (
|
||||
<CellWrapper alignItems="flex-start" fontFamily="inconsolata, monospace" spacing={0}>
|
||||
<CellWrapper
|
||||
{...wrapperProps}
|
||||
alignItems="flex-start"
|
||||
fontFamily="inconsolata, monospace"
|
||||
spacing={0}
|
||||
>
|
||||
{cell?.jobQueuedAt && <ResponseLog time={cell.jobQueuedAt} title="Job queued" />}
|
||||
{cell?.jobStartedAt && <ResponseLog time={cell.jobStartedAt} title="Job started" />}
|
||||
{cell?.modelResponses?.map((response) => {
|
||||
@@ -174,7 +169,7 @@ export default function OutputCell({
|
||||
|
||||
if (mostRecentResponse?.respPayload && normalizedOutput?.type === "json") {
|
||||
return (
|
||||
<CellWrapper>
|
||||
<CellWrapper {...wrapperProps}>
|
||||
<SyntaxHighlighter
|
||||
customStyle={{ overflowX: "unset", width: "100%", flex: 1 }}
|
||||
language="json"
|
||||
@@ -193,7 +188,7 @@ export default function OutputCell({
|
||||
const contentToDisplay = (normalizedOutput?.type === "text" && normalizedOutput.value) || "";
|
||||
|
||||
return (
|
||||
<CellWrapper>
|
||||
<CellWrapper {...wrapperProps}>
|
||||
<Text whiteSpace="pre-wrap">{contentToDisplay}</Text>
|
||||
</CellWrapper>
|
||||
);
|
||||
|
||||
@@ -5,30 +5,103 @@ import {
|
||||
ModalContent,
|
||||
ModalHeader,
|
||||
ModalOverlay,
|
||||
VStack,
|
||||
Text,
|
||||
Box,
|
||||
type UseDisclosureReturn,
|
||||
Link,
|
||||
} from "@chakra-ui/react";
|
||||
import { type RouterOutputs } from "~/utils/api";
|
||||
import { api, type RouterOutputs } from "~/utils/api";
|
||||
import { JSONTree } from "react-json-tree";
|
||||
import CopiableCode from "~/components/CopiableCode";
|
||||
|
||||
export default function ExpandedModal(props: {
|
||||
const theme = {
|
||||
scheme: "chalk",
|
||||
author: "chris kempson (http://chriskempson.com)",
|
||||
base00: "transparent",
|
||||
base01: "#202020",
|
||||
base02: "#303030",
|
||||
base03: "#505050",
|
||||
base04: "#b0b0b0",
|
||||
base05: "#d0d0d0",
|
||||
base06: "#e0e0e0",
|
||||
base07: "#f5f5f5",
|
||||
base08: "#fb9fb1",
|
||||
base09: "#eda987",
|
||||
base0A: "#ddb26f",
|
||||
base0B: "#acc267",
|
||||
base0C: "#12cfc0",
|
||||
base0D: "#6fc2ef",
|
||||
base0E: "#e1a3ee",
|
||||
base0F: "#deaf8f",
|
||||
};
|
||||
|
||||
export default function PromptModal(props: {
|
||||
cell: NonNullable<RouterOutputs["scenarioVariantCells"]["get"]>;
|
||||
disclosure: UseDisclosureReturn;
|
||||
}) {
|
||||
const { data } = api.scenarioVariantCells.getTemplatedPromptMessage.useQuery(
|
||||
{
|
||||
cellId: props.cell.id,
|
||||
},
|
||||
{
|
||||
enabled: props.disclosure.isOpen,
|
||||
},
|
||||
);
|
||||
|
||||
return (
|
||||
<Modal isOpen={props.disclosure.isOpen} onClose={props.disclosure.onClose} size="2xl">
|
||||
<Modal isOpen={props.disclosure.isOpen} onClose={props.disclosure.onClose} size="xl">
|
||||
<ModalOverlay />
|
||||
<ModalContent>
|
||||
<ModalHeader>Prompt</ModalHeader>
|
||||
<ModalHeader>Prompt Details</ModalHeader>
|
||||
<ModalCloseButton />
|
||||
<ModalBody>
|
||||
<JSONTree
|
||||
data={props.cell.prompt}
|
||||
invertTheme={true}
|
||||
theme="chalk"
|
||||
shouldExpandNodeInitially={() => true}
|
||||
getItemString={() => ""}
|
||||
hideRoot
|
||||
/>
|
||||
<VStack py={4} w="">
|
||||
<VStack w="full" alignItems="flex-start">
|
||||
<Text fontWeight="bold">Full Prompt</Text>
|
||||
<Box
|
||||
w="full"
|
||||
p={4}
|
||||
alignItems="flex-start"
|
||||
backgroundColor="blackAlpha.800"
|
||||
borderRadius={4}
|
||||
>
|
||||
<JSONTree
|
||||
data={props.cell.prompt}
|
||||
theme={theme}
|
||||
shouldExpandNodeInitially={() => true}
|
||||
getItemString={() => ""}
|
||||
hideRoot
|
||||
/>
|
||||
</Box>
|
||||
</VStack>
|
||||
{data?.templatedPrompt && (
|
||||
<VStack w="full" mt={4} alignItems="flex-start">
|
||||
<Text fontWeight="bold">Templated prompt message:</Text>
|
||||
<CopiableCode
|
||||
w="full"
|
||||
// bgColor="gray.100"
|
||||
p={4}
|
||||
borderWidth={1}
|
||||
whiteSpace="pre-wrap"
|
||||
code={data.templatedPrompt}
|
||||
/>
|
||||
</VStack>
|
||||
)}
|
||||
{data?.learnMoreUrl && (
|
||||
<Link
|
||||
href={data.learnMoreUrl}
|
||||
isExternal
|
||||
color="blue.500"
|
||||
fontWeight="bold"
|
||||
fontSize="sm"
|
||||
mt={4}
|
||||
alignSelf="flex-end"
|
||||
>
|
||||
Learn More
|
||||
</Link>
|
||||
)}
|
||||
</VStack>
|
||||
</ModalBody>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
Image,
|
||||
Box,
|
||||
} from "@chakra-ui/react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect } from "react";
|
||||
import Link from "next/link";
|
||||
import { BsPlus, BsPersonCircle } from "react-icons/bs";
|
||||
import { type Project } from "@prisma/client";
|
||||
@@ -105,8 +105,8 @@ export default function ProjectMenu() {
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
_focusVisible={{ outline: "unset" }}
|
||||
ml={-1}
|
||||
w={224}
|
||||
w={220}
|
||||
ml={{ base: 2, md: 0 }}
|
||||
boxShadow="0 0 40px 4px rgba(0, 0, 0, 0.1);"
|
||||
fontSize="sm"
|
||||
>
|
||||
@@ -176,7 +176,6 @@ const ProjectOption = ({
|
||||
onClose: () => void;
|
||||
}) => {
|
||||
const setSelectedProjectId = useAppStore((s) => s.setSelectedProjectId);
|
||||
const [gearHovered, setGearHovered] = useState(false);
|
||||
|
||||
return (
|
||||
<HStack
|
||||
@@ -188,8 +187,8 @@ const ProjectOption = ({
|
||||
}}
|
||||
w="full"
|
||||
justifyContent="space-between"
|
||||
_hover={gearHovered ? undefined : { bgColor: "gray.200", textDecoration: "none" }}
|
||||
color={isActive ? "blue.400" : undefined}
|
||||
_hover={{ bgColor: "gray.200", textDecoration: "none" }}
|
||||
bgColor={isActive ? "gray.100" : undefined}
|
||||
py={2}
|
||||
px={4}
|
||||
borderRadius={4}
|
||||
|
||||
128
app/src/components/projectSettings/InviteMemberModal.tsx
Normal file
128
app/src/components/projectSettings/InviteMemberModal.tsx
Normal file
@@ -0,0 +1,128 @@
|
||||
import {
|
||||
Button,
|
||||
FormControl,
|
||||
FormLabel,
|
||||
Input,
|
||||
FormHelperText,
|
||||
HStack,
|
||||
Modal,
|
||||
ModalBody,
|
||||
ModalCloseButton,
|
||||
ModalContent,
|
||||
ModalFooter,
|
||||
ModalHeader,
|
||||
ModalOverlay,
|
||||
Spinner,
|
||||
Text,
|
||||
VStack,
|
||||
RadioGroup,
|
||||
Radio,
|
||||
} from "@chakra-ui/react";
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import { api } from "~/utils/api";
|
||||
import { useHandledAsyncCallback, useSelectedProject } from "~/utils/hooks";
|
||||
import { maybeReportError } from "~/utils/errorHandling/maybeReportError";
|
||||
import { type ProjectUserRole } from "@prisma/client";
|
||||
|
||||
export const InviteMemberModal = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
}: {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}) => {
|
||||
const selectedProject = useSelectedProject().data;
|
||||
const utils = api.useContext();
|
||||
|
||||
const [email, setEmail] = useState("");
|
||||
const [role, setRole] = useState<ProjectUserRole>("MEMBER");
|
||||
|
||||
useEffect(() => {
|
||||
setEmail("");
|
||||
setRole("MEMBER");
|
||||
}, [isOpen]);
|
||||
|
||||
const emailIsValid = !email || !email.match(/.+@.+\..+/);
|
||||
|
||||
const inviteMemberMutation = api.users.inviteToProject.useMutation();
|
||||
|
||||
const [inviteMember, isInviting] = useHandledAsyncCallback(async () => {
|
||||
if (!selectedProject?.id || !role) return;
|
||||
const resp = await inviteMemberMutation.mutateAsync({
|
||||
projectId: selectedProject.id,
|
||||
email,
|
||||
role,
|
||||
});
|
||||
if (maybeReportError(resp)) return;
|
||||
await utils.projects.get.invalidate();
|
||||
onClose();
|
||||
}, [inviteMemberMutation, email, role, selectedProject?.id, onClose]);
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onClose={onClose}>
|
||||
<ModalOverlay />
|
||||
<ModalContent w={1200}>
|
||||
<ModalHeader>
|
||||
<HStack>
|
||||
<Text>Invite Member</Text>
|
||||
</HStack>
|
||||
</ModalHeader>
|
||||
<ModalCloseButton />
|
||||
<ModalBody>
|
||||
<VStack spacing={8} alignItems="flex-start">
|
||||
<Text>
|
||||
Invite a new member to <b>{selectedProject?.name}</b>.
|
||||
</Text>
|
||||
|
||||
<RadioGroup
|
||||
value={role}
|
||||
onChange={(e) => setRole(e as ProjectUserRole)}
|
||||
colorScheme="orange"
|
||||
>
|
||||
<VStack w="full" alignItems="flex-start">
|
||||
<Radio value="MEMBER">
|
||||
<Text fontSize="sm">MEMBER</Text>
|
||||
</Radio>
|
||||
<Radio value="ADMIN">
|
||||
<Text fontSize="sm">ADMIN</Text>
|
||||
</Radio>
|
||||
</VStack>
|
||||
</RadioGroup>
|
||||
<FormControl>
|
||||
<FormLabel>Email</FormLabel>
|
||||
<Input
|
||||
type="email"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" && (e.metaKey || e.ctrlKey || e.shiftKey)) {
|
||||
e.preventDefault();
|
||||
e.currentTarget.blur();
|
||||
inviteMember();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<FormHelperText>Enter the email of the person you want to invite.</FormHelperText>
|
||||
</FormControl>
|
||||
</VStack>
|
||||
</ModalBody>
|
||||
<ModalFooter mt={4}>
|
||||
<HStack>
|
||||
<Button colorScheme="gray" onClick={onClose} minW={24}>
|
||||
<Text>Cancel</Text>
|
||||
</Button>
|
||||
<Button
|
||||
colorScheme="orange"
|
||||
onClick={inviteMember}
|
||||
minW={24}
|
||||
isDisabled={emailIsValid || isInviting}
|
||||
>
|
||||
{isInviting ? <Spinner boxSize={4} /> : <Text>Send Invitation</Text>}
|
||||
</Button>
|
||||
</HStack>
|
||||
</ModalFooter>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
145
app/src/components/projectSettings/MemberTable.tsx
Normal file
145
app/src/components/projectSettings/MemberTable.tsx
Normal file
@@ -0,0 +1,145 @@
|
||||
import { useMemo, useState } from "react";
|
||||
import {
|
||||
Table,
|
||||
Thead,
|
||||
Tr,
|
||||
Th,
|
||||
Tbody,
|
||||
Td,
|
||||
IconButton,
|
||||
useDisclosure,
|
||||
Text,
|
||||
Button,
|
||||
} from "@chakra-ui/react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { BsTrash } from "react-icons/bs";
|
||||
import { type User } from "@prisma/client";
|
||||
|
||||
import { useHandledAsyncCallback, useSelectedProject } from "~/utils/hooks";
|
||||
import { InviteMemberModal } from "./InviteMemberModal";
|
||||
import { RemoveMemberDialog } from "./RemoveMemberDialog";
|
||||
import { api } from "~/utils/api";
|
||||
import { maybeReportError } from "~/utils/errorHandling/maybeReportError";
|
||||
|
||||
const MemberTable = () => {
|
||||
const selectedProject = useSelectedProject().data;
|
||||
const session = useSession().data;
|
||||
|
||||
const utils = api.useContext();
|
||||
|
||||
const [memberToRemove, setMemberToRemove] = useState<User | null>(null);
|
||||
const inviteMemberModal = useDisclosure();
|
||||
|
||||
const cancelInvitationMutation = api.users.cancelProjectInvitation.useMutation();
|
||||
|
||||
const [cancelInvitation, isCancelling] = useHandledAsyncCallback(
|
||||
async (invitationToken: string) => {
|
||||
if (!selectedProject?.id) return;
|
||||
const resp = await cancelInvitationMutation.mutateAsync({
|
||||
invitationToken,
|
||||
});
|
||||
if (maybeReportError(resp)) return;
|
||||
await utils.projects.get.invalidate();
|
||||
},
|
||||
[selectedProject?.id, cancelInvitationMutation],
|
||||
);
|
||||
|
||||
const sortedMembers = useMemo(() => {
|
||||
if (!selectedProject?.projectUsers) return [];
|
||||
return selectedProject.projectUsers.sort((a, b) => {
|
||||
if (a.role === b.role) return a.createdAt < b.createdAt ? -1 : 1;
|
||||
// Take advantage of fact that ADMIN is alphabetically before MEMBER
|
||||
return a.role < b.role ? -1 : 1;
|
||||
});
|
||||
}, [selectedProject?.projectUsers]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Table fontSize={{ base: "sm", md: "md" }}>
|
||||
<Thead
|
||||
sx={{
|
||||
th: {
|
||||
base: { px: 0 },
|
||||
md: { px: 6 },
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Tr>
|
||||
<Th>Name</Th>
|
||||
<Th display={{ base: "none", md: "table-cell" }}>Email</Th>
|
||||
<Th>Role</Th>
|
||||
{selectedProject?.role === "ADMIN" && <Th />}
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody
|
||||
sx={{
|
||||
td: {
|
||||
base: { px: 0 },
|
||||
md: { px: 6 },
|
||||
},
|
||||
}}
|
||||
>
|
||||
{selectedProject &&
|
||||
sortedMembers.map((member) => {
|
||||
return (
|
||||
<Tr key={member.id}>
|
||||
<Td>
|
||||
<Text fontWeight="bold">{member.user.name}</Text>
|
||||
</Td>
|
||||
<Td display={{ base: "none", md: "table-cell" }} h="full">
|
||||
{member.user.email}
|
||||
</Td>
|
||||
<Td fontSize={{ base: "xs", md: "sm" }}>{member.role}</Td>
|
||||
{selectedProject.role === "ADMIN" && (
|
||||
<Td textAlign="end">
|
||||
{member.user.id !== session?.user?.id &&
|
||||
member.user.id !== selectedProject.personalProjectUserId && (
|
||||
<IconButton
|
||||
aria-label="Remove member"
|
||||
colorScheme="red"
|
||||
icon={<BsTrash />}
|
||||
onClick={() => setMemberToRemove(member.user)}
|
||||
/>
|
||||
)}
|
||||
</Td>
|
||||
)}
|
||||
</Tr>
|
||||
);
|
||||
})}
|
||||
{selectedProject?.projectUserInvitations?.map((invitation) => {
|
||||
return (
|
||||
<Tr key={invitation.id}>
|
||||
<Td>
|
||||
<Text as="i">Invitation pending</Text>
|
||||
</Td>
|
||||
<Td>{invitation.email}</Td>
|
||||
<Td fontSize="sm">{invitation.role}</Td>
|
||||
{selectedProject.role === "ADMIN" && (
|
||||
<Td textAlign="end">
|
||||
<Button
|
||||
size="sm"
|
||||
colorScheme="red"
|
||||
variant="ghost"
|
||||
onClick={() => cancelInvitation(invitation.invitationToken)}
|
||||
isLoading={isCancelling}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</Td>
|
||||
)}
|
||||
</Tr>
|
||||
);
|
||||
})}
|
||||
</Tbody>
|
||||
</Table>
|
||||
<InviteMemberModal isOpen={inviteMemberModal.isOpen} onClose={inviteMemberModal.onClose} />
|
||||
<RemoveMemberDialog
|
||||
member={memberToRemove}
|
||||
isOpen={!!memberToRemove}
|
||||
onClose={() => setMemberToRemove(null)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default MemberTable;
|
||||
71
app/src/components/projectSettings/RemoveMemberDialog.tsx
Normal file
71
app/src/components/projectSettings/RemoveMemberDialog.tsx
Normal file
@@ -0,0 +1,71 @@
|
||||
import {
|
||||
Button,
|
||||
AlertDialog,
|
||||
AlertDialogBody,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogContent,
|
||||
AlertDialogOverlay,
|
||||
Text,
|
||||
VStack,
|
||||
Spinner,
|
||||
} from "@chakra-ui/react";
|
||||
import { type User } from "@prisma/client";
|
||||
|
||||
import { useRouter } from "next/router";
|
||||
import { useRef } from "react";
|
||||
import { api } from "~/utils/api";
|
||||
import { useHandledAsyncCallback, useSelectedProject } from "~/utils/hooks";
|
||||
|
||||
export const RemoveMemberDialog = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
member,
|
||||
}: {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
member: User | null;
|
||||
}) => {
|
||||
const selectedProject = useSelectedProject();
|
||||
const removeUserMutation = api.users.removeUserFromProject.useMutation();
|
||||
const utils = api.useContext();
|
||||
const router = useRouter();
|
||||
|
||||
const cancelRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
const [onRemoveConfirm, isRemoving] = useHandledAsyncCallback(async () => {
|
||||
if (!selectedProject.data?.id || !member?.id) return;
|
||||
await removeUserMutation.mutateAsync({ projectId: selectedProject.data.id, userId: member.id });
|
||||
await utils.projects.get.invalidate();
|
||||
onClose();
|
||||
}, [removeUserMutation, selectedProject, router]);
|
||||
|
||||
return (
|
||||
<AlertDialog isOpen={isOpen} leastDestructiveRef={cancelRef} onClose={onClose}>
|
||||
<AlertDialogOverlay>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader fontSize="lg" fontWeight="bold">
|
||||
Remove Member
|
||||
</AlertDialogHeader>
|
||||
|
||||
<AlertDialogBody>
|
||||
<VStack spacing={4} alignItems="flex-start">
|
||||
<Text>
|
||||
Are you sure you want to remove <b>{member?.name}</b> from the project?
|
||||
</Text>
|
||||
</VStack>
|
||||
</AlertDialogBody>
|
||||
|
||||
<AlertDialogFooter>
|
||||
<Button ref={cancelRef} onClick={onClose}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button colorScheme="red" onClick={onRemoveConfirm} ml={3} w={20}>
|
||||
{isRemoving ? <Spinner /> : "Remove"}
|
||||
</Button>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialogOverlay>
|
||||
</AlertDialog>
|
||||
);
|
||||
};
|
||||
@@ -10,7 +10,14 @@ const AddFilterButton = () => {
|
||||
<HStack
|
||||
as={Button}
|
||||
variant="ghost"
|
||||
onClick={() => addFilter({ field: defaultFilterableFields[0], comparator: comparators[0] })}
|
||||
onClick={() =>
|
||||
addFilter({
|
||||
id: Date.now().toString(),
|
||||
field: defaultFilterableFields[0],
|
||||
comparator: comparators[0],
|
||||
value: "",
|
||||
})
|
||||
}
|
||||
spacing={0}
|
||||
fontSize="sm"
|
||||
>
|
||||
|
||||
@@ -8,39 +8,34 @@ import { debounce } from "lodash-es";
|
||||
import SelectFieldDropdown from "./SelectFieldDropdown";
|
||||
import SelectComparatorDropdown from "./SelectComparatorDropdown";
|
||||
|
||||
const LogFilter = ({ filter, index }: { filter: LogFilter; index: number }) => {
|
||||
const LogFilter = ({ filter }: { filter: LogFilter }) => {
|
||||
const updateFilter = useAppStore((s) => s.logFilters.updateFilter);
|
||||
const deleteFilter = useAppStore((s) => s.logFilters.deleteFilter);
|
||||
|
||||
const [editedValue, setEditedValue] = useState("");
|
||||
const [editedValue, setEditedValue] = useState(filter.value);
|
||||
|
||||
const debouncedUpdateFilter = useCallback(
|
||||
debounce(
|
||||
(index: number, filter: LogFilter) => {
|
||||
console.log("updating filter!!!");
|
||||
updateFilter(index, filter);
|
||||
},
|
||||
200,
|
||||
{ leading: true },
|
||||
),
|
||||
debounce((filter: LogFilter) => updateFilter(filter), 500, {
|
||||
leading: true,
|
||||
}),
|
||||
[updateFilter],
|
||||
);
|
||||
|
||||
return (
|
||||
<HStack>
|
||||
<SelectFieldDropdown filter={filter} index={index} />
|
||||
<SelectComparatorDropdown filter={filter} index={index} />
|
||||
<SelectFieldDropdown filter={filter} />
|
||||
<SelectComparatorDropdown filter={filter} />
|
||||
<Input
|
||||
value={editedValue}
|
||||
onChange={(e) => {
|
||||
setEditedValue(e.target.value);
|
||||
debouncedUpdateFilter(index, { ...filter, value: e.target.value });
|
||||
debouncedUpdateFilter({ ...filter, value: e.target.value });
|
||||
}}
|
||||
/>
|
||||
<IconButton
|
||||
aria-label="Delete Filter"
|
||||
icon={<BsTrash />}
|
||||
onClick={() => deleteFilter(index)}
|
||||
onClick={() => deleteFilter(filter.id)}
|
||||
/>
|
||||
</HStack>
|
||||
);
|
||||
|
||||
@@ -19,8 +19,8 @@ const LogFilters = () => {
|
||||
<Text fontWeight="bold" color="gray.500">
|
||||
Filters
|
||||
</Text>
|
||||
{filters.map((filter, index) => (
|
||||
<LogFilter key={index} filter={filter} index={index} />
|
||||
{filters.map((filter) => (
|
||||
<LogFilter key={filter.id} filter={filter} />
|
||||
))}
|
||||
<AddFilterButton />
|
||||
</VStack>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { comparators, type LogFilter } from "~/state/logFiltersSlice";
|
||||
import { useAppStore } from "~/state/store";
|
||||
import InputDropdown from "~/components/InputDropdown";
|
||||
|
||||
const SelectComparatorDropdown = ({ filter, index }: { filter: LogFilter; index: number }) => {
|
||||
const SelectComparatorDropdown = ({ filter }: { filter: LogFilter }) => {
|
||||
const updateFilter = useAppStore((s) => s.logFilters.updateFilter);
|
||||
|
||||
const { comparator } = filter;
|
||||
@@ -11,7 +11,7 @@ const SelectComparatorDropdown = ({ filter, index }: { filter: LogFilter; index:
|
||||
<InputDropdown
|
||||
options={comparators}
|
||||
selectedOption={comparator}
|
||||
onSelect={(option) => updateFilter(index, { ...filter, comparator: option })}
|
||||
onSelect={(option) => updateFilter({ ...filter, comparator: option })}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useAppStore } from "~/state/store";
|
||||
import { useTagNames } from "~/utils/hooks";
|
||||
import InputDropdown from "~/components/InputDropdown";
|
||||
|
||||
const SelectFieldDropdown = ({ filter, index }: { filter: LogFilter; index: number }) => {
|
||||
const SelectFieldDropdown = ({ filter }: { filter: LogFilter }) => {
|
||||
const tagNames = useTagNames().data;
|
||||
|
||||
const updateFilter = useAppStore((s) => s.logFilters.updateFilter);
|
||||
@@ -14,7 +14,7 @@ const SelectFieldDropdown = ({ filter, index }: { filter: LogFilter; index: numb
|
||||
<InputDropdown
|
||||
options={[...defaultFilterableFields, ...(tagNames || [])]}
|
||||
selectedOption={field}
|
||||
onSelect={(option) => updateFilter(index, { ...filter, field: option })}
|
||||
onSelect={(option) => updateFilter({ ...filter, field: option })}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -21,6 +21,11 @@ export const env = createEnv({
|
||||
ANTHROPIC_API_KEY: z.string().default("placeholder"),
|
||||
SENTRY_AUTH_TOKEN: z.string().optional(),
|
||||
OPENPIPE_API_KEY: z.string().optional(),
|
||||
SENDER_EMAIL: z.string().default("placeholder"),
|
||||
SMTP_HOST: z.string().default("placeholder"),
|
||||
SMTP_PORT: z.string().default("placeholder"),
|
||||
SMTP_LOGIN: z.string().default("placeholder"),
|
||||
SMTP_PASSWORD: z.string().default("placeholder"),
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -58,6 +63,11 @@ export const env = createEnv({
|
||||
SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,
|
||||
OPENPIPE_API_KEY: process.env.OPENPIPE_API_KEY,
|
||||
NEXT_PUBLIC_FF_SHOW_LOGGED_CALLS: process.env.NEXT_PUBLIC_FF_SHOW_LOGGED_CALLS,
|
||||
SENDER_EMAIL: process.env.SENDER_EMAIL,
|
||||
SMTP_HOST: process.env.SMTP_HOST,
|
||||
SMTP_PORT: process.env.SMTP_PORT,
|
||||
SMTP_LOGIN: process.env.SMTP_LOGIN,
|
||||
SMTP_PASSWORD: process.env.SMTP_PASSWORD,
|
||||
},
|
||||
/**
|
||||
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import openaiChatCompletionFrontend from "./openai-ChatCompletion/frontend";
|
||||
import replicateLlama2Frontend from "./replicate-llama2/frontend";
|
||||
import anthropicFrontend from "./anthropic-completion/frontend";
|
||||
import openpipeFrontend from "./openpipe-chat/frontend";
|
||||
import { type SupportedProvider, type FrontendModelProvider } from "./types";
|
||||
|
||||
// Keep attributes here that need to be accessible from the frontend. We can't
|
||||
@@ -10,6 +11,7 @@ const frontendModelProviders: Record<SupportedProvider, FrontendModelProvider<an
|
||||
"openai/ChatCompletion": openaiChatCompletionFrontend,
|
||||
"replicate/llama2": replicateLlama2Frontend,
|
||||
"anthropic/completion": anthropicFrontend,
|
||||
"openpipe/Chat": openpipeFrontend,
|
||||
};
|
||||
|
||||
export default frontendModelProviders;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import openaiChatCompletion from "./openai-ChatCompletion";
|
||||
import replicateLlama2 from "./replicate-llama2";
|
||||
import anthropicCompletion from "./anthropic-completion";
|
||||
import openpipeChatCompletion from "./openpipe-chat";
|
||||
import { type SupportedProvider, type ModelProvider } from "./types";
|
||||
|
||||
const modelProviders: Record<SupportedProvider, ModelProvider<any, any, any>> = {
|
||||
"openai/ChatCompletion": openaiChatCompletion,
|
||||
"replicate/llama2": replicateLlama2,
|
||||
"anthropic/completion": anthropicCompletion,
|
||||
"openpipe/Chat": openpipeChatCompletion,
|
||||
};
|
||||
|
||||
export default modelProviders;
|
||||
|
||||
68
app/src/modelProviders/openpipe-chat/frontend.ts
Normal file
68
app/src/modelProviders/openpipe-chat/frontend.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import { type OpenpipeChatOutput, type SupportedModel } from ".";
|
||||
import { type FrontendModelProvider } from "../types";
|
||||
import { refinementActions } from "./refinementActions";
|
||||
import {
|
||||
templateOpenOrcaPrompt,
|
||||
// templateAlpacaInstructPrompt,
|
||||
// templateSystemUserAssistantPrompt,
|
||||
templateInstructionInputResponsePrompt,
|
||||
templateAiroborosPrompt,
|
||||
} from "./templatePrompt";
|
||||
|
||||
const frontendModelProvider: FrontendModelProvider<SupportedModel, OpenpipeChatOutput> = {
|
||||
name: "OpenAI ChatCompletion",
|
||||
|
||||
models: {
|
||||
"Open-Orca/OpenOrcaxOpenChat-Preview2-13B": {
|
||||
name: "OpenOrcaxOpenChat-Preview2-13B",
|
||||
contextWindow: 4096,
|
||||
pricePerSecond: 0.0003,
|
||||
speed: "medium",
|
||||
provider: "openpipe/Chat",
|
||||
learnMoreUrl: "https://huggingface.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B",
|
||||
templatePrompt: templateOpenOrcaPrompt,
|
||||
},
|
||||
// "Open-Orca/OpenOrca-Platypus2-13B": {
|
||||
// name: "OpenOrca-Platypus2-13B",
|
||||
// contextWindow: 4096,
|
||||
// pricePerSecond: 0.0003,
|
||||
// speed: "medium",
|
||||
// provider: "openpipe/Chat",
|
||||
// learnMoreUrl: "https://huggingface.co/Open-Orca/OpenOrca-Platypus2-13B",
|
||||
// templatePrompt: templateAlpacaInstructPrompt,
|
||||
// },
|
||||
// "stabilityai/StableBeluga-13B": {
|
||||
// name: "StableBeluga-13B",
|
||||
// contextWindow: 4096,
|
||||
// pricePerSecond: 0.0003,
|
||||
// speed: "medium",
|
||||
// provider: "openpipe/Chat",
|
||||
// learnMoreUrl: "https://huggingface.co/stabilityai/StableBeluga-13B",
|
||||
// templatePrompt: templateSystemUserAssistantPrompt,
|
||||
// },
|
||||
"NousResearch/Nous-Hermes-Llama2-13b": {
|
||||
name: "Nous-Hermes-Llama2-13b",
|
||||
contextWindow: 4096,
|
||||
pricePerSecond: 0.0003,
|
||||
speed: "medium",
|
||||
provider: "openpipe/Chat",
|
||||
learnMoreUrl: "https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b",
|
||||
templatePrompt: templateInstructionInputResponsePrompt,
|
||||
},
|
||||
"jondurbin/airoboros-l2-13b-gpt4-2.0": {
|
||||
name: "airoboros-l2-13b-gpt4-2.0",
|
||||
contextWindow: 4096,
|
||||
pricePerSecond: 0.0003,
|
||||
speed: "medium",
|
||||
provider: "openpipe/Chat",
|
||||
learnMoreUrl: "https://huggingface.co/jondurbin/airoboros-l2-13b-gpt4-2.0",
|
||||
templatePrompt: templateAiroborosPrompt,
|
||||
},
|
||||
},
|
||||
|
||||
refinementActions,
|
||||
|
||||
normalizeOutput: (output) => ({ type: "text", value: output }),
|
||||
};
|
||||
|
||||
export default frontendModelProvider;
|
||||
108
app/src/modelProviders/openpipe-chat/getCompletion.ts
Normal file
108
app/src/modelProviders/openpipe-chat/getCompletion.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
import { isArray, isString } from "lodash-es";
|
||||
import OpenAI, { APIError } from "openai";
|
||||
|
||||
import { type CompletionResponse } from "../types";
|
||||
import { type OpenpipeChatInput, type OpenpipeChatOutput } from ".";
|
||||
import frontendModelProvider from "./frontend";
|
||||
|
||||
const modelEndpoints: Record<OpenpipeChatInput["model"], string> = {
|
||||
"Open-Orca/OpenOrcaxOpenChat-Preview2-13B": "https://5ef82gjxk8kdys-8000.proxy.runpod.net/v1",
|
||||
// "Open-Orca/OpenOrca-Platypus2-13B": "https://lt5qlel6qcji8t-8000.proxy.runpod.net/v1",
|
||||
// "stabilityai/StableBeluga-13B": "https://vcorl8mxni2ou1-8000.proxy.runpod.net/v1",
|
||||
"NousResearch/Nous-Hermes-Llama2-13b": "https://ncv8pw3u0vb8j2-8000.proxy.runpod.net/v1",
|
||||
"jondurbin/airoboros-l2-13b-gpt4-2.0": "https://9nrbx7oph4btou-8000.proxy.runpod.net/v1",
|
||||
};
|
||||
|
||||
export async function getCompletion(
|
||||
input: OpenpipeChatInput,
|
||||
onStream: ((partialOutput: OpenpipeChatOutput) => void) | null,
|
||||
): Promise<CompletionResponse<OpenpipeChatOutput>> {
|
||||
const { model, messages, ...rest } = input;
|
||||
|
||||
const templatedPrompt = frontendModelProvider.models[model].templatePrompt?.(messages);
|
||||
|
||||
if (!templatedPrompt) {
|
||||
return {
|
||||
type: "error",
|
||||
message: "Failed to generate prompt",
|
||||
autoRetry: false,
|
||||
};
|
||||
}
|
||||
|
||||
const openai = new OpenAI({
|
||||
baseURL: modelEndpoints[model],
|
||||
});
|
||||
const start = Date.now();
|
||||
let finalCompletion: OpenpipeChatOutput = "";
|
||||
|
||||
try {
|
||||
if (onStream) {
|
||||
const resp = await openai.completions.create(
|
||||
{ model, prompt: templatedPrompt, ...rest, stream: true },
|
||||
{
|
||||
maxRetries: 0,
|
||||
},
|
||||
);
|
||||
|
||||
for await (const part of resp) {
|
||||
finalCompletion += part.choices[0]?.text;
|
||||
onStream(finalCompletion);
|
||||
}
|
||||
if (!finalCompletion) {
|
||||
return {
|
||||
type: "error",
|
||||
message: "Streaming failed to return a completion",
|
||||
autoRetry: false,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
const resp = await openai.completions.create(
|
||||
{ model, prompt: templatedPrompt, ...rest, stream: false },
|
||||
{
|
||||
maxRetries: 0,
|
||||
},
|
||||
);
|
||||
finalCompletion = resp.choices[0]?.text || "";
|
||||
if (!finalCompletion) {
|
||||
return {
|
||||
type: "error",
|
||||
message: "Failed to return a completion",
|
||||
autoRetry: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
const timeToComplete = Date.now() - start;
|
||||
|
||||
return {
|
||||
type: "success",
|
||||
statusCode: 200,
|
||||
value: finalCompletion,
|
||||
timeToComplete,
|
||||
};
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof APIError) {
|
||||
// The types from the sdk are wrong
|
||||
const rawMessage = error.message as string | string[];
|
||||
// If the message is not a string, stringify it
|
||||
const message = isString(rawMessage)
|
||||
? rawMessage
|
||||
: isArray(rawMessage)
|
||||
? rawMessage.map((m) => m.toString()).join("\n")
|
||||
: (rawMessage as any).toString();
|
||||
return {
|
||||
type: "error",
|
||||
message,
|
||||
autoRetry: error.status === 429 || error.status === 503,
|
||||
statusCode: error.status,
|
||||
};
|
||||
} else {
|
||||
console.error(error);
|
||||
return {
|
||||
type: "error",
|
||||
message: (error as Error).message,
|
||||
autoRetry: true,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
51
app/src/modelProviders/openpipe-chat/index.ts
Normal file
51
app/src/modelProviders/openpipe-chat/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { type JSONSchema4 } from "json-schema";
|
||||
import { type ModelProvider } from "../types";
|
||||
import inputSchema from "./input.schema.json";
|
||||
import { getCompletion } from "./getCompletion";
|
||||
import frontendModelProvider from "./frontend";
|
||||
|
||||
const supportedModels = [
|
||||
"Open-Orca/OpenOrcaxOpenChat-Preview2-13B",
|
||||
// "Open-Orca/OpenOrca-Platypus2-13B",
|
||||
// "stabilityai/StableBeluga-13B",
|
||||
"NousResearch/Nous-Hermes-Llama2-13b",
|
||||
"jondurbin/airoboros-l2-13b-gpt4-2.0",
|
||||
] as const;
|
||||
|
||||
export type SupportedModel = (typeof supportedModels)[number];
|
||||
|
||||
export type OpenpipeChatInput = {
|
||||
model: SupportedModel;
|
||||
messages: {
|
||||
role: "system" | "user" | "assistant";
|
||||
content: string;
|
||||
}[];
|
||||
temperature?: number;
|
||||
top_p?: number;
|
||||
stop?: string[] | string;
|
||||
max_tokens?: number;
|
||||
presence_penalty?: number;
|
||||
frequency_penalty?: number;
|
||||
};
|
||||
|
||||
export type OpenpipeChatOutput = string;
|
||||
|
||||
export type OpenpipeChatModelProvider = ModelProvider<
|
||||
SupportedModel,
|
||||
OpenpipeChatInput,
|
||||
OpenpipeChatOutput
|
||||
>;
|
||||
|
||||
const modelProvider: OpenpipeChatModelProvider = {
|
||||
getModel: (input) => input.model,
|
||||
inputSchema: inputSchema as JSONSchema4,
|
||||
canStream: true,
|
||||
getCompletion,
|
||||
getUsage: (input, output) => {
|
||||
// TODO: Implement this
|
||||
return null;
|
||||
},
|
||||
...frontendModelProvider,
|
||||
};
|
||||
|
||||
export default modelProvider;
|
||||
92
app/src/modelProviders/openpipe-chat/input.schema.json
Normal file
92
app/src/modelProviders/openpipe-chat/input.schema.json
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model": {
|
||||
"description": "ID of the model to use.",
|
||||
"example": "Open-Orca/OpenOrcaxOpenChat-Preview2-13B",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Open-Orca/OpenOrcaxOpenChat-Preview2-13B",
|
||||
"NousResearch/Nous-Hermes-Llama2-13b",
|
||||
"jondurbin/airoboros-l2-13b-gpt4-2.0"
|
||||
]
|
||||
},
|
||||
"messages": {
|
||||
"description": "A list of messages comprising the conversation so far.",
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"role": {
|
||||
"type": "string",
|
||||
"enum": ["system", "user", "assistant"],
|
||||
"description": "The role of the messages author. One of `system`, `user`, or `assistant`."
|
||||
},
|
||||
"content": {
|
||||
"type": "string",
|
||||
"description": "The contents of the message. `content` is required for all messages."
|
||||
}
|
||||
},
|
||||
"required": ["role", "content"]
|
||||
}
|
||||
},
|
||||
"temperature": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 2,
|
||||
"default": 1,
|
||||
"example": 1,
|
||||
"nullable": true,
|
||||
"description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n"
|
||||
},
|
||||
"top_p": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"default": 1,
|
||||
"example": 1,
|
||||
"nullable": true,
|
||||
"description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n"
|
||||
},
|
||||
"stop": {
|
||||
"description": "Up to 4 sequences where the API will stop generating further tokens.\n",
|
||||
"default": null,
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 4,
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"max_tokens": {
|
||||
"description": "The maximum number of [tokens](/tokenizer) to generate in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens.\n",
|
||||
"type": "integer"
|
||||
},
|
||||
"presence_penalty": {
|
||||
"type": "number",
|
||||
"default": 0,
|
||||
"minimum": -2,
|
||||
"maximum": 2,
|
||||
"nullable": true,
|
||||
"description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)\n"
|
||||
},
|
||||
"frequency_penalty": {
|
||||
"type": "number",
|
||||
"default": 0,
|
||||
"minimum": -2,
|
||||
"maximum": 2,
|
||||
"nullable": true,
|
||||
"description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)\n"
|
||||
}
|
||||
},
|
||||
"required": ["model", "messages"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { type RefinementAction } from "../types";
|
||||
|
||||
export const refinementActions: Record<string, RefinementAction> = {};
|
||||
181
app/src/modelProviders/openpipe-chat/templatePrompt.ts
Normal file
181
app/src/modelProviders/openpipe-chat/templatePrompt.ts
Normal file
@@ -0,0 +1,181 @@
|
||||
import { type OpenpipeChatInput } from ".";
|
||||
|
||||
// User: Hello<|end_of_turn|>Assistant: Hi<|end_of_turn|>User: How are you today?<|end_of_turn|>Assistant:
|
||||
export const templateOpenOrcaPrompt = (messages: OpenpipeChatInput["messages"]) => {
|
||||
const splitter = "<|end_of_turn|>";
|
||||
|
||||
const formattedMessages = messages.map((message) => {
|
||||
if (message.role === "system" || message.role === "user") {
|
||||
return "User: " + message.content;
|
||||
} else {
|
||||
return "Assistant: " + message.content;
|
||||
}
|
||||
});
|
||||
|
||||
let prompt = formattedMessages.join(splitter);
|
||||
|
||||
// Ensure that the prompt ends with an assistant message
|
||||
const lastUserIndex = prompt.lastIndexOf("User:");
|
||||
const lastAssistantIndex = prompt.lastIndexOf("Assistant:");
|
||||
if (lastUserIndex > lastAssistantIndex) {
|
||||
prompt += splitter + "Assistant:";
|
||||
}
|
||||
|
||||
return prompt;
|
||||
};
|
||||
|
||||
// ### Instruction:
|
||||
|
||||
// <prompt> (without the <>)
|
||||
|
||||
// ### Response:
|
||||
export const templateAlpacaInstructPrompt = (messages: OpenpipeChatInput["messages"]) => {
|
||||
const splitter = "\n\n";
|
||||
|
||||
const userTag = "### Instruction:\n\n";
|
||||
const assistantTag = "### Response: \n\n";
|
||||
|
||||
const formattedMessages = messages.map((message) => {
|
||||
if (message.role === "system" || message.role === "user") {
|
||||
return userTag + message.content;
|
||||
} else {
|
||||
return assistantTag + message.content;
|
||||
}
|
||||
});
|
||||
|
||||
let prompt = formattedMessages.join(splitter);
|
||||
|
||||
// Ensure that the prompt ends with an assistant message
|
||||
const lastUserIndex = prompt.lastIndexOf(userTag);
|
||||
const lastAssistantIndex = prompt.lastIndexOf(assistantTag);
|
||||
if (lastUserIndex > lastAssistantIndex) {
|
||||
prompt += splitter + assistantTag;
|
||||
}
|
||||
|
||||
return prompt.trim();
|
||||
};
|
||||
|
||||
// ### System:
|
||||
// This is a system prompt, please behave and help the user.
|
||||
|
||||
// ### User:
|
||||
// Your prompt here
|
||||
|
||||
// ### Assistant
|
||||
// The output of Stable Beluga 13B
|
||||
export const templateSystemUserAssistantPrompt = (messages: OpenpipeChatInput["messages"]) => {
|
||||
const splitter = "\n\n";
|
||||
|
||||
const systemTag = "### System:\n";
|
||||
const userTag = "### User:\n";
|
||||
const assistantTag = "### Assistant\n";
|
||||
|
||||
const formattedMessages = messages.map((message) => {
|
||||
if (message.role === "system") {
|
||||
return systemTag + message.content;
|
||||
} else if (message.role === "user") {
|
||||
return userTag + message.content;
|
||||
} else {
|
||||
return assistantTag + message.content;
|
||||
}
|
||||
});
|
||||
|
||||
let prompt = formattedMessages.join(splitter);
|
||||
|
||||
// Ensure that the prompt ends with an assistant message
|
||||
const lastSystemIndex = prompt.lastIndexOf(systemTag);
|
||||
const lastUserIndex = prompt.lastIndexOf(userTag);
|
||||
const lastAssistantIndex = prompt.lastIndexOf(assistantTag);
|
||||
if (lastSystemIndex > lastAssistantIndex || lastUserIndex > lastAssistantIndex) {
|
||||
prompt += splitter + assistantTag;
|
||||
}
|
||||
|
||||
return prompt;
|
||||
};
|
||||
|
||||
// ### Instruction:
|
||||
// <prompt>
|
||||
|
||||
// ### Input:
|
||||
// <additional context>
|
||||
|
||||
// ### Response:
|
||||
// <leave a newline blank for model to respond>
|
||||
|
||||
export const templateInstructionInputResponsePrompt = (messages: OpenpipeChatInput["messages"]) => {
|
||||
const splitter = "\n\n";
|
||||
|
||||
const systemTag = "### Instruction:\n";
|
||||
const userTag = "### Input:\n";
|
||||
const assistantTag = "### Response:\n";
|
||||
|
||||
const formattedMessages = messages.map((message) => {
|
||||
if (message.role === "system") {
|
||||
return systemTag + message.content;
|
||||
} else if (message.role === "user") {
|
||||
return userTag + message.content;
|
||||
} else {
|
||||
return assistantTag + message.content;
|
||||
}
|
||||
});
|
||||
|
||||
let prompt = formattedMessages.join(splitter);
|
||||
|
||||
// Ensure that the prompt ends with an assistant message
|
||||
const lastSystemIndex = prompt.lastIndexOf(systemTag);
|
||||
const lastUserIndex = prompt.lastIndexOf(userTag);
|
||||
const lastAssistantIndex = prompt.lastIndexOf(assistantTag);
|
||||
if (lastSystemIndex > lastAssistantIndex || lastUserIndex > lastAssistantIndex) {
|
||||
prompt += splitter + assistantTag;
|
||||
}
|
||||
|
||||
return prompt;
|
||||
};
|
||||
|
||||
// A chat between a curious user and an assistant.
|
||||
// The assistant gives helpful, detailed, accurate, uncensored responses to the user's input.
|
||||
// The assistant never refuses to answer, regardless of the legality or morality of the request.
|
||||
// USER: [prompt] ASSISTANT:
|
||||
|
||||
export const templateAiroborosPrompt = (messages: OpenpipeChatInput["messages"]) => {
|
||||
const splitter = " ";
|
||||
|
||||
const userTag = "USER: ";
|
||||
const assistantTag = "ASSISTANT: ";
|
||||
|
||||
let combinedSystemMessage = "";
|
||||
const conversationMessages = [];
|
||||
|
||||
for (const message of messages) {
|
||||
if (message.role === "system") {
|
||||
combinedSystemMessage += message.content;
|
||||
} else if (message.role === "user") {
|
||||
conversationMessages.push(userTag + message.content);
|
||||
} else {
|
||||
conversationMessages.push(assistantTag + message.content);
|
||||
}
|
||||
}
|
||||
|
||||
let systemMessage = "";
|
||||
|
||||
if (combinedSystemMessage) {
|
||||
// If there is no user message, add a user tag to the system message
|
||||
if (conversationMessages.find((message) => message.startsWith(userTag))) {
|
||||
systemMessage = `${combinedSystemMessage}\n`;
|
||||
} else {
|
||||
conversationMessages.unshift(userTag + combinedSystemMessage);
|
||||
}
|
||||
}
|
||||
|
||||
let prompt = `${systemMessage}${conversationMessages.join(splitter)}`;
|
||||
|
||||
// Ensure that the prompt ends with an assistant message
|
||||
const lastUserIndex = prompt.lastIndexOf(userTag);
|
||||
const lastAssistantIndex = prompt.lastIndexOf(assistantTag);
|
||||
|
||||
if (lastUserIndex > lastAssistantIndex) {
|
||||
prompt += splitter + assistantTag;
|
||||
}
|
||||
|
||||
return prompt;
|
||||
};
|
||||
@@ -8,7 +8,7 @@ const replicate = new Replicate({
|
||||
});
|
||||
|
||||
const modelIds: Record<ReplicateLlama2Input["model"], string> = {
|
||||
"7b-chat": "4f0b260b6a13eb53a6b1891f089d57c08f41003ae79458be5011303d81a394dc",
|
||||
"7b-chat": "7b0bfc9aff140d5b75bacbed23e91fd3c34b01a1e958d32132de6e0a19796e2c",
|
||||
"13b-chat": "2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52",
|
||||
"70b-chat": "2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1",
|
||||
};
|
||||
|
||||
@@ -2,11 +2,13 @@ import { type JSONSchema4 } from "json-schema";
|
||||
import { type IconType } from "react-icons";
|
||||
import { type JsonValue } from "type-fest";
|
||||
import { z } from "zod";
|
||||
import { type OpenpipeChatInput } from "./openpipe-chat";
|
||||
|
||||
export const ZodSupportedProvider = z.union([
|
||||
z.literal("openai/ChatCompletion"),
|
||||
z.literal("replicate/llama2"),
|
||||
z.literal("anthropic/completion"),
|
||||
z.literal("openpipe/Chat"),
|
||||
]);
|
||||
|
||||
export type SupportedProvider = z.infer<typeof ZodSupportedProvider>;
|
||||
@@ -22,6 +24,7 @@ export type Model = {
|
||||
description?: string;
|
||||
learnMoreUrl?: string;
|
||||
apiDocsUrl?: string;
|
||||
templatePrompt?: (initialPrompt: OpenpipeChatInput["messages"]) => string;
|
||||
};
|
||||
|
||||
export type ProviderModel = { provider: z.infer<typeof ZodSupportedProvider>; model: string };
|
||||
|
||||
@@ -26,26 +26,6 @@ import Head from "next/head";
|
||||
import PageHeaderContainer from "~/components/nav/PageHeaderContainer";
|
||||
import ProjectBreadcrumbContents from "~/components/nav/ProjectBreadcrumbContents";
|
||||
|
||||
// TODO: import less to fix deployment with server side props
|
||||
// export const getServerSideProps = async (context: GetServerSidePropsContext<{ id: string }>) => {
|
||||
// const experimentId = context.params?.id as string;
|
||||
|
||||
// const helpers = createServerSideHelpers({
|
||||
// router: appRouter,
|
||||
// ctx: createInnerTRPCContext({ session: null }),
|
||||
// transformer: superjson, // optional - adds superjson serialization
|
||||
// });
|
||||
|
||||
// // prefetch query
|
||||
// await helpers.experiments.stats.prefetch({ id: experimentId });
|
||||
|
||||
// return {
|
||||
// props: {
|
||||
// trpcState: helpers.dehydrate(),
|
||||
// },
|
||||
// };
|
||||
// };
|
||||
|
||||
export default function Experiment() {
|
||||
const router = useRouter();
|
||||
const utils = api.useContext();
|
||||
|
||||
110
app/src/pages/invitations/[invitationToken].tsx
Normal file
110
app/src/pages/invitations/[invitationToken].tsx
Normal file
@@ -0,0 +1,110 @@
|
||||
import { Center, Text, VStack, HStack, Button, Card } from "@chakra-ui/react";
|
||||
|
||||
import { useRouter } from "next/router";
|
||||
import AppShell from "~/components/nav/AppShell";
|
||||
import { api } from "~/utils/api";
|
||||
import { useHandledAsyncCallback } from "~/utils/hooks";
|
||||
import { useAppStore } from "~/state/store";
|
||||
import { useSyncVariantEditor } from "~/state/sync";
|
||||
import { maybeReportError } from "~/utils/errorHandling/maybeReportError";
|
||||
|
||||
export default function Invitation() {
|
||||
const router = useRouter();
|
||||
const utils = api.useContext();
|
||||
useSyncVariantEditor();
|
||||
|
||||
const setSelectedProjectId = useAppStore((state) => state.setSelectedProjectId);
|
||||
|
||||
const invitationToken = router.query.invitationToken as string | undefined;
|
||||
|
||||
const invitation = api.users.getProjectInvitation.useQuery(
|
||||
{ invitationToken: invitationToken as string },
|
||||
{ enabled: !!invitationToken },
|
||||
);
|
||||
|
||||
const cancelMutation = api.users.cancelProjectInvitation.useMutation();
|
||||
const [declineInvitation, isDeclining] = useHandledAsyncCallback(async () => {
|
||||
if (invitationToken) {
|
||||
await cancelMutation.mutateAsync({
|
||||
invitationToken,
|
||||
});
|
||||
await router.replace("/");
|
||||
}
|
||||
}, [cancelMutation, invitationToken]);
|
||||
|
||||
const acceptMutation = api.users.acceptProjectInvitation.useMutation();
|
||||
const [acceptInvitation, isAccepting] = useHandledAsyncCallback(async () => {
|
||||
if (invitationToken) {
|
||||
const resp = await acceptMutation.mutateAsync({
|
||||
invitationToken,
|
||||
});
|
||||
if (!maybeReportError(resp) && resp) {
|
||||
await utils.projects.list.invalidate();
|
||||
setSelectedProjectId(resp.payload);
|
||||
}
|
||||
await router.replace("/");
|
||||
}
|
||||
}, [acceptMutation, invitationToken]);
|
||||
|
||||
if (invitation.isLoading) {
|
||||
return (
|
||||
<AppShell requireAuth title="Loading...">
|
||||
<Center h="full">
|
||||
<Text>Loading...</Text>
|
||||
</Center>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
|
||||
if (!invitationToken || !invitation.data) {
|
||||
return (
|
||||
<AppShell requireAuth title="Invalid invitation token">
|
||||
<Center h="full">
|
||||
<Text>
|
||||
The invitation you've received is invalid or expired. Please ask your project admin for
|
||||
a new token.
|
||||
</Text>
|
||||
</Center>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell requireAuth title="Invitation">
|
||||
<Center h="full">
|
||||
<Card>
|
||||
<VStack
|
||||
spacing={8}
|
||||
w="full"
|
||||
maxW="2xl"
|
||||
p={16}
|
||||
borderWidth={1}
|
||||
borderRadius={8}
|
||||
bgColor="white"
|
||||
>
|
||||
<Text fontSize="lg" fontWeight="bold">
|
||||
You're invited! 🎉
|
||||
</Text>
|
||||
<Text textAlign="center">
|
||||
You've been invited to join <b>{invitation.data.project.name}</b> by{" "}
|
||||
<b>
|
||||
{invitation.data.sender.name} ({invitation.data.sender.email})
|
||||
</b>
|
||||
.
|
||||
</Text>
|
||||
<HStack spacing={4}>
|
||||
<Button colorScheme="gray" isLoading={isDeclining} onClick={declineInvitation}>
|
||||
Decline
|
||||
</Button>
|
||||
<Button colorScheme="orange" isLoading={isAccepting} onClick={acceptInvitation}>
|
||||
Accept
|
||||
</Button>
|
||||
</HStack>
|
||||
</VStack>
|
||||
</Card>
|
||||
</Center>
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -9,9 +9,11 @@ import {
|
||||
Divider,
|
||||
Icon,
|
||||
useDisclosure,
|
||||
Box,
|
||||
Tooltip,
|
||||
} from "@chakra-ui/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { BsTrash } from "react-icons/bs";
|
||||
import { BsPlus, BsTrash } from "react-icons/bs";
|
||||
|
||||
import AppShell from "~/components/nav/AppShell";
|
||||
import PageHeaderContainer from "~/components/nav/PageHeaderContainer";
|
||||
@@ -21,6 +23,8 @@ import ProjectBreadcrumbContents from "~/components/nav/ProjectBreadcrumbContent
|
||||
import CopiableCode from "~/components/CopiableCode";
|
||||
import { DeleteProjectDialog } from "~/components/projectSettings/DeleteProjectDialog";
|
||||
import AutoResizeTextArea from "~/components/AutoResizeTextArea";
|
||||
import MemberTable from "~/components/projectSettings/MemberTable";
|
||||
import { InviteMemberModal } from "~/components/projectSettings/InviteMemberModal";
|
||||
|
||||
export default function Settings() {
|
||||
const utils = api.useContext();
|
||||
@@ -50,12 +54,13 @@ export default function Settings() {
|
||||
setName(selectedProject?.name);
|
||||
}, [selectedProject?.name]);
|
||||
|
||||
const deleteProjectOpen = useDisclosure();
|
||||
const inviteMemberModal = useDisclosure();
|
||||
const deleteProjectDialog = useDisclosure();
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell>
|
||||
<PageHeaderContainer>
|
||||
<AppShell requireAuth>
|
||||
<PageHeaderContainer px={{ base: 4, md: 8 }}>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem>
|
||||
<ProjectBreadcrumbContents />
|
||||
@@ -65,7 +70,7 @@ export default function Settings() {
|
||||
</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</PageHeaderContainer>
|
||||
<VStack px={8} py={4} alignItems="flex-start" spacing={4}>
|
||||
<VStack px={{ base: 4, md: 8 }} py={4} alignItems="flex-start" spacing={4}>
|
||||
<VStack spacing={0} alignItems="flex-start">
|
||||
<Text fontSize="2xl" fontWeight="bold">
|
||||
Project Settings
|
||||
@@ -109,6 +114,37 @@ export default function Settings() {
|
||||
</Button>
|
||||
</VStack>
|
||||
<Divider backgroundColor="gray.300" />
|
||||
<VStack w="full" alignItems="flex-start">
|
||||
<Subtitle>Project Members</Subtitle>
|
||||
|
||||
<Text fontSize="sm">
|
||||
Add members to your project to allow them to view and edit your project's data.
|
||||
</Text>
|
||||
<Box mt={4} w="full">
|
||||
<MemberTable />
|
||||
</Box>
|
||||
<Tooltip
|
||||
isDisabled={selectedProject?.role === "ADMIN"}
|
||||
label="Only admins can invite new members"
|
||||
hasArrow
|
||||
>
|
||||
<Button
|
||||
variant="outline"
|
||||
colorScheme="orange"
|
||||
borderRadius={4}
|
||||
onClick={inviteMemberModal.onOpen}
|
||||
mt={2}
|
||||
_disabled={{
|
||||
opacity: 0.6,
|
||||
}}
|
||||
isDisabled={selectedProject?.role !== "ADMIN"}
|
||||
>
|
||||
<Icon as={BsPlus} boxSize={5} />
|
||||
<Text>Invite New Member</Text>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</VStack>
|
||||
<Divider backgroundColor="gray.300" />
|
||||
<VStack alignItems="flex-start">
|
||||
<Subtitle>Project API Key</Subtitle>
|
||||
<Text fontSize="sm">
|
||||
@@ -141,7 +177,7 @@ export default function Settings() {
|
||||
borderRadius={4}
|
||||
mt={2}
|
||||
height="auto"
|
||||
onClick={deleteProjectOpen.onOpen}
|
||||
onClick={deleteProjectDialog.onOpen}
|
||||
>
|
||||
<Icon as={BsTrash} />
|
||||
<Text overflowWrap="break-word" whiteSpace="normal" py={2}>
|
||||
@@ -153,7 +189,11 @@ export default function Settings() {
|
||||
</VStack>
|
||||
</VStack>
|
||||
</AppShell>
|
||||
<DeleteProjectDialog isOpen={deleteProjectOpen.isOpen} onClose={deleteProjectOpen.onClose} />
|
||||
<InviteMemberModal isOpen={inviteMemberModal.isOpen} onClose={inviteMemberModal.onClose} />
|
||||
<DeleteProjectDialog
|
||||
isOpen={deleteProjectDialog.isOpen}
|
||||
onClose={deleteProjectDialog.onClose}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import { datasetEntries } from "./routers/datasetEntries.router";
|
||||
import { projectsRouter } from "./routers/projects.router";
|
||||
import { dashboardRouter } from "./routers/dashboard.router";
|
||||
import { loggedCallsRouter } from "./routers/loggedCalls.router";
|
||||
import { usersRouter } from "./routers/users.router";
|
||||
|
||||
/**
|
||||
* This is the primary router for your server.
|
||||
@@ -30,6 +31,7 @@ export const appRouter = createTRPCRouter({
|
||||
projects: projectsRouter,
|
||||
dashboard: dashboardRouter,
|
||||
loggedCalls: loggedCallsRouter,
|
||||
users: usersRouter,
|
||||
});
|
||||
|
||||
// export type definition of API
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { type Expression, type SqlBool, sql } from "kysely";
|
||||
import { type Expression, type SqlBool, sql, type RawBuilder } from "kysely";
|
||||
import { jsonArrayFrom } from "kysely/helpers/postgres";
|
||||
|
||||
import { createTRPCRouter, protectedProcedure } from "~/server/api/trpc";
|
||||
@@ -8,15 +8,22 @@ import { comparators, defaultFilterableFields } from "~/state/logFiltersSlice";
|
||||
import { requireCanViewProject } from "~/utils/accessControl";
|
||||
|
||||
// create comparator type based off of comparators
|
||||
const comparatorToSqlValue = (comparator: (typeof comparators)[number], value: string) => {
|
||||
switch (comparator) {
|
||||
case "=":
|
||||
return `= '${value}'`;
|
||||
case "!=":
|
||||
return `!= '${value}'`;
|
||||
case "CONTAINS":
|
||||
return `like '%${value}%'`;
|
||||
}
|
||||
const comparatorToSqlExpression = (comparator: (typeof comparators)[number], value: string) => {
|
||||
return (reference: RawBuilder<unknown>): Expression<SqlBool> => {
|
||||
switch (comparator) {
|
||||
case "=":
|
||||
return sql`${reference} = ${value}`;
|
||||
case "!=":
|
||||
// Handle NULL values
|
||||
return sql`${reference} IS DISTINCT FROM ${value}`;
|
||||
case "CONTAINS":
|
||||
return sql`${reference} LIKE ${"%" + value + "%"}`;
|
||||
case "NOT_CONTAINS":
|
||||
return sql`(${reference} NOT LIKE ${"%" + value + "%"} OR ${reference} IS NULL)`;
|
||||
default:
|
||||
throw new Error("Unknown comparator");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const loggedCallsRouter = createTRPCRouter({
|
||||
@@ -30,7 +37,7 @@ export const loggedCallsRouter = createTRPCRouter({
|
||||
z.object({
|
||||
field: z.string(),
|
||||
comparator: z.enum(comparators),
|
||||
value: z.string().optional(),
|
||||
value: z.string(),
|
||||
}),
|
||||
),
|
||||
}),
|
||||
@@ -48,40 +55,19 @@ export const loggedCallsRouter = createTRPCRouter({
|
||||
|
||||
for (const filter of input.filters) {
|
||||
if (!filter.value) continue;
|
||||
const filterExpression = comparatorToSqlExpression(filter.comparator, filter.value);
|
||||
|
||||
if (filter.field === "Request") {
|
||||
wheres.push(
|
||||
sql.raw(
|
||||
`lcmr."reqPayload"::text ${comparatorToSqlValue(
|
||||
filter.comparator,
|
||||
filter.value,
|
||||
)}`,
|
||||
),
|
||||
);
|
||||
wheres.push(filterExpression(sql.raw(`lcmr."reqPayload"::text`)));
|
||||
}
|
||||
if (filter.field === "Response") {
|
||||
wheres.push(
|
||||
sql.raw(
|
||||
`lcmr."respPayload"::text ${comparatorToSqlValue(
|
||||
filter.comparator,
|
||||
filter.value,
|
||||
)}`,
|
||||
),
|
||||
);
|
||||
wheres.push(filterExpression(sql.raw(`lcmr."respPayload"::text`)));
|
||||
}
|
||||
if (filter.field === "Model") {
|
||||
wheres.push(
|
||||
sql.raw(`lc."model" ${comparatorToSqlValue(filter.comparator, filter.value)}`),
|
||||
);
|
||||
wheres.push(filterExpression(sql.raw(`lc."model"`)));
|
||||
}
|
||||
if (filter.field === "Status Code") {
|
||||
wheres.push(
|
||||
sql.raw(
|
||||
`lcmr."statusCode"::text ${comparatorToSqlValue(
|
||||
filter.comparator,
|
||||
filter.value,
|
||||
)}`,
|
||||
),
|
||||
);
|
||||
wheres.push(filterExpression(sql.raw(`lcmr."statusCode"::text`)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,15 +87,15 @@ export const loggedCallsRouter = createTRPCRouter({
|
||||
const filter = tagFilters[i];
|
||||
if (!filter?.value) continue;
|
||||
const tableAlias = `lct${i}`;
|
||||
const filterExpression = comparatorToSqlExpression(filter.comparator, filter.value);
|
||||
|
||||
updatedBaseQuery = updatedBaseQuery
|
||||
.leftJoin(`LoggedCallTag as ${tableAlias}`, (join) =>
|
||||
join
|
||||
.onRef("lc.id", "=", `${tableAlias}.loggedCallId`)
|
||||
.on(`${tableAlias}.name`, "=", filter.field),
|
||||
)
|
||||
.where(
|
||||
sql.raw(`${tableAlias}.value ${comparatorToSqlValue(filter.comparator, filter.value)}`),
|
||||
) as unknown as typeof baseQuery;
|
||||
.where(filterExpression(sql.raw(`${tableAlias}.value`))) as unknown as typeof baseQuery;
|
||||
}
|
||||
|
||||
const rawCalls = await updatedBaseQuery
|
||||
|
||||
@@ -51,6 +51,12 @@ export const projectsRouter = createTRPCRouter({
|
||||
include: {
|
||||
apiKeys: true,
|
||||
personalProjectUser: true,
|
||||
projectUsers: {
|
||||
include: {
|
||||
user: true,
|
||||
},
|
||||
},
|
||||
projectUserInvitations: true,
|
||||
},
|
||||
}),
|
||||
prisma.projectUser.findFirst({
|
||||
@@ -58,7 +64,7 @@ export const projectsRouter = createTRPCRouter({
|
||||
userId: ctx.session.user.id,
|
||||
projectId: input.id,
|
||||
role: {
|
||||
in: ["ADMIN", "MEMBER"],
|
||||
in: ["ADMIN", "MEMBER", "VIEWER"],
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { z } from "zod";
|
||||
import modelProviders from "~/modelProviders/modelProviders";
|
||||
import { createTRPCRouter, protectedProcedure, publicProcedure } from "~/server/api/trpc";
|
||||
import { prisma } from "~/server/db";
|
||||
import { queueQueryModel } from "~/server/tasks/queryModel.task";
|
||||
@@ -96,4 +98,46 @@ export const scenarioVariantCellsRouter = createTRPCRouter({
|
||||
|
||||
await queueQueryModel(cell.id, true);
|
||||
}),
|
||||
getTemplatedPromptMessage: publicProcedure
|
||||
.input(
|
||||
z.object({
|
||||
cellId: z.string(),
|
||||
}),
|
||||
)
|
||||
.query(async ({ input }) => {
|
||||
const cell = await prisma.scenarioVariantCell.findUnique({
|
||||
where: { id: input.cellId },
|
||||
include: {
|
||||
promptVariant: true,
|
||||
modelResponses: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!cell) {
|
||||
throw new TRPCError({
|
||||
code: "NOT_FOUND",
|
||||
});
|
||||
}
|
||||
|
||||
const promptMessages = (cell.prompt as { messages: [] })["messages"];
|
||||
|
||||
if (!promptMessages) return null;
|
||||
|
||||
const { modelProvider, model } = cell.promptVariant;
|
||||
|
||||
const provider = modelProviders[modelProvider as keyof typeof modelProviders];
|
||||
|
||||
if (!provider) return null;
|
||||
|
||||
const modelObj = provider.models[model as keyof typeof provider.models];
|
||||
|
||||
const templatePrompt = modelObj?.templatePrompt;
|
||||
|
||||
if (!templatePrompt) return null;
|
||||
|
||||
return {
|
||||
templatedPrompt: templatePrompt(promptMessages),
|
||||
learnMoreUrl: modelObj.learnMoreUrl,
|
||||
};
|
||||
}),
|
||||
});
|
||||
|
||||
232
app/src/server/api/routers/users.router.ts
Normal file
232
app/src/server/api/routers/users.router.ts
Normal file
@@ -0,0 +1,232 @@
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { z } from "zod";
|
||||
|
||||
import { createTRPCRouter, protectedProcedure } from "~/server/api/trpc";
|
||||
import { prisma } from "~/server/db";
|
||||
import { error, success } from "~/utils/errorHandling/standardResponses";
|
||||
import { requireIsProjectAdmin, requireNothing } from "~/utils/accessControl";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { sendProjectInvitation } from "~/server/emails/sendProjectInvitation";
|
||||
|
||||
export const usersRouter = createTRPCRouter({
|
||||
inviteToProject: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
projectId: z.string(),
|
||||
email: z.string().email(),
|
||||
role: z.enum(["ADMIN", "MEMBER", "VIEWER"]),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
await requireIsProjectAdmin(input.projectId, ctx);
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
email: input.email,
|
||||
},
|
||||
});
|
||||
|
||||
if (user) {
|
||||
const existingMembership = await prisma.projectUser.findUnique({
|
||||
where: {
|
||||
projectId_userId: {
|
||||
projectId: input.projectId,
|
||||
userId: user.id,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (existingMembership) {
|
||||
return error(`A user with ${input.email} is already a member of this project`);
|
||||
}
|
||||
}
|
||||
|
||||
const invitation = await prisma.userInvitation.upsert({
|
||||
where: {
|
||||
projectId_email: {
|
||||
projectId: input.projectId,
|
||||
email: input.email,
|
||||
},
|
||||
},
|
||||
update: {
|
||||
role: input.role,
|
||||
},
|
||||
create: {
|
||||
projectId: input.projectId,
|
||||
email: input.email,
|
||||
role: input.role,
|
||||
invitationToken: uuidv4(),
|
||||
senderId: ctx.session.user.id,
|
||||
},
|
||||
include: {
|
||||
project: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
await sendProjectInvitation({
|
||||
invitationToken: invitation.invitationToken,
|
||||
recipientEmail: input.email,
|
||||
invitationSenderName: ctx.session.user.name || "",
|
||||
invitationSenderEmail: ctx.session.user.email || "",
|
||||
projectName: invitation.project.name,
|
||||
});
|
||||
} catch (e) {
|
||||
// If we fail to send the email, we should delete the invitation
|
||||
await prisma.userInvitation.delete({
|
||||
where: {
|
||||
invitationToken: invitation.invitationToken,
|
||||
},
|
||||
});
|
||||
return error("Failed to send email");
|
||||
}
|
||||
|
||||
return success();
|
||||
}),
|
||||
getProjectInvitation: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
invitationToken: z.string(),
|
||||
}),
|
||||
)
|
||||
.query(async ({ input, ctx }) => {
|
||||
requireNothing(ctx);
|
||||
|
||||
const invitation = await prisma.userInvitation.findUnique({
|
||||
where: {
|
||||
invitationToken: input.invitationToken,
|
||||
},
|
||||
include: {
|
||||
project: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
select: {
|
||||
name: true,
|
||||
email: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!invitation) {
|
||||
throw new TRPCError({ code: "NOT_FOUND" });
|
||||
}
|
||||
|
||||
return invitation;
|
||||
}),
|
||||
acceptProjectInvitation: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
invitationToken: z.string(),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
requireNothing(ctx);
|
||||
|
||||
const invitation = await prisma.userInvitation.findUnique({
|
||||
where: {
|
||||
invitationToken: input.invitationToken,
|
||||
},
|
||||
});
|
||||
|
||||
if (!invitation) {
|
||||
throw new TRPCError({ code: "NOT_FOUND" });
|
||||
}
|
||||
|
||||
await prisma.projectUser.create({
|
||||
data: {
|
||||
projectId: invitation.projectId,
|
||||
userId: ctx.session.user.id,
|
||||
role: invitation.role,
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.userInvitation.delete({
|
||||
where: {
|
||||
invitationToken: input.invitationToken,
|
||||
},
|
||||
});
|
||||
|
||||
return success(invitation.projectId);
|
||||
}),
|
||||
cancelProjectInvitation: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
invitationToken: z.string(),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
requireNothing(ctx);
|
||||
|
||||
const invitation = await prisma.userInvitation.findUnique({
|
||||
where: {
|
||||
invitationToken: input.invitationToken,
|
||||
},
|
||||
});
|
||||
|
||||
if (!invitation) {
|
||||
throw new TRPCError({ code: "NOT_FOUND" });
|
||||
}
|
||||
|
||||
await prisma.userInvitation.delete({
|
||||
where: {
|
||||
invitationToken: input.invitationToken,
|
||||
},
|
||||
});
|
||||
|
||||
return success();
|
||||
}),
|
||||
editProjectUserRole: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
projectId: z.string(),
|
||||
userId: z.string(),
|
||||
role: z.enum(["ADMIN", "MEMBER", "VIEWER"]),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
await requireIsProjectAdmin(input.projectId, ctx);
|
||||
|
||||
await prisma.projectUser.update({
|
||||
where: {
|
||||
projectId_userId: {
|
||||
projectId: input.projectId,
|
||||
userId: input.userId,
|
||||
},
|
||||
},
|
||||
data: {
|
||||
role: input.role,
|
||||
},
|
||||
});
|
||||
|
||||
return success();
|
||||
}),
|
||||
removeUserFromProject: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
projectId: z.string(),
|
||||
userId: z.string(),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
await requireIsProjectAdmin(input.projectId, ctx);
|
||||
|
||||
await prisma.projectUser.delete({
|
||||
where: {
|
||||
projectId_userId: {
|
||||
projectId: input.projectId,
|
||||
userId: input.userId,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return success();
|
||||
}),
|
||||
});
|
||||
31
app/src/server/emails/sendEmail.ts
Normal file
31
app/src/server/emails/sendEmail.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { marked } from "marked";
|
||||
import nodemailer from "nodemailer";
|
||||
import { env } from "~/env.mjs";
|
||||
|
||||
const transporter = nodemailer.createTransport({
|
||||
// All the SMTP_ env vars come from https://app.brevo.com/settings/keys/smtp
|
||||
// @ts-expect-error nodemailer types are wrong
|
||||
host: env.SMTP_HOST,
|
||||
port: env.SMTP_PORT,
|
||||
auth: {
|
||||
user: env.SMTP_LOGIN,
|
||||
pass: env.SMTP_PASSWORD,
|
||||
},
|
||||
});
|
||||
|
||||
export const sendEmail = async (options: { to: string; subject: string; body: string }) => {
|
||||
const bodyHtml = await marked.parseInline(options.body, { mangle: false });
|
||||
|
||||
try {
|
||||
await transporter.sendMail({
|
||||
from: env.SENDER_EMAIL,
|
||||
to: options.to,
|
||||
subject: options.subject,
|
||||
html: bodyHtml,
|
||||
text: options.body,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("error sending email", error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
29
app/src/server/emails/sendProjectInvitation.ts
Normal file
29
app/src/server/emails/sendProjectInvitation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { env } from "~/env.mjs";
|
||||
import { sendEmail } from "./sendEmail";
|
||||
|
||||
export const sendProjectInvitation = async ({
|
||||
invitationToken,
|
||||
recipientEmail,
|
||||
invitationSenderName,
|
||||
invitationSenderEmail,
|
||||
projectName,
|
||||
}: {
|
||||
invitationToken: string;
|
||||
recipientEmail: string;
|
||||
invitationSenderName: string;
|
||||
invitationSenderEmail: string;
|
||||
projectName: string;
|
||||
}) => {
|
||||
const invitationLink = `${env.NEXT_PUBLIC_HOST}/invitations/${invitationToken}`;
|
||||
|
||||
const emailBody = `
|
||||
<p>You have been invited to join ${projectName} by ${invitationSenderName} (${invitationSenderEmail}).</p>
|
||||
<p>Click <a href="${invitationLink}">here</a> to accept the invitation.</p>
|
||||
`;
|
||||
|
||||
await sendEmail({
|
||||
to: recipientEmail,
|
||||
subject: "You've been invited to join a project",
|
||||
body: emailBody,
|
||||
});
|
||||
};
|
||||
@@ -1,20 +1,21 @@
|
||||
import { type SliceCreator } from "./store";
|
||||
|
||||
export const comparators = ["=", "!=", "CONTAINS"] as const;
|
||||
export const comparators = ["=", "!=", "CONTAINS", "NOT_CONTAINS"] as const;
|
||||
|
||||
export const defaultFilterableFields = ["Request", "Response", "Model", "Status Code"] as const;
|
||||
|
||||
export interface LogFilter {
|
||||
id: string;
|
||||
field: string;
|
||||
comparator: (typeof comparators)[number];
|
||||
value?: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export type LogFiltersSlice = {
|
||||
filters: LogFilter[];
|
||||
addFilter: (filter: LogFilter) => void;
|
||||
updateFilter: (index: number, filter: LogFilter) => void;
|
||||
deleteFilter: (index: number) => void;
|
||||
updateFilter: (filter: LogFilter) => void;
|
||||
deleteFilter: (id: string) => void;
|
||||
clearSelectedLogIds: () => void;
|
||||
};
|
||||
|
||||
@@ -24,12 +25,14 @@ export const createLogFiltersSlice: SliceCreator<LogFiltersSlice> = (set, get) =
|
||||
set((state) => {
|
||||
state.logFilters.filters.push(filter);
|
||||
}),
|
||||
updateFilter: (index: number, filter: LogFilter) =>
|
||||
updateFilter: (filter: LogFilter) =>
|
||||
set((state) => {
|
||||
const index = state.logFilters.filters.findIndex((f) => f.id === filter.id);
|
||||
state.logFilters.filters[index] = filter;
|
||||
}),
|
||||
deleteFilter: (index: number) =>
|
||||
deleteFilter: (id: string) =>
|
||||
set((state) => {
|
||||
const index = state.logFilters.filters.findIndex((f) => f.id === id);
|
||||
state.logFilters.filters.splice(index, 1);
|
||||
}),
|
||||
clearSelectedLogIds: () =>
|
||||
|
||||
@@ -18,7 +18,7 @@ const { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpe
|
||||
|
||||
const modalTheme = defineMultiStyleConfig({
|
||||
baseStyle: definePartsStyle({
|
||||
dialog: { borderRadius: "sm" },
|
||||
dialog: { borderRadius: "md", mx: 4 },
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
307
pnpm-lock.yaml
generated
307
pnpm-lock.yaml
generated
@@ -50,6 +50,9 @@ importers:
|
||||
'@prisma/client':
|
||||
specifier: ^4.14.0
|
||||
version: 4.14.0(prisma@4.14.0)
|
||||
'@sendinblue/client':
|
||||
specifier: ^3.3.1
|
||||
version: 3.3.1
|
||||
'@sentry/nextjs':
|
||||
specifier: ^7.61.0
|
||||
version: 7.61.0(next@13.4.2)(react@18.2.0)(webpack@5.88.2)
|
||||
@@ -137,12 +140,15 @@ importers:
|
||||
lucide-react:
|
||||
specifier: ^0.265.0
|
||||
version: 0.265.0(react@18.2.0)
|
||||
marked:
|
||||
specifier: ^7.0.3
|
||||
version: 7.0.3
|
||||
next:
|
||||
specifier: ^13.4.2
|
||||
version: 13.4.2(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0)
|
||||
next-auth:
|
||||
specifier: ^4.22.1
|
||||
version: 4.22.1(next@13.4.2)(react-dom@18.2.0)(react@18.2.0)
|
||||
version: 4.22.1(next@13.4.2)(nodemailer@6.9.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
next-query-params:
|
||||
specifier: ^4.2.3
|
||||
version: 4.2.3(next@13.4.2)(react@18.2.0)(use-query-params@2.2.1)
|
||||
@@ -152,6 +158,9 @@ importers:
|
||||
nextjs-routes:
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1(next@13.4.2)
|
||||
nodemailer:
|
||||
specifier: ^6.9.4
|
||||
version: 6.9.4
|
||||
openai:
|
||||
specifier: 4.0.0-beta.7
|
||||
version: 4.0.0-beta.7
|
||||
@@ -276,6 +285,9 @@ importers:
|
||||
'@types/node':
|
||||
specifier: ^18.16.0
|
||||
version: 18.16.0
|
||||
'@types/nodemailer':
|
||||
specifier: ^6.4.9
|
||||
version: 6.4.9
|
||||
'@types/pg':
|
||||
specifier: ^8.10.2
|
||||
version: 8.10.2
|
||||
@@ -2439,7 +2451,7 @@ packages:
|
||||
next-auth: ^4
|
||||
dependencies:
|
||||
'@prisma/client': 4.14.0(prisma@4.14.0)
|
||||
next-auth: 4.22.1(next@13.4.2)(react-dom@18.2.0)(react@18.2.0)
|
||||
next-auth: 4.22.1(next@13.4.2)(nodemailer@6.9.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
dev: false
|
||||
|
||||
/@next/env@13.4.2:
|
||||
@@ -2635,6 +2647,16 @@ packages:
|
||||
resolution: {integrity: sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==}
|
||||
dev: true
|
||||
|
||||
/@sendinblue/client@3.3.1:
|
||||
resolution: {integrity: sha512-5xNGeT5gKD5XOvl5vHk682wvjJxRPnH3nc2vOZIaDX9XKuhoMaYXyEdqlP0R/Z6gEZiHhzpZxzrdiwlngGzsgw==}
|
||||
dependencies:
|
||||
'@types/bluebird': 3.5.38
|
||||
'@types/request': 2.48.8
|
||||
bluebird: 3.7.2
|
||||
lodash: 4.17.21
|
||||
request: 2.88.2
|
||||
dev: false
|
||||
|
||||
/@sentry-internal/tracing@7.61.0:
|
||||
resolution: {integrity: sha512-zTr+MXEG4SxNxif42LIgm2RQn+JRXL2NuGhRaKSD2i4lXKFqHVGlVdoWqY5UfqnnJPokiTWIj9ejR8I5HV8Ogw==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -2957,13 +2979,21 @@ packages:
|
||||
resolution: {integrity: sha512-oYO/U4VD1DavwrKuCSQWdLG+5K22SLPem2OQaHmFcQuwHoVeGC+JGVRji2MUqZUAIQZHEonOeVfAX09hYiLsdg==}
|
||||
dev: false
|
||||
|
||||
/@types/bluebird@3.5.38:
|
||||
resolution: {integrity: sha512-yR/Kxc0dd4FfwtEoLZMoqJbM/VE/W7hXn/MIjb+axcwag0iFmSPK7OBUZq1YWLynJUoWQkfUrI7T0HDqGApNSg==}
|
||||
dev: false
|
||||
|
||||
/@types/body-parser@1.19.2:
|
||||
resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
|
||||
dependencies:
|
||||
'@types/connect': 3.4.35
|
||||
'@types/node': 18.16.0
|
||||
'@types/node': 20.4.10
|
||||
dev: true
|
||||
|
||||
/@types/caseless@0.12.2:
|
||||
resolution: {integrity: sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==}
|
||||
dev: false
|
||||
|
||||
/@types/chai-subset@1.3.3:
|
||||
resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==}
|
||||
dependencies:
|
||||
@@ -3066,7 +3096,7 @@ packages:
|
||||
/@types/express-serve-static-core@4.17.35:
|
||||
resolution: {integrity: sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==}
|
||||
dependencies:
|
||||
'@types/node': 18.16.0
|
||||
'@types/node': 20.4.10
|
||||
'@types/qs': 6.9.7
|
||||
'@types/range-parser': 1.2.4
|
||||
'@types/send': 0.17.1
|
||||
@@ -3159,6 +3189,12 @@ packages:
|
||||
resolution: {integrity: sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg==}
|
||||
dev: true
|
||||
|
||||
/@types/nodemailer@6.4.9:
|
||||
resolution: {integrity: sha512-XYG8Gv+sHjaOtUpiuytahMy2mM3rectgroNbs6R3djZEKmPNiIJwe9KqOJBGzKKnNZNKvnuvmugBgpq3w/S0ig==}
|
||||
dependencies:
|
||||
'@types/node': 20.4.10
|
||||
dev: true
|
||||
|
||||
/@types/parse-json@4.0.0:
|
||||
resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}
|
||||
dev: false
|
||||
@@ -3218,6 +3254,15 @@ packages:
|
||||
'@types/scheduler': 0.16.3
|
||||
csstype: 3.1.2
|
||||
|
||||
/@types/request@2.48.8:
|
||||
resolution: {integrity: sha512-whjk1EDJPcAR2kYHRbFl/lKeeKYTi05A15K9bnLInCVroNDCtXce57xKdI0/rQaA3K+6q0eFyUBPmqfSndUZdQ==}
|
||||
dependencies:
|
||||
'@types/caseless': 0.12.2
|
||||
'@types/node': 20.4.10
|
||||
'@types/tough-cookie': 4.0.2
|
||||
form-data: 2.5.1
|
||||
dev: false
|
||||
|
||||
/@types/scheduler@0.16.3:
|
||||
resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==}
|
||||
|
||||
@@ -3237,9 +3282,13 @@ packages:
|
||||
dependencies:
|
||||
'@types/http-errors': 2.0.1
|
||||
'@types/mime': 3.0.1
|
||||
'@types/node': 18.16.0
|
||||
'@types/node': 20.4.10
|
||||
dev: true
|
||||
|
||||
/@types/tough-cookie@4.0.2:
|
||||
resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==}
|
||||
dev: false
|
||||
|
||||
/@types/unist@2.0.7:
|
||||
resolution: {integrity: sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==}
|
||||
dev: false
|
||||
@@ -3735,6 +3784,17 @@ packages:
|
||||
is-shared-array-buffer: 1.0.2
|
||||
dev: true
|
||||
|
||||
/asn1@0.2.6:
|
||||
resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==}
|
||||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
dev: false
|
||||
|
||||
/assert-plus@1.0.0:
|
||||
resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}
|
||||
engines: {node: '>=0.8'}
|
||||
dev: false
|
||||
|
||||
/assert@2.0.0:
|
||||
resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==}
|
||||
dependencies:
|
||||
@@ -3774,6 +3834,14 @@ packages:
|
||||
resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/aws-sign2@0.7.0:
|
||||
resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==}
|
||||
dev: false
|
||||
|
||||
/aws4@1.12.0:
|
||||
resolution: {integrity: sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==}
|
||||
dev: false
|
||||
|
||||
/axe-core@4.7.2:
|
||||
resolution: {integrity: sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -3863,6 +3931,12 @@ packages:
|
||||
engines: {node: ^4.5.0 || >= 5.9}
|
||||
dev: false
|
||||
|
||||
/bcrypt-pbkdf@1.0.2:
|
||||
resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==}
|
||||
dependencies:
|
||||
tweetnacl: 0.14.5
|
||||
dev: false
|
||||
|
||||
/big.js@5.2.2:
|
||||
resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==}
|
||||
dev: true
|
||||
@@ -3872,6 +3946,10 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
dev: false
|
||||
|
||||
/bluebird@3.7.2:
|
||||
resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==}
|
||||
dev: false
|
||||
|
||||
/body-parser@1.20.1:
|
||||
resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==}
|
||||
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
|
||||
@@ -3973,6 +4051,10 @@ packages:
|
||||
/caniuse-lite@1.0.30001519:
|
||||
resolution: {integrity: sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==}
|
||||
|
||||
/caseless@0.12.0:
|
||||
resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}
|
||||
dev: false
|
||||
|
||||
/chai@4.3.7:
|
||||
resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -4224,6 +4306,10 @@ packages:
|
||||
toggle-selection: 1.0.6
|
||||
dev: false
|
||||
|
||||
/core-util-is@1.0.2:
|
||||
resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}
|
||||
dev: false
|
||||
|
||||
/core-util-is@1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
dev: false
|
||||
@@ -4411,6 +4497,13 @@ packages:
|
||||
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
|
||||
dev: true
|
||||
|
||||
/dashdash@1.14.1:
|
||||
resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==}
|
||||
engines: {node: '>=0.10'}
|
||||
dependencies:
|
||||
assert-plus: 1.0.0
|
||||
dev: false
|
||||
|
||||
/data-uri-to-buffer@4.0.1:
|
||||
resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}
|
||||
engines: {node: '>= 12'}
|
||||
@@ -4590,6 +4683,13 @@ packages:
|
||||
readable-stream: 2.3.8
|
||||
dev: false
|
||||
|
||||
/ecc-jsbn@0.1.2:
|
||||
resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==}
|
||||
dependencies:
|
||||
jsbn: 0.1.1
|
||||
safer-buffer: 2.1.2
|
||||
dev: false
|
||||
|
||||
/ee-first@1.1.1:
|
||||
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
|
||||
dev: false
|
||||
@@ -5249,6 +5349,15 @@ packages:
|
||||
type: 2.7.2
|
||||
dev: false
|
||||
|
||||
/extend@3.0.2:
|
||||
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
|
||||
dev: false
|
||||
|
||||
/extsprintf@1.3.0:
|
||||
resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==}
|
||||
engines: {'0': node >=0.6.0}
|
||||
dev: false
|
||||
|
||||
/fast-deep-equal@3.1.3:
|
||||
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
|
||||
|
||||
@@ -5377,10 +5486,32 @@ packages:
|
||||
dependencies:
|
||||
is-callable: 1.2.7
|
||||
|
||||
/forever-agent@0.6.1:
|
||||
resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==}
|
||||
dev: false
|
||||
|
||||
/form-data-encoder@1.7.2:
|
||||
resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==}
|
||||
dev: false
|
||||
|
||||
/form-data@2.3.3:
|
||||
resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==}
|
||||
engines: {node: '>= 0.12'}
|
||||
dependencies:
|
||||
asynckit: 0.4.0
|
||||
combined-stream: 1.0.8
|
||||
mime-types: 2.1.35
|
||||
dev: false
|
||||
|
||||
/form-data@2.5.1:
|
||||
resolution: {integrity: sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==}
|
||||
engines: {node: '>= 0.12'}
|
||||
dependencies:
|
||||
asynckit: 0.4.0
|
||||
combined-stream: 1.0.8
|
||||
mime-types: 2.1.35
|
||||
dev: false
|
||||
|
||||
/form-data@3.0.1:
|
||||
resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==}
|
||||
engines: {node: '>= 6'}
|
||||
@@ -5533,6 +5664,12 @@ packages:
|
||||
dependencies:
|
||||
resolve-pkg-maps: 1.0.0
|
||||
|
||||
/getpass@0.1.7:
|
||||
resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==}
|
||||
dependencies:
|
||||
assert-plus: 1.0.0
|
||||
dev: false
|
||||
|
||||
/github-buttons@2.27.0:
|
||||
resolution: {integrity: sha512-PmfRMI2Rttg/2jDfKBeSl621sEznrsKF019SuoLdoNlO7qRUZaOyEI5Li4uW+79pVqnDtKfIEVuHTIJ5lgy64w==}
|
||||
dev: false
|
||||
@@ -5694,6 +5831,20 @@ packages:
|
||||
uglify-js: 3.17.4
|
||||
dev: true
|
||||
|
||||
/har-schema@2.0.0:
|
||||
resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==}
|
||||
engines: {node: '>=4'}
|
||||
dev: false
|
||||
|
||||
/har-validator@5.1.5:
|
||||
resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==}
|
||||
engines: {node: '>=6'}
|
||||
deprecated: this library is no longer supported
|
||||
dependencies:
|
||||
ajv: 6.12.6
|
||||
har-schema: 2.0.0
|
||||
dev: false
|
||||
|
||||
/has-bigints@1.0.2:
|
||||
resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
|
||||
dev: true
|
||||
@@ -5782,6 +5933,15 @@ packages:
|
||||
toidentifier: 1.0.1
|
||||
dev: false
|
||||
|
||||
/http-signature@1.2.0:
|
||||
resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==}
|
||||
engines: {node: '>=0.8', npm: '>=1.3.7'}
|
||||
dependencies:
|
||||
assert-plus: 1.0.0
|
||||
jsprim: 1.4.2
|
||||
sshpk: 1.17.0
|
||||
dev: false
|
||||
|
||||
/https-proxy-agent@5.0.1:
|
||||
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
|
||||
engines: {node: '>= 6'}
|
||||
@@ -6052,6 +6212,10 @@ packages:
|
||||
dependencies:
|
||||
which-typed-array: 1.1.11
|
||||
|
||||
/is-typedarray@1.0.0:
|
||||
resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==}
|
||||
dev: false
|
||||
|
||||
/is-weakref@1.0.2:
|
||||
resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==}
|
||||
dependencies:
|
||||
@@ -6084,6 +6248,10 @@ packages:
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
|
||||
/isstream@0.1.2:
|
||||
resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}
|
||||
dev: false
|
||||
|
||||
/jest-worker@27.5.1:
|
||||
resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==}
|
||||
engines: {node: '>= 10.13.0'}
|
||||
@@ -6115,6 +6283,10 @@ packages:
|
||||
dependencies:
|
||||
argparse: 2.0.1
|
||||
|
||||
/jsbn@0.1.1:
|
||||
resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
|
||||
dev: false
|
||||
|
||||
/jsesc@2.5.2:
|
||||
resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -6155,6 +6327,10 @@ packages:
|
||||
/json-schema-traverse@0.4.1:
|
||||
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
|
||||
|
||||
/json-schema@0.4.0:
|
||||
resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}
|
||||
dev: false
|
||||
|
||||
/json-stable-stringify-without-jsonify@1.0.1:
|
||||
resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
|
||||
dev: true
|
||||
@@ -6163,6 +6339,10 @@ packages:
|
||||
resolution: {integrity: sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==}
|
||||
dev: false
|
||||
|
||||
/json-stringify-safe@5.0.1:
|
||||
resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
|
||||
dev: false
|
||||
|
||||
/json5@1.0.2:
|
||||
resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==}
|
||||
hasBin: true
|
||||
@@ -6191,6 +6371,16 @@ packages:
|
||||
resolution: {integrity: sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==}
|
||||
dev: false
|
||||
|
||||
/jsprim@1.4.2:
|
||||
resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==}
|
||||
engines: {node: '>=0.6.0'}
|
||||
dependencies:
|
||||
assert-plus: 1.0.0
|
||||
extsprintf: 1.3.0
|
||||
json-schema: 0.4.0
|
||||
verror: 1.10.0
|
||||
dev: false
|
||||
|
||||
/jsx-ast-utils@3.3.5:
|
||||
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
|
||||
engines: {node: '>=4.0'}
|
||||
@@ -6358,6 +6548,12 @@ packages:
|
||||
'@jridgewell/sourcemap-codec': 1.4.15
|
||||
dev: true
|
||||
|
||||
/marked@7.0.3:
|
||||
resolution: {integrity: sha512-ev2uM40p0zQ/GbvqotfKcSWEa59fJwluGZj5dcaUOwDRrB1F3dncdXy8NWUApk4fi8atU3kTBOwjyjZ0ud0dxw==}
|
||||
engines: {node: '>= 16'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/md5@2.3.0:
|
||||
resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==}
|
||||
dependencies:
|
||||
@@ -6525,7 +6721,7 @@ packages:
|
||||
/neo-async@2.6.2:
|
||||
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
|
||||
|
||||
/next-auth@4.22.1(next@13.4.2)(react-dom@18.2.0)(react@18.2.0):
|
||||
/next-auth@4.22.1(next@13.4.2)(nodemailer@6.9.4)(react-dom@18.2.0)(react@18.2.0):
|
||||
resolution: {integrity: sha512-NTR3f6W7/AWXKw8GSsgSyQcDW6jkslZLH8AiZa5PQ09w1kR8uHtR9rez/E9gAq/o17+p0JYHE8QjF3RoniiObA==}
|
||||
peerDependencies:
|
||||
next: ^12.2.5 || ^13
|
||||
@@ -6541,6 +6737,7 @@ packages:
|
||||
cookie: 0.5.0
|
||||
jose: 4.14.4
|
||||
next: 13.4.2(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0)
|
||||
nodemailer: 6.9.4
|
||||
oauth: 0.9.15
|
||||
openid-client: 5.4.3
|
||||
preact: 10.16.0
|
||||
@@ -6676,11 +6873,20 @@ packages:
|
||||
/node-releases@2.0.13:
|
||||
resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==}
|
||||
|
||||
/nodemailer@6.9.4:
|
||||
resolution: {integrity: sha512-CXjQvrQZV4+6X5wP6ZIgdehJamI63MFoYFGGPtHudWym9qaEHDNdPzaj5bfMCvxG1vhAileSWW90q7nL0N36mA==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
dev: false
|
||||
|
||||
/normalize-path@3.0.0:
|
||||
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/oauth-sign@0.9.0:
|
||||
resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==}
|
||||
dev: false
|
||||
|
||||
/oauth@0.9.15:
|
||||
resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==}
|
||||
dev: false
|
||||
@@ -6972,6 +7178,10 @@ packages:
|
||||
resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==}
|
||||
dev: true
|
||||
|
||||
/performance-now@2.1.0:
|
||||
resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
|
||||
dev: false
|
||||
|
||||
/pg-cloudflare@1.1.1:
|
||||
resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==}
|
||||
requiresBuild: true
|
||||
@@ -7249,6 +7459,10 @@ packages:
|
||||
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
||||
dev: false
|
||||
|
||||
/psl@1.9.0:
|
||||
resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
|
||||
dev: false
|
||||
|
||||
/punycode@2.3.0:
|
||||
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -7267,6 +7481,11 @@ packages:
|
||||
side-channel: 1.0.4
|
||||
dev: false
|
||||
|
||||
/qs@6.5.3:
|
||||
resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==}
|
||||
engines: {node: '>=0.6'}
|
||||
dev: false
|
||||
|
||||
/queue-microtask@1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
dev: true
|
||||
@@ -7695,6 +7914,33 @@ packages:
|
||||
engines: {git: '>=2.11.0', node: '>=16.6.0', npm: '>=7.19.0', yarn: '>=1.7.0'}
|
||||
dev: false
|
||||
|
||||
/request@2.88.2:
|
||||
resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==}
|
||||
engines: {node: '>= 6'}
|
||||
deprecated: request has been deprecated, see https://github.com/request/request/issues/3142
|
||||
dependencies:
|
||||
aws-sign2: 0.7.0
|
||||
aws4: 1.12.0
|
||||
caseless: 0.12.0
|
||||
combined-stream: 1.0.8
|
||||
extend: 3.0.2
|
||||
forever-agent: 0.6.1
|
||||
form-data: 2.3.3
|
||||
har-validator: 5.1.5
|
||||
http-signature: 1.2.0
|
||||
is-typedarray: 1.0.0
|
||||
isstream: 0.1.2
|
||||
json-stringify-safe: 5.0.1
|
||||
mime-types: 2.1.35
|
||||
oauth-sign: 0.9.0
|
||||
performance-now: 2.1.0
|
||||
qs: 6.5.3
|
||||
safe-buffer: 5.2.1
|
||||
tough-cookie: 2.5.0
|
||||
tunnel-agent: 0.6.0
|
||||
uuid: 3.4.0
|
||||
dev: false
|
||||
|
||||
/require-directory@2.1.1:
|
||||
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -8005,6 +8251,22 @@ packages:
|
||||
engines: {node: '>= 10.x'}
|
||||
dev: false
|
||||
|
||||
/sshpk@1.17.0:
|
||||
resolution: {integrity: sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
asn1: 0.2.6
|
||||
assert-plus: 1.0.0
|
||||
bcrypt-pbkdf: 1.0.2
|
||||
dashdash: 1.14.1
|
||||
ecc-jsbn: 0.1.2
|
||||
getpass: 0.1.7
|
||||
jsbn: 0.1.1
|
||||
safer-buffer: 2.1.2
|
||||
tweetnacl: 0.14.5
|
||||
dev: false
|
||||
|
||||
/stackback@0.0.2:
|
||||
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
|
||||
dev: true
|
||||
@@ -8292,6 +8554,14 @@ packages:
|
||||
engines: {node: '>=0.6'}
|
||||
dev: false
|
||||
|
||||
/tough-cookie@2.5.0:
|
||||
resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==}
|
||||
engines: {node: '>=0.8'}
|
||||
dependencies:
|
||||
psl: 1.9.0
|
||||
punycode: 2.3.0
|
||||
dev: false
|
||||
|
||||
/tr46@0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
dev: false
|
||||
@@ -8371,6 +8641,16 @@ packages:
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
|
||||
/tunnel-agent@0.6.0:
|
||||
resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
|
||||
dependencies:
|
||||
safe-buffer: 5.2.1
|
||||
dev: false
|
||||
|
||||
/tweetnacl@0.14.5:
|
||||
resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==}
|
||||
dev: false
|
||||
|
||||
/type-check@0.4.0:
|
||||
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
@@ -8636,6 +8916,12 @@ packages:
|
||||
engines: {node: '>= 0.4.0'}
|
||||
dev: false
|
||||
|
||||
/uuid@3.4.0:
|
||||
resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==}
|
||||
deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/uuid@8.3.2:
|
||||
resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
|
||||
hasBin: true
|
||||
@@ -8651,6 +8937,15 @@ packages:
|
||||
engines: {node: '>= 0.8'}
|
||||
dev: false
|
||||
|
||||
/verror@1.10.0:
|
||||
resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==}
|
||||
engines: {'0': node >=0.6.0}
|
||||
dependencies:
|
||||
assert-plus: 1.0.0
|
||||
core-util-is: 1.0.2
|
||||
extsprintf: 1.3.0
|
||||
dev: false
|
||||
|
||||
/victory-vendor@36.6.11:
|
||||
resolution: {integrity: sha512-nT8kCiJp8dQh8g991J/R5w5eE2KnO8EAIP0xocWlh9l2okngMWglOPoMZzJvek8Q1KUc4XE/mJxTZnvOB1sTYg==}
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user