Skip to content

Commit

Permalink
✏️ Fix typo scriopt
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Mar 27, 2024
1 parent d30dfc9 commit ec2b149
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
15 changes: 10 additions & 5 deletions packages/api/scripts/connectorUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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`;
Expand Down Expand Up @@ -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} ],`,
Expand Down
2 changes: 0 additions & 2 deletions packages/api/src/ticketing/team/team.module.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -38,7 +37,6 @@ import { GorgiasService } from './services/gorgias';
GithubService,
JiraService,
GorgiasService,
ClickupService,
],
exports: [SyncService],
})
Expand Down
7 changes: 7 additions & 0 deletions packages/api/src/ticketing/team/types/mappingsTypes.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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),
Expand All @@ -31,4 +34,8 @@ export const teamUnificationMapping = {
unify: jiraTeamMapper.unify.bind(jiraTeamMapper),
desunify: jiraTeamMapper.desunify,
},
clickup: {
unify: clickupTeamMapper.unify.bind(clickupTeamMapper),
desunify: clickupTeamMapper.desunify,
},
};
2 changes: 1 addition & 1 deletion packages/shared/src/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export enum CrmProviders {
ZOHO = 'zoho',
ZENDESK = 'zendesk',
HUBSPOT = 'hubspot',
PIPEDRIVE = 'pipedrive',
PIPEDRIVE = 'pipedrive',
FRESHSALES = 'freshsales',
ATTIO = 'attio'
}
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit ec2b149

Please sign in to comment.