-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(HighLevel Node): Api v2 support, new node version #9554
Merged
michael-radency
merged 21 commits into
master
from
node-783-enterprise-request-support-for-highlevel-api-v2-node-update
Jun 3, 2024
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d978833
higthlevel oauth2 api credentials
michael-radency ad26240
typo fix
michael-radency b392844
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency 06bd5c7
update, WIP
michael-radency 497ab49
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency 18f8452
opportunities update wip
michael-radency 1c48ca1
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency 5f5f5dd
create oportunity update
michael-radency e0fd0a4
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency 9906753
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency 6a7b643
opportunities update
michael-radency 5767d06
users get fix, scopes warning
michael-radency 129858b
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency cae87ef
scopes cleanup
michael-radency 80be762
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency a8788df
removed unsuported update properties
michael-radency 0e15d89
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency 5ebddf6
removed scopes
michael-radency 75a8d15
scopes hint
michael-radency a70fc07
Merge branch 'master' of https://github.com/n8n-io/n8n into node-783-…
michael-radency 8c06bdb
review updates
michael-radency File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,87 +1,25 @@ | ||
import type { INodeProperties, INodeType, INodeTypeDescription } from 'n8n-workflow'; | ||
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow'; | ||
import { VersionedNodeType } from 'n8n-workflow'; | ||
|
||
import { contactFields, contactNotes, contactOperations } from './description/ContactDescription'; | ||
import { opportunityFields, opportunityOperations } from './description/OpportunityDescription'; | ||
import { taskFields, taskOperations } from './description/TaskDescription'; | ||
import { | ||
getPipelineStages, | ||
getTimezones, | ||
getUsers, | ||
highLevelApiPagination, | ||
} from './GenericFunctions'; | ||
import { HighLevelV1 } from './v1/HighLevelV1.node'; | ||
import { HighLevelV2 } from './v2/HighLevelV2.node'; | ||
|
||
const ressources: INodeProperties[] = [ | ||
{ | ||
displayName: 'Resource', | ||
name: 'resource', | ||
type: 'options', | ||
noDataExpression: true, | ||
options: [ | ||
{ | ||
name: 'Contact', | ||
value: 'contact', | ||
}, | ||
{ | ||
name: 'Opportunity', | ||
value: 'opportunity', | ||
}, | ||
{ | ||
name: 'Task', | ||
value: 'task', | ||
}, | ||
], | ||
default: 'contact', | ||
required: true, | ||
}, | ||
]; | ||
export class HighLevel extends VersionedNodeType { | ||
constructor() { | ||
const baseDescription: INodeTypeBaseDescription = { | ||
displayName: 'HighLevel', | ||
name: 'highLevel', | ||
icon: 'file:highLevel.svg', | ||
group: ['transform'], | ||
defaultVersion: 2, | ||
description: 'Consume HighLevel API', | ||
}; | ||
|
||
export class HighLevel implements INodeType { | ||
description: INodeTypeDescription = { | ||
displayName: 'HighLevel', | ||
name: 'highLevel', | ||
icon: 'file:highLevel.svg', | ||
group: ['transform'], | ||
version: 1, | ||
description: 'Consume HighLevel API', | ||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', | ||
defaults: { | ||
name: 'HighLevel', | ||
}, | ||
inputs: ['main'], | ||
outputs: ['main'], | ||
credentials: [ | ||
{ | ||
name: 'highLevelApi', | ||
required: true, | ||
}, | ||
], | ||
requestDefaults: { | ||
baseURL: 'https://rest.gohighlevel.com/v1', | ||
headers: { | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
}, | ||
}, | ||
requestOperations: { | ||
pagination: highLevelApiPagination, | ||
}, | ||
properties: [ | ||
...ressources, | ||
...contactOperations, | ||
...contactNotes, | ||
...contactFields, | ||
...opportunityOperations, | ||
...opportunityFields, | ||
...taskOperations, | ||
...taskFields, | ||
], | ||
}; | ||
const nodeVersions: IVersionedNodeType['nodeVersions'] = { | ||
1: new HighLevelV1(baseDescription), | ||
2: new HighLevelV2(baseDescription), | ||
}; | ||
|
||
methods = { | ||
loadOptions: { | ||
getPipelineStages, | ||
getUsers, | ||
getTimezones, | ||
}, | ||
}; | ||
super(nodeVersions, baseDescription); | ||
} | ||
} |
File renamed without changes.
102 changes: 102 additions & 0 deletions
102
packages/nodes-base/nodes/HighLevel/v1/HighLevelV1.node.ts
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,102 @@ | ||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */ | ||
import type { | ||
INodeProperties, | ||
INodeType, | ||
INodeTypeBaseDescription, | ||
INodeTypeDescription, | ||
} from 'n8n-workflow'; | ||
|
||
import { contactFields, contactNotes, contactOperations } from './description/ContactDescription'; | ||
import { opportunityFields, opportunityOperations } from './description/OpportunityDescription'; | ||
import { taskFields, taskOperations } from './description/TaskDescription'; | ||
import { | ||
getPipelineStages, | ||
getTimezones, | ||
getUsers, | ||
highLevelApiPagination, | ||
} from './GenericFunctions'; | ||
|
||
const resources: INodeProperties[] = [ | ||
{ | ||
displayName: 'Resource', | ||
name: 'resource', | ||
type: 'options', | ||
noDataExpression: true, | ||
options: [ | ||
{ | ||
name: 'Contact', | ||
value: 'contact', | ||
}, | ||
{ | ||
name: 'Opportunity', | ||
value: 'opportunity', | ||
}, | ||
{ | ||
name: 'Task', | ||
value: 'task', | ||
}, | ||
], | ||
default: 'contact', | ||
required: true, | ||
}, | ||
]; | ||
|
||
const versionDescription: INodeTypeDescription = { | ||
displayName: 'HighLevel', | ||
name: 'highLevel', | ||
icon: 'file:highLevel.svg', | ||
group: ['transform'], | ||
version: 1, | ||
description: 'Consume HighLevel API v1', | ||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', | ||
defaults: { | ||
name: 'HighLevel', | ||
}, | ||
inputs: ['main'], | ||
outputs: ['main'], | ||
credentials: [ | ||
{ | ||
name: 'highLevelApi', | ||
required: true, | ||
}, | ||
], | ||
requestDefaults: { | ||
baseURL: 'https://rest.gohighlevel.com/v1', | ||
headers: { | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
}, | ||
}, | ||
requestOperations: { | ||
pagination: highLevelApiPagination, | ||
}, | ||
properties: [ | ||
...resources, | ||
...contactOperations, | ||
...contactNotes, | ||
...contactFields, | ||
...opportunityOperations, | ||
...opportunityFields, | ||
...taskOperations, | ||
...taskFields, | ||
], | ||
}; | ||
|
||
export class HighLevelV1 implements INodeType { | ||
description: INodeTypeDescription; | ||
|
||
constructor(baseDescription: INodeTypeBaseDescription) { | ||
this.description = { | ||
...baseDescription, | ||
...versionDescription, | ||
}; | ||
} | ||
|
||
methods = { | ||
loadOptions: { | ||
getPipelineStages, | ||
getUsers, | ||
getTimezones, | ||
}, | ||
}; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
typo