-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* standardize association naming * create a union type for association * hubspot association ids * hubspot contact -> deal association * hubspot company -> deal association * hubspot event -> deal association * hubspot lead -> deal association * hubspot task -> deal association * sfdc note -> deal association * sfdc task -> deal association * sfdc event -> deal & event -> contact association * fix import * fix import * zoho note -> deal association * zoho event -> deal association * zoho task -> deal association * zoho contact -> deal association * zoho company -> deal association * sfdc company -> deal association * enable sdk deploy to s3 * sfdc contact -> deal association * zoho contact -> deal association payload fixed * minor changes * Address comments * Handle errors better * Handle standard errors * fern types for association
- Loading branch information
Showing
27 changed files
with
550 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
types: | ||
CompanyAssociation: | ||
properties: | ||
dealId: | ||
type: optional<string> | ||
docs: The id of the deal to associate with company | ||
ContactAssociation: | ||
properties: | ||
dealId: | ||
type: optional<string> | ||
docs: The id of the deal to associate with contact | ||
DealAssociation: | ||
properties: | ||
contactId: | ||
type: optional<string> | ||
docs: The id of the contact to associate with deal | ||
companyId: | ||
type: optional<string> | ||
docs: The id of the company to associate with deal | ||
EventAssociation: | ||
properties: | ||
dealId: | ||
type: optional<string> | ||
docs: The id of the deal to associate with event | ||
contactId: | ||
type: optional<string> | ||
docs: The id of the contact to associate with event | ||
LeadAssociation: | ||
properties: | ||
contactId: | ||
type: optional<string> | ||
docs: The id of the contact to associate with lead | ||
companyId: | ||
type: optional<string> | ||
docs: The id of the company to associate with lead | ||
dealId: | ||
type: optional<string> | ||
docs: The id of the deal to associate with lead | ||
NoteAssociation: | ||
properties: | ||
contactId: | ||
type: optional<string> | ||
docs: The id of the contact to associate with note | ||
companyId: | ||
type: optional<string> | ||
docs: The id of the company to associate with note | ||
leadId: | ||
type: optional<string> | ||
docs: The id of the lead to associate with note | ||
dealId: | ||
type: optional<string> | ||
docs: The id of the deal to associate with note | ||
TaskAssociation: | ||
properties: | ||
dealId: | ||
type: optional<string> | ||
docs: The id of the deal to associate with task | ||
UserAssociation: | ||
properties: | ||
dealId: | ||
type: optional<string> | ||
docs: The id of the deal to associate with user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type ValueOf<T> = T[keyof T]; | ||
|
||
export type Subtype<T, U extends T> = U; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { | ||
BadRequestError, | ||
InternalServerError, | ||
NotFoundError, | ||
UnAuthorizedError, | ||
} from '../generated/typescript/api/resources/common'; | ||
|
||
export const isStandardError = (error: any) => { | ||
return ( | ||
error instanceof NotFoundError || | ||
error instanceof BadRequestError || | ||
error instanceof UnAuthorizedError || | ||
error instanceof InternalServerError | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,68 @@ | ||
import { NoteAssociation } from '../models/unified'; | ||
import { AllAssociation } from '../constants/common'; | ||
|
||
export const getHubspotAssociationObj = (key: NoteAssociation) => { | ||
switch (key) { | ||
case 'dealId': { | ||
return { | ||
associationCategory: 'HUBSPOT_DEFINED', | ||
associationTypeId: 214, | ||
}; | ||
break; | ||
} | ||
default: { | ||
return {}; | ||
} | ||
export const getHubspotAssociationObj = ( | ||
key: AllAssociation, | ||
associateObj: 'note' | 'deal' | 'contact' | 'lead' | 'company' | 'event' | 'task' | ||
) => { | ||
const associationTypeMapping: { | ||
[x in typeof associateObj]: { [y in AllAssociation]: number | undefined }; | ||
} = { | ||
note: { | ||
dealId: 214, | ||
companyId: 190, | ||
contactId: 202, | ||
leadId: 202, | ||
noteId: undefined, | ||
}, | ||
deal: { | ||
contactId: 3, | ||
leadId: 3, | ||
companyId: 341, | ||
noteId: 213, | ||
dealId: undefined, | ||
}, | ||
contact: { | ||
companyId: 279, | ||
dealId: 4, | ||
noteId: 201, | ||
leadId: undefined, | ||
contactId: undefined, | ||
}, | ||
lead: { | ||
companyId: 279, | ||
dealId: 4, | ||
noteId: 201, | ||
contactId: undefined, | ||
leadId: undefined, | ||
}, | ||
company: { | ||
contactId: 280, | ||
leadId: 280, | ||
dealId: 342, | ||
noteId: 189, | ||
companyId: undefined, | ||
}, | ||
event: { | ||
contactId: 200, | ||
leadId: 601, | ||
dealId: 212, | ||
noteId: undefined, | ||
companyId: 188, | ||
}, | ||
task: { | ||
contactId: 204, | ||
leadId: undefined, | ||
dealId: 216, | ||
noteId: undefined, | ||
companyId: 192, | ||
}, | ||
}; | ||
const associationTypeId = associationTypeMapping[associateObj][key]; | ||
if (associationTypeId) { | ||
return { | ||
associationCategory: 'HUBSPOT_DEFINED', | ||
associationTypeId, | ||
}; | ||
} | ||
return null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
70996fb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
revert-client – ./
revert-client-revertdev.vercel.app
app.revert.dev
revert-client-git-main-revertdev.vercel.app