From 17ae2892eaa8f31ef1b816f79d246615520cc739 Mon Sep 17 00:00:00 2001 From: Boris Verkhovskiy Date: Thu, 9 Oct 2025 15:17:23 -0600 Subject: [PATCH 1/5] Zoho Desk - new help center actions --- .../actions/get-article/get-article.mjs | 55 +++++++++ .../actions/list-articles/list-articles.mjs | 97 +++++++++++++++ .../list-help-centers/list-help-centers.mjs | 39 ++++++ .../list-root-categories.mjs | 109 +++++++++++++++++ .../search-articles/search-articles.mjs | 112 ++++++++++++++++++ components/zoho_desk/common/constants.mjs | 2 + components/zoho_desk/package.json | 2 +- components/zoho_desk/zoho_desk.app.mjs | 102 ++++++++++++++++ 8 files changed, 517 insertions(+), 1 deletion(-) create mode 100644 components/zoho_desk/actions/get-article/get-article.mjs create mode 100644 components/zoho_desk/actions/list-articles/list-articles.mjs create mode 100644 components/zoho_desk/actions/list-help-centers/list-help-centers.mjs create mode 100644 components/zoho_desk/actions/list-root-categories/list-root-categories.mjs create mode 100644 components/zoho_desk/actions/search-articles/search-articles.mjs diff --git a/components/zoho_desk/actions/get-article/get-article.mjs b/components/zoho_desk/actions/get-article/get-article.mjs new file mode 100644 index 0000000000000..53f0cc36cd489 --- /dev/null +++ b/components/zoho_desk/actions/get-article/get-article.mjs @@ -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; + }, +}; diff --git a/components/zoho_desk/actions/list-articles/list-articles.mjs b/components/zoho_desk/actions/list-articles/list-articles.mjs new file mode 100644 index 0000000000000..9188bee393002 --- /dev/null +++ b/components/zoho_desk/actions/list-articles/list-articles.mjs @@ -0,0 +1,97 @@ +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: { + type: "integer", + label: "Max Results", + description: "Maximum number of articles to return. Leave blank to return all available results.", + optional: true, + }, + }, + async run({ $ }) { + const { + portalId, + categoryId, + sortBy, + tag, + maxResults, + } = this; + + const params = { + portalId, + categoryId, + sortBy, + tag, + }; + + const articles = []; + const stream = this.zohoDesk.listKnowledgeBaseArticlesStream({ + params, + }); + for await (const article of stream) { + articles.push(article); + if (maxResults && articles.length >= maxResults) { + break; + } + } + + $.export("$summary", `Retrieved ${articles.length} article${articles.length === 1 + ? "" + : "s"}.`); + + return articles; + }, +}; diff --git a/components/zoho_desk/actions/list-help-centers/list-help-centers.mjs b/components/zoho_desk/actions/list-help-centers/list-help-centers.mjs new file mode 100644 index 0000000000000..35e18c6051198 --- /dev/null +++ b/components/zoho_desk/actions/list-help-centers/list-help-centers.mjs @@ -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; + }, +}; diff --git a/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs new file mode 100644 index 0000000000000..ad3cb50973c7c --- /dev/null +++ b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs @@ -0,0 +1,109 @@ +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: { + type: "integer", + label: "Max Results", + description: "Maximum number of categories to return. Leave blank to return all available results.", + optional: true, + }, + }, + async run({ $ }) { + const { + portalId, + sortBy, + searchValue, + visibility, + departmentId, + hasArticles, + maxResults, + } = this; + + const params = { + portalId, + sortBy, + searchValue, + visibility, + departmentId, + hasArticles, + }; + + const categories = []; + const stream = this.zohoDesk.listKnowledgeBaseRootCategoriesStream({ + params, + }); + for await (const category of stream) { + categories.push(category); + if (maxResults && categories.length >= maxResults) { + break; + } + } + + $.export("$summary", `Retrieved ${categories.length} root categor${categories.length === 1 + ? "y" + : "ies"}.`); + + return categories; + }, +}; diff --git a/components/zoho_desk/actions/search-articles/search-articles.mjs b/components/zoho_desk/actions/search-articles/search-articles.mjs new file mode 100644 index 0000000000000..194d60be0fb29 --- /dev/null +++ b/components/zoho_desk/actions/search-articles/search-articles.mjs @@ -0,0 +1,112 @@ +import zohoDesk from "../../zoho_desk.app.mjs"; + +export default { + key: "zoho_desk-search-articles", + name: "Search Articles", + description: "Searches for knowledge base articles. [See the docs here](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase_Searcharticles)", + 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, + }), + ], + }, + searchStr: { + type: "string", + label: "Search String", + description: "The keywords to search for within articles.", + }, + categoryId: { + type: "string", + label: "Category ID", + description: "Filter by articles belonging to the specified category.", + optional: true, + }, + sortBy: { + type: "string", + label: "Sort By", + description: "Sort the results by created time or relevance. Use `-createdTime` for descending order.", + optional: true, + options: [ + "createdTime", + "relevance", + "-createdTime", + ], + default: "relevance", + }, + searchKeyWordMatch: { + type: "string", + label: "Match Type", + description: "Specify how multiple search keywords must be matched in the results.", + optional: true, + options: [ + { + label: "Results matching at least one keyword", + value: "ANY", + }, + { + label: "Only results matching all keywords", + value: "ALL", + }, + ], + }, + maxResults: { + type: "integer", + label: "Max Results", + description: "Maximum number of articles to return. Leave blank to return all available matches.", + optional: true, + }, + }, + async run({ $ }) { + const { + portalId, + searchStr, + categoryId, + sortBy, + searchKeyWordMatch, + maxResults, + } = this; + + const params = { + portalId, + searchStr, + categoryId, + sortBy, + searchKeyWordMatch, + }; + + const articles = []; + const stream = this.zohoDesk.searchKnowledgeBaseArticlesStream({ + params, + }); + for await (const article of stream) { + articles.push(article); + if (maxResults && articles.length >= maxResults) { + break; + } + } + + $.export("$summary", `Found ${articles.length} article${articles.length === 1 + ? "" + : "s"}.`); + + return articles; + }, +}; diff --git a/components/zoho_desk/common/constants.mjs b/components/zoho_desk/common/constants.mjs index 3f304de8fa88c..1923bfbb4d5df 100644 --- a/components/zoho_desk/common/constants.mjs +++ b/components/zoho_desk/common/constants.mjs @@ -9,6 +9,7 @@ const MULTIPART_FORM_DATA_HEADERS = { const TOKEN_PREFIX = "Zoho-oauthtoken"; const BASE_PREFIX_URL = "https://desk."; const VERSION_PATH = "/api/v1"; +const PORTAL_PATH = "/portal/api"; const FILE_PROP_NAMES = [ "attachment", "uploaddoc", @@ -35,6 +36,7 @@ export default { BASE_PREFIX_URL, TOKEN_PREFIX, VERSION_PATH, + PORTAL_PATH, FILE_PROP_NAMES, LAST_CREATED_AT, LAST_UPDATED_AT, diff --git a/components/zoho_desk/package.json b/components/zoho_desk/package.json index 147ab75b48470..cfb91a22e7626 100644 --- a/components/zoho_desk/package.json +++ b/components/zoho_desk/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zoho_desk", - "version": "0.2.1", + "version": "0.2.2", "description": "Pipedream Zoho_desk Components", "main": "zoho_desk.app.mjs", "keywords": [ diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index a911852d9958a..369f18bc6ce63 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -21,6 +21,29 @@ export default { })); }, }, + portalId: { + type: "string", + label: "Portal ID", + description: "Select the help center portal to target.", + async options({ orgId }) { + if (!orgId) { + return []; + } + const { data: helpCenters = [] } = + await this.listHelpCenters({ + params: { + orgId, + }, + }); + return helpCenters.map(({ + portalId: value, + name: label, + }) => ({ + value, + label: label || value, + })); + }, + }, departmentId: { type: "string", label: "Department ID", @@ -100,6 +123,11 @@ export default { return allowedValues.map(({ value }) => value); }, }, + articleId: { + type: "string", + label: "Article ID", + description: "The ID of the knowledge base article.", + }, }, methods: { getUrl(url, path, versionPath) { @@ -264,6 +292,80 @@ export default { ...args, }); }, + listHelpCenters(args = {}) { + return this.makeRequest({ + path: `${constants.PORTAL_PATH}/helpCenters`, + versionPath: "", + ...args, + }); + }, + listKnowledgeBaseArticles(args = {}) { + return this.makeRequest({ + path: `${constants.PORTAL_PATH}/kbArticles`, + versionPath: "", + ...args, + }); + }, + async *listKnowledgeBaseArticlesStream({ + params, + ...args + } = {}) { + yield* this.getResourcesStream({ + resourceFn: this.listKnowledgeBaseArticles, + resourceFnArgs: { + ...args, + params, + }, + }); + }, + getKnowledgeBaseArticle({ + articleId, + ...args + } = {}) { + return this.makeRequest({ + path: `${constants.PORTAL_PATH}/kbArticles/${articleId}`, + versionPath: "", + ...args, + }); + }, + searchKnowledgeBaseArticles(args = {}) { + return this.makeRequest({ + path: `${constants.PORTAL_PATH}/kbArticles/search`, + versionPath: "", + ...args, + }); + }, + async *searchKnowledgeBaseArticlesStream({ + params, + ...args + } = {}) { + yield* this.getResourcesStream({ + resourceFn: this.searchKnowledgeBaseArticles, + resourceFnArgs: { + ...args, + params, + }, + }); + }, + listKnowledgeBaseRootCategories(args = {}) { + return this.makeRequest({ + path: `${constants.PORTAL_PATH}/kbRootCategories`, + versionPath: "", + ...args, + }); + }, + async *listKnowledgeBaseRootCategoriesStream({ + params, + ...args + } = {}) { + yield* this.getResourcesStream({ + resourceFn: this.listKnowledgeBaseRootCategories, + resourceFnArgs: { + ...args, + params, + }, + }); + }, sendReply({ ticketId, ...args } = {}) { From 2af7bf03798313808fd231ebad5407c98b26ef7c Mon Sep 17 00:00:00 2001 From: Boris Verkhovskiy Date: Thu, 9 Oct 2025 18:30:21 -0600 Subject: [PATCH 2/5] Rename path prefix --- components/zoho_desk/common/constants.mjs | 8 +++---- components/zoho_desk/zoho_desk.app.mjs | 28 +++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/components/zoho_desk/common/constants.mjs b/components/zoho_desk/common/constants.mjs index 1923bfbb4d5df..7447e324781d4 100644 --- a/components/zoho_desk/common/constants.mjs +++ b/components/zoho_desk/common/constants.mjs @@ -8,8 +8,8 @@ const MULTIPART_FORM_DATA_HEADERS = { }; const TOKEN_PREFIX = "Zoho-oauthtoken"; const BASE_PREFIX_URL = "https://desk."; -const VERSION_PATH = "/api/v1"; -const PORTAL_PATH = "/portal/api"; +const CORE_API_PATH = "/api/v1"; +const PORTAL_API_PATH = "/portal/api"; const FILE_PROP_NAMES = [ "attachment", "uploaddoc", @@ -35,8 +35,8 @@ export default { MULTIPART_FORM_DATA_HEADERS, BASE_PREFIX_URL, TOKEN_PREFIX, - VERSION_PATH, - PORTAL_PATH, + CORE_API_PATH, + PORTAL_API_PATH, FILE_PROP_NAMES, LAST_CREATED_AT, LAST_UPDATED_AT, diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index 369f18bc6ce63..9f3b4bc90016f 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -130,9 +130,9 @@ export default { }, }, methods: { - getUrl(url, path, versionPath) { + getUrl(url, path, apiPrefix) { const { region } = this.$auth; - return url || `${constants.BASE_PREFIX_URL}${region}${versionPath}${path}`; + return url || `${constants.BASE_PREFIX_URL}${region}${apiPrefix}${path}`; }, getHeaders(headers) { const { oauth_access_token: oauthAccessToken } = this.$auth; @@ -154,12 +154,12 @@ export default { path, params, headers, - versionPath = constants.VERSION_PATH, + apiPrefix = constants.CORE_API_PATH, withRetries = true, ...args } = {}) { const config = { - url: this.getUrl(url, path, versionPath), + url: this.getUrl(url, path, apiPrefix), params: this.getParams(url, params), headers: this.getHeaders(headers), ...args, @@ -294,15 +294,15 @@ export default { }, listHelpCenters(args = {}) { return this.makeRequest({ - path: `${constants.PORTAL_PATH}/helpCenters`, - versionPath: "", + path: "/helpCenters", + apiPrefix: constants.PORTAL_API_PATH, ...args, }); }, listKnowledgeBaseArticles(args = {}) { return this.makeRequest({ - path: `${constants.PORTAL_PATH}/kbArticles`, - versionPath: "", + path: "/kbArticles", + apiPrefix: constants.PORTAL_API_PATH, ...args, }); }, @@ -323,15 +323,15 @@ export default { ...args } = {}) { return this.makeRequest({ - path: `${constants.PORTAL_PATH}/kbArticles/${articleId}`, - versionPath: "", + path: `/kbArticles/${articleId}`, + apiPrefix: constants.PORTAL_API_PATH, ...args, }); }, searchKnowledgeBaseArticles(args = {}) { return this.makeRequest({ - path: `${constants.PORTAL_PATH}/kbArticles/search`, - versionPath: "", + path: "/kbArticles/search", + apiPrefix: constants.PORTAL_API_PATH, ...args, }); }, @@ -349,8 +349,8 @@ export default { }, listKnowledgeBaseRootCategories(args = {}) { return this.makeRequest({ - path: `${constants.PORTAL_PATH}/kbRootCategories`, - versionPath: "", + path: "/kbRootCategories", + apiPrefix: constants.PORTAL_API_PATH, ...args, }); }, From b1e0ec269b27db769899ff3b7dfe680fdcca42a1 Mon Sep 17 00:00:00 2001 From: Boris Verkhovskiy Date: Wed, 15 Oct 2025 11:18:16 -0600 Subject: [PATCH 3/5] Pass maxResults to streamers --- .../zoho_desk/actions/list-articles/list-articles.mjs | 6 +++--- .../actions/list-root-categories/list-root-categories.mjs | 8 ++++---- .../zoho_desk/actions/search-articles/search-articles.mjs | 8 ++++---- components/zoho_desk/zoho_desk.app.mjs | 6 ++++++ 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/components/zoho_desk/actions/list-articles/list-articles.mjs b/components/zoho_desk/actions/list-articles/list-articles.mjs index 9188bee393002..2196e64f1b2e7 100644 --- a/components/zoho_desk/actions/list-articles/list-articles.mjs +++ b/components/zoho_desk/actions/list-articles/list-articles.mjs @@ -1,4 +1,5 @@ import zohoDesk from "../../zoho_desk.app.mjs"; +import constants from "../../common/constants.mjs"; export default { key: "zoho_desk-list-articles", @@ -59,6 +60,7 @@ export default { label: "Max Results", description: "Maximum number of articles to return. Leave blank to return all available results.", optional: true, + default: constants.MAX_RESOURCES, }, }, async run({ $ }) { @@ -80,12 +82,10 @@ export default { const articles = []; const stream = this.zohoDesk.listKnowledgeBaseArticlesStream({ params, + max: maxResults, }); for await (const article of stream) { articles.push(article); - if (maxResults && articles.length >= maxResults) { - break; - } } $.export("$summary", `Retrieved ${articles.length} article${articles.length === 1 diff --git a/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs index ad3cb50973c7c..9955c42cc37db 100644 --- a/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs +++ b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs @@ -1,4 +1,5 @@ import zohoDesk from "../../zoho_desk.app.mjs"; +import constants from "../../common/constants.mjs"; export default { key: "zoho_desk-list-root-categories", @@ -67,6 +68,7 @@ export default { label: "Max Results", description: "Maximum number of categories to return. Leave blank to return all available results.", optional: true, + default: constants.MAX_RESOURCES, }, }, async run({ $ }) { @@ -89,15 +91,13 @@ export default { hasArticles, }; - const categories = []; const stream = this.zohoDesk.listKnowledgeBaseRootCategoriesStream({ params, + max: maxResults, }); + const categories = []; for await (const category of stream) { categories.push(category); - if (maxResults && categories.length >= maxResults) { - break; - } } $.export("$summary", `Retrieved ${categories.length} root categor${categories.length === 1 diff --git a/components/zoho_desk/actions/search-articles/search-articles.mjs b/components/zoho_desk/actions/search-articles/search-articles.mjs index 194d60be0fb29..6a65796e18cc2 100644 --- a/components/zoho_desk/actions/search-articles/search-articles.mjs +++ b/components/zoho_desk/actions/search-articles/search-articles.mjs @@ -1,4 +1,5 @@ import zohoDesk from "../../zoho_desk.app.mjs"; +import constants from "../../common/constants.mjs"; export default { key: "zoho_desk-search-articles", @@ -72,6 +73,7 @@ export default { label: "Max Results", description: "Maximum number of articles to return. Leave blank to return all available matches.", optional: true, + default: constants.MAX_RESOURCES, }, }, async run({ $ }) { @@ -92,15 +94,13 @@ export default { searchKeyWordMatch, }; - const articles = []; const stream = this.zohoDesk.searchKnowledgeBaseArticlesStream({ params, + max: maxResults, }); + const articles = []; for await (const article of stream) { articles.push(article); - if (maxResults && articles.length >= maxResults) { - break; - } } $.export("$summary", `Found ${articles.length} article${articles.length === 1 diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index 9f3b4bc90016f..b62044768a12c 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -308,6 +308,7 @@ export default { }, async *listKnowledgeBaseArticlesStream({ params, + max, ...args } = {}) { yield* this.getResourcesStream({ @@ -316,6 +317,7 @@ export default { ...args, params, }, + max, }); }, getKnowledgeBaseArticle({ @@ -337,6 +339,7 @@ export default { }, async *searchKnowledgeBaseArticlesStream({ params, + max, ...args } = {}) { yield* this.getResourcesStream({ @@ -345,6 +348,7 @@ export default { ...args, params, }, + max, }); }, listKnowledgeBaseRootCategories(args = {}) { @@ -356,6 +360,7 @@ export default { }, async *listKnowledgeBaseRootCategoriesStream({ params, + max, ...args } = {}) { yield* this.getResourcesStream({ @@ -364,6 +369,7 @@ export default { ...args, params, }, + max, }); }, sendReply({ From 1bf3627581a2e0b8086dccfb4127a82d1da95e38 Mon Sep 17 00:00:00 2001 From: Boris Verkhovskiy Date: Wed, 15 Oct 2025 13:33:28 -0600 Subject: [PATCH 4/5] Move prop definition to .app.mjs --- .../zoho_desk/actions/list-articles/list-articles.mjs | 11 ++++------- .../list-root-categories/list-root-categories.mjs | 11 ++++------- .../actions/search-articles/search-articles.mjs | 11 ++++------- components/zoho_desk/zoho_desk.app.mjs | 7 +++++++ 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/components/zoho_desk/actions/list-articles/list-articles.mjs b/components/zoho_desk/actions/list-articles/list-articles.mjs index 2196e64f1b2e7..f4b4894fc130f 100644 --- a/components/zoho_desk/actions/list-articles/list-articles.mjs +++ b/components/zoho_desk/actions/list-articles/list-articles.mjs @@ -1,6 +1,4 @@ import zohoDesk from "../../zoho_desk.app.mjs"; -import constants from "../../common/constants.mjs"; - export default { key: "zoho_desk-list-articles", name: "List Articles", @@ -56,11 +54,10 @@ export default { optional: true, }, maxResults: { - type: "integer", - label: "Max Results", - description: "Maximum number of articles to return. Leave blank to return all available results.", - optional: true, - default: constants.MAX_RESOURCES, + propDefinition: [ + zohoDesk, + "maxResults", + ], }, }, async run({ $ }) { diff --git a/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs index 9955c42cc37db..705ed60ffdd1a 100644 --- a/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs +++ b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs @@ -1,6 +1,4 @@ import zohoDesk from "../../zoho_desk.app.mjs"; -import constants from "../../common/constants.mjs"; - export default { key: "zoho_desk-list-root-categories", name: "List Root Categories", @@ -64,11 +62,10 @@ export default { optional: true, }, maxResults: { - type: "integer", - label: "Max Results", - description: "Maximum number of categories to return. Leave blank to return all available results.", - optional: true, - default: constants.MAX_RESOURCES, + propDefinition: [ + zohoDesk, + "maxResults", + ], }, }, async run({ $ }) { diff --git a/components/zoho_desk/actions/search-articles/search-articles.mjs b/components/zoho_desk/actions/search-articles/search-articles.mjs index 6a65796e18cc2..ac327a1b76176 100644 --- a/components/zoho_desk/actions/search-articles/search-articles.mjs +++ b/components/zoho_desk/actions/search-articles/search-articles.mjs @@ -1,6 +1,4 @@ import zohoDesk from "../../zoho_desk.app.mjs"; -import constants from "../../common/constants.mjs"; - export default { key: "zoho_desk-search-articles", name: "Search Articles", @@ -69,11 +67,10 @@ export default { ], }, maxResults: { - type: "integer", - label: "Max Results", - description: "Maximum number of articles to return. Leave blank to return all available matches.", - optional: true, - default: constants.MAX_RESOURCES, + propDefinition: [ + zohoDesk, + "maxResults", + ], }, }, async run({ $ }) { diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index b62044768a12c..f1f347dc36a54 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -128,6 +128,13 @@ export default { label: "Article ID", description: "The ID of the knowledge base article.", }, + maxResults: { + type: "integer", + label: "Max Results", + description: `Maximum number of results to return. Set to blank to return everything.`, + optional: true, + default: constants.MAX_RESOURCES, + }, }, methods: { getUrl(url, path, apiPrefix) { From 419d4b997a1f00911c8d8716a7337a688278bd25 Mon Sep 17 00:00:00 2001 From: Boris Verkhovskiy Date: Wed, 15 Oct 2025 14:01:10 -0600 Subject: [PATCH 5/5] Fix lint error --- components/zoho_desk/zoho_desk.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index f1f347dc36a54..ac6a5d4840753 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -131,7 +131,7 @@ export default { maxResults: { type: "integer", label: "Max Results", - description: `Maximum number of results to return. Set to blank to return everything.`, + description: "Maximum number of results to return. Set to blank to return everything.", optional: true, default: constants.MAX_RESOURCES, },