Skip to content

Commit 3a5ab17

Browse files
committed
create-application
1 parent 7572818 commit 3a5ab17

File tree

4 files changed

+61
-68
lines changed

4 files changed

+61
-68
lines changed

components/easyhire/actions/assess-candidate/assess-candidate.mjs

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import easyhire from "../../easyhire.app.mjs";
2+
3+
export default {
4+
key: "easyhire-create-application",
5+
name: "Create Application",
6+
description: "Creates a new application in EasyHire. [See the documentation](https://easyhire.ai/integrations/api-docs/)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
easyhire,
11+
jobOpeningId: {
12+
type: "string",
13+
label: "Job Opening ID",
14+
description: "The ID of the job opening to create the application for",
15+
},
16+
applicantEmail: {
17+
type: "string",
18+
label: "Applicant Email",
19+
description: "The email address of the applicant",
20+
},
21+
applicantName: {
22+
type: "string",
23+
label: "Applicant Name",
24+
description: "The name of the applicant",
25+
},
26+
resumePdf: {
27+
type: "string",
28+
label: "Resume PDF",
29+
description: "The URL of a .pdf file containing the applicant's resume",
30+
},
31+
uniqueExternalId: {
32+
type: "string",
33+
label: "Unique External ID",
34+
description: "A unique external ID representing the application",
35+
optional: true,
36+
},
37+
},
38+
async run({ $ }) {
39+
const response = await this.easyhire.createApplication({
40+
$,
41+
data: {
42+
job_opening_id: this.jobOpeningId,
43+
applicant_email: this.applicantEmail,
44+
applicant_name: this.applicantName,
45+
resume_pdf: this.resumePdf,
46+
unique_external_id: this.uniqueExternalId,
47+
},
48+
});
49+
$.export("$summary", `Successfully created application for ${this.applicantName}`);
50+
return response;
51+
},
52+
};

components/easyhire/easyhire.app.mjs

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,7 @@ import { axios } from "@pipedream/platform";
33
export default {
44
type: "app",
55
app: "easyhire",
6-
propDefinitions: {
7-
candidateId: {
8-
type: "string",
9-
label: "Candidate ID",
10-
description: "The ID of the candidate to be assessed",
11-
},
12-
evaluationScore: {
13-
type: "integer",
14-
label: "Evaluation Score",
15-
description: "The score of the candidate's evaluation",
16-
},
17-
comments: {
18-
type: "string",
19-
label: "Comments",
20-
description: "Comments about the candidate's performance",
21-
optional: true,
22-
},
23-
},
6+
propDefinitions: {},
247
methods: {
258
_baseUrl() {
269
return "https://easyhire.ai/api";
@@ -41,23 +24,16 @@ export default {
4124
...headers,
4225
"Content-Type": "application/json",
4326
"Authorization": `Api-Key ${this.$auth.api_key}`,
27+
"Accept-Version": "v1",
4428
},
4529
});
4630
},
47-
async assessCandidate({
48-
candidateId, evaluationScore, comments,
49-
}) {
31+
createApplication(opts = {}) {
5032
return this._makeRequest({
5133
method: "POST",
52-
path: `/candidate/${candidateId}/score/`,
53-
data: {
54-
score: evaluationScore,
55-
comments: comments || "",
56-
},
34+
path: "/create-application/",
35+
...opts,
5736
});
5837
},
59-
authKeys() {
60-
console.log(Object.keys(this.$auth));
61-
},
6238
},
6339
};

components/easyhire/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/easyhire",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream easyhire Components",
55
"main": "easyhire.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
1518
}

0 commit comments

Comments
 (0)