Skip to content

Commit a55d2c7

Browse files
authored
[20836] feat(ashby): Add search-candidates, get-candidate actions (#20841)
* feat(ashby): Add search-candidates & get-candidate actions * chore(ashby): Bump minor version * chore(ashby): patch-bump all components due to ashby.app.mjs changes
1 parent b049cf5 commit a55d2c7

11 files changed

Lines changed: 115 additions & 8 deletions

File tree

components/ashby/actions/create-application/create-application.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "ashby-create-application",
55
name: "Create Application",
66
description: "Considers a candidate for a job (e.g., when sourcing a candidate for a job posting). [See the documentation](https://developers.ashbyhq.com/reference/applicationcreate)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
readOnlyHint: false,

components/ashby/actions/create-candidate/create-candidate.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "ashby-create-candidate",
55
name: "Create Candidate",
66
description: "Creates a new candidate in Ashby. [See the documentation](https://developers.ashbyhq.com/reference/candidatecreate)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,

components/ashby/actions/create-interview-schedule/create-interview-schedule.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "ashby-create-interview-schedule",
66
name: "Create Interview Schedule",
77
description: "Creates a scheduled interview. [See the documentation](https://developers.ashbyhq.com/reference/interviewschedulecreate)",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/ashby/actions/create-offer/create-offer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "ashby-create-offer",
66
name: "Create Offer",
77
description: "Creates a new offer. [See the documentation](https://developers.ashbyhq.com/reference/offercreate)",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "action",
1010
annotations: {
1111
destructiveHint: false,
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import app from "../../ashby.app.mjs";
2+
3+
export default {
4+
key: "ashby-get-candidate",
5+
name: "Get Candidate",
6+
description: "Retrieves the details of a specific candidate by ID. [See the documentation](https://developers.ashbyhq.com/reference/candidateinfo)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
app,
16+
candidateId: {
17+
propDefinition: [
18+
app,
19+
"candidateId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const {
25+
app,
26+
candidateId,
27+
} = this;
28+
29+
const response = await app.getCandidate({
30+
$,
31+
data: {
32+
id: candidateId,
33+
},
34+
});
35+
36+
$.export("$summary", `Successfully retrieved candidate \`${candidateId}\``);
37+
38+
return response;
39+
},
40+
};

components/ashby/actions/list-applications/list-applications.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "ashby-list-applications",
55
name: "List Applications",
66
description: "Retrieves a list of applications within an organization. [See the documentation](https://developers.ashbyhq.com/reference/applicationlist)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import app from "../../ashby.app.mjs";
3+
4+
export default {
5+
key: "ashby-search-candidates",
6+
name: "Search Candidates",
7+
description: "Search candidates by email and/or name. Limited to 100 results. [See the documentation](https://developers.ashbyhq.com/reference/candidatesearch)",
8+
version: "0.0.1",
9+
type: "action",
10+
annotations: {
11+
destructiveHint: false,
12+
openWorldHint: true,
13+
readOnlyHint: true,
14+
},
15+
props: {
16+
app,
17+
email: {
18+
propDefinition: [
19+
app,
20+
"email",
21+
],
22+
description: "The candidate's email address to search by",
23+
},
24+
name: {
25+
type: "string",
26+
label: "Name",
27+
description: "The candidate's name to search by",
28+
optional: true,
29+
},
30+
},
31+
async run({ $ }) {
32+
const {
33+
app,
34+
email,
35+
name,
36+
} = this;
37+
38+
if (!email && !name) {
39+
throw new ConfigurationError("Please provide at least one of `Email` or `Name` to search by.");
40+
}
41+
42+
const response = await app.searchCandidates({
43+
$,
44+
data: {
45+
email,
46+
name,
47+
},
48+
});
49+
50+
const count = response?.results?.length ?? 0;
51+
$.export("$summary", `Successfully retrieved \`${count}\` candidate(s)`);
52+
53+
return response;
54+
},
55+
};

components/ashby/actions/start-offer-process/start-offer-process.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "ashby-start-offer-process",
55
name: "Start Offer Process",
66
description: "Starts an offer process for a candidate. [See the documentation](https://developers.ashbyhq.com/reference/offerprocessstart)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,

components/ashby/actions/start-offer/start-offer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "ashby-start-offer",
55
name: "Start Offer",
66
description: "Starts an offer and returns an offer form instance that can be filled out and submitted. [See the documentation](https://developers.ashbyhq.com/reference/offerstart)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,

components/ashby/ashby.app.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,18 @@ export default {
352352
...args,
353353
});
354354
},
355+
searchCandidates(args = {}) {
356+
return this.post({
357+
path: "/candidate.search",
358+
...args,
359+
});
360+
},
361+
getCandidate(args = {}) {
362+
return this.post({
363+
path: "/candidate.info",
364+
...args,
365+
});
366+
},
355367
async paginate({
356368
max = 600, fn, fnArgs, keyField = "results",
357369
} = {}) {

0 commit comments

Comments
 (0)