Skip to content

Commit f04dbfb

Browse files
authored
Merging pull request #17937
* new components * pnpm-lock.yaml * update
1 parent d89f5a5 commit f04dbfb

File tree

14 files changed

+673
-14
lines changed

14 files changed

+673
-14
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-create-article",
5+
name: "Create Article",
6+
description: "Create a new article in your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/8Y2t6NVxeU-creating-an-article)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
title: {
12+
type: "string",
13+
label: "Title",
14+
description: "The title of the article",
15+
},
16+
categoryId: {
17+
propDefinition: [
18+
helpdocs,
19+
"categoryId",
20+
],
21+
optional: true,
22+
},
23+
body: {
24+
type: "string",
25+
label: "Body",
26+
description: "The body of the article",
27+
optional: true,
28+
},
29+
isPrivate: {
30+
type: "boolean",
31+
label: "Is Private",
32+
description: "Whether the article is private",
33+
optional: true,
34+
},
35+
isPublished: {
36+
type: "boolean",
37+
label: "Is Published",
38+
description: "Whether the article is published",
39+
optional: true,
40+
},
41+
description: {
42+
type: "string",
43+
label: "Description",
44+
description: "The description of the article",
45+
optional: true,
46+
},
47+
shortVersion: {
48+
type: "string",
49+
label: "Short Version",
50+
description: "The short version of the article",
51+
optional: true,
52+
},
53+
slug: {
54+
type: "string",
55+
label: "Slug",
56+
description: "The slug of the article",
57+
optional: true,
58+
},
59+
tags: {
60+
type: "string[]",
61+
label: "Tags",
62+
description: "The tags of the article",
63+
optional: true,
64+
},
65+
multilingual: {
66+
type: "string[]",
67+
label: "Multilingual",
68+
description: "The language code(s) of the article (e.g. `en`, `fr`, etc.)",
69+
optional: true,
70+
},
71+
},
72+
async run({ $ }) {
73+
const { article } = await this.helpdocs.createArticle({
74+
$,
75+
data: {
76+
title: this.title,
77+
category_id: this.categoryId,
78+
body: this.body,
79+
is_private: this.isPrivate,
80+
is_published: this.isPublished,
81+
description: this.description,
82+
short_version: this.shortVersion,
83+
slug: this.slug,
84+
tags: this.tags,
85+
multilingual: this.multilingual,
86+
},
87+
});
88+
89+
$.export("$summary", `Created article ${this.title}`);
90+
return article;
91+
},
92+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-create-category",
5+
name: "Create Category",
6+
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)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
title: {
12+
type: "string",
13+
label: "Title",
14+
description: "The title of the category",
15+
},
16+
description: {
17+
type: "string",
18+
label: "Description",
19+
description: "The description of the category",
20+
optional: true,
21+
},
22+
},
23+
async run({ $ }) {
24+
const { category } = await this.helpdocs.createCategory({
25+
$,
26+
data: {
27+
title: this.title,
28+
description: this.description,
29+
},
30+
});
31+
32+
$.export("$summary", `Created category ${this.title}`);
33+
return category;
34+
},
35+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-delete-article",
5+
name: "Delete Article",
6+
description: "Delete an article from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/0iyvUUh7py-deleting-an-article)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
articleId: {
12+
propDefinition: [
13+
helpdocs,
14+
"articleId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.helpdocs.deleteArticle({
20+
$,
21+
articleId: this.articleId,
22+
});
23+
24+
$.export("$summary", `Deleted article ${this.articleId}`);
25+
return response;
26+
},
27+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-delete-category",
5+
name: "Delete Category",
6+
description: "Delete a category from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/Hw8fVbXt1V-deleting-a-category)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
categoryId: {
12+
propDefinition: [
13+
helpdocs,
14+
"categoryId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.helpdocs.deleteCategory({
20+
$,
21+
categoryId: this.categoryId,
22+
});
23+
24+
$.export("$summary", `Deleted category ${this.categoryId}`);
25+
return response;
26+
},
27+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-generate-chatbot-source-page",
5+
name: "Generate Chatbot Source Page",
6+
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)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
},
12+
async run({ $ }) {
13+
const response = await this.helpdocs.listArticles({
14+
$,
15+
params: {
16+
format: "list",
17+
},
18+
});
19+
20+
$.export("$summary", "Generated chatbot source page");
21+
return response;
22+
},
23+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-get-article-versions",
5+
name: "Get Article Versions",
6+
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)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
articleId: {
12+
propDefinition: [
13+
helpdocs,
14+
"articleId",
15+
],
16+
},
17+
languageCode: {
18+
type: "string",
19+
label: "Language Code",
20+
description: "Restrict returned articles to a language (e.g. `en`, `fr`, etc.)",
21+
optional: true,
22+
},
23+
},
24+
async run({ $ }) {
25+
const response = await this.helpdocs.getArticleVersions({
26+
$,
27+
articleId: this.articleId,
28+
params: {
29+
language_code: this.languageCode,
30+
},
31+
});
32+
33+
$.export("$summary", `Retrieved article versions for ${this.articleId}`);
34+
return response;
35+
},
36+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-get-article",
5+
name: "Get Article",
6+
description: "Retrieve a specific article from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/lc6AVtLvrv-getting-a-single-article)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
articleId: {
12+
propDefinition: [
13+
helpdocs,
14+
"articleId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const { article } = await this.helpdocs.getArticle({
20+
$,
21+
articleId: this.articleId,
22+
});
23+
24+
$.export("$summary", `Found article ${this.articleId}`);
25+
return article;
26+
},
27+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import helpdocs from "../../helpdocs.app.mjs";
2+
3+
export default {
4+
key: "helpdocs-get-category",
5+
name: "Get Category",
6+
description: "Retrieve a category from your HelpDocs knowledge base. [See the documentation](https://apidocs.helpdocs.io/article/FCRNPUXm3i-getting-a-single-category)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpdocs,
11+
categoryId: {
12+
propDefinition: [
13+
helpdocs,
14+
"categoryId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const { category } = await this.helpdocs.getCategory({
20+
$,
21+
categoryId: this.categoryId,
22+
});
23+
24+
$.export("$summary", `Retrieved category ${this.categoryId}`);
25+
return category;
26+
},
27+
};

0 commit comments

Comments
 (0)