Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,42 @@
"@sweetr/email-templates": "*",
"@sweetr/graphql-types": "*",
"basic-auth": "^2.0.1",
"bcrypt": "^5.1.1",
"bullmq": "^5.2.0",
"bcrypt": "^6.0.0",
"bullmq": "^5.42.0",
"date-fns": "^4.0.0",
"dotenv": "^16.3.1",
"envsafe": "^2.0.3",
"express": "^4.20.0",
"express": "^5.2.1",
"express-rate-limit": "^7.5.0",
"got": "^11.8.3",
"graphql": "^16.8.1",
"graphql-scalars": "^1.22.4",
"graphql-yoga": "^5.0.0",
"hashids": "^2.3.0",
"ioredis": "^5.4.1",
"ioredis": "^5.9.3",
"jsonwebtoken": "^9.0.2",
"micromatch": "^4.0.8",
"octokit": "^3.2.2",
"pino": "^9.13.1",
"radash": "^11.0.0",
"resend": "^3.4.0",
"resend": "^6.0.0",
"semver": "^7.5.4",
"stripe": "^16.6.0",
"utility-types": "^3.10.0",
"zod": "^3.24.2"
},
"devDependencies": {
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-resolvers": "^4.0.1",
"@graphql-codegen/cli": "^6.0.0",
"@graphql-codegen/client-preset": "^5.0.0",
"@graphql-codegen/typescript": "^5.0.0",
"@graphql-codegen/typescript-resolvers": "^5.0.0",
"@octokit/webhooks-types": "^7.3.1",
"@types/bcrypt": "^5.0.2",
"@types/bcrypt": "^6.0.0",
"@types/micromatch": "^4.0.9",
"@types/node": "^20.9.0",
"@typescript-eslint/eslint-plugin": "^8.26.0",
"cross-env": "^10.1.0",
"pino-pretty": "^10.2.3",
"pino-pretty": "^13.0.0",
"prisma": "^5.5.2",
"tsx": "^4.15.9",
"typescript": "^5.2.2",
Expand Down
8 changes: 3 additions & 5 deletions apps/api/src/app/auth/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
WorkspaceMembership,
InstallationTargetType,
} from "@prisma/client";
import jwt from "jsonwebtoken";
import jwt, { type SignOptions } from "jsonwebtoken";
import { config } from "../../../config";
import { getBypassRlsPrisma, getPrisma } from "../../../prisma";
import * as github from "../providers/github/github.provider";
Expand Down Expand Up @@ -62,11 +62,9 @@ export const getGithubLoginUrl = (redirectTo?: string) => {
};

const signJwtToken = (payload: JWTPayload): Token => {
const expiresIn = config.auth.jwt.expiresIn;

const accessToken = jwt.sign(payload, config.auth.jwt.secret, {
expiresIn,
});
expiresIn: config.auth.jwt.expiresIn,
} as SignOptions);
Comment thread
waltergalvao marked this conversation as resolved.

