-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - helpdocs #17937
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
New Components - helpdocs #17937
Changes from all commits
Commits
Show all changes
3 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
92 changes: 92 additions & 0 deletions
92
components/helpdocs/actions/create-article/create-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,92 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-create-article", | ||
| name: "Create Article", | ||
| description: "Create a new article in your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/8Y2t6NVxeU-creating-an-article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| title: { | ||
| type: "string", | ||
| label: "Title", | ||
| description: "The title of the article", | ||
| }, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| helpdocs, | ||
| "categoryId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| body: { | ||
| type: "string", | ||
| label: "Body", | ||
| description: "The body of the article", | ||
| optional: true, | ||
| }, | ||
| isPrivate: { | ||
| type: "boolean", | ||
| label: "Is Private", | ||
| description: "Whether the article is private", | ||
| optional: true, | ||
| }, | ||
| isPublished: { | ||
| type: "boolean", | ||
| label: "Is Published", | ||
| description: "Whether the article is published", | ||
| optional: true, | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "The description of the article", | ||
| optional: true, | ||
| }, | ||
| shortVersion: { | ||
| type: "string", | ||
| label: "Short Version", | ||
| description: "The short version of the article", | ||
| optional: true, | ||
| }, | ||
| slug: { | ||
| type: "string", | ||
| label: "Slug", | ||
| description: "The slug of the article", | ||
| optional: true, | ||
| }, | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "The tags of the article", | ||
| optional: true, | ||
| }, | ||
| multilingual: { | ||
| type: "string[]", | ||
| label: "Multilingual", | ||
| description: "The language code(s) of the article (e.g. `en`, `fr`, etc.)", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { article } = await this.helpdocs.createArticle({ | ||
| $, | ||
| data: { | ||
| title: this.title, | ||
| category_id: this.categoryId, | ||
| body: this.body, | ||
| is_private: this.isPrivate, | ||
| is_published: this.isPublished, | ||
| description: this.description, | ||
| short_version: this.shortVersion, | ||
| slug: this.slug, | ||
| tags: this.tags, | ||
| multilingual: this.multilingual, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Created article ${this.title}`); | ||
| return article; | ||
| }, | ||
| }; |
35 changes: 35 additions & 0 deletions
35
components/helpdocs/actions/create-category/create-category.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,35 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-create-category", | ||
| name: "Create Category", | ||
| description: "Create a new category in your HelpDocs knowledge base to organize articles. [See the documentation](https://apidocs.helpdocs.io/article/i5gdcZ7b9s-creating-a-category)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| title: { | ||
| type: "string", | ||
| label: "Title", | ||
| description: "The title of the category", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "The description of the category", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { category } = await this.helpdocs.createCategory({ | ||
| $, | ||
| data: { | ||
| title: this.title, | ||
| description: this.description, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Created category ${this.title}`); | ||
| return category; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
27 changes: 27 additions & 0 deletions
27
components/helpdocs/actions/delete-article/delete-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,27 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-delete-article", | ||
| name: "Delete Article", | ||
| description: "Delete an article from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/0iyvUUh7py-deleting-an-article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| articleId: { | ||
| propDefinition: [ | ||
| helpdocs, | ||
| "articleId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.helpdocs.deleteArticle({ | ||
| $, | ||
| articleId: this.articleId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Deleted article ${this.articleId}`); | ||
| return response; | ||
| }, | ||
| }; |
27 changes: 27 additions & 0 deletions
27
components/helpdocs/actions/delete-category/delete-category.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,27 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-delete-category", | ||
| name: "Delete Category", | ||
| description: "Delete a category from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/Hw8fVbXt1V-deleting-a-category)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| helpdocs, | ||
| "categoryId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.helpdocs.deleteCategory({ | ||
| $, | ||
| categoryId: this.categoryId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Deleted category ${this.categoryId}`); | ||
| return response; | ||
| }, | ||
| }; |
23 changes: 23 additions & 0 deletions
23
components/helpdocs/actions/generate-chatbot-source-page/generate-chatbot-source-page.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,23 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-generate-chatbot-source-page", | ||
| name: "Generate Chatbot Source Page", | ||
| description: "The chatbot source page feature allows you to generate a comprehensive list of all your Knowledge Base articles that can be fed directly to your chatbot. This makes it easy to leverage your existing documentation to power AI assistants and help your customers find answers quickly. [See the documentation](https://apidocs.helpdocs.io/article/4xha228dwf-generating-a-chatbot-source-page)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.helpdocs.listArticles({ | ||
| $, | ||
| params: { | ||
| format: "list", | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Generated chatbot source page"); | ||
| return response; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
36 changes: 36 additions & 0 deletions
36
components/helpdocs/actions/get-article-versions/get-article-versions.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,36 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-get-article-versions", | ||
| name: "Get Article Versions", | ||
| description: "Retrieve version history and details for a specific article in your knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/c3svl5hvb2-getting-article-versions)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| articleId: { | ||
| propDefinition: [ | ||
| helpdocs, | ||
| "articleId", | ||
| ], | ||
| }, | ||
| languageCode: { | ||
| type: "string", | ||
| label: "Language Code", | ||
| description: "Restrict returned articles to a language (e.g. `en`, `fr`, etc.)", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.helpdocs.getArticleVersions({ | ||
| $, | ||
| articleId: this.articleId, | ||
| params: { | ||
| language_code: this.languageCode, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Retrieved article versions for ${this.articleId}`); | ||
| 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,27 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-get-article", | ||
| name: "Get Article", | ||
| description: "Retrieve a specific article from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/lc6AVtLvrv-getting-a-single-article)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| articleId: { | ||
| propDefinition: [ | ||
| helpdocs, | ||
| "articleId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { article } = await this.helpdocs.getArticle({ | ||
| $, | ||
| articleId: this.articleId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Found 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,27 @@ | ||
| import helpdocs from "../../helpdocs.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "helpdocs-get-category", | ||
| name: "Get Category", | ||
| description: "Retrieve a category from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/FCRNPUXm3i-getting-a-single-category)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| helpdocs, | ||
| categoryId: { | ||
| propDefinition: [ | ||
| helpdocs, | ||
| "categoryId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { category } = await this.helpdocs.getCategory({ | ||
| $, | ||
| categoryId: this.categoryId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Retrieved category ${this.categoryId}`); | ||
| return category; | ||
| }, | ||
| }; |
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.