-
Notifications
You must be signed in to change notification settings - Fork 5.5k
19164 action zendesk helpcenter #19280
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
Open
luancazarine
wants to merge
4
commits into
master
Choose a base branch
from
19164-action-zendesk---helpcenter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ac8e650
Update Zendesk component versions and add new actions
luancazarine a89d43a
Bump version of Zendesk ticket-updated source to 0.2.10
luancazarine f3b5aef
Remove helpCenter option from locale path preparation in Zendesk comp…
luancazarine 4737d3e
Refactor Zendesk request handling and fix article description typo
luancazarine 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
Some comments aren't visible on the classic Files Changed page.
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
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
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
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,43 @@ | ||
| import zendesk from "../../zendesk.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zendesk-get-article", | ||
| name: "Get Article", | ||
| description: "Retrieves an article by its ID. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#show-article).", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zendesk, | ||
| locale: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "locale", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| articleId: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "articleId", | ||
| ({ locale }) => ({ | ||
| locale, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const article = await this.zendesk.getArticle({ | ||
| $, | ||
| locale: this.locale, | ||
| articleId: this.articleId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved article ${this.articleId}`); | ||
| 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,32 @@ | ||
| import zendesk from "../../zendesk.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zendesk-get-macro", | ||
| name: "Get Macro", | ||
| description: "Retrieves a macro by its ID. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#show-macro).", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zendesk, | ||
| macroId: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "macroId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const macro = await this.zendesk.getMacro({ | ||
| $, | ||
| macroId: this.macroId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved macro with ID ${this.macroId}`); | ||
| return macro; | ||
| }, | ||
| }; |
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
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
77 changes: 77 additions & 0 deletions
77
components/zendesk/actions/list-active-macros/list-active-macros.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,77 @@ | ||
| import constants from "../../common/constants.mjs"; | ||
| import zendesk from "../../zendesk.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zendesk-list-active-macros", | ||
| name: "List Active Macros", | ||
| description: "Lists all active shared and personal macros available to the current user. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-active-macros).", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zendesk, | ||
| access: { | ||
| type: "string", | ||
| label: "Access", | ||
| description: "Filter macros by access. The \"agents\" value returns all personal macros for the account's agents and is only available to admins.", | ||
| options: constants.ACCESS_OPTIONS, | ||
| optional: true, | ||
| }, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "macroCategory", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| groupId: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "groupId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| include: { | ||
| type: "string", | ||
| label: "Include", | ||
| description: "Additional fields to include in the response", | ||
| options: constants.INCLUDE_OPTIONS, | ||
| optional: true, | ||
| }, | ||
| sortBy: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "The field to sort the results by", | ||
| options: constants.SORT_BY_OPTIONS, | ||
| optional: true, | ||
| }, | ||
| sortOrder: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "sortOrder", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { macros } = await this.zendesk.listActiveMacros({ | ||
| $, | ||
| params: { | ||
| access: this.access, | ||
| category: this.categoryId, | ||
| group_id: this.groupId, | ||
| include: this.include, | ||
| sort_by: this.sortBy, | ||
| sort_order: this.sortOrder, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${macros.length} macro${macros.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return macros; | ||
| }, | ||
| }; | ||
105 changes: 105 additions & 0 deletions
105
components/zendesk/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,105 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import zendesk from "../../zendesk.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zendesk-list-articles", | ||
| name: "List Articles", | ||
| description: "Retrieves a list of articles. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#list-articles).", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| zendesk, | ||
| locale: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "locale", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "articleCategoryId", | ||
| ({ locale }) => ({ | ||
| locale, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| sectionId: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "sectionId", | ||
| ({ | ||
| locale, categoryId, | ||
| }) => ({ | ||
| locale, | ||
| categoryId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| userId: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "userId", | ||
| ], | ||
| optional: true, | ||
| reloadProps: true, | ||
| }, | ||
| limit: { | ||
| propDefinition: [ | ||
| zendesk, | ||
| "limit", | ||
| ], | ||
| description: "Maximum number of articles to return", | ||
| }, | ||
| }, | ||
| async additionalProps(props) { | ||
| props.locale.hidden = false; | ||
| props.categoryId.hidden = false; | ||
| props.sectionId.hidden = false; | ||
| if (this.userId) { | ||
| props.locale.hidden = true; | ||
| props.categoryId.hidden = true; | ||
| props.sectionId.hidden = true; | ||
| } | ||
| return {}; | ||
| }, | ||
| async run({ $ }) { | ||
| if ((this.categoryId && this.userId) || (this.sectionId && this.userId)) { | ||
| throw new ConfigurationError("Providing a User ID, you cannot provide a Category ID or Section ID."); | ||
| } | ||
|
|
||
| const results = this.zendesk.paginate({ | ||
| fn: this.zendesk.listArticles, | ||
| args: { | ||
| $, | ||
| categoryId: this.categoryId, | ||
| sectionId: this.sectionId, | ||
| userId: this.userId, | ||
| locale: this.userId | ||
| ? null | ||
| : this.locale, | ||
| }, | ||
| resourceKey: "articles", | ||
| max: this.limit, | ||
| }); | ||
|
|
||
| const articles = []; | ||
| for await (const article of results) { | ||
| articles.push(article); | ||
| } | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${articles.length} article${articles.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
|
|
||
| return articles; | ||
| }, | ||
| }; |
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
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
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
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
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
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
6 changes: 3 additions & 3 deletions
6
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.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
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
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
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.