-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Zoho Desk - new help center actions #18708
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 all commits
Commits
Show all changes
5 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
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,55 @@ | ||
| import zohoDesk from "../../zoho_desk.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zoho_desk-get-article", | ||
| name: "Get Article", | ||
| description: "Retrieves the details of a knowledge base article. [See the docs here](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase_Getarticle)", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zohoDesk, | ||
| orgId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "orgId", | ||
| ], | ||
| }, | ||
| portalId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "portalId", | ||
| ({ orgId }) => ({ | ||
| orgId, | ||
| }), | ||
| ], | ||
| }, | ||
| articleId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "articleId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| portalId, | ||
| articleId, | ||
| } = this; | ||
|
|
||
| const article = await this.zohoDesk.getKnowledgeBaseArticle({ | ||
| articleId, | ||
| params: { | ||
| portalId, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Fetched article ${article.title || articleId}.`); | ||
|
|
||
| return article; | ||
| }, | ||
| }; |
94 changes: 94 additions & 0 deletions
94
components/zoho_desk/actions/list-articles/list-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,94 @@ | ||
| import zohoDesk from "../../zoho_desk.app.mjs"; | ||
| export default { | ||
| key: "zoho_desk-list-articles", | ||
| name: "List Articles", | ||
| description: "Lists knowledge base articles for a help center. [See the docs here](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase#KnowledgeBase_Listarticles)", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zohoDesk, | ||
| orgId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "orgId", | ||
| ], | ||
| }, | ||
| portalId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "portalId", | ||
| ({ orgId }) => ({ | ||
| orgId, | ||
| }), | ||
| ], | ||
| }, | ||
| categoryId: { | ||
| type: "string", | ||
| label: "Category ID", | ||
| description: "Filter by the ID(s) of the categories the articles belong to. Use comma-separated IDs to include multiple categories.", | ||
| optional: true, | ||
| }, | ||
| sortBy: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "Sort articles by the specified attribute.", | ||
| optional: true, | ||
| options: [ | ||
| "createdTime", | ||
| "modifiedTime", | ||
| "likeCount", | ||
| "viewCount", | ||
| "unlikeCount", | ||
| ], | ||
| default: "createdTime", | ||
| }, | ||
| tag: { | ||
| type: "string", | ||
| label: "Tag", | ||
| description: "Filter articles by a tag.", | ||
| optional: true, | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| portalId, | ||
| categoryId, | ||
| sortBy, | ||
| tag, | ||
| maxResults, | ||
| } = this; | ||
|
|
||
| const params = { | ||
| portalId, | ||
| categoryId, | ||
| sortBy, | ||
| tag, | ||
| }; | ||
|
|
||
| const articles = []; | ||
| const stream = this.zohoDesk.listKnowledgeBaseArticlesStream({ | ||
| params, | ||
| max: maxResults, | ||
| }); | ||
| for await (const article of stream) { | ||
| articles.push(article); | ||
| } | ||
|
|
||
| $.export("$summary", `Retrieved ${articles.length} article${articles.length === 1 | ||
| ? "" | ||
| : "s"}.`); | ||
|
|
||
| return articles; | ||
| }, | ||
| }; | ||
39 changes: 39 additions & 0 deletions
39
components/zoho_desk/actions/list-help-centers/list-help-centers.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,39 @@ | ||
| import zohoDesk from "../../zoho_desk.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zoho_desk-list-help-centers", | ||
| name: "List Help Centers", | ||
| description: "Lists the help centers configured in an organization. [See the docs here](https://desk.zoho.com/portal/APIDocument.do#HelpCenters_Listhelpcenters)", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zohoDesk, | ||
| orgId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "orgId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { orgId } = this; | ||
|
|
||
| const { data: helpCenters = [] } = | ||
| await this.zohoDesk.listHelpCenters({ | ||
| params: { | ||
| orgId, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Retrieved ${helpCenters.length} help center${helpCenters.length === 1 | ||
| ? "" | ||
| : "s"}.`); | ||
|
|
||
| return helpCenters; | ||
| }, | ||
| }; |
106 changes: 106 additions & 0 deletions
106
components/zoho_desk/actions/list-root-categories/list-root-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,106 @@ | ||
| import zohoDesk from "../../zoho_desk.app.mjs"; | ||
| export default { | ||
| key: "zoho_desk-list-root-categories", | ||
| name: "List Root Categories", | ||
| description: "Lists root knowledge base categories for a help center. [See the docs here](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase_Listallrootcategoriesofthehelpcenter)", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zohoDesk, | ||
| orgId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "orgId", | ||
| ], | ||
| }, | ||
| portalId: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "portalId", | ||
| ({ orgId }) => ({ | ||
| orgId, | ||
| }), | ||
| ], | ||
| }, | ||
| sortBy: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "Sort the categories by the specified attribute.", | ||
| optional: true, | ||
| options: [ | ||
| "name", | ||
| "order", | ||
| ], | ||
| }, | ||
| searchValue: { | ||
| type: "string", | ||
| label: "Search Value", | ||
| description: "Filter categories whose names match the provided value.", | ||
| optional: true, | ||
| }, | ||
| visibility: { | ||
| type: "string", | ||
| label: "Visibility", | ||
| description: "Filter categories by visibility (e.g. ALL_USERS).", | ||
| optional: true, | ||
| }, | ||
| departmentId: { | ||
| type: "string", | ||
| label: "Department ID", | ||
| description: "Filter categories associated with the specified department.", | ||
| optional: true, | ||
| }, | ||
| hasArticles: { | ||
| type: "boolean", | ||
| label: "Has Articles", | ||
| description: "Return only categories that contain articles when set to `true`.", | ||
| optional: true, | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| zohoDesk, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| portalId, | ||
| sortBy, | ||
| searchValue, | ||
| visibility, | ||
| departmentId, | ||
| hasArticles, | ||
| maxResults, | ||
| } = this; | ||
|
|
||
| const params = { | ||
| portalId, | ||
| sortBy, | ||
| searchValue, | ||
| visibility, | ||
| departmentId, | ||
| hasArticles, | ||
| }; | ||
|
|
||
| const stream = this.zohoDesk.listKnowledgeBaseRootCategoriesStream({ | ||
| params, | ||
| max: maxResults, | ||
| }); | ||
| const categories = []; | ||
| for await (const category of stream) { | ||
| categories.push(category); | ||
| } | ||
|
|
||
| $.export("$summary", `Retrieved ${categories.length} root categor${categories.length === 1 | ||
| ? "y" | ||
| : "ies"}.`); | ||
|
|
||
| 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.