diff --git a/packages/api/scripts/connectorUpdate.js b/packages/api/scripts/connectorUpdate.js index 096ecf10c..3274e736d 100755 --- a/packages/api/scripts/connectorUpdate.js +++ b/packages/api/scripts/connectorUpdate.js @@ -39,8 +39,10 @@ function generateImportStatements(serviceNames, basePath, objectType) { function updateTargetFile(file, importStatements, serviceNames, objectType) { let fileContent = fs.readFileSync(file, 'utf8'); - // Append the import statements - fileContent = importStatements.join('\n') + '\n\n' + fileContent; + if (importStatements.length > 0) { + // Append the import statements + fileContent = importStatements.join('\n') + '\n\n' + fileContent; + } // Create updates for OriginalObjectTypeInput and OriginalObjectTypeOutput serviceNames.forEach((serviceName) => { @@ -123,8 +125,11 @@ function updateMappingsFile( .forEach((newServiceName) => { const serviceNameCapitalized = newServiceName.charAt(0).toUpperCase() + newServiceName.slice(1); - const mapperClassName = `${serviceNameCapitalized}${objectType}Mapper`; - const mapperInstanceName = `${newServiceName.toLowerCase()}${objectType}Mapper`; + const objectCapitalized = + objectType.charAt(0).toUpperCase() + objectType.slice(1); + + const mapperClassName = `${serviceNameCapitalized}${objectCapitalized}Mapper`; + const mapperInstanceName = `${newServiceName.toLowerCase()}${objectCapitalized}Mapper`; // Prepare the import statement and instance declaration const importStatement = `import { ${mapperClassName} } from '../services/${newServiceName}/mappers';\n`; @@ -211,7 +216,7 @@ function updateModuleFile(moduleFile, newServiceDirs) { const providerRegex = /providers: \[\n([\s\S]*?)\n \],/; const match = moduleFileContent.match(providerRegex); if (match && !match[1].includes(serviceClass)) { - const updatedProviders = match[1] + ` ${serviceClass},\n`; + const updatedProviders = match[1] + `\n ${serviceClass},\n`; moduleFileContent = moduleFileContent.replace( providerRegex, `providers: [\n${updatedProviders} ],`, diff --git a/packages/api/src/ticketing/team/team.module.ts b/packages/api/src/ticketing/team/team.module.ts index 76839eb6a..c24f4403d 100644 --- a/packages/api/src/ticketing/team/team.module.ts +++ b/packages/api/src/ticketing/team/team.module.ts @@ -1,4 +1,3 @@ -import { ClickupService } from './services/clickup'; import { Module } from '@nestjs/common'; import { TeamController } from './team.controller'; import { SyncService } from './sync/sync.service'; @@ -38,7 +37,6 @@ import { GorgiasService } from './services/gorgias'; GithubService, JiraService, GorgiasService, - ClickupService, ], exports: [SyncService], }) diff --git a/packages/api/src/ticketing/team/types/mappingsTypes.ts b/packages/api/src/ticketing/team/types/mappingsTypes.ts index 8195341db..4e93d9305 100644 --- a/packages/api/src/ticketing/team/types/mappingsTypes.ts +++ b/packages/api/src/ticketing/team/types/mappingsTypes.ts @@ -1,3 +1,4 @@ +import { ClickupTeamMapper } from '../services/clickup/mappers'; import { JiraTeamMapper } from '../services/jira/mappers'; import { FrontTeamMapper } from '../services/front/mappers'; import { GithubTeamMapper } from '../services/github/mappers'; @@ -10,6 +11,8 @@ const githubTeamMapper = new GithubTeamMapper(); const gorgiasTeamMapper = new GorgiasTeamMapper(); const jiraTeamMapper = new JiraTeamMapper(); +const clickupTeamMapper = new ClickupTeamMapper(); + export const teamUnificationMapping = { zendesk_tcg: { unify: zendeskTeamMapper.unify.bind(zendeskTeamMapper), @@ -31,4 +34,8 @@ export const teamUnificationMapping = { unify: jiraTeamMapper.unify.bind(jiraTeamMapper), desunify: jiraTeamMapper.desunify, }, + clickup: { + unify: clickupTeamMapper.unify.bind(clickupTeamMapper), + desunify: clickupTeamMapper.desunify, + }, }; diff --git a/packages/shared/src/enum.ts b/packages/shared/src/enum.ts index cb4448a22..155cf4459 100644 --- a/packages/shared/src/enum.ts +++ b/packages/shared/src/enum.ts @@ -13,7 +13,7 @@ export enum CrmProviders { ZOHO = 'zoho', ZENDESK = 'zendesk', HUBSPOT = 'hubspot', - PIPEDRIVE = 'pipedrive', + PIPEDRIVE = 'pipedrive', FRESHSALES = 'freshsales', ATTIO = 'attio' } diff --git a/packages/shared/src/providers.ts b/packages/shared/src/providers.ts index 9778eaeac..92cfc5a97 100644 --- a/packages/shared/src/providers.ts +++ b/packages/shared/src/providers.ts @@ -17,7 +17,7 @@ export const ACCOUNTING_PROVIDERS = ['']; export const TICKETING_PROVIDERS = ['zendesk', 'front', 'github', 'jira', 'gorgias', 'clickup']; export const MARKETING_AUTOMATION_PROVIDERS = ['']; export const FILE_STORAGE_PROVIDERS = ['']; - + export function getProviderVertical(providerName: string): ProviderVertical { if (CRM_PROVIDERS.includes(providerName)) {