-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - bamboohr #18197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New Components - bamboohr #18197
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
components/bamboohr/actions/add-application-comment/add-application-comment.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import bamboohr from "../../bamboohr.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "bamboohr-add-application-comment", | ||
| name: "Add Application Comment", | ||
| description: "Add a comment to an application. [See the documentation](https://documentation.bamboohr.com/reference/post-application-comment-1)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| bamboohr, | ||
| applicationId: { | ||
| propDefinition: [ | ||
| bamboohr, | ||
| "applicationId", | ||
| ], | ||
| }, | ||
| comment: { | ||
| type: "string", | ||
| label: "Comment", | ||
| description: "The comment to add to the application", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.bamboohr.addApplicationComment({ | ||
| $, | ||
| applicationId: this.applicationId, | ||
| data: { | ||
| comment: this.comment, | ||
| type: "comment", | ||
| }, | ||
| }); | ||
| $.export("$summary", `Added comment to application ${this.applicationId}`); | ||
| return response; | ||
| }, | ||
| }; |
57 changes: 57 additions & 0 deletions
57
components/bamboohr/actions/download-resume/download-resume.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import bamboohr from "../../bamboohr.app.mjs"; | ||
| import fs from "fs"; | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| key: "bamboohr-download-resume", | ||
| name: "Download Resume", | ||
| description: "Download a resume from an application. [See the documentation](https://documentation.bamboohr.com/reference/get-company-file)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| bamboohr, | ||
| applicationId: { | ||
| propDefinition: [ | ||
| bamboohr, | ||
| "applicationId", | ||
| ], | ||
| }, | ||
| filename: { | ||
| type: "string", | ||
| label: "Filename", | ||
| description: "The filename to save the downloaded file as in the `/tmp` directory", | ||
| }, | ||
| syncDir: { | ||
| type: "dir", | ||
| accessMode: "write", | ||
| sync: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { resumeFileId } = await this.bamboohr.getApplication({ | ||
| $, | ||
| applicationId: this.applicationId, | ||
| }); | ||
|
|
||
| if (!resumeFileId) { | ||
| throw new ConfigurationError("No resume file ID found for application"); | ||
| } | ||
|
|
||
| const response = await this.bamboohr.downloadFile({ | ||
| $, | ||
| fileId: resumeFileId, | ||
| }); | ||
|
|
||
| const rawcontent = response.toString("base64"); | ||
| const buffer = Buffer.from(rawcontent, "base64"); | ||
| const downloadedFilepath = `/tmp/${this.filename}`; | ||
| fs.writeFileSync(downloadedFilepath, buffer); | ||
|
|
||
| $.export("$summary", `Downloaded resume for application ${this.applicationId}`); | ||
|
|
||
| return { | ||
| filename: this.filename, | ||
| downloadedFilepath, | ||
| }; | ||
| }, | ||
| }; |
26 changes: 26 additions & 0 deletions
26
components/bamboohr/actions/get-application/get-application.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import bamboohr from "../../bamboohr.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "bamboohr-get-application", | ||
| name: "Get Application", | ||
| description: "Get the details of an application. [See the documentation](https://documentation.bamboohr.com/reference/get-application-details-1)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| bamboohr, | ||
| applicationId: { | ||
| propDefinition: [ | ||
| bamboohr, | ||
| "applicationId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.bamboohr.getApplication({ | ||
| $, | ||
| applicationId: this.applicationId, | ||
| }); | ||
| $.export("$summary", `Found application ${this.applicationId}`); | ||
| return response; | ||
| }, | ||
| }; |
93 changes: 93 additions & 0 deletions
93
components/bamboohr/actions/list-applications/list-applications.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| import bamboohr from "../../bamboohr.app.mjs"; | ||
| import constants from "../../common/constants.mjs"; | ||
|
|
||
| export default { | ||
| key: "bamboohr-list-applications", | ||
| name: "List Applications", | ||
| description: "List all applications. [See the documentation](https://documentation.bamboohr.com/reference/get-applications)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| bamboohr, | ||
| jobId: { | ||
| propDefinition: [ | ||
| bamboohr, | ||
| "jobId", | ||
| ], | ||
| }, | ||
| statusId: { | ||
| propDefinition: [ | ||
| bamboohr, | ||
| "statusId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| statusGroup: { | ||
| type: "string", | ||
| label: "Status Group", | ||
| description: "The group of statuses to filter by", | ||
| options: constants.APPLICATION_STATUS_GROUPS, | ||
| optional: true, | ||
| }, | ||
| jobStatusGroup: { | ||
| type: "string", | ||
| label: "Job Status Group", | ||
| description: "The group of job statuses to filter by", | ||
| options: constants.JOB_STATUS_GROUPS, | ||
| optional: true, | ||
| }, | ||
| searchString: { | ||
| type: "string", | ||
| label: "Search String", | ||
| description: "A general search criteria by which to find applications", | ||
| optional: true, | ||
| }, | ||
| sortBy: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "The field to sort by", | ||
| options: constants.APPLICATION_SORT_FIELDS, | ||
| optional: true, | ||
| }, | ||
| sortOrder: { | ||
| type: "string", | ||
| label: "Sort Order", | ||
| description: "The order in which to sort the results", | ||
| options: [ | ||
| "ASC", | ||
| "DESC", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| newSince: { | ||
| type: "string", | ||
| label: "New Since", | ||
| description: "Only get applications newer than a given UTC timestamp, for example `2024-01-01 13:00:00`", | ||
| optional: true, | ||
| }, | ||
| page: { | ||
| type: "integer", | ||
| label: "Page", | ||
| description: "The page number to return", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.bamboohr.listApplications({ | ||
| $, | ||
| params: { | ||
| jobId: this.jobId, | ||
| applicationStatusId: this.statusId, | ||
| applicationStatus: this.statusGroup, | ||
| jobStatusGroups: this.jobStatusGroup, | ||
| searchString: this.searchString, | ||
| sortBy: this.sortBy, | ||
| sortOrder: this.sortOrder, | ||
| newSince: this.newSince, | ||
| page: this.page, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Found ${response.applications.length} applications`); | ||
| return response; | ||
| }, | ||
| }; | ||
35 changes: 35 additions & 0 deletions
35
components/bamboohr/actions/update-application-status/update-application-status.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import bamboohr from "../../bamboohr.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "bamboohr-update-application-status", | ||
| name: "Update Application Status", | ||
| description: "Update the status of an application. [See the documentation](https://documentation.bamboohr.com/reference/post-applicant-status-1)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| bamboohr, | ||
| applicationId: { | ||
| propDefinition: [ | ||
| bamboohr, | ||
| "applicationId", | ||
| ], | ||
| }, | ||
| statusId: { | ||
| propDefinition: [ | ||
| bamboohr, | ||
| "statusId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.bamboohr.updateApplicationStatus({ | ||
| $, | ||
| applicationId: this.applicationId, | ||
| data: { | ||
| status: this.statusId, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Updated status of application."); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,119 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "bamboohr", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| applicationId: { | ||
| type: "string", | ||
| label: "Application ID", | ||
| description: "The ID of an application", | ||
| async options({ page }) { | ||
| const { applications } = await this.listApplications({ | ||
| params: { | ||
| page: page + 1, | ||
| }, | ||
| }); | ||
| return applications?.map((application) => ({ | ||
| label: `${application.applicant.firstName} ${application.applicant.lastName}`, | ||
| value: application.id, | ||
| })) || []; | ||
| }, | ||
| }, | ||
| jobId: { | ||
| type: "string", | ||
| label: "Job ID", | ||
| description: "The ID of a job", | ||
| optional: true, | ||
| async options() { | ||
| const jobs = await this.listJobs(); | ||
| return jobs?.map((job) => ({ | ||
| label: job.title.label, | ||
| value: job.id, | ||
| })) || []; | ||
| }, | ||
| }, | ||
| statusId: { | ||
| type: "string", | ||
| label: "Status ID", | ||
| description: "The ID of a job status", | ||
| async options() { | ||
| const statuses = await this.listStatuses(); | ||
| return statuses?.map((status) => ({ | ||
| label: status.name, | ||
| value: status.id, | ||
| })) || []; | ||
| }, | ||
| }, | ||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return `https://api.bamboohr.com/api/gateway.php/${this.$auth.company_domain}/v1`; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, path, ...opts | ||
| }) { | ||
| return axios($, { | ||
| url: `${this._baseUrl()}${path}`, | ||
| auth: { | ||
| username: `${this.$auth.api_key}`, | ||
| password: "x", | ||
| }, | ||
| ...opts, | ||
| }); | ||
| }, | ||
| getApplication({ | ||
| applicationId, ...opts | ||
| }) { | ||
| return this._makeRequest({ | ||
| path: `/applicant_tracking/applications/${applicationId}`, | ||
| ...opts, | ||
| }); | ||
| }, | ||
| listApplications(opts = {}) { | ||
| return this._makeRequest({ | ||
| path: "/applicant_tracking/applications", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| listJobs(opts = {}) { | ||
| return this._makeRequest({ | ||
| path: "/applicant_tracking/jobs", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| listStatuses(opts = {}) { | ||
| return this._makeRequest({ | ||
| path: "/applicant_tracking/statuses", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| addApplicationComment({ | ||
| applicationId, ...opts | ||
| }) { | ||
| return this._makeRequest({ | ||
| path: `/applicant_tracking/applications/${applicationId}/comments`, | ||
| method: "POST", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| updateApplicationStatus({ | ||
| applicationId, ...opts | ||
| }) { | ||
| return this._makeRequest({ | ||
| path: `/applicant_tracking/applications/${applicationId}/status`, | ||
| method: "POST", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| downloadFile({ | ||
| fileId, ...opts | ||
| }) { | ||
| return this._makeRequest({ | ||
| path: `/files/${fileId}`, | ||
| responseType: "arraybuffer", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.