Skip to content

Commit d608926

Browse files
committed
init
1 parent 4feefb4 commit d608926

File tree

9 files changed

+535
-16
lines changed

9 files changed

+535
-16
lines changed

components/niceboard/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import niceboard from "../../niceboard.app.mjs";
2+
3+
export default {
4+
key: "niceboard-create-category",
5+
name: "Create Category",
6+
description: "Creates a new job category within the niceboard app. This action can help in organizing job postings more effectively.",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
niceboard,
11+
name: {
12+
type: "string",
13+
label: "Category Name",
14+
description: "The name of the job category to be created",
15+
},
16+
},
17+
async run({ $ }) {
18+
const response = await this.niceboard.postCategory({
19+
data: {
20+
name: this.name,
21+
},
22+
});
23+
$.export("$summary", `Successfully created category with name ${this.name}`);
24+
return response;
25+
},
26+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import niceboard from "../../niceboard.app.mjs";
2+
3+
export default {
4+
key: "niceboard-create-job-alert",
5+
name: "Create Job Alert",
6+
description: "Generates a new job alert for a job seeker registered on the niceboard app",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
niceboard,
11+
jobSeekerId: {
12+
propDefinition: [
13+
niceboard,
14+
"jobSeekerId",
15+
],
16+
},
17+
keywords: {
18+
propDefinition: [
19+
niceboard,
20+
"keywords",
21+
],
22+
},
23+
frequency: {
24+
propDefinition: [
25+
niceboard,
26+
"frequency",
27+
],
28+
optional: true,
29+
},
30+
},
31+
async run({ $ }) {
32+
const options = {
33+
data: {
34+
jobSeekerId: this.jobSeekerId,
35+
keywords: this.keywords,
36+
frequency: this.frequency,
37+
},
38+
};
39+
const result = await this.niceboard.createJobAlert(options);
40+
41+
$.export("$summary", `Created job alert for job seeker ID: ${this.jobSeekerId}`);
42+
return result;
43+
},
44+
};
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import niceboard from "../../niceboard.app.mjs";
2+
3+
export default {
4+
key: "niceboard-create-job",
5+
name: "Create Job",
6+
description: "Creates a new job posting within the Niceboard app.",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
niceboard,
11+
title: {
12+
propDefinition: [
13+
niceboard,
14+
"title",
15+
],
16+
},
17+
description: {
18+
propDefinition: [
19+
niceboard,
20+
"description",
21+
],
22+
},
23+
category: {
24+
propDefinition: [
25+
niceboard,
26+
"category",
27+
],
28+
},
29+
company: {
30+
propDefinition: [
31+
niceboard,
32+
"company",
33+
],
34+
},
35+
jobType: {
36+
propDefinition: [
37+
niceboard,
38+
"jobType",
39+
],
40+
optional: true,
41+
},
42+
location: {
43+
propDefinition: [
44+
niceboard,
45+
"location",
46+
],
47+
optional: true,
48+
},
49+
salaryRange: {
50+
propDefinition: [
51+
niceboard,
52+
"salaryRange",
53+
],
54+
optional: true,
55+
},
56+
},
57+
async run({ $ }) {
58+
const response = await this.niceboard.postJob({
59+
data: {
60+
title: this.title,
61+
description: this.description,
62+
category: this.category,
63+
company: this.company,
64+
jobType: this.jobType,
65+
location: this.location,
66+
salaryRange: this.salaryRange,
67+
},
68+
});
69+
70+
$.export("$summary", `Successfully created job with ID: ${response.id}`);
71+
return response;
72+
},
73+
};

