Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/hathr_ai/hathr_ai.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
12 changes: 12 additions & 0 deletions components/hr_cloud/README.md
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 components/hr_cloud/actions/create-employee/create-employee.mjs
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 components/hr_cloud/actions/create-task/create-task.mjs
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 components/hr_cloud/actions/update-employee/update-employee.mjs
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;
},
};
Loading
Loading