return {
accessToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export const loginToStripeMutation = createMutationResolver({

const session = await createStripeCustomerPortalSession(input.workspaceId);

return session?.url;
return session?.url || null;
},
});
2 changes: 1 addition & 1 deletion apps/api/src/app/email/workers/send-email.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface SendEmailJob {
export const sendEmailWorker = createWorker(
SweetQueue.SEND_EMAIL,
async (job: Job<SendEmailJob>) => {
const template = renderEmailTemplate(
const template = await renderEmailTemplate(
emailTemplates[job.data.template.type],
job.data.template.props
);
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/app/sync-batch/services/sync-batch.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ const sendSyncCompleteEmail = async (workspaceId: number) => {
to: member.user.email,
subject: "Sync complete.",
template: {
id: "initial-sync-complete",
Comment thread
waltergalvao marked this conversation as resolved.
Comment thread
waltergalvao marked this conversation as resolved.
Comment thread
waltergalvao marked this conversation as resolved.
Comment thread
waltergalvao marked this conversation as resolved.
Comment thread
waltergalvao marked this conversation as resolved.
type: emailTemplate,
props: {
username: member.name,
Expand Down
6 changes: 3 additions & 3 deletions apps/api/src/lib/email.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Resend } from "resend";
import { CreateEmailOptions, CreateEmailRequestOptions, Resend } from "resend";
import { DataAccessException } from "../app/errors/exceptions/data-access.exception";
import { env } from "../env";

let resendClient: Resend | null;

export type EmailPayload = Parameters<Resend["emails"]["send"]>[0];
export type EmailOptions = Parameters<Resend["emails"]["send"]>[1];
export type EmailPayload = CreateEmailOptions;
export type EmailOptions = CreateEmailRequestOptions;

export const getEmailClient = (): Resend => {
if (!env.RESEND_API_KEY) {
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ export const take = (limit: number = 50) => {
export const jsonObject = <T extends Record<string, any>>(
value: string | object | JsonValue
): T => {
return isObject(value) ? value : JSON.parse(value as string);
return isObject(value) ? (value as T) : (JSON.parse(value as string) as T);
};
8 changes: 4 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@mantine/nprogress": "^8.3.0",
"@mantine/spotlight": "^8.3.0",
"@sentry/react": "^9.5.0",
"@sentry/vite-plugin": "^3.2.2",
"@sentry/vite-plugin": "^4.0.0",
"@sweetr/graphql-types": "*",
"@tabler/icons": "^3.31.0",
"@tabler/icons-react": "^3.31.0",
Expand All @@ -42,7 +42,8 @@
"react": "^18.3.0",
"react-canvas-confetti": "^1.4.0",
"react-dom": "^18.3.0",
"react-router-dom": "^6.17.0",
"react-router": "^7.13.0",
"utility-types": "^3.10.0",
"zod": "^3.24.2",
"zustand": "^5.0.3"
},
Expand All @@ -66,8 +67,7 @@
"postcss-preset-mantine": "^1.9.0",
"postcss-simple-vars": "^7.0.1",
"typescript": "^5.2.2",
"vite": "^6.3.6",
"vite-plugin-eslint": "^1.8.1"
"vite": "^7.0.0"
},
"packageManager": "npm@8.5.5"
}
2 changes: 1 addition & 1 deletion apps/web/src/api/environments.api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
DefaultError,
InfiniteData,
Optional,
useInfiniteQuery,
UseInfiniteQueryOptions,
useMutation,
Expand All @@ -22,6 +21,7 @@ import {
UnarchiveEnvironmentMutation,
} from "@sweetr/graphql-types/frontend/graphql";
import { queryClient } from "./clients/query-client";
import { Optional } from "utility-types";

export const useEnvironmentOptionsQuery = (
args: EnvironmentOptionsQueryVariables,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/404.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Title, Text, Button, Container, Group } from "@mantine/core";
import { FC } from "react";
import { Link } from "react-router-dom";
import { Link } from "react-router";
import classes from "./404.module.css";

export const PageNotFound: FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/auth/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AuthProvider } from "@sweetr/graphql-types/frontend/graphql";
import { IconBrandGithub } from "@tabler/icons-react";
import { useAuthProviderQuery } from "../../../api/auth.api";
import { Logo } from "../../../components/logo";
import { useSearchParams } from "react-router-dom";
import { useSearchParams } from "react-router";

export const LoginPage = () => {
const [searchParams] = useSearchParams({
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/automations/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Anchor, SimpleGrid, Skeleton } from "@mantine/core";
import { Breadcrumbs } from "../../components/breadcrumbs";
import { CardAutomation } from "./components/card-automation";
import { Link, Outlet } from "react-router-dom";
import { Link, Outlet } from "react-router";
import { PageContainer } from "../../components/page-container";
import { LoadableContent } from "../../components/loadable-content";
import { useAutomationSettings } from "./use-automations";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { UseFormReturnType } from "@mantine/form";
import { colorPickerSwatches } from "../../../../../../providers/color.provider";
import { capitalize } from "radash";
import { FormPrSizeLabeler } from "../../types";
import { Link } from "react-router-dom";
import { Link } from "react-router";
import { IconExternalLink } from "@tabler/icons-react";

interface FormPrSizeLabelerSettingsProps {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/automations/settings/use-automation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
showErrorNotification,
} from "../../../providers/notification.provider";
import { useAutomationCards } from "../use-automation-cards";
import { useNavigate } from "react-router-dom";
import { useNavigate } from "react-router";

export const useAutomationSettings = (type: AutomationType) => {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/github/install/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Confetti } from "./components/confetti";
import { IconBrandGithub, IconX } from "@tabler/icons-react";
import { Logo } from "../../../components/logo";
import { useGithubInstall } from "./use-github-install";
import { useNavigate } from "react-router-dom";
import { useNavigate } from "react-router";
import { showInfoNotification } from "../../../providers/notification.provider";

const steps = [
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/github/install/use-github-install.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useSearchParams } from "react-router-dom";
import { useSearchParams } from "react-router";
import { useEffect, useRef, useState } from "react";
import {
getAuthorizationHeader,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/github/oauth/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Flex, Paper, Progress, Stack } from "@mantine/core";
import { useCallback } from "react";
import { useEffect } from "react";
import { useNavigate, useSearchParams } from "react-router-dom";
import { useNavigate, useSearchParams } from "react-router";
import { useLoginWithGithubMutation } from "../../../api/auth.api";
import { Logo } from "../../../components/logo";
import { setAuth } from "../../../providers/auth.provider";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/home/use-sync-progress-notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
updateNotification,
} from "@mantine/notifications";
import { Anchor, Button, Group, Progress, Tooltip } from "@mantine/core";
import { useNavigate } from "react-router-dom";
import { useNavigate } from "react-router";
import { IconCheck } from "@tabler/icons-react";
import { useWorkspace } from "../../providers/workspace.provider";
import { useWorkspaceSyncProgressQuery } from "../../api/workspaces.api";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Divider, Title, NavLink, Badge } from "@mantine/core";
import { IconHeartHandshake, IconUsers } from "@tabler/icons-react";
import { Link, useLocation } from "react-router-dom";
import { Link, useLocation } from "react-router";
import { Subnav } from "../../../../components/subnav";
import { IconTeam } from "../../../../providers/icon.provider";

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Portal } from "@mantine/core";
import { Navigate, Outlet, useLocation } from "react-router-dom";
import { Navigate, Outlet, useLocation } from "react-router";
import { SubnavHumans } from "./components/subnav-humans";

export const HumansPage = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useInfiniteLoading,
useListGroupedByYearMonth,
} from "../../../../../providers/pagination.provider";
import { useParams } from "react-router-dom";
import { useParams } from "react-router";
import { CodeReview } from "@sweetr/graphql-types/frontend/graphql";
import { PageEmptyState } from "../../../../../components/page-empty-state";
import { CardCodeReview } from "../../../../../components/card-code-review";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge, NavLink, Stack, Text, useMantineTheme } from "@mantine/core";
import { Link } from "react-router-dom";
import { Link } from "react-router";
import { teamRoleColorMap } from "../../../../../../../providers/team-role.provider";
import { TeamMemberRole } from "@sweetr/graphql-types/frontend/graphql";

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/people/[handle]/overview/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Paper, Grid, Skeleton } from "@mantine/core";
import { PaperTitle } from "../../../../../components/paper-title";
import { usePersonQuery } from "../../../../../api/people.api";
import { useParams } from "react-router-dom";
import { useParams } from "react-router";
import { MenuTeams } from "./components/menu-teams";
import { useWorkspace } from "../../../../../providers/workspace.provider";
import { ResourceNotFound } from "../../../../../exceptions/resource-not-found.exception";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/people/[handle]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Text,
Title,
} from "@mantine/core";
import { Outlet, useParams } from "react-router-dom";
import { Outlet, useParams } from "react-router";
import { Breadcrumbs } from "../../../../components/breadcrumbs";
import { PageTitle } from "../../../../components/page-title";
import { usePersonQuery } from "../../../../api/people.api";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useInfiniteLoading,
useListGroupedByYearMonth,
} from "../../../../../providers/pagination.provider";
import { useOutletContext } from "react-router-dom";
import { useOutletContext } from "react-router";
import {
PullRequest,
PullRequestOwnerType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Divider, Title, NavLink, Group } from "@mantine/core";
import { IconEyeCode, IconNotes } from "@tabler/icons-react";
import { Link, useLocation } from "react-router-dom";
import { Link, useLocation } from "react-router";
import { Person } from "@sweetr/graphql-types/frontend/graphql";
import { Subnav } from "../../../../../components/subnav";
import { IconPullRequest } from "../../../../../providers/icon.provider";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/teams/[id]/alerts/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SimpleGrid, Skeleton, Stack } from "@mantine/core";
import { Outlet } from "react-router-dom";
import { Outlet } from "react-router";
import { useTeamId } from "../use-team";
import { LoadableContent } from "../../../../../components/loadable-content";
import { CardSetting } from "../../../../../components/card-setting";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
showSuccessNotification,
showErrorNotification,
} from "../../../../../../providers/notification.provider";
import { useNavigate } from "react-router-dom";
import { useNavigate } from "react-router";
import { getErrorMessage } from "../../../../../../providers/error-message.provider";
import { useAlertCards } from "../use-alert-cards";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
IconTarget,
IconUsers,
} from "@tabler/icons-react";
import { Link, useLocation } from "react-router-dom";
import { Link, useLocation } from "react-router";
import { Team } from "@sweetr/graphql-types/frontend/graphql";
import { Subnav } from "../../../../../../components/subnav";
import { IconPullRequest } from "../../../../../../providers/icon.provider";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/teams/[id]/digests/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Anchor, Image, SimpleGrid, Skeleton } from "@mantine/core";
import { Link, Outlet } from "react-router-dom";
import { Link, Outlet } from "react-router";
import { CardDigest } from "./components/card-digest";
import { useDigestCards } from "./use-digest-cards";
import { useDigests } from "./use-digests";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
showSuccessNotification,
showErrorNotification,
} from "../../../../../../providers/notification.provider";
import { useNavigate } from "react-router-dom";
import { useNavigate } from "react-router";
import { getErrorMessage } from "../../../../../../providers/error-message.provider";

