@pipedream/taleez 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/add-candidate-to-job/add-candidate-to-job.mjs +42 -0
- package/actions/create-candidate/create-candidate.mjs +65 -0
- package/actions/list-candidate-id-options/list-candidate-id-options.mjs +33 -0
- package/actions/list-job-id-options/list-job-id-options.mjs +33 -0
- package/actions/list-jobs/list-jobs.mjs +79 -0
- package/actions/list-recruiter-id-options/list-recruiter-id-options.mjs +33 -0
- package/actions/list-unit-id-options/list-unit-id-options.mjs +33 -0
- package/package.json +4 -1
- package/sources/common/base.mjs +72 -0
- package/sources/new-candidate-created/new-candidate-created.mjs +34 -0
- package/sources/new-job-listed/new-job-listed.mjs +77 -0
- package/taleez.app.mjs +219 -5
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "taleez-add-candidate-to-job",
|
|
5
|
+
name: "Add Candidate to Job",
|
|
6
|
+
description: "Links an existing candidate to a job offer. [See the documentation](https://api.taleez.com/swagger-ui/index.html#/jobs/addCandidate_1)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
taleez,
|
|
16
|
+
candidateId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
taleez,
|
|
19
|
+
"candidateId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
jobId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
taleez,
|
|
25
|
+
"jobId",
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
async run({ $ }) {
|
|
30
|
+
const response = await this.taleez.linkCandidateToJob({
|
|
31
|
+
$,
|
|
32
|
+
jobId: this.jobId,
|
|
33
|
+
data: {
|
|
34
|
+
ids: [
|
|
35
|
+
this.candidateId,
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
$.export("$summary", `Linked candidate ${this.candidateId} to job ${this.jobId} successfully`);
|
|
40
|
+
return response;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "taleez-create-candidate",
|
|
5
|
+
name: "Create Candidate",
|
|
6
|
+
description: "Creates a new candidate in Taleez. [See the documentation](https://api.taleez.com/swagger-ui/index.html#/candidates/create_1)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
taleez,
|
|
16
|
+
firstName: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "First Name",
|
|
19
|
+
description: "First name of the candidate",
|
|
20
|
+
},
|
|
21
|
+
lastName: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Last Name",
|
|
24
|
+
description: "Last name of the candidate",
|
|
25
|
+
},
|
|
26
|
+
email: {
|
|
27
|
+
type: "string",
|
|
28
|
+
label: "Email",
|
|
29
|
+
description: "Candidate email address. Must be unique in your company",
|
|
30
|
+
},
|
|
31
|
+
phone: {
|
|
32
|
+
type: "string",
|
|
33
|
+
label: "Phone",
|
|
34
|
+
description: "Candidate phone (formats : 0611223344, +33611223344, 00336112233). Ignored if not valid.",
|
|
35
|
+
optional: true,
|
|
36
|
+
},
|
|
37
|
+
unitId: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
taleez,
|
|
40
|
+
"unitId",
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
recruiterId: {
|
|
44
|
+
propDefinition: [
|
|
45
|
+
taleez,
|
|
46
|
+
"recruiterId",
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
async run({ $ }) {
|
|
51
|
+
const response = await this.taleez.createCandidate({
|
|
52
|
+
$,
|
|
53
|
+
data: {
|
|
54
|
+
firstName: this.firstName,
|
|
55
|
+
lastName: this.lastName,
|
|
56
|
+
mail: this.email,
|
|
57
|
+
phone: this.phone,
|
|
58
|
+
unitId: this.unitId,
|
|
59
|
+
recruiterId: this.recruiterId,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
$.export("$summary", `Created candidate ${this.firstName} ${this.lastName} successfully`);
|
|
63
|
+
return response;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "taleez-list-candidate-id-options",
|
|
5
|
+
name: "List Candidate ID Options",
|
|
6
|
+
description: "Retrieves available options for the Candidate ID field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
taleez,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await taleez.propDefinitions.candidateId.options.call(this.taleez, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "taleez-list-job-id-options",
|
|
5
|
+
name: "List Job Listing ID Options",
|
|
6
|
+
description: "Retrieves available options for the Job Listing ID field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
taleez,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await taleez.propDefinitions.jobId.options.call(this.taleez, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "taleez-list-jobs",
|
|
5
|
+
name: "List Jobs",
|
|
6
|
+
description: "Retrieves a list of jobs in your company. [See the documentation](https://api.taleez.com/swagger-ui/index.html#/jobs/list_3)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
taleez,
|
|
16
|
+
unitId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
taleez,
|
|
19
|
+
"unitId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
status: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
taleez,
|
|
25
|
+
"status",
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
contract: {
|
|
29
|
+
propDefinition: [
|
|
30
|
+
taleez,
|
|
31
|
+
"contract",
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
city: {
|
|
35
|
+
propDefinition: [
|
|
36
|
+
taleez,
|
|
37
|
+
"city",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
companyLabel: {
|
|
41
|
+
propDefinition: [
|
|
42
|
+
taleez,
|
|
43
|
+
"companyLabel",
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
tag: {
|
|
47
|
+
propDefinition: [
|
|
48
|
+
taleez,
|
|
49
|
+
"tag",
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
maxResults: {
|
|
53
|
+
type: "integer",
|
|
54
|
+
label: "Max Results",
|
|
55
|
+
description: "The maximum number of jobs to retrieve. Default: `100`",
|
|
56
|
+
optional: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
async run({ $ }) {
|
|
60
|
+
const { list: jobs } = await this.taleez.listJobs({
|
|
61
|
+
$,
|
|
62
|
+
params: {
|
|
63
|
+
unitId: this.unitId,
|
|
64
|
+
status: this.status,
|
|
65
|
+
contract: this.contract,
|
|
66
|
+
city: this.city,
|
|
67
|
+
companyLabel: this.companyLabel,
|
|
68
|
+
tag: this.tag,
|
|
69
|
+
pageSize: this.maxResults,
|
|
70
|
+
withDetails: true,
|
|
71
|
+
withProps: true,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
$.export("$summary", `Successfully retrieved ${jobs?.length} job${jobs?.length === 1
|
|
75
|
+
? ""
|
|
76
|
+
: "s"}`);
|
|
77
|
+
return jobs;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "taleez-list-recruiter-id-options",
|
|
5
|
+
name: "List Recruiter ID Options",
|
|
6
|
+
description: "Retrieves available options for the Recruiter ID field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
taleez,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await taleez.propDefinitions.recruiterId.options.call(this.taleez, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "taleez-list-unit-id-options",
|
|
5
|
+
name: "List Unit ID Options",
|
|
6
|
+
description: "Retrieves available options for the Unit ID field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
taleez,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await taleez.propDefinitions.unitId.options.call(this.taleez, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/taleez",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Pipedream Taleez Components",
|
|
5
5
|
"main": "taleez.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^3.1.1"
|
|
14
17
|
}
|
|
15
18
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import taleez from "../../taleez.app.mjs";
|
|
2
|
+
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
taleez,
|
|
7
|
+
db: "$.service.db",
|
|
8
|
+
timer: {
|
|
9
|
+
type: "$.interface.timer",
|
|
10
|
+
default: {
|
|
11
|
+
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
_getLastTs() {
|
|
17
|
+
return this.db.get("lastTs") || 0;
|
|
18
|
+
},
|
|
19
|
+
_setLastTs(lastTs) {
|
|
20
|
+
this.db.set("lastTs", lastTs);
|
|
21
|
+
},
|
|
22
|
+
emitEvent(item) {
|
|
23
|
+
const meta = this.generateMeta(item);
|
|
24
|
+
this.$emit(item, meta);
|
|
25
|
+
},
|
|
26
|
+
async processEvent(max) {
|
|
27
|
+
const lastTs = this._getLastTs();
|
|
28
|
+
let maxTs = lastTs;
|
|
29
|
+
const tsField = this.getTsField();
|
|
30
|
+
|
|
31
|
+
const results = this.taleez.paginate({
|
|
32
|
+
fn: this.getResourceFn(),
|
|
33
|
+
args: this.getArgs(),
|
|
34
|
+
max,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
for await (const item of results) {
|
|
38
|
+
if (tsField) {
|
|
39
|
+
const ts = item[tsField];
|
|
40
|
+
if (ts > lastTs) {
|
|
41
|
+
this.emitEvent(item);
|
|
42
|
+
maxTs = Math.max(ts, maxTs);
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
this.emitEvent(item);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this._setLastTs(maxTs);
|
|
50
|
+
},
|
|
51
|
+
getArgs() {
|
|
52
|
+
return {};
|
|
53
|
+
},
|
|
54
|
+
getTsField() {
|
|
55
|
+
return undefined;
|
|
56
|
+
},
|
|
57
|
+
getResourceFn() {
|
|
58
|
+
throw new Error("getResourceFn is not implemented");
|
|
59
|
+
},
|
|
60
|
+
generateMeta() {
|
|
61
|
+
throw new Error("generateMeta is not implemented");
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
hooks: {
|
|
65
|
+
async deploy() {
|
|
66
|
+
await this.processEvent(25);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
async run() {
|
|
70
|
+
await this.processEvent();
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import common from "../common/base.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "taleez-new-candidate-created",
|
|
6
|
+
name: "New Candidate Created",
|
|
7
|
+
description: "Emit new event when a candidate is added in Taleez. [See the documentation](https://api.taleez.com/swagger-ui/index.html#/candidates/list_4)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "source",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
methods: {
|
|
12
|
+
...common.methods,
|
|
13
|
+
getResourceFn() {
|
|
14
|
+
return this.taleez.listCandidates;
|
|
15
|
+
},
|
|
16
|
+
getArgs() {
|
|
17
|
+
return {
|
|
18
|
+
params: {
|
|
19
|
+
withProps: true,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
getTsField() {
|
|
24
|
+
return "dateCreation";
|
|
25
|
+
},
|
|
26
|
+
generateMeta(candidate) {
|
|
27
|
+
return {
|
|
28
|
+
id: candidate.id,
|
|
29
|
+
summary: `New Candidate: ${candidate.firstName} ${candidate.lastName}`,
|
|
30
|
+
ts: candidate.dateCreation,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import common from "../common/base.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "taleez-new-job-listed",
|
|
6
|
+
name: "New Job Listing Created",
|
|
7
|
+
description: "Emit new event when a job listing is created in Taleez. [See the documentation](https://api.taleez.com/swagger-ui/index.html#/jobs/list_3)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "source",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
unitId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
common.props.taleez,
|
|
16
|
+
"unitId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
status: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
common.props.taleez,
|
|
22
|
+
"status",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
contract: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
common.props.taleez,
|
|
28
|
+
"contract",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
city: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
common.props.taleez,
|
|
34
|
+
"city",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
companyLabel: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
common.props.taleez,
|
|
40
|
+
"companyLabel",
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
tag: {
|
|
44
|
+
propDefinition: [
|
|
45
|
+
common.props.taleez,
|
|
46
|
+
"tag",
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
...common.methods,
|
|
52
|
+
getResourceFn() {
|
|
53
|
+
return this.taleez.listJobs;
|
|
54
|
+
},
|
|
55
|
+
getArgs() {
|
|
56
|
+
return {
|
|
57
|
+
params: {
|
|
58
|
+
unitId: this.unitId,
|
|
59
|
+
status: this.status,
|
|
60
|
+
contract: this.contract,
|
|
61
|
+
city: this.city,
|
|
62
|
+
companyLabel: this.companyLabel,
|
|
63
|
+
tag: this.tag,
|
|
64
|
+
withDetails: true,
|
|
65
|
+
withProps: true,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
generateMeta(job) {
|
|
70
|
+
return {
|
|
71
|
+
id: job.id,
|
|
72
|
+
summary: `New Job: ${job.label}`,
|
|
73
|
+
ts: job.dateCreation,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
package/taleez.app.mjs
CHANGED
|
@@ -1,11 +1,225 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
type: "app",
|
|
3
5
|
app: "taleez",
|
|
4
|
-
propDefinitions: {
|
|
6
|
+
propDefinitions: {
|
|
7
|
+
jobId: {
|
|
8
|
+
type: "string",
|
|
9
|
+
label: "Job Listing ID",
|
|
10
|
+
description: "The ID of the job listing",
|
|
11
|
+
async options({ page }) {
|
|
12
|
+
const { list } = await this.listJobs({
|
|
13
|
+
params: {
|
|
14
|
+
page,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
return list?.map(({
|
|
18
|
+
id: value, label,
|
|
19
|
+
}) => ({
|
|
20
|
+
label,
|
|
21
|
+
value,
|
|
22
|
+
}));
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
candidateId: {
|
|
26
|
+
type: "string",
|
|
27
|
+
label: "Candidate ID",
|
|
28
|
+
description: "The ID of the candidate to link",
|
|
29
|
+
async options({ page }) {
|
|
30
|
+
const { list } = await this.listCandidates({
|
|
31
|
+
params: {
|
|
32
|
+
page,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return list?.map(({
|
|
36
|
+
id: value, firstName, lastName,
|
|
37
|
+
}) => ({
|
|
38
|
+
label: `${firstName} ${lastName}`,
|
|
39
|
+
value,
|
|
40
|
+
}));
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
unitId: {
|
|
44
|
+
type: "string",
|
|
45
|
+
label: "Unit ID",
|
|
46
|
+
description: "Filter by unit ID",
|
|
47
|
+
optional: true,
|
|
48
|
+
async options({ page }) {
|
|
49
|
+
const { list } = await this.listUnits({
|
|
50
|
+
params: {
|
|
51
|
+
page,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
return list?.map(({
|
|
55
|
+
id: value, publicName: label,
|
|
56
|
+
}) => ({
|
|
57
|
+
label,
|
|
58
|
+
value,
|
|
59
|
+
}));
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
recruiterId: {
|
|
63
|
+
type: "string",
|
|
64
|
+
label: "Recruiter ID",
|
|
65
|
+
description: "The ID of the recruiter adding this candidate",
|
|
66
|
+
optional: true,
|
|
67
|
+
async options({ page }) {
|
|
68
|
+
const { list } = await this.listRecruiters({
|
|
69
|
+
params: {
|
|
70
|
+
page,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
return list?.map(({
|
|
74
|
+
id: value, firstName, lastName,
|
|
75
|
+
}) => ({
|
|
76
|
+
label: `${firstName} ${lastName}`,
|
|
77
|
+
value,
|
|
78
|
+
}));
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
status: {
|
|
82
|
+
type: "string",
|
|
83
|
+
label: "Status",
|
|
84
|
+
description: "Filter by job status",
|
|
85
|
+
options: [
|
|
86
|
+
"DRAFT",
|
|
87
|
+
"PUBLISHED",
|
|
88
|
+
"DONE",
|
|
89
|
+
"SUSPENDED",
|
|
90
|
+
],
|
|
91
|
+
optional: true,
|
|
92
|
+
},
|
|
93
|
+
contract: {
|
|
94
|
+
type: "string",
|
|
95
|
+
label: "Contract",
|
|
96
|
+
description: "Filter by job contract",
|
|
97
|
+
options: [
|
|
98
|
+
"CDI",
|
|
99
|
+
"CDD",
|
|
100
|
+
"INTERIM",
|
|
101
|
+
"FREELANCE",
|
|
102
|
+
"INTERNSHIP",
|
|
103
|
+
"APPRENTICESHIP",
|
|
104
|
+
"STUDENT",
|
|
105
|
+
"VIE",
|
|
106
|
+
"FRANCHISE",
|
|
107
|
+
"STATUTE",
|
|
108
|
+
"VACATAIRE",
|
|
109
|
+
"LIBERAL",
|
|
110
|
+
"CDI_CHANTIER",
|
|
111
|
+
"INTERMITTENT",
|
|
112
|
+
"SEASON",
|
|
113
|
+
"OTHER",
|
|
114
|
+
"VOLUNTEER",
|
|
115
|
+
"PERMANENT",
|
|
116
|
+
"FIXEDTERM",
|
|
117
|
+
],
|
|
118
|
+
optional: true,
|
|
119
|
+
},
|
|
120
|
+
city: {
|
|
121
|
+
type: "string",
|
|
122
|
+
label: "City",
|
|
123
|
+
description: "Filter by job city",
|
|
124
|
+
optional: true,
|
|
125
|
+
},
|
|
126
|
+
companyLabel: {
|
|
127
|
+
type: "string",
|
|
128
|
+
label: "Company Label",
|
|
129
|
+
description: "Filter by company label",
|
|
130
|
+
optional: true,
|
|
131
|
+
},
|
|
132
|
+
tag: {
|
|
133
|
+
type: "string",
|
|
134
|
+
label: "Tag",
|
|
135
|
+
description: "Filter by job tag",
|
|
136
|
+
optional: true,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
5
139
|
methods: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
140
|
+
_baseUrl() {
|
|
141
|
+
return "https://api.taleez.com/0";
|
|
142
|
+
},
|
|
143
|
+
_makeRequest({
|
|
144
|
+
$ = this,
|
|
145
|
+
path,
|
|
146
|
+
...otherOpts
|
|
147
|
+
}) {
|
|
148
|
+
return axios($, {
|
|
149
|
+
...otherOpts,
|
|
150
|
+
url: `${this._baseUrl()}${path}`,
|
|
151
|
+
headers: {
|
|
152
|
+
"x-taleez-api-secret": this.$auth.secret_key,
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
listJobs(opts = {}) {
|
|
157
|
+
return this._makeRequest({
|
|
158
|
+
path: "/jobs",
|
|
159
|
+
...opts,
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
listCandidates(opts = {}) {
|
|
163
|
+
return this._makeRequest({
|
|
164
|
+
path: "/candidates",
|
|
165
|
+
...opts,
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
listUnits(opts = {}) {
|
|
169
|
+
return this._makeRequest({
|
|
170
|
+
path: "/units",
|
|
171
|
+
...opts,
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
listRecruiters(opts = {}) {
|
|
175
|
+
return this._makeRequest({
|
|
176
|
+
path: "/recruiters",
|
|
177
|
+
...opts,
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
createCandidate(opts = {}) {
|
|
181
|
+
return this._makeRequest({
|
|
182
|
+
method: "POST",
|
|
183
|
+
path: "/candidates",
|
|
184
|
+
...opts,
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
linkCandidateToJob({
|
|
188
|
+
jobId, ...opts
|
|
189
|
+
}) {
|
|
190
|
+
return this._makeRequest({
|
|
191
|
+
method: "POST",
|
|
192
|
+
path: `/jobs/${jobId}/candidates`,
|
|
193
|
+
...opts,
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
async *paginate({
|
|
197
|
+
fn, args = {}, max,
|
|
198
|
+
}) {
|
|
199
|
+
let hasMorePages = true;
|
|
200
|
+
let page = 0;
|
|
201
|
+
let count = 0;
|
|
202
|
+
|
|
203
|
+
while (hasMorePages) {
|
|
204
|
+
const {
|
|
205
|
+
list, hasMore,
|
|
206
|
+
} = await fn({
|
|
207
|
+
...args,
|
|
208
|
+
params: {
|
|
209
|
+
...args?.params,
|
|
210
|
+
page,
|
|
211
|
+
pageSize: 1000,
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
for (const item of list) {
|
|
215
|
+
yield item;
|
|
216
|
+
if (max && ++count >= max) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
hasMorePages = hasMore;
|
|
221
|
+
page++;
|
|
222
|
+
}
|
|
9
223
|
},
|
|
10
224
|
},
|
|
11
|
-
};
|
|
225
|
+
};
|