Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions components/niceboard/.gitignore

This file was deleted.

34 changes: 34 additions & 0 deletions components/niceboard/actions/create-category/create-category.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import niceboard from "../../niceboard.app.mjs";

export default {
key: "niceboard-create-category",
name: "Create Category",
description: "Creates a new job category within Niceboard.",
version: "0.0.1",
type: "action",
props: {
niceboard,
niceboardUrl: {
propDefinition: [
niceboard,
"niceboardUrl",
],
},
name: {
type: "string",
label: "Category Name",
description: "The name of the job category to be created",
},
},
async run({ $ }) {
const response = await this.niceboard.createCategory({
$,
niceboardUrl: this.niceboardUrl,
data: {
name: this.name,
},
});
$.export("$summary", `Successfully created category with name "${this.name}"`);
return response;
},
};
114 changes: 114 additions & 0 deletions components/niceboard/actions/create-job/create-job.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import niceboard from "../../niceboard.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
key: "niceboard-create-job",
name: "Create Job",
description: "Creates a new job posting within the Niceboard app.",
version: "0.0.1",
type: "action",
props: {
niceboard,
niceboardUrl: {
propDefinition: [
niceboard,
"niceboardUrl",
],
},
title: {
propDefinition: [
niceboard,
"title",
],
},
description: {
propDefinition: [
niceboard,
"description",
],
},
companyId: {
propDefinition: [
niceboard,
"companyId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
},
jobTypeId: {
propDefinition: [
niceboard,
"jobTypeId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
},
categoryId: {
propDefinition: [
niceboard,
"categoryId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
optional: true,
},
locationId: {
propDefinition: [
niceboard,
"locationId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
optional: true,
},
minSalary: {
propDefinition: [
niceboard,
"minSalary",
],
},
maxSalary: {
propDefinition: [
niceboard,
"maxSalary",
],
},
salaryTimeframe: {
propDefinition: [
niceboard,
"salaryTimeframe",
],
},
},
async run({ $ }) {
if ((this.minSalary || this.maxSalary) && !this.salaryTimeframe) {
throw new ConfigurationError("Salary Timeframe is required if Minimum Salary or Maximum Salary is entered");
}

const response = await this.niceboard.createJob({
$,
niceboardUrl: this.niceboardUrl,
data: {
title: this.title,
description_html: this.description,
company_id: this.companyId,
jobtype_id: this.jobTypeId,
category_id: this.categoryId,
location_id: this.locationId,
salary_min: this.minSalary,
salary_max: this.maxSalary,
salary_timeframe: this.salaryTimeframe,
apply_by_form: true,
},
});

if (response?.job?.id) {
$.export("$summary", `Successfully created job with ID: ${response.job.id}`);
}
return response;
},
};
122 changes: 122 additions & 0 deletions components/niceboard/actions/update-job/update-job.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import niceboard from "../../niceboard.app.mjs";

export default {
key: "niceboard-update-job",
name: "Update Job",
description: "Updates an existing job posting within the Niceboard app.",
version: "0.0.1",
type: "action",
props: {
niceboard,
niceboardUrl: {
propDefinition: [
niceboard,
"niceboardUrl",
],
},
jobId: {
propDefinition: [
niceboard,
"jobId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
},
title: {
propDefinition: [
niceboard,
"title",
],
optional: true,
},
description: {
propDefinition: [
niceboard,
"description",
],
optional: true,
},
companyId: {
propDefinition: [
niceboard,
"companyId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
optional: true,
},
jobTypeId: {
propDefinition: [
niceboard,
"jobTypeId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
optional: true,
},
categoryId: {
propDefinition: [
niceboard,
"categoryId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
optional: true,
},
locationId: {
propDefinition: [
niceboard,
"locationId",
(c) => ({
niceboardUrl: c.niceboardUrl,
}),
],
optional: true,
},
minSalary: {
propDefinition: [
niceboard,
"minSalary",
],
},
maxSalary: {
propDefinition: [
niceboard,
"maxSalary",
],
},
salaryTimeframe: {
propDefinition: [
niceboard,
"salaryTimeframe",
],
},
},
async run({ $ }) {
const response = await this.niceboard.updateJob({
$,
niceboardUrl: this.niceboardUrl,
jobId: this.jobId,
data: {
title: this.title,
description_html: this.description,
company_id: this.companyId,
jobtype_id: this.jobTypeId,
category_id: this.categoryId,
location_id: this.locationId,
salary_min: this.minSalary,
salary_max: this.maxSalary,
salary_timeframe: this.salaryTimeframe,
},
});

if (response?.job?.id) {
$.export("$summary", `Successfully updated job with ID: ${response.job.id}`);
}
return response;
},
};
13 changes: 0 additions & 13 deletions components/niceboard/app/niceboard.app.ts

This file was deleted.

Loading
Loading