From 2b564084d8e52d4d303908c5775edf494d11e574 Mon Sep 17 00:00:00 2001 From: aatbip Date: Fri, 9 Feb 2024 19:28:08 +0545 Subject: [PATCH 001/155] fix profileLinks issue --- src/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 5cf3e6d..01e2a05 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -71,7 +71,7 @@ export default async function Home({ searchParams }: { searchParams: { token: st return ( Date: Fri, 9 Feb 2024 19:33:06 +0545 Subject: [PATCH 002/155] fix profileLinks issue --- src/app/manage/page.tsx | 2 +- src/layouts/Footer.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index c8b3f64..b313267 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -50,7 +50,7 @@ async function getClient(clientId: string, token: string) { export default async function ManagePage({ searchParams }: { searchParams: { token: string; portalId: string } }) { const { token, portalId } = searchParams; - const settings = await getSettings({ token, portalId }).then((s) => s.profileLinks); + const settings = await getSettings({ token, portalId }).then((s) => s?.profileLinks || []); const customFieldAccess = await getCustomFieldAccess({ token, portalId }); // static for now, will be dynamic later after some API decisions are made const clientId = 'a583a0d0-de70-4d14-8bb1-0aacf7424e2c'; diff --git a/src/layouts/Footer.tsx b/src/layouts/Footer.tsx index fa5ed16..9bbcbd4 100644 --- a/src/layouts/Footer.tsx +++ b/src/layouts/Footer.tsx @@ -44,8 +44,8 @@ export const Footer = () => { const customFieldAccess = await customFieldAccessRes.json(); appState?.setAppState((prev) => ({ ...prev, - settings: settings.data.profileLinks, - mutableSettings: settings.data.profileLinks, + settings: settings?.data?.profileLinks || [], + mutableSettings: settings?.data?.profileLinks || [], })); appState?.setAppState((prev) => ({ ...prev, From 3770305b413014c1961f8856f672a21b4945d737 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 16 Feb 2024 18:22:58 +0545 Subject: [PATCH 003/155] fix: order custom fields according to order key --- .../customFieldAccessTable/CustomFieldAccessTable.tsx | 3 ++- src/utils/orderable.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/utils/orderable.ts diff --git a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx index dd7f0f2..3b90f41 100644 --- a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx +++ b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx @@ -5,6 +5,7 @@ import { StyledCheckBox } from '../styled/StyledCheckbox'; import { useAppState } from '@/hooks/useAppState'; import { iconsTypeMap } from './iconsTypeMap'; import { Permissions } from '@/types/settings'; +import { order } from '@/utils/orderable'; export const CustomFieldAccessTable = () => { const appState = useAppState(); @@ -68,7 +69,7 @@ export const CustomFieldAccessTable = () => { - {appState?.mutableCustomFieldAccess.map((field: any, key: number) => { + {order(appState?.mutableCustomFieldAccess).map((field: any, key: number) => { return ( diff --git a/src/utils/orderable.ts b/src/utils/orderable.ts new file mode 100644 index 0000000..4b075fe --- /dev/null +++ b/src/utils/orderable.ts @@ -0,0 +1,7 @@ +interface OrderableObject { + order: number; +} + +export function order(list: Orderable) { + return list.sort((a, b) => a.order - b.order); +} From e9e4dd13b878a9696994772372f660b5e909ff66 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 20 Feb 2024 20:40:19 +0545 Subject: [PATCH 004/155] feat: default to fallbackColor when iconImageUrl is not provided --- src/app/api/client-profile-updates/route.ts | 1 + src/components/table/Table.tsx | 1 + .../cellRenderers/CompanyCellRenderer.tsx | 13 +++++--- .../table/cellRenderers/CompanyIcon.tsx | 30 +++++++++++++++++++ src/types/common.ts | 1 + 5 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 src/components/table/cellRenderers/CompanyIcon.tsx diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index f4faecf..140cad3 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -114,5 +114,6 @@ function getCompanyDetails(company: CompanyResponse) { id: company.id, name: company.name, iconImageUrl: company.iconImageUrl, + fallbackColor: company.fallbackColor, }; } diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 6237de2..670a809 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -111,6 +111,7 @@ export const TableCore = () => { return { iconImageUrl: company.iconImageUrl, name: company.name, + fallbackColor: company.fallbackColor, }; }, }, diff --git a/src/components/table/cellRenderers/CompanyCellRenderer.tsx b/src/components/table/cellRenderers/CompanyCellRenderer.tsx index 55256fd..ec0848c 100644 --- a/src/components/table/cellRenderers/CompanyCellRenderer.tsx +++ b/src/components/table/cellRenderers/CompanyCellRenderer.tsx @@ -1,10 +1,15 @@ -import { Box, Stack, Typography } from '@mui/material'; +import { Stack, Typography } from '@mui/material'; +import { CompanyIcon } from './CompanyIcon'; -export const CompanyCellRenderer = ({ value }: { value: { iconImageUrl: string; name: string } }) => { - const { iconImageUrl, name } = value; +export const CompanyCellRenderer = ({ + value, +}: { + value: { iconImageUrl: string; name: string; fallbackColor?: string }; +}) => { + const { iconImageUrl, name, fallbackColor } = value; return ( - {iconImageUrl && } + {name} diff --git a/src/components/table/cellRenderers/CompanyIcon.tsx b/src/components/table/cellRenderers/CompanyIcon.tsx new file mode 100644 index 0000000..7f94d61 --- /dev/null +++ b/src/components/table/cellRenderers/CompanyIcon.tsx @@ -0,0 +1,30 @@ +import { Box } from '@mui/material'; + +interface CompanyIconProps { + label: string; + iconImageUrl: string; + fallbackColor?: string; +} + +export const CompanyIcon = ({ label, iconImageUrl, fallbackColor }: CompanyIconProps) => { + return iconImageUrl ? ( + + ) : ( + + {label} + + ); +}; diff --git a/src/types/common.ts b/src/types/common.ts index 99d812d..f31fb1b 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -30,6 +30,7 @@ export const CompanyResponseSchema = z.object({ id: z.string(), name: z.string(), iconImageUrl: z.string().nullable(), + fallbackColor: z.string().nullish(), }); export type CompanyResponse = z.infer; From 03cd738b3394dc9a998fd81b0085c479b3742a8d Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 20 Feb 2024 22:13:27 +0545 Subject: [PATCH 005/155] fix: form doesn't allow to save empty fields --- src/app/manage/views/ManagePageContainer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index 6b26173..9408909 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -74,7 +74,8 @@ export const ManagePageContainer = ({ if (Array.isArray(obj[key])) { result[key] = obj[key].map((item: any) => item.key); } else { - result[key] = obj[key]; + // Jugaad because copilot API doesn't update customFields if any value is empty string + result[key] = obj[key] === '' ? '' : obj[key]; } } return result; @@ -131,7 +132,7 @@ export const ManagePageContainer = ({ {field.name} ' ? '' : profileData[field.key]} variant="outlined" padding="8px 12px" disabled={!field.permission.includes('EDIT')} From 800f7e066a63d2f5435b2efc64387832b41f8ad8 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 20 Feb 2024 22:33:41 +0545 Subject: [PATCH 006/155] fix: display empty when field is cleared --- src/components/table/cellRenderers/HistoryCellRenderer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index a3c7e8c..ef4afa7 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -191,7 +191,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string )} - {data.value} + {data.value === '' ? '' : data.value} @@ -259,7 +259,7 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { • - {history.value} + {history.value === '' ? '' : history.value} ); From 28f04998078b63caf3c9251f1029f5d07c7c36e1 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 20 Feb 2024 22:38:32 +0545 Subject: [PATCH 007/155] feat: limit update history to 4 items --- src/components/table/cellRenderers/HistoryCellRenderer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index ef4afa7..146bbe0 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -139,7 +139,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string columnGap: '10px', })} > - {data.value.map((el: any, key: number) => { + {data.value.slice(0, 4).map((el: any, key: number) => { if (key === 0) return null; return ( { > Update history - {updateHistory.map((history: any, key: number) => { + {updateHistory.slice(0, 4).map((history: any, key: number) => { if (history.type === 'multiSelect') { return ( From 944da504c0f7be24b0de7289daeedd6b43d322cb Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 08:44:08 +0545 Subject: [PATCH 008/155] fix: implement limit on backend --- .../services/clientProfileUpdates.service.ts | 2 +- src/components/table/cellRenderers/HistoryCellRenderer.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts index af704e5..ed0b184 100644 --- a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts +++ b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts @@ -53,7 +53,7 @@ export class ClientProfileUpdatesService { AND "createdAt" <= ${lastUpdated} AND "changedFields" ->> ${customFieldKey} IS NOT NULL ORDER BY "createdAt" DESC - LIMIT 5; + LIMIT 4; `; } } diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index 146bbe0..ef4afa7 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -139,7 +139,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string columnGap: '10px', })} > - {data.value.slice(0, 4).map((el: any, key: number) => { + {data.value.map((el: any, key: number) => { if (key === 0) return null; return ( { > Update history - {updateHistory.slice(0, 4).map((history: any, key: number) => { + {updateHistory.map((history: any, key: number) => { if (history.type === 'multiSelect') { return ( From 8a6e70c5b0b31f08f81e6e931da96503c07f3cae Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 08:44:33 +0545 Subject: [PATCH 009/155] chore!: bump copilot-node-sdk to 1.2.0 --- package.json | 2 +- src/types/common.ts | 2 +- src/utils/copilotApiUtils.ts | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 46ff062..c52e442 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@mui/material": "^5.15.4", "@prisma/client": "^5.7.1", "@vercel/postgres": "^0.5.1", - "copilot-node-sdk": "^0.0.45", + "copilot-node-sdk": "^1.2.0", "ag-grid-react": "^31.0.2", "next": "14.1.0", "prisma": "^5.7.1", diff --git a/src/types/common.ts b/src/types/common.ts index f31fb1b..31a34bb 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -5,7 +5,7 @@ export const MeResponseSchema = z.object({ givenName: z.string(), familyName: z.string(), email: z.string(), - portalName: z.string(), + portalName: z.string().optional(), }); export type MeResponse = z.infer; diff --git a/src/utils/copilotApiUtils.ts b/src/utils/copilotApiUtils.ts index 618108c..f464070 100644 --- a/src/utils/copilotApiUtils.ts +++ b/src/utils/copilotApiUtils.ts @@ -27,7 +27,7 @@ export class CopilotAPI { } async me(): Promise { - return MeResponseSchema.parse(await this.copilot.getUserAndPortalInfo()); + return MeResponseSchema.parse(await this.copilot.getUserInfo()); } async getClient(clientId: string): Promise { diff --git a/yarn.lock b/yarn.lock index fe559a0..533aa8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2213,10 +2213,10 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -copilot-node-sdk@^0.0.45: - version "0.0.45" - resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-0.0.45.tgz#82127dd6a4ff149d633b1e416aa7d0b636b4e8d8" - integrity sha512-K0ufAvAN2JSRst6KZGH+YSr7auiNg2oaeUK7ccAEwDMvfdtuF2MeUK+B894C5GobeOJapcVAL3BGGaJA0QKA8A== +copilot-node-sdk@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-1.2.2.tgz#7f23c14669630f016f6ce6d92ac667f5b8d0ff4a" + integrity sha512-UqGYrwH/rqEjeuP+fqZQx7z2/1XhKELgkiZDhNr5zHhoI8DC4owoQEJTe/0lI4H/rJTLqZTBqagzWohuG4OOcg== dependencies: isomorphic-fetch "^3.0.0" jsonwebtoken "^9.0.2" From 9a1d98aafa80854f771a287166756afbdc6ca3df Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 12:32:10 +0545 Subject: [PATCH 010/155] revert: unset on empty field input --- src/app/manage/views/ManagePageContainer.tsx | 4 ++-- src/components/table/cellRenderers/HistoryCellRenderer.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index 9408909..c0e993e 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -75,7 +75,7 @@ export const ManagePageContainer = ({ result[key] = obj[key].map((item: any) => item.key); } else { // Jugaad because copilot API doesn't update customFields if any value is empty string - result[key] = obj[key] === '' ? '' : obj[key]; + result[key] = obj[key]; } } return result; @@ -132,7 +132,7 @@ export const ManagePageContainer = ({ {field.name} ' ? '' : profileData[field.key]} + value={profileData && profileData[field.key]} variant="outlined" padding="8px 12px" disabled={!field.permission.includes('EDIT')} diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index ef4afa7..a3c7e8c 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -191,7 +191,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string )} - {data.value === '' ? '' : data.value} + {data.value} @@ -259,7 +259,7 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { • - {history.value === '' ? '' : history.value} + {history.value} ); From c48675a49843a26264f9d9cf44771e126edddc6d Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 12:49:59 +0545 Subject: [PATCH 011/155] fix: sort custom fields based on recently created --- .../services/clientProfileUpdates.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts index ed0b184..57a2849 100644 --- a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts +++ b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts @@ -33,12 +33,18 @@ export class ClientProfileUpdatesService { in: companyIds, }, }, + orderBy: { + createdAt: 'desc', + }, }); } else { clientProfileUpdates = await this.prismaClient.clientProfileUpdates.findMany({ where: { portalId: portalId, }, + orderBy: { + createdAt: 'desc', + }, }); } From 0e7f3a2c29e1f4c736bfd6d438114c8e3c8a69f2 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 13:25:21 +0545 Subject: [PATCH 012/155] fix: show empty if field was updated from previously empty value --- src/app/api/profile-update-history/route.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/api/profile-update-history/route.ts b/src/app/api/profile-update-history/route.ts index 4c78eab..fb65112 100644 --- a/src/app/api/profile-update-history/route.ts +++ b/src/app/api/profile-update-history/route.ts @@ -45,6 +45,13 @@ export async function GET(request: NextRequest) { value: options.length > 0 ? options : value, }; }); + // If update history contains fewer than 4 items we assume the oldest value to start from empty + if (parsedUpdateHistory.length < 4) { + parsedUpdateHistory.push({ + type: 'text', + value: 'Empty', + }); + } return NextResponse.json(parsedUpdateHistory); } catch (error) { From 375c3743a7c7dbdf69d52d616d13e8ea1b04d8a1 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 13:26:26 +0545 Subject: [PATCH 013/155] chore: log to stderr instead of stdout --- src/app/api/client/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/client/route.ts b/src/app/api/client/route.ts index 1bc44ec..ae8b2a9 100644 --- a/src/app/api/client/route.ts +++ b/src/app/api/client/route.ts @@ -19,7 +19,7 @@ export async function GET(request: NextRequest) { return NextResponse.json({ data: client }); } catch (error) { - console.log(error); + console.error(error); return respondError('Client not found.', 404); } } From 883b17f3631c1ed60fe3bdb2c1f8b2fc42fb5435 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 13:35:44 +0545 Subject: [PATCH 014/155] fix: implement singleton pattern in db util properly (prevent multiple prisma client created issue) --- src/lib/db.ts | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/lib/db.ts b/src/lib/db.ts index 5b6ed4c..9f778ff 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -2,12 +2,32 @@ import { PrismaClient } from '@prisma/client'; class DBClient { private static client: PrismaClient; + private static isInitialized = false; + + private constructor() { + // private constructor to prevent external instantiation + } + + private static async disconnectAndExit(): Promise { + if (DBClient.client) { + await DBClient.client.$disconnect(); + } + process.exit(); + } static getInstance(): PrismaClient { - if (this.client) { - return this.client; + if (!this.client) { + if (!this.isInitialized) { + // Make sure that prisma client is only created once + this.client = new PrismaClient(); + this.isInitialized = true; + + // disconnect the client when the Node.js process exits + process.on('beforeExit', DBClient.disconnectAndExit); + process.on('SIGINT', DBClient.disconnectAndExit); + process.on('SIGTERM', DBClient.disconnectAndExit); + } } - this.client = new PrismaClient(); return this.client; } From 63f503acf4ea74d1a562d1cb8bc5d07f0abb5165 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 15:24:59 +0545 Subject: [PATCH 015/155] docs: remove unnecessary comment --- src/app/manage/views/ManagePageContainer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index c0e993e..6b26173 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -74,7 +74,6 @@ export const ManagePageContainer = ({ if (Array.isArray(obj[key])) { result[key] = obj[key].map((item: any) => item.key); } else { - // Jugaad because copilot API doesn't update customFields if any value is empty string result[key] = obj[key]; } } From b504a454ba6b05814c253975c113ed39b510118b Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 21 Feb 2024 17:46:50 +0545 Subject: [PATCH 016/155] fix: render company column only if isCompaniesEnabled --- services/workspace.ts | 16 ++++++++++++++++ src/app/api/workspace/route.ts | 21 +++++++++++++++++++++ src/app/page.tsx | 3 +++ src/components/table/Table.tsx | 5 ++++- src/context/index.tsx | 5 +++++ src/hoc/ContextUpdate.tsx | 16 +++++++++++++++- src/types/api.ts | 4 ++++ src/types/common.ts | 29 +++++++++++++++++++++++++++++ src/utils/copilotApiUtils.ts | 11 ++++++++++- 9 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 services/workspace.ts create mode 100644 src/app/api/workspace/route.ts create mode 100644 src/types/api.ts diff --git a/services/workspace.ts b/services/workspace.ts new file mode 100644 index 0000000..83e0990 --- /dev/null +++ b/services/workspace.ts @@ -0,0 +1,16 @@ +import { apiUrl } from '@/config'; +import { APIProps } from '@/types/api'; +import { WorkspaceResponse } from '@/types/common'; + +// Fetch workspace from API +export async function getWorkspaceInfo({ token, portalId }: APIProps): Promise { + const res = await fetch(`${apiUrl}/api/workspace?token=${token}`, { + next: { tags: ['workspace'] }, + }); + + if (!res.ok) { + throw new Error('Something went wrong in getWorkspaceInfo'); + } + + return (await res.json()) as WorkspaceResponse; +} diff --git a/src/app/api/workspace/route.ts b/src/app/api/workspace/route.ts new file mode 100644 index 0000000..11f4bd7 --- /dev/null +++ b/src/app/api/workspace/route.ts @@ -0,0 +1,21 @@ +import { handleError, respondError } from '@/utils/common'; +import { CopilotAPI } from '@/utils/copilotApiUtils'; +import { NextRequest, NextResponse } from 'next/server'; +import { z } from 'zod'; + +export async function GET(request: NextRequest) { + const searchParams = request.nextUrl.searchParams; + const token = searchParams.get('token'); + + if (!token) { + return respondError('Missing token', 422); + } + + const copilotClient = new CopilotAPI(z.string().parse(token)); + + try { + return NextResponse.json(await copilotClient.getWorkspace()); + } catch (e) { + return handleError(e); + } +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 01e2a05..d8c1110 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -6,6 +6,7 @@ import { apiUrl } from '@/config'; import { ParsedClientProfileUpdatesResponse } from '@/types/clientProfileUpdates'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ContextUpdate } from '@/hoc/ContextUpdate'; +import { getWorkspaceInfo } from '../../services/workspace'; export const revalidate = 0; @@ -67,6 +68,7 @@ export default async function Home({ searchParams }: { searchParams: { token: st const clientProfileUpdates = await getClientProfileUpdates({ token, portalId }); const customFieldAccess = await getCustomFieldAccess({ token, portalId }); const settings = await getSettings({ token, portalId }); + const workspace = await getWorkspaceInfo({ token, portalId }); return ( diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 670a809..e3e77e5 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -61,7 +61,10 @@ export const TableCore = () => { if (appState?.clientProfileUpdates.length && appState?.clientProfileUpdates.length) { const col = appState?.clientProfileUpdates[0]; delete col.id; - const keys = Object.keys(col); + let keys = Object.keys(col); + if (!appState.workspace?.isCompaniesEnabled) { + keys = keys.filter((key: string) => key !== 'company'); + } keys.map((el) => { if (el === 'client') { colDefs = [ diff --git a/src/context/index.tsx b/src/context/index.tsx index cd5fd51..375cf90 100644 --- a/src/context/index.tsx +++ b/src/context/index.tsx @@ -1,5 +1,6 @@ 'use client'; +import { WorkspaceResponse } from '@/types/common'; import { FC, ReactNode, useState, createContext, Dispatch, SetStateAction } from 'react'; export interface IAppState { @@ -12,6 +13,7 @@ export interface IAppState { mutableSettings: any; token: string; portalId: string; + workspace?: WorkspaceResponse; } export interface IAppContext { @@ -24,6 +26,7 @@ export interface IAppContext { mutableSettings: any; token: string; portalId: string; + workspace?: WorkspaceResponse; setAppState: Dispatch>; } @@ -44,6 +47,7 @@ export const AppContextProvider: FC = ({ children }) => { mutableSettings: [], token: '', portalId: '', + workspace: { isCompaniesEnabled: undefined }, }); return ( @@ -58,6 +62,7 @@ export const AppContextProvider: FC = ({ children }) => { mutableSettings: state.mutableSettings, token: state.token, portalId: state.portalId, + workspace: state.workspace, setAppState: setState, }} > diff --git a/src/hoc/ContextUpdate.tsx b/src/hoc/ContextUpdate.tsx index 92e3e96..3c13d6e 100644 --- a/src/hoc/ContextUpdate.tsx +++ b/src/hoc/ContextUpdate.tsx @@ -2,6 +2,7 @@ import { useAppState } from '@/hooks/useAppState'; import { ParsedClientProfileUpdatesResponse } from '@/types/clientProfileUpdates'; +import { WorkspaceResponse } from '@/types/common'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ReactNode, useEffect } from 'react'; @@ -12,11 +13,24 @@ interface IContextUpdate { settings: any; token: string; portalId: string; + workspace: WorkspaceResponse; } -export const ContextUpdate = ({ children, clientProfileUpdates, access, settings, token, portalId }: IContextUpdate) => { +export const ContextUpdate = ({ + children, + clientProfileUpdates, + access, + settings, + token, + portalId, + workspace, +}: IContextUpdate) => { const appState = useAppState(); + useEffect(() => { + appState?.setAppState((prev) => ({ ...prev, workspace })); + }, [workspace]); + useEffect(() => { appState?.setAppState((prev) => ({ ...prev, clientProfileUpdates })); }, [clientProfileUpdates]); diff --git a/src/types/api.ts b/src/types/api.ts new file mode 100644 index 0000000..9d6eec0 --- /dev/null +++ b/src/types/api.ts @@ -0,0 +1,4 @@ +export interface APIProps { + token: string; + portalId: string; +} diff --git a/src/types/common.ts b/src/types/common.ts index 31a34bb..e5bca42 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -1,5 +1,12 @@ import { z } from 'zod'; +export interface Token { + clientId?: string; + companyId?: string; + internalUserId?: string; + workspaceId: string; +} + export const MeResponseSchema = z.object({ id: z.string(), givenName: z.string(), @@ -9,6 +16,28 @@ export const MeResponseSchema = z.object({ }); export type MeResponse = z.infer; +// Response schema for `/workspace` endpoint +export const WorkspaceResponseSchema = z.object({ + isCompaniesEnabled: z.boolean().optional(), + // For future use + // id: z.string(), + // industry: z.string().optional(), + // isClientDirectSignUpEnabled: z.boolean().optional(), + // logOutUrl: z.string().optional(), + // brandName: z.string().optional(), + // squareIconUrl: z.string().optional(), + // fullLogoUrl: z.string().optional(), + // squareLoginImageUrl: z.string().optional(), + // socialSharingImageUrl: z.string().optional(), + // colorSidebarBackground: z.string().optional(), + // colorSidebarText: z.string().optional(), + // colorAccent: z.string().optional(), + // font: z.string().optional(), + // metaTitle: z.string().optional(), + // metaDescription: z.string().optional(), +}); +export type WorkspaceResponse = z.infer; + export const ClientResponseSchema = z.object({ id: z.string(), givenName: z.string(), diff --git a/src/utils/copilotApiUtils.ts b/src/utils/copilotApiUtils.ts index f464070..2696b34 100644 --- a/src/utils/copilotApiUtils.ts +++ b/src/utils/copilotApiUtils.ts @@ -13,11 +13,16 @@ import { MeResponseSchema, CompaniesResponse, CompaniesResponseSchema, + WorkspaceResponse, + WorkspaceResponseSchema, + Token, } from '@/types/common'; import { copilotAPIKey } from '@/config'; +export type CopilotApi = typeof Copilot & { getTokenPayload?: () => Promise }; + export class CopilotAPI { - copilot: typeof Copilot; + copilot: CopilotApi; constructor(apiToken: string) { this.copilot = copilotApi({ @@ -30,6 +35,10 @@ export class CopilotAPI { return MeResponseSchema.parse(await this.copilot.getUserInfo()); } + async getWorkspace(): Promise { + return WorkspaceResponseSchema.parse(await this.copilot.getWorkspaceInfo()); + } + async getClient(clientId: string): Promise { return ClientResponseSchema.parse(await this.copilot.retrieveAClient({ id: clientId })); } From a529d63ff733d13ace66c49fbe87c86760c24f19 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 22 Feb 2024 08:29:29 +0545 Subject: [PATCH 017/155] fix: OUT-78 | fix columns appearing in random order --- src/components/table/Table.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index e3e77e5..eb12687 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -10,6 +10,7 @@ import { HistoryCellRenderer } from './cellRenderers/HistoryCellRenderer'; import { useAppState } from '@/hooks/useAppState'; import { getTimeAgo } from '@/utils/getTimeAgo'; import { arraysHaveSameElements } from '@/utils/arrayHaveSameElements'; +import { order } from '@/utils/orderable'; export const TableCore = () => { const appState = useAppState(); @@ -61,11 +62,17 @@ export const TableCore = () => { if (appState?.clientProfileUpdates.length && appState?.clientProfileUpdates.length) { const col = appState?.clientProfileUpdates[0]; delete col.id; - let keys = Object.keys(col); + + let keys = [ + // This destructure is for essential meta info fields: client, company, last updated + ...Object.keys(col).slice(0, 3), + // Rest of these cols are for profile custom fields + ...order(appState?.mutableCustomFieldAccess).map((field: { name: string }) => field.name), + ]; if (!appState.workspace?.isCompaniesEnabled) { keys = keys.filter((key: string) => key !== 'company'); } - keys.map((el) => { + keys.map((el: string) => { if (el === 'client') { colDefs = [ ...colDefs, From 0077e222cc936b0b5a7b3b809334a5058bd1077b Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 22 Feb 2024 08:33:29 +0545 Subject: [PATCH 018/155] fix: OUT-79 | fix form fields appearing in random order --- src/app/manage/views/ManagePageContainer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index 6b26173..f485627 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -6,6 +6,7 @@ import { StyledTextInput } from '@/components/styled/StyledTextInput'; import { Box, Stack, Tooltip, Typography, styled } from '@mui/material'; import { FC, ReactElement, useMemo, useState } from 'react'; import { EmptyStateFallback } from './EmptyStateFallback'; +import { order } from '@/utils/orderable'; export const ManagePageContainer = ({ customFieldAccess, @@ -124,7 +125,7 @@ export const ManagePageContainer = ({ }} > {allowedCustomField && - allowedCustomField.map((field: any, key: number) => { + order(allowedCustomField).map((field: any, key: number) => { if (field.type !== 'multiSelect') { return ( From 0fc7538fc5139a7922d73bf28ab1322f368d6e51 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari <59971845+rrojan@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:57:36 +0545 Subject: [PATCH 019/155] OUT-66 | Profile Manager Fixes (#2) * fix: order custom fields according to order key * feat: default to fallbackColor when iconImageUrl is not provided * fix: form doesn't allow to save empty fields * fix: display empty when field is cleared * feat: limit update history to 4 items * fix: implement limit on backend * chore!: bump copilot-node-sdk to 1.2.0 * revert: unset on empty field input * fix: sort custom fields based on recently created * fix: show empty if field was updated from previously empty value * chore: log to stderr instead of stdout * fix: implement singleton pattern in db util properly (prevent multiple prisma client created issue) * fix: minor fixes * revert: remove deprecated comment * fix: save primary color in a theme util instead --- package.json | 2 +- src/app/api/client-profile-updates/route.ts | 1 + .../services/clientProfileUpdates.service.ts | 8 ++++- src/app/api/client/route.ts | 2 +- src/app/api/profile-update-history/route.ts | 7 ++++ .../CustomFieldAccessTable.tsx | 3 +- src/components/table/Table.tsx | 1 + .../cellRenderers/CompanyCellRenderer.tsx | 13 +++++--- .../table/cellRenderers/CompanyIcon.tsx | 33 +++++++++++++++++++ src/lib/db.ts | 26 +++++++++++++-- src/types/common.ts | 3 +- src/utils/copilotApiUtils.ts | 2 +- src/utils/copilotTheme.ts | 7 ++++ src/utils/orderable.ts | 7 ++++ yarn.lock | 8 ++--- 15 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 src/components/table/cellRenderers/CompanyIcon.tsx create mode 100644 src/utils/copilotTheme.ts create mode 100644 src/utils/orderable.ts diff --git a/package.json b/package.json index 46ff062..c52e442 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@mui/material": "^5.15.4", "@prisma/client": "^5.7.1", "@vercel/postgres": "^0.5.1", - "copilot-node-sdk": "^0.0.45", + "copilot-node-sdk": "^1.2.0", "ag-grid-react": "^31.0.2", "next": "14.1.0", "prisma": "^5.7.1", diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index f4faecf..140cad3 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -114,5 +114,6 @@ function getCompanyDetails(company: CompanyResponse) { id: company.id, name: company.name, iconImageUrl: company.iconImageUrl, + fallbackColor: company.fallbackColor, }; } diff --git a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts index af704e5..57a2849 100644 --- a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts +++ b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts @@ -33,12 +33,18 @@ export class ClientProfileUpdatesService { in: companyIds, }, }, + orderBy: { + createdAt: 'desc', + }, }); } else { clientProfileUpdates = await this.prismaClient.clientProfileUpdates.findMany({ where: { portalId: portalId, }, + orderBy: { + createdAt: 'desc', + }, }); } @@ -53,7 +59,7 @@ export class ClientProfileUpdatesService { AND "createdAt" <= ${lastUpdated} AND "changedFields" ->> ${customFieldKey} IS NOT NULL ORDER BY "createdAt" DESC - LIMIT 5; + LIMIT 4; `; } } diff --git a/src/app/api/client/route.ts b/src/app/api/client/route.ts index 1bc44ec..ae8b2a9 100644 --- a/src/app/api/client/route.ts +++ b/src/app/api/client/route.ts @@ -19,7 +19,7 @@ export async function GET(request: NextRequest) { return NextResponse.json({ data: client }); } catch (error) { - console.log(error); + console.error(error); return respondError('Client not found.', 404); } } diff --git a/src/app/api/profile-update-history/route.ts b/src/app/api/profile-update-history/route.ts index 4c78eab..fb65112 100644 --- a/src/app/api/profile-update-history/route.ts +++ b/src/app/api/profile-update-history/route.ts @@ -45,6 +45,13 @@ export async function GET(request: NextRequest) { value: options.length > 0 ? options : value, }; }); + // If update history contains fewer than 4 items we assume the oldest value to start from empty + if (parsedUpdateHistory.length < 4) { + parsedUpdateHistory.push({ + type: 'text', + value: 'Empty', + }); + } return NextResponse.json(parsedUpdateHistory); } catch (error) { diff --git a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx index dd7f0f2..3b90f41 100644 --- a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx +++ b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx @@ -5,6 +5,7 @@ import { StyledCheckBox } from '../styled/StyledCheckbox'; import { useAppState } from '@/hooks/useAppState'; import { iconsTypeMap } from './iconsTypeMap'; import { Permissions } from '@/types/settings'; +import { order } from '@/utils/orderable'; export const CustomFieldAccessTable = () => { const appState = useAppState(); @@ -68,7 +69,7 @@ export const CustomFieldAccessTable = () => { - {appState?.mutableCustomFieldAccess.map((field: any, key: number) => { + {order(appState?.mutableCustomFieldAccess).map((field: any, key: number) => { return ( diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 6237de2..670a809 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -111,6 +111,7 @@ export const TableCore = () => { return { iconImageUrl: company.iconImageUrl, name: company.name, + fallbackColor: company.fallbackColor, }; }, }, diff --git a/src/components/table/cellRenderers/CompanyCellRenderer.tsx b/src/components/table/cellRenderers/CompanyCellRenderer.tsx index 55256fd..6c1038a 100644 --- a/src/components/table/cellRenderers/CompanyCellRenderer.tsx +++ b/src/components/table/cellRenderers/CompanyCellRenderer.tsx @@ -1,10 +1,15 @@ -import { Box, Stack, Typography } from '@mui/material'; +import { Stack, Typography } from '@mui/material'; +import CompanyIcon from '@/components/table/cellRenderers/CompanyIcon'; -export const CompanyCellRenderer = ({ value }: { value: { iconImageUrl: string; name: string } }) => { - const { iconImageUrl, name } = value; +export const CompanyCellRenderer = ({ + value, +}: { + value: { iconImageUrl: string; name: string; fallbackColor?: string }; +}) => { + const { iconImageUrl, name, fallbackColor } = value; return ( - {iconImageUrl && } + {name} diff --git a/src/components/table/cellRenderers/CompanyIcon.tsx b/src/components/table/cellRenderers/CompanyIcon.tsx new file mode 100644 index 0000000..c0b40ac --- /dev/null +++ b/src/components/table/cellRenderers/CompanyIcon.tsx @@ -0,0 +1,33 @@ +import copilotTheme from '@/utils/copilotTheme'; +import { Box } from '@mui/material'; + +interface CompanyIconProps { + label: string; + iconImageUrl: string; + fallbackColor?: string; +} + +const CompanyIcon = ({ label, iconImageUrl, fallbackColor }: CompanyIconProps) => { + return iconImageUrl ? ( + + ) : ( + + {label} + + ); +}; + +export default CompanyIcon; diff --git a/src/lib/db.ts b/src/lib/db.ts index 5b6ed4c..9f778ff 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -2,12 +2,32 @@ import { PrismaClient } from '@prisma/client'; class DBClient { private static client: PrismaClient; + private static isInitialized = false; + + private constructor() { + // private constructor to prevent external instantiation + } + + private static async disconnectAndExit(): Promise { + if (DBClient.client) { + await DBClient.client.$disconnect(); + } + process.exit(); + } static getInstance(): PrismaClient { - if (this.client) { - return this.client; + if (!this.client) { + if (!this.isInitialized) { + // Make sure that prisma client is only created once + this.client = new PrismaClient(); + this.isInitialized = true; + + // disconnect the client when the Node.js process exits + process.on('beforeExit', DBClient.disconnectAndExit); + process.on('SIGINT', DBClient.disconnectAndExit); + process.on('SIGTERM', DBClient.disconnectAndExit); + } } - this.client = new PrismaClient(); return this.client; } diff --git a/src/types/common.ts b/src/types/common.ts index 99d812d..31a34bb 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -5,7 +5,7 @@ export const MeResponseSchema = z.object({ givenName: z.string(), familyName: z.string(), email: z.string(), - portalName: z.string(), + portalName: z.string().optional(), }); export type MeResponse = z.infer; @@ -30,6 +30,7 @@ export const CompanyResponseSchema = z.object({ id: z.string(), name: z.string(), iconImageUrl: z.string().nullable(), + fallbackColor: z.string().nullish(), }); export type CompanyResponse = z.infer; diff --git a/src/utils/copilotApiUtils.ts b/src/utils/copilotApiUtils.ts index 618108c..f464070 100644 --- a/src/utils/copilotApiUtils.ts +++ b/src/utils/copilotApiUtils.ts @@ -27,7 +27,7 @@ export class CopilotAPI { } async me(): Promise { - return MeResponseSchema.parse(await this.copilot.getUserAndPortalInfo()); + return MeResponseSchema.parse(await this.copilot.getUserInfo()); } async getClient(clientId: string): Promise { diff --git a/src/utils/copilotTheme.ts b/src/utils/copilotTheme.ts new file mode 100644 index 0000000..51ec737 --- /dev/null +++ b/src/utils/copilotTheme.ts @@ -0,0 +1,7 @@ +const copilotTheme = { + colors: { + primary: '#09AA6C', + }, +}; + +export default copilotTheme; diff --git a/src/utils/orderable.ts b/src/utils/orderable.ts new file mode 100644 index 0000000..4b075fe --- /dev/null +++ b/src/utils/orderable.ts @@ -0,0 +1,7 @@ +interface OrderableObject { + order: number; +} + +export function order(list: Orderable) { + return list.sort((a, b) => a.order - b.order); +} diff --git a/yarn.lock b/yarn.lock index fe559a0..533aa8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2213,10 +2213,10 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -copilot-node-sdk@^0.0.45: - version "0.0.45" - resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-0.0.45.tgz#82127dd6a4ff149d633b1e416aa7d0b636b4e8d8" - integrity sha512-K0ufAvAN2JSRst6KZGH+YSr7auiNg2oaeUK7ccAEwDMvfdtuF2MeUK+B894C5GobeOJapcVAL3BGGaJA0QKA8A== +copilot-node-sdk@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-1.2.2.tgz#7f23c14669630f016f6ce6d92ac667f5b8d0ff4a" + integrity sha512-UqGYrwH/rqEjeuP+fqZQx7z2/1XhKELgkiZDhNr5zHhoI8DC4owoQEJTe/0lI4H/rJTLqZTBqagzWohuG4OOcg== dependencies: isomorphic-fetch "^3.0.0" jsonwebtoken "^9.0.2" From 212c0a430eace815d086f96adc32dadbc9839e46 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 23 Feb 2024 11:58:24 +0545 Subject: [PATCH 020/155] feat: implement dynamic slicing for main columns --- src/app/views/MainSection.tsx | 2 +- src/app/views/Sidebar.tsx | 2 +- src/components/table/Table.tsx | 4 ++-- src/layouts/Footer.tsx | 2 +- src/utils/array.ts | 14 ++++++++++++++ src/utils/arrayHaveSameElements.ts | 8 -------- 6 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 src/utils/array.ts delete mode 100644 src/utils/arrayHaveSameElements.ts diff --git a/src/app/views/MainSection.tsx b/src/app/views/MainSection.tsx index 63a3319..cfda9cf 100644 --- a/src/app/views/MainSection.tsx +++ b/src/app/views/MainSection.tsx @@ -6,7 +6,7 @@ import { Header } from '@/layouts/Header'; import { Box } from '@mui/material'; import { Sidebar } from './Sidebar'; import { TableCore } from '@/components/table/Table'; -import { arraysHaveSameElements } from '@/utils/arrayHaveSameElements'; +import { arraysHaveSameElements } from '@/utils/array'; const MainSection = () => { const appState = useAppState(); diff --git a/src/app/views/Sidebar.tsx b/src/app/views/Sidebar.tsx index fdbf73f..3bf4d50 100644 --- a/src/app/views/Sidebar.tsx +++ b/src/app/views/Sidebar.tsx @@ -4,7 +4,7 @@ import { CustomFieldAccessTable } from '@/components/customFieldAccessTable/Cust import { Box, Stack, Typography } from '@mui/material'; import { Switch } from '@/components/switch/Switch'; import { useAppState } from '@/hooks/useAppState'; -import { arraysHaveSameElements } from '@/utils/arrayHaveSameElements'; +import { arraysHaveSameElements } from '@/utils/array'; import { ProfileLinks } from '@/types/settings'; export const Sidebar = () => { diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index eb12687..9f5d499 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -9,7 +9,7 @@ import { CompanyCellRenderer } from './cellRenderers/CompanyCellRenderer'; import { HistoryCellRenderer } from './cellRenderers/HistoryCellRenderer'; import { useAppState } from '@/hooks/useAppState'; import { getTimeAgo } from '@/utils/getTimeAgo'; -import { arraysHaveSameElements } from '@/utils/arrayHaveSameElements'; +import { arraysHaveSameElements, sliceTillElement } from '@/utils/array'; import { order } from '@/utils/orderable'; export const TableCore = () => { @@ -65,7 +65,7 @@ export const TableCore = () => { let keys = [ // This destructure is for essential meta info fields: client, company, last updated - ...Object.keys(col).slice(0, 3), + ...sliceTillElement(Object.keys(col), 'lastUpdated'), // Rest of these cols are for profile custom fields ...order(appState?.mutableCustomFieldAccess).map((field: { name: string }) => field.name), ]; diff --git a/src/layouts/Footer.tsx b/src/layouts/Footer.tsx index 9bbcbd4..38d545d 100644 --- a/src/layouts/Footer.tsx +++ b/src/layouts/Footer.tsx @@ -2,7 +2,7 @@ import { FooterSave } from '@/components/footerSave/FooterSave'; import { useAppState } from '@/hooks/useAppState'; -import { arraysHaveSameElements } from '@/utils/arrayHaveSameElements'; +import { arraysHaveSameElements } from '@/utils/array'; import { useState } from 'react'; export const Footer = () => { diff --git a/src/utils/array.ts b/src/utils/array.ts new file mode 100644 index 0000000..d490f33 --- /dev/null +++ b/src/utils/array.ts @@ -0,0 +1,14 @@ +export function arraysHaveSameElements(arr1: string[], arr2: string[]) { + // Sort the arrays + const sortedArr1 = arr1.slice().sort(); + const sortedArr2 = arr2.slice().sort(); + + // Compare the sorted arrays + return JSON.stringify(sortedArr1) === JSON.stringify(sortedArr2); +} + +// Returns a subset of the array sliced from the startIndex (default 0) till the target +export const sliceTillElement = (arr: T[], target: T, startIndex: number = 0): T[] => { + const index = arr.indexOf(target); + return index >= 0 ? arr.slice(startIndex, index + 1) : []; +}; diff --git a/src/utils/arrayHaveSameElements.ts b/src/utils/arrayHaveSameElements.ts deleted file mode 100644 index 399c47f..0000000 --- a/src/utils/arrayHaveSameElements.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function arraysHaveSameElements(arr1: string[], arr2: string[]) { - // Sort the arrays - const sortedArr1 = arr1.slice().sort(); - const sortedArr2 = arr2.slice().sort(); - - // Compare the sorted arrays - return JSON.stringify(sortedArr1) === JSON.stringify(sortedArr2); -} From 74dfa1694da26884ba4d14f556377cb3596c7ece Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 23 Feb 2024 13:29:40 +0545 Subject: [PATCH 021/155] fix: fetch settings directly --- services/workspace.ts | 15 +++++---------- src/app/api/workspace/route.ts | 21 --------------------- 2 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 src/app/api/workspace/route.ts diff --git a/services/workspace.ts b/services/workspace.ts index 83e0990..1a8af8f 100644 --- a/services/workspace.ts +++ b/services/workspace.ts @@ -1,16 +1,11 @@ import { apiUrl } from '@/config'; import { APIProps } from '@/types/api'; import { WorkspaceResponse } from '@/types/common'; +import { CopilotAPI } from '@/utils/copilotApiUtils'; +import { z } from 'zod'; // Fetch workspace from API -export async function getWorkspaceInfo({ token, portalId }: APIProps): Promise { - const res = await fetch(`${apiUrl}/api/workspace?token=${token}`, { - next: { tags: ['workspace'] }, - }); - - if (!res.ok) { - throw new Error('Something went wrong in getWorkspaceInfo'); - } - - return (await res.json()) as WorkspaceResponse; +export async function getWorkspaceInfo({ token }: APIProps): Promise { + const copilotClient = new CopilotAPI(z.string().parse(token)); + return await copilotClient.getWorkspace(); } diff --git a/src/app/api/workspace/route.ts b/src/app/api/workspace/route.ts deleted file mode 100644 index 11f4bd7..0000000 --- a/src/app/api/workspace/route.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { handleError, respondError } from '@/utils/common'; -import { CopilotAPI } from '@/utils/copilotApiUtils'; -import { NextRequest, NextResponse } from 'next/server'; -import { z } from 'zod'; - -export async function GET(request: NextRequest) { - const searchParams = request.nextUrl.searchParams; - const token = searchParams.get('token'); - - if (!token) { - return respondError('Missing token', 422); - } - - const copilotClient = new CopilotAPI(z.string().parse(token)); - - try { - return NextResponse.json(await copilotClient.getWorkspace()); - } catch (e) { - return handleError(e); - } -} From 4e1f98262456cf3e29c63cd065772d3874a65d7b Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 18:50:10 +0545 Subject: [PATCH 022/155] feat: add usable button component --- src/components/atoms/Button.tsx | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/components/atoms/Button.tsx diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx new file mode 100644 index 0000000..7fdb01d --- /dev/null +++ b/src/components/atoms/Button.tsx @@ -0,0 +1,38 @@ +import { SimpleButton } from '@/components/styled/SimpleButton'; +import { Typography } from '@mui/material'; +import { TypographyPropsVariantOverrides } from '@mui/material/Typography/Typography'; +import { OverridableStringUnion } from '@mui/types'; +import { Variant } from '@mui/material/styles/createTypography'; +import Link from 'next/link'; + +type ButtonModes = 'button' | 'link'; + +interface ButtonProps { + children: string | JSX.Element; + typographyVariant?: OverridableStringUnion; + mode?: ButtonModes; + href?: string; + onClick?: () => void; +} + +const Button = ({ mode = 'link', children, href, typographyVariant = 'md', onClick }: ButtonProps) => { + if (mode === 'link') { + // Use mode link if you want Next to route to another url but also prefetch that page + return ( + + + {children} + + + ); + } + + // Use mode button if you have custom behaviour / don't want prefetching to work + return ( + + {children} + + ); +}; + +export default Button; From 4cf8548facad2fcd2090592ccc0ecbe58f281f1b Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 18:50:29 +0545 Subject: [PATCH 023/155] feat: implement profile & payment urls in manage --- src/app/manage/page.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index b313267..1df9e5c 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -1,10 +1,10 @@ import { Box, Stack, Typography } from '@mui/material'; import { ManagePageContainer } from './views/ManagePageContainer'; -import { SimpleButton } from '@/components/styled/SimpleButton'; import { apiUrl } from '@/config'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; -import { Settings } from '@mui/icons-material'; import { ProfileLinks } from '@/types/settings'; +import Button from '@/components/atoms/Button'; +import { ClientLinks } from '@/utils/copilotLinks'; export const revalidate = 0; @@ -82,14 +82,10 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok )} {settings && settings.includes(ProfileLinks.PaymentMethod) && ( - - Set a payment method - + )} {settings && settings.includes(ProfileLinks.ProfileSetting) && ( - - Go to account settings - + )} From 3e218b1434a022bb82fb17771ac2197f175580fc Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 18:50:45 +0545 Subject: [PATCH 024/155] chore: add object to track usable client portal links --- src/utils/copilotLinks.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/utils/copilotLinks.ts diff --git a/src/utils/copilotLinks.ts b/src/utils/copilotLinks.ts new file mode 100644 index 0000000..a0c63cc --- /dev/null +++ b/src/utils/copilotLinks.ts @@ -0,0 +1,4 @@ +export const ClientLinks = { + profile: '/settings/profile', + paymentMethods: '/settings/billing', +}; From f89ba69c88fd1a97c6f0833ea66a181c8ed79bdc Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 18:56:56 +0545 Subject: [PATCH 025/155] fix: use latest node 18 version in workflow --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6818bcd..31fab0a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 18.17.0 + node-version: 18 cache: yarn cache-dependency-path: './yarn.lock' From a37bea49d8bcb909f8a0df9f3048eebfe2b4dba0 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 19:01:23 +0545 Subject: [PATCH 026/155] chore: match patch version for 1.2.x > 1.2.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c52e442..164d081 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@mui/material": "^5.15.4", "@prisma/client": "^5.7.1", "@vercel/postgres": "^0.5.1", - "copilot-node-sdk": "^1.2.0", + "copilot-node-sdk": "^1.2.2", "ag-grid-react": "^31.0.2", "next": "14.1.0", "prisma": "^5.7.1", From 2105ed4a22740fab044fa4bfc563b14e5ade59ae Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 19:24:52 +0545 Subject: [PATCH 027/155] fix: minor fixes --- src/app/manage/page.tsx | 5 ++--- src/components/atoms/Button.tsx | 12 ++++++++++-- src/utils/copilotLinks.ts | 4 ---- 3 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 src/utils/copilotLinks.ts diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 1df9e5c..ebf71f6 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -4,7 +4,6 @@ import { apiUrl } from '@/config'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ProfileLinks } from '@/types/settings'; import Button from '@/components/atoms/Button'; -import { ClientLinks } from '@/utils/copilotLinks'; export const revalidate = 0; @@ -82,10 +81,10 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok )} {settings && settings.includes(ProfileLinks.PaymentMethod) && ( - + )} {settings && settings.includes(ProfileLinks.ProfileSetting) && ( - + )} diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 7fdb01d..a4d5b60 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -1,3 +1,5 @@ +'use client'; + import { SimpleButton } from '@/components/styled/SimpleButton'; import { Typography } from '@mui/material'; import { TypographyPropsVariantOverrides } from '@mui/material/Typography/Typography'; @@ -12,10 +14,16 @@ interface ButtonProps { typographyVariant?: OverridableStringUnion; mode?: ButtonModes; href?: string; - onClick?: () => void; + route?: string; } -const Button = ({ mode = 'link', children, href, typographyVariant = 'md', onClick }: ButtonProps) => { +const Button = ({ mode = 'button', children, href, route, typographyVariant = 'md' }: ButtonProps) => { + let onClick; + if (mode === 'button' && route) { + onClick = () => { + window.parent.postMessage({ type: 'history.push', route }, '*'); + }; + } if (mode === 'link') { // Use mode link if you want Next to route to another url but also prefetch that page return ( diff --git a/src/utils/copilotLinks.ts b/src/utils/copilotLinks.ts deleted file mode 100644 index a0c63cc..0000000 --- a/src/utils/copilotLinks.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const ClientLinks = { - profile: '/settings/profile', - paymentMethods: '/settings/billing', -}; From 8a86c1feee150d736c286ad3a20879b097d62ee5 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 19:39:09 +0545 Subject: [PATCH 028/155] refactor: clean up code --- src/components/atoms/Button.tsx | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index a4d5b60..82cdf9a 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -7,35 +7,16 @@ import { OverridableStringUnion } from '@mui/types'; import { Variant } from '@mui/material/styles/createTypography'; import Link from 'next/link'; -type ButtonModes = 'button' | 'link'; - interface ButtonProps { children: string | JSX.Element; - typographyVariant?: OverridableStringUnion; - mode?: ButtonModes; - href?: string; route?: string; + typographyVariant?: OverridableStringUnion; + onClick?: () => void; } -const Button = ({ mode = 'button', children, href, route, typographyVariant = 'md' }: ButtonProps) => { - let onClick; - if (mode === 'button' && route) { - onClick = () => { - window.parent.postMessage({ type: 'history.push', route }, '*'); - }; - } - if (mode === 'link') { - // Use mode link if you want Next to route to another url but also prefetch that page - return ( - - - {children} - - - ); - } +const Button = ({ children, route, onClick, typographyVariant = 'md' }: ButtonProps) => { + onClick = onClick || (() => window.parent.postMessage({ type: 'history.push', route: route || '#' }, '*')); - // Use mode button if you have custom behaviour / don't want prefetching to work return ( {children} From 4c1d747bbaf3f8cd0e101daefcc86a79ed1fe843 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 19:41:27 +0545 Subject: [PATCH 029/155] refactor: make portal links type safe --- src/components/atoms/Button.tsx | 2 +- src/types/copilotPortal.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/types/copilotPortal.ts diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 82cdf9a..0386695 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -9,7 +9,7 @@ import Link from 'next/link'; interface ButtonProps { children: string | JSX.Element; - route?: string; + route?: PortalRoutes; typographyVariant?: OverridableStringUnion; onClick?: () => void; } diff --git a/src/types/copilotPortal.ts b/src/types/copilotPortal.ts new file mode 100644 index 0000000..1b02008 --- /dev/null +++ b/src/types/copilotPortal.ts @@ -0,0 +1,11 @@ +type PortalRoutes = + | 'messages' + | 'files' + | 'contracts' + | 'forms' + | 'billing' + | 'helpdesk' + | 'profile' + | 'settings' + | 'billing' + | 'notifications'; From e0adc92f9de7a7007222130c1233690c0d3c8cae Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 19:42:32 +0545 Subject: [PATCH 030/155] fix: export portal routes --- src/components/atoms/Button.tsx | 2 +- src/types/copilotPortal.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 0386695..d7f470b 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -5,7 +5,7 @@ import { Typography } from '@mui/material'; import { TypographyPropsVariantOverrides } from '@mui/material/Typography/Typography'; import { OverridableStringUnion } from '@mui/types'; import { Variant } from '@mui/material/styles/createTypography'; -import Link from 'next/link'; +import { PortalRoutes } from '@/types/copilotPortal'; interface ButtonProps { children: string | JSX.Element; diff --git a/src/types/copilotPortal.ts b/src/types/copilotPortal.ts index 1b02008..828160e 100644 --- a/src/types/copilotPortal.ts +++ b/src/types/copilotPortal.ts @@ -1,4 +1,4 @@ -type PortalRoutes = +export type PortalRoutes = | 'messages' | 'files' | 'contracts' From 548c9992038fb55723e5e389834bc68053f58790 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 26 Feb 2024 19:45:26 +0545 Subject: [PATCH 031/155] refactor: clean up code --- src/components/atoms/Button.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index d7f470b..a0ed5de 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -15,7 +15,7 @@ interface ButtonProps { } const Button = ({ children, route, onClick, typographyVariant = 'md' }: ButtonProps) => { - onClick = onClick || (() => window.parent.postMessage({ type: 'history.push', route: route || '#' }, '*')); + onClick = onClick || (route && (() => window.parent.postMessage({ type: 'history.push', route }, '*'))); return ( From 7cd775ab49a8e666d9f034955dfa7ca55508dd65 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 27 Feb 2024 14:48:09 +0545 Subject: [PATCH 032/155] fix: use portal id from workspace instead of search params --- services/workspace.ts | 2 +- src/app/manage/page.tsx | 6 ++++-- src/app/page.tsx | 5 +++-- src/types/common.ts | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/services/workspace.ts b/services/workspace.ts index 1a8af8f..d53b610 100644 --- a/services/workspace.ts +++ b/services/workspace.ts @@ -5,7 +5,7 @@ import { CopilotAPI } from '@/utils/copilotApiUtils'; import { z } from 'zod'; // Fetch workspace from API -export async function getWorkspaceInfo({ token }: APIProps): Promise { +export async function getWorkspaceInfo({ token }: { token: string }): Promise { const copilotClient = new CopilotAPI(z.string().parse(token)); return await copilotClient.getWorkspace(); } diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index b313267..a797847 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -3,8 +3,8 @@ import { ManagePageContainer } from './views/ManagePageContainer'; import { SimpleButton } from '@/components/styled/SimpleButton'; import { apiUrl } from '@/config'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; -import { Settings } from '@mui/icons-material'; import { ProfileLinks } from '@/types/settings'; +import { getWorkspaceInfo } from '../../../services/workspace'; export const revalidate = 0; @@ -48,10 +48,12 @@ async function getClient(clientId: string, token: string) { } export default async function ManagePage({ searchParams }: { searchParams: { token: string; portalId: string } }) { - const { token, portalId } = searchParams; + const { token } = searchParams; + const { id: portalId } = await getWorkspaceInfo({ token }); const settings = await getSettings({ token, portalId }).then((s) => s?.profileLinks || []); const customFieldAccess = await getCustomFieldAccess({ token, portalId }); + // static for now, will be dynamic later after some API decisions are made const clientId = 'a583a0d0-de70-4d14-8bb1-0aacf7424e2c'; const companyId = '52eb75a9-2790-4e37-aa7a-c13f7bc3aa91'; diff --git a/src/app/page.tsx b/src/app/page.tsx index d8c1110..1173127 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -63,12 +63,13 @@ async function getSettings({ token, portalId }: { token: string; portalId: strin } export default async function Home({ searchParams }: { searchParams: { token: string; portalId: string } }) { - const { token, portalId } = searchParams; + const { token } = searchParams; + const workspace = await getWorkspaceInfo({ token }); + const { id: portalId } = workspace; const clientProfileUpdates = await getClientProfileUpdates({ token, portalId }); const customFieldAccess = await getCustomFieldAccess({ token, portalId }); const settings = await getSettings({ token, portalId }); - const workspace = await getWorkspaceInfo({ token, portalId }); return ( ; // Response schema for `/workspace` endpoint export const WorkspaceResponseSchema = z.object({ + id: z.string(), isCompaniesEnabled: z.boolean().optional(), // For future use - // id: z.string(), // industry: z.string().optional(), // isClientDirectSignUpEnabled: z.boolean().optional(), // logOutUrl: z.string().optional(), From 975fa5a2fab355f3550bf2825804be3aa5d8cd5b Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 27 Feb 2024 14:53:19 +0545 Subject: [PATCH 033/155] fix: type issue on initial app state --- src/context/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/index.tsx b/src/context/index.tsx index 375cf90..85b1606 100644 --- a/src/context/index.tsx +++ b/src/context/index.tsx @@ -47,7 +47,7 @@ export const AppContextProvider: FC = ({ children }) => { mutableSettings: [], token: '', portalId: '', - workspace: { isCompaniesEnabled: undefined }, + workspace: { isCompaniesEnabled: undefined, id: '' }, }); return ( From 6c6a1d5141d44aa0272e307a72563b764c0eff44 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 27 Feb 2024 18:56:13 +0545 Subject: [PATCH 034/155] fix: zod issue on customFields crashing both pages --- src/app/api/client-profile-updates/route.ts | 7 +++++-- src/types/common.ts | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 140cad3..1890f96 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -20,7 +20,10 @@ export async function POST(request: NextRequest) { const clientUpdateResponse = await copilotClient.updateClient(clientProfileUpdateRequest.data.clientId, { customFields: clientProfileUpdateRequest.data.form, }); - const changedFields = getObjectDifference(clientUpdateResponse.customFields ?? {}, client.customFields ?? {}); + const changedFields = getObjectDifference( + (clientUpdateResponse.customFields ?? {}) as Record, + (client.customFields ?? {}) as Record, + ); if (Object.keys(changedFields).length === 0) { return NextResponse.json({}); } @@ -30,7 +33,7 @@ export async function POST(request: NextRequest) { clientId: clientProfileUpdateRequest.data.clientId, companyId: clientProfileUpdateRequest.data.companyId, portalId: clientProfileUpdateRequest.data.portalId, - customFields: clientUpdateResponse.customFields ?? {}, + customFields: (clientUpdateResponse.customFields ?? {}) as Record, changedFields, }); diff --git a/src/types/common.ts b/src/types/common.ts index 1263098..d0d5540 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -46,7 +46,8 @@ export const ClientResponseSchema = z.object({ companyId: z.string(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())])).nullable(), + customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + // customFields: z.any(), }); export type ClientResponse = z.infer; @@ -96,6 +97,7 @@ export const ClientRequestSchema = z.object({ givenName: z.string().optional(), familyName: z.string().optional(), companyId: z.string().uuid().optional(), - customFields: z.record(z.union([z.string(), z.array(z.string())])).optional(), + customFields: z.record(z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + // customFields: z.any(), }); export type ClientRequest = z.infer; From 4ef4b5fecb6610e45857d28ed1f29182a2f38ae2 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 27 Feb 2024 18:56:13 +0545 Subject: [PATCH 035/155] fix: zod issue on customFields crashing both pages --- src/app/api/client-profile-updates/route.ts | 7 +++++-- src/types/common.ts | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 140cad3..1890f96 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -20,7 +20,10 @@ export async function POST(request: NextRequest) { const clientUpdateResponse = await copilotClient.updateClient(clientProfileUpdateRequest.data.clientId, { customFields: clientProfileUpdateRequest.data.form, }); - const changedFields = getObjectDifference(clientUpdateResponse.customFields ?? {}, client.customFields ?? {}); + const changedFields = getObjectDifference( + (clientUpdateResponse.customFields ?? {}) as Record, + (client.customFields ?? {}) as Record, + ); if (Object.keys(changedFields).length === 0) { return NextResponse.json({}); } @@ -30,7 +33,7 @@ export async function POST(request: NextRequest) { clientId: clientProfileUpdateRequest.data.clientId, companyId: clientProfileUpdateRequest.data.companyId, portalId: clientProfileUpdateRequest.data.portalId, - customFields: clientUpdateResponse.customFields ?? {}, + customFields: (clientUpdateResponse.customFields ?? {}) as Record, changedFields, }); diff --git a/src/types/common.ts b/src/types/common.ts index e5bca42..dc4d352 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -46,7 +46,8 @@ export const ClientResponseSchema = z.object({ companyId: z.string(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())])).nullable(), + customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + // customFields: z.any(), }); export type ClientResponse = z.infer; @@ -96,6 +97,7 @@ export const ClientRequestSchema = z.object({ givenName: z.string().optional(), familyName: z.string().optional(), companyId: z.string().uuid().optional(), - customFields: z.record(z.union([z.string(), z.array(z.string())])).optional(), + customFields: z.record(z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + // customFields: z.any(), }); export type ClientRequest = z.infer; From 4d30c611967cf8cd26263bb43501825dcdd66af9 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 27 Feb 2024 19:35:53 +0545 Subject: [PATCH 036/155] refactor: remove commented code --- src/types/common.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/types/common.ts b/src/types/common.ts index dc4d352..bea2c7d 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -47,7 +47,6 @@ export const ClientResponseSchema = z.object({ status: z.string(), avatarImageUrl: z.string().nullable(), customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), - // customFields: z.any(), }); export type ClientResponse = z.infer; @@ -98,6 +97,5 @@ export const ClientRequestSchema = z.object({ familyName: z.string().optional(), companyId: z.string().uuid().optional(), customFields: z.record(z.union([z.string(), z.array(z.string())]).nullable()).nullish(), - // customFields: z.any(), }); export type ClientRequest = z.infer; From ca418c26608a41b977a203ab05beb09b7bef3d3c Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 28 Feb 2024 18:52:12 +0545 Subject: [PATCH 037/155] fix: minor issues --- src/app/manage/page.tsx | 5 +++-- src/components/atoms/Button.tsx | 11 ++++++----- src/types/copilotPortal.ts | 24 +++++++++++++----------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index ebf71f6..8937028 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -4,6 +4,7 @@ import { apiUrl } from '@/config'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ProfileLinks } from '@/types/settings'; import Button from '@/components/atoms/Button'; +import { PortalRoutes } from '@/types/copilotPortal'; export const revalidate = 0; @@ -81,10 +82,10 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok )} {settings && settings.includes(ProfileLinks.PaymentMethod) && ( - + )} {settings && settings.includes(ProfileLinks.ProfileSetting) && ( - + )} diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index a0ed5de..e8c7ecb 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -5,20 +5,21 @@ import { Typography } from '@mui/material'; import { TypographyPropsVariantOverrides } from '@mui/material/Typography/Typography'; import { OverridableStringUnion } from '@mui/types'; import { Variant } from '@mui/material/styles/createTypography'; -import { PortalRoutes } from '@/types/copilotPortal'; +import { AvailablePortalRoutes, PortalRoutes } from '@/types/copilotPortal'; +import { ReactNode } from 'react'; interface ButtonProps { - children: string | JSX.Element; - route?: PortalRoutes; + children: string | ReactNode; + route?: AvailablePortalRoutes; typographyVariant?: OverridableStringUnion; onClick?: () => void; } const Button = ({ children, route, onClick, typographyVariant = 'md' }: ButtonProps) => { - onClick = onClick || (route && (() => window.parent.postMessage({ type: 'history.push', route }, '*'))); + const handleClick = onClick || (route && (() => window.parent.postMessage({ type: 'history.push', route }, '*'))); return ( - + {children} ); diff --git a/src/types/copilotPortal.ts b/src/types/copilotPortal.ts index 828160e..0347f5e 100644 --- a/src/types/copilotPortal.ts +++ b/src/types/copilotPortal.ts @@ -1,11 +1,13 @@ -export type PortalRoutes = - | 'messages' - | 'files' - | 'contracts' - | 'forms' - | 'billing' - | 'helpdesk' - | 'profile' - | 'settings' - | 'billing' - | 'notifications'; +export enum PortalRoutes { + Messages = 'messages', + Files = 'files', + Contracts = 'contracts', + Forms = 'forms', + Billing = 'billing', + Helpdesk = 'helpdesk', + Profile = 'profile', + Settings = 'settings', + Notifications = 'notifications', +} + +export type AvailablePortalRoutes = `${PortalRoutes}`; // NOTE: this creates string union of enum values From 2437f2352130839de1153b70b66b2b5604be01b7 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 28 Feb 2024 19:07:02 +0545 Subject: [PATCH 038/155] fix: make button route pushing semantic --- src/app/manage/page.tsx | 4 ++-- src/components/atoms/Button.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 8937028..9bceb0d 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -82,10 +82,10 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok )} {settings && settings.includes(ProfileLinks.PaymentMethod) && ( - + )} {settings && settings.includes(ProfileLinks.ProfileSetting) && ( - + )} diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index e8c7ecb..f45e305 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -10,13 +10,14 @@ import { ReactNode } from 'react'; interface ButtonProps { children: string | ReactNode; - route?: AvailablePortalRoutes; + parentRouteOnClick?: AvailablePortalRoutes; typographyVariant?: OverridableStringUnion; onClick?: () => void; } -const Button = ({ children, route, onClick, typographyVariant = 'md' }: ButtonProps) => { - const handleClick = onClick || (route && (() => window.parent.postMessage({ type: 'history.push', route }, '*'))); +const Button = ({ children, parentRouteOnClick, onClick, typographyVariant = 'md' }: ButtonProps) => { + const handleClick = + onClick || (parentRouteOnClick && (() => window.parent.postMessage({ type: 'history.push', parentRouteOnClick }, '*'))); return ( From 2d76e07b6cec806a87c61f0f2d2cf80e26226f34 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 29 Feb 2024 13:07:22 +0545 Subject: [PATCH 039/155] chore: upgrade to copilot-node-sdk 1.2.2 --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 533aa8a..41d0748 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2213,7 +2213,7 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -copilot-node-sdk@^1.2.0: +copilot-node-sdk@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-1.2.2.tgz#7f23c14669630f016f6ce6d92ac667f5b8d0ff4a" integrity sha512-UqGYrwH/rqEjeuP+fqZQx7z2/1XhKELgkiZDhNr5zHhoI8DC4owoQEJTe/0lI4H/rJTLqZTBqagzWohuG4OOcg== From bdbee3c1624c85435ae0cb35b6ddd68f9af31343 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 29 Feb 2024 13:08:00 +0545 Subject: [PATCH 040/155] refactor: clean up redirecting button components --- src/app/manage/page.tsx | 6 +++--- src/components/atoms/Button.tsx | 9 ++------- src/components/atoms/RedirectButton.tsx | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 src/components/atoms/RedirectButton.tsx diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 9bceb0d..856e4e4 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -3,8 +3,8 @@ import { ManagePageContainer } from './views/ManagePageContainer'; import { apiUrl } from '@/config'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ProfileLinks } from '@/types/settings'; -import Button from '@/components/atoms/Button'; import { PortalRoutes } from '@/types/copilotPortal'; +import RedirectButton from '@/components/atoms/RedirectButton'; export const revalidate = 0; @@ -82,10 +82,10 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok )} {settings && settings.includes(ProfileLinks.PaymentMethod) && ( - + Set a payment method )} {settings && settings.includes(ProfileLinks.ProfileSetting) && ( - + Go to account settings )} diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index f45e305..cfe89f0 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -5,20 +5,15 @@ import { Typography } from '@mui/material'; import { TypographyPropsVariantOverrides } from '@mui/material/Typography/Typography'; import { OverridableStringUnion } from '@mui/types'; import { Variant } from '@mui/material/styles/createTypography'; -import { AvailablePortalRoutes, PortalRoutes } from '@/types/copilotPortal'; import { ReactNode } from 'react'; interface ButtonProps { children: string | ReactNode; - parentRouteOnClick?: AvailablePortalRoutes; typographyVariant?: OverridableStringUnion; - onClick?: () => void; + handleClick?: () => void; } -const Button = ({ children, parentRouteOnClick, onClick, typographyVariant = 'md' }: ButtonProps) => { - const handleClick = - onClick || (parentRouteOnClick && (() => window.parent.postMessage({ type: 'history.push', parentRouteOnClick }, '*'))); - +const Button = ({ children, handleClick, typographyVariant = 'md' }: ButtonProps) => { return ( {children} diff --git a/src/components/atoms/RedirectButton.tsx b/src/components/atoms/RedirectButton.tsx new file mode 100644 index 0000000..56cb866 --- /dev/null +++ b/src/components/atoms/RedirectButton.tsx @@ -0,0 +1,20 @@ +'use client'; + +import { ReactNode } from 'react'; +import Button from './Button'; +import { AvailablePortalRoutes } from '@/types/copilotPortal'; + +interface RedirectButtonProps { + route: AvailablePortalRoutes; + children: string | ReactNode; +} + +const RedirectButton = ({ route, children }: RedirectButtonProps) => { + const handleClick = () => { + window.parent.postMessage({ type: 'history.push', route }, '*'); + }; + + return ; +}; + +export default RedirectButton; From ccf4838298097fe461fbc542f85be0e70077ded3 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 29 Feb 2024 13:10:35 +0545 Subject: [PATCH 041/155] refactor: omit undefined default value --- src/context/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/index.tsx b/src/context/index.tsx index 85b1606..c5cd752 100644 --- a/src/context/index.tsx +++ b/src/context/index.tsx @@ -47,7 +47,7 @@ export const AppContextProvider: FC = ({ children }) => { mutableSettings: [], token: '', portalId: '', - workspace: { isCompaniesEnabled: undefined, id: '' }, + workspace: { id: '' }, }); return ( From 41548a49a1624480e460fbcaf6839a64df6a9722 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari <59971845+rrojan@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:37:23 +0545 Subject: [PATCH 042/155] OUT-137 | clientID and companyId are hardcoded, extract them from token payload (#9) * fix: read clientId and companyId from token * fix: prefer classes over service fns --- services/workspace.ts | 11 ----------- src/app/manage/page.tsx | 15 +++++++-------- src/app/page.tsx | 8 +++++--- src/types/common.ts | 26 ++++++++++++++++++++------ src/utils/copilotApiUtils.ts | 17 +++++++++++++++++ 5 files changed, 49 insertions(+), 28 deletions(-) delete mode 100644 services/workspace.ts diff --git a/services/workspace.ts b/services/workspace.ts deleted file mode 100644 index d53b610..0000000 --- a/services/workspace.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { apiUrl } from '@/config'; -import { APIProps } from '@/types/api'; -import { WorkspaceResponse } from '@/types/common'; -import { CopilotAPI } from '@/utils/copilotApiUtils'; -import { z } from 'zod'; - -// Fetch workspace from API -export async function getWorkspaceInfo({ token }: { token: string }): Promise { - const copilotClient = new CopilotAPI(z.string().parse(token)); - return await copilotClient.getWorkspace(); -} diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 9deec9f..63cf07b 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -3,9 +3,10 @@ import { ManagePageContainer } from './views/ManagePageContainer'; import { apiUrl } from '@/config'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ProfileLinks } from '@/types/settings'; -import { getWorkspaceInfo } from '../../../services/workspace'; import { PortalRoutes } from '@/types/copilotPortal'; import RedirectButton from '@/components/atoms/RedirectButton'; +import { z } from 'zod'; +import { CopilotAPI } from '@/utils/copilotApiUtils'; export const revalidate = 0; @@ -49,17 +50,15 @@ async function getClient(clientId: string, token: string) { } export default async function ManagePage({ searchParams }: { searchParams: { token: string; portalId: string } }) { - const { token } = searchParams; + const token = z.string().parse(searchParams.token); - const { id: portalId } = await getWorkspaceInfo({ token }); + const copilotClient = new CopilotAPI(token); + + const { id: portalId } = await copilotClient.getWorkspace(); + const { clientId, companyId } = await copilotClient.getClientTokenPayload(); const settings = await getSettings({ token, portalId }).then((s) => s?.profileLinks || []); const customFieldAccess = await getCustomFieldAccess({ token, portalId }); - // static for now, will be dynamic later after some API decisions are made - const clientId = 'a583a0d0-de70-4d14-8bb1-0aacf7424e2c'; - const companyId = '52eb75a9-2790-4e37-aa7a-c13f7bc3aa91'; - // const clientId = '2b37da9b-73b9-4c28-b7ac-144cf39cb13b'; - // const companyId = 'b5b3883c-f3e7-40e2-98e8-4f4b195ba98e'; const client = await getClient(clientId, token); return ( diff --git a/src/app/page.tsx b/src/app/page.tsx index 1173127..f24a4bb 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -6,7 +6,8 @@ import { apiUrl } from '@/config'; import { ParsedClientProfileUpdatesResponse } from '@/types/clientProfileUpdates'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ContextUpdate } from '@/hoc/ContextUpdate'; -import { getWorkspaceInfo } from '../../services/workspace'; +import { CopilotAPI } from '@/utils/copilotApiUtils'; +import { z } from 'zod'; export const revalidate = 0; @@ -63,8 +64,9 @@ async function getSettings({ token, portalId }: { token: string; portalId: strin } export default async function Home({ searchParams }: { searchParams: { token: string; portalId: string } }) { - const { token } = searchParams; - const workspace = await getWorkspaceInfo({ token }); + const token = z.string().parse(searchParams); + const copilotClient = new CopilotAPI(token); + const workspace = await copilotClient.getWorkspace(); const { id: portalId } = workspace; const clientProfileUpdates = await getClientProfileUpdates({ token, portalId }); diff --git a/src/types/common.ts b/src/types/common.ts index 7c7bc5d..15e0200 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -1,11 +1,25 @@ import { z } from 'zod'; -export interface Token { - clientId?: string; - companyId?: string; - internalUserId?: string; - workspaceId: string; -} +export const TokenSchema = z.object({ + clientId: z.string().nullish(), + companyId: z.string().nullish(), + internalUserId: z.string().nullish(), + workspaceId: z.string().nullish(), +}); +export type Token = z.infer; + +export const IUTokenSchema = z.object({ + internalUserId: z.string(), + workspaceId: z.string(), +}); +export type IUToken = z.infer; + +export const ClientTokenSchema = z.object({ + clientId: z.string(), + companyId: z.string(), + workspaceId: z.string().nullish(), +}); +export type ClientToken = z.infer; export const MeResponseSchema = z.object({ id: z.string(), diff --git a/src/utils/copilotApiUtils.ts b/src/utils/copilotApiUtils.ts index 2696b34..5c13370 100644 --- a/src/utils/copilotApiUtils.ts +++ b/src/utils/copilotApiUtils.ts @@ -16,6 +16,11 @@ import { WorkspaceResponse, WorkspaceResponseSchema, Token, + TokenSchema, + ClientToken, + ClientTokenSchema, + IUTokenSchema, + IUToken, } from '@/types/common'; import { copilotAPIKey } from '@/config'; @@ -39,6 +44,18 @@ export class CopilotAPI { return WorkspaceResponseSchema.parse(await this.copilot.getWorkspaceInfo()); } + private async getTokenPayload(): Promise { + return TokenSchema.parse(await this.copilot.getTokenPayload?.()); + } + + async getClientTokenPayload(): Promise { + return ClientTokenSchema.parse(await this.getTokenPayload()); + } + + async getIUTokenPayload(): Promise { + return IUTokenSchema.parse(await this.getTokenPayload()); + } + async getClient(clientId: string): Promise { return ClientResponseSchema.parse(await this.copilot.retrieveAClient({ id: clientId })); } From 134f2a70f68509366bdce0526ff60a39b28d121c Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 5 Mar 2024 11:42:41 +0545 Subject: [PATCH 043/155] fix: string parsing on object type --- src/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index f24a4bb..0272cdc 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -64,7 +64,7 @@ async function getSettings({ token, portalId }: { token: string; portalId: strin } export default async function Home({ searchParams }: { searchParams: { token: string; portalId: string } }) { - const token = z.string().parse(searchParams); + const token = z.string().parse(searchParams.token); const copilotClient = new CopilotAPI(token); const workspace = await copilotClient.getWorkspace(); const { id: portalId } = workspace; From e7aa46ac795f248693786f1cb9d3245b0eb84cb6 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 6 Mar 2024 17:39:11 +0545 Subject: [PATCH 044/155] fix: safe parse token and don't throw error when token isn't provided --- src/app/manage/page.tsx | 6 +++++- src/app/page.tsx | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 63cf07b..7f3583b 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -50,7 +50,11 @@ async function getClient(clientId: string, token: string) { } export default async function ManagePage({ searchParams }: { searchParams: { token: string; portalId: string } }) { - const token = z.string().parse(searchParams.token); + const tokenParsed = z.string().safeParse(searchParams.token); + if (!tokenParsed.success) { + return
Please provide a valid token!
; + } + const token = tokenParsed.data; const copilotClient = new CopilotAPI(token); diff --git a/src/app/page.tsx b/src/app/page.tsx index 0272cdc..fb2ee4b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -64,7 +64,13 @@ async function getSettings({ token, portalId }: { token: string; portalId: strin } export default async function Home({ searchParams }: { searchParams: { token: string; portalId: string } }) { - const token = z.string().parse(searchParams.token); + const tokenParsed = z.string().safeParse(searchParams.token); + + if (!tokenParsed.success) { + return
Please provide a valid token!
; + } + + const token = tokenParsed.data; const copilotClient = new CopilotAPI(token); const workspace = await copilotClient.getWorkspace(); const { id: portalId } = workspace; From 3ea8749d6b7d043f13157822bcd2b67821289d56 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 6 Mar 2024 19:06:06 +0545 Subject: [PATCH 045/155] hotfix: show InvalidToken instead of raising error --- src/app/page.tsx | 3 ++- src/components/atoms/InvalidToken.tsx | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/components/atoms/InvalidToken.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index fb2ee4b..5b5f3ae 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -8,6 +8,7 @@ import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; import { ContextUpdate } from '@/hoc/ContextUpdate'; import { CopilotAPI } from '@/utils/copilotApiUtils'; import { z } from 'zod'; +import InvalidToken from '@/components/atoms/InvalidToken'; export const revalidate = 0; @@ -67,7 +68,7 @@ export default async function Home({ searchParams }: { searchParams: { token: st const tokenParsed = z.string().safeParse(searchParams.token); if (!tokenParsed.success) { - return
Please provide a valid token!
; + return ; } const token = tokenParsed.data; diff --git a/src/components/atoms/InvalidToken.tsx b/src/components/atoms/InvalidToken.tsx new file mode 100644 index 0000000..ed06990 --- /dev/null +++ b/src/components/atoms/InvalidToken.tsx @@ -0,0 +1,18 @@ +const InvalidToken = () => { + return ( +
+ Please provide a valid token! +
+ ); +}; + +export default InvalidToken; From 61895b3a43e1494fec8010d55a83b6137934b9fd Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 6 Mar 2024 19:08:01 +0545 Subject: [PATCH 046/155] hotfix: show InvalidToken instead of raising error --- src/app/manage/page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 7f3583b..5e22333 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -7,6 +7,7 @@ import { PortalRoutes } from '@/types/copilotPortal'; import RedirectButton from '@/components/atoms/RedirectButton'; import { z } from 'zod'; import { CopilotAPI } from '@/utils/copilotApiUtils'; +import InvalidToken from '@/components/atoms/InvalidToken'; export const revalidate = 0; @@ -52,8 +53,9 @@ async function getClient(clientId: string, token: string) { export default async function ManagePage({ searchParams }: { searchParams: { token: string; portalId: string } }) { const tokenParsed = z.string().safeParse(searchParams.token); if (!tokenParsed.success) { - return
Please provide a valid token!
; + return ; } + const token = tokenParsed.data; const copilotClient = new CopilotAPI(token); From 387c25068fa7ed84218b306675fc0635ab35e8c6 Mon Sep 17 00:00:00 2001 From: Kevin Foley Date: Wed, 6 Mar 2024 10:56:10 -0500 Subject: [PATCH 047/155] chore: fix the crash when company does not exist --- src/app/api/client-profile-updates/route.ts | 8 ++++---- src/lib/helper.ts | 14 ++++++++++++++ src/types/clientProfileUpdates.ts | 12 +++++++----- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 1890f96..63c485f 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -5,7 +5,7 @@ import { handleError, respondError } from '@/utils/common'; import { ClientProfileUpdatesService } from '@/app/api/client-profile-updates/services/clientProfileUpdates.service'; import { ClientResponse, CompanyResponse } from '@/types/common'; import { z } from 'zod'; -import { createLookup, getObjectDifference, getSelectedOptions } from '@/lib/helper'; +import { createLookup, createMapLookup, getObjectDifference, getSelectedOptions } from '@/lib/helper'; export async function POST(request: NextRequest) { const data = await request.json(); @@ -67,16 +67,16 @@ export async function GET(request: NextRequest) { const clientProfileUpdates = await new ClientProfileUpdatesService().findMany(portalId, []); const clientLookup = createLookup(clients.data, 'id'); - const companyLookup = createLookup(companies.data, 'id'); + const companyLookup = createMapLookup(companies.data, 'id'); const parsedClientProfileUpdates: ParsedClientProfileUpdatesResponse[] = clientProfileUpdates.map((update) => { const client = clientLookup[update.clientId]; - const company = companyLookup[update.companyId]; + const company = companyLookup.get(update.companyId); let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { id: update.id, client: getClientDetails(client), - company: getCompanyDetails(company), + company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, }; diff --git a/src/lib/helper.ts b/src/lib/helper.ts index f3df2cb..62cb802 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -25,6 +25,20 @@ export function createLookup(array: any[] | undefined | null, key: string): Reco return lookup; } +export function createMapLookup>( + array: T[] | undefined | null, + key: string, +): Map { + const mapItems = (array ?? []) + .map((item) => { + if (key in item) return [item[key], item]; + return null; + }) + .filter(Boolean); + const lookup: Map = new Map(); + return lookup; +} + export function getSelectedOptions(portalCustomField: CustomField, value: string | string[]) { const options: unknown[] = []; diff --git a/src/types/clientProfileUpdates.ts b/src/types/clientProfileUpdates.ts index 1045269..46e35cc 100644 --- a/src/types/clientProfileUpdates.ts +++ b/src/types/clientProfileUpdates.ts @@ -41,11 +41,13 @@ export const ParsedClientProfileUpdatesResponseSchema = z.object({ email: z.string(), avatarImageUrl: z.string().nullable(), }), - company: z.object({ - id: z.string().uuid(), - name: z.string(), - iconImageUrl: z.string().nullable(), - }), + company: z + .object({ + id: z.string().uuid(), + name: z.string(), + iconImageUrl: z.string().nullable(), + }) + .optional(), lastUpdated: z.date(), }); export type ParsedClientProfileUpdatesResponse = z.infer; From 6f49d6714e82f05f847e47c51bcd8a6ed779c2e7 Mon Sep 17 00:00:00 2001 From: Kevin Foley Date: Wed, 6 Mar 2024 11:13:29 -0500 Subject: [PATCH 048/155] chore: cleanup --- src/lib/helper.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/helper.ts b/src/lib/helper.ts index 62cb802..ab9b275 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -29,14 +29,12 @@ export function createMapLookup>( array: T[] | undefined | null, key: string, ): Map { - const mapItems = (array ?? []) - .map((item) => { - if (key in item) return [item[key], item]; - return null; - }) - .filter(Boolean); - const lookup: Map = new Map(); - return lookup; + const result = new Map(); + if (!array) return result; + for (const item of array) { + result.set(item[key], item); + } + return result; } export function getSelectedOptions(portalCustomField: CustomField, value: string | string[]) { From 134f9a1c3c9923ee1382229481b2a4bd1024629a Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 11 Mar 2024 11:47:17 +0545 Subject: [PATCH 049/155] chore: add env keys for postgres --- .env.example | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 30d4c00..fccd0a7 100644 --- a/.env.example +++ b/.env.example @@ -1,14 +1,24 @@ -COPILOT_API_KEY="b4fa0b79be594f91a2c72c63216d45ec.6463d9dc556351b6" +# --- Copilot +# +# Generate an API key from the copilot dashboard that is usable in profile manager +COPILOT_API_KEY= +COPILOT_API_URL="https://api-beta.copilot.com" +# Set as local to work on test tokens, and production to work on valid IU / client tokens +COPILOT_ENV="local" -# Vercel Database -POSTGRES_PRISMA_URL="postgres://default:2tCAVY7Npmyc@ep-morning-mountain-74331247-pooler.us-east-1.postgres.vercel-storage.com/verceldb?pgbouncer=true&connect_timeout=15" -POSTGRES_URL_NON_POOLING="postgres://default:2tCAVY7Npmyc@ep-morning-mountain-74331247.us-east-1.postgres.vercel-storage.com/verceldb" +# --- Database hosts and credentials +# +POSTGRES_URL= +POSTGRES_PRISMA_URL= +POSTGRES_URL_NO_SSL= +POSTGRES_URL_NON_POOLING= +POSTGRES_USER= +POSTGRES_HOST= +POSTGRES_PASSWORD= +POSTGRES_DATABASE= -# Local Database -; POSTGRES_PRISMA_URL="postgresql://db:db@127.0.0.1:59004/db?schema=public" -; POSTGRES_URL_NON_POOLING="postgresql://db:db@127.0.0.1:59004/db?schema=public" -COPILOT_API_URL="https://api-beta.copilot.com" -COPILOT_ENV="local" +# --- Vercel hosts and credentials +# VERCEL_URL="localhost:3000" VERCEL_ENV="development" From 1c0239e8ba736cbef1b628113e1ae86911261349 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari <59971845+rrojan@users.noreply.github.com> Date: Mon, 11 Mar 2024 21:10:13 +0545 Subject: [PATCH 050/155] chore: add env keys for postgres (#12) --- .env.example | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 30d4c00..fccd0a7 100644 --- a/.env.example +++ b/.env.example @@ -1,14 +1,24 @@ -COPILOT_API_KEY="b4fa0b79be594f91a2c72c63216d45ec.6463d9dc556351b6" +# --- Copilot +# +# Generate an API key from the copilot dashboard that is usable in profile manager +COPILOT_API_KEY= +COPILOT_API_URL="https://api-beta.copilot.com" +# Set as local to work on test tokens, and production to work on valid IU / client tokens +COPILOT_ENV="local" -# Vercel Database -POSTGRES_PRISMA_URL="postgres://default:2tCAVY7Npmyc@ep-morning-mountain-74331247-pooler.us-east-1.postgres.vercel-storage.com/verceldb?pgbouncer=true&connect_timeout=15" -POSTGRES_URL_NON_POOLING="postgres://default:2tCAVY7Npmyc@ep-morning-mountain-74331247.us-east-1.postgres.vercel-storage.com/verceldb" +# --- Database hosts and credentials +# +POSTGRES_URL= +POSTGRES_PRISMA_URL= +POSTGRES_URL_NO_SSL= +POSTGRES_URL_NON_POOLING= +POSTGRES_USER= +POSTGRES_HOST= +POSTGRES_PASSWORD= +POSTGRES_DATABASE= -# Local Database -; POSTGRES_PRISMA_URL="postgresql://db:db@127.0.0.1:59004/db?schema=public" -; POSTGRES_URL_NON_POOLING="postgresql://db:db@127.0.0.1:59004/db?schema=public" -COPILOT_API_URL="https://api-beta.copilot.com" -COPILOT_ENV="local" +# --- Vercel hosts and credentials +# VERCEL_URL="localhost:3000" VERCEL_ENV="development" From 2b64cefee0cf4deee212f20f207e431e3e20b98a Mon Sep 17 00:00:00 2001 From: Kevin Foley Date: Mon, 11 Mar 2024 15:45:15 -0400 Subject: [PATCH 051/155] chore: fix redirect paths --- src/types/copilotPortal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/copilotPortal.ts b/src/types/copilotPortal.ts index 0347f5e..0eb41c2 100644 --- a/src/types/copilotPortal.ts +++ b/src/types/copilotPortal.ts @@ -3,9 +3,9 @@ export enum PortalRoutes { Files = 'files', Contracts = 'contracts', Forms = 'forms', - Billing = 'billing', + Billing = 'settings.billing', Helpdesk = 'helpdesk', - Profile = 'profile', + Profile = 'settings.profile', Settings = 'settings', Notifications = 'notifications', } From 2dc92fee859597bafdcdc05934a2e6e3da2d1eaa Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 12 Mar 2024 17:54:53 +0545 Subject: [PATCH 052/155] fix: tricky issue with copilot api not saving empty string custom field keys --- src/app/api/client-profile-updates/route.ts | 11 ++++++++--- src/lib/helper.ts | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 63c485f..5d5a8f1 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -20,12 +20,17 @@ export async function POST(request: NextRequest) { const clientUpdateResponse = await copilotClient.updateClient(clientProfileUpdateRequest.data.clientId, { customFields: clientProfileUpdateRequest.data.form, }); + // NOTE: If you pass empty string as value to a custom field, that key will be deleted from the copilot api + // (Probably because it's built in Go and Go does the weird zero value cast thing) + // So sending an empty "" is the same as nil + clientUpdateResponse.customFields = { ...clientProfileUpdateRequest.data.form, ...clientUpdateResponse.customFields }; + const changedFields = getObjectDifference( (clientUpdateResponse.customFields ?? {}) as Record, (client.customFields ?? {}) as Record, ); if (Object.keys(changedFields).length === 0) { - return NextResponse.json({}); + return NextResponse.json({ message: 'No changed fields detected' }); } const service = new ClientProfileUpdatesService(); @@ -37,7 +42,7 @@ export async function POST(request: NextRequest) { changedFields, }); - return NextResponse.json({}); + return NextResponse.json({ message: 'Saved client profile updates along with changed fields' }); } catch (error) { return handleError(error); } @@ -90,7 +95,7 @@ export async function GET(request: NextRequest) { type: portalCustomField.type, key: portalCustomField.key, value: options.length > 0 ? options : value, - isChanged: !!update.changedFields[portalCustomField.key], + isChanged: update.changedFields[portalCustomField.key] === '' || !!update.changedFields[portalCustomField.key], }; }); diff --git a/src/lib/helper.ts b/src/lib/helper.ts index ab9b275..8066dfa 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -7,6 +7,10 @@ export function getObjectDifference(obj1: Record, obj let value2 = obj2[key]; value1 = Array.isArray(value1) ? value1.sort() : value1; value2 = Array.isArray(value2) ? value2.sort() : value2; + + if (value1 === undefined) value1 = ''; + if (value2 === undefined) value2 = ''; + if (JSON.stringify(value1) !== JSON.stringify(value2)) { diff[key] = value1; } From 04ece8369681fc551c9dff764a199b160d46b113 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 12 Mar 2024 18:15:36 +0545 Subject: [PATCH 053/155] fix: profile manager crashing when multi field is set empty --- .../cellRenderers/HistoryCellRenderer.tsx | 66 +++++++++++-------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index a3c7e8c..ce9633b 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -86,43 +86,51 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string • )} - + {data?.value?.[0] ? ( - + + - - {data.value ? data.value[0].label : ''} + + {data.value ? data.value[0].label : ''} + + + + + {data.value.length > 1 && `+ ${data.value.length - 1}`} - - - {data.value.length > 1 && `+ ${data.value.length - 1}`} - - + ) : ( + <> + )} {loading ? : } @@ -139,7 +147,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string columnGap: '10px', })} > - {data.value.map((el: any, key: number) => { + {data?.value?.map((el: any, key: number) => { if (key === 0) return null; return ( Date: Tue, 12 Mar 2024 18:28:40 +0545 Subject: [PATCH 054/155] fix: use a thumbnail in case of no client pic --- src/components/table/Table.tsx | 3 +++ .../cellRenderers/ClientCellRenderer.tsx | 27 ++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 9f5d499..27505b0 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -11,6 +11,7 @@ import { useAppState } from '@/hooks/useAppState'; import { getTimeAgo } from '@/utils/getTimeAgo'; import { arraysHaveSameElements, sliceTillElement } from '@/utils/array'; import { order } from '@/utils/orderable'; +import copilotTheme from '@/utils/copilotTheme'; export const TableCore = () => { const appState = useAppState(); @@ -91,10 +92,12 @@ export const TableCore = () => { minWidth: 250, valueGetter: (params: any) => { const client = params.data[el]; + const company = params.data['company']; return { avatarImageUrl: client.avatarImageUrl, name: client.name, email: client.email, + fallbackColor: company.fallbackColor || copilotTheme.colors.primary, }; }, }, diff --git a/src/components/table/cellRenderers/ClientCellRenderer.tsx b/src/components/table/cellRenderers/ClientCellRenderer.tsx index d395a03..d69bbef 100644 --- a/src/components/table/cellRenderers/ClientCellRenderer.tsx +++ b/src/components/table/cellRenderers/ClientCellRenderer.tsx @@ -1,10 +1,31 @@ import { Box, Stack, Typography } from '@mui/material'; -export const ClientCellRenderer = ({ value }: { value: { avatarImageUrl: string; email: string; name: string } }) => { - const { avatarImageUrl, email, name } = value; +export const ClientCellRenderer = ({ + value, +}: { + value: { avatarImageUrl: string; email: string; name: string; fallbackColor: string }; +}) => { + const { avatarImageUrl, email, name, fallbackColor } = value; return ( - + {avatarImageUrl ? ( + + ) : ( +
+ {name[0].toUpperCase()} +
+ )} {name} From 0ef626b3f1db3deaf2f5ce987a506d3c1c4d67ea Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 12 Mar 2024 18:36:19 +0545 Subject: [PATCH 055/155] fix: dont show company avatar if no company --- src/components/table/cellRenderers/ClientCellRenderer.tsx | 1 + src/components/table/cellRenderers/CompanyCellRenderer.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/components/table/cellRenderers/ClientCellRenderer.tsx b/src/components/table/cellRenderers/ClientCellRenderer.tsx index d69bbef..2ecd045 100644 --- a/src/components/table/cellRenderers/ClientCellRenderer.tsx +++ b/src/components/table/cellRenderers/ClientCellRenderer.tsx @@ -6,6 +6,7 @@ export const ClientCellRenderer = ({ value: { avatarImageUrl: string; email: string; name: string; fallbackColor: string }; }) => { const { avatarImageUrl, email, name, fallbackColor } = value; + return ( {avatarImageUrl ? ( diff --git a/src/components/table/cellRenderers/CompanyCellRenderer.tsx b/src/components/table/cellRenderers/CompanyCellRenderer.tsx index 6c1038a..5451b55 100644 --- a/src/components/table/cellRenderers/CompanyCellRenderer.tsx +++ b/src/components/table/cellRenderers/CompanyCellRenderer.tsx @@ -7,6 +7,8 @@ export const CompanyCellRenderer = ({ value: { iconImageUrl: string; name: string; fallbackColor?: string }; }) => { const { iconImageUrl, name, fallbackColor } = value; + if (!name) return <>; + return ( From d688822541fac4f7fe8fd330f1d98777ca9dea2e Mon Sep 17 00:00:00 2001 From: Potluck Mittal Date: Tue, 12 Mar 2024 15:25:21 -0400 Subject: [PATCH 056/155] change profile link --- src/app/manage/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 5e22333..3d6e8be 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -93,7 +93,7 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok Set a payment method )} {settings && settings.includes(ProfileLinks.ProfileSetting) && ( - Go to account settings + Go to account settings )} From 9a30fe54142b4c9e9fd0868675a93e59efcb4ded Mon Sep 17 00:00:00 2001 From: Potluck Mittal Date: Tue, 12 Mar 2024 16:24:20 -0400 Subject: [PATCH 057/155] add default text for IU --- src/components/table/Table.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 9f5d499..3af2f10 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -206,6 +206,7 @@ export const TableCore = () => { defaultColDef={defaultColDef} suppressMovableColumns={true} quickFilterText={appState?.searchKeyword} + overlayNoRowsTemplate={"Your clients have not yet made any Profile updates."} />
); From f724b22454bac152aa259f20b2efa52b0a1f5984 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 13 Mar 2024 18:26:47 +0545 Subject: [PATCH 058/155] fix: add fields changed by IU to history as well --- src/app/api/client-profile-updates/route.ts | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 5d5a8f1..e02fcb3 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -34,6 +34,28 @@ export async function POST(request: NextRequest) { } const service = new ClientProfileUpdatesService(); + + // First, check if the copilot's custom fields and our recent history are in sync + for (const key of Object.keys(changedFields)) { + const lastHistory = (await new ClientProfileUpdatesService().getUpdateHistory(key, client.id, new Date()))?.[0] + ?.changedFields?.[key]; + if (!lastHistory) continue; + + // If not, fix it. + if (client.customFields?.[key] !== lastHistory) { + await service.save({ + clientId: clientProfileUpdateRequest.data.clientId, + companyId: clientProfileUpdateRequest.data.companyId, + portalId: clientProfileUpdateRequest.data.portalId, + customFields: { ...(clientUpdateResponse.customFields ?? {}), [key]: client.customFields?.[key] } as Record< + string, + any + >, + // @ts-expect-error inject key + changedFields: { [key]: client.customFields?.[key] }, + }); + } + } await service.save({ clientId: clientProfileUpdateRequest.data.clientId, companyId: clientProfileUpdateRequest.data.companyId, From cc0415ee4f31069b41415214468da870be221625 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 13 Mar 2024 18:50:24 +0545 Subject: [PATCH 059/155] chore: add support for IU created column in udpates --- .../migration.sql | 2 + prisma/schema.prisma | 39 ++++++++++--------- 2 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 prisma/migrations/20240313124911_add_was_updated_by_iu_key_to_client_profile_updates/migration.sql diff --git a/prisma/migrations/20240313124911_add_was_updated_by_iu_key_to_client_profile_updates/migration.sql b/prisma/migrations/20240313124911_add_was_updated_by_iu_key_to_client_profile_updates/migration.sql new file mode 100644 index 0000000..a00128e --- /dev/null +++ b/prisma/migrations/20240313124911_add_was_updated_by_iu_key_to_client_profile_updates/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "ClientProfileUpdates" ADD COLUMN "wasUpdatedByIU" BOOLEAN NOT NULL DEFAULT false; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 45c5ccb..6143c99 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -17,29 +17,30 @@ enum Permission { } model CustomFieldAccess { - id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid - customFieldId String @db.Uuid - portalId String - permissions Permission[] - createdAt DateTime @default(now()) @db.Timestamptz() - updatedAt DateTime @updatedAt @ignore @db.Timestamptz() + id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid + customFieldId String @db.Uuid + portalId String + permissions Permission[] + createdAt DateTime @default(now()) @db.Timestamptz() + updatedAt DateTime @updatedAt @ignore @db.Timestamptz() } model ClientProfileUpdates { - id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid - clientId String @db.Uuid - companyId String @db.Uuid - portalId String - customFields Json @db.JsonB - changedFields Json @db.JsonB - createdAt DateTime @default(now()) @db.Timestamptz() - updatedAt DateTime @updatedAt @ignore @db.Timestamptz() + id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid + clientId String @db.Uuid + companyId String @db.Uuid + portalId String + customFields Json @db.JsonB + changedFields Json @db.JsonB + createdAt DateTime @default(now()) @db.Timestamptz() + wasUpdatedByIU Boolean @default(false) + updatedAt DateTime @updatedAt @ignore @db.Timestamptz() } model Setting { - id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid - portalId String - data Json @db.JsonB - createdAt DateTime @default(now()) @db.Timestamptz() - updatedAt DateTime @updatedAt @ignore @db.Timestamptz() + id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid + portalId String + data Json @db.JsonB + createdAt DateTime @default(now()) @db.Timestamptz() + updatedAt DateTime @updatedAt @ignore @db.Timestamptz() } From 1a495db68178694b08772a4914c176d5f09704c0 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 13 Mar 2024 18:50:52 +0545 Subject: [PATCH 060/155] fix: use the wasUpdatedByIU key to filter out IU -> client profile changes --- src/app/api/client-profile-updates/route.ts | 2 ++ .../services/clientProfileUpdates.service.ts | 3 +++ src/types/clientProfileUpdates.ts | 1 + 3 files changed, 6 insertions(+) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index e02fcb3..2fb12a7 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -53,6 +53,7 @@ export async function POST(request: NextRequest) { >, // @ts-expect-error inject key changedFields: { [key]: client.customFields?.[key] }, + wasUpdatedByIU: true, }); } } @@ -71,6 +72,7 @@ export async function POST(request: NextRequest) { } export async function GET(request: NextRequest) { + console.log('HIT MOTHERFUCKER'); const token = request.nextUrl.searchParams.get('token'); const portalId = request.nextUrl.searchParams.get('portalId'); diff --git a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts index 57a2849..67e1765 100644 --- a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts +++ b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts @@ -18,6 +18,7 @@ export class ClientProfileUpdatesService { portalId: requestData.portalId, customFields: requestData.customFields, changedFields: requestData.changedFields, + wasUpdatedByIU: requestData.wasUpdatedByIU, }, }); } @@ -32,6 +33,7 @@ export class ClientProfileUpdatesService { companyId: { in: companyIds, }, + wasUpdatedByIU: false, }, orderBy: { createdAt: 'desc', @@ -41,6 +43,7 @@ export class ClientProfileUpdatesService { clientProfileUpdates = await this.prismaClient.clientProfileUpdates.findMany({ where: { portalId: portalId, + wasUpdatedByIU: false, }, orderBy: { createdAt: 'desc', diff --git a/src/types/clientProfileUpdates.ts b/src/types/clientProfileUpdates.ts index 46e35cc..ac4533a 100644 --- a/src/types/clientProfileUpdates.ts +++ b/src/types/clientProfileUpdates.ts @@ -18,6 +18,7 @@ export const ClientProfileUpdatesSchema = z.object({ portalId: z.string(), customFields: CustomFieldUpdatesSchema, changedFields: CustomFieldUpdatesSchema, + wasUpdatedByIU: z.boolean().optional(), }); export type ClientProfileUpdates = z.infer; From cac5db4da0968616384081f97c6c2c48ba2c8e6d Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 13 Mar 2024 18:51:27 +0545 Subject: [PATCH 061/155] refactor: remove unused code --- src/app/api/client-profile-updates/route.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 2fb12a7..5ba9e75 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -72,7 +72,6 @@ export async function POST(request: NextRequest) { } export async function GET(request: NextRequest) { - console.log('HIT MOTHERFUCKER'); const token = request.nextUrl.searchParams.get('token'); const portalId = request.nextUrl.searchParams.get('portalId'); From ad86ffe8012fb9c45e6c167455a2a589ff19b330 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 13 Mar 2024 18:56:10 +0545 Subject: [PATCH 062/155] hotfix: fix build issue in main --- src/components/table/Table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 3af2f10..aa38603 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -206,7 +206,7 @@ export const TableCore = () => { defaultColDef={defaultColDef} suppressMovableColumns={true} quickFilterText={appState?.searchKeyword} - overlayNoRowsTemplate={"Your clients have not yet made any Profile updates."} + overlayNoRowsTemplate={'Your clients have not yet made any Profile updates.'} />
); From 7a7a61ca36b481866c5c362f3ad831059f2d946d Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 15 Mar 2024 10:06:57 +0545 Subject: [PATCH 063/155] fix: update history overflow --- .../table/cellRenderers/HistoryCellRenderer.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index ce9633b..0c8a74c 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -218,7 +218,8 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { backgroundColor: theme.color.base.white, boxShadow: '0px 8px 24px 0px rgba(0, 0, 0, 0.12)', padding: 4, - minWidth: '200px', + minWidth: '400px', + maxWidth: '400px', })} > Update history @@ -262,12 +263,13 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { ); } return ( - + - {history.value} + {history.value.slice(0, 700)} + {history.value.length > 700 ? '...' : ''} ); From af2c70797d453ae6ecb51543d5c2e6b2bc9cfb68 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 15 Mar 2024 10:08:21 +0545 Subject: [PATCH 064/155] fix: manage title showing even when no fields are present --- src/app/manage/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 3d6e8be..7d6a903 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -66,6 +66,7 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok const customFieldAccess = await getCustomFieldAccess({ token, portalId }); const client = await getClient(clientId, token); + const isAccessProvided = customFieldAccess.some((field: any) => field.permission.length > 0); return ( - Manage your profile - + {isAccessProvided ? Manage your profile : <>} Date: Fri, 15 Mar 2024 10:21:11 +0545 Subject: [PATCH 065/155] chore: add missing icons --- src/icons/email.svg | 4 ++++ src/icons/index.ts | 3 +++ src/icons/link.svg | 3 +++ src/icons/number.svg | 3 +++ 4 files changed, 13 insertions(+) create mode 100644 src/icons/email.svg create mode 100644 src/icons/link.svg create mode 100644 src/icons/number.svg diff --git a/src/icons/email.svg b/src/icons/email.svg new file mode 100644 index 0000000..72d3fd4 --- /dev/null +++ b/src/icons/email.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/icons/index.ts b/src/icons/index.ts index 578c1fe..79bdf33 100644 --- a/src/icons/index.ts +++ b/src/icons/index.ts @@ -8,3 +8,6 @@ export { default as AddressIcon } from './address.svg'; export { default as MultiSelectIcon } from './multiselect.svg'; export { default as PhoneNumberIcon } from './phonenumber.svg'; export { default as TextIcon } from './text.svg'; +export { default as EmailIcon } from './email.svg'; +export { default as LinkIcon } from './link.svg'; +export { default as NumberIcon } from './number.svg'; diff --git a/src/icons/link.svg b/src/icons/link.svg new file mode 100644 index 0000000..bf354af --- /dev/null +++ b/src/icons/link.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/icons/number.svg b/src/icons/number.svg new file mode 100644 index 0000000..06e4221 --- /dev/null +++ b/src/icons/number.svg @@ -0,0 +1,3 @@ + + + From f8d72e570cf47a643e061c8d68794a0a67847292 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 15 Mar 2024 10:21:55 +0545 Subject: [PATCH 066/155] fix: field icons --- .../customFieldAccessTable/CustomFieldAccessTable.tsx | 1 + src/components/customFieldAccessTable/iconsTypeMap.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx index 3b90f41..62c33be 100644 --- a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx +++ b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx @@ -74,6 +74,7 @@ export const CustomFieldAccessTable = () => { + {console.log('XXX', field)} {iconsTypeMap[field.type]} {field.name} diff --git a/src/components/customFieldAccessTable/iconsTypeMap.tsx b/src/components/customFieldAccessTable/iconsTypeMap.tsx index 7867818..1b18c0b 100644 --- a/src/components/customFieldAccessTable/iconsTypeMap.tsx +++ b/src/components/customFieldAccessTable/iconsTypeMap.tsx @@ -1,9 +1,11 @@ -import { AddressIcon, MultiSelectIcon, PhoneNumberIcon, TextIcon } from '@/icons'; +import { AddressIcon, EmailIcon, LinkIcon, MultiSelectIcon, NumberIcon, PhoneNumberIcon, TextIcon } from '@/icons'; export const iconsTypeMap: any = { phoneNumber: , text: , multiSelect: , - number: , + number: , address: , + email: , + url: , }; From 10c232b1392c25200956ffd54df50b52f2a6755d Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 15 Mar 2024 10:29:24 +0545 Subject: [PATCH 067/155] fix: stray 0 appears in IU sometimes --- src/app/views/MainSection.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/views/MainSection.tsx b/src/app/views/MainSection.tsx index cfda9cf..24a47dc 100644 --- a/src/app/views/MainSection.tsx +++ b/src/app/views/MainSection.tsx @@ -26,10 +26,10 @@ const MainSection = () => { }} >
- {windowWidth && (windowWidth <= 600 ? : null)} + {windowWidth ? windowWidth <= 600 ? : <> : <>} {/* If window width is less than 600 and showSidebar is false then show or else, show always */} - {windowWidth && windowWidth <= 600 ? appState?.showSidebar ? null : : } + {windowWidth ? windowWidth <= 600 ? appState?.showSidebar ? null : : : <>} ); }; From 4f2bef9e5430be3b551796dc1de382112f97ec34 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Sun, 17 Mar 2024 12:41:21 +0545 Subject: [PATCH 068/155] feat: integrate sentry for error monitoring --- .gitignore | 3 + next.config.js | 45 ++++++ package.json | 3 +- sentry.client.config.ts | 31 ++++ sentry.edge.config.ts | 16 ++ sentry.server.config.ts | 18 +++ src/app/global-error.tsx | 22 +++ src/config/index.ts | 3 + yarn.lock | 319 ++++++++++++++++++++++++++++++++++++++- 9 files changed, 453 insertions(+), 7 deletions(-) create mode 100644 sentry.client.config.ts create mode 100644 sentry.edge.config.ts create mode 100644 sentry.server.config.ts create mode 100644 src/app/global-error.tsx diff --git a/.gitignore b/.gitignore index 86297a8..d058228 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ next-env.d.ts .idea .ddev + +# Sentry Config File +.sentryclirc diff --git a/next.config.js b/next.config.js index 9377308..5b38fbc 100644 --- a/next.config.js +++ b/next.config.js @@ -11,3 +11,48 @@ const nextConfig = { }; module.exports = nextConfig; + + +// Injected content via Sentry wizard below + +const { withSentryConfig } = require("@sentry/nextjs"); + +module.exports = withSentryConfig( + module.exports, + { + // For all available options, see: + // https://github.com/getsentry/sentry-webpack-plugin#options + + // Suppresses source map uploading logs during build + silent: true, + org: "copilot-platforms", + project: "profile-manager", + }, + { + // For all available options, see: + // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ + + // Upload a larger set of source maps for prettier stack traces (increases build time) + widenClientFileUpload: true, + + // Transpiles SDK to be compatible with IE11 (increases bundle size) + transpileClientSDK: true, + + // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. (increases server load) + // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- + // side errors will fail. + tunnelRoute: "/monitoring", + + // Hides source maps from generated client bundles + hideSourceMaps: true, + + // Automatically tree-shake Sentry logger statements to reduce bundle size + disableLogger: true, + + // Enables automatic instrumentation of Vercel Cron Monitors. + // See the following for more information: + // https://docs.sentry.io/product/crons/ + // https://vercel.com/docs/cron-jobs + automaticVercelMonitors: true, + } +); diff --git a/package.json b/package.json index 164d081..f6b6f30 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,10 @@ "@mui/icons-material": "^5.14.5", "@mui/material": "^5.15.4", "@prisma/client": "^5.7.1", + "@sentry/nextjs": "^7.105.0", "@vercel/postgres": "^0.5.1", - "copilot-node-sdk": "^1.2.2", "ag-grid-react": "^31.0.2", + "copilot-node-sdk": "^1.2.2", "next": "14.1.0", "prisma": "^5.7.1", "react": "^18", diff --git a/sentry.client.config.ts b/sentry.client.config.ts new file mode 100644 index 0000000..b3d7775 --- /dev/null +++ b/sentry.client.config.ts @@ -0,0 +1,31 @@ +// This file configures the initialization of Sentry on the client. +// The config you add here will be used whenever a users loads a page in their browser. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import { SentryConfig } from '@/config'; +import * as Sentry from '@sentry/nextjs'; + +Sentry.init({ + dsn: SentryConfig.DSN, + + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + + replaysOnErrorSampleRate: 1.0, + + // This sets the sample rate to be 10%. You may want this to be 100% while + // in development and sample at a lower rate in production + replaysSessionSampleRate: 0.1, + + // You can remove this option if you're not planning to use the Sentry Session Replay feature: + // integrations: [ + // Sentry.replayIntegration({ + // Additional Replay configuration goes in here, for example: + // maskAllText: true, + // blockAllMedia: true, + // }), + // ], +}); diff --git a/sentry.edge.config.ts b/sentry.edge.config.ts new file mode 100644 index 0000000..522b187 --- /dev/null +++ b/sentry.edge.config.ts @@ -0,0 +1,16 @@ +// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). +// The config you add here will be used whenever one of the edge features is loaded. +// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import { SentryConfig } from '@/config'; +import * as Sentry from '@sentry/nextjs'; + +Sentry.init({ + dsn: SentryConfig.DSN, + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, +}); diff --git a/sentry.server.config.ts b/sentry.server.config.ts new file mode 100644 index 0000000..a2d7a48 --- /dev/null +++ b/sentry.server.config.ts @@ -0,0 +1,18 @@ +// This file configures the initialization of Sentry on the server. +// The config you add here will be used whenever the server handles a request. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import { SentryConfig } from '@/config'; +import * as Sentry from '@sentry/nextjs'; + +Sentry.init({ + dsn: SentryConfig.DSN, + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + + // uncomment the line below to enable Spotlight (https://spotlightjs.com) + // spotlight: process.env.NODE_ENV === 'development', +}); diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx new file mode 100644 index 0000000..1ad7aeb --- /dev/null +++ b/src/app/global-error.tsx @@ -0,0 +1,22 @@ +'use client'; + +import * as Sentry from '@sentry/nextjs'; +import Error from 'next/error'; +import { useEffect } from 'react'; + +export default function GlobalError({ error }: { error: Error & { digest?: string } }) { + useEffect(() => { + const reportId = Sentry.captureException(error); + + console.info('Error reported:', reportId); + console.error(error); + }, [error]); + + return ( + + + + + + ); +} diff --git a/src/config/index.ts b/src/config/index.ts index d716e57..f7322f8 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,3 +1,6 @@ export const copilotAPIUrl = process.env.COPILOT_API_URL || ''; export const copilotAPIKey = process.env.COPILOT_API_KEY || ''; export const apiUrl = `${process.env.VERCEL_ENV === 'development' ? 'http://' : 'https://'}${process.env.VERCEL_URL}`; +export const SentryConfig = { + DSN: process.env.NEXT_PUBLIC_SENTRY_DSN || '', +}; diff --git a/yarn.lock b/yarn.lock index 41d0748..0ba5f1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1255,7 +1255,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== @@ -1503,11 +1503,183 @@ dependencies: "@prisma/debug" "5.8.1" +"@rollup/plugin-commonjs@24.0.0": + version "24.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.0.tgz#fb7cf4a6029f07ec42b25daa535c75b05a43f75c" + integrity sha512-0w0wyykzdyRRPHOb0cQt14mIBLujfAv6GgP6g8nvg/iBxEm112t3YPPq+Buqe2+imvElTka+bjNlJ/gB56TD8g== + dependencies: + "@rollup/pluginutils" "^5.0.1" + commondir "^1.0.1" + estree-walker "^2.0.2" + glob "^8.0.3" + is-reference "1.2.1" + magic-string "^0.27.0" + +"@rollup/pluginutils@^5.0.1": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0" + integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^2.3.1" + "@rushstack/eslint-patch@^1.3.3": version "1.7.2" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz#2d4260033e199b3032a08b41348ac10de21c47e9" integrity sha512-RbhOOTCNoCrbfkRyoXODZp75MlpiHMgbE5MEBZAnnnLyQNgrigEj4p0lzsMDyc1zVsJDLrivB58tgg3emX0eEA== +"@sentry-internal/feedback@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.107.0.tgz#144cf01b1c1739d61db3990519f59b49a356fef1" + integrity sha512-okF0B9AJHrpkwNMxNs/Lffw3N5ZNbGwz4uvCfyOfnMxc7E2VfDM18QzUvTBRvNr3bA9wl+InJ+EMG3aZhyPunA== + dependencies: + "@sentry/core" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry-internal/replay-canvas@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.107.0.tgz#ce2a8f6bf63ab962e696f26b509cfb87aa931302" + integrity sha512-dmDL9g3QDfo7axBOsVnpiKdJ/DXrdeuRv1AqsLgwzJKvItsv0ZizX0u+rj5b1UoxcwbXRMxJ0hit5a1yt3t/ow== + dependencies: + "@sentry/core" "7.107.0" + "@sentry/replay" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry-internal/tracing@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.107.0.tgz#a10b4abcbc9e0d8da948e3a95029574387ca7b16" + integrity sha512-le9wM8+OHBbq7m/8P7JUJ1UhSPIty+Z/HmRXc5Z64ODZcOwFV6TmDpYx729IXDdz36XUKmeI+BeM7yQdTTZPfQ== + dependencies: + "@sentry/core" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry/browser@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.107.0.tgz#a1caf4a3c39857862ba3314b9d4ed03f9259f338" + integrity sha512-KnqaQDhxv6w9dJ+mYLsNwPeGZfgbpM3vaismBNyJCKLgWn2V75kxkSq+bDX8LQT/13AyK7iFp317L6P8EuNa3g== + dependencies: + "@sentry-internal/feedback" "7.107.0" + "@sentry-internal/replay-canvas" "7.107.0" + "@sentry-internal/tracing" "7.107.0" + "@sentry/core" "7.107.0" + "@sentry/replay" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry/cli@^1.77.1": + version "1.77.3" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.77.3.tgz#c40b4d09b0878d6565d42a915855add99db4fec3" + integrity sha512-c3eDqcDRmy4TFz2bFU5Y6QatlpoBPPa8cxBooaS4aMQpnIdLYPF1xhyyiW0LQlDUNc3rRjNF7oN5qKoaRoMTQQ== + dependencies: + https-proxy-agent "^5.0.0" + mkdirp "^0.5.5" + node-fetch "^2.6.7" + progress "^2.0.3" + proxy-from-env "^1.1.0" + which "^2.0.2" + +"@sentry/core@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.107.0.tgz#926838ba2c2861d6bd2bced0232e1f9d1ead6c75" + integrity sha512-C7ogye6+KPyBi8NVL0P8Rxx3Ur7Td8ufnjxosVy678lqY+dcYPk/HONROrzUFYW5fMKWL4/KYnwP+x9uHnkDmw== + dependencies: + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry/integrations@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.107.0.tgz#a46a82be885ef1482197ed7073d7982bd266c09a" + integrity sha512-0h2sZcjcdptS2pju1KSF4+sXaRaFTlmAN1ZokFfmfnVTs6cVtIFttUFxTYrwQUEE2knpAV05pz87zg1yfPAfYg== + dependencies: + "@sentry/core" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + localforage "^1.8.1" + +"@sentry/nextjs@^7.105.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.107.0.tgz#31b85459633d173413430a6a48ad45fffc54db4e" + integrity sha512-cGKntMb/svjHx5xWuLEh4sYMPA75c9gXegVeGeibpLUuD9b+LNeL7GaqxQ9dm2CX+Vza7QvHGBO/u+08abpEQA== + dependencies: + "@rollup/plugin-commonjs" "24.0.0" + "@sentry/core" "7.107.0" + "@sentry/integrations" "7.107.0" + "@sentry/node" "7.107.0" + "@sentry/react" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + "@sentry/vercel-edge" "7.107.0" + "@sentry/webpack-plugin" "1.21.0" + chalk "3.0.0" + resolve "1.22.8" + rollup "2.78.0" + stacktrace-parser "^0.1.10" + +"@sentry/node@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.107.0.tgz#d60c2e28953f2ba14d12ada9190f1fc577b2b280" + integrity sha512-UZXkG7uThT2YyPW8AOSKRXp1LbVcBHufa4r1XAwBukA2FKO6HHJPjMUgY6DYVQ6k+BmA56CNfVjYrdLbyjBYYA== + dependencies: + "@sentry-internal/tracing" "7.107.0" + "@sentry/core" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry/react@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.107.0.tgz#45feb115383bde7d454e5f816663df34c1c28c39" + integrity sha512-3sXNKcDQjEimxwBPnRkewy3xNLt3KqStMAdDZ/dAF3rviOSVyk80DCQ3P6+HIqeB+IAXqWptg4eSWRA1qNZquA== + dependencies: + "@sentry/browser" "7.107.0" + "@sentry/core" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + hoist-non-react-statics "^3.3.2" + +"@sentry/replay@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.107.0.tgz#d714f864ef8602e6d009b2fa8ff8e4ef63c3e9e4" + integrity sha512-BNJDEVaEwr/YnV22qnyVA1almx/3p615m3+KaF8lPo7YleYgJGSJv1auH64j1G8INkrJ0J0wFBujb1EFjMYkxA== + dependencies: + "@sentry-internal/tracing" "7.107.0" + "@sentry/core" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry/types@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.107.0.tgz#5ba4b472be6ccad9aecd58dbc0141a09dafb68c1" + integrity sha512-H7qcPjPSUWHE/Zf5bR1EE24G0pGVuJgrSx8Tvvl5nKEepswMYlbXHRVSDN0gTk/E5Z7cqf+hUBOpkQgZyps77w== + +"@sentry/utils@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.107.0.tgz#b8524539d052a40f9c5f34a8347501f0f81a0751" + integrity sha512-C6PbN5gHh73MRHohnReeQ60N8rrLYa9LciHue3Ru2290eSThg4CzsPnx4SzkGpkSeVlhhptKtKZ+hp/ha3iVuw== + dependencies: + "@sentry/types" "7.107.0" + +"@sentry/vercel-edge@7.107.0": + version "7.107.0" + resolved "https://registry.yarnpkg.com/@sentry/vercel-edge/-/vercel-edge-7.107.0.tgz#90ada052bf3c766a971dc7d64d1473e7482c86f3" + integrity sha512-8p4v0QrMus3lVOwfIfevf/F+GuJnkC/0CIyp69FF7RMHb0zvkCmuXBjuski1AMD5aCL+E3e4MEU73UKA5XNqSA== + dependencies: + "@sentry-internal/tracing" "7.107.0" + "@sentry/core" "7.107.0" + "@sentry/types" "7.107.0" + "@sentry/utils" "7.107.0" + +"@sentry/webpack-plugin@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.21.0.tgz#bbe7cb293751f80246a4a56f9a7dd6de00f14b58" + integrity sha512-x0PYIMWcsTauqxgl7vWUY6sANl+XGKtx7DCVnnY7aOIIlIna0jChTAPANTfA2QrK+VK+4I/4JxatCEZBnXh3Og== + dependencies: + "@sentry/cli" "^1.77.1" + webpack-sources "^2.0.0 || ^3.0.0" + "@svgr/babel-plugin-add-jsx-attribute@8.0.0": version "8.0.0" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz#4001f5d5dd87fa13303e36ee106e3ff3a7eb8b22" @@ -1646,6 +1818,11 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== +"@types/estree@*", "@types/estree@^1.0.0": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/json-schema@^7.0.6": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" @@ -1806,6 +1983,13 @@ ag-grid-react@^31.0.2: ag-grid-community "~31.0.3" prop-types "^15.8.1" +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -2112,6 +2296,14 @@ caniuse-lite@^1.0.30001565, caniuse-lite@^1.0.30001578, caniuse-lite@^1.0.300015 resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001580.tgz#e3c76bc6fe020d9007647044278954ff8cd17d1e" integrity sha512-mtj5ur2FFPZcCEpXFy8ADXbDACuNFXg6mxVDqp7tqooX6l3zwm+d8EPoeOSIFRDvHs8qu7/SLFOGniULkcH2iA== +chalk@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chalk@5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" @@ -2198,6 +2390,11 @@ commander@^7.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -2316,7 +2513,7 @@ damerau-levenshtein@^1.0.8: resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== -debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -2783,6 +2980,11 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -2908,6 +3110,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.1, function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" @@ -3006,6 +3213,17 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.0.3: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -3112,13 +3330,21 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" -hoist-non-react-statics@^3.3.1: +hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== dependencies: react-is "^16.7.0" +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + human-signals@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" @@ -3134,6 +3360,11 @@ ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== + import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -3289,6 +3520,13 @@ is-path-inside@^3.0.3: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-reference@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -3524,6 +3762,13 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== + dependencies: + immediate "~3.0.5" + lilconfig@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.0.0.tgz#f8067feb033b5b74dab4602a5f5029420be749bc" @@ -3562,6 +3807,13 @@ listr2@8.0.0: rfdc "^1.3.0" wrap-ansi "^9.0.0" +localforage@^1.8.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" + integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== + dependencies: + lie "3.1.1" + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -3653,6 +3905,13 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +magic-string@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" + integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.13" + make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -3710,11 +3969,25 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +mkdirp@^0.5.5: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -3771,7 +4044,7 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-fetch@^2.6.1: +node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -4080,6 +4353,11 @@ prisma@^5.7.1: dependencies: "@prisma/engines" "5.8.1" +progress@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + prop-types@^15.6.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -4089,6 +4367,11 @@ prop-types@^15.6.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + punycode@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" @@ -4208,7 +4491,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.4: +resolve@1.22.8, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -4251,6 +4534,13 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +rollup@2.78.0: + version "2.78.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.78.0.tgz#00995deae70c0f712ea79ad904d5f6b033209d9e" + integrity sha512-4+YfbQC9QEVvKTanHhIAFVUFSRsezvQF8vFOJwtGfb9Bb+r014S+qryr9PSmw8x6sMnPkmFBGAvIFVQxvJxjtg== + optionalDependencies: + fsevents "~2.3.2" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -4396,6 +4686,13 @@ source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + streamsearch@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" @@ -4613,6 +4910,11 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + type-fest@^3.0.0: version "3.13.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-3.13.1.tgz#bb744c1f0678bea7543a2d1ec24e83e68e8c8706" @@ -4742,6 +5044,11 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +"webpack-sources@^2.0.0 || ^3.0.0": + version "3.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== + whatwg-fetch@^3.4.1: version "3.6.20" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz#580ce6d791facec91d37c72890995a0b48d31c70" @@ -4805,7 +5112,7 @@ which-typed-array@^1.1.11, which-typed-array@^1.1.13, which-typed-array@^1.1.9: gopd "^1.0.1" has-tostringtag "^1.0.0" -which@^2.0.1: +which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== From 09d2587fe646de08a62cc73374bb6daefa8538d1 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Sun, 17 Mar 2024 12:41:44 +0545 Subject: [PATCH 069/155] feat: modify next config to support sentry --- next.config.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/next.config.js b/next.config.js index 5b38fbc..dd719df 100644 --- a/next.config.js +++ b/next.config.js @@ -12,10 +12,9 @@ const nextConfig = { module.exports = nextConfig; - // Injected content via Sentry wizard below -const { withSentryConfig } = require("@sentry/nextjs"); +const { withSentryConfig } = require('@sentry/nextjs'); module.exports = withSentryConfig( module.exports, @@ -25,8 +24,8 @@ module.exports = withSentryConfig( // Suppresses source map uploading logs during build silent: true, - org: "copilot-platforms", - project: "profile-manager", + org: 'copilot-platforms', + project: 'profile-manager', }, { // For all available options, see: @@ -41,7 +40,7 @@ module.exports = withSentryConfig( // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. (increases server load) // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- // side errors will fail. - tunnelRoute: "/monitoring", + tunnelRoute: '/monitoring', // Hides source maps from generated client bundles hideSourceMaps: true, @@ -54,5 +53,5 @@ module.exports = withSentryConfig( // https://docs.sentry.io/product/crons/ // https://vercel.com/docs/cron-jobs automaticVercelMonitors: true, - } + }, ); From 80007532ba7c96a006fe2112a7357977eab400f1 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 18 Mar 2024 18:47:48 +0545 Subject: [PATCH 070/155] refactor: remove console.log --- src/components/customFieldAccessTable/CustomFieldAccessTable.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx index 62c33be..3b90f41 100644 --- a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx +++ b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx @@ -74,7 +74,6 @@ export const CustomFieldAccessTable = () => { - {console.log('XXX', field)} {iconsTypeMap[field.type]} {field.name} From f3888b9d80551e09e7609f3ceb231102507c3d1c Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 19 Mar 2024 07:36:48 +0545 Subject: [PATCH 071/155] feat: add loader --- src/app/loading.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/app/loading.tsx diff --git a/src/app/loading.tsx b/src/app/loading.tsx new file mode 100644 index 0000000..3d11795 --- /dev/null +++ b/src/app/loading.tsx @@ -0,0 +1,11 @@ +import { Box, CircularProgress } from '@mui/material'; + +const Loading = () => { + return ( + + + + ); +}; + +export default Loading; From 82d5e98b3a57332e62879e27903d4b2460d52cc2 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 19 Mar 2024 14:47:53 +0545 Subject: [PATCH 072/155] hotfix: app crashing on fallbackColor not present --- src/app/api/client-profile-updates/route.ts | 8 ++++---- src/components/table/Table.tsx | 4 ++-- src/components/table/cellRenderers/ClientCellRenderer.tsx | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 5ba9e75..516f920 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -142,9 +142,9 @@ function getClientDetails(client: ClientResponse) { function getCompanyDetails(company: CompanyResponse) { return { - id: company.id, - name: company.name, - iconImageUrl: company.iconImageUrl, - fallbackColor: company.fallbackColor, + id: company?.id, + name: company?.name, + iconImageUrl: company?.iconImageUrl, + fallbackColor: company?.fallbackColor, }; } diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 70c33e5..004f03a 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -97,7 +97,7 @@ export const TableCore = () => { avatarImageUrl: client.avatarImageUrl, name: client.name, email: client.email, - fallbackColor: company.fallbackColor || copilotTheme.colors.primary, + fallbackColor: company?.fallbackColor || copilotTheme.colors.primary, }; }, }, @@ -124,7 +124,7 @@ export const TableCore = () => { return { iconImageUrl: company.iconImageUrl, name: company.name, - fallbackColor: company.fallbackColor, + fallbackColor: company?.fallbackColor || copilotTheme.colors.primary, }; }, }, diff --git a/src/components/table/cellRenderers/ClientCellRenderer.tsx b/src/components/table/cellRenderers/ClientCellRenderer.tsx index 2ecd045..7cefc25 100644 --- a/src/components/table/cellRenderers/ClientCellRenderer.tsx +++ b/src/components/table/cellRenderers/ClientCellRenderer.tsx @@ -1,9 +1,10 @@ +import copilotTheme from '@/utils/copilotTheme'; import { Box, Stack, Typography } from '@mui/material'; export const ClientCellRenderer = ({ value, }: { - value: { avatarImageUrl: string; email: string; name: string; fallbackColor: string }; + value: { avatarImageUrl: string; email: string; name: string; fallbackColor?: string }; }) => { const { avatarImageUrl, email, name, fallbackColor } = value; @@ -17,7 +18,7 @@ export const ClientCellRenderer = ({ minWidth: '28px', height: '28px', borderRadius: '100%', - background: fallbackColor, + background: fallbackColor || copilotTheme.colors.primary, color: 'white', display: 'flex', justifyContent: 'center', From 3d6d5288fa3f2eefa9eeda349db59492d5d6d0f4 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 19 Mar 2024 15:04:30 +0545 Subject: [PATCH 073/155] hotfix: iconImageUrl key causing crash --- src/components/table/Table.tsx | 4 ++-- src/components/table/cellRenderers/CompanyCellRenderer.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 004f03a..c3449a5 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -122,8 +122,8 @@ export const TableCore = () => { valueGetter: (params: any) => { const company = params.data[el]; return { - iconImageUrl: company.iconImageUrl, - name: company.name, + iconImageUrl: company?.iconImageUrl, + name: company?.name || '', fallbackColor: company?.fallbackColor || copilotTheme.colors.primary, }; }, diff --git a/src/components/table/cellRenderers/CompanyCellRenderer.tsx b/src/components/table/cellRenderers/CompanyCellRenderer.tsx index 5451b55..b422ba1 100644 --- a/src/components/table/cellRenderers/CompanyCellRenderer.tsx +++ b/src/components/table/cellRenderers/CompanyCellRenderer.tsx @@ -4,14 +4,14 @@ import CompanyIcon from '@/components/table/cellRenderers/CompanyIcon'; export const CompanyCellRenderer = ({ value, }: { - value: { iconImageUrl: string; name: string; fallbackColor?: string }; + value: { iconImageUrl?: string; name?: string; fallbackColor?: string }; }) => { const { iconImageUrl, name, fallbackColor } = value; if (!name) return <>; return ( - + {name} From 096af797bf7ede2ac5568d636b52d66e852e3fc3 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 19 Mar 2024 17:30:15 +0545 Subject: [PATCH 074/155] refactor: strictly type field --- src/app/manage/page.tsx | 7 +++++-- src/types/customFieldAccess.ts | 17 ++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 7d6a903..a084aaf 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -1,7 +1,7 @@ import { Box, Stack, Typography } from '@mui/material'; import { ManagePageContainer } from './views/ManagePageContainer'; import { apiUrl } from '@/config'; -import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; +import { CustomAccessField, CustomFieldAccessResponse, ModifiedPermissionAccessField } from '@/types/customFieldAccess'; import { ProfileLinks } from '@/types/settings'; import { PortalRoutes } from '@/types/copilotPortal'; import RedirectButton from '@/components/atoms/RedirectButton'; @@ -66,7 +66,10 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok const customFieldAccess = await getCustomFieldAccess({ token, portalId }); const client = await getClient(clientId, token); - const isAccessProvided = customFieldAccess.some((field: any) => field.permission.length > 0); + + const isAccessProvided = customFieldAccess.some( + (field) => (field as unknown as ModifiedPermissionAccessField).permission.length > 0, + ); return ( ; -export const CustomFieldAccessResponseSchema = z.array( - z.object({ - customFieldId: z.string().uuid(), - portalId: z.string(), - permissions: z.array(z.nativeEnum(Permission)), - }), -); +export const CustomAccessFieldSchema = z.object({ + customFieldId: z.string().uuid(), + portalId: z.string(), + permissions: z.array(z.nativeEnum(Permission)), +}); +export type CustomAccessField = z.infer; + +export const CustomFieldAccessResponseSchema = z.array(CustomAccessFieldSchema); export type CustomFieldAccessResponse = z.infer; + +export type ModifiedPermissionAccessField = Omit & { permission: string[] }; From eb6dd55784ad4892a40c13d7c20974702a683f5e Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 21 Mar 2024 16:54:47 +0545 Subject: [PATCH 075/155] fix: add case for undefined or empty string lastHistory mismatch --- src/app/api/client-profile-updates/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 516f920..56e153f 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -39,7 +39,7 @@ export async function POST(request: NextRequest) { for (const key of Object.keys(changedFields)) { const lastHistory = (await new ClientProfileUpdatesService().getUpdateHistory(key, client.id, new Date()))?.[0] ?.changedFields?.[key]; - if (!lastHistory) continue; + if ((lastHistory === undefined || lastHistory === '') && client.customFields?.[key] === undefined) continue; // If not, fix it. if (client.customFields?.[key] !== lastHistory) { From 97ca07fffc7a6159b2ed32027e1a512b40e7900f Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 21 Mar 2024 17:26:53 +0545 Subject: [PATCH 076/155] refactor: clean up logic so code is maintainable --- src/app/api/client-profile-updates/route.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 56e153f..2cc625a 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -39,10 +39,15 @@ export async function POST(request: NextRequest) { for (const key of Object.keys(changedFields)) { const lastHistory = (await new ClientProfileUpdatesService().getUpdateHistory(key, client.id, new Date()))?.[0] ?.changedFields?.[key]; - if ((lastHistory === undefined || lastHistory === '') && client.customFields?.[key] === undefined) continue; - // If not, fix it. + const areHistoriesEmpty = + // Case where both have empty values. Make sure to strict check so we don't consider 0 input as empty history + (lastHistory === undefined || lastHistory === null || lastHistory === '') && + client.customFields?.[key] === undefined; + if (areHistoriesEmpty) continue; + if (client.customFields?.[key] !== lastHistory) { + // If not, fix it. await service.save({ clientId: clientProfileUpdateRequest.data.clientId, companyId: clientProfileUpdateRequest.data.companyId, From 779529ac726bdcc593e51bcbdd23b60d8caf11a1 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 21 Mar 2024 17:28:18 +0545 Subject: [PATCH 077/155] fix: getObjectDifference doesn't consider comparison by reference for objects --- src/lib/helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helper.ts b/src/lib/helper.ts index 8066dfa..28fbee8 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -8,8 +8,8 @@ export function getObjectDifference(obj1: Record, obj value1 = Array.isArray(value1) ? value1.sort() : value1; value2 = Array.isArray(value2) ? value2.sort() : value2; - if (value1 === undefined) value1 = ''; - if (value2 === undefined) value2 = ''; + if (value1 === undefined || (Array.isArray(value1) && value1.length === 0)) value1 = ''; + if (value2 === undefined || (Array.isArray(value2) && value2.length === 0)) value2 = ''; if (JSON.stringify(value1) !== JSON.stringify(value2)) { diff[key] = value1; From 54c62dde949b95ed1a73f94f1554f53b42235d28 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 21 Mar 2024 17:33:40 +0545 Subject: [PATCH 078/155] refactor: minor cleanup --- src/lib/helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helper.ts b/src/lib/helper.ts index 28fbee8..37b7668 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -8,8 +8,8 @@ export function getObjectDifference(obj1: Record, obj value1 = Array.isArray(value1) ? value1.sort() : value1; value2 = Array.isArray(value2) ? value2.sort() : value2; - if (value1 === undefined || (Array.isArray(value1) && value1.length === 0)) value1 = ''; - if (value2 === undefined || (Array.isArray(value2) && value2.length === 0)) value2 = ''; + if (value1 === undefined || (Array.isArray(value1) && !value1.length)) value1 = ''; + if (value2 === undefined || (Array.isArray(value2) && !value2.length)) value2 = ''; if (JSON.stringify(value1) !== JSON.stringify(value2)) { diff[key] = value1; From 2208a765906c0cae51d6a08d1c6db61d879f828c Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 21 Mar 2024 17:35:19 +0545 Subject: [PATCH 079/155] fix: handle future null edge case --- src/lib/helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helper.ts b/src/lib/helper.ts index 37b7668..cedb64b 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -8,8 +8,8 @@ export function getObjectDifference(obj1: Record, obj value1 = Array.isArray(value1) ? value1.sort() : value1; value2 = Array.isArray(value2) ? value2.sort() : value2; - if (value1 === undefined || (Array.isArray(value1) && !value1.length)) value1 = ''; - if (value2 === undefined || (Array.isArray(value2) && !value2.length)) value2 = ''; + if (value1 === undefined || value1 === null || (Array.isArray(value1) && !value1.length)) value1 = ''; + if (value2 === undefined || value2 === null || (Array.isArray(value2) && !value2.length)) value2 = ''; if (JSON.stringify(value1) !== JSON.stringify(value2)) { diff[key] = value1; From 490b29be97cff51b1d895d9a8e2a10d8cff2912f Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 21 Mar 2024 17:37:08 +0545 Subject: [PATCH 080/155] docs: document confusing code --- src/lib/helper.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/helper.ts b/src/lib/helper.ts index cedb64b..b9d811f 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -8,6 +8,8 @@ export function getObjectDifference(obj1: Record, obj value1 = Array.isArray(value1) ? value1.sort() : value1; value2 = Array.isArray(value2) ? value2.sort() : value2; + // The reason we are converting both values to emptry string is because we save + // empty field as '' while copilot deletes that key from customFields entirely so it becomes undefined if (value1 === undefined || value1 === null || (Array.isArray(value1) && !value1.length)) value1 = ''; if (value2 === undefined || value2 === null || (Array.isArray(value2) && !value2.length)) value2 = ''; From 0ea981d28021fdc77dd72f188fd02bcd14e74b21 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 22 Mar 2024 16:48:52 +0545 Subject: [PATCH 081/155] hotfix: zod validation issue for customField --- src/types/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/common.ts b/src/types/common.ts index 15e0200..0ec8466 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -60,7 +60,7 @@ export const ClientResponseSchema = z.object({ companyId: z.string(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + customFields: z.record(z.string().nullish(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), }); export type ClientResponse = z.infer; From 357f00efc655c3ef956835052edf97744aa58ffb Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 22 Mar 2024 17:01:40 +0545 Subject: [PATCH 082/155] revert: hotfix --- src/types/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/common.ts b/src/types/common.ts index 0ec8466..15e0200 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -60,7 +60,7 @@ export const ClientResponseSchema = z.object({ companyId: z.string(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string().nullish(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), }); export type ClientResponse = z.infer; From 0389ee32edbb6f5bbdbc3e7f0984308735c6b45a Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 22 Mar 2024 17:11:03 +0545 Subject: [PATCH 083/155] hotfix: custom field value --- src/types/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/common.ts b/src/types/common.ts index 15e0200..c43d7fb 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -60,7 +60,7 @@ export const ClientResponseSchema = z.object({ companyId: z.string(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())], z.number()).nullable()).nullish(), }); export type ClientResponse = z.infer; @@ -110,6 +110,6 @@ export const ClientRequestSchema = z.object({ givenName: z.string().optional(), familyName: z.string().optional(), companyId: z.string().uuid().optional(), - customFields: z.record(z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + customFields: z.record(z.string(), z.union([z.string(), z.array(z.string()), z.number()]).nullish()).nullish(), }); export type ClientRequest = z.infer; From 7254966742b7bc472badab75f977fb24d61eecda Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 22 Mar 2024 17:18:35 +0545 Subject: [PATCH 084/155] hotfix: zod validation issue --- src/types/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/common.ts b/src/types/common.ts index c43d7fb..bb87cb0 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -60,7 +60,7 @@ export const ClientResponseSchema = z.object({ companyId: z.string(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())], z.number()).nullable()).nullish(), + customFields: z.record(z.string(), z.union([z.string().nullable(), z.array(z.string()).nullable()]).nullable()).nullish(), }); export type ClientResponse = z.infer; @@ -110,6 +110,6 @@ export const ClientRequestSchema = z.object({ givenName: z.string().optional(), familyName: z.string().optional(), companyId: z.string().uuid().optional(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string()), z.number()]).nullish()).nullish(), + customFields: z.record(z.union([z.string().nullish(), z.array(z.string()).nullish()]).nullable()).nullish(), }); export type ClientRequest = z.infer; From 9cf76f4b50f4807dab03ab68c77ba894f7d0f3f4 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 22 Mar 2024 17:26:53 +0545 Subject: [PATCH 085/155] hotfix: fix nullable validation --- src/types/clientProfileUpdates.ts | 2 +- src/types/common.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types/clientProfileUpdates.ts b/src/types/clientProfileUpdates.ts index ac4533a..e2d69c0 100644 --- a/src/types/clientProfileUpdates.ts +++ b/src/types/clientProfileUpdates.ts @@ -1,6 +1,6 @@ import { z } from 'zod'; -export const CustomFieldUpdatesSchema = z.record(z.union([z.string(), z.array(z.string())])); +export const CustomFieldUpdatesSchema = z.record(z.union([z.string(), z.array(z.string())]).nullable()); export type CustomFieldUpdates = z.infer; export const ClientProfileUpdatesRequestSchema = z.object({ diff --git a/src/types/common.ts b/src/types/common.ts index bb87cb0..d06b39e 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -60,7 +60,7 @@ export const ClientResponseSchema = z.object({ companyId: z.string(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string(), z.union([z.string().nullable(), z.array(z.string()).nullable()]).nullable()).nullish(), + customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), }); export type ClientResponse = z.infer; @@ -110,6 +110,6 @@ export const ClientRequestSchema = z.object({ givenName: z.string().optional(), familyName: z.string().optional(), companyId: z.string().uuid().optional(), - customFields: z.record(z.union([z.string().nullish(), z.array(z.string()).nullish()]).nullable()).nullish(), + customFields: z.record(z.union([z.string(), z.array(z.string())]).nullish()).nullish(), }); export type ClientRequest = z.infer; From 7fd3a98b24c7a1201b5267b86da1bd301f66f3eb Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 22 Mar 2024 17:29:03 +0545 Subject: [PATCH 086/155] hotfix: fix nullable validation --- src/types/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/common.ts b/src/types/common.ts index d06b39e..0002aa7 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -110,6 +110,6 @@ export const ClientRequestSchema = z.object({ givenName: z.string().optional(), familyName: z.string().optional(), companyId: z.string().uuid().optional(), - customFields: z.record(z.union([z.string(), z.array(z.string())]).nullish()).nullish(), + customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullish()).nullish(), }); export type ClientRequest = z.infer; From caebc0bbad27c170777bd85085575c993829dc62 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 22 Mar 2024 17:39:44 +0545 Subject: [PATCH 087/155] hotfix: build issue --- src/app/api/client-profile-updates/route.ts | 2 +- src/app/api/profile-update-history/route.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 2cc625a..57051aa 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -115,7 +115,7 @@ export async function GET(request: NextRequest) { portalCustomFields.data?.forEach((portalCustomField) => { const value = update.customFields[portalCustomField.key] ?? null; - const options = getSelectedOptions(portalCustomField, value); + const options = getSelectedOptions(portalCustomField, value || ''); // @ts-ignore parsedClientProfileUpdate[portalCustomField.name] = { diff --git a/src/app/api/profile-update-history/route.ts b/src/app/api/profile-update-history/route.ts index fb65112..c6f5805 100644 --- a/src/app/api/profile-update-history/route.ts +++ b/src/app/api/profile-update-history/route.ts @@ -39,7 +39,7 @@ export async function GET(request: NextRequest) { ); const parsedUpdateHistory = updateHistory.map((update) => { const value = update.changedFields[customFieldKey]; - const options = getSelectedOptions(selectedCustomField, value); + const options = getSelectedOptions(selectedCustomField, value || ''); return { type: selectedCustomField.type, value: options.length > 0 ? options : value, From 6ce0db3c4061eabeb29a132cc2534f1da17104d5 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 25 Mar 2024 20:13:42 +0545 Subject: [PATCH 088/155] hotfix: multi field issues in client & IU --- src/components/multiSelect/MultiSelect.tsx | 2 +- src/components/table/Table.tsx | 2 +- .../cellRenderers/HistoryCellRenderer.tsx | 53 ++++++++++--------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/components/multiSelect/MultiSelect.tsx b/src/components/multiSelect/MultiSelect.tsx index 214d11f..f8c8b1c 100644 --- a/src/components/multiSelect/MultiSelect.tsx +++ b/src/components/multiSelect/MultiSelect.tsx @@ -20,7 +20,7 @@ export const MultiSelect = ({ data, nameField, value, getSelec value={value} multiple id="tags-outlined" - options={data} + options={Array.isArray(data) ? data : []} getOptionLabel={(option: T) => nameField(option)} filterSelectedOptions autoHighlight diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index c3449a5..86b56d9 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -158,7 +158,7 @@ export const TableCore = () => { const data = params.data[el]; if (data.type === 'multiSelect') { if (data && data.value !== null) { - return data.value[0].label; + return data.value[0]?.label; } return ''; } else { diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index 0c8a74c..b75db00 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -232,32 +232,35 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { • - {history.value.map((el: any, key: number) => { - return ( - - + {/* history.value can either be "" (empty state) or an array of multi tags */} + {!Array.isArray(history?.value) + ? history.value + : history.value.map((el: any, key: number) => { + return ( + + - - {el.label} - - - ); - })} + + {el.label} + + + ); + })} ); From f462454daf13d271bfcfe9db1c2b63753a4204c7 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 25 Mar 2024 21:13:52 +0545 Subject: [PATCH 089/155] chore: add clients icon --- src/icons/clients.svg | 6 ++++++ src/icons/index.ts | 1 + 2 files changed, 7 insertions(+) create mode 100644 src/icons/clients.svg diff --git a/src/icons/clients.svg b/src/icons/clients.svg new file mode 100644 index 0000000..1525673 --- /dev/null +++ b/src/icons/clients.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/icons/index.ts b/src/icons/index.ts index 79bdf33..088306a 100644 --- a/src/icons/index.ts +++ b/src/icons/index.ts @@ -11,3 +11,4 @@ export { default as TextIcon } from './text.svg'; export { default as EmailIcon } from './email.svg'; export { default as LinkIcon } from './link.svg'; export { default as NumberIcon } from './number.svg'; +export { default as ClientsIcon } from './clients.svg'; From 4bac9a90e894db6e4dcdff74959f05136340ac93 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 25 Mar 2024 21:14:10 +0545 Subject: [PATCH 090/155] feat: add empty state for profile updates list --- src/components/table/Table.tsx | 56 ++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 86b56d9..19c531c 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -1,4 +1,4 @@ -import { Box } from '@mui/material'; +import { Box, Typography } from '@mui/material'; import { AgGridReact } from 'ag-grid-react'; import 'ag-grid-community/styles/ag-grid.css'; // Core CSS import 'ag-grid-community/styles/ag-theme-quartz.css'; // Theme @@ -12,6 +12,8 @@ import { getTimeAgo } from '@/utils/getTimeAgo'; import { arraysHaveSameElements, sliceTillElement } from '@/utils/array'; import { order } from '@/utils/orderable'; import copilotTheme from '@/utils/copilotTheme'; +import { ClientsIcon } from '@/icons'; +import Link from 'next/link'; export const TableCore = () => { const appState = useAppState(); @@ -202,15 +204,49 @@ export const TableCore = () => { padding: { xs: 0, sm: '8px 24px 0 24px' }, }} > - + {rowData?.length ? ( + + ) : ( + + + + +
+ + Let clients view and update custom fields + +
+
+ + With Profile Manager, you can let clients view and edit their own custom fields. Configure custom field access + on the right. Then if clients make updates, they will show directly on this page. + + + Learn More + +
+
+ )}
); }; From 8ffb632c7929200268c894ab28f247cf3658d063 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 25 Mar 2024 21:48:29 +0545 Subject: [PATCH 091/155] hotfix: favor noRowsOverlayComponent in AG Grid --- src/components/table/NoRowsOverlay.tsx | 41 ++++++++++++++++++ src/components/table/Table.tsx | 57 +++++--------------------- 2 files changed, 52 insertions(+), 46 deletions(-) create mode 100644 src/components/table/NoRowsOverlay.tsx diff --git a/src/components/table/NoRowsOverlay.tsx b/src/components/table/NoRowsOverlay.tsx new file mode 100644 index 0000000..5e1db8d --- /dev/null +++ b/src/components/table/NoRowsOverlay.tsx @@ -0,0 +1,41 @@ +import { ClientsIcon } from '@/icons'; +import { Box, Typography } from '@mui/material'; +import Link from 'next/link'; + +const NoRowsOverlay = () => ( + + + + +
+ + Let clients view and update custom fields + +
+
+ + With Profile Manager, you can let clients view and edit their own custom fields. Configure custom field access on the + right. Then if clients make updates, they will show directly on this page. + + + + Learn More + + +
+
+); + +export default NoRowsOverlay; diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 19c531c..37c6111 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -1,4 +1,4 @@ -import { Box, Typography } from '@mui/material'; +import { Box } from '@mui/material'; import { AgGridReact } from 'ag-grid-react'; import 'ag-grid-community/styles/ag-grid.css'; // Core CSS import 'ag-grid-community/styles/ag-theme-quartz.css'; // Theme @@ -12,8 +12,7 @@ import { getTimeAgo } from '@/utils/getTimeAgo'; import { arraysHaveSameElements, sliceTillElement } from '@/utils/array'; import { order } from '@/utils/orderable'; import copilotTheme from '@/utils/copilotTheme'; -import { ClientsIcon } from '@/icons'; -import Link from 'next/link'; +import NoRowsOverlay from './NoRowsOverlay'; export const TableCore = () => { const appState = useAppState(); @@ -204,49 +203,15 @@ export const TableCore = () => { padding: { xs: 0, sm: '8px 24px 0 24px' }, }} > - {rowData?.length ? ( - - ) : ( - - - - -
- - Let clients view and update custom fields - -
-
- - With Profile Manager, you can let clients view and edit their own custom fields. Configure custom field access - on the right. Then if clients make updates, they will show directly on this page. - - - Learn More - -
-
- )} + ); }; From 659f9cf04f1b47d51e7d9e06972862e8bc343db9 Mon Sep 17 00:00:00 2001 From: Potluck Mittal Date: Mon, 25 Mar 2024 13:29:38 -0400 Subject: [PATCH 092/155] undo using noRowsOverlayComponent because it doesn't support links natively --- src/components/table/Table.tsx | 56 ++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 37c6111..5c59af8 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -1,4 +1,4 @@ -import { Box } from '@mui/material'; +import { Box, Typography } from '@mui/material'; import { AgGridReact } from 'ag-grid-react'; import 'ag-grid-community/styles/ag-grid.css'; // Core CSS import 'ag-grid-community/styles/ag-theme-quartz.css'; // Theme @@ -12,6 +12,8 @@ import { getTimeAgo } from '@/utils/getTimeAgo'; import { arraysHaveSameElements, sliceTillElement } from '@/utils/array'; import { order } from '@/utils/orderable'; import copilotTheme from '@/utils/copilotTheme'; +import { ClientsIcon } from '@/icons'; +import Link from 'next/link'; import NoRowsOverlay from './NoRowsOverlay'; export const TableCore = () => { @@ -203,15 +205,49 @@ export const TableCore = () => { padding: { xs: 0, sm: '8px 24px 0 24px' }, }} > - + {rowData?.length ? ( + + ) : ( + + + + +
+ + Let clients view and update custom fields + +
+
+ + With Profile Manager, you can let clients view and edit their own custom fields. Configure custom field access + on the right. Then if clients make updates, they will show directly on this page. + + + Learn More + +
+
+ )} ); }; From 994284452441b53fd529b7d6cf7580a5e5a0af3b Mon Sep 17 00:00:00 2001 From: Potluck Mittal Date: Mon, 25 Mar 2024 13:43:36 -0400 Subject: [PATCH 093/155] open link in new tab --- src/components/table/Table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 5c59af8..3a6201c 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -240,7 +240,7 @@ export const TableCore = () => { on the right. Then if clients make updates, they will show directly on this page. Learn More From b76e923b1e9ec64b4dbf43354781fbe1db979c38 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 26 Mar 2024 07:53:32 +0545 Subject: [PATCH 094/155] hotfix: link issue with AG Grid --- src/components/table/NoRowsOverlay.tsx | 3 ++- src/components/table/Table.tsx | 33 +------------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/components/table/NoRowsOverlay.tsx b/src/components/table/NoRowsOverlay.tsx index 5e1db8d..ace9616 100644 --- a/src/components/table/NoRowsOverlay.tsx +++ b/src/components/table/NoRowsOverlay.tsx @@ -9,7 +9,7 @@ const NoRowsOverlay = () => ( flexDirection: 'column', gap: '1.25em', alignItems: 'flex-start', - margin: '0% auto', + margin: '20% auto', maxWidth: '640px', }} > @@ -30,6 +30,7 @@ const NoRowsOverlay = () => ( Learn More diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 3a6201c..213c8f1 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -213,40 +213,9 @@ export const TableCore = () => { defaultColDef={defaultColDef} suppressMovableColumns={true} quickFilterText={appState?.searchKeyword} - overlayNoRowsTemplate={'Your clients have not yet made any Profile updates.'} /> ) : ( - - - - -
- - Let clients view and update custom fields - -
-
- - With Profile Manager, you can let clients view and edit their own custom fields. Configure custom field access - on the right. Then if clients make updates, they will show directly on this page. - - - Learn More - -
-
+ )} ); From 506d924d7f5c5372d05ffc350dfdaeb4dccd2cb8 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 26 Mar 2024 14:32:04 +0545 Subject: [PATCH 095/155] fix: edge case with null phone numbers --- .../cellRenderers/HistoryCellRenderer.tsx | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index b75db00..3d60f4d 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -63,8 +63,9 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string const multiSelectAnchorOpen = Boolean(multiSelectAnchor); const multiSelectAnchorId = multiSelectAnchorOpen ? 'multiselect-popper' : undefined; + // There are certain edge cases like with Phone Numbers where null is returned if (data.value === null) { - return null; + data.value = ''; } if (data.type === 'multiSelect') { @@ -147,33 +148,34 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string columnGap: '10px', })} > - {data?.value?.map((el: any, key: number) => { - if (key === 0) return null; - return ( - - + {data?.value && + data?.value?.map((el: any, key: number) => { + if (key === 0) return null; + return ( + + - - {el.label} - - - ); - })} + + {el.label} + + + ); + })}
@@ -182,6 +184,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string return ( + {console.log(data.value, showDot)} {showDot && ( Date: Tue, 26 Mar 2024 15:09:58 +0545 Subject: [PATCH 096/155] fix: extraneous Empty in log --- .../services/clientProfileUpdates.service.ts | 2 +- src/app/api/profile-update-history/route.ts | 12 ++++++++---- .../table/cellRenderers/HistoryCellRenderer.tsx | 1 - src/types/clientProfileUpdates.ts | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts index 67e1765..5ae413f 100644 --- a/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts +++ b/src/app/api/client-profile-updates/services/clientProfileUpdates.service.ts @@ -56,7 +56,7 @@ export class ClientProfileUpdatesService { async getUpdateHistory(customFieldKey: string, clientId: string, lastUpdated: Date): Promise { return this.prismaClient.$queryRaw` - SELECT "changedFields" + SELECT "changedFields", "wasUpdatedByIU" FROM "ClientProfileUpdates" WHERE "clientId" = ${clientId}::uuid AND "createdAt" <= ${lastUpdated} diff --git a/src/app/api/profile-update-history/route.ts b/src/app/api/profile-update-history/route.ts index c6f5805..c929a62 100644 --- a/src/app/api/profile-update-history/route.ts +++ b/src/app/api/profile-update-history/route.ts @@ -43,14 +43,18 @@ export async function GET(request: NextRequest) { return { type: selectedCustomField.type, value: options.length > 0 ? options : value, + wasUpdatedByIU: update.wasUpdatedByIU, }; }); // If update history contains fewer than 4 items we assume the oldest value to start from empty if (parsedUpdateHistory.length < 4) { - parsedUpdateHistory.push({ - type: 'text', - value: 'Empty', - }); + if (!parsedUpdateHistory[parsedUpdateHistory.length - 1]?.wasUpdatedByIU) { + parsedUpdateHistory.push({ + type: 'text', + value: 'Empty', + wasUpdatedByIU: false, + }); + } } return NextResponse.json(parsedUpdateHistory); diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index 3d60f4d..24049eb 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -184,7 +184,6 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string return ( - {console.log(data.value, showDot)} {showDot && ( ; From 7a7a6de6a74b5bc8c6effcc1b372aeef20f1b8b2 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 26 Mar 2024 16:33:51 +0545 Subject: [PATCH 097/155] refactor: remove log --- src/components/table/cellRenderers/HistoryCellRenderer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index 3d60f4d..24049eb 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -184,7 +184,6 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string return ( - {console.log(data.value, showDot)} {showDot && ( Date: Tue, 26 Mar 2024 12:35:51 -0400 Subject: [PATCH 098/155] fix nullpointer when custom fields is null --- src/app/manage/views/ManagePageContainer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index f485627..e8c84e5 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -29,7 +29,7 @@ export const ManagePageContainer = ({ const [allowedCustomField, setAllowedCustomField] = useState(null); - const [customFieldsValue, setCustomFieldsValue] = useState(client.customFields); + const [customFieldsValue, setCustomFieldsValue] = useState(client.customFields || {}); const [profileData, setProfileData] = useState({}); From a4de9b1d6f1ab0b9cc2d471b8eeb40ee4bc4ba8e Mon Sep 17 00:00:00 2001 From: Potluck Mittal Date: Tue, 26 Mar 2024 15:21:12 -0400 Subject: [PATCH 099/155] copy update in sidebar --- src/app/views/Sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/views/Sidebar.tsx b/src/app/views/Sidebar.tsx index 3bf4d50..e676b50 100644 --- a/src/app/views/Sidebar.tsx +++ b/src/app/views/Sidebar.tsx @@ -61,7 +61,7 @@ export const Sidebar = () => { borderBottom: `1px solid ${theme.color.borders.border}`, })} > - Links + Show links to other settings General profile settings From beffe41b7abac8b29a62c652d35536cc47ba3185 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 27 Mar 2024 14:24:42 +0545 Subject: [PATCH 100/155] chore: add SWR --- package.json | 1 + yarn.lock | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f6b6f30..8e6950b 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "prisma": "^5.7.1", "react": "^18", "react-dom": "^18", + "swr": "^2.2.5", "zod": "^3.22.4" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 0ba5f1a..42af2d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2341,7 +2341,7 @@ cli-truncate@^4.0.0: slice-ansi "^5.0.0" string-width "^7.0.0" -client-only@0.0.1: +client-only@0.0.1, client-only@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== @@ -4832,6 +4832,14 @@ svgo@^3.0.2: csso "^5.0.5" picocolors "^1.0.0" +swr@^2.2.5: + version "2.2.5" + resolved "https://registry.yarnpkg.com/swr/-/swr-2.2.5.tgz#063eea0e9939f947227d5ca760cc53696f46446b" + integrity sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg== + dependencies: + client-only "^0.0.1" + use-sync-external-store "^1.2.0" + tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" @@ -5027,6 +5035,11 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +use-sync-external-store@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + utf-8-validate@6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-6.0.3.tgz#7d8c936d854e86b24d1d655f138ee27d2636d777" From 6f6e6cfbd154f91bb8517e16d4c335b7505154c8 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 27 Mar 2024 14:25:03 +0545 Subject: [PATCH 101/155] chore: add fetcher util to help with SWR fetch fn --- src/utils/fetcher.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/utils/fetcher.ts diff --git a/src/utils/fetcher.ts b/src/utils/fetcher.ts new file mode 100644 index 0000000..ce2152d --- /dev/null +++ b/src/utils/fetcher.ts @@ -0,0 +1,5 @@ +export const fetcher = (url: string | null) => { + if (url) { + return fetch(url).then((res) => res.json()); + } +}; From abf8900bb05aaf0ce56aac56f48d7d848d9fef30 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 27 Mar 2024 14:26:28 +0545 Subject: [PATCH 102/155] chore: implement SWR and initial client side fetch loader --- src/app/page.tsx | 20 -------------------- src/components/table/Table.tsx | 11 ++++++----- src/context/index.tsx | 4 ++++ src/hoc/ContextUpdate.tsx | 25 ++++++++++++++----------- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 5b5f3ae..0621a8a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,24 +12,6 @@ import InvalidToken from '@/components/atoms/InvalidToken'; export const revalidate = 0; -async function getClientProfileUpdates({ - token, - portalId, -}: { - token: string; - portalId: string; -}): Promise { - const res = await fetch(`${apiUrl}/api/client-profile-updates?token=${token}&portalId=${portalId}`); - - if (!res.ok) { - throw new Error('Something went wrong in getClientProfileUpdates'); - } - - const data = await res.json(); - - return data; -} - async function getCustomFieldAccess({ token, portalId, @@ -76,13 +58,11 @@ export default async function Home({ searchParams }: { searchParams: { token: st const workspace = await copilotClient.getWorkspace(); const { id: portalId } = workspace; - const clientProfileUpdates = await getClientProfileUpdates({ token, portalId }); const customFieldAccess = await getCustomFieldAccess({ token, portalId }); const settings = await getSettings({ token, portalId }); return ( { const appState = useAppState(); @@ -63,7 +62,7 @@ export const TableCore = () => { setRowData(appState?.clientProfileUpdates); let colDefs: any = []; - if (appState?.clientProfileUpdates.length && appState?.clientProfileUpdates.length) { + if (appState?.clientProfileUpdates?.length) { const col = appState?.clientProfileUpdates[0]; delete col.id; @@ -208,12 +207,14 @@ export const TableCore = () => { {rowData?.length ? ( + ) : appState?.isClientProfileUpdatesLoading ? ( + ) : ( )} diff --git a/src/context/index.tsx b/src/context/index.tsx index c5cd752..4c3efb6 100644 --- a/src/context/index.tsx +++ b/src/context/index.tsx @@ -7,6 +7,7 @@ export interface IAppState { showSidebar: boolean; searchKeyword: string; clientProfileUpdates: any[]; + isClientProfileUpdatesLoading: boolean; customFieldAccess: any; //readonly mutableCustomFieldAccess: any; settings: any; //readonly @@ -20,6 +21,7 @@ export interface IAppContext { showSidebar: boolean; searchKeyword: string; clientProfileUpdates: any[]; + isClientProfileUpdatesLoading: boolean; customFieldAccess: any; //readonly mutableCustomFieldAccess: any; settings: any; //readonly @@ -41,6 +43,7 @@ export const AppContextProvider: FC = ({ children }) => { showSidebar: false, searchKeyword: '', clientProfileUpdates: [], + isClientProfileUpdatesLoading: true, customFieldAccess: [], mutableCustomFieldAccess: [], settings: [], @@ -56,6 +59,7 @@ export const AppContextProvider: FC = ({ children }) => { showSidebar: state.showSidebar, searchKeyword: state.searchKeyword, clientProfileUpdates: state.clientProfileUpdates, + isClientProfileUpdatesLoading: state.isClientProfileUpdatesLoading, customFieldAccess: state.customFieldAccess, mutableCustomFieldAccess: state.mutableCustomFieldAccess, settings: state.settings, diff --git a/src/hoc/ContextUpdate.tsx b/src/hoc/ContextUpdate.tsx index 3c13d6e..e90d237 100644 --- a/src/hoc/ContextUpdate.tsx +++ b/src/hoc/ContextUpdate.tsx @@ -1,14 +1,14 @@ 'use client'; import { useAppState } from '@/hooks/useAppState'; -import { ParsedClientProfileUpdatesResponse } from '@/types/clientProfileUpdates'; import { WorkspaceResponse } from '@/types/common'; import { CustomFieldAccessResponse } from '@/types/customFieldAccess'; +import { fetcher } from '@/utils/fetcher'; import { ReactNode, useEffect } from 'react'; +import useSWR from 'swr'; interface IContextUpdate { children: ReactNode; - clientProfileUpdates: ParsedClientProfileUpdatesResponse[]; access: CustomFieldAccessResponse; settings: any; token: string; @@ -16,16 +16,15 @@ interface IContextUpdate { workspace: WorkspaceResponse; } -export const ContextUpdate = ({ - children, - clientProfileUpdates, - access, - settings, - token, - portalId, - workspace, -}: IContextUpdate) => { +export const ContextUpdate = ({ children, access, settings, token, portalId, workspace }: IContextUpdate) => { const appState = useAppState(); + const { data: clientProfileUpdates, isLoading: isClientProfileUpdatesLoading } = useSWR( + `api/client-profile-updates?token=${token}&portalId=${portalId}`, + fetcher, + { + refreshInterval: 5000, + }, + ); useEffect(() => { appState?.setAppState((prev) => ({ ...prev, workspace })); @@ -33,6 +32,10 @@ export const ContextUpdate = ({ useEffect(() => { appState?.setAppState((prev) => ({ ...prev, clientProfileUpdates })); + // lag half second before setting isLoading to false so that noRows component doesn't flash No Rows Found before rendering data! + const timeoutId = setTimeout(() => appState?.setAppState((prev) => ({ ...prev, isClientProfileUpdatesLoading })), 500); + + return () => clearTimeout(timeoutId); }, [clientProfileUpdates]); useEffect(() => { From eeb977e739b1fc2a9acb520f28b2c917a2f50905 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Wed, 27 Mar 2024 14:37:39 +0545 Subject: [PATCH 103/155] fix: fix horrible load times --- src/app/manage/page.tsx | 10 +++++----- src/app/page.tsx | 6 ++++-- src/hoc/ContextUpdate.tsx | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index a084aaf..f6adc95 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -62,11 +62,11 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok const { id: portalId } = await copilotClient.getWorkspace(); const { clientId, companyId } = await copilotClient.getClientTokenPayload(); - const settings = await getSettings({ token, portalId }).then((s) => s?.profileLinks || []); - const customFieldAccess = await getCustomFieldAccess({ token, portalId }); - - const client = await getClient(clientId, token); - + const [settings, customFieldAccess, client] = await Promise.all([ + getSettings({ token, portalId }).then((s) => s?.profileLinks || []), + getCustomFieldAccess({ token, portalId }), + getClient(clientId, token), + ]); const isAccessProvided = customFieldAccess.some( (field) => (field as unknown as ModifiedPermissionAccessField).permission.length > 0, ); diff --git a/src/app/page.tsx b/src/app/page.tsx index 0621a8a..51d47b7 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -58,8 +58,10 @@ export default async function Home({ searchParams }: { searchParams: { token: st const workspace = await copilotClient.getWorkspace(); const { id: portalId } = workspace; - const customFieldAccess = await getCustomFieldAccess({ token, portalId }); - const settings = await getSettings({ token, portalId }); + const [customFieldAccess, settings] = await Promise.all([ + getCustomFieldAccess({ token, portalId }), + getSettings({ token, portalId }), + ]); return ( Date: Mon, 8 Apr 2024 07:23:28 +0545 Subject: [PATCH 104/155] chore!: bump copilot-node-sdk to 2.0.0 --- package.json | 4 +-- yarn.lock | 83 ++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8e6950b..4de5ea8 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "@sentry/nextjs": "^7.105.0", "@vercel/postgres": "^0.5.1", "ag-grid-react": "^31.0.2", - "copilot-node-sdk": "^1.2.2", - "next": "14.1.0", + "copilot-node-sdk": "^2.0.0", + "next": "^14.1.0", "prisma": "^5.7.1", "react": "^18", "react-dom": "^18", diff --git a/yarn.lock b/yarn.lock index 42af2d2..e80df05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1384,6 +1384,11 @@ resolved "https://registry.yarnpkg.com/@next/env/-/env-14.1.0.tgz#43d92ebb53bc0ae43dcc64fb4d418f8f17d7a341" integrity sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw== +"@next/env@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/env/-/env-14.1.4.tgz#432e80651733fbd67230bf262aee28be65252674" + integrity sha512-e7X7bbn3Z6DWnDi75UWn+REgAbLEqxI8Tq2pkFOFAMpWAWApz/YCUhtWMWn410h8Q2fYiYL7Yg5OlxMOCfFjJQ== + "@next/eslint-plugin-next@14.0.4": version "14.0.4" resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-14.0.4.tgz#474fd88d92209270021186043513fbdc4203f5ec" @@ -1396,46 +1401,91 @@ resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.0.tgz#70a57c87ab1ae5aa963a3ba0f4e59e18f4ecea39" integrity sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ== +"@next/swc-darwin-arm64@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.4.tgz#a3bca0dc4393ac4cf3169bbf24df63441de66bb7" + integrity sha512-ubmUkbmW65nIAOmoxT1IROZdmmJMmdYvXIe8211send9ZYJu+SqxSnJM4TrPj9wmL6g9Atvj0S/2cFmMSS99jg== + "@next/swc-darwin-x64@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.0.tgz#0863a22feae1540e83c249384b539069fef054e9" integrity sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g== +"@next/swc-darwin-x64@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.4.tgz#ba3683d4e2d30099f3f2864dd7349a4d9f440140" + integrity sha512-b0Xo1ELj3u7IkZWAKcJPJEhBop117U78l70nfoQGo4xUSvv0PJSTaV4U9xQBLvZlnjsYkc8RwQN1HoH/oQmLlQ== + "@next/swc-linux-arm64-gnu@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.0.tgz#893da533d3fce4aec7116fe772d4f9b95232423c" integrity sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ== +"@next/swc-linux-arm64-gnu@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.4.tgz#3519969293f16379954b7e196deb0c1eecbb2f8b" + integrity sha512-457G0hcLrdYA/u1O2XkRMsDKId5VKe3uKPvrKVOyuARa6nXrdhJOOYU9hkKKyQTMru1B8qEP78IAhf/1XnVqKA== + "@next/swc-linux-arm64-musl@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.0.tgz#d81ddcf95916310b8b0e4ad32b637406564244c0" integrity sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g== +"@next/swc-linux-arm64-musl@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.4.tgz#4bb3196bd402b3f84cf5373ff1021f547264d62f" + integrity sha512-l/kMG+z6MB+fKA9KdtyprkTQ1ihlJcBh66cf0HvqGP+rXBbOXX0dpJatjZbHeunvEHoBBS69GYQG5ry78JMy3g== + "@next/swc-linux-x64-gnu@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.0.tgz#18967f100ec19938354332dcb0268393cbacf581" integrity sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ== +"@next/swc-linux-x64-gnu@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.4.tgz#1b3372c98c83dcdab946cdb4ee06e068b8139ba3" + integrity sha512-BapIFZ3ZRnvQ1uWbmqEGJuPT9cgLwvKtxhK/L2t4QYO7l+/DxXuIGjvp1x8rvfa/x1FFSsipERZK70pewbtJtw== + "@next/swc-linux-x64-musl@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.0.tgz#77077cd4ba8dda8f349dc7ceb6230e68ee3293cf" integrity sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg== +"@next/swc-linux-x64-musl@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.4.tgz#8459088bdc872648ff78f121db596f2533df5808" + integrity sha512-mqVxTwk4XuBl49qn2A5UmzFImoL1iLm0KQQwtdRJRKl21ylQwwGCxJtIYo2rbfkZHoSKlh/YgztY0qH3wG1xIg== + "@next/swc-win32-arm64-msvc@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.0.tgz#5f0b8cf955644104621e6d7cc923cad3a4c5365a" integrity sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ== +"@next/swc-win32-arm64-msvc@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.4.tgz#84280a08c00cc3be24ddd3a12f4617b108e6dea6" + integrity sha512-xzxF4ErcumXjO2Pvg/wVGrtr9QQJLk3IyQX1ddAC/fi6/5jZCZ9xpuL9Tzc4KPWMFq8GGWFVDMshZOdHGdkvag== + "@next/swc-win32-ia32-msvc@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.0.tgz#21f4de1293ac5e5a168a412b139db5d3420a89d0" integrity sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw== +"@next/swc-win32-ia32-msvc@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.4.tgz#23ff7f4bd0a27177428669ef6fa5c3923c738031" + integrity sha512-WZiz8OdbkpRw6/IU/lredZWKKZopUMhcI2F+XiMAcPja0uZYdMTZQRoQ0WZcvinn9xZAidimE7tN9W5v9Yyfyw== + "@next/swc-win32-x64-msvc@14.1.0": version "14.1.0" resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.0.tgz#e561fb330466d41807123d932b365cf3d33ceba2" integrity sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg== +"@next/swc-win32-x64-msvc@14.1.4": + version "14.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.4.tgz#bccf5beccfde66d6c66fa4e2509118c796385eda" + integrity sha512-4Rto21sPfw555sZ/XNLqfxDUNeLhNYGO2dlPqsnuCg8N8a2a9u1ltqBOPQ4vj1Gf7eJC0W2hHG2eYUHuiXgY2w== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2410,10 +2460,10 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -copilot-node-sdk@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-1.2.2.tgz#7f23c14669630f016f6ce6d92ac667f5b8d0ff4a" - integrity sha512-UqGYrwH/rqEjeuP+fqZQx7z2/1XhKELgkiZDhNr5zHhoI8DC4owoQEJTe/0lI4H/rJTLqZTBqagzWohuG4OOcg== +copilot-node-sdk@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-2.0.0.tgz#d70af16a552ef8bea42288c446637cb156a615d8" + integrity sha512-9LqBbRxBhMfKJWy3I3ez7GoiQbU7qvbbBrMhRNs+1G09tHsvuZGmGKbFBPiKVwSOnxH83a8GkmO8j09kGb8Hpg== dependencies: isomorphic-fetch "^3.0.0" jsonwebtoken "^9.0.2" @@ -4013,7 +4063,7 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -next@14.1.0, next@^14.0.2: +next@^14.0.2: version "14.1.0" resolved "https://registry.yarnpkg.com/next/-/next-14.1.0.tgz#b31c0261ff9caa6b4a17c5af019ed77387174b69" integrity sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q== @@ -4036,6 +4086,29 @@ next@14.1.0, next@^14.0.2: "@next/swc-win32-ia32-msvc" "14.1.0" "@next/swc-win32-x64-msvc" "14.1.0" +next@^14.1.0: + version "14.1.4" + resolved "https://registry.yarnpkg.com/next/-/next-14.1.4.tgz#203310f7310578563fd5c961f0db4729ce7a502d" + integrity sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ== + dependencies: + "@next/env" "14.1.4" + "@swc/helpers" "0.5.2" + busboy "1.6.0" + caniuse-lite "^1.0.30001579" + graceful-fs "^4.2.11" + postcss "8.4.31" + styled-jsx "5.1.1" + optionalDependencies: + "@next/swc-darwin-arm64" "14.1.4" + "@next/swc-darwin-x64" "14.1.4" + "@next/swc-linux-arm64-gnu" "14.1.4" + "@next/swc-linux-arm64-musl" "14.1.4" + "@next/swc-linux-x64-gnu" "14.1.4" + "@next/swc-linux-x64-musl" "14.1.4" + "@next/swc-win32-arm64-msvc" "14.1.4" + "@next/swc-win32-ia32-msvc" "14.1.4" + "@next/swc-win32-x64-msvc" "14.1.4" + no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" From 609d7fa88b0474e7c4d41976fb72b05b7990ae6f Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 8 Apr 2024 07:24:00 +0545 Subject: [PATCH 105/155] fix!: deprecate all uses of me() --- src/app/api/client-profile-updates/route.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 57051aa..dbca9f7 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -90,8 +90,7 @@ export async function GET(request: NextRequest) { try { const copilotClient = new CopilotAPI(z.string().parse(token)); - const [currentUser, clients, companies, portalCustomFields] = await Promise.all([ - copilotClient.me(), + const [clients, companies, portalCustomFields] = await Promise.all([ copilotClient.getClients(), copilotClient.getCompanies(), copilotClient.getCustomFields(), From f1fe04ad70bcdabefdaa09cbb70bba956ad697a7 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 8 Apr 2024 07:24:25 +0545 Subject: [PATCH 106/155] fix: change all CopilotAPI methods to use new sdk --- src/utils/copilotApiUtils.ts | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/utils/copilotApiUtils.ts b/src/utils/copilotApiUtils.ts index 5c13370..26357e6 100644 --- a/src/utils/copilotApiUtils.ts +++ b/src/utils/copilotApiUtils.ts @@ -1,5 +1,5 @@ import { copilotApi } from 'copilot-node-sdk'; -import { DefaultService as Copilot } from 'copilot-node-sdk/codegen/api/services/DefaultService'; +import type { CopilotAPI as SDK } from 'copilot-node-sdk'; import { ClientResponse, ClientResponseSchema, @@ -9,8 +9,6 @@ import { ClientRequest, CustomFieldResponse, CustomFieldResponseSchema, - MeResponse, - MeResponseSchema, CompaniesResponse, CompaniesResponseSchema, WorkspaceResponse, @@ -24,10 +22,8 @@ import { } from '@/types/common'; import { copilotAPIKey } from '@/config'; -export type CopilotApi = typeof Copilot & { getTokenPayload?: () => Promise }; - export class CopilotAPI { - copilot: CopilotApi; + copilot: SDK; constructor(apiToken: string) { this.copilot = copilotApi({ @@ -36,12 +32,8 @@ export class CopilotAPI { }); } - async me(): Promise { - return MeResponseSchema.parse(await this.copilot.getUserInfo()); - } - async getWorkspace(): Promise { - return WorkspaceResponseSchema.parse(await this.copilot.getWorkspaceInfo()); + return WorkspaceResponseSchema.parse(await this.copilot.retrieveWorkspace()); } private async getTokenPayload(): Promise { @@ -56,21 +48,21 @@ export class CopilotAPI { return IUTokenSchema.parse(await this.getTokenPayload()); } - async getClient(clientId: string): Promise { - return ClientResponseSchema.parse(await this.copilot.retrieveAClient({ id: clientId })); + async getClient(id: string): Promise { + return ClientResponseSchema.parse(await this.copilot.retrieveClient({ id })); } async getClients() { return ClientsResponseSchema.parse(await this.copilot.listClients({})); } - async updateClient(clientId: string, requestBody: ClientRequest): Promise { + async updateClient(id: string, requestBody: ClientRequest): Promise { // @ts-ignore - return ClientResponseSchema.parse(await this.copilot.updateAClient({ id: clientId, requestBody })); + return ClientResponseSchema.parse(await this.copilot.updateClient({ id, requestBody })); } - async getCompany(companyId: string): Promise { - return CompanyResponseSchema.parse(await this.copilot.retrieveACompany({ id: companyId })); + async getCompany(id: string): Promise { + return CompanyResponseSchema.parse(await this.copilot.retrieveCompany({ id })); } async getCompanies(): Promise { From 3ef40c92750621949d848902c1d61e78a0a0dff0 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 8 Apr 2024 07:24:45 +0545 Subject: [PATCH 107/155] fix: ApiError no longer exported from SDK --- src/exceptions/copilot.ts | 16 ++++++++++++++++ src/utils/common.ts | 22 ++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 src/exceptions/copilot.ts diff --git a/src/exceptions/copilot.ts b/src/exceptions/copilot.ts new file mode 100644 index 0000000..4cd8022 --- /dev/null +++ b/src/exceptions/copilot.ts @@ -0,0 +1,16 @@ +export class CopilotApiError extends Error { + readonly status: number; + readonly body: { + message: string; + }; + + constructor(status: number, message: string) { + super(message); + this.status = status; + this.body = { message }; + } +} + +export const matchesCopilotApiError = (err: unknown) => { + return 'body' in (err as { body: { message: string } }) && 'status' in (err as { status: number }); +}; diff --git a/src/utils/common.ts b/src/utils/common.ts index 7023261..d466074 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,13 +1,5 @@ import { NextResponse } from 'next/server'; -import { CopilotAPI } from './copilotApiUtils'; -import { MeResponse } from '@/types/common'; -import { ApiError } from 'copilot-node-sdk/codegen/api'; - -export async function getCurrentUser(apiToken: string): Promise { - const copilotClient = new CopilotAPI(apiToken); - - return await copilotClient.me(); -} +import { matchesCopilotApiError } from '@/exceptions/copilot'; export function respondError(message: string, status: number = 500) { return NextResponse.json( @@ -24,10 +16,16 @@ export function handleError(error: unknown) { message: 'Something went wrong', status: 500, }; - if (error instanceof ApiError) { + if (matchesCopilotApiError(error)) { + const castedErr = error as { + status: number; + body: { + message: string; + }; + }; apiError = { - message: error.body.message, - status: error.status, + message: castedErr.body.message, + status: castedErr.status, }; } return respondError(apiError.message, apiError.status); From 07cc2ce9a8dc04b629b406789076716b59723a5c Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 8 Apr 2024 08:11:05 +0545 Subject: [PATCH 108/155] refactor: remove CopilotApiError --- src/exceptions/copilot.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/exceptions/copilot.ts b/src/exceptions/copilot.ts index 4cd8022..414846f 100644 --- a/src/exceptions/copilot.ts +++ b/src/exceptions/copilot.ts @@ -1,16 +1,3 @@ -export class CopilotApiError extends Error { - readonly status: number; - readonly body: { - message: string; - }; - - constructor(status: number, message: string) { - super(message); - this.status = status; - this.body = { message }; - } -} - export const matchesCopilotApiError = (err: unknown) => { return 'body' in (err as { body: { message: string } }) && 'status' in (err as { status: number }); }; From 9e4b849124007a4484b8f26695014146f84fc3ec Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 8 Apr 2024 08:17:11 +0545 Subject: [PATCH 109/155] fix: make type check stricter --- src/exceptions/copilot.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/exceptions/copilot.ts b/src/exceptions/copilot.ts index 414846f..4d2fcf3 100644 --- a/src/exceptions/copilot.ts +++ b/src/exceptions/copilot.ts @@ -1,3 +1,8 @@ +// TODO: replace this when copilot exports their ApiError class export const matchesCopilotApiError = (err: unknown) => { - return 'body' in (err as { body: { message: string } }) && 'status' in (err as { status: number }); + return ( + 'body' in (err as { body: { message: string } }) && + 'message' in (err as { body: { message: string } })?.body && + 'status' in (err as { status: number }) + ); }; From 4eebe64854ba584ddebd2bc6634cdd0a1f6958ff Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 11 Apr 2024 10:28:31 +0545 Subject: [PATCH 110/155] refactor: clean typing --- src/exceptions/copilot.ts | 9 ++++++++- src/utils/common.ts | 10 ++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/exceptions/copilot.ts b/src/exceptions/copilot.ts index 4d2fcf3..eea3d9b 100644 --- a/src/exceptions/copilot.ts +++ b/src/exceptions/copilot.ts @@ -1,5 +1,12 @@ // TODO: replace this when copilot exports their ApiError class -export const matchesCopilotApiError = (err: unknown) => { +export declare class CopiltoAPIError { + body: { + message: string; + }; + status: number; +} + +export const matchesCopilotApiError = (err: unknown): err is CopiltoAPIError => { return ( 'body' in (err as { body: { message: string } }) && 'message' in (err as { body: { message: string } })?.body && diff --git a/src/utils/common.ts b/src/utils/common.ts index d466074..5c76c95 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -17,15 +17,9 @@ export function handleError(error: unknown) { status: 500, }; if (matchesCopilotApiError(error)) { - const castedErr = error as { - status: number; - body: { - message: string; - }; - }; apiError = { - message: castedErr.body.message, - status: castedErr.status, + message: error.body.message, + status: error.status, }; } return respondError(apiError.message, apiError.status); From 9643bc88fec537ffda1666fb6c9b48562e05d284 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 15 Apr 2024 13:01:45 +0545 Subject: [PATCH 111/155] chore: turn off exhaustive deps for hooks --- .eslintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..b9f7187 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,4 @@ { - "extends": "next/core-web-vitals" + "extends": "next/core-web-vitals", + "react-hooks/exhaustive-deps": "off" } From d189d6cc129b7d219cc7cb93a83ca6cb2b243047 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 15 Apr 2024 13:04:34 +0545 Subject: [PATCH 112/155] chore: turn off exhaustive deps for hooks --- .eslintrc.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index b9f7187..09937b6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,6 @@ { "extends": "next/core-web-vitals", - "react-hooks/exhaustive-deps": "off" + "rules": { + "react-hooks/exhaustive-deps": "off" + } } From 227459af4953d0c08a360072b2799864316c4c0a Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 6 May 2024 10:24:59 +0545 Subject: [PATCH 113/155] hotfix!: bump up connection limit in hacky way --- prisma/schema.prisma | 46 +++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 6143c99..3314c00 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -6,8 +6,10 @@ generator client { } datasource db { - provider = "postgresql" - url = env("POSTGRES_PRISMA_URL") + provider = "postgresql" + // Vercel won't let us change the POSTGRES_* config so update it with a connection_limit key using a custom env var like + // POSTGRES_PRISMA_URL_HIGHER_CONNECTION_LIMIT="$POSTGRES_PRISMA_URL&connection_limit=20" + url = env("POSTGRES_PRISMA_URL_HIGHER_CONNECTION_LIMIT") directUrl = env("POSTGRES_URL_NON_POOLING") } @@ -17,30 +19,30 @@ enum Permission { } model CustomFieldAccess { - id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid - customFieldId String @db.Uuid - portalId String - permissions Permission[] - createdAt DateTime @default(now()) @db.Timestamptz() - updatedAt DateTime @updatedAt @ignore @db.Timestamptz() + id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid + customFieldId String @db.Uuid + portalId String + permissions Permission[] + createdAt DateTime @default(now()) @db.Timestamptz() + updatedAt DateTime @updatedAt @ignore @db.Timestamptz() } model ClientProfileUpdates { - id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid - clientId String @db.Uuid - companyId String @db.Uuid - portalId String - customFields Json @db.JsonB - changedFields Json @db.JsonB - createdAt DateTime @default(now()) @db.Timestamptz() - wasUpdatedByIU Boolean @default(false) - updatedAt DateTime @updatedAt @ignore @db.Timestamptz() + id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid + clientId String @db.Uuid + companyId String @db.Uuid + portalId String + customFields Json @db.JsonB + changedFields Json @db.JsonB + createdAt DateTime @default(now()) @db.Timestamptz() + wasUpdatedByIU Boolean @default(false) + updatedAt DateTime @updatedAt @ignore @db.Timestamptz() } model Setting { - id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid - portalId String - data Json @db.JsonB - createdAt DateTime @default(now()) @db.Timestamptz() - updatedAt DateTime @updatedAt @ignore @db.Timestamptz() + id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid + portalId String + data Json @db.JsonB + createdAt DateTime @default(now()) @db.Timestamptz() + updatedAt DateTime @updatedAt @ignore @db.Timestamptz() } From 21b0d5c516f20521383f6dc55dc6d495a9f688de Mon Sep 17 00:00:00 2001 From: Sazan Rajbhandari Date: Mon, 9 Sep 2024 16:22:09 +0545 Subject: [PATCH 114/155] Implement Sentry sourcemaps (#29) * chore: include docker-compose file for local * feat: upload sourcemaps to Sentry * chore: add back previous key in next config * fix: remove sentry dns * chore: add reply block --- .gitignore | 3 + docker-compose.yml | 14 + next.config.js | 67 +- package.json | 2 +- sentry.client.config.ts | 43 +- sentry.edge.config.ts | 20 +- sentry.server.config.ts | 21 +- src/instrumentation.ts | 9 + yarn.lock | 1361 +++++++++++++++++++++++++++++++++------ 9 files changed, 1272 insertions(+), 268 deletions(-) create mode 100644 docker-compose.yml create mode 100644 src/instrumentation.ts diff --git a/.gitignore b/.gitignore index d058228..b179259 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ next-env.d.ts # Sentry Config File .sentryclirc + +# Sentry Config File +.env.sentry-build-plugin diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..575a297 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +services: + postgres: + image: postgres:15-alpine + ports: + - $DATABASE_PORT:5432 + environment: + POSTGRES_USER: $DATABASE_USER + POSTGRES_PASSWORD: $DATABASE_PASSWORD + POSTGRES_DB: $DATABASE_NAME + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: diff --git a/next.config.js b/next.config.js index dd719df..dbe04ac 100644 --- a/next.config.js +++ b/next.config.js @@ -16,42 +16,45 @@ module.exports = nextConfig; const { withSentryConfig } = require('@sentry/nextjs'); -module.exports = withSentryConfig( - module.exports, - { - // For all available options, see: - // https://github.com/getsentry/sentry-webpack-plugin#options - - // Suppresses source map uploading logs during build - silent: true, - org: 'copilot-platforms', - project: 'profile-manager', - }, - { - // For all available options, see: - // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ +module.exports = withSentryConfig(module.exports, { + // For all available options, see: + // https://github.com/getsentry/sentry-webpack-plugin#options - // Upload a larger set of source maps for prettier stack traces (increases build time) - widenClientFileUpload: true, + org: 'copilot-platforms', + project: 'profile-manager', - // Transpiles SDK to be compatible with IE11 (increases bundle size) - transpileClientSDK: true, + // Only print logs for uploading source maps in CI + silent: !process.env.CI, - // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. (increases server load) - // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- - // side errors will fail. - tunnelRoute: '/monitoring', + // For all available options, see: + // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ - // Hides source maps from generated client bundles - hideSourceMaps: true, + // Upload a larger set of source maps for prettier stack traces (increases build time) + widenClientFileUpload: true, - // Automatically tree-shake Sentry logger statements to reduce bundle size - disableLogger: true, + // Transpiles SDK to be compatible with IE11 (increases bundle size) + transpileClientSDK: true, - // Enables automatic instrumentation of Vercel Cron Monitors. - // See the following for more information: - // https://docs.sentry.io/product/crons/ - // https://vercel.com/docs/cron-jobs - automaticVercelMonitors: true, + // Automatically annotate React components to show their full name in breadcrumbs and session replay + reactComponentAnnotation: { + enabled: true, }, -); + + // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. + // This can increase your server load as well as your hosting bill. + // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- + // side errors will fail. + tunnelRoute: '/monitoring', + + // Hides source maps from generated client bundles + hideSourceMaps: true, + + // Automatically tree-shake Sentry logger statements to reduce bundle size + disableLogger: true, + + // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) + // See the following for more information: + // https://docs.sentry.io/product/crons/ + // https://vercel.com/docs/cron-jobs + automaticVercelMonitors: true, +}); diff --git a/package.json b/package.json index 4de5ea8..1d2fe25 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@mui/icons-material": "^5.14.5", "@mui/material": "^5.15.4", "@prisma/client": "^5.7.1", - "@sentry/nextjs": "^7.105.0", + "@sentry/nextjs": "^8", "@vercel/postgres": "^0.5.1", "ag-grid-react": "^31.0.2", "copilot-node-sdk": "^2.0.0", diff --git a/sentry.client.config.ts b/sentry.client.config.ts index b3d7775..fee710a 100644 --- a/sentry.client.config.ts +++ b/sentry.client.config.ts @@ -2,30 +2,33 @@ // The config you add here will be used whenever a users loads a page in their browser. // https://docs.sentry.io/platforms/javascript/guides/nextjs/ -import { SentryConfig } from '@/config'; import * as Sentry from '@sentry/nextjs'; -Sentry.init({ - dsn: SentryConfig.DSN, +const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN - // Adjust this value in production, or use tracesSampler for greater control - tracesSampleRate: 1, +if (dsn) { + Sentry.init({ + dsn, - // Setting this option to true will print useful information to the console while you're setting up Sentry. - debug: false, + // Add optional integrations for additional features + integrations: [Sentry.replayIntegration({ + // Additional Replay configuration goes in here, for example: + maskAllText: true, + blockAllMedia: true, + })], - replaysOnErrorSampleRate: 1.0, + // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. + tracesSampleRate: 1, - // This sets the sample rate to be 10%. You may want this to be 100% while - // in development and sample at a lower rate in production - replaysSessionSampleRate: 0.1, + // Define how likely Replay events are sampled. + // This sets the sample rate to be 10%. You may want this to be 100% while + // in development and sample at a lower rate in production + replaysSessionSampleRate: 0.1, - // You can remove this option if you're not planning to use the Sentry Session Replay feature: - // integrations: [ - // Sentry.replayIntegration({ - // Additional Replay configuration goes in here, for example: - // maskAllText: true, - // blockAllMedia: true, - // }), - // ], -}); + // Define how likely Replay events are sampled when an error occurs. + replaysOnErrorSampleRate: 1.0, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + }); +} diff --git a/sentry.edge.config.ts b/sentry.edge.config.ts index 522b187..3de053a 100644 --- a/sentry.edge.config.ts +++ b/sentry.edge.config.ts @@ -3,14 +3,18 @@ // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. // https://docs.sentry.io/platforms/javascript/guides/nextjs/ -import { SentryConfig } from '@/config'; import * as Sentry from '@sentry/nextjs'; -Sentry.init({ - dsn: SentryConfig.DSN, - // Adjust this value in production, or use tracesSampler for greater control - tracesSampleRate: 1, +const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN - // Setting this option to true will print useful information to the console while you're setting up Sentry. - debug: false, -}); +if (dsn) { + Sentry.init({ + dsn, + + // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + }); +} diff --git a/sentry.server.config.ts b/sentry.server.config.ts index a2d7a48..9c0ba15 100644 --- a/sentry.server.config.ts +++ b/sentry.server.config.ts @@ -2,17 +2,18 @@ // The config you add here will be used whenever the server handles a request. // https://docs.sentry.io/platforms/javascript/guides/nextjs/ -import { SentryConfig } from '@/config'; import * as Sentry from '@sentry/nextjs'; -Sentry.init({ - dsn: SentryConfig.DSN, - // Adjust this value in production, or use tracesSampler for greater control - tracesSampleRate: 1, +const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN - // Setting this option to true will print useful information to the console while you're setting up Sentry. - debug: false, +if (dsn) { + Sentry.init({ + dsn, - // uncomment the line below to enable Spotlight (https://spotlightjs.com) - // spotlight: process.env.NODE_ENV === 'development', -}); + // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + }); +} diff --git a/src/instrumentation.ts b/src/instrumentation.ts new file mode 100644 index 0000000..6a02852 --- /dev/null +++ b/src/instrumentation.ts @@ -0,0 +1,9 @@ +export async function register() { + if (process.env.NEXT_RUNTIME === 'nodejs') { + await import('../sentry.server.config'); + } + + if (process.env.NEXT_RUNTIME === 'edge') { + await import('../sentry.edge.config'); + } +} diff --git a/yarn.lock b/yarn.lock index e80df05..3f8cd84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,11 +33,45 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" +"@babel/code-frame@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" + integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== + dependencies: + "@babel/highlight" "^7.24.7" + picocolors "^1.0.0" + "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.3", "@babel/compat-data@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== +"@babel/compat-data@^7.25.2": + version "7.25.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.4.tgz#7d2a80ce229890edcf4cc259d4d696cb4dae2fcb" + integrity sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ== + +"@babel/core@^7.18.5": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" + integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/helper-compilation-targets" "^7.25.2" + "@babel/helper-module-transforms" "^7.25.2" + "@babel/helpers" "^7.25.0" + "@babel/parser" "^7.25.0" + "@babel/template" "^7.25.0" + "@babel/traverse" "^7.25.2" + "@babel/types" "^7.25.2" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/core@^7.21.3": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.9.tgz#b028820718000f267870822fec434820e9b1e4d1" @@ -69,6 +103,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.25.0", "@babel/generator@^7.25.6": + version "7.25.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.6.tgz#0df1ad8cb32fe4d2b01d8bf437f153d19342a87c" + integrity sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw== + dependencies: + "@babel/types" "^7.25.6" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -94,6 +138,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz#e1d9410a90974a3a5a66e84ff55ef62e3c02d06c" + integrity sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw== + dependencies: + "@babel/compat-data" "^7.25.2" + "@babel/helper-validator-option" "^7.24.8" + browserslist "^4.23.1" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.22.15", "@babel/helper-create-class-features-plugin@^7.23.6": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.9.tgz#fddfdf51fca28f23d16b9e3935a4732690acfad6" @@ -163,6 +218,14 @@ dependencies: "@babel/types" "^7.22.15" +"@babel/helper-module-imports@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" + integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" @@ -174,6 +237,16 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" +"@babel/helper-module-transforms@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz#ee713c29768100f2776edf04d4eb23b8d27a66e6" + integrity sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ== + dependencies: + "@babel/helper-module-imports" "^7.24.7" + "@babel/helper-simple-access" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + "@babel/traverse" "^7.25.2" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -211,6 +284,14 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-simple-access@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" + integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" @@ -230,16 +311,31 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" + integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== + "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" + integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== + "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== +"@babel/helper-validator-option@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" + integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== + "@babel/helper-wrap-function@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" @@ -258,6 +354,14 @@ "@babel/traverse" "^7.23.9" "@babel/types" "^7.23.9" +"@babel/helpers@^7.25.0": + version "7.25.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.6.tgz#57ee60141829ba2e102f30711ffe3afab357cc60" + integrity sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q== + dependencies: + "@babel/template" "^7.25.0" + "@babel/types" "^7.25.6" + "@babel/highlight@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" @@ -267,11 +371,28 @@ chalk "^2.4.2" js-tokens "^4.0.0" +"@babel/highlight@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" + integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.7" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/parser@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== +"@babel/parser@^7.25.0", "@babel/parser@^7.25.6": + version "7.25.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.6.tgz#85660c5ef388cbbf6e3d2a694ee97a38f18afe2f" + integrity sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q== + dependencies: + "@babel/types" "^7.25.6" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" @@ -1019,6 +1140,15 @@ "@babel/parser" "^7.23.9" "@babel/types" "^7.23.9" +"@babel/template@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.0.tgz#e733dc3134b4fede528c15bc95e89cb98c52592a" + integrity sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/parser" "^7.25.0" + "@babel/types" "^7.25.0" + "@babel/traverse@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.9.tgz#2f9d6aead6b564669394c5ce0f9302bb65b9d950" @@ -1035,6 +1165,19 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.24.7", "@babel/traverse@^7.25.2": + version "7.25.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.6.tgz#04fad980e444f182ecf1520504941940a90fea41" + integrity sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.6" + "@babel/parser" "^7.25.6" + "@babel/template" "^7.25.0" + "@babel/types" "^7.25.6" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.21.3", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.4", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.4.4": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" @@ -1044,6 +1187,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.24.7", "@babel/types@^7.25.0", "@babel/types@^7.25.2", "@babel/types@^7.25.6": + version "7.25.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.6.tgz#893942ddb858f32ae7a004ec9d3a76b3463ef8e6" + integrity sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw== + dependencies: + "@babel/helper-string-parser" "^7.24.8" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -1236,6 +1388,18 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -1245,6 +1409,15 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" @@ -1255,11 +1428,21 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14": +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@^1.4.15", "@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" @@ -1276,6 +1459,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" @@ -1507,6 +1698,270 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@opentelemetry/api-logs@0.52.1": + version "0.52.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz#52906375da4d64c206b0c4cb8ffa209214654ecc" + integrity sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A== + dependencies: + "@opentelemetry/api" "^1.0.0" + +"@opentelemetry/api-logs@0.53.0": + version "0.53.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz#c478cbd8120ec2547b64edfa03a552cfe42170be" + integrity sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw== + dependencies: + "@opentelemetry/api" "^1.0.0" + +"@opentelemetry/api@^1.0.0", "@opentelemetry/api@^1.8", "@opentelemetry/api@^1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" + integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== + +"@opentelemetry/context-async-hooks@^1.25.1": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.26.0.tgz#fa92f722cf685685334bba95f258d3ef9fce60f6" + integrity sha512-HedpXXYzzbaoutw6DFLWLDket2FwLkLpil4hGCZ1xYEIMTcivdfwEOISgdbLEWyG3HW52gTq2V9mOVJrONgiwg== + +"@opentelemetry/core@1.26.0", "@opentelemetry/core@^1.1.0", "@opentelemetry/core@^1.25.1", "@opentelemetry/core@^1.8.0": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.26.0.tgz#7d84265aaa850ed0ca5813f97d831155be42b328" + integrity sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ== + dependencies: + "@opentelemetry/semantic-conventions" "1.27.0" + +"@opentelemetry/instrumentation-connect@0.39.0": + version "0.39.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.39.0.tgz#32bdbaac464cba061c95df6c850ee81efdd86f8b" + integrity sha512-pGBiKevLq7NNglMgqzmeKczF4XQMTOUOTkK8afRHMZMnrK3fcETyTH7lVaSozwiOM3Ws+SuEmXZT7DYrrhxGlg== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + "@types/connect" "3.4.36" + +"@opentelemetry/instrumentation-express@0.42.0": + version "0.42.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.42.0.tgz#279f195aa66baee2b98623a16666c6229c8e7564" + integrity sha512-YNcy7ZfGnLsVEqGXQPT+S0G1AE46N21ORY7i7yUQyfhGAL4RBjnZUqefMI0NwqIl6nGbr1IpF0rZGoN8Q7x12Q== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-fastify@0.39.0": + version "0.39.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.39.0.tgz#96a040e4944daf77c53a8fe5a128bc3b2568e4aa" + integrity sha512-SS9uSlKcsWZabhBp2szErkeuuBDgxOUlllwkS92dVaWRnMmwysPhcEgHKB8rUe3BHg/GnZC1eo1hbTZv4YhfoA== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-fs@0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.15.0.tgz#41658507860f39fee5209bca961cea8d24ca2a83" + integrity sha512-JWVKdNLpu1skqZQA//jKOcKdJC66TWKqa2FUFq70rKohvaSq47pmXlnabNO+B/BvLfmidfiaN35XakT5RyMl2Q== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.53.0" + +"@opentelemetry/instrumentation-generic-pool@0.39.0": + version "0.39.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.39.0.tgz#2b9af16ad82d5cbe67125c0125753cecd162a728" + integrity sha512-y4v8Y+tSfRB3NNBvHjbjrn7rX/7sdARG7FuK6zR8PGb28CTa0kHpEGCJqvL9L8xkTNvTXo+lM36ajFGUaK1aNw== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + +"@opentelemetry/instrumentation-graphql@0.43.0": + version "0.43.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.43.0.tgz#71bb94ea775c70dbd388c739b397ec1418f3f170" + integrity sha512-aI3YMmC2McGd8KW5du1a2gBA0iOMOGLqg4s9YjzwbjFwjlmMNFSK1P3AIg374GWg823RPUGfVTIgZ/juk9CVOA== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + +"@opentelemetry/instrumentation-hapi@0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.41.0.tgz#de8711907256d8fae1b5faf71fc825cef4a7ddbb" + integrity sha512-jKDrxPNXDByPlYcMdZjNPYCvw0SQJjN+B1A+QH+sx+sAHsKSAf9hwFiJSrI6C4XdOls43V/f/fkp9ITkHhKFbQ== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-http@0.53.0": + version "0.53.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.53.0.tgz#0d806adf1b3aba036bc46e16162e3c0dbb8a6b60" + integrity sha512-H74ErMeDuZfj7KgYCTOFGWF5W9AfaPnqLQQxeFq85+D29wwV2yqHbz2IKLYpkOh7EI6QwDEl7rZCIxjJLyc/CQ== + dependencies: + "@opentelemetry/core" "1.26.0" + "@opentelemetry/instrumentation" "0.53.0" + "@opentelemetry/semantic-conventions" "1.27.0" + semver "^7.5.2" + +"@opentelemetry/instrumentation-ioredis@0.43.0": + version "0.43.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.43.0.tgz#dbadabaeefc4cb47c406f878444f1bcac774fa89" + integrity sha512-i3Dke/LdhZbiUAEImmRG3i7Dimm/BD7t8pDDzwepSvIQ6s2X6FPia7561gw+64w+nx0+G9X14D7rEfaMEmmjig== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/redis-common" "^0.36.2" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-koa@0.43.0": + version "0.43.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.43.0.tgz#963fd192a1b5f6cbae5dabf4ec82e3105cbb23b1" + integrity sha512-lDAhSnmoTIN6ELKmLJBplXzT/Jqs5jGZehuG22EdSMaTwgjMpxMDI1YtlKEhiWPWkrz5LUsd0aOO0ZRc9vn3AQ== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-mongodb@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.47.0.tgz#f8107d878281433905e717f223fb4c0f10356a7b" + integrity sha512-yqyXRx2SulEURjgOQyJzhCECSh5i1uM49NUaq9TqLd6fA7g26OahyJfsr9NE38HFqGRHpi4loyrnfYGdrsoVjQ== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/sdk-metrics" "^1.9.1" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-mongoose@0.42.0": + version "0.42.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.42.0.tgz#375afd21adfcd897a8f521c1ffd2d91e6a428705" + integrity sha512-AnWv+RaR86uG3qNEMwt3plKX1ueRM7AspfszJYVkvkehiicC3bHQA6vWdb6Zvy5HAE14RyFbu9+2hUUjR2NSyg== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-mysql2@0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.41.0.tgz#6377b6e2d2487fd88e1d79aa03658db6c8d51651" + integrity sha512-REQB0x+IzVTpoNgVmy5b+UnH1/mDByrneimP6sbDHkp1j8QOl1HyWOrBH/6YWR0nrbU3l825Em5PlybjT3232g== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + "@opentelemetry/sql-common" "^0.40.1" + +"@opentelemetry/instrumentation-mysql@0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.41.0.tgz#2d50691ead5219774bd36d66c35d5b4681485dd7" + integrity sha512-jnvrV6BsQWyHS2qb2fkfbfSb1R/lmYwqEZITwufuRl37apTopswu9izc0b1CYRp/34tUG/4k/V39PND6eyiNvw== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + "@types/mysql" "2.15.26" + +"@opentelemetry/instrumentation-nestjs-core@0.40.0": + version "0.40.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.40.0.tgz#2c0e6405b56caaec32747d55c57ff9a034668ea8" + integrity sha512-WF1hCUed07vKmf5BzEkL0wSPinqJgH7kGzOjjMAiTGacofNXjb/y4KQ8loj2sNsh5C/NN7s1zxQuCgbWbVTGKg== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation-pg@0.44.0": + version "0.44.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.44.0.tgz#1e97a0aeb2dca068ee23ce75884a0a0063a7ce3f" + integrity sha512-oTWVyzKqXud1BYEGX1loo2o4k4vaU1elr3vPO8NZolrBtFvQ34nx4HgUaexUDuEog00qQt+MLR5gws/p+JXMLQ== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/semantic-conventions" "^1.27.0" + "@opentelemetry/sql-common" "^0.40.1" + "@types/pg" "8.6.1" + "@types/pg-pool" "2.0.6" + +"@opentelemetry/instrumentation-redis-4@0.42.0": + version "0.42.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.42.0.tgz#fc01104cfe884c7546385eaae03c57a47edd19d1" + integrity sha512-NaD+t2JNcOzX/Qa7kMy68JbmoVIV37fT/fJYzLKu2Wwd+0NCxt+K2OOsOakA8GVg8lSpFdbx4V/suzZZ2Pvdjg== + dependencies: + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/redis-common" "^0.36.2" + "@opentelemetry/semantic-conventions" "^1.27.0" + +"@opentelemetry/instrumentation@0.53.0", "@opentelemetry/instrumentation@^0.53.0": + version "0.53.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz#e6369e4015eb5112468a4d45d38dcada7dad892d" + integrity sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A== + dependencies: + "@opentelemetry/api-logs" "0.53.0" + "@types/shimmer" "^1.2.0" + import-in-the-middle "^1.8.1" + require-in-the-middle "^7.1.1" + semver "^7.5.2" + shimmer "^1.2.1" + +"@opentelemetry/instrumentation@^0.46.0": + version "0.46.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.46.0.tgz#a8a252306f82e2eace489312798592a14eb9830e" + integrity sha512-a9TijXZZbk0vI5TGLZl+0kxyFfrXHhX6Svtz7Pp2/VBlCSKrazuULEyoJQrOknJyFWNMEmbbJgOciHCCpQcisw== + dependencies: + "@types/shimmer" "^1.0.2" + import-in-the-middle "1.7.1" + require-in-the-middle "^7.1.1" + semver "^7.5.2" + shimmer "^1.2.1" + +"@opentelemetry/instrumentation@^0.49 || ^0.50 || ^0.51 || ^0.52.0": + version "0.52.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.52.1.tgz#2e7e46a38bd7afbf03cf688c862b0b43418b7f48" + integrity sha512-uXJbYU/5/MBHjMp1FqrILLRuiJCs3Ofk0MeRDk8g1S1gD47U8X3JnSwcMO1rtRo1x1a7zKaQHaoYu49p/4eSKw== + dependencies: + "@opentelemetry/api-logs" "0.52.1" + "@types/shimmer" "^1.0.2" + import-in-the-middle "^1.8.1" + require-in-the-middle "^7.1.1" + semver "^7.5.2" + shimmer "^1.2.1" + +"@opentelemetry/redis-common@^0.36.2": + version "0.36.2" + resolved "https://registry.yarnpkg.com/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz#906ac8e4d804d4109f3ebd5c224ac988276fdc47" + integrity sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g== + +"@opentelemetry/resources@1.26.0", "@opentelemetry/resources@^1.25.1": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.26.0.tgz#da4c7366018bd8add1f3aa9c91c6ac59fd503cef" + integrity sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw== + dependencies: + "@opentelemetry/core" "1.26.0" + "@opentelemetry/semantic-conventions" "1.27.0" + +"@opentelemetry/sdk-metrics@^1.9.1": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz#37bb0afb1d4447f50aab9cdd05db6f2d8b86103e" + integrity sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ== + dependencies: + "@opentelemetry/core" "1.26.0" + "@opentelemetry/resources" "1.26.0" + +"@opentelemetry/sdk-trace-base@^1.22", "@opentelemetry/sdk-trace-base@^1.25.1": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz#0c913bc6d2cfafd901de330e4540952269ae579c" + integrity sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw== + dependencies: + "@opentelemetry/core" "1.26.0" + "@opentelemetry/resources" "1.26.0" + "@opentelemetry/semantic-conventions" "1.27.0" + +"@opentelemetry/semantic-conventions@1.27.0", "@opentelemetry/semantic-conventions@^1.17.0", "@opentelemetry/semantic-conventions@^1.25.1", "@opentelemetry/semantic-conventions@^1.27.0": + version "1.27.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz#1a857dcc95a5ab30122e04417148211e6f945e6c" + integrity sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg== + +"@opentelemetry/sql-common@^0.40.1": + version "0.40.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz#93fbc48d8017449f5b3c3274f2268a08af2b83b6" + integrity sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg== + dependencies: + "@opentelemetry/core" "^1.1.0" + +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@popperjs/core@^2.11.8": version "2.11.8" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" @@ -1553,17 +2008,26 @@ dependencies: "@prisma/debug" "5.8.1" -"@rollup/plugin-commonjs@24.0.0": - version "24.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.0.tgz#fb7cf4a6029f07ec42b25daa535c75b05a43f75c" - integrity sha512-0w0wyykzdyRRPHOb0cQt14mIBLujfAv6GgP6g8nvg/iBxEm112t3YPPq+Buqe2+imvElTka+bjNlJ/gB56TD8g== +"@prisma/instrumentation@5.19.1": + version "5.19.1" + resolved "https://registry.yarnpkg.com/@prisma/instrumentation/-/instrumentation-5.19.1.tgz#146319cf85f22b7a43296f0f40cfeac55516e66e" + integrity sha512-VLnzMQq7CWroL5AeaW0Py2huiNKeoMfCH3SUxstdzPrlWQi6UQ9UrfcbUkNHlVFqOMacqy8X/8YtE0kuKDpD9w== + dependencies: + "@opentelemetry/api" "^1.8" + "@opentelemetry/instrumentation" "^0.49 || ^0.50 || ^0.51 || ^0.52.0" + "@opentelemetry/sdk-trace-base" "^1.22" + +"@rollup/plugin-commonjs@26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-26.0.1.tgz#16d4d6e54fa63021249a292b50f27c0b0f1a30d8" + integrity sha512-UnsKoZK6/aGIH6AdkptXhNvhaqftcjq3zZdT+LY5Ftms6JR06nADcDsYp5hTU9E2lbJUEOhdlY5J4DNTneM+jQ== dependencies: "@rollup/pluginutils" "^5.0.1" commondir "^1.0.1" estree-walker "^2.0.2" - glob "^8.0.3" + glob "^10.4.1" is-reference "1.2.1" - magic-string "^0.27.0" + magic-string "^0.30.3" "@rollup/pluginutils@^5.0.1": version "5.1.0" @@ -1579,156 +2043,246 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz#2d4260033e199b3032a08b41348ac10de21c47e9" integrity sha512-RbhOOTCNoCrbfkRyoXODZp75MlpiHMgbE5MEBZAnnnLyQNgrigEj4p0lzsMDyc1zVsJDLrivB58tgg3emX0eEA== -"@sentry-internal/feedback@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.107.0.tgz#144cf01b1c1739d61db3990519f59b49a356fef1" - integrity sha512-okF0B9AJHrpkwNMxNs/Lffw3N5ZNbGwz4uvCfyOfnMxc7E2VfDM18QzUvTBRvNr3bA9wl+InJ+EMG3aZhyPunA== - dependencies: - "@sentry/core" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - -"@sentry-internal/replay-canvas@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.107.0.tgz#ce2a8f6bf63ab962e696f26b509cfb87aa931302" - integrity sha512-dmDL9g3QDfo7axBOsVnpiKdJ/DXrdeuRv1AqsLgwzJKvItsv0ZizX0u+rj5b1UoxcwbXRMxJ0hit5a1yt3t/ow== - dependencies: - "@sentry/core" "7.107.0" - "@sentry/replay" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - -"@sentry-internal/tracing@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.107.0.tgz#a10b4abcbc9e0d8da948e3a95029574387ca7b16" - integrity sha512-le9wM8+OHBbq7m/8P7JUJ1UhSPIty+Z/HmRXc5Z64ODZcOwFV6TmDpYx729IXDdz36XUKmeI+BeM7yQdTTZPfQ== - dependencies: - "@sentry/core" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - -"@sentry/browser@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.107.0.tgz#a1caf4a3c39857862ba3314b9d4ed03f9259f338" - integrity sha512-KnqaQDhxv6w9dJ+mYLsNwPeGZfgbpM3vaismBNyJCKLgWn2V75kxkSq+bDX8LQT/13AyK7iFp317L6P8EuNa3g== - dependencies: - "@sentry-internal/feedback" "7.107.0" - "@sentry-internal/replay-canvas" "7.107.0" - "@sentry-internal/tracing" "7.107.0" - "@sentry/core" "7.107.0" - "@sentry/replay" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - -"@sentry/cli@^1.77.1": - version "1.77.3" - resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.77.3.tgz#c40b4d09b0878d6565d42a915855add99db4fec3" - integrity sha512-c3eDqcDRmy4TFz2bFU5Y6QatlpoBPPa8cxBooaS4aMQpnIdLYPF1xhyyiW0LQlDUNc3rRjNF7oN5qKoaRoMTQQ== +"@sentry-internal/browser-utils@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-8.29.0.tgz#c84e8d8a08170dbf52968e6b563775949c2ac532" + integrity sha512-6HpyQkaqPvK6Lnigjlarq/LDYgXT2OBNf24RK7z0ipJSxSIpmtelfzHbnwWYnypNDXfTDdPm97fZEenQHryYJA== + dependencies: + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + +"@sentry-internal/feedback@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-8.29.0.tgz#9c562f7d13794131b6ac87860cda5492ed538e37" + integrity sha512-yAL5YMEFk4XaeVRUGEguydahRzaQrNPAaWRv6k+XRzCv9CGBhxb14KXQc9X/penlauMFcDfgelCPKcTqcf6wDw== + dependencies: + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + +"@sentry-internal/replay-canvas@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-8.29.0.tgz#57a08adec35641607b53ea079f7a6ef539e98c00" + integrity sha512-W2YbZRvp2lYC50V51fNLcnoIiK1Km4vSc+v6SL7c//lv2qpyumoUAAIDKY+14s8Lgt1RsR6rfZhfheD4O/6WSQ== + dependencies: + "@sentry-internal/replay" "8.29.0" + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + +"@sentry-internal/replay@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-8.29.0.tgz#d704ad5a137c3dd6fe398e0c9856c4fc043be707" + integrity sha512-Xgv/eYucsm7GaGKms2ClQ02NpD07MxjoTjp1/vYZm0H4Q08dVphVZrQp7hL1oX/VD9mb5SFyyKuuIRqIu7S8RA== + dependencies: + "@sentry-internal/browser-utils" "8.29.0" + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + +"@sentry/babel-plugin-component-annotate@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.3.tgz#de4970d51a54ef52b21f0d6ec49bd06bf37753c1" + integrity sha512-OlHA+i+vnQHRIdry4glpiS/xTOtgjmpXOt6IBOUqynx5Jd/iK1+fj+t8CckqOx9wRacO/hru2wfW/jFq0iViLg== + +"@sentry/browser@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-8.29.0.tgz#d60a754a26c5235fab05fe2e675ced07209aaa88" + integrity sha512-aKTy4H/3RI0q9LIeepesjWGlGNeh4HGFfwQjzHME8gcWCQ5LSlzYX4U+hu2yp7r1Jfd9MUTFfOuuLih2HGLGsQ== + dependencies: + "@sentry-internal/browser-utils" "8.29.0" + "@sentry-internal/feedback" "8.29.0" + "@sentry-internal/replay" "8.29.0" + "@sentry-internal/replay-canvas" "8.29.0" + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + +"@sentry/bundler-plugin-core@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.3.tgz#f8c0a25321216ae9777749c1a4b9d982ae1ec2e1" + integrity sha512-DeoUl0WffcqZZRl5Wy9aHvX4WfZbbWt0QbJ7NJrcEViq+dRAI2FQTYECFLwdZi5Gtb3oyqZICO+P7k8wDnzsjQ== + dependencies: + "@babel/core" "^7.18.5" + "@sentry/babel-plugin-component-annotate" "2.22.3" + "@sentry/cli" "^2.33.1" + dotenv "^16.3.1" + find-up "^5.0.0" + glob "^9.3.2" + magic-string "0.30.8" + unplugin "1.0.1" + +"@sentry/cli-darwin@2.35.0": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.35.0.tgz#4bc9a07690f0de75d930ba47f4655f6465191768" + integrity sha512-dRtDaASkB1ncSbCLMIL8bxki4dPMimSdYz74XOUJ5IvDVVzEInEO7PqvyOj/cyafB+1FSNudaZ90ZRvsNN1Maw== + +"@sentry/cli-linux-arm64@2.35.0": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.35.0.tgz#bad8a45b81d2b317f702991783a503f566b2294e" + integrity sha512-NpyVz2lQWWkMa9GZkt0m4cA/wsgYnWOE6Z+4ePUGjbOIG3Ws9DLaHjYxUUYI79kxfbVCp7wLo1S6kOkj+M1Dlw== + +"@sentry/cli-linux-arm@2.35.0": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.35.0.tgz#dacfc219876f5dce3d8c65dab7128ea3e493f561" + integrity sha512-zNL+/HnepZ4/MkIS8wfoUQxSa+k6r0DSSdX1TpDH5436u+3LB5rfCTBfZ624DWHKMoXX+1dI+rWSi+zL8QFMsg== + +"@sentry/cli-linux-i686@2.35.0": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.35.0.tgz#d0e6401b60b0a4b6c3578998995ba6cb31c1bf20" + integrity sha512-vIYwZVqx+kYZdPsenIm+UqjSCKe9Q2Aof6kzrzW0DPR1WyqIWbWG4NbiugiPTiuA1dLjUjYpGP8wyIqb8hxv4w== + +"@sentry/cli-linux-x64@2.35.0": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.35.0.tgz#a1e8e7bff960ed8916b4cc9c0ef75a057e30f989" + integrity sha512-7Wy5QNt6wZ8EaxEbHqP0DEiyUcXRVItRt9jzhpa2nCaawL+fwDOQCjUkHGsdIC+y14UqA+er9CaPCSp8sA6Vaw== + +"@sentry/cli-win32-i686@2.35.0": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.35.0.tgz#c1b090f7c740c5b22d1019ca48a84f58cd4b2670" + integrity sha512-XDcBUtO5A9elH+xgFNs6NBjkMBnz0sZLo5DU7LE77qKXULnlLeJ63eZD1ukQIRPvxEDsIEPOllRweLuAlUMDtw== + +"@sentry/cli-win32-x64@2.35.0": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.35.0.tgz#f592af483da239be846e556f57f5c6fc7dc1dc54" + integrity sha512-86yHO+31qAXUeAdSCH7MNodn/cn/9xd2fTrxjtfNZWO0pX0jW91sCdomfBxhu5b977cyV9gNcqeBbc9XSIKIIA== + +"@sentry/cli@^2.33.1": + version "2.35.0" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.35.0.tgz#5514eb8f5808bc70707ffa186156f8ff7ca5971e" + integrity sha512-7sHRJViEgHTfEXf+HD1Fb2cwmnxlILmb2NNxghP2vvrgC2PhuwuJU7AX4zg7HjJgxH9HBmnn4AJskDujaJ/6cQ== dependencies: https-proxy-agent "^5.0.0" - mkdirp "^0.5.5" node-fetch "^2.6.7" progress "^2.0.3" proxy-from-env "^1.1.0" which "^2.0.2" - -"@sentry/core@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.107.0.tgz#926838ba2c2861d6bd2bced0232e1f9d1ead6c75" - integrity sha512-C7ogye6+KPyBi8NVL0P8Rxx3Ur7Td8ufnjxosVy678lqY+dcYPk/HONROrzUFYW5fMKWL4/KYnwP+x9uHnkDmw== - dependencies: - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - -"@sentry/integrations@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.107.0.tgz#a46a82be885ef1482197ed7073d7982bd266c09a" - integrity sha512-0h2sZcjcdptS2pju1KSF4+sXaRaFTlmAN1ZokFfmfnVTs6cVtIFttUFxTYrwQUEE2knpAV05pz87zg1yfPAfYg== - dependencies: - "@sentry/core" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - localforage "^1.8.1" - -"@sentry/nextjs@^7.105.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.107.0.tgz#31b85459633d173413430a6a48ad45fffc54db4e" - integrity sha512-cGKntMb/svjHx5xWuLEh4sYMPA75c9gXegVeGeibpLUuD9b+LNeL7GaqxQ9dm2CX+Vza7QvHGBO/u+08abpEQA== - dependencies: - "@rollup/plugin-commonjs" "24.0.0" - "@sentry/core" "7.107.0" - "@sentry/integrations" "7.107.0" - "@sentry/node" "7.107.0" - "@sentry/react" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - "@sentry/vercel-edge" "7.107.0" - "@sentry/webpack-plugin" "1.21.0" + optionalDependencies: + "@sentry/cli-darwin" "2.35.0" + "@sentry/cli-linux-arm" "2.35.0" + "@sentry/cli-linux-arm64" "2.35.0" + "@sentry/cli-linux-i686" "2.35.0" + "@sentry/cli-linux-x64" "2.35.0" + "@sentry/cli-win32-i686" "2.35.0" + "@sentry/cli-win32-x64" "2.35.0" + +"@sentry/core@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.29.0.tgz#52032ece2d7b60f3775f10189c27e26b1cebdbca" + integrity sha512-scMbZaJ0Ov8NPgWn86EdjhyTLrhvRVbTxjg0imJAvhIvRbblH3xyqye/17Qnk2fOp8TNDOl7TBZHi0NCFQ5HUw== + dependencies: + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + +"@sentry/nextjs@^8": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-8.29.0.tgz#7dbfd6c3565d56de87d9325ebf62d116cced9c40" + integrity sha512-Ce7mt07YtIlNc69tEoSingQYRdZW51RgPq5FsXiDOMngHfos/9Y3JrWLFoTOq7RMtRz1/AlhaFinpt9U/qvaPw== + dependencies: + "@opentelemetry/instrumentation-http" "0.53.0" + "@opentelemetry/semantic-conventions" "^1.25.1" + "@rollup/plugin-commonjs" "26.0.1" + "@sentry/core" "8.29.0" + "@sentry/node" "8.29.0" + "@sentry/opentelemetry" "8.29.0" + "@sentry/react" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + "@sentry/vercel-edge" "8.29.0" + "@sentry/webpack-plugin" "2.22.3" chalk "3.0.0" resolve "1.22.8" - rollup "2.78.0" + rollup "3.29.4" stacktrace-parser "^0.1.10" -"@sentry/node@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.107.0.tgz#d60c2e28953f2ba14d12ada9190f1fc577b2b280" - integrity sha512-UZXkG7uThT2YyPW8AOSKRXp1LbVcBHufa4r1XAwBukA2FKO6HHJPjMUgY6DYVQ6k+BmA56CNfVjYrdLbyjBYYA== - dependencies: - "@sentry-internal/tracing" "7.107.0" - "@sentry/core" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - -"@sentry/react@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.107.0.tgz#45feb115383bde7d454e5f816663df34c1c28c39" - integrity sha512-3sXNKcDQjEimxwBPnRkewy3xNLt3KqStMAdDZ/dAF3rviOSVyk80DCQ3P6+HIqeB+IAXqWptg4eSWRA1qNZquA== - dependencies: - "@sentry/browser" "7.107.0" - "@sentry/core" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" +"@sentry/node@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-8.29.0.tgz#6e462b8802356a630c56733dc795a4035464c4ab" + integrity sha512-RCKpWR6DUWmlxtms10MRXwJZRrFt1a2P38FjwEEahcdcK1R6wB8GPf0GO4JnJAiw6oeM0MERSqLIcSLT8+FxtA== + dependencies: + "@opentelemetry/api" "^1.9.0" + "@opentelemetry/context-async-hooks" "^1.25.1" + "@opentelemetry/core" "^1.25.1" + "@opentelemetry/instrumentation" "^0.53.0" + "@opentelemetry/instrumentation-connect" "0.39.0" + "@opentelemetry/instrumentation-express" "0.42.0" + "@opentelemetry/instrumentation-fastify" "0.39.0" + "@opentelemetry/instrumentation-fs" "0.15.0" + "@opentelemetry/instrumentation-generic-pool" "0.39.0" + "@opentelemetry/instrumentation-graphql" "0.43.0" + "@opentelemetry/instrumentation-hapi" "0.41.0" + "@opentelemetry/instrumentation-http" "0.53.0" + "@opentelemetry/instrumentation-ioredis" "0.43.0" + "@opentelemetry/instrumentation-koa" "0.43.0" + "@opentelemetry/instrumentation-mongodb" "0.47.0" + "@opentelemetry/instrumentation-mongoose" "0.42.0" + "@opentelemetry/instrumentation-mysql" "0.41.0" + "@opentelemetry/instrumentation-mysql2" "0.41.0" + "@opentelemetry/instrumentation-nestjs-core" "0.40.0" + "@opentelemetry/instrumentation-pg" "0.44.0" + "@opentelemetry/instrumentation-redis-4" "0.42.0" + "@opentelemetry/resources" "^1.25.1" + "@opentelemetry/sdk-trace-base" "^1.25.1" + "@opentelemetry/semantic-conventions" "^1.25.1" + "@prisma/instrumentation" "5.19.1" + "@sentry/core" "8.29.0" + "@sentry/opentelemetry" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + import-in-the-middle "^1.11.0" + optionalDependencies: + opentelemetry-instrumentation-fetch-node "1.2.3" + +"@sentry/opentelemetry@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/opentelemetry/-/opentelemetry-8.29.0.tgz#6ae54c640155925fc42ac86f37d125f9bb983794" + integrity sha512-MtfjDMUuKFYlyw9hZohp9xnphz+6QosyHb2zCV3e/fANoA53FDxmg/Co7haMohUCiOwwJPytUmSQQaP0nyL2Uw== + dependencies: + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" + +"@sentry/react@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-8.29.0.tgz#f69b87a7947213dcaabdd18bafb6ac818d30f0a2" + integrity sha512-ux+9rNHx2ZyWC94OBb5K1HFQU/v64gL/n3co9e/3cD9nUnqXMJuw/IofiwD1fv6nfdWECLU50A1OtXhA9/c+XQ== + dependencies: + "@sentry/browser" "8.29.0" + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" hoist-non-react-statics "^3.3.2" -"@sentry/replay@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.107.0.tgz#d714f864ef8602e6d009b2fa8ff8e4ef63c3e9e4" - integrity sha512-BNJDEVaEwr/YnV22qnyVA1almx/3p615m3+KaF8lPo7YleYgJGSJv1auH64j1G8INkrJ0J0wFBujb1EFjMYkxA== - dependencies: - "@sentry-internal/tracing" "7.107.0" - "@sentry/core" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" - -"@sentry/types@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.107.0.tgz#5ba4b472be6ccad9aecd58dbc0141a09dafb68c1" - integrity sha512-H7qcPjPSUWHE/Zf5bR1EE24G0pGVuJgrSx8Tvvl5nKEepswMYlbXHRVSDN0gTk/E5Z7cqf+hUBOpkQgZyps77w== +"@sentry/types@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.29.0.tgz#c19e43524b8e7766028f4da8f02eddcc33518541" + integrity sha512-j4gX3ctzgD4xVWllXAhm6M+kHFEvrFoUPFq60X/pgkjsWCocGuhtNfB0rW43ICG8hCnlz8IYl7O7b8V8qY7SPg== -"@sentry/utils@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.107.0.tgz#b8524539d052a40f9c5f34a8347501f0f81a0751" - integrity sha512-C6PbN5gHh73MRHohnReeQ60N8rrLYa9LciHue3Ru2290eSThg4CzsPnx4SzkGpkSeVlhhptKtKZ+hp/ha3iVuw== +"@sentry/utils@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.29.0.tgz#d4a36643369e30ba62ef8f40f149420a100f64bb" + integrity sha512-nb93/m3SjQChQJFqJj3oNW3Rz/12yrT7jypTCire3c2hpYWG2uR5n8VY9UUMTA6HLNvdom6tckK7p3bXGXlF0w== dependencies: - "@sentry/types" "7.107.0" + "@sentry/types" "8.29.0" -"@sentry/vercel-edge@7.107.0": - version "7.107.0" - resolved "https://registry.yarnpkg.com/@sentry/vercel-edge/-/vercel-edge-7.107.0.tgz#90ada052bf3c766a971dc7d64d1473e7482c86f3" - integrity sha512-8p4v0QrMus3lVOwfIfevf/F+GuJnkC/0CIyp69FF7RMHb0zvkCmuXBjuski1AMD5aCL+E3e4MEU73UKA5XNqSA== +"@sentry/vercel-edge@8.29.0": + version "8.29.0" + resolved "https://registry.yarnpkg.com/@sentry/vercel-edge/-/vercel-edge-8.29.0.tgz#3d5e42db56ada63da9aa6922b19953472fe798f5" + integrity sha512-utNt38aX/2v6vgD8Wje29Zfb4injpSJTY7GMIFWYe65oivSRHwieqqlOrZ5B3pCSTSUADsGKK+pexgdxwRIGlA== dependencies: - "@sentry-internal/tracing" "7.107.0" - "@sentry/core" "7.107.0" - "@sentry/types" "7.107.0" - "@sentry/utils" "7.107.0" + "@sentry/core" "8.29.0" + "@sentry/types" "8.29.0" + "@sentry/utils" "8.29.0" -"@sentry/webpack-plugin@1.21.0": - version "1.21.0" - resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.21.0.tgz#bbe7cb293751f80246a4a56f9a7dd6de00f14b58" - integrity sha512-x0PYIMWcsTauqxgl7vWUY6sANl+XGKtx7DCVnnY7aOIIlIna0jChTAPANTfA2QrK+VK+4I/4JxatCEZBnXh3Og== +"@sentry/webpack-plugin@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.22.3.tgz#a9eeb4689c062eb6dc50671c09f06ec6875b9b02" + integrity sha512-Sq1S6bL3nuoTP5typkj+HPjQ13dqftIE8kACAq4tKkXOpWO9bf6HtqcruEQCxMekbWDTdljsrknQ17ZBx2q66Q== dependencies: - "@sentry/cli" "^1.77.1" - webpack-sources "^2.0.0 || ^3.0.0" + "@sentry/bundler-plugin-core" "2.22.3" + unplugin "1.0.1" + uuid "^9.0.0" "@svgr/babel-plugin-add-jsx-attribute@8.0.0": version "8.0.0" @@ -1868,6 +2422,13 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== +"@types/connect@3.4.36": + version "3.4.36" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.36.tgz#e511558c15a39cb29bd5357eebb57bd1459cd1ab" + integrity sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w== + dependencies: + "@types/node" "*" + "@types/estree@*", "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" @@ -1883,6 +2444,13 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/mysql@2.15.26": + version "2.15.26" + resolved "https://registry.yarnpkg.com/@types/mysql/-/mysql-2.15.26.tgz#f0de1484b9e2354d587e7d2bd17a873cc8300836" + integrity sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ== + dependencies: + "@types/node" "*" + "@types/node@*", "@types/node@^20": version "20.11.7" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.7.tgz#cb49aedd758c978c30806d0c38b520ed2a3df6e0" @@ -1895,6 +2463,31 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== +"@types/pg-pool@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/pg-pool/-/pg-pool-2.0.6.tgz#1376d9dc5aec4bb2ec67ce28d7e9858227403c77" + integrity sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ== + dependencies: + "@types/pg" "*" + +"@types/pg@*": + version "8.11.8" + resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.11.8.tgz#bc712f1ad8ca664acb1d321b42691d1a166a88d6" + integrity sha512-IqpCf8/569txXN/HoP5i1LjXfKZWL76Yr2R77xgeIICUbAYHeoaEZFhYHo2uDftecLWrTJUq63JvQu8q3lnDyA== + dependencies: + "@types/node" "*" + pg-protocol "*" + pg-types "^4.0.1" + +"@types/pg@8.6.1": + version "8.6.1" + resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.6.1.tgz#099450b8dc977e8197a44f5229cedef95c8747f9" + integrity sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w== + dependencies: + "@types/node" "*" + pg-protocol "*" + pg-types "^2.2.0" + "@types/pg@8.6.6": version "8.6.6" resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.6.6.tgz#21cdf873a3e345a6e78f394677e3b3b1b543cb80" @@ -1944,6 +2537,11 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff" integrity sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A== +"@types/shimmer@^1.0.2", "@types/shimmer@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.2.0.tgz#9b706af96fa06416828842397a70dfbbf1c14ded" + integrity sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg== + "@typescript-eslint/parser@^5.4.2 || ^6.0.0": version "6.19.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.19.1.tgz#68a87bb21afaf0b1689e9cdce0e6e75bc91ada78" @@ -2005,6 +2603,16 @@ utf-8-validate "6.0.3" ws "8.14.2" +acorn-import-assertions@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" + integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== + +acorn-import-attributes@^1.9.5: + version "1.9.5" + resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" + integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -2020,6 +2628,11 @@ acorn@^8.4.1, acorn@^8.9.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +acorn@^8.8.1, acorn@^8.8.2: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + ag-grid-community@~31.0.3: version "31.0.3" resolved "https://registry.yarnpkg.com/ag-grid-community/-/ag-grid-community-31.0.3.tgz#80870881a3be03aa5df890b4a70409ef5d781e7f" @@ -2074,18 +2687,26 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" -ansi-styles@^6.0.0, ansi-styles@^6.2.1: +ansi-styles@^6.0.0, ansi-styles@^6.1.0, ansi-styles@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -2261,6 +2882,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +binary-extensions@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== + boolbase@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" @@ -2288,6 +2914,13 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" +braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + browserslist@^4.22.2: version "4.22.2" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.2.tgz#704c4943072bd81ea18997f3bd2180e89c77874b" @@ -2298,6 +2931,16 @@ browserslist@^4.22.2: node-releases "^2.0.14" update-browserslist-db "^1.0.13" +browserslist@^4.23.1: + version "4.23.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.3.tgz#debb029d3c93ebc97ffbc8d9cbb03403e227c800" + integrity sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA== + dependencies: + caniuse-lite "^1.0.30001646" + electron-to-chromium "^1.5.4" + node-releases "^2.0.18" + update-browserslist-db "^1.1.0" + buffer-equal-constant-time@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" @@ -2346,6 +2989,11 @@ caniuse-lite@^1.0.30001565, caniuse-lite@^1.0.30001578, caniuse-lite@^1.0.300015 resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001580.tgz#e3c76bc6fe020d9007647044278954ff8cd17d1e" integrity sha512-mtj5ur2FFPZcCEpXFy8ADXbDACuNFXg6mxVDqp7tqooX6l3zwm+d8EPoeOSIFRDvHs8qu7/SLFOGniULkcH2iA== +caniuse-lite@^1.0.30001646: + version "1.0.30001659" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001659.tgz#f370c311ffbc19c4965d8ec0064a3625c8aaa7af" + integrity sha512-Qxxyfv3RdHAfJcXelgf0hU4DFUVXBGTjqrBUZLUh8AtlGnsDo+CnncYtTd95+ZKfnANUOzxyIQCuU/UeBZBYoA== + chalk@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" @@ -2376,6 +3024,26 @@ chalk@^4.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chokidar@^3.5.3: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +cjs-module-lexer@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170" + integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA== + cli-cursor@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" @@ -2505,7 +3173,7 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -2577,6 +3245,13 @@ debug@^3.2.7: dependencies: ms "^2.1.1" +debug@^4.3.5: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + deep-is@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" @@ -2682,6 +3357,16 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" +dotenv@^16.3.1: + version "16.4.5" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== + +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -2694,11 +3379,21 @@ electron-to-chromium@^1.4.601: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.646.tgz#2ed74709d854d5501b32936c9feaaee02c7a9ba5" integrity sha512-vThkQ0JuF45qT/20KbRgM56lV7IuGt7SjhawQ719PDHzhP84KAO1WJoaxgCoAffKHK47FmVKP1Fqizx7CwK1SA== +electron-to-chromium@^1.5.4: + version "1.5.18" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.18.tgz#5fe62b9d21efbcfa26571066502d94f3ed97e495" + integrity sha512-1OfuVACu+zKlmjsNdcJuVQuVE61sZOLbNM4JAQ1Rvh6EOj0/EUKhMJjRH73InPlXSh8HIJk1cVZ8pyOV/FMdUQ== + emoji-regex@^10.3.0: version "10.3.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + emoji-regex@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" @@ -2819,6 +3514,11 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.1.2: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -3107,6 +3807,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + find-root@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -3141,6 +3848,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.3.0.tgz#0ac8644c06e431439f8561db8ecf29a7b5519c77" + integrity sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + fraction.js@^4.3.7: version "4.3.7" resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" @@ -3225,7 +3940,7 @@ get-tsconfig@^4.5.0: dependencies: resolve-pkg-maps "^1.0.0" -glob-parent@^5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -3251,6 +3966,18 @@ glob@7.1.7: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^10.4.1: + version "10.4.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" + integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^7.1.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -3263,16 +3990,15 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^8.0.3: - version "8.1.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" - integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== +glob@^9.3.2: + version "9.3.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.5.tgz#ca2ed8ca452781a3009685607fdf025a899dfe21" + integrity sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q== dependencies: fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^5.0.1" - once "^1.3.0" + minimatch "^8.0.2" + minipass "^4.2.4" + path-scurry "^1.6.1" globals@^11.1.0: version "11.12.0" @@ -3410,11 +4136,6 @@ ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== - import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -3423,6 +4144,26 @@ import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" +import-in-the-middle@1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.7.1.tgz#3e111ff79c639d0bde459bd7ba29dd9fdf357364" + integrity sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg== + dependencies: + acorn "^8.8.2" + acorn-import-assertions "^1.9.0" + cjs-module-lexer "^1.2.2" + module-details-from-path "^1.0.3" + +import-in-the-middle@^1.11.0, import-in-the-middle@^1.8.1: + version "1.11.0" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz#a94c4925b8da18256cde3b3b7b38253e6ca5e708" + integrity sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q== + dependencies: + acorn "^8.8.2" + acorn-import-attributes "^1.9.5" + cjs-module-lexer "^1.2.2" + module-details-from-path "^1.0.3" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -3478,6 +4219,13 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" @@ -3517,6 +4265,11 @@ is-finalizationregistry@^1.0.2: dependencies: call-bind "^1.0.2" +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-fullwidth-code-point@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz#fae3167c729e7463f8461ce512b080a49268aa88" @@ -3536,7 +4289,7 @@ is-generator-function@^1.0.10: dependencies: has-tostringtag "^1.0.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -3672,6 +4425,15 @@ iterator.prototype@^1.1.2: reflect.getprototypeof "^1.0.4" set-function-name "^2.0.1" +jackspeak@^3.1.2: + version "3.4.3" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" + integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -3812,13 +4574,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lie@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== - dependencies: - immediate "~3.0.5" - lilconfig@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.0.0.tgz#f8067feb033b5b74dab4602a5f5029420be749bc" @@ -3857,13 +4612,6 @@ listr2@8.0.0: rfdc "^1.3.0" wrap-ansi "^9.0.0" -localforage@^1.8.1: - version "1.10.0" - resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" - integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== - dependencies: - lie "3.1.1" - locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -3941,6 +4689,11 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -3955,12 +4708,19 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -magic-string@^0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" - integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== +magic-string@0.30.8: + version "0.30.8" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.8.tgz#14e8624246d2bedba70d5462aa99ac9681844613" + integrity sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ== dependencies: - "@jridgewell/sourcemap-codec" "^1.4.13" + "@jridgewell/sourcemap-codec" "^1.4.15" + +magic-string@^0.30.3: + version "0.30.11" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.11.tgz#301a6f93b3e8c2cb13ac1a7a673492c0dfd12954" + integrity sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" make-error@^1.1.1: version "1.3.6" @@ -4019,10 +4779,17 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== +minimatch@^8.0.2: + version "8.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.4.tgz#847c1b25c014d4e9a7f68aaf63dedd668a626229" + integrity sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== dependencies: brace-expansion "^2.0.1" @@ -4031,19 +4798,27 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -mkdirp@^0.5.5: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" +minipass@^4.2.4: + version "4.2.8" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.8.tgz#f0010f64393ecfc1d1ccb5f582bcaf45f48e1a3a" + integrity sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ== + +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + +module-details-from-path@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b" + integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A== ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.1.1: +ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -4134,6 +4909,16 @@ node-releases@^2.0.14: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.18: + version "2.0.18" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" @@ -4223,6 +5008,11 @@ object.values@^1.1.6, object.values@^1.1.7: define-properties "^1.2.0" es-abstract "^1.22.1" +obuf@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" + integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== + once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -4255,6 +5045,14 @@ openapi-typescript-codegen@^0.25.0: handlebars "^4.7.7" json-schema-ref-parser "^9.0.9" +opentelemetry-instrumentation-fetch-node@1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/opentelemetry-instrumentation-fetch-node/-/opentelemetry-instrumentation-fetch-node-1.2.3.tgz#beb24048bdccb1943ba2a5bbadca68020e448ea7" + integrity sha512-Qb11T7KvoCevMaSeuamcLsAD+pZnavkhDnlVL0kRozfhl42dKG5Q3anUklAFKJZjY3twLR+BnRa6DlwwkIE/+A== + dependencies: + "@opentelemetry/instrumentation" "^0.46.0" + "@opentelemetry/semantic-conventions" "^1.17.0" + optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -4281,6 +5079,11 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +package-json-from-dist@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz#e501cd3094b278495eb4258d4c9f6d5ac3019f00" + integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -4323,6 +5126,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.11.1, path-scurry@^1.6.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -4333,6 +5144,11 @@ pg-int8@1.0.1: resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== +pg-numeric@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pg-numeric/-/pg-numeric-1.0.2.tgz#816d9a44026086ae8ae74839acd6a09b0636aa3a" + integrity sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw== + pg-protocol@*: version "1.6.0" resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.6.0.tgz#4c91613c0315349363af2084608db843502f8833" @@ -4349,12 +5165,30 @@ pg-types@^2.2.0: postgres-date "~1.0.4" postgres-interval "^1.1.0" +pg-types@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-4.0.2.tgz#399209a57c326f162461faa870145bb0f918b76d" + integrity sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng== + dependencies: + pg-int8 "1.0.1" + pg-numeric "1.0.2" + postgres-array "~3.0.1" + postgres-bytea "~3.0.0" + postgres-date "~2.1.0" + postgres-interval "^3.0.0" + postgres-range "^1.1.1" + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.3.1: +picocolors@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.0.tgz#5358b76a78cde483ba5cef6a9dc9671440b27d59" + integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -4392,16 +5226,33 @@ postgres-array@~2.0.0: resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== +postgres-array@~3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-3.0.2.tgz#68d6182cb0f7f152a7e60dc6a6889ed74b0a5f98" + integrity sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog== + postgres-bytea@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w== +postgres-bytea@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-3.0.0.tgz#9048dc461ac7ba70a6a42d109221619ecd1cb089" + integrity sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw== + dependencies: + obuf "~1.1.2" + postgres-date@~1.0.4: version "1.0.7" resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== +postgres-date@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-2.1.0.tgz#b85d3c1fb6fb3c6c8db1e9942a13a3bf625189d0" + integrity sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA== + postgres-interval@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" @@ -4409,6 +5260,16 @@ postgres-interval@^1.1.0: dependencies: xtend "^4.0.0" +postgres-interval@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-3.0.0.tgz#baf7a8b3ebab19b7f38f07566c7aab0962f0c86a" + integrity sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw== + +postgres-range@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/postgres-range/-/postgres-range-1.1.4.tgz#a59c5f9520909bcec5e63e8cf913a92e4c952863" + integrity sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -4490,6 +5351,13 @@ react@^18: dependencies: loose-envify "^1.1.0" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + reflect.getprototypeof@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz#aaccbf41aca3821b87bb71d9dcbc7ad0ba50a3f3" @@ -4554,6 +5422,15 @@ regjsparser@^0.9.1: dependencies: jsesc "~0.5.0" +require-in-the-middle@^7.1.1: + version "7.4.0" + resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.4.0.tgz#606977820d4b5f9be75e5a108ce34cfed25b3bb4" + integrity sha512-X34iHADNbNDfr6OTStIAHWSAvvKQRYgLO6duASaVf7J2VA3lvmNYboAHOuLC2huav1IwgZJtyEcJCKVzFxOSMQ== + dependencies: + debug "^4.3.5" + module-details-from-path "^1.0.3" + resolve "^1.22.8" + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -4564,7 +5441,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@1.22.8, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.4: +resolve@1.22.8, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.4, resolve@^1.22.8: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -4607,10 +5484,10 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup@2.78.0: - version "2.78.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.78.0.tgz#00995deae70c0f712ea79ad904d5f6b033209d9e" - integrity sha512-4+YfbQC9QEVvKTanHhIAFVUFSRsezvQF8vFOJwtGfb9Bb+r014S+qryr9PSmw8x6sMnPkmFBGAvIFVQxvJxjtg== +rollup@3.29.4: + version "3.29.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981" + integrity sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw== optionalDependencies: fsevents "~2.3.2" @@ -4657,6 +5534,11 @@ semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== +semver@^7.5.2: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" @@ -4696,6 +5578,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shimmer@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" + integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -4710,7 +5597,7 @@ signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -signal-exit@^4.1.0: +signal-exit@^4.0.1, signal-exit@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== @@ -4776,6 +5663,33 @@ string-argv@0.3.2: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string-width@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.1.0.tgz#d994252935224729ea3719c49f7206dc9c46550a" @@ -4827,14 +5741,21 @@ string.prototype.trimstart@^1.0.7: define-properties "^1.2.0" es-abstract "^1.22.1" -strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" -strip-ansi@^7.1.0: +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== @@ -5093,6 +6014,16 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== +unplugin@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-1.0.1.tgz#83b528b981cdcea1cad422a12cd02e695195ef3f" + integrity sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA== + dependencies: + acorn "^8.8.1" + chokidar "^3.5.3" + webpack-sources "^3.2.3" + webpack-virtual-modules "^0.5.0" + update-browserslist-db@^1.0.13: version "1.0.13" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" @@ -5101,6 +6032,14 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -5120,6 +6059,11 @@ utf-8-validate@6.0.3: dependencies: node-gyp-build "^4.3.0" +uuid@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" @@ -5130,11 +6074,16 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== -"webpack-sources@^2.0.0 || ^3.0.0": +webpack-sources@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== +webpack-virtual-modules@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz#362f14738a56dae107937ab98ea7062e8bdd3b6c" + integrity sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw== + whatwg-fetch@^3.4.1: version "3.6.20" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz#580ce6d791facec91d37c72890995a0b48d31c70" @@ -5210,6 +6159,24 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrap-ansi@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-9.0.0.tgz#1a3dc8b70d85eeb8398ddfb1e4a02cd186e58b3e" From 492d65f0bfd1b928e808c76780e6590583230d3a Mon Sep 17 00:00:00 2001 From: Sazan Rajbhandari Date: Mon, 9 Sep 2024 18:36:31 +0545 Subject: [PATCH 115/155] Debug update history issue (#30) * debug: add logs in update history POST request * fix: add fallback values * fixes --- sentry.client.config.ts | 12 +++++++----- src/app/api/client-profile-updates/route.ts | 8 ++++++-- src/app/manage/views/ManagePageContainer.tsx | 8 ++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/sentry.client.config.ts b/sentry.client.config.ts index fee710a..d90f0c6 100644 --- a/sentry.client.config.ts +++ b/sentry.client.config.ts @@ -11,11 +11,13 @@ if (dsn) { dsn, // Add optional integrations for additional features - integrations: [Sentry.replayIntegration({ - // Additional Replay configuration goes in here, for example: - maskAllText: true, - blockAllMedia: true, - })], + integrations: [ + Sentry.replayIntegration({ + // Additional Replay configuration goes in here, for example: + maskAllText: true, + blockAllMedia: true, + }), + ], // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. tracesSampleRate: 1, diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index dbca9f7..cf7d970 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -35,10 +35,14 @@ export async function POST(request: NextRequest) { const service = new ClientProfileUpdatesService(); + console.log(`Processing profile update for client: ${client}`); + // First, check if the copilot's custom fields and our recent history are in sync for (const key of Object.keys(changedFields)) { - const lastHistory = (await new ClientProfileUpdatesService().getUpdateHistory(key, client.id, new Date()))?.[0] - ?.changedFields?.[key]; + const updateHistory = await new ClientProfileUpdatesService().getUpdateHistory(key, client.id, new Date()); + console.log('Processing updateHistory:', updateHistory); + const lastHistory = updateHistory?.[0]?.changedFields?.[key]; + console.log('Last history:', lastHistory); const areHistoriesEmpty = // Case where both have empty values. Make sure to strict check so we don't consider 0 input as empty history diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index e8c84e5..17fa31d 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -44,7 +44,7 @@ export const ManagePageContainer = ({ return []; } const customFieldObject = allowedFields.find((el: any) => el.key === key); - const selectedValues = customFieldObject.options.filter((el: any) => values.includes(el.key)); + const selectedValues = customFieldObject?.options.filter((el: any) => values.includes(el.key)) || []; return selectedValues; }; @@ -101,7 +101,7 @@ export const ManagePageContainer = ({ const updatedClientData = await client.json(); - setCustomFieldsValue(updatedClientData.data.customFields); + setCustomFieldsValue(updatedClientData.data?.customFields || {}); setCustomFieldAccess(data); @@ -132,7 +132,7 @@ export const ManagePageContainer = ({ {field.name} item.label} - value={profileData && profileData[field.key]} + value={profileData?.[field.key]} getSelectedValue={(value) => { setProfileData((prev: any) => { return { ...prev, [field.key]: value }; From e79eab55e7ab4b63d93614a6724b1c1544b43d99 Mon Sep 17 00:00:00 2001 From: aatbip Date: Tue, 24 Sep 2024 10:46:11 +0545 Subject: [PATCH 116/155] test: 1 --- src/app/api/client-profile-updates/route.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index cf7d970..387b4c8 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -101,6 +101,7 @@ export async function GET(request: NextRequest) { ]); //todo:: filter companyIds based on currentUser restrictions const clientProfileUpdates = await new ClientProfileUpdatesService().findMany(portalId, []); + console.log('clientttt', clientProfileUpdates); const clientLookup = createLookup(clients.data, 'id'); const companyLookup = createMapLookup(companies.data, 'id'); From 1660e1bc2b71141bbd7a8a38d0718c1af7404ad6 Mon Sep 17 00:00:00 2001 From: aatbip Date: Tue, 24 Sep 2024 11:13:16 +0545 Subject: [PATCH 117/155] test: 2 --- sentry.client.config.ts | 2 +- sentry.edge.config.ts | 2 +- sentry.server.config.ts | 2 +- src/app/api/client-profile-updates/route.ts | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sentry.client.config.ts b/sentry.client.config.ts index d90f0c6..e0c9ca8 100644 --- a/sentry.client.config.ts +++ b/sentry.client.config.ts @@ -4,7 +4,7 @@ import * as Sentry from '@sentry/nextjs'; -const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN +const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN; if (dsn) { Sentry.init({ diff --git a/sentry.edge.config.ts b/sentry.edge.config.ts index 3de053a..e27ed53 100644 --- a/sentry.edge.config.ts +++ b/sentry.edge.config.ts @@ -5,7 +5,7 @@ import * as Sentry from '@sentry/nextjs'; -const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN +const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN; if (dsn) { Sentry.init({ diff --git a/sentry.server.config.ts b/sentry.server.config.ts index 9c0ba15..057a37a 100644 --- a/sentry.server.config.ts +++ b/sentry.server.config.ts @@ -4,7 +4,7 @@ import * as Sentry from '@sentry/nextjs'; -const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN +const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN; if (dsn) { Sentry.init({ diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 387b4c8..cabed9f 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -101,17 +101,18 @@ export async function GET(request: NextRequest) { ]); //todo:: filter companyIds based on currentUser restrictions const clientProfileUpdates = await new ClientProfileUpdatesService().findMany(portalId, []); - console.log('clientttt', clientProfileUpdates); const clientLookup = createLookup(clients.data, 'id'); const companyLookup = createMapLookup(companies.data, 'id'); + console.log('client lookup', clientLookup); + console.log('company lookup', companyLookup); const parsedClientProfileUpdates: ParsedClientProfileUpdatesResponse[] = clientProfileUpdates.map((update) => { const client = clientLookup[update.clientId]; const company = companyLookup.get(update.companyId); let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { - id: update.id, + id: update?.id || `${Math.random()}`, client: getClientDetails(client), company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, From edfd42bee3d56df6b61c6842cb3493adbff3f09f Mon Sep 17 00:00:00 2001 From: aatbip Date: Tue, 24 Sep 2024 11:27:23 +0545 Subject: [PATCH 118/155] test: 3 --- src/app/api/client-profile-updates/route.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index cabed9f..f0df4c5 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -104,15 +104,13 @@ export async function GET(request: NextRequest) { const clientLookup = createLookup(clients.data, 'id'); const companyLookup = createMapLookup(companies.data, 'id'); - console.log('client lookup', clientLookup); - console.log('company lookup', companyLookup); const parsedClientProfileUpdates: ParsedClientProfileUpdatesResponse[] = clientProfileUpdates.map((update) => { const client = clientLookup[update.clientId]; const company = companyLookup.get(update.companyId); let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { - id: update?.id || `${Math.random()}`, + id: update?.id, client: getClientDetails(client), company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, @@ -143,10 +141,10 @@ export async function GET(request: NextRequest) { function getClientDetails(client: ClientResponse) { return { - id: client.id, - name: `${client.givenName} ${client.familyName}`, - email: client.email, - avatarImageUrl: client.avatarImageUrl, + id: client?.id, + name: `${client?.givenName} ${client?.familyName}`, + email: client?.email, + avatarImageUrl: client?.avatarImageUrl, }; } From b5e6b481ba9760baca78df4be8c6a17b82ad0194 Mon Sep 17 00:00:00 2001 From: aatbip Date: Tue, 24 Sep 2024 11:30:24 +0545 Subject: [PATCH 119/155] test: 4 --- src/app/api/client-profile-updates/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index f0df4c5..7d62eeb 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -109,9 +109,11 @@ export async function GET(request: NextRequest) { const client = clientLookup[update.clientId]; const company = companyLookup.get(update.companyId); - let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { + let parsedClientProfileUpdate: any = { id: update?.id, - client: getClientDetails(client), + // client: getClientDetails(client), + // company: company ? getCompanyDetails(company) : undefined, + client: client ? getClientDetails(client) : undefined, company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, }; From f3c7ad74b66e39482366916424284c7e7583ecee Mon Sep 17 00:00:00 2001 From: aatbip Date: Tue, 24 Sep 2024 11:37:10 +0545 Subject: [PATCH 120/155] fix: getClientDetails optional undefined return --- src/app/api/client-profile-updates/route.ts | 4 +--- src/types/clientProfileUpdates.ts | 14 ++++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 7d62eeb..9c09c7a 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -109,10 +109,8 @@ export async function GET(request: NextRequest) { const client = clientLookup[update.clientId]; const company = companyLookup.get(update.companyId); - let parsedClientProfileUpdate: any = { + let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { id: update?.id, - // client: getClientDetails(client), - // company: company ? getCompanyDetails(company) : undefined, client: client ? getClientDetails(client) : undefined, company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, diff --git a/src/types/clientProfileUpdates.ts b/src/types/clientProfileUpdates.ts index a51638d..dce7001 100644 --- a/src/types/clientProfileUpdates.ts +++ b/src/types/clientProfileUpdates.ts @@ -36,12 +36,14 @@ export type ClientProfileUpdatesResponse = z.infer Date: Tue, 24 Sep 2024 12:14:25 +0545 Subject: [PATCH 121/155] test: 5 --- src/app/api/client-profile-updates/route.ts | 12 ++++++------ src/types/clientProfileUpdates.ts | 14 ++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 9c09c7a..cf7d970 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -110,8 +110,8 @@ export async function GET(request: NextRequest) { const company = companyLookup.get(update.companyId); let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { - id: update?.id, - client: client ? getClientDetails(client) : undefined, + id: update.id, + client: getClientDetails(client), company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, }; @@ -141,10 +141,10 @@ export async function GET(request: NextRequest) { function getClientDetails(client: ClientResponse) { return { - id: client?.id, - name: `${client?.givenName} ${client?.familyName}`, - email: client?.email, - avatarImageUrl: client?.avatarImageUrl, + id: client.id, + name: `${client.givenName} ${client.familyName}`, + email: client.email, + avatarImageUrl: client.avatarImageUrl, }; } diff --git a/src/types/clientProfileUpdates.ts b/src/types/clientProfileUpdates.ts index dce7001..a51638d 100644 --- a/src/types/clientProfileUpdates.ts +++ b/src/types/clientProfileUpdates.ts @@ -36,14 +36,12 @@ export type ClientProfileUpdatesResponse = z.infer Date: Tue, 24 Sep 2024 12:15:49 +0545 Subject: [PATCH 122/155] test: 6 --- src/app/api/client-profile-updates/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index cf7d970..a4e902d 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -110,7 +110,7 @@ export async function GET(request: NextRequest) { const company = companyLookup.get(update.companyId); let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { - id: update.id, + id: update.id, //update this client: getClientDetails(client), company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, From ee70e746f205fc61053f85c3bc225f5c7b399830 Mon Sep 17 00:00:00 2001 From: aatbip Date: Tue, 24 Sep 2024 12:19:26 +0545 Subject: [PATCH 123/155] fix: optional chaining and strict check --- src/app/api/client-profile-updates/route.ts | 12 ++++++------ src/types/clientProfileUpdates.ts | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index a4e902d..9c09c7a 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -110,8 +110,8 @@ export async function GET(request: NextRequest) { const company = companyLookup.get(update.companyId); let parsedClientProfileUpdate: ParsedClientProfileUpdatesResponse = { - id: update.id, //update this - client: getClientDetails(client), + id: update?.id, + client: client ? getClientDetails(client) : undefined, company: company ? getCompanyDetails(company) : undefined, lastUpdated: update.createdAt, }; @@ -141,10 +141,10 @@ export async function GET(request: NextRequest) { function getClientDetails(client: ClientResponse) { return { - id: client.id, - name: `${client.givenName} ${client.familyName}`, - email: client.email, - avatarImageUrl: client.avatarImageUrl, + id: client?.id, + name: `${client?.givenName} ${client?.familyName}`, + email: client?.email, + avatarImageUrl: client?.avatarImageUrl, }; } diff --git a/src/types/clientProfileUpdates.ts b/src/types/clientProfileUpdates.ts index a51638d..dce7001 100644 --- a/src/types/clientProfileUpdates.ts +++ b/src/types/clientProfileUpdates.ts @@ -36,12 +36,14 @@ export type ClientProfileUpdatesResponse = z.infer Date: Thu, 26 Sep 2024 15:31:19 +0545 Subject: [PATCH 124/155] fix: adds optional chaining --- src/components/table/Table.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 7fbe61b..d8e5bca 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -96,9 +96,9 @@ export const TableCore = () => { const client = params.data[el]; const company = params.data['company']; return { - avatarImageUrl: client.avatarImageUrl, - name: client.name, - email: client.email, + avatarImageUrl: client?.avatarImageUrl, + name: client?.name, + email: client?.email, fallbackColor: company?.fallbackColor || copilotTheme.colors.primary, }; }, From 239b60bca00023d3b61f2839869ea5573bd26906 Mon Sep 17 00:00:00 2001 From: aatbip Date: Tue, 1 Oct 2024 13:55:02 +0545 Subject: [PATCH 125/155] fix: triage issue - undefined reading 0 --- src/components/table/cellRenderers/ClientCellRenderer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/table/cellRenderers/ClientCellRenderer.tsx b/src/components/table/cellRenderers/ClientCellRenderer.tsx index 7cefc25..1ded5cd 100644 --- a/src/components/table/cellRenderers/ClientCellRenderer.tsx +++ b/src/components/table/cellRenderers/ClientCellRenderer.tsx @@ -8,6 +8,8 @@ export const ClientCellRenderer = ({ }) => { const { avatarImageUrl, email, name, fallbackColor } = value; + if (!name) return <>; + return ( {avatarImageUrl ? ( @@ -25,7 +27,7 @@ export const ClientCellRenderer = ({ alignItems: 'center', }} > - {name[0].toUpperCase()} + {name[0]?.toUpperCase()} )} From 7c1ac666fb15691304527b09a8514e8cf2f6f00a Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 14 Nov 2024 15:36:34 +0545 Subject: [PATCH 126/155] fix(OUT-1034): root cause of couldn't find id of undefined - client deletion issue --- src/app/api/client-profile-updates/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 9c09c7a..65048de 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -132,8 +132,10 @@ export async function GET(request: NextRequest) { return parsedClientProfileUpdate; }); - - return NextResponse.json(parsedClientProfileUpdates); + // If any client is deleted in Copilot, we can't fetch the client data for it. + // Filter them out of the array to only show active client profile updates + const activeClientProfileUpdates = parsedClientProfileUpdates.filter((profile) => !!profile.client); + return NextResponse.json(activeClientProfileUpdates); } catch (error) { return handleError(error); } From dcb61c3c7bf1f92627324b043ff5ac4d7801f4dc Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 12 Dec 2024 19:51:26 +0545 Subject: [PATCH 127/155] fix(OUT-983): fix rgbaColor being initially set as undefined --- src/utils/updateColor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/updateColor.ts b/src/utils/updateColor.ts index 1eadb98..211f810 100644 --- a/src/utils/updateColor.ts +++ b/src/utils/updateColor.ts @@ -1,9 +1,9 @@ export function updateColor(rgbaColor: any, newOpacity: number) { // Parse the input RGBA color string const colorRegex = /^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/; - const match = rgbaColor.match(colorRegex); + const match = rgbaColor?.match(colorRegex); - if (!match) { + if (!rgbaColor || !match) { // Invalid input format, return the original color return rgbaColor; } From bdfb7176b55159876b699a0abb0feb3e94079b2c Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 16 Dec 2024 19:03:19 +0545 Subject: [PATCH 128/155] fix(OUT-1157): fix extracting `type` from null --- src/app/api/client-profile-updates/route.ts | 2 ++ src/app/manage/views/ManagePageContainer.tsx | 6 +++--- .../customFieldAccessTable/CustomFieldAccessTable.tsx | 2 +- src/components/table/Table.tsx | 4 ++-- .../table/cellRenderers/HistoryCellRenderer.tsx | 10 +++++----- src/lib/helper.ts | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 65048de..e070066 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -117,6 +117,8 @@ export async function GET(request: NextRequest) { }; portalCustomFields.data?.forEach((portalCustomField) => { + if (!portalCustomField) return; + const value = update.customFields[portalCustomField.key] ?? null; const options = getSelectedOptions(portalCustomField, value || ''); diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index 17fa31d..76d5b90 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -50,7 +50,7 @@ export const ManagePageContainer = ({ }; allowedFields.map((field: any) => { profileData[field.key] = - field.type === 'multiSelect' + field?.type === 'multiSelect' ? [...getSelectedValuesForMultiSelect(field.key)] : customFieldsValue[field.key] || ''; }); @@ -126,7 +126,7 @@ export const ManagePageContainer = ({ > {allowedCustomField && order(allowedCustomField).map((field: any, key: number) => { - if (field.type !== 'multiSelect') { + if (field?.type !== 'multiSelect') { return ( {field.name} @@ -148,7 +148,7 @@ export const ManagePageContainer = ({ ); } - if (field.type === 'multiSelect') { + if (field?.type === 'multiSelect') { return ( {field.name} diff --git a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx index 3b90f41..e39a525 100644 --- a/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx +++ b/src/components/customFieldAccessTable/CustomFieldAccessTable.tsx @@ -74,7 +74,7 @@ export const CustomFieldAccessTable = () => { - {iconsTypeMap[field.type]} + {iconsTypeMap[field?.type]} {field.name} diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index d8e5bca..23b29c8 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -154,11 +154,11 @@ export const TableCore = () => { { field: el, flex: 1, - sortable: col[el].type === 'multiSelect' ? false : true, + sortable: col[el] ? (col[el].type === 'multiSelect' ? false : true) : false, comparator: comparatorTypeII, getQuickFilterText: (params: any) => { const data = params.data[el]; - if (data.type === 'multiSelect') { + if (data?.type === 'multiSelect') { if (data && data.value !== null) { return data.value[0]?.label; } diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index 24049eb..534e007 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -68,7 +68,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string data.value = ''; } - if (data.type === 'multiSelect') { + if (data?.type === 'multiSelect') { return ( {showDot && ( @@ -201,7 +201,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string )} - {data.value} + {data?.value} @@ -227,7 +227,7 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { Update history {updateHistory.map((history: any, key: number) => { - if (history.type === 'multiSelect') { + if (history?.type === 'multiSelect') { return ( @@ -273,8 +273,8 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { • - {history.value.slice(0, 700)} - {history.value.length > 700 ? '...' : ''} + {history?.value.slice(0, 700)} + {history?.value.length > 700 ? '...' : ''} ); diff --git a/src/lib/helper.ts b/src/lib/helper.ts index b9d811f..cdff0d2 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -46,7 +46,7 @@ export function createMapLookup>( export function getSelectedOptions(portalCustomField: CustomField, value: string | string[]) { const options: unknown[] = []; - if (portalCustomField.type === 'multiSelect' && value && Array.isArray(value) && portalCustomField.options) { + if (portalCustomField?.type === 'multiSelect' && value && Array.isArray(value) && portalCustomField.options) { portalCustomField.options.forEach((option) => { if (value.includes(option.key)) { options.push(option); From 2927dd6cc1520904742029f59c118aa902301d9e Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 16 Dec 2024 19:42:21 +0545 Subject: [PATCH 129/155] hotfix(OUT-1153): raise maximum duration of serverless function to prevent connection from closing --- src/app/api/client/route.ts | 2 ++ src/app/api/custom-field-access/route.ts | 2 ++ src/app/api/settings/route.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/app/api/client/route.ts b/src/app/api/client/route.ts index ae8b2a9..96beba9 100644 --- a/src/app/api/client/route.ts +++ b/src/app/api/client/route.ts @@ -3,6 +3,8 @@ import { CopilotAPI } from '@/utils/copilotApiUtils'; import { NextResponse, NextRequest } from 'next/server'; import { z } from 'zod'; +export const maxDuration = 60; + export async function GET(request: NextRequest) { const searchParams = request.nextUrl.searchParams; const clientId = searchParams.get('clientId'); diff --git a/src/app/api/custom-field-access/route.ts b/src/app/api/custom-field-access/route.ts index fb0ddc8..fd8da27 100644 --- a/src/app/api/custom-field-access/route.ts +++ b/src/app/api/custom-field-access/route.ts @@ -5,6 +5,8 @@ import { respondError } from '@/utils/common'; import { CopilotAPI } from '@/utils/copilotApiUtils'; import { z } from 'zod'; +export const maxDuration = 60; + export async function GET(request: NextRequest) { const searchParams = request.nextUrl.searchParams; const token = searchParams.get('token'); diff --git a/src/app/api/settings/route.ts b/src/app/api/settings/route.ts index 35f7142..b3e8aa6 100644 --- a/src/app/api/settings/route.ts +++ b/src/app/api/settings/route.ts @@ -3,6 +3,8 @@ import { SettingRequestSchema } from '@/types/settings'; import { SettingService } from '@/app/api/settings/services/setting.service'; import { respondError } from '@/utils/common'; +export const maxDuration = 60; + export async function PUT(request: NextRequest) { const requestData = await request.json(); const setting = SettingRequestSchema.safeParse(requestData); From a017f8840eed6cb580759c3cc28391b682cca23a Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 16 Dec 2024 19:46:07 +0545 Subject: [PATCH 130/155] hotfix(OUT-1157): fix 500 Internal Server Error on client side due to undefined companyId --- src/types/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/common.ts b/src/types/common.ts index 0002aa7..08ee957 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -16,7 +16,7 @@ export type IUToken = z.infer; export const ClientTokenSchema = z.object({ clientId: z.string(), - companyId: z.string(), + companyId: z.string().optional(), workspaceId: z.string().nullish(), }); export type ClientToken = z.infer; @@ -57,7 +57,7 @@ export const ClientResponseSchema = z.object({ givenName: z.string(), familyName: z.string(), email: z.string(), - companyId: z.string(), + companyId: z.string().optional(), status: z.string(), avatarImageUrl: z.string().nullable(), customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), From f30f33a09c1a2d32bb30de7405251973ef2544ed Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 16 Dec 2024 19:53:59 +0545 Subject: [PATCH 131/155] feat(OUT-1157): make companyId field nullable --- .../20241216140758_make_company_id_optional/migration.sql | 2 ++ prisma/schema.prisma | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 prisma/migrations/20241216140758_make_company_id_optional/migration.sql diff --git a/prisma/migrations/20241216140758_make_company_id_optional/migration.sql b/prisma/migrations/20241216140758_make_company_id_optional/migration.sql new file mode 100644 index 0000000..90c3569 --- /dev/null +++ b/prisma/migrations/20241216140758_make_company_id_optional/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "ClientProfileUpdates" ALTER COLUMN "companyId" DROP NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 3314c00..770005b 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -30,7 +30,7 @@ model CustomFieldAccess { model ClientProfileUpdates { id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid clientId String @db.Uuid - companyId String @db.Uuid + companyId String? @db.Uuid portalId String customFields Json @db.JsonB changedFields Json @db.JsonB From 699c1b66557e866b5965a13906b5a64843c0d961 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 16 Dec 2024 19:54:19 +0545 Subject: [PATCH 132/155] fix(OUT-1157): make companyId optional for ManagePageContainer --- src/app/manage/views/ManagePageContainer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index 76d5b90..9050765 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -20,7 +20,7 @@ export const ManagePageContainer = ({ client: any; token: string; clientId: string; - companyId: string; + companyId?: string; portalId: string; }) => { const [_customFieldAccess, setCustomFieldAccess] = useState(customFieldAccess); @@ -86,10 +86,10 @@ export const ManagePageContainer = ({ method: 'POST', body: JSON.stringify({ token: token, - companyId: companyId, - clientId: clientId, - portalId: portalId, - form: form, + companyId, + clientId, + portalId, + form, }), }); From ba2c6411ac259956d04518b66d694d5d6aeb52d2 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 31 Dec 2024 18:20:39 +0545 Subject: [PATCH 133/155] feat(OUT-1214): show a helpful warning that preview mode is not supported --- src/app/NoPreviewSupport.tsx | 15 +++++++++++++++ src/app/page.tsx | 8 ++++++++ src/utils/copilotApiUtils.ts | 2 +- src/utils/previewMode.ts | 13 +++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/app/NoPreviewSupport.tsx create mode 100644 src/utils/previewMode.ts diff --git a/src/app/NoPreviewSupport.tsx b/src/app/NoPreviewSupport.tsx new file mode 100644 index 0000000..18b2cb1 --- /dev/null +++ b/src/app/NoPreviewSupport.tsx @@ -0,0 +1,15 @@ +import { Box } from '@mui/material'; +import AnnouncementIcon from '@mui/icons-material/Announcement'; + +export const NoPreviewSupport = () => { + return ( + + + + + +
CRM preview is currently not supported for Profile Manager
{' '} +
+
+ ); +}; diff --git a/src/app/page.tsx b/src/app/page.tsx index 51d47b7..c0c4657 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,6 +9,8 @@ import { ContextUpdate } from '@/hoc/ContextUpdate'; import { CopilotAPI } from '@/utils/copilotApiUtils'; import { z } from 'zod'; import InvalidToken from '@/components/atoms/InvalidToken'; +import { getPreviewMode } from '@/utils/previewMode'; +import { NoPreviewSupport } from './NoPreviewSupport'; export const revalidate = 0; @@ -55,6 +57,12 @@ export default async function Home({ searchParams }: { searchParams: { token: st const token = tokenParsed.data; const copilotClient = new CopilotAPI(token); + + const tokenPayload = await copilotClient.getTokenPayload(); + if (getPreviewMode(tokenPayload)) { + return ; + } + const workspace = await copilotClient.getWorkspace(); const { id: portalId } = workspace; diff --git a/src/utils/copilotApiUtils.ts b/src/utils/copilotApiUtils.ts index 26357e6..877cfa4 100644 --- a/src/utils/copilotApiUtils.ts +++ b/src/utils/copilotApiUtils.ts @@ -36,7 +36,7 @@ export class CopilotAPI { return WorkspaceResponseSchema.parse(await this.copilot.retrieveWorkspace()); } - private async getTokenPayload(): Promise { + async getTokenPayload(): Promise { return TokenSchema.parse(await this.copilot.getTokenPayload?.()); } diff --git a/src/utils/previewMode.ts b/src/utils/previewMode.ts new file mode 100644 index 0000000..9e340fc --- /dev/null +++ b/src/utils/previewMode.ts @@ -0,0 +1,13 @@ +import { Token } from '@/types/common'; + +export type PreviewMode = 'client' | 'company' | null; + +export const getPreviewMode = (tokenPayload: Token): PreviewMode => { + const isClientPreview = tokenPayload.internalUserId && tokenPayload.clientId; + // For a company to be alongside IU token, it shouldn't be "default" or undefined + // Older workspaces in Copilot have "default" as companyId, while newer ones have undefined for IUs + const isDefaultCompany = tokenPayload.companyId === 'default'; + const isCompanyPreview = tokenPayload.internalUserId && !isDefaultCompany && !!tokenPayload.companyId; + const previewMode: PreviewMode = isClientPreview ? 'client' : isCompanyPreview ? 'company' : null; + return previewMode; +}; From 91bb75e1c050bfadf9fa8f77fba7791bf4743dd1 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 31 Dec 2024 18:24:26 +0545 Subject: [PATCH 134/155] feat(OUT-1214): add support for NoPreviewSupport --- src/app/manage/page.tsx | 21 ++++++++++++++------- src/app/page.tsx | 5 ----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index f6adc95..76a172f 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -1,13 +1,15 @@ -import { Box, Stack, Typography } from '@mui/material'; -import { ManagePageContainer } from './views/ManagePageContainer'; +import { NoPreviewSupport } from '@/app/NoPreviewSupport'; +import InvalidToken from '@/components/atoms/InvalidToken'; +import RedirectButton from '@/components/atoms/RedirectButton'; import { apiUrl } from '@/config'; -import { CustomAccessField, CustomFieldAccessResponse, ModifiedPermissionAccessField } from '@/types/customFieldAccess'; -import { ProfileLinks } from '@/types/settings'; import { PortalRoutes } from '@/types/copilotPortal'; -import RedirectButton from '@/components/atoms/RedirectButton'; -import { z } from 'zod'; +import { CustomFieldAccessResponse, ModifiedPermissionAccessField } from '@/types/customFieldAccess'; +import { ProfileLinks } from '@/types/settings'; import { CopilotAPI } from '@/utils/copilotApiUtils'; -import InvalidToken from '@/components/atoms/InvalidToken'; +import { getPreviewMode } from '@/utils/previewMode'; +import { Box, Stack, Typography } from '@mui/material'; +import { z } from 'zod'; +import { ManagePageContainer } from './views/ManagePageContainer'; export const revalidate = 0; @@ -60,6 +62,11 @@ export default async function ManagePage({ searchParams }: { searchParams: { tok const copilotClient = new CopilotAPI(token); + const tokenPayload = await copilotClient.getTokenPayload(); + if (getPreviewMode(tokenPayload)) { + return ; + } + const { id: portalId } = await copilotClient.getWorkspace(); const { clientId, companyId } = await copilotClient.getClientTokenPayload(); const [settings, customFieldAccess, client] = await Promise.all([ diff --git a/src/app/page.tsx b/src/app/page.tsx index c0c4657..d1b0d55 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -58,11 +58,6 @@ export default async function Home({ searchParams }: { searchParams: { token: st const token = tokenParsed.data; const copilotClient = new CopilotAPI(token); - const tokenPayload = await copilotClient.getTokenPayload(); - if (getPreviewMode(tokenPayload)) { - return ; - } - const workspace = await copilotClient.getWorkspace(); const { id: portalId } = workspace; From a5ac078f6a175ee9f69b839702c2b11f0e3f9ff6 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 16 Jan 2025 21:02:55 +0545 Subject: [PATCH 135/155] fix: accomodate new address schema for customFields --- src/types/common.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/types/common.ts b/src/types/common.ts index 08ee957..02da2aa 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -60,7 +60,13 @@ export const ClientResponseSchema = z.object({ companyId: z.string().optional(), status: z.string(), avatarImageUrl: z.string().nullable(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullable()).nullish(), + customFields: z + .record( + z.string(), + // Accomodate new address field + z.union([z.string().nullable(), z.array(z.string()).nullable(), z.record(z.string(), z.any()).nullable()]).nullable(), + ) + .nullish(), }); export type ClientResponse = z.infer; From bcb0c6ca931c4121d75d385fa23eb720fd7a4abd Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 16 Jan 2025 22:00:15 +0545 Subject: [PATCH 136/155] feat: hack together address support for IU & client --- src/app/api/client-profile-updates/route.ts | 12 ++++++++++++ src/app/manage/views/ManagePageContainer.tsx | 9 ++++++++- .../cellRenderers/HistoryCellRenderer.tsx | 18 +++++++++++++++++- src/lib/helper.ts | 2 +- src/types/clientProfileUpdates.ts | 6 +++++- src/types/common.ts | 4 +++- 6 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index e070066..3d24450 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -17,7 +17,19 @@ export async function POST(request: NextRequest) { //todo: check access const copilotClient = new CopilotAPI(clientProfileUpdateRequest.data.token); const client: ClientResponse = await copilotClient.getClient(clientProfileUpdateRequest.data.clientId); + + for (const key of Object.keys(clientProfileUpdateRequest.data.form)) { + // Yes, this code sucks. No, I don't have an option right now + // TODO: Cleanup once we support better fields for address + const data = clientProfileUpdateRequest?.data?.form?.[key]; + const addressableData = data as { fullAddress: string }; + if (addressableData?.fullAddress) { + clientProfileUpdateRequest.data.form[key] = addressableData.fullAddress; + } + } + const clientUpdateResponse = await copilotClient.updateClient(clientProfileUpdateRequest.data.clientId, { + // @ts-expect-error temporary support for address type customFields: clientProfileUpdateRequest.data.form, }); // NOTE: If you pass empty string as value to a custom field, that key will be deleted from the copilot api diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index 9050765..89df331 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -127,18 +127,25 @@ export const ManagePageContainer = ({ {allowedCustomField && order(allowedCustomField).map((field: any, key: number) => { if (field?.type !== 'multiSelect') { + let fieldValue = profileData?.[field.key]; + if (field?.key === 'address') { + fieldValue = profileData?.[field.key]?.fullAddress; + } return ( {field.name} { setProfileData((prev: any) => { + if (field.key === 'address') { + return { ...prev, [field.key]: { fullAddress: e.target.value } }; + } return { ...prev, [field.key]: e.target.value }; }); }} diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index 534e007..c858843 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -201,7 +201,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string
)} - {data?.value} + {data?.value.fullAddress ?? data?.value} @@ -267,6 +267,22 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { ); } + if (typeof history?.value === 'object') { + if (history?.value.fullAddress) { + return ( + + + • + + + {history.value.fullAddress} + + + ); + } else { + return <>; + } + } return ( diff --git a/src/lib/helper.ts b/src/lib/helper.ts index cdff0d2..ba7ad31 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -43,7 +43,7 @@ export function createMapLookup>( return result; } -export function getSelectedOptions(portalCustomField: CustomField, value: string | string[]) { +export function getSelectedOptions(portalCustomField: CustomField, value: string | string[] | object) { const options: unknown[] = []; if (portalCustomField?.type === 'multiSelect' && value && Array.isArray(value) && portalCustomField.options) { diff --git a/src/types/clientProfileUpdates.ts b/src/types/clientProfileUpdates.ts index dce7001..dfee707 100644 --- a/src/types/clientProfileUpdates.ts +++ b/src/types/clientProfileUpdates.ts @@ -1,6 +1,10 @@ import { z } from 'zod'; -export const CustomFieldUpdatesSchema = z.record(z.union([z.string(), z.array(z.string())]).nullable()); +export const AddressCustomFieldSchema = z.record(z.string(), z.any()); + +export const CustomFieldUpdatesSchema = z.record( + z.union([z.string(), z.array(z.string()), AddressCustomFieldSchema]).nullable(), +); export type CustomFieldUpdates = z.infer; export const ClientProfileUpdatesRequestSchema = z.object({ diff --git a/src/types/common.ts b/src/types/common.ts index 02da2aa..9574565 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -116,6 +116,8 @@ export const ClientRequestSchema = z.object({ givenName: z.string().optional(), familyName: z.string().optional(), companyId: z.string().uuid().optional(), - customFields: z.record(z.string(), z.union([z.string(), z.array(z.string())]).nullish()).nullish(), + customFields: z + .record(z.string(), z.union([z.string(), z.array(z.string())]).nullish(), z.record(z.string(), z.any())) + .nullish(), }); export type ClientRequest = z.infer; From bbe5642bd501e877b773122261277bc4d59115c0 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 16 Jan 2025 22:15:49 +0545 Subject: [PATCH 137/155] fix: better type safety --- src/components/table/cellRenderers/HistoryCellRenderer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index c858843..568a3b7 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -29,6 +29,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string `/api/profile-update-history?token=${token}&clientId=${clientId}&key=${key}&lastUpdated=${lastUpdated}`, ); const data = await res.json(); + // console.log('data', data); setUpdateHistory(data); setLoading(false); }; @@ -201,7 +202,7 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string )} - {data?.value.fullAddress ?? data?.value} + {typeof data?.value === 'object' ? data?.value.fullAddress || '' : data?.value} @@ -268,7 +269,7 @@ const HistoryList = ({ updateHistory }: { updateHistory: any }) => { ); } if (typeof history?.value === 'object') { - if (history?.value.fullAddress) { + if ('fullAddress' in history?.value) { return ( From bcf85dc9ec08205018434413b58caac8b1a35824 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 16 Jan 2025 22:16:02 +0545 Subject: [PATCH 138/155] refactor: remove console.log --- src/components/table/cellRenderers/HistoryCellRenderer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index 568a3b7..c1b2fad 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -29,7 +29,6 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string `/api/profile-update-history?token=${token}&clientId=${clientId}&key=${key}&lastUpdated=${lastUpdated}`, ); const data = await res.json(); - // console.log('data', data); setUpdateHistory(data); setLoading(false); }; From 95fb41d4344d0cca8d4076906e94c7dda084de65 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Fri, 17 Jan 2025 15:03:53 +0545 Subject: [PATCH 139/155] fix(OUT-1301): fix address value showing up as [object Object] --- src/app/manage/views/ManagePageContainer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/manage/views/ManagePageContainer.tsx b/src/app/manage/views/ManagePageContainer.tsx index 89df331..d1fade5 100644 --- a/src/app/manage/views/ManagePageContainer.tsx +++ b/src/app/manage/views/ManagePageContainer.tsx @@ -128,8 +128,8 @@ export const ManagePageContainer = ({ order(allowedCustomField).map((field: any, key: number) => { if (field?.type !== 'multiSelect') { let fieldValue = profileData?.[field.key]; - if (field?.key === 'address') { - fieldValue = profileData?.[field.key]?.fullAddress; + if (field?.type === 'address') { + fieldValue = fieldValue.fullAddress; } return ( @@ -143,7 +143,7 @@ export const ManagePageContainer = ({ key={key} onChange={(e) => { setProfileData((prev: any) => { - if (field.key === 'address') { + if (field.type === 'address') { return { ...prev, [field.key]: { fullAddress: e.target.value } }; } return { ...prev, [field.key]: e.target.value }; From f95e0150f42ed762fecb14a44a10ac039575b900 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 21 Jan 2025 17:47:05 +0545 Subject: [PATCH 140/155] fix(OUT-1302): account for address being object type for tracking changes --- src/app/api/client-profile-updates/route.ts | 37 ++++++++++++++------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/app/api/client-profile-updates/route.ts b/src/app/api/client-profile-updates/route.ts index 3d24450..f640d49 100644 --- a/src/app/api/client-profile-updates/route.ts +++ b/src/app/api/client-profile-updates/route.ts @@ -63,19 +63,32 @@ export async function POST(request: NextRequest) { if (areHistoriesEmpty) continue; if (client.customFields?.[key] !== lastHistory) { + // Account for address being object type + let isAddressSame = false; + const addressableCustomField = client.customFields?.[key] as { fullAddress: string }; + const addressableLastHistory = lastHistory as { fullAddress: string }; + if ( + addressableCustomField?.fullAddress && + addressableLastHistory.fullAddress && + addressableCustomField.fullAddress === addressableLastHistory.fullAddress + ) { + isAddressSame = true; + } + // If not, fix it. - await service.save({ - clientId: clientProfileUpdateRequest.data.clientId, - companyId: clientProfileUpdateRequest.data.companyId, - portalId: clientProfileUpdateRequest.data.portalId, - customFields: { ...(clientUpdateResponse.customFields ?? {}), [key]: client.customFields?.[key] } as Record< - string, - any - >, - // @ts-expect-error inject key - changedFields: { [key]: client.customFields?.[key] }, - wasUpdatedByIU: true, - }); + !isAddressSame && + (await service.save({ + clientId: clientProfileUpdateRequest.data.clientId, + companyId: clientProfileUpdateRequest.data.companyId, + portalId: clientProfileUpdateRequest.data.portalId, + customFields: { ...(clientUpdateResponse.customFields ?? {}), [key]: client.customFields?.[key] } as Record< + string, + any + >, + // @ts-expect-error inject key + changedFields: { [key]: client.customFields?.[key] }, + wasUpdatedByIU: true, + })); } } await service.save({ From 952884fc8ef1aa9616588158d7780e71abf669f8 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 21 Jan 2025 18:48:07 +0545 Subject: [PATCH 141/155] fix: verbosely stop revalidation when inactive / offline --- src/hoc/ContextUpdate.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hoc/ContextUpdate.tsx b/src/hoc/ContextUpdate.tsx index 8e1ff3d..6e86637 100644 --- a/src/hoc/ContextUpdate.tsx +++ b/src/hoc/ContextUpdate.tsx @@ -22,7 +22,10 @@ export const ContextUpdate = ({ children, access, settings, token, portalId, wor `api/client-profile-updates?token=${token}&portalId=${portalId}`, fetcher, { + // Don't sent requests if tab is inactive refreshInterval: 10000, + refreshWhenHidden: false, + refreshWhenOffline: false, }, ); From 9d0b3703e04839b751fe88ce2b4312e9f7800f24 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 20 Feb 2025 17:09:19 +0545 Subject: [PATCH 142/155] chore(hotfix): remove portalId from searchParams --- src/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index d1b0d55..b335b1f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -48,7 +48,7 @@ async function getSettings({ token, portalId }: { token: string; portalId: strin return data; } -export default async function Home({ searchParams }: { searchParams: { token: string; portalId: string } }) { +export default async function Home({ searchParams }: { searchParams: { token: string } }) { const tokenParsed = z.string().safeParse(searchParams.token); if (!tokenParsed.success) { From 1c93752de7add8b480ef0229c0d8c5fd6755a34d Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Thu, 20 Feb 2025 17:09:49 +0545 Subject: [PATCH 143/155] chore(hotfix): remove portalId from searchParams --- src/app/manage/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/manage/page.tsx b/src/app/manage/page.tsx index 76a172f..5c57f96 100644 --- a/src/app/manage/page.tsx +++ b/src/app/manage/page.tsx @@ -52,7 +52,7 @@ async function getClient(clientId: string, token: string) { return data; } -export default async function ManagePage({ searchParams }: { searchParams: { token: string; portalId: string } }) { +export default async function ManagePage({ searchParams }: { searchParams: { token: string } }) { const tokenParsed = z.string().safeParse(searchParams.token); if (!tokenParsed.success) { return ; From 1445ad64adafcb358760f3182474c3886c71dda6 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 4 Mar 2025 15:14:49 +0545 Subject: [PATCH 144/155] chore(OUT-1493): bump copilot-node-sdk to 3.5.1 (use copilot.app) --- package.json | 5 +- yarn.lock | 306 +++------------------------------------------------ 2 files changed, 18 insertions(+), 293 deletions(-) diff --git a/package.json b/package.json index 1d2fe25..c25b1b8 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@sentry/nextjs": "^8", "@vercel/postgres": "^0.5.1", "ag-grid-react": "^31.0.2", - "copilot-node-sdk": "^2.0.0", + "copilot-node-sdk": "^3.5.1", "next": "^14.1.0", "prisma": "^5.7.1", "react": "^18", @@ -54,5 +54,6 @@ "yarn lint:fix", "yarn prettier:fix" ] - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/yarn.lock b/yarn.lock index 3f8cd84..82f2139 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,16 +15,6 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@apidevtools/json-schema-ref-parser@9.0.9": - version "9.0.9" - resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#d720f9256e3609621280584f2b47ae165359268b" - integrity sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w== - dependencies: - "@jsdevtools/ono" "^7.1.3" - "@types/json-schema" "^7.0.6" - call-me-maybe "^1.0.1" - js-yaml "^4.1.0" - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" @@ -1196,13 +1186,6 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - "@emotion/babel-plugin@^11.11.0": version "11.11.0" resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz#c2d872b6a7767a9d176d007f5b31f7d504bb5d6c" @@ -1418,7 +1401,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== @@ -1443,14 +1426,6 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.22" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" @@ -1467,11 +1442,6 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@jsdevtools/ono@^7.1.3": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" - integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== - "@mui/base@5.0.0-beta.33": version "5.0.0-beta.33" resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-beta.33.tgz#fbb844e2d840d47dd7a48850a03152aed2381d10" @@ -2402,26 +2372,6 @@ resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== -"@tsconfig/node10@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" - integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - "@types/connect@3.4.36": version "3.4.36" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.36.tgz#e511558c15a39cb29bd5357eebb57bd1459cd1ab" @@ -2434,11 +2384,6 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== -"@types/json-schema@^7.0.6": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" @@ -2618,21 +2563,16 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^8.1.1: - version "8.3.2" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" - integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== - -acorn@^8.4.1, acorn@^8.9.0: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== - acorn@^8.8.1, acorn@^8.8.2: version "8.12.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== +acorn@^8.9.0: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== + ag-grid-community@~31.0.3: version "31.0.3" resolved "https://registry.yarnpkg.com/ag-grid-community/-/ag-grid-community-31.0.3.tgz#80870881a3be03aa5df890b4a70409ef5d781e7f" @@ -2707,11 +2647,6 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -2941,11 +2876,6 @@ browserslist@^4.23.1: node-releases "^2.0.18" update-browserslist-db "^1.1.0" -buffer-equal-constant-time@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" - integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== - bufferutil@4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.8.tgz#1de6a71092d65d7766c4d8a522b261a6e787e8ea" @@ -2969,17 +2899,12 @@ call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: get-intrinsic "^1.2.1" set-function-length "^1.1.1" -call-me-maybe@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" - integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^6.2.0, camelcase@^6.3.0: +camelcase@^6.2.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -3098,7 +3023,7 @@ colorette@^2.0.20: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -commander@11.1.0, commander@^11.0.0: +commander@11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== @@ -3128,17 +3053,13 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -copilot-node-sdk@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-2.0.0.tgz#d70af16a552ef8bea42288c446637cb156a615d8" - integrity sha512-9LqBbRxBhMfKJWy3I3ez7GoiQbU7qvbbBrMhRNs+1G09tHsvuZGmGKbFBPiKVwSOnxH83a8GkmO8j09kGb8Hpg== +copilot-node-sdk@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/copilot-node-sdk/-/copilot-node-sdk-3.5.1.tgz#99fb3db7b1f2e0f7574862b9cf5accebc161af3e" + integrity sha512-0qmmJJD0LMnORVxsbhqjtqEJ3f2d8TbY5BYXL2sDiNTi53QDuQuAwQUmHp8DZfqVbaTz9waZhgJMq5zL7c8BmA== dependencies: isomorphic-fetch "^3.0.0" - jsonwebtoken "^9.0.2" next "^14.0.2" - openapi-typescript-codegen "^0.25.0" - ts-node "^10.9.1" - typescript "^5.2.2" core-js-compat@^3.31.0, core-js-compat@^3.34.0: version "3.35.1" @@ -3168,11 +3089,6 @@ cosmiconfig@^8.1.3: parse-json "^5.2.0" path-type "^4.0.0" -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -3285,11 +3201,6 @@ dequal@^2.0.3: resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -3367,13 +3278,6 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ecdsa-sig-formatter@1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" - integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== - dependencies: - safe-buffer "^5.0.1" - electron-to-chromium@^1.4.601: version "1.4.646" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.646.tgz#2ed74709d854d5501b32936c9feaaee02c7a9ba5" @@ -3861,15 +3765,6 @@ fraction.js@^4.3.7: resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== -fs-extra@^11.1.1: - version "11.2.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" - integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -4038,7 +3933,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4: +graceful-fs@^4.2.11, graceful-fs@^4.2.4: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -4048,18 +3943,6 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -handlebars@^4.7.7: - version "4.7.8" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" - integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.2" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -4466,13 +4349,6 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== -json-schema-ref-parser@^9.0.9: - version "9.0.9" - resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#66ea538e7450b12af342fa3d5b8458bc1e1e013f" - integrity sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q== - dependencies: - "@apidevtools/json-schema-ref-parser" "9.0.9" - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -4495,31 +4371,6 @@ json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -jsonwebtoken@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" - integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ== - dependencies: - jws "^3.2.2" - lodash.includes "^4.3.0" - lodash.isboolean "^3.0.3" - lodash.isinteger "^4.0.4" - lodash.isnumber "^3.0.3" - lodash.isplainobject "^4.0.6" - lodash.isstring "^4.0.1" - lodash.once "^4.0.0" - ms "^2.1.1" - semver "^7.5.4" - "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5: version "3.3.5" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" @@ -4530,23 +4381,6 @@ jsonwebtoken@^9.0.2: object.assign "^4.1.4" object.values "^1.1.6" -jwa@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" - integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== - dependencies: - buffer-equal-constant-time "1.0.1" - ecdsa-sig-formatter "1.0.11" - safe-buffer "^5.0.1" - -jws@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" - integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== - dependencies: - jwa "^1.4.1" - safe-buffer "^5.0.1" - keyv@^4.5.3: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" @@ -4624,46 +4458,11 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.includes@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" - integrity sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w== - -lodash.isboolean@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" - integrity sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg== - -lodash.isinteger@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" - integrity sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA== - -lodash.isnumber@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" - integrity sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw== - -lodash.isplainobject@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" - integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA== - -lodash.isstring@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" - integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.once@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" - integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== - log-update@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-6.0.0.tgz#0ddeb7ac6ad658c944c1de902993fce7c33f5e59" @@ -4722,11 +4521,6 @@ magic-string@^0.30.3: dependencies: "@jridgewell/sourcemap-codec" "^1.5.0" -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - mdn-data@2.0.28: version "2.0.28" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.28.tgz#5ec48e7bef120654539069e1ae4ddc81ca490eba" @@ -4793,7 +4587,7 @@ minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" -minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -4833,11 +4627,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -neo-async@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - next@^14.0.2: version "14.1.0" resolved "https://registry.yarnpkg.com/next/-/next-14.1.0.tgz#b31c0261ff9caa6b4a17c5af019ed77387174b69" @@ -5034,17 +4823,6 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" -openapi-typescript-codegen@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/openapi-typescript-codegen/-/openapi-typescript-codegen-0.25.0.tgz#0cb028f54b33b0a63bd9da3756c1c41b4e1a70e2" - integrity sha512-nN/TnIcGbP58qYgwEEy5FrAAjePcYgfMaCe3tsmYyTgI3v4RR9v8os14L+LEWDvV50+CmqiyTzRkKKtJeb6Ybg== - dependencies: - camelcase "^6.3.0" - commander "^11.0.0" - fs-extra "^11.1.1" - handlebars "^4.7.7" - json-schema-ref-parser "^9.0.9" - opentelemetry-instrumentation-fetch-node@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/opentelemetry-instrumentation-fetch-node/-/opentelemetry-instrumentation-fetch-node-1.2.3.tgz#beb24048bdccb1943ba2a5bbadca68020e448ea7" @@ -5508,11 +5286,6 @@ safe-array-concat@^1.0.1: has-symbols "^1.0.3" isarray "^2.0.5" -safe-buffer@^5.0.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-regex-test@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.2.tgz#3ba32bdb3ea35f940ee87e5087c60ee786c3f6c5" @@ -5641,11 +5414,6 @@ source-map@^0.5.7: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - stacktrace-parser@^0.1.10: version "0.1.10" resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" @@ -5866,25 +5634,6 @@ ts-api-utils@^1.0.1: resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== -ts-node@^10.9.1: - version "10.9.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" - integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -5961,16 +5710,11 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" -typescript@^5, typescript@^5.2.2: +typescript@^5: version "5.3.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== -uglify-js@^3.1.4: - version "3.17.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" - integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== - unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" @@ -6009,11 +5753,6 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -universalify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" - integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== - unplugin@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-1.0.1.tgz#83b528b981cdcea1cad422a12cd02e695195ef3f" @@ -6064,11 +5803,6 @@ uuid@^9.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -6154,11 +5888,6 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== - "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -6221,11 +5950,6 @@ yaml@^1.10.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From a620e75cd7051ca63ce61050b2304441c7e28aa8 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 4 Mar 2025 15:15:29 +0545 Subject: [PATCH 145/155] chore(OUT-1493): bump COPILOT_API_URL to use new "app" domain instead of api-beta --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index fccd0a7..bda1d49 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ # # Generate an API key from the copilot dashboard that is usable in profile manager COPILOT_API_KEY= -COPILOT_API_URL="https://api-beta.copilot.com" +COPILOT_API_URL="https://api.copilot.app" # Set as local to work on test tokens, and production to work on valid IU / client tokens COPILOT_ENV="local" From 61931e47201b07d373aa8a9fcabe7c78ea71e736 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Tue, 4 Mar 2025 15:15:48 +0545 Subject: [PATCH 146/155] chore(OUT-1493): change link for profile manager app page --- src/components/table/NoRowsOverlay.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/NoRowsOverlay.tsx b/src/components/table/NoRowsOverlay.tsx index ace9616..dd67a08 100644 --- a/src/components/table/NoRowsOverlay.tsx +++ b/src/components/table/NoRowsOverlay.tsx @@ -28,7 +28,7 @@ const NoRowsOverlay = () => ( From 0926093c568a252b62bec1f27d213e14921468fb Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Mon, 9 Jun 2025 13:16:44 +0545 Subject: [PATCH 147/155] fix(OUT-1809) : history renderer's popover element overflowing to the sidebar - created a ref to track the parent element of Table(AgGridReact) component for getting boundary of the element. - added a modifier in the pooper element to explictly render the popover element in the boundary of the table to prevent overflowing. --- src/components/table/Table.tsx | 8 +++-- .../cellRenderers/HistoryCellRenderer.tsx | 31 ++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index 23b29c8..c568fc2 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -3,7 +3,7 @@ import { AgGridReact } from 'ag-grid-react'; import 'ag-grid-community/styles/ag-grid.css'; // Core CSS import 'ag-grid-community/styles/ag-theme-quartz.css'; // Theme import './table.css'; -import { useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { ClientCellRenderer } from './cellRenderers/ClientCellRenderer'; import { CompanyCellRenderer } from './cellRenderers/CompanyCellRenderer'; import { HistoryCellRenderer } from './cellRenderers/HistoryCellRenderer'; @@ -57,7 +57,7 @@ export const TableCore = () => { return stringA.localeCompare(stringB); } }; - + const tableRef = useRef(null); useEffect(() => { setRowData(appState?.clientProfileUpdates); @@ -177,6 +177,9 @@ export const TableCore = () => { key: el, }; }, + cellRendererParams: { + tableRef: tableRef, + }, }, ]; }); @@ -194,6 +197,7 @@ export const TableCore = () => { return ( { +export const HistoryCellRenderer = ({ value, tableRef }: { value: { row: any; key: string }; tableRef: any }) => { const appState = useAppState(); - const [loading, setLoading] = useState(false); const [updateHistory, setUpdateHistory] = useState([]); @@ -132,10 +131,34 @@ export const HistoryCellRenderer = ({ value }: { value: { row: any; key: string ) : ( <> )} - + {loading ? : } - + ({ From 33a99efae7a1d8209a72639bcb21e48b3e52b744 Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Mon, 9 Jun 2025 13:23:18 +0545 Subject: [PATCH 148/155] fix(OUT-1809) : used appropriate type for tableRef prop in HistoryCellRenderer --- .../table/cellRenderers/HistoryCellRenderer.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/table/cellRenderers/HistoryCellRenderer.tsx b/src/components/table/cellRenderers/HistoryCellRenderer.tsx index a214539..9003575 100644 --- a/src/components/table/cellRenderers/HistoryCellRenderer.tsx +++ b/src/components/table/cellRenderers/HistoryCellRenderer.tsx @@ -4,7 +4,13 @@ import { FiberManualRecord } from '@mui/icons-material'; import { Box, CircularProgress, Popper, Stack, Typography } from '@mui/material'; import React, { useState } from 'react'; -export const HistoryCellRenderer = ({ value, tableRef }: { value: { row: any; key: string }; tableRef: any }) => { +export const HistoryCellRenderer = ({ + value, + tableRef, +}: { + value: { row: any; key: string }; + tableRef: React.RefObject; +}) => { const appState = useAppState(); const [loading, setLoading] = useState(false); From 119f51b954245a76d246a2574e9d24cc931f4be9 Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari <59971845+rrojan@users.noreply.github.com> Date: Tue, 10 Jun 2025 11:56:52 +0545 Subject: [PATCH 149/155] fix(OUT-1763): fix timeouts and max_file_descriptor limit issues (#49) --- prisma/schema.prisma | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 770005b..f0e3463 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -6,11 +6,13 @@ generator client { } datasource db { - provider = "postgresql" + provider = "postgresql" // Vercel won't let us change the POSTGRES_* config so update it with a connection_limit key using a custom env var like // POSTGRES_PRISMA_URL_HIGHER_CONNECTION_LIMIT="$POSTGRES_PRISMA_URL&connection_limit=20" - url = env("POSTGRES_PRISMA_URL_HIGHER_CONNECTION_LIMIT") - directUrl = env("POSTGRES_URL_NON_POOLING") + url = env("POSTGRES_PRISMA_URL_HIGHER_CONNECTION_LIMIT") + directUrl = env("POSTGRES_URL_NON_POOLING") + // Emulates relationships in Prisma client itself. Better for serverless databases like neon or planetscale + relationMode = "prisma" } enum Permission { From 44e067e8c9fc7575b69bfcea65599b4eb5261812 Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Wed, 20 Aug 2025 17:16:18 +0545 Subject: [PATCH 150/155] feat(OUT-2227): added support for custom client/company labels in table headers --- src/components/table/Table.tsx | 6 +++--- src/types/common.ts | 9 +++++++++ src/utils/getWorkspaceLabels.ts | 22 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 src/utils/getWorkspaceLabels.ts diff --git a/src/components/table/Table.tsx b/src/components/table/Table.tsx index c568fc2..5b32048 100644 --- a/src/components/table/Table.tsx +++ b/src/components/table/Table.tsx @@ -14,10 +14,10 @@ import { order } from '@/utils/orderable'; import copilotTheme from '@/utils/copilotTheme'; import NoRowsOverlay from './NoRowsOverlay'; import Loading from '@/app/loading'; +import { getWorkspaceLabels } from '@/utils/getWorkspaceLabels'; export const TableCore = () => { const appState = useAppState(); - // Row Data: The data to be displayed. const [rowData, setRowData] = useState([]); // @@ -80,7 +80,7 @@ export const TableCore = () => { colDefs = [ ...colDefs, { - field: 'client', + field: getWorkspaceLabels(appState?.workspace).individualTerm, cellRenderer: ClientCellRenderer, flex: 1, comparator: comparatorTypeI, @@ -110,7 +110,7 @@ export const TableCore = () => { colDefs = [ ...colDefs, { - field: 'company', + field: getWorkspaceLabels(appState?.workspace).groupTerm, cellRenderer: CompanyCellRenderer, flex: 1, comparator: comparatorTypeI, diff --git a/src/types/common.ts b/src/types/common.ts index 9574565..9418ea8 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -34,6 +34,15 @@ export type MeResponse = z.infer; export const WorkspaceResponseSchema = z.object({ id: z.string(), isCompaniesEnabled: z.boolean().optional(), + label: z + .object({ + individualTerm: z.string().optional(), + individualTermPlural: z.string().optional(), + groupTerm: z.string().optional(), + groupTermPlural: z.string().optional(), + }) + .optional(), + // For future use // industry: z.string().optional(), // isClientDirectSignUpEnabled: z.boolean().optional(), diff --git a/src/utils/getWorkspaceLabels.ts b/src/utils/getWorkspaceLabels.ts new file mode 100644 index 0000000..7e90bd8 --- /dev/null +++ b/src/utils/getWorkspaceLabels.ts @@ -0,0 +1,22 @@ +import { WorkspaceResponse } from '@/types/common'; + +export const getWorkspaceLabels = (workspace?: WorkspaceResponse, shouldCapitalize?: boolean) => { + const capitalize = (str?: string) => (str ? str.charAt(0).toUpperCase() + str.slice(1) : str); + const labels = shouldCapitalize + ? { + individualTerm: workspace?.label?.individualTerm ? capitalize(workspace.label.individualTerm) : 'Client', + individualTermPlural: workspace?.label?.individualTermPlural + ? capitalize(workspace.label.individualTermPlural) + : 'Clients', + groupTerm: workspace?.label?.groupTerm ? capitalize(workspace.label.groupTerm) : 'Company', + groupTermPlural: workspace?.label?.groupTermPlural ? capitalize(workspace.label.groupTermPlural) : 'Companies', + } + : { + individualTerm: workspace?.label?.individualTerm ? workspace.label.individualTerm : 'client', + individualTermPlural: workspace?.label?.individualTermPlural ? workspace.label.individualTermPlural : 'clients', + groupTerm: workspace?.label?.groupTerm ? workspace.label.groupTerm : 'company', + groupTermPlural: workspace?.label?.groupTermPlural ? workspace.label.groupTermPlural : 'companies', + }; //clean this when we are making workspace's label field non-optional. + + return labels; +}; From d024412bf5ed799126557c7623a5e6991d573eee Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Fri, 22 Aug 2025 14:21:20 +0545 Subject: [PATCH 151/155] fix(OUT-2227): response key in workspace schema changed from label to labels --- src/types/common.ts | 2 +- src/utils/getWorkspaceLabels.ts | 34 +++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/types/common.ts b/src/types/common.ts index 9418ea8..3764672 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -34,7 +34,7 @@ export type MeResponse = z.infer; export const WorkspaceResponseSchema = z.object({ id: z.string(), isCompaniesEnabled: z.boolean().optional(), - label: z + labels: z .object({ individualTerm: z.string().optional(), individualTermPlural: z.string().optional(), diff --git a/src/utils/getWorkspaceLabels.ts b/src/utils/getWorkspaceLabels.ts index 7e90bd8..b4c4e9f 100644 --- a/src/utils/getWorkspaceLabels.ts +++ b/src/utils/getWorkspaceLabels.ts @@ -1,22 +1,32 @@ import { WorkspaceResponse } from '@/types/common'; -export const getWorkspaceLabels = (workspace?: WorkspaceResponse, shouldCapitalize?: boolean) => { - const capitalize = (str?: string) => (str ? str.charAt(0).toUpperCase() + str.slice(1) : str); +type WorkspaceLabels = { + individualTerm: string; + individualTermPlural: string; + groupTerm: string; + groupTermPlural: string; +}; + +export const getWorkspaceLabels = (workspace?: WorkspaceResponse, shouldCapitalize?: boolean): WorkspaceLabels => { + const capitalize = (str?: string): string => (str ? str.charAt(0).toUpperCase() + str.slice(1) : ''); + const deCapitalize = (str?: string): string => (str ? str.charAt(0).toLowerCase() + str.slice(1) : ''); const labels = shouldCapitalize ? { - individualTerm: workspace?.label?.individualTerm ? capitalize(workspace.label.individualTerm) : 'Client', - individualTermPlural: workspace?.label?.individualTermPlural - ? capitalize(workspace.label.individualTermPlural) + individualTerm: workspace?.labels?.individualTerm ? capitalize(workspace.labels.individualTerm) : 'Client', + individualTermPlural: workspace?.labels?.individualTermPlural + ? capitalize(workspace.labels.individualTermPlural) : 'Clients', - groupTerm: workspace?.label?.groupTerm ? capitalize(workspace.label.groupTerm) : 'Company', - groupTermPlural: workspace?.label?.groupTermPlural ? capitalize(workspace.label.groupTermPlural) : 'Companies', + groupTerm: workspace?.labels?.groupTerm ? capitalize(workspace.labels.groupTerm) : 'Company', + groupTermPlural: workspace?.labels?.groupTermPlural ? capitalize(workspace.labels.groupTermPlural) : 'Companies', } : { - individualTerm: workspace?.label?.individualTerm ? workspace.label.individualTerm : 'client', - individualTermPlural: workspace?.label?.individualTermPlural ? workspace.label.individualTermPlural : 'clients', - groupTerm: workspace?.label?.groupTerm ? workspace.label.groupTerm : 'company', - groupTermPlural: workspace?.label?.groupTermPlural ? workspace.label.groupTermPlural : 'companies', - }; //clean this when we are making workspace's label field non-optional. + individualTerm: workspace?.labels?.individualTerm ? deCapitalize(workspace.labels.individualTerm) : 'client', + individualTermPlural: workspace?.labels?.individualTermPlural + ? deCapitalize(workspace.labels.individualTermPlural) + : 'clients', + groupTerm: workspace?.labels?.groupTerm ? deCapitalize(workspace.labels.groupTerm) : 'company', + groupTermPlural: workspace?.labels?.groupTermPlural ? deCapitalize(workspace.labels.groupTermPlural) : 'companies', + }; return labels; }; From af6aa41cc04a8efdd5bcf0037e9fee01a6ce8e61 Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Mon, 25 Aug 2025 17:41:57 +0545 Subject: [PATCH 152/155] fix(OUT-2227): cleanup getWorkspaceLabel util --- src/utils/getWorkspaceLabels.ts | 35 +++++++++++++-------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/src/utils/getWorkspaceLabels.ts b/src/utils/getWorkspaceLabels.ts index b4c4e9f..312a0ea 100644 --- a/src/utils/getWorkspaceLabels.ts +++ b/src/utils/getWorkspaceLabels.ts @@ -7,26 +7,19 @@ type WorkspaceLabels = { groupTermPlural: string; }; -export const getWorkspaceLabels = (workspace?: WorkspaceResponse, shouldCapitalize?: boolean): WorkspaceLabels => { - const capitalize = (str?: string): string => (str ? str.charAt(0).toUpperCase() + str.slice(1) : ''); - const deCapitalize = (str?: string): string => (str ? str.charAt(0).toLowerCase() + str.slice(1) : ''); - const labels = shouldCapitalize - ? { - individualTerm: workspace?.labels?.individualTerm ? capitalize(workspace.labels.individualTerm) : 'Client', - individualTermPlural: workspace?.labels?.individualTermPlural - ? capitalize(workspace.labels.individualTermPlural) - : 'Clients', - groupTerm: workspace?.labels?.groupTerm ? capitalize(workspace.labels.groupTerm) : 'Company', - groupTermPlural: workspace?.labels?.groupTermPlural ? capitalize(workspace.labels.groupTermPlural) : 'Companies', - } - : { - individualTerm: workspace?.labels?.individualTerm ? deCapitalize(workspace.labels.individualTerm) : 'client', - individualTermPlural: workspace?.labels?.individualTermPlural - ? deCapitalize(workspace.labels.individualTermPlural) - : 'clients', - groupTerm: workspace?.labels?.groupTerm ? deCapitalize(workspace.labels.groupTerm) : 'company', - groupTermPlural: workspace?.labels?.groupTermPlural ? deCapitalize(workspace.labels.groupTermPlural) : 'companies', - }; +export const getWorkspaceLabels = (workspace?: WorkspaceResponse, shouldCapitalize: boolean = false): WorkspaceLabels => { + const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1); + const deCapitalize = (str: string) => str.charAt(0).toLowerCase() + str.slice(1); - return labels; + const format = (value: string | undefined, fallback: string) => { + if (!value) return shouldCapitalize ? capitalize(fallback) : deCapitalize(fallback); + return shouldCapitalize ? capitalize(value) : deCapitalize(value); + }; + + return { + individualTerm: format(workspace?.labels?.individualTerm, 'client'), + individualTermPlural: format(workspace?.labels?.individualTermPlural, 'clients'), + groupTerm: format(workspace?.labels?.groupTerm, 'company'), + groupTermPlural: format(workspace?.labels?.groupTermPlural, 'companies'), + }; }; From 4589daf61d268be60e4ca0c47964bb550205d05d Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Wed, 27 Aug 2025 17:15:22 +0545 Subject: [PATCH 153/155] fix(label-fix): custom label used in filter bar --- src/layouts/Header.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layouts/Header.tsx b/src/layouts/Header.tsx index cbcb1a5..5f31ee1 100644 --- a/src/layouts/Header.tsx +++ b/src/layouts/Header.tsx @@ -1,6 +1,7 @@ import SearchBar from '@/components/searchBar/SearchBar'; import { Toggle } from '@/components/toggle/Toggle'; import { useAppState } from '@/hooks/useAppState'; +import { getWorkspaceLabels } from '@/utils/getWorkspaceLabels'; import { Stack, Typography } from '@mui/material'; export const Header = () => { @@ -17,7 +18,7 @@ export const Header = () => { })} > - Client profile updates + {getWorkspaceLabels(appState?.workspace, true).individualTerm} profile updates Date: Mon, 22 Sep 2025 19:55:20 +0545 Subject: [PATCH 154/155] chore(OUT-2395): change branding from Copilot to Assembly --- README.md | 2 +- src/app/layout.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 827dd22..5269b15 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -## Copilot profile manager +## Assembly profile manager diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6c914b8..5cec5b0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -9,8 +9,8 @@ import { Footer } from '@/layouts/Footer'; const inter = Inter({ subsets: ['latin'] }); export const metadata: Metadata = { - title: 'Profile Manager App', - description: 'Copilot Profile Manager App', + title: 'Profile Manager', + description: 'Assembly Profile Manager App', }; export default function RootLayout({ children }: { children: React.ReactNode }) { From 2ffb99255032ca24485ffa1a2cdc1a316688a9eb Mon Sep 17 00:00:00 2001 From: Rojan Rajbhandari Date: Mon, 11 Aug 2025 16:58:35 +0545 Subject: [PATCH 155/155] chore(OUT-2147): bump CI node-version to 20 --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 31fab0a..da69e3b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 cache: yarn cache-dependency-path: './yarn.lock'