interface UseDigestsProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@mantine/core";
import { IconProps } from "@tabler/icons-react";
import { FC } from "react";
import { useNavigate } from "react-router-dom";
import { useNavigate } from "react-router";

interface CardChartProps extends PaperProps {
label: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SimpleGrid } from "@mantine/core";
import { Outlet } from "react-router-dom";
import { Outlet } from "react-router";
import {
IconClock,
IconEyeCheck,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/teams/[id]/members/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, SimpleGrid, Skeleton } from "@mantine/core";
import { CardPerson } from "../../../../../components/card-person";
import { useOutletContext } from "react-router-dom";
import { useOutletContext } from "react-router";
import { useTeamQuery } from "../../../../../api/teams.api";
import { PageEmptyState } from "../../../../../components/page-empty-state";
import { TeamOutletContext } from "../types";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/teams/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { useDisclosure } from "@mantine/hooks";
import { DrawerUpsertTeam } from "../components/drawer-upsert-team";
import { PageTitle } from "../../../../components/page-title";
import { Outlet } from "react-router-dom";
import { Outlet } from "react-router";
import { useTeamQuery } from "../../../../api/teams.api";
import { Breadcrumbs } from "../../../../components/breadcrumbs";
import { HeaderActions } from "../../../../components/header-actions";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/humans/teams/[id]/use-team.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useParams } from "react-router-dom";
import { useParams } from "react-router";
import { ResourceNotFound } from "../../../../exceptions/resource-not-found.exception";

export const useTeamId = () => {
Expand Down
Loading