-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add HR Cloud components #15815
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
Merged
Merged
Add HR Cloud components #15815
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
091eb60
Add HR Cloud components
dannyroosevelt c6d2354
Update pnpm-lock.yaml
dannyroosevelt 44f0dfb
Update package.json
dannyroosevelt 119e9e5
Update README.md
dannyroosevelt e74215a
Fix: Replace compound name prop with separate firstName and lastName …
dannyroosevelt 75d5b65
Fix API endpoint structure and add version flexibility to HR Cloud co…
dannyroosevelt a5c5ea0
Update HR Cloud API URL structure to match documentation
dannyroosevelt 5e31294
create-employee updates
michelle0927 fd33ab0
Merge remote-tracking branch 'origin/master' into add-hr-cloud-compon…
michelle0927 32653e3
pnpm-lock.yaml
michelle0927 151e265
remove console.log
michelle0927 b17db49
update actions
michelle0927 f263c59
sources updates
michelle0927 6c60df1
package.json
michelle0927 b3e218a
pnpm-lock.yaml
michelle0927 40f7816
pnpm-lock.yaml
michelle0927 d10b085
fix key
michelle0927 0e64952
update package.json version
michelle0927 d75019d
fix employeeNumber prop
michelle0927 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 hidden or 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 |
|---|---|---|
|
|
@@ -8,4 +8,4 @@ export default { | |
| console.log(Object.keys(this.$auth)); | ||
| }, | ||
| }, | ||
| }; | ||
| }; | ||
This file contains hidden or 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,12 @@ | ||
| # Overview | ||
|
|
||
| HR Cloud is a human resources management system (HRMS) that helps businesses manage their employee data, payroll, benefits, time tracking, and more. This integration enables you to automate your HR workflows by connecting HR Cloud with thousands of other apps on Pipedream. | ||
|
|
||
| # Getting Started | ||
|
|
||
| To use this integration, you'll need an HR Cloud account and an API key. To get started, | ||
|
|
||
| 1. Log in to your HR Cloud account | ||
| 2. Navigate to Settings > API Settings | ||
| 3. Create a new API key or use an existing one | ||
|
|
121 changes: 121 additions & 0 deletions
121
components/hr_cloud/actions/create-employee/create-employee.mjs
This file contains hidden or 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,121 @@ | ||
| import hrCloud from "../../hr_cloud.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "hr_cloud-create-employee", | ||
| name: "Create Employee", | ||
| description: "Create a new employee record in the system. [See the documentation](https://help.hrcloud.com/api/#/employee#POST_employee)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| hrCloud, | ||
| firstName: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "firstName", | ||
| ], | ||
| }, | ||
| lastName: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "lastName", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "email", | ||
| ], | ||
| }, | ||
| jobTitle: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "jobTitle", | ||
| ], | ||
| }, | ||
| departmentId: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "departmentId", | ||
| ], | ||
| }, | ||
| startDate: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "startDate", | ||
| ], | ||
| }, | ||
| locationId: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "locationId", | ||
| ], | ||
| }, | ||
| employmentStatus: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "employmentStatusId", | ||
| ], | ||
| }, | ||
| employeeNumber: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "employeeNumber", | ||
| ], | ||
| }, | ||
| recordStatus: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "recordStatus", | ||
| ], | ||
| }, | ||
| address: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "address", | ||
| ], | ||
| }, | ||
| city: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "city", | ||
| ], | ||
| }, | ||
| state: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "state", | ||
| ], | ||
| }, | ||
| zip: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "zip", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.hrCloud.createEmployee({ | ||
| $, | ||
| data: { | ||
| xFirstName: this.firstName, | ||
| xLastName: this.lastName, | ||
| xEmail: this.email, | ||
| xFullName: `${this.firstName} ${this.lastName}`, | ||
| xPositionLookup: this.jobTitle, | ||
| xDepartmentLookup: this.departmentId, | ||
| xStartDate: this.startDate, | ||
| xLocationLookup: this.locationId, | ||
| xEmploymentStatusLookup: this.employmentStatus, | ||
| xEmployeeNumber: this.employeeNumber, | ||
| xRecordStatus: this.recordStatus, | ||
| xAddress1: this.address, | ||
| xCity: this.city, | ||
| xState: this.state, | ||
| xZipCode: this.zip, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created employee: ${this.firstName} ${this.lastName}`); | ||
| return response; | ||
| }, | ||
| }; |
107 changes: 107 additions & 0 deletions
107
components/hr_cloud/actions/create-task/create-task.mjs
This file contains hidden or 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,107 @@ | ||
| import hrCloud from "../../hr_cloud.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "hr_cloud-create-task", | ||
| name: "Create Task", | ||
| description: "Creates a new task. [See the documentation](https://help.hrcloud.com/api/#/task#POST_tasks)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| hrCloud, | ||
| applicationCode: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "applicationCode", | ||
| ], | ||
| reloadProps: true, | ||
| }, | ||
| title: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "title", | ||
| ], | ||
| }, | ||
| employeeIds: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "employeeId", | ||
| ], | ||
| type: "string[]", | ||
| label: "Employee IDs", | ||
| description: "Array of related employee IDs", | ||
| }, | ||
| assigneeType: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "assigneeType", | ||
| ], | ||
| reloadProps: true, | ||
| }, | ||
| assignedEmployeeId: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "employeeId", | ||
| ], | ||
| label: "Assignee Employee ID", | ||
| description: "ID of assigned employee", | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| }, | ||
| additionalProps(existingProps) { | ||
| const props = {}; | ||
|
|
||
| if (this.assigneeType === "SpecificEmployee") { | ||
| existingProps.assignedEmployeeId.hidden = false; | ||
| existingProps.assignedEmployeeId.optional = false; | ||
| } | ||
|
|
||
| if (this.assigneeType === "Hierarchy") { | ||
| props.hierarchyLevel = { | ||
| type: "integer", | ||
| label: "Hierarchy Level", | ||
| description: "Level of upper hierarchy level. From 1 to 9", | ||
| max: 9, | ||
| }; | ||
| } | ||
|
|
||
| if (this.applicationCode === "coreHr" || this.applicationCode === "benefits") { | ||
| props.fixedDueDate = { | ||
| type: "string", | ||
| label: "Fixed Due Date", | ||
| description: "Fixed DueDate to complete task (YYYY-MM-DD)", | ||
| }; | ||
| } | ||
|
|
||
| if (this.applicationCode === "onboard" || this.applicationCode === "offboard") { | ||
| props.relativeDueDate = { | ||
| type: "string", | ||
| label: "Relative Due Date", | ||
| description: "Relative DueDate for StartDate or SeparationDate to complete task. Example: `{\"timeUnit\": \"Day\", \"direction\": \"After\", \"offset\": 10}`", | ||
| }; | ||
| } | ||
|
|
||
| return props; | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.hrCloud.createTask({ | ||
| $, | ||
| data: { | ||
| taskType: "task", | ||
| applicationCode: this.applicationCode, | ||
| title: this.title, | ||
| relatedToEmployeeIds: this.employeeIds, | ||
| assigneeType: this.assigneeType, | ||
| assignedEmployeeId: this.assignedEmployeeId, | ||
| hierarchyLevel: this.hierarchyLevel, | ||
| fixedDueDate: this.fixedDueDate, | ||
| relativeDueDate: typeof this.relativeDueDate === "string" | ||
| ? JSON.parse(this.relativeDueDate) | ||
| : this.relativeDueDate, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created task \`${this.title}\``); | ||
| return response; | ||
| }, | ||
| }; |
80 changes: 80 additions & 0 deletions
80
components/hr_cloud/actions/update-employee/update-employee.mjs
This file contains hidden or 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,80 @@ | ||
| import hrCloud from "../../hr_cloud.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "hr_cloud-update-employee", | ||
| name: "Update Employee", | ||
| description: "Update an existing employee. [See the documentation](https://help.hrcloud.com/api/#/employee#PUT_employee)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| hrCloud, | ||
| employeeId: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "employeeId", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "email", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| firstName: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "firstName", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| lastName: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "lastName", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| address: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "address", | ||
| ], | ||
| }, | ||
| city: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "city", | ||
| ], | ||
| }, | ||
| state: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "state", | ||
| ], | ||
| }, | ||
| zip: { | ||
| propDefinition: [ | ||
| hrCloud, | ||
| "zip", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.hrCloud.updateEmployee({ | ||
| $, | ||
| data: { | ||
| Id: this.employeeId, | ||
| xPersonalEmail: this.email, | ||
| xFirstName: this.firstName, | ||
| xLastName: this.lastName, | ||
| xAddress1: this.address, | ||
| xCity: this.city, | ||
| xState: this.state, | ||
| xZipCode: this.zip, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully updated employee: ${response[0].xFirstName} ${response[0].xLastName}`); | ||
| return response; | ||
| }, | ||
| }; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.