Skip to content

Commit 3dcdab8

Browse files
committed
cats init
1 parent 8b37319 commit 3dcdab8

File tree

8 files changed

+849
-5
lines changed

8 files changed

+849
-5
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import cats from "../../cats.app.mjs";
2+
3+
export default {
4+
key: "cats-add-candidate-pipeline",
5+
name: "Add Candidate to Job Pipeline",
6+
description: "Adds a specific candidate to a job pipeline in CATS. [See the documentation](https://docs.catsone.com/api/v3/)",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
cats,
11+
candidateId: {
12+
propDefinition: [
13+
cats,
14+
"candidateId",
15+
],
16+
},
17+
jobId: {
18+
propDefinition: [
19+
cats,
20+
"jobId",
21+
],
22+
},
23+
rating: {
24+
propDefinition: [
25+
cats,
26+
"rating",
27+
],
28+
optional: true,
29+
},
30+
},
31+
async run({ $ }) {
32+
const data = {
33+
candidate_id: this.candidateId,
34+
job_id: this.jobId,
35+
};
36+
37+
if (this.rating !== undefined) {
38+
data.rating = this.rating;
39+
}
40+
41+
const response = await this.cats.addCandidateToJobPipeline(data);
42+
$.export("$summary", `Successfully added candidate ID ${this.candidateId} to job pipeline ID ${this.jobId}`);
43+
return response;
44+
},
45+
};
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
import cats from "../../cats.app.mjs";
2+
3+
export default {
4+
key: "cats-create-candidate",
5+
name: "Create Candidate",
6+
description: "Create a new candidate in your CATS database. [See the documentation](https://docs.catsone.com/api/v3/#create-a-candidate)",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
cats,
11+
checkDuplicate: {
12+
propDefinition: [
13+
cats,
14+
"checkDuplicate",
15+
],
16+
},
17+
firstName: {
18+
propDefinition: [
19+
cats,
20+
"firstName",
21+
],
22+
},
23+
lastName: {
24+
propDefinition: [
25+
cats,
26+
"lastName",
27+
],
28+
},
29+
middleName: {
30+
propDefinition: [
31+
cats,
32+
"middleName",
33+
],
34+
optional: true,
35+
},
36+
title: {
37+
propDefinition: [
38+
cats,
39+
"title",
40+
],
41+
optional: true,
42+
},
43+
phones: {
44+
propDefinition: [
45+
cats,
46+
"phones",
47+
],
48+
optional: true,
49+
},
50+
address: {
51+
propDefinition: [
52+
cats,
53+
"address",
54+
],
55+
optional: true,
56+
},
57+
countryCode: {
58+
propDefinition: [
59+
cats,
60+
"countryCode",
61+
],
62+
optional: true,
63+
},
64+
socialMediaUrls: {
65+
propDefinition: [
66+
cats,
67+
"socialMediaUrls",
68+
],
69+
optional: true,
70+
},
71+
website: {
72+
propDefinition: [
73+
cats,
74+
"website",
75+
],
76+
optional: true,
77+
},
78+
bestTimeToCall: {
79+
propDefinition: [
80+
cats,
81+
"bestTimeToCall",
82+
],
83+
optional: true,
84+
},
85+
currentEmployer: {
86+
propDefinition: [
87+
cats,
88+
"currentEmployer",
89+
],
90+
optional: true,
91+
},
92+
dateAvailable: {
93+
propDefinition: [
94+
cats,
95+
"dateAvailable",
96+
],
97+
optional: true,
98+
},
99+
desiredPay: {
100+
propDefinition: [
101+
cats,
102+
"desiredPay",
103+
],
104+
optional: true,
105+
},
106+
isWillingToRelocate: {
107+
propDefinition: [
108+
cats,
109+
"isWillingToRelocate",
110+
],
111+
optional: true,
112+
},
113+
keySkills: {
114+
propDefinition: [
115+
cats,
116+
"keySkills",
117+
],
118+
optional: true,
119+
},
120+
notes: {
121+
propDefinition: [
122+
cats,
123+
"notes",
124+
],
125+
optional: true,
126+
},
127+
source: {
128+
propDefinition: [
129+
cats,
130+
"source",
131+
],
132+
optional: true,
133+
},
134+
ownerId: {
135+
propDefinition: [
136+
cats,
137+
"ownerId",
138+
],
139+
optional: true,
140+
},
141+
workHistory: {
142+
propDefinition: [
143+
cats,
144+
"workHistory",
145+
],
146+
optional: true,
147+
},
148+
},
149+
async run({ $ }) {
150+
const candidateData = {
151+
check_duplicate: this.checkDuplicate,
152+
first_name: this.firstName,
153+
last_name: this.lastName,
154+
middle_name: this.middleName,
155+
title: this.title,
156+
phones: this.phones
157+
? this.phones.map(JSON.parse)
158+
: undefined,
159+
address: this.address,
160+
country_code: this.countryCode,
161+
social_media_urls: this.socialMediaUrls
162+
? this.socialMediaUrls.map(JSON.parse)
163+
: undefined,
164+
website: this.website,
165+
best_time_to_call: this.bestTimeToCall,
166+
current_employer: this.currentEmployer,
167+
date_available: this.dateAvailable,
168+
desired_pay: this.desiredPay,
169+
is_willing_to_relocate: this.isWillingToRelocate,
170+
key_skills: this.keySkills,
171+
notes: this.notes,
172+
source: this.source,
173+
owner_id: this.ownerId,
174+
work_history: this.workHistory
175+
? this.workHistory.map(JSON.parse)
176+
: undefined,
177+
};
178+
179+
const response = await this.cats.createCandidate(candidateData);
180+
181+
$.export("$summary", `Created candidate with ID ${response.id}`);
182+
return response;
183+
},
184+
};
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import cats from "../../cats.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "cats-create-contact",
6+
name: "Create Contact",
7+
description: "Adds a new contact to the CATS platform. [See the documentation](https://docs.catsone.com/api/v3/)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
cats,
12+
firstName: {
13+
propDefinition: [
14+
cats,
15+
"firstName",
16+
],
17+
},
18+
lastName: {
19+
propDefinition: [
20+
cats,
21+
"lastName",
22+
],
23+
},
24+
ownerId: {
25+
propDefinition: [
26+
cats,
27+
"ownerId",
28+
],
29+
},
30+
companyId: {
31+
propDefinition: [
32+
cats,
33+
"companyId",
34+
],
35+
},
36+
title: {
37+
propDefinition: [
38+
cats,
39+
"title",
40+
],
41+
optional: true,
42+
},
43+
emails: {
44+
propDefinition: [
45+
cats,
46+
"emails",
47+
],
48+
optional: true,
49+
},
50+
phones: {
51+
propDefinition: [
52+
cats,
53+
"phones",
54+
],
55+
optional: true,
56+
},
57+
address: {
58+
propDefinition: [
59+
cats,
60+
"address",
61+
],
62+
optional: true,
63+
},
64+
countryCode: {
65+
propDefinition: [
66+
cats,
67+
"countryCode",
68+
],
69+
optional: true,
70+
},
71+
socialMediaUrls: {
72+
propDefinition: [
73+
cats,
74+
"socialMediaUrls",
75+
],
76+
optional: true,
77+
},
78+
isHot: {
79+
propDefinition: [
80+
cats,
81+
"isHot",
82+
],
83+
optional: true,
84+
},
85+
notes: {
86+
propDefinition: [
87+
cats,
88+
"notes",
89+
],
90+
optional: true,
91+
},
92+
customFields: {
93+
propDefinition: [
94+
cats,
95+
"customFields",
96+
],
97+
optional: true,
98+
},
99+
},
100+
async run({ $ }) {
101+
const data = {
102+
first_name: this.firstName,
103+
last_name: this.lastName,
104+
owner_id: this.ownerId,
105+
company_id: this.companyId,
106+
title: this.title,
107+
emails: this.emails,
108+
phones: this.phones,
109+
address: this.address,
110+
country_code: this.countryCode,
111+
social_media_urls: this.socialMediaUrls,
112+
is_hot: this.isHot,
113+
notes: this.notes,
114+
custom_fields: this.customFields,
115+
};
116+
117+
const response = await this.cats.createContact(data);
118+
$.export("$summary", `Contact created: ${response.id}`);
119+
return response;
120+
},
121+
};

0 commit comments

Comments
 (0)