-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[ACTION] trengo - Helpcenter #19277
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
jcortes
wants to merge
1
commit into
master
Choose a base branch
from
trengo-new-components-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
[ACTION] trengo - Helpcenter #19277
Changes from all commits
Commits
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
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,41 @@ | ||
| import app from "../../trengo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "trengo-get-article", | ||
| name: "Get Article", | ||
| description: "Get a specific article. [See the documentation](https://developers.trengo.com/reference/get-an-article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| helpCenterId: { | ||
| propDefinition: [ | ||
| app, | ||
| "helpCenterId", | ||
| ], | ||
| }, | ||
| articleId: { | ||
| propDefinition: [ | ||
| app, | ||
| "articleId", | ||
| ({ helpCenterId }) => ({ | ||
| helpCenterId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getArticle({ | ||
| $, | ||
| helpCenterId: this.helpCenterId, | ||
| articleId: this.articleId, | ||
| }); | ||
| $.export("$summary", "Successfully retrieved article"); | ||
| return response; | ||
| }, | ||
| }; |
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,41 @@ | ||
| import app from "../../trengo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "trengo-get-block", | ||
| name: "Get Block", | ||
| description: "Get a specific block. [See the documentation](https://developers.trengo.com/reference/get-a-block)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| helpCenterId: { | ||
| propDefinition: [ | ||
| app, | ||
| "helpCenterId", | ||
| ], | ||
| }, | ||
| blockId: { | ||
| propDefinition: [ | ||
| app, | ||
| "blockId", | ||
| ({ helpCenterId }) => ({ | ||
| helpCenterId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getBlock({ | ||
| $, | ||
| helpCenterId: this.helpCenterId, | ||
| blockId: this.blockId, | ||
| }); | ||
| $.export("$summary", "Successfully retrieved block"); | ||
| return response; | ||
| }, | ||
| }; |
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,41 @@ | ||
| import app from "../../trengo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "trengo-get-category", | ||
| name: "Get Category", | ||
| description: "Get a specific category. [See the documentation](https://developers.trengo.com/reference/get-a-category)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| helpCenterId: { | ||
| propDefinition: [ | ||
| app, | ||
| "helpCenterId", | ||
| ], | ||
| }, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| app, | ||
| "categoryId", | ||
| ({ helpCenterId }) => ({ | ||
| helpCenterId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getCategory({ | ||
| $, | ||
| helpCenterId: this.helpCenterId, | ||
| categoryId: this.categoryId, | ||
| }); | ||
| $.export("$summary", "Successfully retrieved category"); | ||
| return response; | ||
| }, | ||
| }; |
31 changes: 31 additions & 0 deletions
31
components/trengo/actions/get-help-center/get-help-center.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,31 @@ | ||
| import app from "../../trengo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "trengo-get-help-center", | ||
| name: "Get Help Center", | ||
| description: "Get a specific help center. [See the documentation](https://developers.trengo.com/reference/get-a-help-center)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| helpCenterId: { | ||
| propDefinition: [ | ||
| app, | ||
| "helpCenterId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getHelpCenter({ | ||
| $, | ||
| helpCenterId: this.helpCenterId, | ||
| }); | ||
| $.export("$summary", "Successfully retrieved help center"); | ||
| return response; | ||
| }, | ||
| }; |
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
50 changes: 50 additions & 0 deletions
50
components/trengo/actions/list-all-blocks/list-all-blocks.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,50 @@ | ||
| import utils from "../../common/utils.mjs"; | ||
| import app from "../../trengo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "trengo-list-all-blocks", | ||
| name: "List All Blocks", | ||
| description: "List all blocks in a help center. [See the documentation](https://developers.trengo.com/reference/list-all-blocks)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| helpCenterId: { | ||
| propDefinition: [ | ||
| app, | ||
| "helpCenterId", | ||
| ], | ||
| }, | ||
| maxResults: { | ||
| type: "integer", | ||
| label: "Max Results", | ||
| description: "Maximum number of blocks to return (if not specified, all results will be returned)", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const blocks = []; | ||
| const resourcesStream = utils.getResourcesStream({ | ||
| resourceFn: this.app.listBlocks, | ||
| resourceFnArgs: { | ||
| helpCenterId: this.helpCenterId, | ||
| }, | ||
| }); | ||
| for await (const item of resourcesStream) { | ||
| blocks.push(item); | ||
| if (this.maxResults && blocks.length >= this.maxResults) { | ||
| break; | ||
| } | ||
| } | ||
| const length = blocks.length; | ||
| $.export("$summary", `Successfully retrieved ${length} block${length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return blocks; | ||
| }, | ||
| }; | ||
50 changes: 50 additions & 0 deletions
50
components/trengo/actions/list-all-categories/list-all-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,50 @@ | ||
| import utils from "../../common/utils.mjs"; | ||
| import app from "../../trengo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "trengo-list-all-categories", | ||
| name: "List All Categories", | ||
| description: "List all categories in a help center. [See the documentation](https://developers.trengo.com/reference/list-all-categories)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| props: { | ||
| app, | ||
| helpCenterId: { | ||
| propDefinition: [ | ||
| app, | ||
| "helpCenterId", | ||
| ], | ||
| }, | ||
| maxResults: { | ||
| type: "integer", | ||
| label: "Max Results", | ||
| description: "Maximum number of categories to return (if not specified, all results will be returned)", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const categories = []; | ||
| const resourcesStream = utils.getResourcesStream({ | ||
| resourceFn: this.app.listCategories, | ||
| resourceFnArgs: { | ||
| helpCenterId: this.helpCenterId, | ||
| }, | ||
| }); | ||
| for await (const item of resourcesStream) { | ||
| categories.push(item); | ||
| if (this.maxResults && categories.length >= this.maxResults) { | ||
| break; | ||
| } | ||
| } | ||
| const length = categories.length; | ||
| $.export("$summary", `Successfully retrieved ${length} categor${length === 1 | ||
| ? "y" | ||
| : "ies"}`); | ||
| return categories; | ||
| }, | ||
| }; | ||
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
42 changes: 42 additions & 0 deletions
42
components/trengo/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,42 @@ | ||
| import utils from "../../common/utils.mjs"; | ||
| import app from "../../trengo.app.mjs"; | ||
|
|
||
| export default { | ||
| type: "action", | ||
| key: "trengo-list-help-centers", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| name: "List Help Centers", | ||
| description: "List all help centers. [See the documentation](https://developers.trengo.com/reference/list-all-help-centers)", | ||
| props: { | ||
| app, | ||
| maxResults: { | ||
| type: "integer", | ||
| label: "Max Results", | ||
| description: "Maximum number of help centers to return (if not specified, all results will be returned)", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const helpCenters = []; | ||
| const resourcesStream = utils.getResourcesStream({ | ||
| resourceFn: this.app.getHelpCenters, | ||
| resourceFnArgs: {}, | ||
| }); | ||
| for await (const item of resourcesStream) { | ||
| helpCenters.push(item); | ||
| if (this.maxResults && helpCenters.length >= this.maxResults) { | ||
| break; | ||
| } | ||
| } | ||
| const length = helpCenters.length; | ||
| $.export("$summary", `Successfully retrieved ${length} help center${length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return helpCenters; | ||
| }, | ||
| }; |
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.