From b0a3ba96f7fc5f27744c908db252614049a583bb Mon Sep 17 00:00:00 2001 From: nael Date: Sat, 22 Jun 2024 15:22:24 +0200 Subject: [PATCH] :sparkles: New features --- .../src/app/(Dashboard)/b2c/profile/page.tsx | 4 +- .../Configuration/Catalog/CatalogWidget.tsx | 6 +- .../Connector/ConnectorDisplay.tsx | 18 +- .../Configuration/Connector/ConnectorList.tsx | 6 +- .../components/Connection/ConnectionTable.tsx | 2 +- .../src/components/Connection/columns.tsx | 125 ++- .../src/components/Events/EventsTable.tsx | 2 +- .../src/components/RootLayout/index.tsx | 1 - .../shared/api-data-table-pagination.tsx | 10 +- .../shared/data-table-pagination.tsx | 6 +- .../src/components/shared/data-table.tsx | 2 +- apps/client-ts/src/hooks/get/useEvents.tsx | 4 +- .../src/hooks/get/useQueryPagination.tsx | 16 +- apps/client-ts/src/lib/types.ts | 2 +- docker-compose.dev.yml | 157 +-- docker-compose.source.yml | 30 +- docker-compose.yml | 30 +- docs/api-reference/pagination.mdx | 2 +- .../api/src/@core/connections/@utils/index.ts | 13 +- .../api/src/@core/connections/@utils/types.ts | 25 + .../services/accounting.connection.service.ts | 39 +- .../services/freeagent/freeagent.service.ts | 46 +- .../services/freshbooks/freshbooks.service.ts | 46 +- .../services/moneybird/moneybird.service.ts | 46 +- .../services/pennylane/pennylane.service.ts | 46 +- .../services/quickbooks/quickbooks.service.ts | 46 +- .../accounting/services/sage/sage.service.ts | 44 +- .../wave_financial/wave_financial.service.ts | 53 +- .../accounting/services/xero/xero.service.ts | 46 +- .../connections/accounting/types/index.ts | 16 +- .../connections/ats/ats.connection.module.ts | 39 + .../ats/services/ashby/ashby.service.ts | 84 ++ .../ats/services/ats.connection.service.ts | 98 ++ .../ats/services/bamboohr/bamboohr.service.ts | 161 +++ .../services/greenhouse/greenhouse.service.ts | 193 ++++ .../ats/services/jobadder/jobadder.service.ts | 191 ++++ .../ats/services/lever/lever.service.ts | 189 ++++ .../ats/services/registry.service.ts | 25 + .../ats/services/workday/workday.service.ts | 91 ++ .../src/@core/connections/ats/types/index.ts | 7 + .../connections/connections.controller.ts | 242 +++-- .../@core/connections/connections.module.ts | 6 + .../connections/crm/crm.connection.module.ts | 9 +- .../crm/services/accelo/accelo.service.ts | 49 +- .../crm/services/affinity/affinity.service.ts | 84 ++ .../crm/services/attio/attio.service.ts | 33 +- .../crm/services/capsule/capsule.service.ts | 40 +- .../crm/services/close/close.service.ts | 39 +- .../crm/services/copper/copper.service.ts | 32 +- .../crm/services/crm.connection.service.ts | 68 +- .../crm/services/hubspot/hubspot.service.ts | 41 +- .../crm/services/keap/keap.service.ts | 41 +- .../services/pipedrive/pipedrive.service.ts | 41 +- .../services/teamleader/teamleader.service.ts | 44 +- .../crm/services/teamwork/teamwork.service.ts | 49 +- .../crm/services/zendesk/zendesk.service.ts | 46 +- .../crm/services/zoho/zoho.service.ts | 45 +- .../src/@core/connections/crm/types/index.ts | 16 +- .../filestorage/services/box/box.service.ts | 44 +- .../services/dropbox/dropbox.service.ts | 46 +- .../filestorage.connection.service.ts | 37 +- .../google_drive/google_drive.service.ts | 45 +- .../services/onedrive/onedrive.service.ts | 58 +- .../services/sharepoint/sharepoint.service.ts | 46 +- .../connections/filestorage/types/index.ts | 15 +- .../hris/hris.connection.module.ts | 11 +- .../services/bamboohr/bamboohr.service.ts | 161 +++ .../hris/services/deel/deel.service.ts | 44 +- .../services/factorial/factorial.service.ts | 202 ++++ .../hris/services/gusto/gusto.service.ts | 198 ++++ .../hris/services/hris.connection.service.ts | 44 +- .../hris/services/namely/namely.service.ts | 196 ++++ .../hris/services/payfit/payfit.service.ts | 151 +++ .../services/rippling/rippling.service.ts | 44 +- .../src/@core/connections/hris/types/index.ts | 16 +- .../management.connection.module.ts | 31 + .../services/management.connection.service.ts | 98 ++ .../services/notion/notion.service.ts | 144 +++ .../management/services/registry.service.ts | 25 + .../services/slack/slack.service.ts | 160 +++ .../connections/management/types/index.ts | 7 + .../marketingautomation.connection.module.ts | 14 +- .../services/brevo/brevo.service.ts | 86 ++ .../getresponse/getresponse.service.ts | 50 +- .../services/keap/keap.service.ts | 189 ++++ .../services/klaviyo/klaviyo.service.ts | 190 ++++ .../services/mailchimp/mailchimp.service.ts | 25 +- .../marketingautomation.connection.service.ts | 40 +- .../services/podium/podium.service.ts | 46 +- .../marketingautomation/types/index.ts | 16 +- .../ticketing/services/aha/aha.service.ts | 42 +- .../ticketing/services/asana/asana.service.ts | 186 ++++ .../services/clickup/clickup.service.ts | 33 +- .../ticketing/services/dixa/dixa.service.ts | 84 ++ .../ticketing/services/front/front.service.ts | 50 +- .../services/github/github.service.ts | 31 +- .../services/gitlab/gitlab.service.ts | 41 +- .../services/gorgias/gorgias.service.ts | 50 +- .../services/helpscout/helpscout.service.ts | 181 ++++ .../services/ironclad/ironclad.service.ts | 186 ++++ .../ticketing/services/jira/jira.service.ts | 38 +- .../services/linear/linear.service.ts | 31 +- .../services/ticketing.connection.service.ts | 41 +- .../ticketing/services/wrike/wrike.service.ts | 198 ++++ .../services/zendesk/zendesk.service.ts | 42 +- .../ticketing/ticketing.connection.module.ts | 11 +- .../connections/ticketing/types/index.ts | 17 +- .../api/src/@core/events/events.service.ts | 4 +- .../utils/dtos/fetch-objects-query.dto.ts | 6 +- .../src/@core/utils/dtos/pagination.dto.ts | 2 +- .../api/src/crm/company/company.controller.ts | 4 +- .../crm/company/services/company.service.ts | 6 +- .../api/src/crm/contact/contact.controller.ts | 4 +- .../crm/contact/services/contact.service.ts | 6 +- packages/api/src/crm/deal/deal.controller.ts | 4 +- .../api/src/crm/deal/services/deal.service.ts | 6 +- .../crm/engagement/engagement.controller.ts | 4 +- .../engagement/services/engagement.service.ts | 6 +- packages/api/src/crm/note/note.controller.ts | 4 +- .../api/src/crm/note/services/note.service.ts | 6 +- .../src/crm/stage/services/stage.service.ts | 6 +- .../api/src/crm/stage/stage.controller.ts | 4 +- .../api/src/crm/task/services/task.service.ts | 6 +- packages/api/src/crm/task/task.controller.ts | 4 +- .../api/src/crm/user/services/user.service.ts | 6 +- packages/api/src/crm/user/user.controller.ts | 4 +- .../ticketing/account/account.controller.ts | 4 +- .../account/services/account.service.ts | 6 +- .../attachment/attachment.controller.ts | 4 +- .../attachment/services/attachment.service.ts | 6 +- .../collection/collection.controller.ts | 4 +- .../collection/services/collection.service.ts | 6 +- .../ticketing/comment/comment.controller.ts | 4 +- .../comment/services/comment.service.ts | 6 +- .../ticketing/contact/contact.controller.ts | 4 +- .../contact/services/contact.service.ts | 6 +- .../src/ticketing/tag/services/tag.service.ts | 6 +- .../api/src/ticketing/tag/tag.controller.ts | 4 +- .../ticketing/team/services/team.service.ts | 6 +- .../api/src/ticketing/team/team.controller.ts | 4 +- .../ticket/services/ticket.service.ts | 6 +- .../src/ticketing/ticket/ticket.controller.ts | 4 +- .../ticketing/user/services/user.service.ts | 6 +- .../api/src/ticketing/user/user.controller.ts | 4 +- packages/api/swagger/swagger-spec.json | 36 +- packages/api/swagger/swagger-spec.yaml | 36 +- packages/shared/src/authUrl.ts | 76 +- packages/shared/src/categories.ts | 1 + packages/shared/src/connectors/metadata.ts | 936 ++++++++++++++---- packages/shared/src/envConfig.ts | 27 +- packages/shared/src/types.ts | 20 +- packages/shared/src/utils.ts | 24 +- 152 files changed, 5902 insertions(+), 2069 deletions(-) create mode 100644 packages/api/src/@core/connections/@utils/types.ts create mode 100644 packages/api/src/@core/connections/ats/ats.connection.module.ts create mode 100644 packages/api/src/@core/connections/ats/services/ashby/ashby.service.ts create mode 100644 packages/api/src/@core/connections/ats/services/ats.connection.service.ts create mode 100644 packages/api/src/@core/connections/ats/services/bamboohr/bamboohr.service.ts create mode 100644 packages/api/src/@core/connections/ats/services/greenhouse/greenhouse.service.ts create mode 100644 packages/api/src/@core/connections/ats/services/jobadder/jobadder.service.ts create mode 100644 packages/api/src/@core/connections/ats/services/lever/lever.service.ts create mode 100644 packages/api/src/@core/connections/ats/services/registry.service.ts create mode 100644 packages/api/src/@core/connections/ats/services/workday/workday.service.ts create mode 100644 packages/api/src/@core/connections/ats/types/index.ts create mode 100644 packages/api/src/@core/connections/crm/services/affinity/affinity.service.ts create mode 100644 packages/api/src/@core/connections/hris/services/bamboohr/bamboohr.service.ts create mode 100644 packages/api/src/@core/connections/hris/services/factorial/factorial.service.ts create mode 100644 packages/api/src/@core/connections/hris/services/gusto/gusto.service.ts create mode 100644 packages/api/src/@core/connections/hris/services/namely/namely.service.ts create mode 100644 packages/api/src/@core/connections/hris/services/payfit/payfit.service.ts create mode 100644 packages/api/src/@core/connections/management/management.connection.module.ts create mode 100644 packages/api/src/@core/connections/management/services/management.connection.service.ts create mode 100644 packages/api/src/@core/connections/management/services/notion/notion.service.ts create mode 100644 packages/api/src/@core/connections/management/services/registry.service.ts create mode 100644 packages/api/src/@core/connections/management/services/slack/slack.service.ts create mode 100644 packages/api/src/@core/connections/management/types/index.ts create mode 100644 packages/api/src/@core/connections/marketingautomation/services/brevo/brevo.service.ts create mode 100644 packages/api/src/@core/connections/marketingautomation/services/keap/keap.service.ts create mode 100644 packages/api/src/@core/connections/marketingautomation/services/klaviyo/klaviyo.service.ts create mode 100644 packages/api/src/@core/connections/ticketing/services/asana/asana.service.ts create mode 100644 packages/api/src/@core/connections/ticketing/services/dixa/dixa.service.ts create mode 100644 packages/api/src/@core/connections/ticketing/services/helpscout/helpscout.service.ts create mode 100644 packages/api/src/@core/connections/ticketing/services/ironclad/ironclad.service.ts create mode 100644 packages/api/src/@core/connections/ticketing/services/wrike/wrike.service.ts diff --git a/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx b/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx index 6fddc0616..67a372943 100644 --- a/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx +++ b/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx @@ -65,9 +65,9 @@ const Profile = () => {

Connected user

-
+
-
diff --git a/apps/client-ts/src/components/Configuration/Connector/ConnectorDisplay.tsx b/apps/client-ts/src/components/Configuration/Connector/ConnectorDisplay.tsx index 1ac4f283f..4a5894222 100644 --- a/apps/client-ts/src/components/Configuration/Connector/ConnectorDisplay.tsx +++ b/apps/client-ts/src/components/Configuration/Connector/ConnectorDisplay.tsx @@ -94,7 +94,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) { function onSubmit(values: z.infer) { const { client_id, client_secret, scope, api_key, secret, username, subdomain } = values; const performUpdate = mappingConnectionStrategies && mappingConnectionStrategies.length > 0; - switch (item?.authStrategy) { + switch (item?.authStrategy.strategy) { case AuthStrategy.oauth2: const needs_subdomain = needsSubdomain(item.name.toLowerCase(), item.vertical!.toLowerCase()); if (client_id === "" || client_secret === "" || scope === "") { @@ -341,11 +341,11 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) { if (mappingConnectionStrategies && mappingConnectionStrategies.length > 0) { fetchCredentials({ type: mappingConnectionStrategies[0].type, - attributes: item?.authStrategy === AuthStrategy.oauth2 ? needsSubdomain(item.name.toLowerCase(), item.vertical!.toLowerCase()) ? ["subdomain", "client_id", "client_secret", "scope"] : ["client_id", "client_secret", "scope"] - : item?.authStrategy === AuthStrategy.api_key ? ["api_key"] : ["username", "secret"] + attributes: item?.authStrategy.strategy === AuthStrategy.oauth2 ? needsSubdomain(item.name.toLowerCase(), item.vertical!.toLowerCase()) ? ["subdomain", "client_id", "client_secret", "scope"] : ["client_id", "client_secret", "scope"] + : item?.authStrategy.strategy === AuthStrategy.api_key ? ["api_key"] : ["username", "secret"] }, { onSuccess(data) { - if (item?.authStrategy === AuthStrategy.oauth2) { + if (item?.authStrategy.strategy === AuthStrategy.oauth2) { let i = 0; if(needsSubdomain(item.name.toLowerCase(), item.vertical!.toLowerCase())){ form.setValue("subdomain", data[i]); @@ -355,10 +355,10 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) { form.setValue("client_secret", data[i + 1]); form.setValue("scope", data[i + 2]); } - if (item?.authStrategy === AuthStrategy.api_key) { + if (item?.authStrategy.strategy === AuthStrategy.api_key) { form.setValue("api_key", data[0]); } - if (item?.authStrategy === AuthStrategy.basic) { + if (item?.authStrategy.strategy === AuthStrategy.basic) { form.setValue("username", data[0]); form.setValue("secret", data[1]); } @@ -435,7 +435,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
- { item.authStrategy == AuthStrategy.oauth2 && + { item.authStrategy.strategy == AuthStrategy.oauth2 && <> { needsSubdomain(item.name.toLowerCase(), item.vertical!.toLowerCase()) &&
@@ -516,7 +516,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) { } { - item.authStrategy == AuthStrategy.api_key && + item.authStrategy.strategy == AuthStrategy.api_key && <>
} { - item.authStrategy == AuthStrategy.basic && + item.authStrategy.strategy == AuthStrategy.basic && <>
} - {item.authStrategy && - - {item.authStrategy} + {item.authStrategy.strategy && + + {item.authStrategy.strategy} }
diff --git a/apps/client-ts/src/components/Connection/ConnectionTable.tsx b/apps/client-ts/src/components/Connection/ConnectionTable.tsx index 13f0aa700..048e26ed8 100644 --- a/apps/client-ts/src/components/Connection/ConnectionTable.tsx +++ b/apps/client-ts/src/components/Connection/ConnectionTable.tsx @@ -125,7 +125,7 @@ export default function ConnectionTable() { } - {ts && } + {ts && }
diff --git a/apps/client-ts/src/components/Connection/columns.tsx b/apps/client-ts/src/components/Connection/columns.tsx index ceb3c965f..e3fca11ac 100644 --- a/apps/client-ts/src/components/Connection/columns.tsx +++ b/apps/client-ts/src/components/Connection/columns.tsx @@ -10,6 +10,8 @@ import { toast } from "sonner" import { getLogoURL } from "@panora/shared" import { formatISODate, truncateMiddle } from "@/lib/utils" import { Button } from "../ui/button" +import { Label } from "../ui/label" +import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover" const connectionTokenComponent = ({row}:{row:any}) => { const handleCopy = async () => { @@ -35,6 +37,70 @@ const connectionTokenComponent = ({row}:{row:any}) => { ) } +const Customizer = ({ + logo, + name, + lastSync, + authStrategy, + linkedUserId, + connectionToken, +}: { + logo: string; + name: string; + lastSync: string; + authStrategy: string; + linkedUserId: string; + connectionToken: string; +}) => { + return ( +
+
+
+
+ +
+ {`${name.substring(0, 1).toUpperCase()}${name.substring(1)}`} + {authStrategy} +
+
+
+
+
+
+ + {lastSync} +
+
+ + {truncateMiddle(connectionToken,6)} +
+
+ + {truncateMiddle(linkedUserId,6)} +
+
+
+ + +
+
+ + ) +} + export const columns: ColumnDef[] = [ { accessorKey: "app", @@ -82,30 +148,6 @@ export const columns: ColumnDef[] = [ enableSorting: false, enableHiding: false, }, - { - accessorKey: "status", - header: ({ column }) => ( - - ), - cell: ({ row }) => { - /*const direction = priorities.find( - (direction) => direction.value === row.getValue("status") - ) - - if (!direction) { - return null - }*/ - - return ( -
- {row.getValue("status")} -
- ) - }, - filterFn: (row, id, value) => { - return value.includes(row.getValue(id)) - }, - }, { accessorKey: "linkedUser", header: ({ column }) => ( @@ -151,5 +193,38 @@ export const columns: ColumnDef[] = [ ), cell: connectionTokenComponent + }, + { + accessorKey: "status", + header: ({ column }) => ( + '' + ), + cell: ({ row }) => { + return ( +
+ + + + + + + + +
+ ) + }, + filterFn: (row, id, value) => { + return value.includes(row.getValue(id)) + }, } -] \ No newline at end of file +]; \ No newline at end of file diff --git a/apps/client-ts/src/components/Events/EventsTable.tsx b/apps/client-ts/src/components/Events/EventsTable.tsx index 88befe029..680d91197 100644 --- a/apps/client-ts/src/components/Events/EventsTable.tsx +++ b/apps/client-ts/src/components/Events/EventsTable.tsx @@ -18,7 +18,7 @@ export default function EventsTable() { error, } = useEvents({ page: pagination.page, - pageSize: pagination.pageSize, + limit: pagination.limit, }); const transformedEvents = events?.map((event: Event) => ({ diff --git a/apps/client-ts/src/components/RootLayout/index.tsx b/apps/client-ts/src/components/RootLayout/index.tsx index 64f90ff34..4ea5f5493 100644 --- a/apps/client-ts/src/components/RootLayout/index.tsx +++ b/apps/client-ts/src/components/RootLayout/index.tsx @@ -97,7 +97,6 @@ export const RootLayout = ({children}:{children:React.ReactNode}) => {
-

Project

Rows per page