Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jul 23, 2024
1 parent faa7923 commit 0324dc0
Show file tree
Hide file tree
Showing 18 changed files with 96 additions and 73 deletions.
17 changes: 11 additions & 6 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@ai-sdk/openai": "^0.0.36",
"@ai-sdk/openai": "^0.0.37",
"@baselime/node-opentelemetry": "^0.5.8",
"@date-fns/utc": "^1.2.0",
"@hookform/resolvers": "^3.9.0",
"@midday-ai/engine": "^0.1.0-alpha.14",
"@midday-ai/engine": "^0.1.0-alpha.15",
"@midday/events": "workspace:*",
"@midday/inbox": "workspace:*",
"@midday/jobs": "workspace:*",
Expand All @@ -37,13 +37,18 @@
"@todesktop/runtime": "^1.6.3",
"@trigger.dev/nextjs": "^2.3.19",
"@uidotdev/usehooks": "^2.4.1",
"@upstash/ratelimit": "^1.2.1",
"@upstash/ratelimit": "^2.0.1",
"@vercel/speed-insights": "^1.0.12",
"@zip.js/zip.js": "2.7.45",
"ai": "^3.2.29",
"@zip.js/zip.js": "2.7.47",
"ai": "^3.2.32",
"change-case": "^5.4.4",
<<<<<<< HEAD
"dub": "^0.29.18",
"framer-motion": "^11.3.2",
=======
"dub": "^0.34.0",
"framer-motion": "^11.3.8",
>>>>>>> 95422695 (Update dependencies)
"geist": "^1.3.1",
"headless-currency-input": "^1.1.0",
"loops": "1.0.1",
Expand Down Expand Up @@ -78,7 +83,7 @@
"@next/bundle-analyzer": "^14.2.5",
"@t3-oss/env-nextjs": "^0.10.1",
"@todesktop/tailwind-variants": "^1.0.1",
"@types/node": "^20.14.10",
"@types/node": "^20.14.11",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"typescript": "^5.5.3"
Expand Down
3 changes: 2 additions & 1 deletion apps/dashboard/src/actions/ai/chat/get-chats-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { addMonths, addWeeks, isAfter, isBefore, isToday } from "date-fns";
import { getChats } from "../storage";
import type { Chat } from "../types";

