Skip to content

Commit 4911f5a

Browse files
committed
feat(zoho-desk): expand help desk operations
1 parent 9324ef3 commit 4911f5a

44 files changed

Lines changed: 10123 additions & 351 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/integrations/zoho-desk-service-account.mdx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,16 @@ Sim requests the Zoho Desk scopes used by its tools, knowledge connector, organi
7878

7979
```
8080
Desk.tickets.READ
81+
Desk.tickets.CREATE
8182
Desk.tickets.UPDATE
8283
Desk.contacts.READ
84+
Desk.contacts.CREATE
85+
Desk.contacts.UPDATE
86+
Desk.accounts.READ
87+
Desk.accounts.CREATE
88+
Desk.accounts.UPDATE
89+
Desk.search.READ
90+
Desk.departments.READ
8391
Desk.agents.READ
8492
Desk.basic.READ
8593
Desk.articles.READ

‎apps/docs/content/docs/integrations/zoho_desk.mdx‎

Lines changed: 827 additions & 5 deletions
Large diffs are not rendered by default.

‎apps/sim/blocks/blocks/zoho-desk.ts‎

Lines changed: 4055 additions & 224 deletions
Large diffs are not rendered by default.

‎apps/sim/lib/oauth/oauth.ts‎

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,38 +1667,20 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
16671667
serviceAccountProviderId: 'zoho-desk-service-account',
16681668
icon: ZohoDeskIcon,
16691669
baseProviderIcon: ZohoDeskIcon,
1670-
// Kept to what the tools and the webhook trigger exercise. NOTE: Zoho
1671-
// lists `Desk.organization.READ , Desk.basic.READ` for GET /organizations
1672-
// and `Desk.departments.READ , Desk.basic.READ` for GET /departments, and
1673-
// does not document whether that comma means AND or OR. Both bootstrap
1674-
// endpoints are assumed covered by Desk.basic.READ alone - verify against
1675-
// a live Desk org and widen here if either returns SCOPE_MISMATCH.
1676-
// tickets (incl. threads/comments), contacts (get_contact), basic
1677-
// (list_organizations), agents (the `assigneeId` picker lists agents),
1678-
// webhook create/delete (the trigger provisions and tears down its own
1679-
// subscription), and profile (OAuth getUserInfo).
1680-
// Desk.search.READ, Desk.webhooks.READ and Desk.webhooks.UPDATE were
1681-
// requested but unused - no tool searches, and the provider never lists
1682-
// or edits a subscription.
16831670
scopes: [
1684-
// READ + UPDATE rather than tickets.ALL: no tool creates or deletes a
1685-
// ticket, and ALL additionally grants ticket DELETE. Threads, comments
1686-
// and attachments live under the tickets module and are covered by
1687-
// these two. NOTE: Zoho publishes no scope line for the attachment
1688-
// content sub-path - verify attachment download against a live account
1689-
// before merge and widen here if it returns SCOPE_MISMATCH.
16901671
'Desk.tickets.READ',
1672+
'Desk.tickets.CREATE',
16911673
'Desk.tickets.UPDATE',
16921674
'Desk.contacts.READ',
1693-
// READ only: the knowledge base connector syncs Help Center articles
1694-
// via GET /articles and GET /articles/{id}; nothing authors one.
1675+
'Desk.contacts.CREATE',
1676+
'Desk.contacts.UPDATE',
1677+
'Desk.accounts.READ',
1678+
'Desk.accounts.CREATE',
1679+
'Desk.accounts.UPDATE',
1680+
'Desk.search.READ',
1681+
'Desk.departments.READ',
16951682
'Desk.articles.READ',
1696-
// GET /organizations documents `Desk.organization.READ , Desk.basic.READ`.
1697-
// Sibling endpoints spell the same construction "requires X and Y"
1698-
// (dependencyMappings, roles), so the comma is AND, not OR.
16991683
'Desk.organization.READ',
1700-
// READ only: the agent picker for `assigneeId` lists agents, and no
1701-
// tool creates, edits or deletes one.
17021684
'Desk.agents.READ',
17031685
'Desk.basic.READ',
17041686
'Desk.webhooks.CREATE',

‎apps/sim/lib/oauth/utils.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,16 @@ export const SCOPE_DESCRIPTIONS: Record<string, string> = {
8787
'bookmarks:write': 'Add, edit, and remove Slack channel bookmarks',
8888
'bookmarks:read': 'View Slack channel bookmarks',
8989
// Zoho Desk scopes
90+
'Desk.tickets.CREATE': 'Create support tickets',
91+
'Desk.contacts.CREATE': 'Create contacts',
92+
'Desk.contacts.UPDATE': 'Update contacts',
93+
'Desk.accounts.READ': 'View customer accounts',
94+
'Desk.accounts.CREATE': 'Create customer accounts',
95+
'Desk.accounts.UPDATE': 'Update customer accounts',
96+
'Desk.search.READ': 'Search tickets, contacts, and accounts',
97+
'Desk.departments.READ': 'View departments',
9098
'Desk.tickets.READ': 'View tickets, threads, comments, and attachments',
91-
'Desk.tickets.UPDATE': 'Update tickets and add comments',
99+
'Desk.tickets.UPDATE': 'Update tickets, send replies, and manage comments',
92100
'Desk.contacts.READ': 'View contacts',
93101
'Desk.articles.READ': 'View knowledge base articles',
94102
'Desk.organization.READ': 'View organization details',

‎apps/sim/tools/generated/tool-ids.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/generated/tool-metadata.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/generated/tool-outputs.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/registry.ts‎

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6457,14 +6457,34 @@ import {
64576457
import { zerobounceGetCreditsTool, zerobounceVerifyEmailTool } from '@/tools/zerobounce'
64586458
import {
64596459
zohoDeskAddCommentTool,
6460+
zohoDeskCreateAccountTool,
6461+
zohoDeskCreateContactTool,
6462+
zohoDeskCreateTicketTool,
6463+
zohoDeskDeleteCommentTool,
6464+
zohoDeskGetAccountTool,
6465+
zohoDeskGetAgentTool,
64606466
zohoDeskGetAttachmentTool,
6467+
zohoDeskGetCommentTool,
64616468
zohoDeskGetContactTool,
6469+
zohoDeskGetDepartmentTool,
64626470
zohoDeskGetThreadTool,
64636471
zohoDeskGetTicketTool,
6472+
zohoDeskListAccountsTool,
6473+
zohoDeskListAgentsTool,
64646474
zohoDeskListCommentsTool,
6475+
zohoDeskListContactsTool,
6476+
zohoDeskListDepartmentsTool,
64656477
zohoDeskListOrganizationsTool,
64666478
zohoDeskListThreadsTool,
64676479
zohoDeskListTicketsTool,
6480+
zohoDeskMoveTicketTool,
6481+
zohoDeskSearchAccountsTool,
6482+
zohoDeskSearchContactsTool,
6483+
zohoDeskSearchTicketsTool,
6484+
zohoDeskSendReplyTool,
6485+
zohoDeskUpdateAccountTool,
6486+
zohoDeskUpdateCommentTool,
6487+
zohoDeskUpdateContactTool,
64686488
zohoDeskUpdateTicketTool,
64696489
} from '@/tools/zoho_desk'
64706490
import {
@@ -12325,16 +12345,36 @@ export const tools: Record<string, ExecutableToolConfig> = {
1232512345
zendesk_delete_organization: zendeskDeleteOrganizationTool,
1232612346
zendesk_search: zendeskSearchTool,
1232712347
zendesk_search_count: zendeskSearchCountTool,
12328-
zoho_desk_list_tickets: zohoDeskListTicketsTool,
12329-
zoho_desk_get_ticket: zohoDeskGetTicketTool,
12330-
zoho_desk_update_ticket: zohoDeskUpdateTicketTool,
12331-
zoho_desk_list_comments: zohoDeskListCommentsTool,
1233212348
zoho_desk_add_comment: zohoDeskAddCommentTool,
12333-
zoho_desk_list_threads: zohoDeskListThreadsTool,
12334-
zoho_desk_get_thread: zohoDeskGetThreadTool,
12349+
zoho_desk_create_account: zohoDeskCreateAccountTool,
12350+
zoho_desk_create_contact: zohoDeskCreateContactTool,
12351+
zoho_desk_create_ticket: zohoDeskCreateTicketTool,
12352+
zoho_desk_delete_comment: zohoDeskDeleteCommentTool,
12353+
zoho_desk_get_account: zohoDeskGetAccountTool,
12354+
zoho_desk_get_agent: zohoDeskGetAgentTool,
12355+
zoho_desk_get_attachment: zohoDeskGetAttachmentTool,
12356+
zoho_desk_get_comment: zohoDeskGetCommentTool,
1233512357
zoho_desk_get_contact: zohoDeskGetContactTool,
12358+
zoho_desk_get_department: zohoDeskGetDepartmentTool,
12359+
zoho_desk_get_thread: zohoDeskGetThreadTool,
12360+
zoho_desk_get_ticket: zohoDeskGetTicketTool,
12361+
zoho_desk_list_accounts: zohoDeskListAccountsTool,
12362+
zoho_desk_list_agents: zohoDeskListAgentsTool,
12363+
zoho_desk_list_comments: zohoDeskListCommentsTool,
12364+
zoho_desk_list_contacts: zohoDeskListContactsTool,
12365+
zoho_desk_list_departments: zohoDeskListDepartmentsTool,
1233612366
zoho_desk_list_organizations: zohoDeskListOrganizationsTool,
12337-
zoho_desk_get_attachment: zohoDeskGetAttachmentTool,
12367+
zoho_desk_list_threads: zohoDeskListThreadsTool,
12368+
zoho_desk_list_tickets: zohoDeskListTicketsTool,
12369+
zoho_desk_move_ticket: zohoDeskMoveTicketTool,
12370+
zoho_desk_search_accounts: zohoDeskSearchAccountsTool,
12371+
zoho_desk_search_contacts: zohoDeskSearchContactsTool,
12372+
zoho_desk_search_tickets: zohoDeskSearchTicketsTool,
12373+
zoho_desk_send_reply: zohoDeskSendReplyTool,
12374+
zoho_desk_update_account: zohoDeskUpdateAccountTool,
12375+
zoho_desk_update_comment: zohoDeskUpdateCommentTool,
12376+
zoho_desk_update_contact: zohoDeskUpdateContactTool,
12377+
zoho_desk_update_ticket: zohoDeskUpdateTicketTool,
1233812378
intercom_create_contact: intercomCreateContactTool,
1233912379
intercom_create_contact_v2: intercomCreateContactV2Tool,
1234012380
intercom_get_contact: intercomGetContactTool,

‎apps/sim/tools/zoho_desk/add_comment.ts‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { ToolConfig } from '@/tools/types'
22
import { safeUrlPathSegment } from '@/tools/url-path'
3+
import { parseZohoDeskJson, readZohoDeskResponse } from '@/tools/zoho_desk/request'
34
import type { ZohoDeskAddCommentParams, ZohoDeskResponse } from '@/tools/zoho_desk/types'
45
import { ZOHO_DESK_COMMENT_PROPERTIES } from '@/tools/zoho_desk/types'
56
import {
67
buildZohoDeskHeaders,
78
getZohoDeskApiBase,
8-
getZohoDeskErrorMessage,
99
withDerivedContentText,
1010
} from '@/tools/zoho_desk/utils'
1111

@@ -61,6 +61,12 @@ export const zohoDeskAddCommentTool: ToolConfig<ZohoDeskAddCommentParams, ZohoDe
6161
visibility: 'user-or-llm',
6262
description: 'Whether the comment is public',
6363
},
64+
attachmentIds: {
65+
type: 'json',
66+
required: false,
67+
visibility: 'user-or-llm',
68+
description: 'JSON array of previously uploaded attachment IDs',
69+
},
6470
},
6571

6672
request: {
@@ -69,19 +75,15 @@ export const zohoDeskAddCommentTool: ToolConfig<ZohoDeskAddCommentParams, ZohoDe
6975
method: 'POST',
7076
headers: (params) => buildZohoDeskHeaders(params),
7177
body: (params) => ({
78+
attachmentIds: parseZohoDeskJson(params.attachmentIds, 'attachmentIds', 'array'),
7279
content: params.content,
7380
contentType: params.contentType || 'plainText',
7481
isPublic: params.isPublic ?? false,
7582
}),
7683
},
7784

7885
transformResponse: async (response) => {
79-
const data = await response.json().catch(() => ({}))
80-
if (!response.ok) {
81-
throw new Error(
82-
getZohoDeskErrorMessage(data, `Failed to add comment (HTTP ${response.status})`)
83-
)
84-
}
86+
const data = await readZohoDeskResponse(response)
8587
return {
8688
success: true,
8789
output: { comment: withDerivedContentText(data) },

0 commit comments

Comments
 (0)