From 091eb6050fea2d55cc4203ed0175ed4761d0db1d Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Mar 2025 14:24:49 -0800 Subject: [PATCH 01/18] Add HR Cloud components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- components/hr_cloud/README.md | 25 ++ .../approve-leave-request.mjs | 35 +++ .../create-employee/create-employee.mjs | 58 ++++ .../log-timesheet-entry.mjs | 62 ++++ components/hr_cloud/hr_cloud.app.mjs | 277 +++++++++++++++++- components/hr_cloud/package.json | 5 +- components/hr_cloud/sources/common/base.mjs | 48 +++ .../new-employee-instant.mjs | 48 +++ .../new-leave-request-instant.mjs | 39 +++ .../new-timesheet-entry-instant.mjs | 49 ++++ 10 files changed, 640 insertions(+), 6 deletions(-) create mode 100644 components/hr_cloud/README.md create mode 100644 components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs create mode 100644 components/hr_cloud/actions/create-employee/create-employee.mjs create mode 100644 components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs create mode 100644 components/hr_cloud/sources/common/base.mjs create mode 100644 components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs create mode 100644 components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs create mode 100644 components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs diff --git a/components/hr_cloud/README.md b/components/hr_cloud/README.md new file mode 100644 index 0000000000000..ac571b70b8e40 --- /dev/null +++ b/components/hr_cloud/README.md @@ -0,0 +1,25 @@ +# HR Cloud + +## 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. You can get your API key by: + +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 + +## Available Triggers + +- **New Employee (Instant)** - Triggers when a new employee is added to the system +- **New Leave Request (Instant)** - Triggers when an employee submits a leave request +- **New Timesheet Entry (Instant)** - Triggers when an employee logs a new timesheet entry + +## Available Actions + +- **Create Employee** - Create a new employee record in the system +- **Approve Leave Request** - Approve a pending employee leave request +- **Log Timesheet Entry** - Log a new timesheet entry for an employee \ No newline at end of file diff --git a/components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs b/components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs new file mode 100644 index 0000000000000..d8a48db961d5f --- /dev/null +++ b/components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs @@ -0,0 +1,35 @@ +import hrCloud from "../../hr_cloud.app.mjs"; + +export default { + key: "hr_cloud-approve-leave-request", + name: "Approve Leave Request", + description: "Approve a pending employee leave request. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", + version: "0.0.1", + type: "action", + props: { + hrCloud, + leaveRequestId: { + propDefinition: [ + hrCloud, + "leaveRequestId", + ], + }, + approvalNote: { + propDefinition: [ + hrCloud, + "approvalNote", + ], + }, + }, + async run({ $ }) { + const response = await this.hrCloud.approveLeaveRequest(this.leaveRequestId, { + $, + data: { + note: this.approvalNote, + }, + }); + + $.export("$summary", `Successfully approved leave request (ID: ${this.leaveRequestId})`); + return response; + }, +}; diff --git a/components/hr_cloud/actions/create-employee/create-employee.mjs b/components/hr_cloud/actions/create-employee/create-employee.mjs new file mode 100644 index 0000000000000..8c865d5f68d59 --- /dev/null +++ b/components/hr_cloud/actions/create-employee/create-employee.mjs @@ -0,0 +1,58 @@ +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/#/introduction#top)", + version: "0.0.1", + type: "action", + props: { + hrCloud, + name: { + propDefinition: [ + hrCloud, + "name", + ], + }, + email: { + propDefinition: [ + hrCloud, + "email", + ], + }, + jobTitle: { + propDefinition: [ + hrCloud, + "jobTitle", + ], + }, + departmentId: { + propDefinition: [ + hrCloud, + "departmentId", + ], + }, + startDate: { + propDefinition: [ + hrCloud, + "startDate", + ], + }, + }, + async run({ $ }) { + const response = await this.hrCloud.createEmployee({ + $, + data: { + first_name: this.name.firstName, + last_name: this.name.lastName, + email: this.email, + job_title_id: this.jobTitle, + department_id: this.departmentId, + start_date: this.startDate, + }, + }); + + $.export("$summary", `Successfully created employee: ${this.name.firstName} ${this.name.lastName}`); + return response; + }, +}; diff --git a/components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs b/components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs new file mode 100644 index 0000000000000..76267fa1fc05f --- /dev/null +++ b/components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs @@ -0,0 +1,62 @@ +import hrCloud from "../../hr_cloud.app.mjs"; + +export default { + key: "hr_cloud-log-timesheet-entry", + name: "Log Timesheet Entry", + description: "Log a new timesheet entry for an employee. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", + version: "0.0.1", + type: "action", + props: { + hrCloud, + employeeId: { + propDefinition: [ + hrCloud, + "employeeId", + ], + }, + hours: { + propDefinition: [ + hrCloud, + "hours", + ], + }, + date: { + propDefinition: [ + hrCloud, + "date", + ], + }, + projectId: { + propDefinition: [ + hrCloud, + "projectId", + ], + }, + notes: { + propDefinition: [ + hrCloud, + "notes", + ], + }, + }, + async run({ $ }) { + const response = await this.hrCloud.createTimesheetEntry({ + $, + data: { + employee_id: this.employeeId, + hours: this.hours, + date: this.date, + project_id: this.projectId, + notes: this.notes, + }, + }); + + const employee = await this.hrCloud.getEmployee(this.employeeId, { + $, + }); + const employeeName = `${employee.first_name} ${employee.last_name}`; + + $.export("$summary", `Successfully logged ${this.hours} hours for ${employeeName}`); + return response; + }, +}; diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index ee69105dfa01f..fcdf16c6e1fb0 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -1,11 +1,278 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "hr_cloud", - propDefinitions: {}, + propDefinitions: { + departmentId: { + type: "string", + label: "Department", + description: "The department to filter by", + async options({ page }) { + const departments = await this.getDepartments({ + params: { + page: page + 1, + }, + }); + return departments.map((department) => ({ + label: department.name, + value: department.id, + })); + }, + optional: true, + }, + jobTitle: { + type: "string", + label: "Job Title", + description: "The job title to filter by", + async options({ page }) { + const jobTitles = await this.getJobTitles({ + params: { + page: page + 1, + }, + }); + return jobTitles.map((jobTitle) => ({ + label: jobTitle.name, + value: jobTitle.id, + })); + }, + optional: true, + }, + leaveType: { + type: "string", + label: "Leave Type", + description: "The leave type to filter by", + async options() { + const leaveTypes = await this.getLeaveTypes(); + return leaveTypes.map((leaveType) => ({ + label: leaveType.name, + value: leaveType.id, + })); + }, + optional: true, + }, + projectId: { + type: "string", + label: "Project", + description: "The project to filter by", + async options({ page }) { + const projects = await this.getProjects({ + params: { + page: page + 1, + }, + }); + return projects.map((project) => ({ + label: project.name, + value: project.id, + })); + }, + optional: true, + }, + employeeId: { + type: "string", + label: "Employee", + description: "The employee", + async options({ page }) { + const employees = await this.getEmployees({ + params: { + page: page + 1, + }, + }); + return employees.map((employee) => ({ + label: `${employee.first_name} ${employee.last_name}`, + value: employee.id, + })); + }, + }, + leaveRequestId: { + type: "string", + label: "Leave Request ID", + description: "The ID of the leave request to approve", + async options({ page }) { + const leaveRequests = await this.getLeaveRequests({ + params: { + page: page + 1, + status: "pending", + }, + }); + return leaveRequests.map((request) => ({ + label: `${request.employee_name} - ${request.leave_type} (${request.start_date} to ${request.end_date})`, + value: request.id, + })); + }, + }, + hours: { + type: "integer", + label: "Hours Worked", + description: "The number of hours worked", + }, + date: { + type: "string", + label: "Date", + description: "The date of the timesheet entry (YYYY-MM-DD)", + }, + notes: { + type: "string", + label: "Notes", + description: "Additional notes for the timesheet entry", + optional: true, + }, + name: { + type: "object", + label: "Name", + description: "The employee's name", + properties: { + firstName: { + type: "string", + label: "First Name", + description: "The employee's first name", + }, + lastName: { + type: "string", + label: "Last Name", + description: "The employee's last name", + }, + }, + }, + email: { + type: "string", + label: "Email", + description: "The employee's email address", + }, + startDate: { + type: "string", + label: "Start Date", + description: "The employee's start date (YYYY-MM-DD)", + optional: true, + }, + approvalNote: { + type: "string", + label: "Approval Note", + description: "Note to include with the leave request approval", + optional: true, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.hrcloud.com/v1"; + }, + _authHeaders() { + return { + "Authorization": `Bearer ${this.$auth.api_key}`, + "Content-Type": "application/json", + }; + }, + async _makeRequest({ + $ = this, + path, + method = "GET", + params = {}, + data = {}, + }) { + const config = { + method, + url: `${this._baseUrl()}${path}`, + headers: this._authHeaders(), + params, + data, + }; + return axios($, config); + }, + async createWebhook({ + eventType, endpoint, metadata, + }) { + return this._makeRequest({ + method: "POST", + path: "/webhooks", + data: { + event_type: eventType, + endpoint, + metadata, + }, + }); + }, + async deleteWebhook(webhookId) { + return this._makeRequest({ + method: "DELETE", + path: `/webhooks/${webhookId}`, + }); + }, + async getEmployees(args = {}) { + const response = await this._makeRequest({ + path: "/employees", + ...args, + }); + return response.employees || []; + }, + async getEmployee(employeeId, args = {}) { + const response = await this._makeRequest({ + path: `/employees/${employeeId}`, + ...args, + }); + return response.employee; + }, + async createEmployee(args = {}) { + return this._makeRequest({ + method: "POST", + path: "/employees", + ...args, + }); + }, + async getDepartments(args = {}) { + const response = await this._makeRequest({ + path: "/departments", + ...args, + }); + return response.departments || []; + }, + async getJobTitles(args = {}) { + const response = await this._makeRequest({ + path: "/job-titles", + ...args, + }); + return response.job_titles || []; + }, + async getLeaveRequests(args = {}) { + const response = await this._makeRequest({ + path: "/leave-requests", + ...args, + }); + return response.leave_requests || []; + }, + async getLeaveTypes(args = {}) { + const response = await this._makeRequest({ + path: "/leave-types", + ...args, + }); + return response.leave_types || []; + }, + async approveLeaveRequest(requestId, args = {}) { + return this._makeRequest({ + method: "PUT", + path: `/leave-requests/${requestId}/approve`, + ...args, + }); + }, + async getProjects(args = {}) { + const response = await this._makeRequest({ + path: "/projects", + ...args, + }); + return response.projects || []; + }, + async getTimesheetEntries(args = {}) { + const response = await this._makeRequest({ + path: "/timesheet-entries", + ...args, + }); + return response.timesheet_entries || []; + }, + async createTimesheetEntry(args = {}) { + return this._makeRequest({ + method: "POST", + path: "/timesheet-entries", + ...args, + }); }, }, -}; \ No newline at end of file +}; diff --git a/components/hr_cloud/package.json b/components/hr_cloud/package.json index f88060820f9bd..574b46a3e118a 100644 --- a/components/hr_cloud/package.json +++ b/components/hr_cloud/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hr_cloud", - "version": "0.0.1", + "version": "0.0.2", "description": "Pipedream HR Cloud Components", "main": "hr_cloud.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^1.6.0" } } \ No newline at end of file diff --git a/components/hr_cloud/sources/common/base.mjs b/components/hr_cloud/sources/common/base.mjs new file mode 100644 index 0000000000000..bce8724c8c887 --- /dev/null +++ b/components/hr_cloud/sources/common/base.mjs @@ -0,0 +1,48 @@ +import { ConfigurationError } from "@pipedream/platform"; +import hrCloud from "../../hr_cloud.app.mjs"; + +export default { + dedupe: "unique", + props: { + hrCloud, + http: "$.interface.http", + db: "$.service.db", + }, + hooks: { + async activate() { + const { id } = await this.hrCloud.createWebhook({ + eventType: this.getEventType(), + endpoint: this.http.endpoint, + metadata: this.getMetadata(), + }); + + this.db.set("webhookId", id); + }, + async deactivate() { + const webhookId = this.db.get("webhookId"); + if (webhookId) { + await this.hrCloud.deleteWebhook(webhookId); + } + }, + }, + methods: { + getEventType() { + throw new ConfigurationError("getEventType is not implemented"); + }, + getMetadata() { + return {}; + }, + generateMeta() { + throw new ConfigurationError("generateMeta is not implemented"); + }, + }, + async run(event) { + const { body } = event; + if (!body) { + return; + } + + const meta = this.generateMeta(body); + this.$emit(body, meta); + }, +}; diff --git a/components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs b/components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs new file mode 100644 index 0000000000000..221cfb5f8490d --- /dev/null +++ b/components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs @@ -0,0 +1,48 @@ +import common from "../common/base.mjs"; + +export default { + ...common, + key: "hr_cloud-new-employee-instant", + name: "New Employee (Instant)", + description: "Emit new event when a new employee is added to the system. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", + version: "0.0.1", + type: "source", + props: { + ...common.props, + departmentId: { + propDefinition: [ + common.props.hrCloud, + "departmentId", + ], + }, + jobTitle: { + propDefinition: [ + common.props.hrCloud, + "jobTitle", + ], + }, + }, + methods: { + ...common.methods, + getEventType() { + return "employee.created"; + }, + getMetadata() { + const metadata = {}; + if (this.departmentId) { + metadata.department_id = this.departmentId; + } + if (this.jobTitle) { + metadata.job_title = this.jobTitle; + } + return metadata; + }, + generateMeta(data) { + return { + id: data.id, + summary: `New Employee: ${data.first_name} ${data.last_name}`, + ts: Date.parse(data.created_at), + }; + }, + }, +}; diff --git a/components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs b/components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs new file mode 100644 index 0000000000000..65e6720ef997c --- /dev/null +++ b/components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs @@ -0,0 +1,39 @@ +import common from "../common/base.mjs"; + +export default { + ...common, + key: "hr_cloud-new-leave-request-instant", + name: "New Leave Request (Instant)", + description: "Emit new event when an employee submits a leave request. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", + version: "0.0.1", + type: "source", + props: { + ...common.props, + leaveType: { + propDefinition: [ + common.props.hrCloud, + "leaveType", + ], + }, + }, + methods: { + ...common.methods, + getEventType() { + return "leave_request.created"; + }, + getMetadata() { + const metadata = {}; + if (this.leaveType) { + metadata.leave_type = this.leaveType; + } + return metadata; + }, + generateMeta(data) { + return { + id: data.id, + summary: `New Leave Request: ${data.employee_name} - ${data.leave_type}`, + ts: Date.parse(data.created_at), + }; + }, + }, +}; diff --git a/components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs b/components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs new file mode 100644 index 0000000000000..f216fa9867f63 --- /dev/null +++ b/components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs @@ -0,0 +1,49 @@ +import common from "../common/base.mjs"; + +export default { + ...common, + key: "hr_cloud-new-timesheet-entry-instant", + name: "New Timesheet Entry (Instant)", + description: "Emit new event when an employee logs a new timesheet entry. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", + version: "0.0.1", + type: "source", + props: { + ...common.props, + projectId: { + propDefinition: [ + common.props.hrCloud, + "projectId", + ], + }, + employeeId: { + propDefinition: [ + common.props.hrCloud, + "employeeId", + ], + optional: true, + }, + }, + methods: { + ...common.methods, + getEventType() { + return "timesheet_entry.created"; + }, + getMetadata() { + const metadata = {}; + if (this.projectId) { + metadata.project_id = this.projectId; + } + if (this.employeeId) { + metadata.employee_id = this.employeeId; + } + return metadata; + }, + generateMeta(data) { + return { + id: data.id, + summary: `New Timesheet Entry: ${data.employee_name} - ${data.hours} hours`, + ts: Date.parse(data.created_at), + }; + }, + }, +}; From c6d2354f95682001d409700da6ae0c0d09e6b3bd Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Mar 2025 14:25:29 -0800 Subject: [PATCH 02/18] Update pnpm-lock.yaml --- pnpm-lock.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d657cda35aec..0c714fb7afcb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5989,7 +5989,10 @@ importers: version: 1.6.6 components/hr_cloud: - specifiers: {} + dependencies: + '@pipedream/platform': + specifier: ^1.6.0 + version: 1.6.6 components/hr_partner: {} From 44f0dfbaff2e99d72befd0985b6d44bc58ed2f10 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Mar 2025 14:33:59 -0800 Subject: [PATCH 03/18] Update package.json --- components/hr_cloud/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hr_cloud/package.json b/components/hr_cloud/package.json index 574b46a3e118a..96b0964f013bb 100644 --- a/components/hr_cloud/package.json +++ b/components/hr_cloud/package.json @@ -15,4 +15,4 @@ "dependencies": { "@pipedream/platform": "^1.6.0" } -} \ No newline at end of file +} From 119e9e532ce18d04cba1f784c787e029b641ddc3 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Mar 2025 14:38:58 -0800 Subject: [PATCH 04/18] Update README.md --- components/hr_cloud/README.md | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/components/hr_cloud/README.md b/components/hr_cloud/README.md index ac571b70b8e40..078a918bdd726 100644 --- a/components/hr_cloud/README.md +++ b/components/hr_cloud/README.md @@ -1,25 +1,11 @@ -# HR Cloud - -## Overview +# 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 +# Getting Started -To use this integration, you'll need an HR Cloud account and an API key. You can get your API key by: +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 - -## Available Triggers - -- **New Employee (Instant)** - Triggers when a new employee is added to the system -- **New Leave Request (Instant)** - Triggers when an employee submits a leave request -- **New Timesheet Entry (Instant)** - Triggers when an employee logs a new timesheet entry - -## Available Actions - -- **Create Employee** - Create a new employee record in the system -- **Approve Leave Request** - Approve a pending employee leave request -- **Log Timesheet Entry** - Log a new timesheet entry for an employee \ No newline at end of file From e74215a1ec2abeb8b32f9d29c993cefbd2e52a52 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Mar 2025 15:47:21 -0800 Subject: [PATCH 05/18] Fix: Replace compound name prop with separate firstName and lastName props --- .../create-employee/create-employee.mjs | 16 ++++++++---- components/hr_cloud/hr_cloud.app.mjs | 25 +++++++------------ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/components/hr_cloud/actions/create-employee/create-employee.mjs b/components/hr_cloud/actions/create-employee/create-employee.mjs index 8c865d5f68d59..1668545151878 100644 --- a/components/hr_cloud/actions/create-employee/create-employee.mjs +++ b/components/hr_cloud/actions/create-employee/create-employee.mjs @@ -8,10 +8,16 @@ export default { type: "action", props: { hrCloud, - name: { + firstName: { propDefinition: [ hrCloud, - "name", + "firstName", + ], + }, + lastName: { + propDefinition: [ + hrCloud, + "lastName", ], }, email: { @@ -43,8 +49,8 @@ export default { const response = await this.hrCloud.createEmployee({ $, data: { - first_name: this.name.firstName, - last_name: this.name.lastName, + first_name: this.firstName, + last_name: this.lastName, email: this.email, job_title_id: this.jobTitle, department_id: this.departmentId, @@ -52,7 +58,7 @@ export default { }, }); - $.export("$summary", `Successfully created employee: ${this.name.firstName} ${this.name.lastName}`); + $.export("$summary", `Successfully created employee: ${this.firstName} ${this.lastName}`); return response; }, }; diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index fcdf16c6e1fb0..874cde499f7e4 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -117,22 +117,15 @@ export default { description: "Additional notes for the timesheet entry", optional: true, }, - name: { - type: "object", - label: "Name", - description: "The employee's name", - properties: { - firstName: { - type: "string", - label: "First Name", - description: "The employee's first name", - }, - lastName: { - type: "string", - label: "Last Name", - description: "The employee's last name", - }, - }, + firstName: { + type: "string", + label: "First Name", + description: "The employee's first name", + }, + lastName: { + type: "string", + label: "Last Name", + description: "The employee's last name", }, email: { type: "string", From 75d5b65b3e9f99eb2f14ceb1696118403efd2dce Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Mar 2025 20:07:17 -0800 Subject: [PATCH 06/18] Fix API endpoint structure and add version flexibility to HR Cloud component --- components/hr_cloud/README.md | 10 +++++ components/hr_cloud/hr_cloud.app.mjs | 56 ++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/components/hr_cloud/README.md b/components/hr_cloud/README.md index 078a918bdd726..687b5ef7f8495 100644 --- a/components/hr_cloud/README.md +++ b/components/hr_cloud/README.md @@ -9,3 +9,13 @@ To use this integration, you'll need an HR Cloud account and an API key. To get 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 + +# API URL Structure + +This integration uses the HR Cloud API. If you encounter 404 errors, please confirm the correct API URL structure with your HR Cloud documentation, as it may vary depending on your account setup. The integration supports the following formats: + +- https://api.hrcloud.com/api/... (default) +- https://api.hrcloud.com/v1/api/... (older accounts) +- https://api.hrcloud.com/v2/api/... (newer accounts) + +If you continue to encounter 404 errors, please contact HR Cloud support to confirm your API URL structure. diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index 874cde499f7e4..4d73e1c75c3ac 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -4,6 +4,13 @@ export default { type: "app", app: "hr_cloud", propDefinitions: { + apiVersion: { + type: "string", + label: "API Version", + description: "The HR Cloud API version to use. Leave empty to use the default version.", + default: "", + optional: true, + }, departmentId: { type: "string", label: "Department", @@ -147,7 +154,15 @@ export default { }, methods: { _baseUrl() { - return "https://api.hrcloud.com/v1"; + // Default to base URL without version + const baseUrl = "https://api.hrcloud.com"; + + // If a version is specified in the app props, use it + if (this.$auth.apiVersion) { + return `${baseUrl}/${this.$auth.apiVersion}`; + } + + return baseUrl; }, _authHeaders() { return { @@ -169,14 +184,25 @@ export default { params, data, }; - return axios($, config); + + try { + console.log(`Making request to: ${config.url}`); + const response = await axios($, config); + return response; + } catch (error) { + console.error(`Error with request to ${path}: ${error.message}`); + if (error.response?.status === 404) { + throw new Error(`API endpoint not found (404): ${path}. Please verify the API URL structure in the HR Cloud documentation.`); + } + throw error; + } }, async createWebhook({ eventType, endpoint, metadata, }) { return this._makeRequest({ method: "POST", - path: "/webhooks", + path: "/api/webhooks", data: { event_type: eventType, endpoint, @@ -187,19 +213,19 @@ export default { async deleteWebhook(webhookId) { return this._makeRequest({ method: "DELETE", - path: `/webhooks/${webhookId}`, + path: `/api/webhooks/${webhookId}`, }); }, async getEmployees(args = {}) { const response = await this._makeRequest({ - path: "/employees", + path: "/api/employees", ...args, }); return response.employees || []; }, async getEmployee(employeeId, args = {}) { const response = await this._makeRequest({ - path: `/employees/${employeeId}`, + path: `/api/employees/${employeeId}`, ...args, }); return response.employee; @@ -207,34 +233,34 @@ export default { async createEmployee(args = {}) { return this._makeRequest({ method: "POST", - path: "/employees", + path: "/api/employees", ...args, }); }, async getDepartments(args = {}) { const response = await this._makeRequest({ - path: "/departments", + path: "/api/departments", ...args, }); return response.departments || []; }, async getJobTitles(args = {}) { const response = await this._makeRequest({ - path: "/job-titles", + path: "/api/job-titles", ...args, }); return response.job_titles || []; }, async getLeaveRequests(args = {}) { const response = await this._makeRequest({ - path: "/leave-requests", + path: "/api/leave-requests", ...args, }); return response.leave_requests || []; }, async getLeaveTypes(args = {}) { const response = await this._makeRequest({ - path: "/leave-types", + path: "/api/leave-types", ...args, }); return response.leave_types || []; @@ -242,20 +268,20 @@ export default { async approveLeaveRequest(requestId, args = {}) { return this._makeRequest({ method: "PUT", - path: `/leave-requests/${requestId}/approve`, + path: `/api/leave-requests/${requestId}/approve`, ...args, }); }, async getProjects(args = {}) { const response = await this._makeRequest({ - path: "/projects", + path: "/api/projects", ...args, }); return response.projects || []; }, async getTimesheetEntries(args = {}) { const response = await this._makeRequest({ - path: "/timesheet-entries", + path: "/api/timesheet-entries", ...args, }); return response.timesheet_entries || []; @@ -263,7 +289,7 @@ export default { async createTimesheetEntry(args = {}) { return this._makeRequest({ method: "POST", - path: "/timesheet-entries", + path: "/api/timesheet-entries", ...args, }); }, From a5c5ea0cb7e8623cda3dbff179e534047b55d255 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Mar 2025 20:11:12 -0800 Subject: [PATCH 07/18] Update HR Cloud API URL structure to match documentation --- components/hr_cloud/README.md | 9 ------ components/hr_cloud/hr_cloud.app.mjs | 43 +++++++++------------------- 2 files changed, 14 insertions(+), 38 deletions(-) diff --git a/components/hr_cloud/README.md b/components/hr_cloud/README.md index 687b5ef7f8495..9940cdbbfc0fb 100644 --- a/components/hr_cloud/README.md +++ b/components/hr_cloud/README.md @@ -10,12 +10,3 @@ To use this integration, you'll need an HR Cloud account and an API key. To get 2. Navigate to Settings > API Settings 3. Create a new API key or use an existing one -# API URL Structure - -This integration uses the HR Cloud API. If you encounter 404 errors, please confirm the correct API URL structure with your HR Cloud documentation, as it may vary depending on your account setup. The integration supports the following formats: - -- https://api.hrcloud.com/api/... (default) -- https://api.hrcloud.com/v1/api/... (older accounts) -- https://api.hrcloud.com/v2/api/... (newer accounts) - -If you continue to encounter 404 errors, please contact HR Cloud support to confirm your API URL structure. diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index 4d73e1c75c3ac..56bcd2d8e4d25 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -4,13 +4,6 @@ export default { type: "app", app: "hr_cloud", propDefinitions: { - apiVersion: { - type: "string", - label: "API Version", - description: "The HR Cloud API version to use. Leave empty to use the default version.", - default: "", - optional: true, - }, departmentId: { type: "string", label: "Department", @@ -154,15 +147,7 @@ export default { }, methods: { _baseUrl() { - // Default to base URL without version - const baseUrl = "https://api.hrcloud.com"; - - // If a version is specified in the app props, use it - if (this.$auth.apiVersion) { - return `${baseUrl}/${this.$auth.apiVersion}`; - } - - return baseUrl; + return "https://corehr-api.hrcloud.com/v1/cloud"; }, _authHeaders() { return { @@ -202,7 +187,7 @@ export default { }) { return this._makeRequest({ method: "POST", - path: "/api/webhooks", + path: "/webhooks", data: { event_type: eventType, endpoint, @@ -213,19 +198,19 @@ export default { async deleteWebhook(webhookId) { return this._makeRequest({ method: "DELETE", - path: `/api/webhooks/${webhookId}`, + path: `/webhooks/${webhookId}`, }); }, async getEmployees(args = {}) { const response = await this._makeRequest({ - path: "/api/employees", + path: "/employees", ...args, }); return response.employees || []; }, async getEmployee(employeeId, args = {}) { const response = await this._makeRequest({ - path: `/api/employees/${employeeId}`, + path: `/employees/${employeeId}`, ...args, }); return response.employee; @@ -233,34 +218,34 @@ export default { async createEmployee(args = {}) { return this._makeRequest({ method: "POST", - path: "/api/employees", + path: "/employees", ...args, }); }, async getDepartments(args = {}) { const response = await this._makeRequest({ - path: "/api/departments", + path: "/departments", ...args, }); return response.departments || []; }, async getJobTitles(args = {}) { const response = await this._makeRequest({ - path: "/api/job-titles", + path: "/job-titles", ...args, }); return response.job_titles || []; }, async getLeaveRequests(args = {}) { const response = await this._makeRequest({ - path: "/api/leave-requests", + path: "/leave-requests", ...args, }); return response.leave_requests || []; }, async getLeaveTypes(args = {}) { const response = await this._makeRequest({ - path: "/api/leave-types", + path: "/leave-types", ...args, }); return response.leave_types || []; @@ -268,20 +253,20 @@ export default { async approveLeaveRequest(requestId, args = {}) { return this._makeRequest({ method: "PUT", - path: `/api/leave-requests/${requestId}/approve`, + path: `/leave-requests/${requestId}/approve`, ...args, }); }, async getProjects(args = {}) { const response = await this._makeRequest({ - path: "/api/projects", + path: "/projects", ...args, }); return response.projects || []; }, async getTimesheetEntries(args = {}) { const response = await this._makeRequest({ - path: "/api/timesheet-entries", + path: "/timesheet-entries", ...args, }); return response.timesheet_entries || []; @@ -289,7 +274,7 @@ export default { async createTimesheetEntry(args = {}) { return this._makeRequest({ method: "POST", - path: "/api/timesheet-entries", + path: "/timesheet-entries", ...args, }); }, From 5e31294edf46f19f1f793782439c4afcd910f2ff Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 11:25:39 -0500 Subject: [PATCH 08/18] create-employee updates --- .../create-employee/create-employee.mjs | 42 +++++++-- components/hr_cloud/hr_cloud.app.mjs | 88 +++++++++++++++---- 2 files changed, 107 insertions(+), 23 deletions(-) diff --git a/components/hr_cloud/actions/create-employee/create-employee.mjs b/components/hr_cloud/actions/create-employee/create-employee.mjs index 1668545151878..e4c809c25b9c1 100644 --- a/components/hr_cloud/actions/create-employee/create-employee.mjs +++ b/components/hr_cloud/actions/create-employee/create-employee.mjs @@ -3,7 +3,7 @@ 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/#/introduction#top)", + 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: { @@ -44,17 +44,45 @@ export default { "startDate", ], }, + employeeNumber: { + propDefinition: [ + hrCloud, + "employeeNumber", + ], + }, + locationId: { + propDefinition: [ + hrCloud, + "locationId", + ], + }, + employmentStatus: { + propDefinition: [ + hrCloud, + "employmentStatusId", + ], + }, + recordStatus: { + propDefinition: [ + hrCloud, + "recordStatus", + ], + }, }, async run({ $ }) { const response = await this.hrCloud.createEmployee({ $, data: { - first_name: this.firstName, - last_name: this.lastName, - email: this.email, - job_title_id: this.jobTitle, - department_id: this.departmentId, - start_date: this.startDate, + xFirstName: this.firstName, + xLastName: this.lastName, + xEmail: this.email, + xFullName: `${this.firstName} ${this.lastName}`, + xPositionLookup: this.jobTitle, + xDepartmentLookup: this.departmentId, + xStartDate: this.startDate, + xRecordStatus: this.recordStatus, + xEmploymentStatusLookup: this.employmentStatus, + xLocationLookup: this.locationId, }, }); diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index 56bcd2d8e4d25..99e961c4f690c 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -7,19 +7,18 @@ export default { departmentId: { type: "string", label: "Department", - description: "The department to filter by", + description: "The employee department", async options({ page }) { const departments = await this.getDepartments({ params: { page: page + 1, }, - }); + }); console.log(departments); return departments.map((department) => ({ - label: department.name, - value: department.id, + label: department.xDepartmentName, + value: department.Id, })); }, - optional: true, }, jobTitle: { type: "string", @@ -32,11 +31,10 @@ export default { }, }); return jobTitles.map((jobTitle) => ({ - label: jobTitle.name, - value: jobTitle.id, + label: jobTitle.xPositionTitle, + value: jobTitle.Id, })); }, - optional: true, }, leaveType: { type: "string", @@ -101,6 +99,38 @@ export default { })); }, }, + locationId: { + type: "string", + label: "Location ID", + description: "The ID of a location", + async options({ page }) { + const locations = await this.getLocations({ + params: { + page: page + 1, + }, + }); + return locations.map((location) => ({ + label: location.xLocationName, + value: location.Id, + })); + }, + }, + employmentStatusId: { + type: "string", + label: "Employment Status ID", + description: "The ID of an employment status", + async options({ page }) { + const statuses = await this.getEmploymentStatus({ + params: { + page: page + 1, + }, + }); + return statuses.map((status) => ({ + label: status.xType, + value: status.Id, + })); + }, + }, hours: { type: "integer", label: "Hours Worked", @@ -136,6 +166,21 @@ export default { type: "string", label: "Start Date", description: "The employee's start date (YYYY-MM-DD)", + }, + employeeNumber: { + type: "string", + label: "Employee Number", + description: "Unique employee number", + }, + recordStatus: { + type: "string", + label: "Record Status", + description: "The employee status", + options: [ + "Active", + "Inactive", + ], + default: "Active", optional: true, }, approvalNote: { @@ -151,7 +196,8 @@ export default { }, _authHeaders() { return { - "Authorization": `Bearer ${this.$auth.api_key}`, + "customer_key": `${this.$auth.consumer_key}`, + "customer_secret": `${this.$auth.consumer_secret}`, "Content-Type": "application/json", }; }, @@ -218,23 +264,21 @@ export default { async createEmployee(args = {}) { return this._makeRequest({ method: "POST", - path: "/employees", + path: "/xEmployee", ...args, }); }, async getDepartments(args = {}) { - const response = await this._makeRequest({ - path: "/departments", + return this._makeRequest({ + path: "/xDepartment", ...args, }); - return response.departments || []; }, async getJobTitles(args = {}) { - const response = await this._makeRequest({ - path: "/job-titles", + return this._makeRequest({ + path: "/xPosition", ...args, }); - return response.job_titles || []; }, async getLeaveRequests(args = {}) { const response = await this._makeRequest({ @@ -250,6 +294,18 @@ export default { }); return response.leave_types || []; }, + async getLocations(args = {}) { + return this._makeRequest({ + path: "/xLocation", + ...args, + }); + }, + async getEmploymentStatus(args = {}) { + return this._makeRequest({ + path: "/xEmploymentStatus", + ...args, + }); + }, async approveLeaveRequest(requestId, args = {}) { return this._makeRequest({ method: "PUT", From 32653e37d4b6fc65f93697b72a2bc877f02cc9b7 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 11:31:17 -0500 Subject: [PATCH 09/18] pnpm-lock.yaml --- pnpm-lock.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 67dde8b455f41..1e16d3096ce53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5730,8 +5730,7 @@ importers: components/hasura: {} - components/hathr_ai: - specifiers: {} + components/hathr_ai: {} components/have_i_been_pwned: {} @@ -8252,8 +8251,7 @@ importers: components/neetokb: {} - components/neo4j_auradb: - specifiers: {} + components/neo4j_auradb: {} components/neon_api_keys: dependencies: From 151e265e6f65f3b1e569a0bc5f59ad7a0b1cb706 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 11:31:32 -0500 Subject: [PATCH 10/18] remove console.log --- components/hr_cloud/hr_cloud.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index 99e961c4f690c..a4f1654062132 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -13,7 +13,7 @@ export default { params: { page: page + 1, }, - }); console.log(departments); + }); return departments.map((department) => ({ label: department.xDepartmentName, value: department.Id, From b17db49930867359cc1a293b5fbcf9f67771baf4 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 14:36:17 -0500 Subject: [PATCH 11/18] update actions --- .../approve-leave-request.mjs | 35 --- .../create-employee/create-employee.mjs | 45 +++- .../actions/create-task/create-task.mjs | 107 +++++++++ .../log-timesheet-entry.mjs | 62 ----- .../update-employee/update-employee.mjs | 80 +++++++ components/hr_cloud/hr_cloud.app.mjs | 220 ++++++------------ 6 files changed, 301 insertions(+), 248 deletions(-) delete mode 100644 components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs create mode 100644 components/hr_cloud/actions/create-task/create-task.mjs delete mode 100644 components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs create mode 100644 components/hr_cloud/actions/update-employee/update-employee.mjs diff --git a/components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs b/components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs deleted file mode 100644 index d8a48db961d5f..0000000000000 --- a/components/hr_cloud/actions/approve-leave-request/approve-leave-request.mjs +++ /dev/null @@ -1,35 +0,0 @@ -import hrCloud from "../../hr_cloud.app.mjs"; - -export default { - key: "hr_cloud-approve-leave-request", - name: "Approve Leave Request", - description: "Approve a pending employee leave request. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", - version: "0.0.1", - type: "action", - props: { - hrCloud, - leaveRequestId: { - propDefinition: [ - hrCloud, - "leaveRequestId", - ], - }, - approvalNote: { - propDefinition: [ - hrCloud, - "approvalNote", - ], - }, - }, - async run({ $ }) { - const response = await this.hrCloud.approveLeaveRequest(this.leaveRequestId, { - $, - data: { - note: this.approvalNote, - }, - }); - - $.export("$summary", `Successfully approved leave request (ID: ${this.leaveRequestId})`); - return response; - }, -}; diff --git a/components/hr_cloud/actions/create-employee/create-employee.mjs b/components/hr_cloud/actions/create-employee/create-employee.mjs index e4c809c25b9c1..c108e45f158d0 100644 --- a/components/hr_cloud/actions/create-employee/create-employee.mjs +++ b/components/hr_cloud/actions/create-employee/create-employee.mjs @@ -44,12 +44,6 @@ export default { "startDate", ], }, - employeeNumber: { - propDefinition: [ - hrCloud, - "employeeNumber", - ], - }, locationId: { propDefinition: [ hrCloud, @@ -62,12 +56,42 @@ export default { "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({ @@ -80,9 +104,14 @@ export default { xPositionLookup: this.jobTitle, xDepartmentLookup: this.departmentId, xStartDate: this.startDate, - xRecordStatus: this.recordStatus, - xEmploymentStatusLookup: this.employmentStatus, xLocationLookup: this.locationId, + xEmploymentStatusLookup: this.employmentStatus, + xEmploymentNumber: this.employmentNumber, + xRecordStatus: this.recordStatus, + xAddress1: this.address, + xCity: this.city, + xState: this.state, + xZipCode: this.zip, }, }); diff --git a/components/hr_cloud/actions/create-task/create-task.mjs b/components/hr_cloud/actions/create-task/create-task.mjs new file mode 100644 index 0000000000000..03dbe365fb002 --- /dev/null +++ b/components/hr_cloud/actions/create-task/create-task.mjs @@ -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; + }, +}; diff --git a/components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs b/components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs deleted file mode 100644 index 76267fa1fc05f..0000000000000 --- a/components/hr_cloud/actions/log-timesheet-entry/log-timesheet-entry.mjs +++ /dev/null @@ -1,62 +0,0 @@ -import hrCloud from "../../hr_cloud.app.mjs"; - -export default { - key: "hr_cloud-log-timesheet-entry", - name: "Log Timesheet Entry", - description: "Log a new timesheet entry for an employee. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", - version: "0.0.1", - type: "action", - props: { - hrCloud, - employeeId: { - propDefinition: [ - hrCloud, - "employeeId", - ], - }, - hours: { - propDefinition: [ - hrCloud, - "hours", - ], - }, - date: { - propDefinition: [ - hrCloud, - "date", - ], - }, - projectId: { - propDefinition: [ - hrCloud, - "projectId", - ], - }, - notes: { - propDefinition: [ - hrCloud, - "notes", - ], - }, - }, - async run({ $ }) { - const response = await this.hrCloud.createTimesheetEntry({ - $, - data: { - employee_id: this.employeeId, - hours: this.hours, - date: this.date, - project_id: this.projectId, - notes: this.notes, - }, - }); - - const employee = await this.hrCloud.getEmployee(this.employeeId, { - $, - }); - const employeeName = `${employee.first_name} ${employee.last_name}`; - - $.export("$summary", `Successfully logged ${this.hours} hours for ${employeeName}`); - return response; - }, -}; diff --git a/components/hr_cloud/actions/update-employee/update-employee.mjs b/components/hr_cloud/actions/update-employee/update-employee.mjs new file mode 100644 index 0000000000000..740a966aa36b4 --- /dev/null +++ b/components/hr_cloud/actions/update-employee/update-employee.mjs @@ -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_upsert)", + 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; + }, +}; diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index a4f1654062132..5734787160227 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -7,7 +7,7 @@ export default { departmentId: { type: "string", label: "Department", - description: "The employee department", + description: "The ID of an employee department", async options({ page }) { const departments = await this.getDepartments({ params: { @@ -23,7 +23,7 @@ export default { jobTitle: { type: "string", label: "Job Title", - description: "The job title to filter by", + description: "The ID of a job title", async options({ page }) { const jobTitles = await this.getJobTitles({ params: { @@ -36,40 +36,10 @@ export default { })); }, }, - leaveType: { - type: "string", - label: "Leave Type", - description: "The leave type to filter by", - async options() { - const leaveTypes = await this.getLeaveTypes(); - return leaveTypes.map((leaveType) => ({ - label: leaveType.name, - value: leaveType.id, - })); - }, - optional: true, - }, - projectId: { - type: "string", - label: "Project", - description: "The project to filter by", - async options({ page }) { - const projects = await this.getProjects({ - params: { - page: page + 1, - }, - }); - return projects.map((project) => ({ - label: project.name, - value: project.id, - })); - }, - optional: true, - }, employeeId: { type: "string", label: "Employee", - description: "The employee", + description: "The ID of an employee", async options({ page }) { const employees = await this.getEmployees({ params: { @@ -77,25 +47,8 @@ export default { }, }); return employees.map((employee) => ({ - label: `${employee.first_name} ${employee.last_name}`, - value: employee.id, - })); - }, - }, - leaveRequestId: { - type: "string", - label: "Leave Request ID", - description: "The ID of the leave request to approve", - async options({ page }) { - const leaveRequests = await this.getLeaveRequests({ - params: { - page: page + 1, - status: "pending", - }, - }); - return leaveRequests.map((request) => ({ - label: `${request.employee_name} - ${request.leave_type} (${request.start_date} to ${request.end_date})`, - value: request.id, + label: `${employee.xFirstName} ${employee.xLastName}`, + value: employee.Id, })); }, }, @@ -131,22 +84,6 @@ export default { })); }, }, - hours: { - type: "integer", - label: "Hours Worked", - description: "The number of hours worked", - }, - date: { - type: "string", - label: "Date", - description: "The date of the timesheet entry (YYYY-MM-DD)", - }, - notes: { - type: "string", - label: "Notes", - description: "Additional notes for the timesheet entry", - optional: true, - }, firstName: { type: "string", label: "First Name", @@ -171,6 +108,7 @@ export default { type: "string", label: "Employee Number", description: "Unique employee number", + optional: true, }, recordStatus: { type: "string", @@ -183,12 +121,63 @@ export default { default: "Active", optional: true, }, - approvalNote: { + address: { + type: "string", + label: "Street Address", + description: "The street address of the employee", + optional: true, + }, + city: { + type: "string", + label: "City", + description: "The city of the employee", + optional: true, + }, + state: { type: "string", - label: "Approval Note", - description: "Note to include with the leave request approval", + label: "State", + description: "The state of the employee", optional: true, }, + zip: { + type: "integer", + label: "Zip", + description: "The zip code of the employee", + optional: true, + }, + applicationCode: { + type: "string", + label: "Application Code", + description: "Alpha-numeric code for application", + options: [ + "coreHr", + "onboard", + "benefits", + "offboard", + ], + }, + title: { + type: "string", + label: "Title", + description: "The title of a task", + }, + assigneeType: { + type: "string", + label: "Assignee Type", + description: "Type of assignee", + options: [ + "Employee", + "Manager", + "ManagersManager", + "HrAdmin", + "HrUser", + "HrOperation", + "ItUser", + "ItOperation", + "SpecificEmployee", + "Hierarchy", + ], + }, }, methods: { _baseUrl() { @@ -228,109 +217,54 @@ export default { throw error; } }, - async createWebhook({ - eventType, endpoint, metadata, - }) { - return this._makeRequest({ - method: "POST", - path: "/webhooks", - data: { - event_type: eventType, - endpoint, - metadata, - }, - }); - }, - async deleteWebhook(webhookId) { - return this._makeRequest({ - method: "DELETE", - path: `/webhooks/${webhookId}`, - }); - }, - async getEmployees(args = {}) { - const response = await this._makeRequest({ - path: "/employees", - ...args, - }); - return response.employees || []; - }, - async getEmployee(employeeId, args = {}) { - const response = await this._makeRequest({ - path: `/employees/${employeeId}`, - ...args, - }); - return response.employee; - }, - async createEmployee(args = {}) { - return this._makeRequest({ - method: "POST", - path: "/xEmployee", - ...args, - }); - }, - async getDepartments(args = {}) { + getDepartments(args = {}) { return this._makeRequest({ path: "/xDepartment", ...args, }); }, - async getJobTitles(args = {}) { + getJobTitles(args = {}) { return this._makeRequest({ path: "/xPosition", ...args, }); }, - async getLeaveRequests(args = {}) { - const response = await this._makeRequest({ - path: "/leave-requests", - ...args, - }); - return response.leave_requests || []; - }, - async getLeaveTypes(args = {}) { - const response = await this._makeRequest({ - path: "/leave-types", - ...args, - }); - return response.leave_types || []; - }, - async getLocations(args = {}) { + getLocations(args = {}) { return this._makeRequest({ path: "/xLocation", ...args, }); }, - async getEmploymentStatus(args = {}) { + getEmploymentStatus(args = {}) { return this._makeRequest({ path: "/xEmploymentStatus", ...args, }); }, - async approveLeaveRequest(requestId, args = {}) { + getEmployees(args = {}) { return this._makeRequest({ - method: "PUT", - path: `/leave-requests/${requestId}/approve`, + path: "/xEmployee", ...args, }); }, - async getProjects(args = {}) { - const response = await this._makeRequest({ - path: "/projects", + createEmployee(args = {}) { + return this._makeRequest({ + method: "POST", + path: "/xEmployee", ...args, }); - return response.projects || []; }, - async getTimesheetEntries(args = {}) { - const response = await this._makeRequest({ - path: "/timesheet-entries", + createTask(args = {}) { + return this._makeRequest({ + method: "POST", + path: "/xTask/Portal", ...args, }); - return response.timesheet_entries || []; }, - async createTimesheetEntry(args = {}) { + updateEmployee(args = {}) { return this._makeRequest({ - method: "POST", - path: "/timesheet-entries", + method: "PUT", + path: "/xEmployee", ...args, }); }, From f263c59fafee8c4228718db5504274e1eab10347 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 15:23:56 -0500 Subject: [PATCH 12/18] sources updates --- .../update-employee/update-employee.mjs | 2 +- components/hr_cloud/hr_cloud.app.mjs | 37 +++++++- components/hr_cloud/sources/common/base.mjs | 85 +++++++++++++------ .../new-applicant-created.mjs | 27 ++++++ .../new-employee-created.mjs | 27 ++++++ .../new-employee-instant.mjs | 48 ----------- .../new-leave-request-instant.mjs | 39 --------- .../new-task-created/new-task-created.mjs | 27 ++++++ .../new-timesheet-entry-instant.mjs | 49 ----------- 9 files changed, 175 insertions(+), 166 deletions(-) create mode 100644 components/hr_cloud/sources/new-applicant-created/new-applicant-created.mjs create mode 100644 components/hr_cloud/sources/new-employee-created/new-employee-created.mjs delete mode 100644 components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs delete mode 100644 components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs create mode 100644 components/hr_cloud/sources/new-task-created/new-task-created.mjs delete mode 100644 components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs diff --git a/components/hr_cloud/actions/update-employee/update-employee.mjs b/components/hr_cloud/actions/update-employee/update-employee.mjs index 740a966aa36b4..9f8be4bab5502 100644 --- a/components/hr_cloud/actions/update-employee/update-employee.mjs +++ b/components/hr_cloud/actions/update-employee/update-employee.mjs @@ -3,7 +3,7 @@ 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_upsert)", + description: "Update an existing employee. [See the documentation](https://help.hrcloud.com/api/#/employee#PUT_employee)", version: "0.0.1", type: "action", props: { diff --git a/components/hr_cloud/hr_cloud.app.mjs b/components/hr_cloud/hr_cloud.app.mjs index 5734787160227..87c44a684ca8f 100644 --- a/components/hr_cloud/hr_cloud.app.mjs +++ b/components/hr_cloud/hr_cloud.app.mjs @@ -206,7 +206,6 @@ export default { }; try { - console.log(`Making request to: ${config.url}`); const response = await axios($, config); return response; } catch (error) { @@ -247,6 +246,18 @@ export default { ...args, }); }, + getApplicants(args = {}) { + return this._makeRequest({ + path: "/xApplicant", + ...args, + }); + }, + getTasks(args = {}) { + return this._makeRequest({ + path: "/xTask", + ...args, + }); + }, createEmployee(args = {}) { return this._makeRequest({ method: "POST", @@ -268,5 +279,29 @@ export default { ...args, }); }, + async *paginate({ + resourceFn, + params = {}, + max, + }) { + params = { + ...params, + page: 1, + }; + let total, count = 0; + do { + const items = await resourceFn({ + params, + }); + for (const item of items) { + yield item; + if (max && ++count >= max) { + return; + } + } + total = items?.length; + params.page++; + } while (total > 0); + }, }, }; diff --git a/components/hr_cloud/sources/common/base.mjs b/components/hr_cloud/sources/common/base.mjs index bce8724c8c887..74cdaccc96bf2 100644 --- a/components/hr_cloud/sources/common/base.mjs +++ b/components/hr_cloud/sources/common/base.mjs @@ -1,48 +1,77 @@ -import { ConfigurationError } from "@pipedream/platform"; import hrCloud from "../../hr_cloud.app.mjs"; +import { + DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, ConfigurationError, +} from "@pipedream/platform"; export default { - dedupe: "unique", props: { hrCloud, - http: "$.interface.http", db: "$.service.db", + timer: { + type: "$.interface.timer", + default: { + intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, + }, + }, }, hooks: { - async activate() { - const { id } = await this.hrCloud.createWebhook({ - eventType: this.getEventType(), - endpoint: this.http.endpoint, - metadata: this.getMetadata(), - }); - - this.db.set("webhookId", id); - }, - async deactivate() { - const webhookId = this.db.get("webhookId"); - if (webhookId) { - await this.hrCloud.deleteWebhook(webhookId); - } + async deploy() { + let results = await this.getResults(); + results = results.slice(-1 * 25); + results.forEach((item) => this.emitEvent(item)); }, }, methods: { - getEventType() { - throw new ConfigurationError("getEventType is not implemented"); + _getLastTs() { + return this.db.get("lastTs") || 0; }, - getMetadata() { + _setLastTs(lastTs) { + this.db.set("lastTs", lastTs); + }, + async getResults() { + const lastTs = this._getLastTs(); + let maxTs = lastTs; + + const resourceFn = this.getResourceFn(); + const params = this.getParams(); + const tsField = this.getTsField(); + + const items = this.hrCloud.paginate({ + resourceFn, + params, + }); + + const results = []; + for await (const item of items) { + const ts = Date.parse(item[tsField]); + if (ts >= lastTs) { + results.push(item); + maxTs = Math.max(maxTs, ts); + } + } + + this._setLastTs(maxTs); + return results; + }, + getParams() { return {}; }, + emitEvent(item) { + const meta = this.generateMeta(item); + this.$emit(item, meta); + }, + getResourceFn() { + throw new ConfigurationError("getResourceFn is not implemented"); + }, + getTsField() { + throw new ConfigurationError("getTsField is not implemented"); + }, generateMeta() { throw new ConfigurationError("generateMeta is not implemented"); }, }, - async run(event) { - const { body } = event; - if (!body) { - return; - } - - const meta = this.generateMeta(body); - this.$emit(body, meta); + async run() { + const results = await this.getResults(); + results.forEach((item) => this.emitEvent(item)); }, }; diff --git a/components/hr_cloud/sources/new-applicant-created/new-applicant-created.mjs b/components/hr_cloud/sources/new-applicant-created/new-applicant-created.mjs new file mode 100644 index 0000000000000..7aef00236dbc6 --- /dev/null +++ b/components/hr_cloud/sources/new-applicant-created/new-applicant-created.mjs @@ -0,0 +1,27 @@ +import common from "../common/base.mjs"; + +export default { + ...common, + key: "hr_cloud-new-applicant-created", + name: "New Applicant Created", + description: "Emit new event when a new applicant is created. [See the documentation](https://help.hrcloud.com/api/#/applicant#GET_applicants)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getResourceFn() { + return this.hrCloud.getApplicants; + }, + getTsField() { + return "xAppliedOn"; + }, + generateMeta(applicant) { + return { + id: applicant.Id, + summary: `New Applicant: ${applicant.xFirstName} ${applicant.xLastName}`, + ts: Date.parse(applicant[this.getTsField()]), + }; + }, + }, +}; diff --git a/components/hr_cloud/sources/new-employee-created/new-employee-created.mjs b/components/hr_cloud/sources/new-employee-created/new-employee-created.mjs new file mode 100644 index 0000000000000..fed4a95e47fca --- /dev/null +++ b/components/hr_cloud/sources/new-employee-created/new-employee-created.mjs @@ -0,0 +1,27 @@ +import common from "../common/base.mjs"; + +export default { + ...common, + key: "hr_cloud-new-employee", + name: "New Employee Created", + description: "Emit new event when a new employee is added to the system. [See the documentation](https://help.hrcloud.com/api/#/employee#GET_employee)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getResourceFn() { + return this.hrCloud.getEmployees; + }, + getTsField() { + return "xCreatedOn"; + }, + generateMeta(employee) { + return { + id: employee.Id, + summary: `New Employee: ${employee.xFirstName} ${employee.xLastName}`, + ts: Date.parse(employee[this.getTsField()]), + }; + }, + }, +}; diff --git a/components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs b/components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs deleted file mode 100644 index 221cfb5f8490d..0000000000000 --- a/components/hr_cloud/sources/new-employee-instant/new-employee-instant.mjs +++ /dev/null @@ -1,48 +0,0 @@ -import common from "../common/base.mjs"; - -export default { - ...common, - key: "hr_cloud-new-employee-instant", - name: "New Employee (Instant)", - description: "Emit new event when a new employee is added to the system. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", - version: "0.0.1", - type: "source", - props: { - ...common.props, - departmentId: { - propDefinition: [ - common.props.hrCloud, - "departmentId", - ], - }, - jobTitle: { - propDefinition: [ - common.props.hrCloud, - "jobTitle", - ], - }, - }, - methods: { - ...common.methods, - getEventType() { - return "employee.created"; - }, - getMetadata() { - const metadata = {}; - if (this.departmentId) { - metadata.department_id = this.departmentId; - } - if (this.jobTitle) { - metadata.job_title = this.jobTitle; - } - return metadata; - }, - generateMeta(data) { - return { - id: data.id, - summary: `New Employee: ${data.first_name} ${data.last_name}`, - ts: Date.parse(data.created_at), - }; - }, - }, -}; diff --git a/components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs b/components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs deleted file mode 100644 index 65e6720ef997c..0000000000000 --- a/components/hr_cloud/sources/new-leave-request-instant/new-leave-request-instant.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import common from "../common/base.mjs"; - -export default { - ...common, - key: "hr_cloud-new-leave-request-instant", - name: "New Leave Request (Instant)", - description: "Emit new event when an employee submits a leave request. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", - version: "0.0.1", - type: "source", - props: { - ...common.props, - leaveType: { - propDefinition: [ - common.props.hrCloud, - "leaveType", - ], - }, - }, - methods: { - ...common.methods, - getEventType() { - return "leave_request.created"; - }, - getMetadata() { - const metadata = {}; - if (this.leaveType) { - metadata.leave_type = this.leaveType; - } - return metadata; - }, - generateMeta(data) { - return { - id: data.id, - summary: `New Leave Request: ${data.employee_name} - ${data.leave_type}`, - ts: Date.parse(data.created_at), - }; - }, - }, -}; diff --git a/components/hr_cloud/sources/new-task-created/new-task-created.mjs b/components/hr_cloud/sources/new-task-created/new-task-created.mjs new file mode 100644 index 0000000000000..5da347eb1503f --- /dev/null +++ b/components/hr_cloud/sources/new-task-created/new-task-created.mjs @@ -0,0 +1,27 @@ +import common from "../common/base.mjs"; + +export default { + ...common, + key: "hr_cloud-new-task-created", + name: "New Task Created", + description: "Emit new event when a new task is created. [See the documentation](https://help.hrcloud.com/api/#/task#GET_tasks)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getResourceFn() { + return this.hrCloud.getTasks; + }, + getTsField() { + return "xCreatedOn"; + }, + generateMeta(task) { + return { + id: task.Id, + summary: `New Task: ${task.xSubject}`, + ts: Date.parse(task[this.getTsField()]), + }; + }, + }, +}; diff --git a/components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs b/components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs deleted file mode 100644 index f216fa9867f63..0000000000000 --- a/components/hr_cloud/sources/new-timesheet-entry-instant/new-timesheet-entry-instant.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import common from "../common/base.mjs"; - -export default { - ...common, - key: "hr_cloud-new-timesheet-entry-instant", - name: "New Timesheet Entry (Instant)", - description: "Emit new event when an employee logs a new timesheet entry. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)", - version: "0.0.1", - type: "source", - props: { - ...common.props, - projectId: { - propDefinition: [ - common.props.hrCloud, - "projectId", - ], - }, - employeeId: { - propDefinition: [ - common.props.hrCloud, - "employeeId", - ], - optional: true, - }, - }, - methods: { - ...common.methods, - getEventType() { - return "timesheet_entry.created"; - }, - getMetadata() { - const metadata = {}; - if (this.projectId) { - metadata.project_id = this.projectId; - } - if (this.employeeId) { - metadata.employee_id = this.employeeId; - } - return metadata; - }, - generateMeta(data) { - return { - id: data.id, - summary: `New Timesheet Entry: ${data.employee_name} - ${data.hours} hours`, - ts: Date.parse(data.created_at), - }; - }, - }, -}; From 6c60df1587a43a5ee0b768107f490471814928f3 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 15:26:33 -0500 Subject: [PATCH 13/18] package.json --- components/hr_cloud/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hr_cloud/package.json b/components/hr_cloud/package.json index 96b0964f013bb..8b8b4ffead63e 100644 --- a/components/hr_cloud/package.json +++ b/components/hr_cloud/package.json @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.6.0" + "@pipedream/platform": "^3.0.3" } } From b3e218a8ea6d60cbd216b47748e20b4ab218d908 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 15:28:14 -0500 Subject: [PATCH 14/18] pnpm-lock.yaml --- pnpm-lock.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e16d3096ce53..612bc8b209bc2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5993,8 +5993,8 @@ importers: components/hr_cloud: dependencies: '@pipedream/platform': - specifier: ^1.6.0 - version: 1.6.6 + specifier: ^3.0.3 + version: 3.0.3 components/hr_partner: {} @@ -14843,7 +14843,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.6))(jiti@1.21.6)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -46892,7 +46892,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -46906,10 +46906,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 7.26.0 + '@babel/core': 8.0.0-alpha.13 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) + babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) esbuild: 0.24.2 ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): From 40f78169148cd6ab58e1bcfc42ea1e90199b2db3 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 15:29:50 -0500 Subject: [PATCH 15/18] pnpm-lock.yaml --- pnpm-lock.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 612bc8b209bc2..d726b2a9e83c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14843,7 +14843,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.6))(jiti@1.21.6)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -46892,7 +46892,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -46906,10 +46906,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 8.0.0-alpha.13 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) + babel-jest: 29.7.0(@babel/core@7.26.0) esbuild: 0.24.2 ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): From d10b085a39aca3974683d3b8af0c3f5cb49dae3f Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 15:33:34 -0500 Subject: [PATCH 16/18] fix key --- .../sources/new-employee-created/new-employee-created.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hr_cloud/sources/new-employee-created/new-employee-created.mjs b/components/hr_cloud/sources/new-employee-created/new-employee-created.mjs index fed4a95e47fca..93c774c9a10b6 100644 --- a/components/hr_cloud/sources/new-employee-created/new-employee-created.mjs +++ b/components/hr_cloud/sources/new-employee-created/new-employee-created.mjs @@ -2,7 +2,7 @@ import common from "../common/base.mjs"; export default { ...common, - key: "hr_cloud-new-employee", + key: "hr_cloud-new-employee-created", name: "New Employee Created", description: "Emit new event when a new employee is added to the system. [See the documentation](https://help.hrcloud.com/api/#/employee#GET_employee)", version: "0.0.1", From 0e64952e8fa5618b5c0ea39a9ed61c7f1e2cced6 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 15:34:13 -0500 Subject: [PATCH 17/18] update package.json version --- components/hr_cloud/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hr_cloud/package.json b/components/hr_cloud/package.json index 8b8b4ffead63e..c4c3ca3727f22 100644 --- a/components/hr_cloud/package.json +++ b/components/hr_cloud/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hr_cloud", - "version": "0.0.2", + "version": "0.1.0", "description": "Pipedream HR Cloud Components", "main": "hr_cloud.app.mjs", "keywords": [ From d75019da97e9eda1ba56f6494a14dfe8adf564f1 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 6 Mar 2025 15:39:57 -0500 Subject: [PATCH 18/18] fix employeeNumber prop --- components/hr_cloud/actions/create-employee/create-employee.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hr_cloud/actions/create-employee/create-employee.mjs b/components/hr_cloud/actions/create-employee/create-employee.mjs index c108e45f158d0..f9bed64eeda36 100644 --- a/components/hr_cloud/actions/create-employee/create-employee.mjs +++ b/components/hr_cloud/actions/create-employee/create-employee.mjs @@ -106,7 +106,7 @@ export default { xStartDate: this.startDate, xLocationLookup: this.locationId, xEmploymentStatusLookup: this.employmentStatus, - xEmploymentNumber: this.employmentNumber, + xEmployeeNumber: this.employeeNumber, xRecordStatus: this.recordStatus, xAddress1: this.address, xCity: this.city,