Skip to content

Commit

Permalink
🐛 Fix
Browse files Browse the repository at this point in the history
:wq
  • Loading branch information
naelob committed Mar 26, 2024
1 parent afd34f2 commit 82873a8
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 19 deletions.
6 changes: 4 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"test:e2e": "jest --config ./test/jest-e2e.json",
"ci": "pnpm run lint && pnpm run build",
"copy-types-to-shared": "cp ./exports.ts ../shared/index.ts",
"prisma:seed": "ts-node ./scripts/seed.webapp.ts"
"prisma:seed": "ts-node ./scripts/seed.webapp.ts",
"validate-connectors": "node ./scripts/connectorUpdate.js"
},
"dependencies": {
"@nestjs/bull": "^10.0.1",
Expand Down Expand Up @@ -60,7 +61,8 @@
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"stytch": "^10.5.0",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"yargs": "^17.7.2"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
Expand Down
25 changes: 24 additions & 1 deletion packages/api/scripts/connectorUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { log } from 'console';
import * as fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

// Function to scan the directory for new service directories
function scanDirectory(dir) {
Expand Down Expand Up @@ -326,4 +328,25 @@ function updateObjectTypes(baseDir, objectType, vertical) {
}

// Example usage for ticketing/team
updateObjectTypes('../src/ticketing/team/services', 'Team', 'ticketing');
//updateObjectTypes('../src/ticketing/team/services', 'Team', 'ticketing');

// Check if the script is being run directly
if (import.meta.url === process.argv[1]) {
// Get command-line arguments
const args = process.argv.slice(1);
const vertical = args[0];
const objectType = args[1];
const baseDir = `../src/${vertical.toLowerCase()}/${objectType.toLowerCase()}/services`;
updateObjectTypes(baseDir, objectType, vertical);
}

/*const options = yargs.usage('Usage: -vertical <vertical>').option('v', {
alias: 'vertical',
describe: 'Your vertical',
type: 'string',
demandOption: true,
}).argv;*/
const argv = yargs(hideBin(process.argv)).argv;

const baseDir = `../src/${argv.vertical.toLowerCase()}/${argv.object.toLowerCase()}/services`;
updateObjectTypes(baseDir, argv.object, argv.vertical);
19 changes: 4 additions & 15 deletions packages/api/src/@core/utils/types/original/original.ticketing.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@






import { ClickupTeamInput, ClickupTeamOutput } from '@ticketing/team/services/clickup/types';








import {
ClickupTeamInput,
ClickupTeamOutput,
} from '@ticketing/team/services/clickup/types';

import {
FrontAccountInput,
Expand Down
3 changes: 2 additions & 1 deletion packages/api/src/ticketing/team/team.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ import { GorgiasService } from './services/gorgias';
FrontService,
GithubService,
JiraService,
GorgiasService, ClickupService,
GorgiasService,
ClickupService,
],
exports: [SyncService],
})
Expand Down
10 changes: 10 additions & 0 deletions packages/api/src/ticketing/team/types/mappingsTypes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { ClickupteamMapper } from '../services/clickup/mappers';
import { FrontteamMapper } from '../services/front/mappers';
import { GithubteamMapper } from '../services/github/mappers';
import { GorgiasteamMapper } from '../services/gorgias/mappers';
import { JirateamMapper } from '../services/jira/mappers';
import { ClickupTeamMapper } from '../services/clickup/mappers';
import { JiraTeamMapper } from '../services/jira/mappers';
import { FrontTeamMapper } from '../services/front/mappers';
Expand All @@ -13,6 +18,11 @@ const jiraTeamMapper = new JiraTeamMapper();

const clickupTeamMapper = new ClickupTeamMapper();

const clickupteamMapper = new ClickupteamMapper();
const frontteamMapper = new FrontteamMapper();
const githubteamMapper = new GithubteamMapper();
const gorgiasteamMapper = new GorgiasteamMapper();
const jirateamMapper = new JirateamMapper();
export const teamUnificationMapping = {
zendesk_tcg: {
unify: zendeskTeamMapper.unify.bind(zendeskTeamMapper),
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 82873a8

Please sign in to comment.