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
N8N-2603 BambooHR Node #2471
N8N-2603 BambooHR Node #2471
Conversation
…ement new Http Helper
…ng Employees File, TimeOff EstimationTime
…Create Request, Create History Item, Fixed Get Types
…mments, Finished TimeOff Api Operations
…Expand and Add new Optional Fields for Creating and Updating Employee, Write Comments, Fixed Employee API operations
… Comments for Employee Files & Company Files & Reports Acc Info API Operation
…employee, Refactor GetDirectoy to GetAll + update the output of the response
…Create -> CompanyFile:addCategory
…t rid off Account Information resources
…elds to UpdateFields
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.
Thank you for taking this on
properties = [ | ||
{ | ||
displayName: 'API Key', | ||
name: 'apiKey', | ||
type: 'string' as NodePropertyTypes, | ||
default: '', | ||
}, | ||
{ | ||
displayName: 'Company name', | ||
name: 'companyName', | ||
type: 'string' as NodePropertyTypes, | ||
default: '', | ||
}, |
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.
Type properties
instead of asserting the type of type
. Remember that type assertions override TS.
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.
Done
methods = { | ||
loadOptions: { | ||
async getTimeOffTypeID(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { | ||
const returnData: INodePropertyOptions[] = []; | ||
const body = {} as IDataObject; | ||
const requestMethod = 'GET'; | ||
const endPoint = 'meta/time_off/types'; | ||
|
||
const response = await apiRequest.call(this, requestMethod, endPoint, body); | ||
const timeOffTypeIds = response.body.timeOffTypes; | ||
|
||
for (const item of timeOffTypeIds) { | ||
returnData.push({ | ||
name: item.name, | ||
value: item.id, | ||
}); | ||
} | ||
return returnData; | ||
}, | ||
}, | ||
}; |
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.
Check the Mattermost node, which has loadOptions
in methods
as a separate dir.
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.
Done. Created separate dir for it.
const returnData: INodePropertyOptions[] = []; | ||
const body = {} as IDataObject; | ||
const requestMethod = 'GET'; | ||
const endPoint = 'meta/time_off/types'; |
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.
endpoint
without middle cap, applicable elsewhere as well.
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.
Done
loadOptions: { | ||
async getTimeOffTypeID(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { | ||
const returnData: INodePropertyOptions[] = []; | ||
const body = {} as IDataObject; |
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.
Type instead of asserting. Applicable elsewhere as well.
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.
Done
description: 'Consume BambooHR API', | ||
defaults: { | ||
name: 'BambooHR', | ||
color: '#73c41d', |
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.
color
has been deprecated.
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.
Removed
export const versionDescription: INodeTypeDescription = { | ||
displayName: 'BambooHR', | ||
name: 'bambooHR', | ||
icon: 'file:bambooHR.png', |
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.
If available, SVGs are preferred.
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.
Only the old logo was present in svg format. :/
displayName: 'Resource', | ||
name: 'resource', | ||
type: 'options', | ||
options: [ |
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.
Alphabetize.
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.
Done
}, | ||
], | ||
default: 'employees', | ||
description: 'The resource to operate on', |
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.
description: 'The resource to operate on', |
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.
Removed
*/ | ||
export async function apiRequest( | ||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, | ||
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD', |
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.
Are they all used by your implementation?
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.
I removed only 'HEAD' form here since we are using GET, POST, PUT and DELETE
…ate loadOptions file
5ff8c8a
to
ccfe600
Compare
Great, thanks a lot. Got merged. |
Got released with |
BambooHR Node
##Here is the list of the tasks related to BambooHR Node. The list should be expanded with new task related to the API operations present in https://documentation.bamboohr.com/docs/getting-started
Tasks:
Employees
Employees Files
Company Files
Reports
Tabular Data
Account Information
Time Off
Feel free to test the Draft PR and expand the list below.
###Bugs & Improvements
###TODO