Skip to content

Commit 74caf69

Browse files
Add HR Cloud components (#15815)
* Add HR Cloud components Added new webhook triggers: - new-employee-instant: Emits event when new employee is added - new-leave-request-instant: Emits event when leave request is submitted - new-timesheet-entry-instant: Emits event when timesheet entry is logged Added new actions: - create-employee: Creates a new employee record - approve-leave-request: Approves a pending leave request - log-timesheet-entry: Logs a new timesheet entry Includes filtering options for triggers and required/optional fields for actions. Resolves #15812 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update pnpm-lock.yaml * Update package.json * Update README.md * Fix: Replace compound name prop with separate firstName and lastName props * Fix API endpoint structure and add version flexibility to HR Cloud component * Update HR Cloud API URL structure to match documentation * create-employee updates * pnpm-lock.yaml * remove console.log * update actions * sources updates * package.json * pnpm-lock.yaml * pnpm-lock.yaml * fix key * update package.json version * fix employeeNumber prop --------- Co-authored-by: michelle0927 <michellelbergero@hotmail.com>
1 parent 251db8e commit 74caf69

File tree

15 files changed

+795
-16
lines changed

15 files changed

+795
-16
lines changed

components/hathr_ai/hathr_ai.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/hr_cloud/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Overview
2+
3+
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.
4+
5+
# Getting Started
6+
7+
To use this integration, you'll need an HR Cloud account and an API key. To get started,
8+
9+
1. Log in to your HR Cloud account
10+
2. Navigate to Settings > API Settings
11+
3. Create a new API key or use an existing one
12+
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import hrCloud from "../../hr_cloud.app.mjs";
2+
3+
export default {
4+
key: "hr_cloud-create-employee",
5+
name: "Create Employee",
6+
description: "Create a new employee record in the system. [See the documentation](https://help.hrcloud.com/api/#/employee#POST_employee)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
hrCloud,
11+
firstName: {
12+
propDefinition: [
13+
hrCloud,
14+
"firstName",
15+
],
16+
},
17+
lastName: {
18+
propDefinition: [
19+
hrCloud,
20+
"lastName",
21+
],
22+
},
23+
email: {
24+
propDefinition: [
25+
hrCloud,
26+
"email",
27+
],
28+
},
29+
jobTitle: {
30+
propDefinition: [
31+
hrCloud,
32+
"jobTitle",
33+
],
34+
},
35+
departmentId: {
36+
propDefinition: [
37+
hrCloud,
38+
"departmentId",
39+
],
40+
},
41+
startDate: {
42+
propDefinition: [
43+
hrCloud,
44+
"startDate",
45+
],
46+
},
47+
locationId: {
48+
propDefinition: [
49+
hrCloud,
50+
"locationId",
51+
],
52+
},
53+
employmentStatus: {
54+
propDefinition: [
55+
hrCloud,
56+
"employmentStatusId",
57+
],
58+
},
59+
employeeNumber: {
60+
propDefinition: [
61+
hrCloud,
62+
"employeeNumber",
63+
],
64+
},
65+
recordStatus: {
66+
propDefinition: [
67+
hrCloud,
68+
"recordStatus",
69+
],
70+
},
71+
address: {
72+
propDefinition: [
73+
hrCloud,
74+
"address",
75+
],
76+
},
77+
city: {
78+
propDefinition: [
79+
hrCloud,
80+
"city",
81+
],
82+
},
83+
state: {
84+
propDefinition: [
85+
hrCloud,
86+
"state",
87+
],
88+
},
89+
zip: {
90+
propDefinition: [
91+
hrCloud,
92+
"zip",
93+
],
94+
},
95+
},
96+
async run({ $ }) {
97+
const response = await this.hrCloud.createEmployee({
98+
$,
99+
data: {
100+
xFirstName: this.firstName,
101+
xLastName: this.lastName,
102+
xEmail: this.email,
103+
xFullName: `${this.firstName} ${this.lastName}`,
104+
xPositionLookup: this.jobTitle,
105+
xDepartmentLookup: this.departmentId,
106+
xStartDate: this.startDate,
107+
xLocationLookup: this.locationId,
108+
xEmploymentStatusLookup: this.employmentStatus,
109+
xEmployeeNumber: this.employeeNumber,
110+
xRecordStatus: this.recordStatus,
111+
xAddress1: this.address,
112+
xCity: this.city,
113+
xState: this.state,
114+
xZipCode: this.zip,
115+
},
116+
});
117+
118+
$.export("$summary", `Successfully created employee: ${this.firstName} ${this.lastName}`);
119+
return response;
120+
},
121+
};
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import hrCloud from "../../hr_cloud.app.mjs";
2+
3+
export default {
4+
key: "hr_cloud-create-task",
5+
name: "Create Task",
6+
description: "Creates a new task. [See the documentation](https://help.hrcloud.com/api/#/task#POST_tasks)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
hrCloud,
11+
applicationCode: {
12+
propDefinition: [
13+
hrCloud,
14+
"applicationCode",
15+
],
16+
reloadProps: true,
17+
},
18+
title: {
19+
propDefinition: [
20+
hrCloud,
21+
"title",
22+
],
23+
},
24+
employeeIds: {
25+
propDefinition: [
26+
hrCloud,
27+
"employeeId",
28+
],
29+
type: "string[]",
30+
label: "Employee IDs",
31+
description: "Array of related employee IDs",
32+
},
33+
assigneeType: {
34+
propDefinition: [
35+
hrCloud,
36+
"assigneeType",
37+
],
38+
reloadProps: true,
39+
},
40+
assignedEmployeeId: {
41+
propDefinition: [
42+
hrCloud,
43+
"employeeId",
44+
],
45+
label: "Assignee Employee ID",
46+
description: "ID of assigned employee",
47+
hidden: true,
48+
optional: true,
49+
},
50+
},
51+
additionalProps(existingProps) {
52+
const props = {};
53+
54+
if (this.assigneeType === "SpecificEmployee") {
55+
existingProps.assignedEmployeeId.hidden = false;
56+
existingProps.assignedEmployeeId.optional = false;
57+
}
58+
59+
if (this.assigneeType === "Hierarchy") {
60+
props.hierarchyLevel = {
61+
type: "integer",
62+
label: "Hierarchy Level",
63+
description: "Level of upper hierarchy level. From 1 to 9",
64+
max: 9,
65+
};
66+
}
67+
68+
if (this.applicationCode === "coreHr" || this.applicationCode === "benefits") {
69+
props.fixedDueDate = {
70+
type: "string",
71+
label: "Fixed Due Date",
72+
description: "Fixed DueDate to complete task (YYYY-MM-DD)",
73+
};
74+
}
75+
76+
if (this.applicationCode === "onboard" || this.applicationCode === "offboard") {
77+
props.relativeDueDate = {
78+
type: "string",
79+
label: "Relative Due Date",
80+
description: "Relative DueDate for StartDate or SeparationDate to complete task. Example: `{\"timeUnit\": \"Day\", \"direction\": \"After\", \"offset\": 10}`",
81+
};
82+
}
83+
84+
return props;
85+
},
86+
async run({ $ }) {
87+
const response = await this.hrCloud.createTask({
88+
$,
89+
data: {
90+
taskType: "task",
91+
applicationCode: this.applicationCode,
92+
title: this.title,
93+
relatedToEmployeeIds: this.employeeIds,
94+
assigneeType: this.assigneeType,
95+
assignedEmployeeId: this.assignedEmployeeId,
96+
hierarchyLevel: this.hierarchyLevel,
97+
fixedDueDate: this.fixedDueDate,
98+
relativeDueDate: typeof this.relativeDueDate === "string"
99+
? JSON.parse(this.relativeDueDate)
100+
: this.relativeDueDate,
101+
},
102+
});
103+
104+
$.export("$summary", `Successfully created task \`${this.title}\``);
105+
return response;
106+
},
107+
};
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import hrCloud from "../../hr_cloud.app.mjs";
2+
3+
export default {
4+
key: "hr_cloud-update-employee",
5+
name: "Update Employee",
6+
description: "Update an existing employee. [See the documentation](https://help.hrcloud.com/api/#/employee#PUT_employee)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
hrCloud,
11+
employeeId: {
12+
propDefinition: [
13+
hrCloud,
14+
"employeeId",
15+
],
16+
},
17+
email: {
18+
propDefinition: [
19+
hrCloud,
20+
"email",
21+
],
22+
optional: true,
23+
},
24+
firstName: {
25+
propDefinition: [
26+
hrCloud,
27+
"firstName",
28+
],
29+
optional: true,
30+
},
31+
lastName: {
32+
propDefinition: [
33+
hrCloud,
34+
"lastName",
35+
],
36+
optional: true,
37+
},
38+
address: {
39+
propDefinition: [
40+
hrCloud,
41+
"address",
42+
],
43+
},
44+
city: {
45+
propDefinition: [
46+
hrCloud,
47+
"city",
48+
],
49+
},
50+
state: {
51+
propDefinition: [
52+
hrCloud,
53+
"state",
54+
],
55+
},
56+
zip: {
57+
propDefinition: [
58+
hrCloud,
59+
"zip",
60+
],
61+
},
62+
},
63+
async run({ $ }) {
64+
const response = await this.hrCloud.updateEmployee({
65+
$,
66+
data: {
67+
Id: this.employeeId,
68+
xPersonalEmail: this.email,
69+
xFirstName: this.firstName,
70+
xLastName: this.lastName,
71+
xAddress1: this.address,
72+
xCity: this.city,
73+
xState: this.state,
74+
xZipCode: this.zip,
75+
},
76+
});
77+
$.export("$summary", `Successfully updated employee: ${response[0].xFirstName} ${response[0].xLastName}`);
78+
return response;
79+
},
80+
};

0 commit comments

Comments
 (0)