components/niceboard/app/niceboard.app.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
import { axios } from "@pipedream/platform";
2+
3+
export default {
4+
type: "app",
5+
app: "niceboard",
6+
propDefinitions: {
7+
jobId: {
8+
type: "string",
9+
label: "Job ID",
10+
description: "The ID of the job",
11+
},
12+
applicantId: {
13+
type: "string",
14+
label: "Applicant ID",
15+
description: "The ID of the applicant",
16+
},
17+
applicantDetails: {
18+
type: "object",
19+
label: "Applicant Details",
20+
description: "Details about the applicant",
21+
optional: true,
22+
},
23+
jobDetails: {
24+
type: "object",
25+
label: "Job Details",
26+
description: "Details about the job",
27+
optional: true,
28+
},
29+
employerId: {
30+
type: "string",
31+
label: "Employer ID",
32+
description: "The ID of the employer",
33+
},
34+
employerDetails: {
35+
type: "object",
36+
label: "Employer Details",
37+
description: "Details about the employer",
38+
optional: true,
39+
},
40+
jobSeekerId: {
41+
type: "string",
42+
label: "Job Seeker ID",
43+
description: "The ID of the job seeker",
44+
},
45+
jobSeekerDetails: {
46+
type: "object",
47+
label: "Job Seeker Details",
48+
description: "Details about the job seeker",
49+
optional: true,
50+
},
51+
title: {
52+
type: "string",
53+
label: "Title",
54+
description: "The title of the job posting",
55+
},
56+
description: {
57+
type: "string",
58+
label: "Description",
59+
description: "The description of the job posting",
60+
},
61+
category: {
62+
type: "string",
63+
label: "Category",
64+
description: "The category of the job posting",
65+
},
66+
company: {
67+
type: "string",
68+
label: "Company",
69+
description: "The company of the job posting",
70+
},
71+
jobType: {
72+
type: "string",
73+
label: "Job Type",
74+
description: "The type of the job posting",
75+
optional: true,
76+
},
77+
location: {
78+
type: "string",
79+
label: "Location",
80+
description: "The location of the job posting",
81+
optional: true,
82+
},
83+
salaryRange: {
84+
type: "string",
85+
label: "Salary Range",
86+
description: "The salary range of the job posting",
87+
optional: true,
88+
},
89+
name: {
90+
type: "string",
91+
label: "Name",
92+
description: "The name of the job category",
93+
},
94+
keywords: {
95+
type: "string[]",
96+
label: "Keywords",
97+
description: "The keywords for the job alert",
98+
},
99+
frequency: {
100+
type: "string",
101+
label: "Frequency",
102+
description: "The frequency of the job alert",
103+
optional: true,
104+
},
105+
},
106+
methods: {
107+
_baseUrl() {
108+
return "https://api.niceboard.com";
109+
},
110+
async _makeRequest(opts = {}) {
111+
const {
112+
$ = this,
113+
method = "GET",
114+
path,
115+
headers,
116+
...otherOpts
117+
} = opts;
118+
return axios($, {
119+
...otherOpts,
120+
method,
121+
url: this._baseUrl() + path,
122+
headers: {
123+
...headers,
124+
"Authorization": `Bearer ${this.$auth.api_token}`,
125+
},
126+
});
127+
},
128+
async getJobs(opts = {}) {
129+
return this._makeRequest({
130+
path: "/jobs",
131+
...opts,
132+
});
133+
},
134+
async getApplicants(opts = {}) {
135+
return this._makeRequest({
136+
path: "/applicants",
137+
...opts,
138+
});
139+
},
140+
async getEmployers(opts = {}) {
141+
return this._makeRequest({
142+
path: "/employers",
143+
...opts,
144+
});
145+
},
146+
async getJobSeekers(opts = {}) {
147+
return this._makeRequest({
148+
path: "/jobseekers",
149+
...opts,
150+
});
151+
},
152+
async postJob(opts = {}) {
153+
return this._makeRequest({
154+
method: "POST",
155+
path: "/jobs",
156+
...opts,
157+
});
158+
},
159+
async postCategory(opts = {}) {
160+
return this._makeRequest({
161+
method: "POST",
162+
path: "/categories",
163+
...opts,
164+
});
165+
},
166+
async createJobAlert(opts = {}) {
167+
return this._makeRequest({
168+
method: "POST",
169+
path: "/alerts",
170+
...opts,
171+
});
172+
},
173+
},
174+
};

0 commit comments

Comments
 (0)