-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - freshservice #17898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
components/freshservice/actions/create-solution-article/create-solution-article.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| import freshservice from "../../freshservice.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshservice-create-solution-article", | ||
| name: "Create Solution Article", | ||
| description: "Create a solution article. [See the documentation](https://api.freshservice.com/#create_solution_article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshservice, | ||
| title: { | ||
| type: "string", | ||
| label: "Title", | ||
| description: "The title of the solution article", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "The description of the solution article", | ||
| }, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionCategoryId", | ||
| ], | ||
| }, | ||
| folderId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionFolderId", | ||
| (c) => ({ | ||
| solutionCategoryId: c.solutionCategoryId, | ||
| }), | ||
| ], | ||
| }, | ||
| status: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionArticleStatus", | ||
| ], | ||
| }, | ||
| articleType: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionArticleType", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "The tags of the solution article", | ||
| optional: true, | ||
| }, | ||
| keywords: { | ||
| type: "string[]", | ||
| label: "Keywords", | ||
| description: "The keywords of the solution article", | ||
| optional: true, | ||
| }, | ||
| reviewDate: { | ||
| type: "string", | ||
| label: "Review Date", | ||
| description: "Date in future when this article would need to be reviewed again. E.g. `2020-03-29T16:44:26Z`", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { article } = await this.freshservice.createSolutionArticle({ | ||
| $, | ||
| data: { | ||
| title: this.title, | ||
| description: this.description, | ||
| folder_id: this.folderId, | ||
| article_type: this.articleType, | ||
| status: this.status, | ||
| tags: this.tags, | ||
| keywords: this.keywords, | ||
| review_date: this.reviewDate, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created solution article with ID ${article.id}`); | ||
| return article; | ||
| }, | ||
| }; | ||
60 changes: 60 additions & 0 deletions
60
components/freshservice/actions/create-ticket/create-ticket.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import freshservice from "../../freshservice.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshservice-create-ticket", | ||
| name: "Create Ticket", | ||
| description: "Create a new ticket. [See the documentation](https://api.freshservice.com/#create_ticket)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshservice, | ||
| source: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "ticketSourceType", | ||
| ], | ||
| }, | ||
| status: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "ticketStatus", | ||
| ], | ||
| }, | ||
| priority: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "ticketPriority", | ||
| ], | ||
| }, | ||
| subject: { | ||
| type: "string", | ||
| label: "Ticket Subject", | ||
| description: "The subject of a ticket", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Ticket Description", | ||
| description: "The description of a ticket", | ||
| }, | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "The email address accociated with the ticket", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { ticket } = await this.freshservice.createTicket({ | ||
| $, | ||
| data: { | ||
| source: this.source, | ||
| status: this.status, | ||
| priority: this.priority, | ||
| subject: this.subject, | ||
| description: this.description, | ||
| email: this.email, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created ticket with ID ${ticket.id}`); | ||
| return ticket; | ||
| }, | ||
| }; |
44 changes: 44 additions & 0 deletions
44
components/freshservice/actions/delete-solution-article/delete-solution-article.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import freshservice from "../../freshservice.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshservice-delete-solution-article", | ||
| name: "Delete Solution Article", | ||
| description: "Delete a solution article. [See the documentation](https://api.freshservice.com/#delete_solution_article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshservice, | ||
| solutionCategoryId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionCategoryId", | ||
| ], | ||
| }, | ||
| solutionFolderId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionFolderId", | ||
| (c) => ({ | ||
| solutionCategoryId: c.solutionCategoryId, | ||
| }), | ||
| ], | ||
| }, | ||
| solutionArticleId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionArticleId", | ||
| (c) => ({ | ||
| solutionFolderId: c.solutionFolderId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const article = await this.freshservice.deleteSolutionArticle({ | ||
| $, | ||
| articleId: this.solutionArticleId, | ||
| }); | ||
| $.export("$summary", `Successfully deleted solution article with ID ${this.solutionArticleId}`); | ||
| return article; | ||
| }, | ||
| }; |
44 changes: 44 additions & 0 deletions
44
components/freshservice/actions/get-solution-article/get-solution-article.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import freshservice from "../../freshservice.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshservice-get-solution-article", | ||
| name: "Get Solution Article", | ||
| description: "Get a solution article by ID. [See the documentation](https://api.freshservice.com/#view_solution_article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshservice, | ||
| solutionCategoryId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionCategoryId", | ||
| ], | ||
| }, | ||
| solutionFolderId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionFolderId", | ||
| (c) => ({ | ||
| solutionCategoryId: c.solutionCategoryId, | ||
| }), | ||
| ], | ||
| }, | ||
| solutionArticleId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionArticleId", | ||
| (c) => ({ | ||
| solutionFolderId: c.solutionFolderId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { article } = await this.freshservice.getSolutionArticle({ | ||
| $, | ||
| articleId: this.solutionArticleId, | ||
| }); | ||
| $.export("$summary", `Successfully fetched solution article with ID ${article.id}`); | ||
| return article; | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import freshservice from "../../freshservice.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshservice-get-ticket", | ||
| name: "Get Ticket", | ||
| description: "Get a ticket by ID. [See the documentation](https://api.freshservice.com/#view_a_ticket)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshservice, | ||
| ticketId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "ticketId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { ticket } = await this.freshservice.getTicket({ | ||
| $, | ||
| ticketId: this.ticketId, | ||
| }); | ||
| $.export("$summary", `Successfully fetched ticket with ID ${ticket.id}`); | ||
| return ticket; | ||
| }, | ||
| }; |
37 changes: 37 additions & 0 deletions
37
components/freshservice/actions/list-solution-articles/list-solution-articles.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import freshservice from "../../freshservice.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshservice-list-solution-articles", | ||
| name: "List Solution Articles", | ||
| description: "List all solution articles. [See the documentation](https://api.freshservice.com/#view_all_solution_article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshservice, | ||
| solutionCategoryId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionCategoryId", | ||
| ], | ||
| }, | ||
| solutionFolderId: { | ||
| propDefinition: [ | ||
| freshservice, | ||
| "solutionFolderId", | ||
| (c) => ({ | ||
| solutionCategoryId: c.solutionCategoryId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { articles } = await this.freshservice.listSolutionArticles({ | ||
| $, | ||
| params: { | ||
| folder_id: this.solutionFolderId, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully listed ${articles.length} solution articles`); | ||
| return articles; | ||
| }, | ||
| }; |
19 changes: 19 additions & 0 deletions
19
components/freshservice/actions/list-solution-categories/list-solution-categories.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import freshservice from "../../freshservice.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "freshservice-list-solution-categories", | ||
| name: "List Solution Categories", | ||
| description: "List all solution categories. [See the documentation](https://api.freshservice.com/#view_all_solution_category)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| freshservice, | ||
| }, | ||
| async run({ $ }) { | ||
| const { categories } = await this.freshservice.listSolutionCategories({ | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully listed ${categories.length} solution categories`); | ||
| return categories; | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.