Skip to content

Commit 7572818

Browse files
committed
easyhire init
1 parent 44871be commit 7572818

File tree

3 files changed

+94
-4
lines changed

3 files changed

+94
-4
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import easyhire from "../../easyhire.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "easyhire-assess-candidate",
6+
name: "Assess Candidate",
7+
description: "Assess a specific candidate on EasyHire. The user needs to input the candidate's id and their evaluation score. An optional prop is comments about the candidate's performance.",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
easyhire,
12+
candidateId: {
13+
type: "string",
14+
label: "Candidate ID",
15+
description: "The ID of the candidate to be assessed",
16+
},
17+
evaluationScore: {
18+
type: "integer",
19+
label: "Evaluation Score",
20+
description: "The score of the candidate's evaluation",
21+
},
22+
comments: {
23+
type: "string",
24+
label: "Comments",
25+
description: "Comments about the candidate's performance",
26+
optional: true,
27+
},
28+
},
29+
async run({ $ }) {
30+
const response = await this.easyhire.assessCandidate({
31+
candidateId: this.candidateId,
32+
evaluationScore: this.evaluationScore,
33+
comments: this.comments || "",
34+
});
35+
$.export("$summary", `Successfully assessed candidate ${this.candidateId}`);
36+
return response;
37+
},
38+
};
Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,63 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "easyhire",
4-
propDefinitions: {},
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+
},
524
methods: {
6-
// this.$auth contains connected account data
25+
_baseUrl() {
26+
return "https://easyhire.ai/api";
27+
},
28+
async _makeRequest(opts = {}) {
29+
const {
30+
$ = this,
31+
method = "GET",
32+
path,
33+
headers,
34+
...otherOpts
35+
} = opts;
36+
return axios($, {
37+
...otherOpts,
38+
method,
39+
url: this._baseUrl() + path,
40+
headers: {
41+
...headers,
42+
"Content-Type": "application/json",
43+
"Authorization": `Api-Key ${this.$auth.api_key}`,
44+
},
45+
});
46+
},
47+
async assessCandidate({
48+
candidateId, evaluationScore, comments,
49+
}) {
50+
return this._makeRequest({
51+
method: "POST",
52+
path: `/candidate/${candidateId}/score/`,
53+
data: {
54+
score: evaluationScore,
55+
comments: comments || "",
56+
},
57+
});
58+
},
759
authKeys() {
860
console.log(Object.keys(this.$auth));
961
},
1062
},
11-
};
63+
};

components/easyhire/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
"publishConfig": {
1313
"access": "public"
1414
}
15-
}
15+
}

0 commit comments

Comments
 (0)