Skip to content

Commit 4b7cb94

Browse files
committed
feat(zoho-desk): expand help desk operations
1 parent cc6e91f commit 4b7cb94

45 files changed

Lines changed: 10124 additions & 352 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
@@ -1659,38 +1659,20 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
16591659
serviceAccountProviderId: 'zoho-desk-service-account',
16601660
icon: ZohoDeskIcon,
16611661
baseProviderIcon: ZohoDeskIcon,
1662-
// Kept to what the tools and the webhook trigger exercise. NOTE: Zoho
1663-
// lists `Desk.organization.READ , Desk.basic.READ` for GET /organizations
1664-
// and `Desk.departments.READ , Desk.basic.READ` for GET /departments, and
1665-
// does not document whether that comma means AND or OR. Both bootstrap
1666-
// endpoints are assumed covered by Desk.basic.READ alone - verify against
1667-
// a live Desk org and widen here if either returns SCOPE_MISMATCH.
1668-
// tickets (incl. threads/comments), contacts (get_contact), basic
1669-
// (list_organizations), agents (the `assigneeId` picker lists agents),
1670-
// webhook create/delete (the trigger provisions and tears down its own
1671-
// subscription), and profile (OAuth getUserInfo).
1672-
// Desk.search.READ, Desk.webhooks.READ and Desk.webhooks.UPDATE were
1673-
// requested but unused - no tool searches, and the provider never lists
1674-
// or edits a subscription.
16751662
scopes: [
1676-
// READ + UPDATE rather than tickets.ALL: no tool creates or deletes a
1677-
// ticket, and ALL additionally grants ticket DELETE. Threads, comments
1678-
// and attachments live under the tickets module and are covered by
1679-
// these two. NOTE: Zoho publishes no scope line for the attachment
1680-
// content sub-path - verify attachment download against a live account
1681-
// before merge and widen here if it returns SCOPE_MISMATCH.
16821663
'Desk.tickets.READ',
1664+
'Desk.tickets.CREATE',
16831665
'Desk.tickets.UPDATE',
16841666
'Desk.contacts.READ',
1685-
// READ only: the knowledge base connector syncs Help Center articles
1686-
// via GET /articles and GET /articles/{id}; nothing authors one.
1667+
'Desk.contacts.CREATE',
1668+
'Desk.contacts.UPDATE',
1669+
'Desk.accounts.READ',
1670+
'Desk.accounts.CREATE',
1671+
'Desk.accounts.UPDATE',
1672+
'Desk.search.READ',
1673+
'Desk.departments.READ',
16871674
'Desk.articles.READ',
1688-
// GET /organizations documents `Desk.organization.READ , Desk.basic.READ`.
1689-
// Sibling endpoints spell the same construction "requires X and Y"
1690-
// (dependencyMappings, roles), so the comma is AND, not OR.
16911675
'Desk.organization.READ',
1692-
// READ only: the agent picker for `assigneeId` lists agents, and no
1693-
// tool creates, edits or deletes one.
16941676
'Desk.agents.READ',
16951677
'Desk.basic.READ',
16961678
'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
@@ -6442,14 +6442,34 @@ import {
64426442
import { zerobounceGetCreditsTool, zerobounceVerifyEmailTool } from '@/tools/zerobounce'
64436443
import {
64446444
zohoDeskAddCommentTool,
6445+
zohoDeskCreateAccountTool,
6446+
zohoDeskCreateContactTool,
6447+
zohoDeskCreateTicketTool,
6448+
zohoDeskDeleteCommentTool,
6449+
zohoDeskGetAccountTool,
6450+
zohoDeskGetAgentTool,
64456451
zohoDeskGetAttachmentTool,
6452+
zohoDeskGetCommentTool,
64466453
zohoDeskGetContactTool,
6454+
zohoDeskGetDepartmentTool,
64476455
zohoDeskGetThreadTool,
64486456
zohoDeskGetTicketTool,
6457+
zohoDeskListAccountsTool,
6458+
zohoDeskListAgentsTool,
64496459
zohoDeskListCommentsTool,
6460+
zohoDeskListContactsTool,
6461+
zohoDeskListDepartmentsTool,
64506462
zohoDeskListOrganizationsTool,
64516463
zohoDeskListThreadsTool,
64526464
zohoDeskListTicketsTool,
6465+
zohoDeskMoveTicketTool,
6466+
zohoDeskSearchAccountsTool,
6467+
zohoDeskSearchContactsTool,
6468+
zohoDeskSearchTicketsTool,
6469+
zohoDeskSendReplyTool,
6470+
zohoDeskUpdateAccountTool,
6471+
zohoDeskUpdateCommentTool,
6472+
zohoDeskUpdateContactTool,
64536473
zohoDeskUpdateTicketTool,
64546474
} from '@/tools/zoho_desk'
64556475
import {
@@ -12295,16 +12315,36 @@ export const tools: Record<string, ExecutableToolConfig> = {
1229512315
zendesk_delete_organization: zendeskDeleteOrganizationTool,
1229612316
zendesk_search: zendeskSearchTool,
1229712317
zendesk_search_count: zendeskSearchCountTool,
12298-
zoho_desk_list_tickets: zohoDeskListTicketsTool,
12299-
zoho_desk_get_ticket: zohoDeskGetTicketTool,
12300-
zoho_desk_update_ticket: zohoDeskUpdateTicketTool,
12301-
zoho_desk_list_comments: zohoDeskListCommentsTool,
1230212318
zoho_desk_add_comment: zohoDeskAddCommentTool,
12303-
zoho_desk_list_threads: zohoDeskListThreadsTool,
12304-
zoho_desk_get_thread: zohoDeskGetThreadTool,
12319+
zoho_desk_create_account: zohoDeskCreateAccountTool,
12320+
zoho_desk_create_contact: zohoDeskCreateContactTool,
12321+
zoho_desk_create_ticket: zohoDeskCreateTicketTool,
12322+
zoho_desk_delete_comment: zohoDeskDeleteCommentTool,
12323+
zoho_desk_get_account: zohoDeskGetAccountTool,
12324+
zoho_desk_get_agent: zohoDeskGetAgentTool,
12325+
zoho_desk_get_attachment: zohoDeskGetAttachmentTool,
12326+
zoho_desk_get_comment: zohoDeskGetCommentTool,
1230512327
zoho_desk_get_contact: zohoDeskGetContactTool,
12328+
zoho_desk_get_department: zohoDeskGetDepartmentTool,
12329+
zoho_desk_get_thread: zohoDeskGetThreadTool,
12330+
zoho_desk_get_ticket: zohoDeskGetTicketTool,
12331+
zoho_desk_list_accounts: zohoDeskListAccountsTool,
12332+
zoho_desk_list_agents: zohoDeskListAgentsTool,
12333+
zoho_desk_list_comments: zohoDeskListCommentsTool,
12334+
zoho_desk_list_contacts: zohoDeskListContactsTool,
12335+
zoho_desk_list_departments: zohoDeskListDepartmentsTool,
1230612336
zoho_desk_list_organizations: zohoDeskListOrganizationsTool,
12307-
zoho_desk_get_attachment: zohoDeskGetAttachmentTool,
12337+
zoho_desk_list_threads: zohoDeskListThreadsTool,
12338+
zoho_desk_list_tickets: zohoDeskListTicketsTool,
12339+
zoho_desk_move_ticket: zohoDeskMoveTicketTool,
12340+
zoho_desk_search_accounts: zohoDeskSearchAccountsTool,
12341+
zoho_desk_search_contacts: zohoDeskSearchContactsTool,
12342+
zoho_desk_search_tickets: zohoDeskSearchTicketsTool,
12343+
zoho_desk_send_reply: zohoDeskSendReplyTool,
12344+
zoho_desk_update_account: zohoDeskUpdateAccountTool,
12345+
zoho_desk_update_comment: zohoDeskUpdateCommentTool,
12346+
zoho_desk_update_contact: zohoDeskUpdateContactTool,
12347+
zoho_desk_update_ticket: zohoDeskUpdateTicketTool,
1230812348
intercom_create_contact: intercomCreateContactTool,
1230912349
intercom_create_contact_v2: intercomCreateContactV2Tool,
1231012350
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)