Skip to content

Commit

Permalink
Merge pull request #466 from mit-27/fix-connector-script
Browse files Browse the repository at this point in the history
Fix connectorUpdate
  • Loading branch information
naelob authored May 28, 2024
2 parents 9016a31 + 04727bd commit da25209
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/api/scripts/connectorUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function updateEnumFile(enumFilePath, newServiceDirs, vertical) {
const base = vertical.substring(0, 1).toUpperCase() + vertical.substring(1);

// Define the enum name to be updated based on the vertical
let enumName = `${base}Providers`;
let enumName = `${base}Connectors`;
// Extract the enum content
const enumRegex = new RegExp(`export enum ${enumName} {([\\s\\S]*?)}\n`, 'm');
const match = fileContent.match(enumRegex);
Expand Down Expand Up @@ -328,9 +328,9 @@ function updateObjectTypes(baseDir, objectType, vertical) {
// Extract the current provider arrays from providers.ts and enum.ts
const providersFilePath = path.join(
__dirname,
'../../shared/src/providers.ts',
'../../shared/src/connectors/index.ts',
);
const enumFilePath = path.join(__dirname, '../../shared/src/enum.ts');
const enumFilePath = path.join(__dirname, '../../shared/src/connectors/enum.ts');
const currentProviders = extractArrayFromFile(
providersFilePath,
`${vertical.toUpperCase()}_PROVIDERS`,
Expand Down Expand Up @@ -377,7 +377,7 @@ function updateObjectTypes(baseDir, objectType, vertical) {
baseDir,
objectType,
);
console.log(importStatements)
// console.log(importStatements)
updateTargetFile(targetFile, importStatements, possibleProviderForImportStatements, objectType);
}

Expand Down
16 changes: 12 additions & 4 deletions packages/api/src/@core/utils/types/original/original.ticketing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ export type OriginalUserInput =
| JiraUserInput;
//| JiraServiceMgmtUserInput;
/* account */
export type OriginalAccountInput = ZendeskAccountInput | FrontAccountInput;
export type OriginalAccountInput =
| ZendeskAccountInput
| FrontAccountInput;
/* contact */
export type OriginalContactInput =
| ZendeskContactInput
Expand All @@ -178,7 +180,9 @@ export type OriginalTeamInput =

/* attachment */
export type OriginalAttachmentInput = null;
export type OriginalCollectionInput = JiraCollectionInput | GitlabCollectionInput;
export type OriginalCollectionInput =
| JiraCollectionInput
| GitlabCollectionInput;

export type TicketingObjectInput =
| OriginalTicketInput
Expand Down Expand Up @@ -217,7 +221,9 @@ export type OriginalUserOutput =
| GorgiasUserOutput
| JiraUserOutput;
/* account */
export type OriginalAccountOutput = ZendeskAccountOutput | FrontAccountOutput;
export type OriginalAccountOutput =
| ZendeskAccountOutput
| FrontAccountOutput;
/* contact */
export type OriginalContactOutput =
| ZendeskContactOutput
Expand Down Expand Up @@ -247,7 +253,9 @@ export type OriginalAttachmentOutput =

/* collection */

export type OriginalCollectionOutput = JiraCollectionOutput | GitlabCollectionOutput;
export type OriginalCollectionOutput =
| JiraCollectionOutput
| GitlabCollectionOutput;


export type TicketingObjectOutput =
Expand Down

0 comments on commit da25209

Please sign in to comment.