export async function getChatsAction() {
const data = await getChats();
Expand All @@ -10,7 +11,7 @@ export async function getChatsAction() {
return [];
}

const base = {
const base: { "1d": Chat[]; "7d": Chat[]; "30d": Chat[] } = {
"1d": [],
"7d": [],
"30d": [],
Expand Down
10 changes: 7 additions & 3 deletions apps/dashboard/src/actions/ai/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export async function submitUserMessage(
role: message.role,
content: message.content,
name: message.name,
display: null,
})),
],
text: ({ content, done, delta }) => {
Expand Down Expand Up @@ -180,7 +181,7 @@ export async function submitUserMessage(
getDocuments: getDocumentsTool({ aiState, teamId }),
createReport: createReport({
aiState,
userId: user?.data?.id,
userId: user?.data?.id ?? "",
teamId,
currency: defaultValues.currency,
dateFrom: defaultValues.from,
Expand Down Expand Up @@ -210,8 +211,11 @@ export const AI = createAI<AIState, UIState>({

const { chatId, messages } = state;

const firstMessageContent = messages?.at(0).content as string;
const title = firstMessageContent.substring(0, 100);
const firstMessageContent = messages?.at(0)?.content ?? "";
const title =
typeof firstMessageContent === "string"
? firstMessageContent.substring(0, 100)
: "";

const chat: Chat = {
id: chatId,
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/actions/ai/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function getAssistantSettings(): Promise<SettingsResponse> {
data: { session },
} = await getSession();

const defaultSettings = {
const defaultSettings: SettingsResponse = {
enabled: true,
provider: isEUCountry(getCountryCode()) ? "mistralai" : "openai",
};
Expand All @@ -20,7 +20,7 @@ export async function getAssistantSettings(): Promise<SettingsResponse> {

return {
...defaultSettings,
...settings,
...(settings || {}),
};
}

Expand Down
4 changes: 3 additions & 1 deletion apps/dashboard/src/actions/ai/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type Message = CoreMessage & {
id: string;
};

export interface Chat extends Record<string, any> {
export interface Chat extends Record<string, unknown> {
id: string;
title: string;
createdAt: Date;
Expand Down Expand Up @@ -46,6 +46,8 @@ export interface ClientMessage {
display: ReactNode;
}

type ValueOrUpdater<T> = T | ((prevState: T) => T);

export type MutableAIState = {
get: () => AIState;
update: (newState: ValueOrUpdater<AIState>) => void;
Expand Down
6 changes: 5 additions & 1 deletion apps/dashboard/src/components/delete-team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import { Loader2 } from "lucide-react";
import { useAction } from "next-safe-action/hooks";
import { useRouter } from "next/navigation";

export function DeleteTeam({ teamId }) {
interface DeleteTeamProps {
teamId: string;
}

export function DeleteTeam({ teamId }: DeleteTeamProps) {
const router = useRouter();
const deleteTeam = useAction(deleteTeamAction, {
onSuccess: () => router.push("/teams"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import Image from "next/image";
import appIcon from "public/appicon.png";
import { useEffect, useRef } from "react";

export function DesktopSignInVerifyCode({ code }) {
interface DesktopSignInVerifyCodeProps {
code: string;
}

export function DesktopSignInVerifyCode({
code,
}: DesktopSignInVerifyCodeProps) {
const hasRunned = useRef(false);

useEffect(() => {
Expand Down
41 changes: 14 additions & 27 deletions apps/dashboard/src/components/modals/select-bank-accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { connectBankAccountAction } from "@/actions/connect-bank-account-action";
import { connectBankAccountSchema } from "@/actions/schema";
import { useConnectParams } from "@/hooks/use-connect-params";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@midday/ui/button";
import {
Expand All @@ -25,12 +26,6 @@ import { useToast } from "@midday/ui/use-toast";
import { Loader2 } from "lucide-react";
import { useAction } from "next-safe-action/hooks";
import Image from "next/image";
import {
parseAsBoolean,
parseAsString,
parseAsStringEnum,
useQueryStates,
} from "nuqs";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import type z from "zod";
Expand Down Expand Up @@ -63,29 +58,21 @@ export function SelectBankAccountsModal() {
const [loading, setLoading] = useState(true);
const [eventId, setEventId] = useState<string>();

const [params, setParams] = useQueryStates({
step: parseAsStringEnum(["connect", "account"]),
error: parseAsBoolean,
ref: parseAsString,
token: parseAsString,
enrollment_id: parseAsString,
institution_id: parseAsString,
provider: parseAsStringEnum(["teller", "plaid", "gocardless"]),
countryCode: parseAsString,
});
const { step, error, setParams } = useConnectParams();

const {
provider,
step,
error,
token,
ref,
enrollment_id,
institution_id,
countryCode,
} = params;
const isOpen = step === "account";

const isOpen = step === "account" && !error;
useEffect(() => {
if (error) {
// NOTE: On GoCardLess cancel flow
setParams({
step: "connect",
error: null,
details: null,
provider: null,
});
}
}, [error]);

const onClose = () => {
setParams(
Expand Down
16 changes: 11 additions & 5 deletions apps/dashboard/src/components/project-members.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { Avatar, AvatarFallback, AvatarImage } from "@midday/ui/avatar";

export function ProjectMembers({ members }) {
interface Member {
id: string;
avatar_url?: string;
full_name?: string;
}

interface ProjectMembersProps {
members: Member[];
}

export function ProjectMembers({ members }: ProjectMembersProps) {
return (
<div className="flex space-x-2">
{members?.map((member) => (
<div key={member.id} className="relative">
{/* {member.working && (
<div className="w-[6px] h-[6px] rounded-full bg-[#00C969] absolute z-10 -right-[1px] -top-[1px] border border-[1px] border-background" />
)} */}

<Avatar className="rounded-full w-5 h-5">
<AvatarImage src={member?.avatar_url} />
<AvatarFallback>
Expand Down
9 changes: 7 additions & 2 deletions apps/dashboard/src/components/verify-mfa.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export function VerifyMfa() {
setError(true);
}

if (!factors.data) {
setValidating(false);
setError(true);
return;
}

const totpFactor = factors.data.totp[0];

if (!totpFactor) {
Expand Down Expand Up @@ -74,8 +80,7 @@ export function VerifyMfa() {
<InputOTP
onComplete={onComplete}
maxLength={6}
numeric="numeric"
className={error && "invalid"}
className={error ? "invalid" : undefined}
disabled={isValidating}
render={({ slots }) => (
<InputOTPGroup>
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/widgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Tracker } from "./widgets/tracker";

type Props = {
disabled: boolean;
initialPeriod: any;
initialPeriod: Date | string;
searchParams: { [key: string]: string | string[] | undefined };
};

Expand Down
5 changes: 4 additions & 1 deletion apps/dashboard/src/hooks/use-connect-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { parseAsString, parseAsStringEnum, useQueryStates } from "nuqs";

export function useConnectParams(initialCountryCode?: string) {
const [params, setParams] = useQueryStates({
step: parseAsStringEnum(["connect", "account", "gocardless"]),
step: parseAsStringEnum(["connect", "account"]),
countryCode: parseAsString.withDefault(initialCountryCode ?? ""),
provider: parseAsStringEnum(["teller", "plaid", "gocardless"]),
token: parseAsString,
enrollment_id: parseAsString,
institution_id: parseAsString,
q: parseAsString,
error: parseAsString,
ref: parseAsString,
details: parseAsString,
});

return {
Expand Down
6 changes: 3 additions & 3 deletions apps/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"@hono/zod-validator": "^0.2.2",
"hono": "^4.5.0",
"typesense": "^1.8.2",
"xior": "^0.5.3",
"xior": "^0.5.5",
"zod": "^3.23.8"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240712.0",
"@cloudflare/workers-types": "^4.20240718.0",
"@types/bun": "^1.1.6",
"wrangler": "^3.65.0"
"wrangler": "^3.65.1"
}
}
6 changes: 3 additions & 3 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"@openpanel/nextjs": "^0.0.10-beta",
"@openstatus/react": "^0.0.3",
"@splinetool/react-spline": "4.0.0",
"@splinetool/runtime": "1.9.0",
"@splinetool/runtime": "1.9.2",
"@team-plain/typescript-sdk": "4.6.1",
"@uidotdev/usehooks": "^2.4.1",
"d3": "^7.9.0",
"date-fns": "^3.6.0",
"framer-motion": "^11.3.2",
"framer-motion": "^11.3.8",
"geist": "^1.3.1",
"next": "14.2.5",
"next-mdx-remote": "^5.0.0",
Expand All @@ -39,7 +39,7 @@
},
"devDependencies": {
"@midday/tsconfig": "workspace:*",
"@types/node": "^20.14.10",
"@types/node": "^20.14.11",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@biomejs/biome": "1.8.3",
"@manypkg/cli": "^0.21.4",
"turbo": "2.0.7",
"turbo": "2.0.9",
"typescript": "^5.5.3"
},
"packageManager": "[email protected]",
Expand Down
8 changes: 4 additions & 4 deletions packages/jobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
},
"dependencies": {
"@fast-csv/format": "5.0.0",
"@langchain/community": "^0.2.16",
"@langchain/core": "^0.2.12",
"@langchain/openai": "^0.2.1",
"@langchain/community": "^0.2.20",
"@langchain/core": "^0.2.17",
"@langchain/openai": "^0.2.4",
"@midday/documents": "workspace:*",
"@midday/import": "workspace:*",
"@trigger.dev/react": "2.3.19",
"@trigger.dev/resend": "2.3.19",
"@trigger.dev/sdk": "2.3.19",
"@trigger.dev/supabase": "^2.3.19",
"change-case": "^5.4.4",
"langchain": "^0.2.8",
"langchain": "^0.2.10",
"nanoid": "^5.0.7"
}
}
2 changes: 1 addition & 1 deletion packages/kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@upstash/redis": "^1.32.0",
"@upstash/redis": "^1.33.0",
"server-only": "^0.0.1"
}
}
Loading

0 comments on commit 0324dc0

Please sign in to comment.