Skip to content

Commit 091eb60

Browse files
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 <[email protected]>
1 parent a43eb46 commit 091eb60

File tree

10 files changed

+640
-6
lines changed

10 files changed

+640
-6
lines changed

components/hr_cloud/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# HR Cloud
2+
3+
## Overview
4+
5+
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.
6+
7+
## Getting Started
8+
9+
To use this integration, you'll need an HR Cloud account and an API key. You can get your API key by:
10+
11+
1. Log in to your HR Cloud account
12+
2. Navigate to Settings > API Settings
13+
3. Create a new API key or use an existing one
14+
15+
## Available Triggers
16+
17+
- **New Employee (Instant)** - Triggers when a new employee is added to the system
18+
- **New Leave Request (Instant)** - Triggers when an employee submits a leave request
19+
- **New Timesheet Entry (Instant)** - Triggers when an employee logs a new timesheet entry
20+
21+
## Available Actions
22+
23+
- **Create Employee** - Create a new employee record in the system
24+
- **Approve Leave Request** - Approve a pending employee leave request
25+
- **Log Timesheet Entry** - Log a new timesheet entry for an employee
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import hrCloud from "../../hr_cloud.app.mjs";
2+
3+
export default {
4+
key: "hr_cloud-approve-leave-request",
5+
name: "Approve Leave Request",
6+
description: "Approve a pending employee leave request. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
hrCloud,
11+
leaveRequestId: {
12+
propDefinition: [
13+
hrCloud,
14+
"leaveRequestId",
15+
],
16+
},
17+
approvalNote: {
18+
propDefinition: [
19+
hrCloud,
20+
"approvalNote",
21+
],
22+
},
23+
},
24+
async run({ $ }) {
25+
const response = await this.hrCloud.approveLeaveRequest(this.leaveRequestId, {
26+
$,
27+
data: {
28+
note: this.approvalNote,
29+
},
30+
});
31+
32+
$.export("$summary", `Successfully approved leave request (ID: ${this.leaveRequestId})`);
33+
return response;
34+
},
35+
};
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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/#/introduction#top)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
hrCloud,
11+
name: {
12+
propDefinition: [
13+
hrCloud,
14+
"name",
15+
],
16+
},
17+
email: {
18+
propDefinition: [
19+
hrCloud,
20+
"email",
21+
],
22+
},
23+
jobTitle: {
24+
propDefinition: [
25+
hrCloud,
26+
"jobTitle",
27+
],
28+
},
29+
departmentId: {
30+
propDefinition: [
31+
hrCloud,
32+
"departmentId",
33+
],
34+
},
35+
startDate: {
36+
propDefinition: [
37+
hrCloud,
38+
"startDate",
39+
],
40+
},
41+
},
42+
async run({ $ }) {
43+
const response = await this.hrCloud.createEmployee({
44+
$,
45+
data: {
46+
first_name: this.name.firstName,
47+
last_name: this.name.lastName,
48+
email: this.email,
49+
job_title_id: this.jobTitle,
50+
department_id: this.departmentId,
51+
start_date: this.startDate,
52+
},
53+
});
54+
55+
$.export("$summary", `Successfully created employee: ${this.name.firstName} ${this.name.lastName}`);
56+
return response;
57+
},
58+
};
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import hrCloud from "../../hr_cloud.app.mjs";
2+
3+
export default {
4+
key: "hr_cloud-log-timesheet-entry",
5+
name: "Log Timesheet Entry",
6+
description: "Log a new timesheet entry for an employee. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
hrCloud,
11+
employeeId: {
12+
propDefinition: [
13+
hrCloud,
14+
"employeeId",
15+
],
16+
},
17+
hours: {
18+
propDefinition: [
19+
hrCloud,
20+
"hours",
21+
],
22+
},
23+
date: {
24+
propDefinition: [
25+
hrCloud,
26+
"date",
27+
],
28+
},
29+
projectId: {
30+
propDefinition: [
31+
hrCloud,
32+
"projectId",
33+
],
34+
},
35+
notes: {
36+
propDefinition: [
37+
hrCloud,
38+
"notes",
39+
],
40+
},
41+
},
42+
async run({ $ }) {
43+
const response = await this.hrCloud.createTimesheetEntry({
44+
$,
45+
data: {
46+
employee_id: this.employeeId,
47+
hours: this.hours,
48+
date: this.date,
49+
project_id: this.projectId,
50+
notes: this.notes,
51+
},
52+
});
53+
54+
const employee = await this.hrCloud.getEmployee(this.employeeId, {
55+
$,
56+
});
57+
const employeeName = `${employee.first_name} ${employee.last_name}`;
58+
59+
$.export("$summary", `Successfully logged ${this.hours} hours for ${employeeName}`);
60+
return response;
61+
},
62+
};

0 commit comments

Comments
 (0)