Skip to content

Commit f7b704e

Browse files
authored
Merging pull request #17898
* wip * updates * pnpm-lock.yaml * updates
1 parent fc93582 commit f7b704e

File tree

18 files changed

+1014
-44
lines changed

18 files changed

+1014
-44
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import freshservice from "../../freshservice.app.mjs";
2+
3+
export default {
4+
key: "freshservice-create-solution-article",
5+
name: "Create Solution Article",
6+
description: "Create a solution article. [See the documentation](https://api.freshservice.com/#create_solution_article)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
freshservice,
11+
title: {
12+
type: "string",
13+
label: "Title",
14+
description: "The title of the solution article",
15+
},
16+
description: {
17+
type: "string",
18+
label: "Description",
19+
description: "The description of the solution article",
20+
},
21+
categoryId: {
22+
propDefinition: [
23+
freshservice,
24+
"solutionCategoryId",
25+
],
26+
},
27+
folderId: {
28+
propDefinition: [
29+
freshservice,
30+
"solutionFolderId",
31+
(c) => ({
32+
solutionCategoryId: c.categoryId,
33+
}),
34+
],
35+
},
36+
status: {
37+
propDefinition: [
38+
freshservice,
39+
"solutionArticleStatus",
40+
],
41+
},
42+
articleType: {
43+
propDefinition: [
44+
freshservice,
45+
"solutionArticleType",
46+
],
47+
optional: true,
48+
},
49+
tags: {
50+
type: "string[]",
51+
label: "Tags",
52+
description: "The tags of the solution article",
53+
optional: true,
54+
},
55+
keywords: {
56+
type: "string[]",
57+
label: "Keywords",
58+
description: "The keywords of the solution article",
59+
optional: true,
60+
},
61+
reviewDate: {
62+
type: "string",
63+
label: "Review Date",
64+
description: "Date in future when this article would need to be reviewed again. E.g. `2020-03-29T16:44:26Z`",
65+
optional: true,
66+
},
67+
},
68+
async run({ $ }) {
69+
const { article } = await this.freshservice.createSolutionArticle({
70+
$,
71+
data: {
72+
title: this.title,
73+
description: this.description,
74+
folder_id: this.folderId,
75+
article_type: this.articleType,
76+
status: this.status,
77+
tags: this.tags,
78+
keywords: this.keywords,
79+
review_date: this.reviewDate,
80+
},
81+
});
82+
$.export("$summary", `Successfully created solution article with ID ${article.id}`);
83+
return article;
84+
},
85+
};
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import freshservice from "../../freshservice.app.mjs";
2+
3+
export default {
4+
key: "freshservice-create-ticket",
5+
name: "Create Ticket",
6+
description: "Create a new ticket. [See the documentation](https://api.freshservice.com/#create_ticket)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
freshservice,
11+
source: {
12+
propDefinition: [
13+
freshservice,
14+
"ticketSourceType",
15+
],
16+
},
17+
status: {
18+
propDefinition: [
19+
freshservice,
20+
"ticketStatus",
21+
],
22+
},
23+
priority: {
24+
propDefinition: [
25+
freshservice,
26+
"ticketPriority",
27+
],
28+
},
29+
subject: {
30+
type: "string",
31+
label: "Ticket Subject",
32+
description: "The subject of a ticket",
33+
},
34+
description: {
35+
type: "string",
36+
label: "Ticket Description",
37+
description: "The description of a ticket",
38+
},
39+
email: {
40+
type: "string",
41+
label: "Email",
42+
description: "The email address accociated with the ticket",
43+
},
44+
},
45+
async run({ $ }) {
46+
const { ticket } = await this.freshservice.createTicket({
47+
$,
48+
data: {
49+
source: this.source,
50+
status: this.status,
51+
priority: this.priority,
52+
subject: this.subject,
53+
description: this.description,
54+
email: this.email,
55+
},
56+
});
57+
$.export("$summary", `Successfully created ticket with ID ${ticket.id}`);
58+
return ticket;
59+
},
60+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import freshservice from "../../freshservice.app.mjs";
2+
3+
export default {
4+
key: "freshservice-delete-solution-article",
5+
name: "Delete Solution Article",
6+
description: "Delete a solution article. [See the documentation](https://api.freshservice.com/#delete_solution_article)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
freshservice,
11+
solutionCategoryId: {
12+
propDefinition: [
13+
freshservice,
14+
"solutionCategoryId",
15+
],
16+
},
17+
solutionFolderId: {
18+
propDefinition: [
19+
freshservice,
20+
"solutionFolderId",
21+
(c) => ({
22+
solutionCategoryId: c.solutionCategoryId,
23+
}),
24+
],
25+
},
26+
solutionArticleId: {
27+
propDefinition: [
28+
freshservice,
29+
"solutionArticleId",
30+
(c) => ({
31+
solutionFolderId: c.solutionFolderId,
32+
}),
33+
],
34+
},
35+
},
36+
async run({ $ }) {
37+
const article = await this.freshservice.deleteSolutionArticle({
38+
$,
39+
articleId: this.solutionArticleId,
40+
});
41+
$.export("$summary", `Successfully deleted solution article with ID ${this.solutionArticleId}`);
42+
return article;
43+
},
44+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import freshservice from "../../freshservice.app.mjs";
2+
3+
export default {
4+
key: "freshservice-get-solution-article",
5+
name: "Get Solution Article",
6+
description: "Get a solution article by ID. [See the documentation](https://api.freshservice.com/#view_solution_article)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
freshservice,
11+
solutionCategoryId: {
12+
propDefinition: [
13+
freshservice,
14+
"solutionCategoryId",
15+
],
16+
},
17+
solutionFolderId: {
18+
propDefinition: [
19+
freshservice,
20+
"solutionFolderId",
21+
(c) => ({
22+
solutionCategoryId: c.solutionCategoryId,
23+
}),
24+
],
25+
},
26+
solutionArticleId: {
27+
propDefinition: [
28+
freshservice,
29+
"solutionArticleId",
30+
(c) => ({
31+
solutionFolderId: c.solutionFolderId,
32+
}),
33+
],
34+
},
35+
},
36+
async run({ $ }) {
37+
const { article } = await this.freshservice.getSolutionArticle({
38+
$,
39+
articleId: this.solutionArticleId,
40+
});
41+
$.export("$summary", `Successfully fetched solution article with ID ${article.id}`);
42+
return article;
43+
},
44+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import freshservice from "../../freshservice.app.mjs";
2+
3+
export default {
4+
key: "freshservice-get-ticket",
5+
name: "Get Ticket",
6+
description: "Get a ticket by ID. [See the documentation](https://api.freshservice.com/#view_a_ticket)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
freshservice,
11+
ticketId: {
12+
propDefinition: [
13+
freshservice,
14+
"ticketId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const { ticket } = await this.freshservice.getTicket({
20+
$,
21+
ticketId: this.ticketId,
22+
});
23+
$.export("$summary", `Successfully fetched ticket with ID ${ticket.id}`);
24+
return ticket;
25+
},
26+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import freshservice from "../../freshservice.app.mjs";
2+
3+
export default {
4+
key: "freshservice-list-solution-articles",
5+
name: "List Solution Articles",
6+
description: "List all solution articles. [See the documentation](https://api.freshservice.com/#view_all_solution_article)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
freshservice,
11+
solutionCategoryId: {
12+
propDefinition: [
13+
freshservice,
14+
"solutionCategoryId",
15+
],
16+
},
17+
solutionFolderId: {
18+
propDefinition: [
19+
freshservice,
20+
"solutionFolderId",
21+
(c) => ({
22+
solutionCategoryId: c.solutionCategoryId,
23+
}),
24+
],
25+
},
26+
},
27+
async run({ $ }) {
28+
const { articles } = await this.freshservice.listSolutionArticles({
29+
$,
30+
params: {
31+
folder_id: this.solutionFolderId,
32+
},
33+
});
34+
$.export("$summary", `Successfully listed ${articles.length} solution articles`);
35+
return articles;
36+
},
37+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import freshservice from "../../freshservice.app.mjs";
2+
3+
export default {
4+
key: "freshservice-list-solution-categories",
5+
name: "List Solution Categories",
6+
description: "List all solution categories. [See the documentation](https://api.freshservice.com/#view_all_solution_category)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
freshservice,
11+
},
12+
async run({ $ }) {
13+
const { categories } = await this.freshservice.listSolutionCategories({
14+
$,
15+
});
16+
$.export("$summary", `Successfully listed ${categories.length} solution categories`);
17+
return categories;
18+
},
19+
};

0 commit comments

Comments
 (0)