Skip to content

Commit ee1414d

Browse files
committed
updates
1 parent c0690e6 commit ee1414d

File tree

14 files changed

+53
-67
lines changed

14 files changed

+53
-67
lines changed

components/freshservice/actions/create-solution-article/create-solution-article.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-create-solution-article",
55
name: "Create Solution Article",
66
description: "Create a solution article. [See the documentation](https://api.freshservice.com/#create_solution_article)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -33,17 +33,16 @@ export default {
3333
}),
3434
],
3535
},
36-
articleType: {
36+
status: {
3737
propDefinition: [
3838
freshservice,
39-
"solutionArticleType",
39+
"solutionArticleStatus",
4040
],
41-
optional: true,
4241
},
43-
status: {
42+
articleType: {
4443
propDefinition: [
4544
freshservice,
46-
"solutionArticleStatus",
45+
"solutionArticleType",
4746
],
4847
optional: true,
4948
},
@@ -67,7 +66,7 @@ export default {
6766
},
6867
},
6968
async run({ $ }) {
70-
const article = await this.freshdesk.createSolutionArticle({
69+
const { article } = await this.freshservice.createSolutionArticle({
7170
$,
7271
data: {
7372
title: this.title,

components/freshservice/actions/create-ticket/create-ticket.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-create-ticket",
55
name: "Create Ticket",
66
description: "Create a new ticket. [See the documentation](https://api.freshservice.com/#create_ticket)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -35,17 +35,15 @@ export default {
3535
type: "string",
3636
label: "Ticket Description",
3737
description: "The description of a ticket",
38-
optional: true,
3938
},
4039
email: {
4140
type: "string",
4241
label: "Email",
4342
description: "The email address accociated with the ticket",
44-
optional: true,
4543
},
4644
},
4745
async run({ $ }) {
48-
const ticket = await this.freshdesk.createTicket({
46+
const { ticket } = await this.freshservice.createTicket({
4947
$,
5048
data: {
5149
source: this.source,

components/freshservice/actions/delete-solution-article/delete-solution-article.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-delete-solution-article",
55
name: "Delete Solution Article",
66
description: "Delete a solution article. [See the documentation](https://api.freshservice.com/#delete_solution_article)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -34,7 +34,7 @@ export default {
3434
},
3535
},
3636
async run({ $ }) {
37-
const article = await this.freshdesk.deleteSolutionArticle({
37+
const article = await this.freshservice.deleteSolutionArticle({
3838
$,
3939
articleId: this.solutionArticleId,
4040
});

components/freshservice/actions/get-solution-article/get-solution-article.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-get-solution-article",
55
name: "Get Solution Article",
66
description: "Get a solution article by ID. [See the documentation](https://api.freshservice.com/#view_solution_article)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -34,9 +34,9 @@ export default {
3434
},
3535
},
3636
async run({ $ }) {
37-
const article = await this.freshdesk.getSolutionArticle({
37+
const { article } = await this.freshservice.getSolutionArticle({
3838
$,
39-
article_id: this.solutionArticleId,
39+
articleId: this.solutionArticleId,
4040
});
4141
$.export("$summary", `Successfully fetched solution article with ID ${article.id}`);
4242
return article;

components/freshservice/actions/get-ticket/get-ticket.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-get-ticket",
55
name: "Get Ticket",
66
description: "Get a ticket by ID. [See the documentation](https://api.freshservice.com/#view_a_ticket)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -16,9 +16,9 @@ export default {
1616
},
1717
},
1818
async run({ $ }) {
19-
const ticket = await this.freshdesk.getTicket({
19+
const { ticket } = await this.freshservice.getTicket({
2020
$,
21-
ticket_id: this.ticketId,
21+
ticketId: this.ticketId,
2222
});
2323
$.export("$summary", `Successfully fetched ticket with ID ${ticket.id}`);
2424
return ticket;

components/freshservice/actions/list-solution-articles/list-solution-articles.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-list-solution-articles",
55
name: "List Solution Articles",
66
description: "List all solution articles. [See the documentation](https://api.freshservice.com/#view_all_solution_article)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -25,9 +25,11 @@ export default {
2525
},
2626
},
2727
async run({ $ }) {
28-
const articles = await this.freshdesk.listSolutionArticles({
28+
const { articles } = await this.freshservice.listSolutionArticles({
2929
$,
30-
folder_id: this.solutionFolderId,
30+
params: {
31+
folder_id: this.solutionFolderId,
32+
},
3133
});
3234
$.export("$summary", `Successfully listed ${articles.length} solution articles`);
3335
return articles;

components/freshservice/actions/list-solution-categories/list-solution-categories.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export default {
44
key: "freshservice-list-solution-categories",
55
name: "List Solution Categories",
66
description: "List all solution categories. [See the documentation](https://api.freshservice.com/#view_all_solution_category)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
1111
},
1212
async run({ $ }) {
13-
const categories = await $.freshdesk.listSolutionCategories({
13+
const { categories } = await this.freshservice.listSolutionCategories({
1414
$,
1515
});
1616
$.export("$summary", `Successfully listed ${categories.length} solution categories`);

components/freshservice/actions/update-solution-article/update-solution-article.mjs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-update-solution-article",
55
name: "Update Solution Article",
66
description: "Update a solution article. [See the documentation](https://api.freshservice.com/#update_solution_article)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -44,23 +44,6 @@ export default {
4444
description: "The description of the solution article",
4545
optional: true,
4646
},
47-
categoryId: {
48-
propDefinition: [
49-
freshservice,
50-
"solutionCategoryId",
51-
],
52-
optional: true,
53-
},
54-
folderId: {
55-
propDefinition: [
56-
freshservice,
57-
"solutionFolderId",
58-
(c) => ({
59-
solutionCategoryId: c.solutionCategoryId,
60-
}),
61-
],
62-
optional: true,
63-
},
6447
articleType: {
6548
propDefinition: [
6649
freshservice,
@@ -95,7 +78,7 @@ export default {
9578
},
9679
},
9780
async run({ $ }) {
98-
const article = await this.freshdesk.updateSolutionArticle({
81+
const { article } = await this.freshservice.updateSolutionArticle({
9982
$,
10083
articleId: this.solutionArticleId,
10184
data: {

components/freshservice/actions/update-ticket/update-ticket.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshservice-update-ticket",
55
name: "Update Ticket",
66
description: "Update a ticket. [See the documentation](https://api.freshservice.com/#update_ticket_priority)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
1010
freshservice,
@@ -55,9 +55,9 @@ export default {
5555
},
5656
},
5757
async run({ $ }) {
58-
const ticket = await this.freshdesk.updateTicket({
58+
const { ticket } = await this.freshservice.updateTicket({
5959
$,
60-
ticket_id: this.ticketId,
60+
ticketId: this.ticketId,
6161
data: {
6262
source: this.source,
6363
status: this.status,

components/freshservice/freshservice.app.mjs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export default {
2323
description: "The ID of a solution folder",
2424
async options({ solutionCategoryId }) {
2525
const { folders } = await this.listSolutionFolders({
26-
category_id: solutionCategoryId,
26+
params: {
27+
category_id: solutionCategoryId,
28+
},
2729
});
2830
return folders.map((folder) => ({
2931
label: folder.name,
@@ -37,7 +39,9 @@ export default {
3739
description: "The ID of a solution article",
3840
async options({ solutionFolderId }) {
3941
const { articles } = await this.listSolutionArticles({
40-
folder_id: solutionFolderId,
42+
params: {
43+
folder_id: solutionFolderId,
44+
},
4145
});
4246
return articles.map((article) => ({
4347
label: article.title,
@@ -62,31 +66,31 @@ export default {
6266
},
6367
},
6468
ticketSourceType: {
65-
type: "string",
69+
type: "integer",
6670
label: "Ticket Source Type",
6771
description: "The source type of a ticket",
6872
options: constants.TICKET_SOURCE_TYPES,
6973
},
7074
ticketStatus: {
71-
type: "string",
75+
type: "integer",
7276
label: "Ticket Status",
7377
description: "The status of a ticket",
7478
options: constants.TICKET_STATUS,
7579
},
7680
ticketPriority: {
77-
type: "string",
81+
type: "integer",
7882
label: "Ticket Priority",
7983
description: "The priority of a ticket",
8084
options: constants.TICKET_PRIORITIES,
8185
},
8286
solutionArticleType: {
83-
type: "string",
87+
type: "integer",
8488
label: "Solution Article Type",
8589
description: "The type of a solution article",
8690
options: constants.SOLUTION_ARTICLE_TYPES,
8791
},
8892
solutionArticleStatus: {
89-
type: "string",
93+
type: "integer",
9094
label: "Solution Article Status",
9195
description: "The status of a solution article",
9296
options: constants.SOLUTION_ARTICLE_STATUS,

0 commit comments

Comments
 (0)