@zaapi/open-api-mcp 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +5 -0
- package/dist/client.js.map +1 -1
- package/dist/instructions.js +77 -0
- package/dist/instructions.js.map +1 -0
- package/dist/server.js +134 -12
- package/dist/server.js.map +1 -1
- package/dist/tools/accounts/list-accounts.js +8 -18
- package/dist/tools/accounts/list-accounts.js.map +1 -1
- package/dist/tools/accounts/list-whatsapp-templates.js +49 -0
- package/dist/tools/accounts/list-whatsapp-templates.js.map +1 -0
- package/dist/tools/common.js +48 -26
- package/dist/tools/common.js.map +1 -1
- package/dist/tools/contacts/create-contact.js +13 -7
- package/dist/tools/contacts/create-contact.js.map +1 -1
- package/dist/tools/contacts/get-contact-by-id.js +6 -7
- package/dist/tools/contacts/get-contact-by-id.js.map +1 -1
- package/dist/tools/contacts/list-contact-fields.js +5 -3
- package/dist/tools/contacts/list-contact-fields.js.map +1 -1
- package/dist/tools/contacts/list-contacts.js +11 -6
- package/dist/tools/contacts/list-contacts.js.map +1 -1
- package/dist/tools/contacts/search-contacts.js +20 -0
- package/dist/tools/contacts/search-contacts.js.map +1 -0
- package/dist/tools/contacts/update-contact-field.js +12 -7
- package/dist/tools/contacts/update-contact-field.js.map +1 -1
- package/dist/tools/conversations/filter-conversations.js +11 -7
- package/dist/tools/conversations/filter-conversations.js.map +1 -1
- package/dist/tools/conversations/mark-conversation-read.js +4 -6
- package/dist/tools/conversations/mark-conversation-read.js.map +1 -1
- package/dist/tools/conversations/update-conversation-labels.js +10 -9
- package/dist/tools/conversations/update-conversation-labels.js.map +1 -1
- package/dist/tools/index.js +14 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/labels/list-labels.js +7 -4
- package/dist/tools/labels/list-labels.js.map +1 -1
- package/dist/tools/messages/create-internal-comment.js +9 -8
- package/dist/tools/messages/create-internal-comment.js.map +1 -1
- package/dist/tools/messages/get-messages.js +9 -7
- package/dist/tools/messages/get-messages.js.map +1 -1
- package/dist/tools/messages/list-internal-comments.js +8 -8
- package/dist/tools/messages/list-internal-comments.js.map +1 -1
- package/dist/tools/messages/search-messages.js +20 -0
- package/dist/tools/messages/search-messages.js.map +1 -0
- package/dist/tools/messages/send-email.js +27 -0
- package/dist/tools/messages/send-email.js.map +1 -0
- package/dist/tools/messages/send-new-email.js +27 -0
- package/dist/tools/messages/send-new-email.js.map +1 -0
- package/dist/tools/messages/send-new-whatsapp-template.js +35 -0
- package/dist/tools/messages/send-new-whatsapp-template.js.map +1 -0
- package/dist/tools/messages/send-plain-text-message.js +9 -8
- package/dist/tools/messages/send-plain-text-message.js.map +1 -1
- package/dist/tools/messages/send-whatsapp-template.js +32 -0
- package/dist/tools/messages/send-whatsapp-template.js.map +1 -0
- package/dist/tools/responses.js +303 -0
- package/dist/tools/responses.js.map +1 -0
- package/dist/tools/teams/list-teams.js +10 -5
- package/dist/tools/teams/list-teams.js.map +1 -1
- package/dist/tools/tickets/close-ticket.js +17 -10
- package/dist/tools/tickets/close-ticket.js.map +1 -1
- package/dist/tools/tickets/get-ticket-by-id.js +8 -8
- package/dist/tools/tickets/get-ticket-by-id.js.map +1 -1
- package/dist/tools/tickets/list-ticket-fields.js +7 -4
- package/dist/tools/tickets/list-ticket-fields.js.map +1 -1
- package/dist/tools/tickets/list-tickets.js +22 -22
- package/dist/tools/tickets/list-tickets.js.map +1 -1
- package/dist/tools/tickets/update-ticket-field.js +15 -8
- package/dist/tools/tickets/update-ticket-field.js.map +1 -1
- package/dist/tools/users/list-users.js +8 -5
- package/dist/tools/users/list-users.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { emailMessageFields, hasEmailContent, } from '../common.js';
|
|
3
|
+
const queryKeys = [];
|
|
4
|
+
export const sendEmail = {
|
|
5
|
+
name: 'sendEmail',
|
|
6
|
+
title: 'Send an email on a conversation',
|
|
7
|
+
description: "Send an email on an existing Gmail or Outlook conversation. Check the conversation's account channel first; the API does not reject other channels. Pass text, html, or both — at least one non-empty string. to is required, because Outlook cannot infer recipients from the thread. This reaches a real customer and cannot be recalled, so confirm the recipients and wording before calling it. A retry sends another email. The response is only an acknowledgement, so re-read with getMessages to confirm it landed. Requires the messages:write scope.",
|
|
8
|
+
scope: 'messages:write',
|
|
9
|
+
method: 'POST',
|
|
10
|
+
path: '/v1/messages/email',
|
|
11
|
+
queryKeys,
|
|
12
|
+
inputSchema: z
|
|
13
|
+
.object({
|
|
14
|
+
conversationId: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('Gmail or Outlook conversation to send on.'),
|
|
18
|
+
...emailMessageFields,
|
|
19
|
+
})
|
|
20
|
+
.refine(hasEmailContent, { message: 'Send text and/or html.' }),
|
|
21
|
+
annotations: {
|
|
22
|
+
readOnlyHint: false,
|
|
23
|
+
destructiveHint: false,
|
|
24
|
+
openWorldHint: true,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=send-email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-email.js","sourceRoot":"","sources":["../../../src/tools/messages/send-email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,eAAe,GAEhB,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,SAAS,GAAiB;IACrC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,iCAAiC;IACxC,WAAW,EACT,iiBAAiiB;IACniB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,oBAAoB;IAC1B,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,2CAA2C,CAAC;QACxD,GAAG,kBAAkB;KACtB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACjE,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { emailMessageFields, hasEmailContent, } from '../common.js';
|
|
3
|
+
const queryKeys = [];
|
|
4
|
+
export const sendNewEmail = {
|
|
5
|
+
name: 'sendNewEmail',
|
|
6
|
+
title: 'Start an email thread',
|
|
7
|
+
description: 'Send an email from a Gmail or Outlook account and start a conversation. accountId comes from listAccounts and must be gmail or outlook. The API does not reject other channels, so check before calling. Pass text, html, or both — at least one non-empty string. to is required and accepts 1 to 50 addresses. This reaches a real customer and cannot be recalled, so confirm the recipients and wording before calling it. A retry sends another email. The response is only an acknowledgement and does not include the new conversation. Requires the messages:write scope.',
|
|
8
|
+
scope: 'messages:write',
|
|
9
|
+
method: 'POST',
|
|
10
|
+
path: '/v1/messages/email/new',
|
|
11
|
+
queryKeys,
|
|
12
|
+
inputSchema: z
|
|
13
|
+
.object({
|
|
14
|
+
accountId: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('Gmail or Outlook account to send from. Use an id from listAccounts.'),
|
|
18
|
+
...emailMessageFields,
|
|
19
|
+
})
|
|
20
|
+
.refine(hasEmailContent, { message: 'Send text and/or html.' }),
|
|
21
|
+
annotations: {
|
|
22
|
+
readOnlyHint: false,
|
|
23
|
+
destructiveHint: false,
|
|
24
|
+
openWorldHint: true,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=send-new-email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-new-email.js","sourceRoot":"","sources":["../../../src/tools/messages/send-new-email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,eAAe,GAEhB,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,mjBAAmjB;IACrjB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,wBAAwB;IAC9B,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,qEAAqE,CACtE;QACH,GAAG,kBAAkB;KACtB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACjE,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const queryKeys = [];
|
|
3
|
+
export const sendNewWhatsappTemplate = {
|
|
4
|
+
name: 'sendNewWhatsappTemplate',
|
|
5
|
+
title: 'Send a WhatsApp template to a phone number',
|
|
6
|
+
description: 'Send an approved WhatsApp template to a phone number from a WhatsApp account, and start a conversation when that phone has no thread on the account. accountId comes from listAccounts and must be whatsapp. phoneNumber is E.164, for example +66812345678. templateId and variables work the same way as sendWhatsappTemplate. This reaches a real customer and cannot be recalled, so confirm the recipient, template, and variables before calling it. A retry sends the template again. A 400 means the account is not WhatsApp or has no WhatsApp credentials, the template cannot be sent (not APPROVED, NAMED parameters, header or button variables, or a YELLOW or RED quality score), or it is a MARKETING template to a contact who opted out. The response is only an acknowledgement and does not include the new conversation. Requires the messages:write scope.',
|
|
7
|
+
scope: 'messages:write',
|
|
8
|
+
method: 'POST',
|
|
9
|
+
path: '/v1/messages/whatsapp/new',
|
|
10
|
+
queryKeys,
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
accountId: z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1)
|
|
15
|
+
.describe('WhatsApp account to send from. Use an id from listAccounts whose channel is whatsapp.'),
|
|
16
|
+
phoneNumber: z
|
|
17
|
+
.string()
|
|
18
|
+
.regex(/^\+[1-9]\d{1,14}$/)
|
|
19
|
+
.describe('Recipient phone number in E.164 format, for example +66812345678.'),
|
|
20
|
+
templateId: z
|
|
21
|
+
.string()
|
|
22
|
+
.min(1)
|
|
23
|
+
.describe('Template id from listWhatsappTemplates. Status must be APPROVED.'),
|
|
24
|
+
variables: z
|
|
25
|
+
.array(z.string())
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Positional body values for a template whose body contains {{1}}, {{2}}, and so on, in that order. Omit when the body has no placeholders.'),
|
|
28
|
+
}),
|
|
29
|
+
annotations: {
|
|
30
|
+
readOnlyHint: false,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
openWorldHint: true,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=send-new-whatsapp-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-new-whatsapp-template.js","sourceRoot":"","sources":["../../../src/tools/messages/send-new-whatsapp-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,uBAAuB,GAAiB;IACnD,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,4CAA4C;IACnD,WAAW,EACT,k1BAAk1B;IACp1B,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,2BAA2B;IACjC,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,uFAAuF,CACxF;QACH,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,KAAK,CAAC,mBAAmB,CAAC;aAC1B,QAAQ,CACP,mEAAmE,CACpE;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kEAAkE,CACnE;QACH,SAAS,EAAE,CAAC;aACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,2IAA2I,CAC5I;KACJ,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { describeHttpRequest } from '../common.js';
|
|
3
2
|
const queryKeys = [];
|
|
4
3
|
export const sendPlainTextMessage = {
|
|
5
4
|
name: 'sendPlainTextMessage',
|
|
6
5
|
title: 'Send a plain text message',
|
|
7
|
-
description:
|
|
6
|
+
description: 'Send plain text to the customer on a conversation. This reaches a real person on the channel and cannot be recalled, so confirm the wording before calling it; for a note only the team can see, use createInternalComment instead. Delivery can still fail downstream when the account is unhealthy or the channel has closed its reply window — the response is only an acknowledgement, so re-read with getMessages to confirm the message landed. Requires the messages:write scope.',
|
|
7
|
+
scope: 'messages:write',
|
|
8
8
|
method: 'POST',
|
|
9
9
|
path: '/v1/messages/plain-text',
|
|
10
10
|
queryKeys,
|
|
11
11
|
inputSchema: z.object({
|
|
12
|
-
conversationId: z
|
|
13
|
-
.string()
|
|
14
|
-
.min(1)
|
|
15
|
-
.describe('JSON body. The ID of the conversation.'),
|
|
12
|
+
conversationId: z.string().min(1).describe('The ID of the conversation.'),
|
|
16
13
|
text: z
|
|
17
14
|
.string()
|
|
18
15
|
.min(1)
|
|
19
16
|
.max(1000)
|
|
20
|
-
.describe('
|
|
17
|
+
.describe('Plain text sent to the customer. Maximum 1000 characters.'),
|
|
21
18
|
}),
|
|
22
|
-
annotations: {
|
|
19
|
+
annotations: {
|
|
20
|
+
readOnlyHint: false,
|
|
21
|
+
destructiveHint: false,
|
|
22
|
+
openWorldHint: true,
|
|
23
|
+
},
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=send-plain-text-message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-plain-text-message.js","sourceRoot":"","sources":["../../../src/tools/messages/send-plain-text-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"send-plain-text-message.js","sourceRoot":"","sources":["../../../src/tools/messages/send-plain-text-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,0dAA0d;IAC5d,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,yBAAyB;IAC/B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,IAAI,CAAC;aACT,QAAQ,CAAC,2DAA2D,CAAC;KACzE,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const queryKeys = [];
|
|
3
|
+
const variables = z
|
|
4
|
+
.array(z.string())
|
|
5
|
+
.optional()
|
|
6
|
+
.describe('Positional body values for a template whose body contains {{1}}, {{2}}, and so on, in that order. Omit when the body has no placeholders.');
|
|
7
|
+
export const sendWhatsappTemplate = {
|
|
8
|
+
name: 'sendWhatsappTemplate',
|
|
9
|
+
title: 'Send a WhatsApp template',
|
|
10
|
+
description: 'Send an approved WhatsApp template on an existing WhatsApp conversation. templateId is the id from listWhatsappTemplates; pass variables in placeholder order when the body contains {{1}}, {{2}}, and so on. This reaches a real customer and cannot be recalled, so confirm the template and variables before calling it. A retry sends the template again. A 400 means the account is not WhatsApp or has no WhatsApp credentials, the template cannot be sent (not APPROVED, NAMED parameters, header or button variables, or a YELLOW or RED quality score), or it is a MARKETING template to a contact who opted out. The response is only an acknowledgement, so re-read with getMessages to confirm it landed. Requires the messages:write scope.',
|
|
11
|
+
scope: 'messages:write',
|
|
12
|
+
method: 'POST',
|
|
13
|
+
path: '/v1/messages/whatsapp',
|
|
14
|
+
queryKeys,
|
|
15
|
+
inputSchema: z.object({
|
|
16
|
+
conversationId: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.describe('WhatsApp conversation to send on.'),
|
|
20
|
+
templateId: z
|
|
21
|
+
.string()
|
|
22
|
+
.min(1)
|
|
23
|
+
.describe('Template id from listWhatsappTemplates. Status must be APPROVED.'),
|
|
24
|
+
variables,
|
|
25
|
+
}),
|
|
26
|
+
annotations: {
|
|
27
|
+
readOnlyHint: false,
|
|
28
|
+
destructiveHint: false,
|
|
29
|
+
openWorldHint: true,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=send-whatsapp-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-whatsapp-template.js","sourceRoot":"","sources":["../../../src/tools/messages/send-whatsapp-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,SAAS,GAAG,CAAC;KAChB,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACjB,QAAQ,EAAE;KACV,QAAQ,CACP,2IAA2I,CAC5I,CAAC;AAEJ,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,0BAA0B;IACjC,WAAW,EACT,2tBAA2tB;IAC7tB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,uBAAuB;IAC7B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mCAAmC,CAAC;QAChD,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kEAAkE,CACnE;QACH,SAAS;KACV,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const openObject = () => z.looseObject({});
|
|
3
|
+
export const channel = z.enum([
|
|
4
|
+
'line',
|
|
5
|
+
'instagram',
|
|
6
|
+
'facebook',
|
|
7
|
+
'lazada',
|
|
8
|
+
'shopee',
|
|
9
|
+
'tiktok',
|
|
10
|
+
'drunken_lullabies',
|
|
11
|
+
'whatsapp',
|
|
12
|
+
'widget',
|
|
13
|
+
'gmail',
|
|
14
|
+
'outlook',
|
|
15
|
+
]);
|
|
16
|
+
const relatedChannel = z.looseObject({
|
|
17
|
+
id: z.string().optional(),
|
|
18
|
+
name: z.string().optional(),
|
|
19
|
+
channel: z.string().optional(),
|
|
20
|
+
});
|
|
21
|
+
const relatedUser = z.looseObject({
|
|
22
|
+
id: z.string().optional(),
|
|
23
|
+
name: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
const relatedSeller = z.looseObject({
|
|
26
|
+
userId: z.string().optional(),
|
|
27
|
+
name: z.string().optional(),
|
|
28
|
+
roleId: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
export const ticket = z.looseObject({
|
|
31
|
+
id: z.string().optional(),
|
|
32
|
+
ticketNumber: z.string().optional(),
|
|
33
|
+
accountId: z.string().optional(),
|
|
34
|
+
account: relatedChannel.optional(),
|
|
35
|
+
conversationId: z.string().optional(),
|
|
36
|
+
conversation: relatedChannel.optional(),
|
|
37
|
+
contactId: z.string().optional(),
|
|
38
|
+
channel: channel.optional(),
|
|
39
|
+
isOpen: z.boolean().optional(),
|
|
40
|
+
openedAt: z.string().optional(),
|
|
41
|
+
closedAt: z.string().optional(),
|
|
42
|
+
reopenedAt: z.string().optional(),
|
|
43
|
+
assigneeUserId: z.string().optional().describe('User UUID (User.userId).'),
|
|
44
|
+
assignee: relatedUser.optional(),
|
|
45
|
+
handledBy: z.string().optional().describe('User UUID of whoever closed it.'),
|
|
46
|
+
handledByUser: relatedUser.optional(),
|
|
47
|
+
isFollowUp: z.boolean().optional(),
|
|
48
|
+
isSpam: z.boolean().optional(),
|
|
49
|
+
ticketFields: openObject()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Keyed by ticket field id, plus isConverted, salesRevenue, aiCsat, aiSummary.'),
|
|
52
|
+
ticketFieldsUpdatedAt: z
|
|
53
|
+
.string()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Echo back on the next updateTicketField or it is rejected with 409.'),
|
|
56
|
+
createdAt: z.string().optional(),
|
|
57
|
+
updatedAt: z.string().optional(),
|
|
58
|
+
});
|
|
59
|
+
export const ticketField = z.looseObject({
|
|
60
|
+
id: z.string().optional(),
|
|
61
|
+
name: z
|
|
62
|
+
.string()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Label shown in the app. Match on this.'),
|
|
65
|
+
description: z.string().optional(),
|
|
66
|
+
displayType: z.string().optional(),
|
|
67
|
+
dataType: z
|
|
68
|
+
.string()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe('Values must match: string, number, boolean or date.'),
|
|
71
|
+
sortOrder: z.number().optional(),
|
|
72
|
+
selectOptions: z
|
|
73
|
+
.array(openObject())
|
|
74
|
+
.optional()
|
|
75
|
+
.describe('Permitted values for select fields.'),
|
|
76
|
+
regex: z.string().optional(),
|
|
77
|
+
isRequired: z.boolean().optional(),
|
|
78
|
+
showConditions: z.array(openObject()).optional(),
|
|
79
|
+
maxItems: z.number().optional(),
|
|
80
|
+
active: z.boolean().optional(),
|
|
81
|
+
accounts: z.array(openObject()).optional(),
|
|
82
|
+
createdAt: z.string().optional(),
|
|
83
|
+
updatedAt: z.string().optional(),
|
|
84
|
+
});
|
|
85
|
+
export const conversation = z.looseObject({
|
|
86
|
+
id: z.string().optional(),
|
|
87
|
+
accountId: z.string().optional(),
|
|
88
|
+
account: relatedChannel.optional(),
|
|
89
|
+
channel: channel.optional(),
|
|
90
|
+
displayName: z.string().optional(),
|
|
91
|
+
contactId: z.string().optional(),
|
|
92
|
+
referenceId: z
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("The channel's own conversation id."),
|
|
96
|
+
labelIds: z.array(z.string()).optional(),
|
|
97
|
+
isSpam: z.boolean().optional(),
|
|
98
|
+
unreadMsgCnt: z.number().optional(),
|
|
99
|
+
allMsgCnt: z.number().optional(),
|
|
100
|
+
emailSubject: z.string().optional(),
|
|
101
|
+
lastRecipientMsgDate: z.string().optional(),
|
|
102
|
+
lastMsg: z
|
|
103
|
+
.looseObject({
|
|
104
|
+
snippet: z.string().optional(),
|
|
105
|
+
sentByRecipient: z.boolean().optional(),
|
|
106
|
+
sentAt: z.string().optional(),
|
|
107
|
+
})
|
|
108
|
+
.optional(),
|
|
109
|
+
createdAt: z.string().optional(),
|
|
110
|
+
updatedAt: z.string().optional(),
|
|
111
|
+
});
|
|
112
|
+
export const contact = z.looseObject({
|
|
113
|
+
id: z.string().optional(),
|
|
114
|
+
fullName: z.string().optional(),
|
|
115
|
+
firstName: z.string().optional(),
|
|
116
|
+
lastName: z.string().optional(),
|
|
117
|
+
email: z.string().optional(),
|
|
118
|
+
phone: z.string().optional(),
|
|
119
|
+
secondaryPhones: z.array(z.string()).optional(),
|
|
120
|
+
secondaryEmails: z.array(z.string()).optional(),
|
|
121
|
+
addresses: z.array(z.string()).optional(),
|
|
122
|
+
note: z.string().optional(),
|
|
123
|
+
customFields: openObject().optional().describe('Keyed by contact field id.'),
|
|
124
|
+
customFieldsUpdatedAt: z
|
|
125
|
+
.string()
|
|
126
|
+
.optional()
|
|
127
|
+
.describe('Echo back as updatedAt on the next updateContactField. Absent means send updatedAt instead.'),
|
|
128
|
+
createdAt: z.string().optional(),
|
|
129
|
+
updatedAt: z.string().optional(),
|
|
130
|
+
});
|
|
131
|
+
export const contactField = z.looseObject({
|
|
132
|
+
id: z.string().optional(),
|
|
133
|
+
name: z
|
|
134
|
+
.string()
|
|
135
|
+
.optional()
|
|
136
|
+
.describe('Label shown in the app. Match on this.'),
|
|
137
|
+
description: z.string().optional(),
|
|
138
|
+
displayType: z.string().optional(),
|
|
139
|
+
dataType: z
|
|
140
|
+
.string()
|
|
141
|
+
.optional()
|
|
142
|
+
.describe('Values must match: string, number, boolean or date.'),
|
|
143
|
+
active: z.boolean().optional(),
|
|
144
|
+
sortOrder: z.number().optional(),
|
|
145
|
+
selectOptions: z
|
|
146
|
+
.array(openObject())
|
|
147
|
+
.optional()
|
|
148
|
+
.describe('Permitted values for select fields.'),
|
|
149
|
+
regex: z.string().optional(),
|
|
150
|
+
maxItems: z.number().optional(),
|
|
151
|
+
});
|
|
152
|
+
export const contactSearchHit = z.looseObject({
|
|
153
|
+
id: z.string().optional(),
|
|
154
|
+
fullName: z.string().optional(),
|
|
155
|
+
phone: z.string().optional(),
|
|
156
|
+
email: z.string().optional(),
|
|
157
|
+
secondaryPhones: z.array(z.string()).optional(),
|
|
158
|
+
secondaryEmails: z.array(z.string()).optional(),
|
|
159
|
+
addresses: z.array(z.string()).optional(),
|
|
160
|
+
note: z.string().optional(),
|
|
161
|
+
matchedFields: z
|
|
162
|
+
.array(z.string())
|
|
163
|
+
.optional()
|
|
164
|
+
.describe('Which fields matched.'),
|
|
165
|
+
});
|
|
166
|
+
export const message = z.looseObject({
|
|
167
|
+
id: z.string().optional(),
|
|
168
|
+
conversationId: z.string().optional(),
|
|
169
|
+
text: z.string().optional(),
|
|
170
|
+
messageDirection: z
|
|
171
|
+
.enum(['inbound', 'outbound'])
|
|
172
|
+
.optional()
|
|
173
|
+
.describe('inbound is from the contact, outbound from the store.'),
|
|
174
|
+
messageCategory: z.string().optional(),
|
|
175
|
+
type: z.string().optional(),
|
|
176
|
+
sender: openObject().optional(),
|
|
177
|
+
sentAt: z.string().optional(),
|
|
178
|
+
conversation: relatedChannel.optional(),
|
|
179
|
+
account: relatedChannel.optional(),
|
|
180
|
+
sentBy: relatedSeller.optional(),
|
|
181
|
+
});
|
|
182
|
+
export const messageSearchHit = z.looseObject({
|
|
183
|
+
id: z.string().optional(),
|
|
184
|
+
conversationId: z.string().optional(),
|
|
185
|
+
text: z.string().optional(),
|
|
186
|
+
sentByRecipient: z
|
|
187
|
+
.boolean()
|
|
188
|
+
.optional()
|
|
189
|
+
.describe('true when the contact sent it.'),
|
|
190
|
+
sentAt: z.string().optional(),
|
|
191
|
+
score: z.number().optional().describe('Relevance score.'),
|
|
192
|
+
});
|
|
193
|
+
export const internalComment = z.looseObject({
|
|
194
|
+
id: z.string().optional(),
|
|
195
|
+
conversationId: z.string().optional(),
|
|
196
|
+
conversation: relatedChannel.optional(),
|
|
197
|
+
accountId: z.string().optional(),
|
|
198
|
+
account: relatedChannel.optional(),
|
|
199
|
+
authorUserId: z.string().optional(),
|
|
200
|
+
noteData: z
|
|
201
|
+
.looseObject({
|
|
202
|
+
text: z.string().optional(),
|
|
203
|
+
createdBy: z.union([z.string(), relatedSeller]).optional(),
|
|
204
|
+
tagText: z.string().optional(),
|
|
205
|
+
mediaUrl: z.string().optional(),
|
|
206
|
+
})
|
|
207
|
+
.optional(),
|
|
208
|
+
sentAt: z.string().optional(),
|
|
209
|
+
createdAt: z.string().optional(),
|
|
210
|
+
updatedAt: z.string().optional(),
|
|
211
|
+
});
|
|
212
|
+
export const user = z.looseObject({
|
|
213
|
+
id: z.string().optional().describe('Seat record id. Filters nothing.'),
|
|
214
|
+
name: z.string().optional(),
|
|
215
|
+
userId: z
|
|
216
|
+
.string()
|
|
217
|
+
.optional()
|
|
218
|
+
.describe('User UUID. What assignment, handledBy and the team filter match on.'),
|
|
219
|
+
roleId: z.string().optional(),
|
|
220
|
+
role: z
|
|
221
|
+
.looseObject({ id: z.string().optional(), name: z.string().optional() })
|
|
222
|
+
.optional(),
|
|
223
|
+
});
|
|
224
|
+
export const label = z.looseObject({
|
|
225
|
+
id: z.string().optional(),
|
|
226
|
+
label: z.string().optional().describe('The label text.'),
|
|
227
|
+
color: z.string().optional(),
|
|
228
|
+
fbAdId: z.string().optional(),
|
|
229
|
+
whatsAppAdId: z.string().optional(),
|
|
230
|
+
metaPostId: z.string().optional(),
|
|
231
|
+
whatsAppBroadcastId: z.string().optional(),
|
|
232
|
+
isSystemLabel: z.boolean().optional(),
|
|
233
|
+
});
|
|
234
|
+
export const team = z.looseObject({
|
|
235
|
+
id: z.string().optional(),
|
|
236
|
+
name: z.string().optional(),
|
|
237
|
+
description: z.string().optional(),
|
|
238
|
+
users: z
|
|
239
|
+
.array(z.union([z.string(), relatedUser]))
|
|
240
|
+
.optional()
|
|
241
|
+
.describe('User ids, or { id, name } under expand=users.'),
|
|
242
|
+
});
|
|
243
|
+
export const whatsappTemplate = z.looseObject({
|
|
244
|
+
id: z
|
|
245
|
+
.string()
|
|
246
|
+
.optional()
|
|
247
|
+
.describe('Pass this as templateId when sending the template.'),
|
|
248
|
+
name: z.string().optional(),
|
|
249
|
+
parameter_format: z
|
|
250
|
+
.string()
|
|
251
|
+
.optional()
|
|
252
|
+
.describe('POSITIONAL fills {{1}}, {{2}} in order.'),
|
|
253
|
+
language: z.string().optional(),
|
|
254
|
+
status: z.string().optional(),
|
|
255
|
+
category: z.string().optional(),
|
|
256
|
+
components: z
|
|
257
|
+
.array(z.looseObject({
|
|
258
|
+
type: z.string().optional(),
|
|
259
|
+
format: z.string().optional(),
|
|
260
|
+
text: z
|
|
261
|
+
.string()
|
|
262
|
+
.optional()
|
|
263
|
+
.describe('Body text may contain {{1}}, {{2}}, and so on.'),
|
|
264
|
+
buttons: z.array(openObject()).optional(),
|
|
265
|
+
}))
|
|
266
|
+
.optional()
|
|
267
|
+
.describe('Template parts. A BODY part may contain {{1}}, {{2}}. Pass those values as variables when sending.'),
|
|
268
|
+
quality_score: z
|
|
269
|
+
.looseObject({
|
|
270
|
+
score: z.string().optional(),
|
|
271
|
+
date: z.number().optional(),
|
|
272
|
+
})
|
|
273
|
+
.optional(),
|
|
274
|
+
});
|
|
275
|
+
export const account = z.looseObject({
|
|
276
|
+
id: z.string().optional(),
|
|
277
|
+
channel: channel.optional(),
|
|
278
|
+
name: z.string().optional(),
|
|
279
|
+
status: z
|
|
280
|
+
.enum(['healthy', 'unhealthy', 'disconnected'])
|
|
281
|
+
.optional()
|
|
282
|
+
.describe('Sending on anything but healthy may fail at the channel.'),
|
|
283
|
+
lastAuthorizedAt: z.string().optional(),
|
|
284
|
+
metadata: openObject().optional(),
|
|
285
|
+
});
|
|
286
|
+
export const acknowledgement = z
|
|
287
|
+
.looseObject({ message: z.string().optional() })
|
|
288
|
+
.describe('Acknowledgement only. Re-read the resource to confirm the result.');
|
|
289
|
+
const pagination = z.looseObject({
|
|
290
|
+
pageSize: z.string().optional(),
|
|
291
|
+
nextCursor: z
|
|
292
|
+
.string()
|
|
293
|
+
.optional()
|
|
294
|
+
.describe('Pass back as cursor for the next page. Absent on the last page.'),
|
|
295
|
+
});
|
|
296
|
+
export function envelope(data, dataDescription, options = {}) {
|
|
297
|
+
return z.looseObject({
|
|
298
|
+
status: z.number().describe('HTTP status from the Open API.'),
|
|
299
|
+
data: data.describe(dataDescription),
|
|
300
|
+
...(options.paginated ? { pagination: pagination.optional() } : {}),
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/tools/responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC;IAC5B,MAAM;IACN,WAAW;IACX,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,mBAAmB;IACnB,UAAU;IACV,QAAQ;IACR,OAAO;IACP,SAAS;CACV,CAAC,CAAC;AAGH,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAGH,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;IAChC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,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,CAAC,0DAA0D,CAAC;IACvE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;KAC/C,QAAQ,CACP,mEAAmE,CACpE,CAAC;AAEJ,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,iEAAiE,CAClE;CACJ,CAAC,CAAC;AAOH,MAAM,UAAU,QAAQ,CACtB,IAAO,EACP,eAAuB,EACvB,UAAmC,EAAE;IAErC,OAAO,CAAC,CAAC,WAAW,CAAC;QACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QAC7D,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;QACpC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { expand, paginationFields, paginationQueryKeys, } from '../common.js';
|
|
3
|
+
import { envelope, team } from '../responses.js';
|
|
3
4
|
const queryKeys = ['userId', ...paginationQueryKeys];
|
|
4
5
|
export const listTeams = {
|
|
5
6
|
name: 'listTeams',
|
|
6
7
|
title: 'List teams',
|
|
7
|
-
description:
|
|
8
|
+
description: 'Page through the teams on the store and their members. Pass userId to return only the teams containing that user. There is no team filter on tickets — to scope a ticket query to a team, read its members here and pass their UUIDs as listTickets assigneeUserIds. Requires the teams:read scope.',
|
|
9
|
+
scope: 'teams:read',
|
|
8
10
|
method: 'GET',
|
|
9
11
|
path: '/v1/teams',
|
|
10
12
|
queryKeys,
|
|
@@ -13,10 +15,13 @@ export const listTeams = {
|
|
|
13
15
|
.string()
|
|
14
16
|
.min(1)
|
|
15
17
|
.optional()
|
|
16
|
-
.describe('
|
|
18
|
+
.describe('Return only teams containing this user UUID.'),
|
|
17
19
|
...paginationFields,
|
|
18
|
-
expand: expand('
|
|
20
|
+
expand: expand(['users'], 'Return each member as { id, name } when that user still exists on the store.'),
|
|
19
21
|
}),
|
|
20
|
-
|
|
22
|
+
outputSchema: envelope(z.array(team), 'A page of teams.', {
|
|
23
|
+
paginated: true,
|
|
24
|
+
}),
|
|
25
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
21
26
|
};
|
|
22
27
|
//# sourceMappingURL=list-teams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-teams.js","sourceRoot":"","sources":["../../../src/tools/teams/list-teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"list-teams.js","sourceRoot":"","sources":["../../../src/tools/teams/list-teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAG,mBAAmB,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,SAAS,GAAiB;IACrC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,WAAW,EACT,qSAAqS;IACvS,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,WAAW;IACjB,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,8CAA8C,CAAC;QAC3D,GAAG,gBAAgB;QACnB,MAAM,EAAE,MAAM,CACZ,CAAC,OAAO,CAAC,EACT,8EAA8E,CAC/E;KACF,CAAC;IACF,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,kBAAkB,EAAE;QACxD,SAAS,EAAE,IAAI;KAChB,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
|
|
@@ -1,40 +1,47 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { expand, fieldValue } from '../common.js';
|
|
3
|
+
import { envelope, ticket } from '../responses.js';
|
|
3
4
|
const queryKeys = ['expand'];
|
|
4
5
|
export const closeTicket = {
|
|
5
6
|
name: 'closeTicket',
|
|
6
7
|
title: 'Close a ticket',
|
|
7
|
-
description:
|
|
8
|
+
description: 'Close a ticket, optionally recording who handled it, whether it converted, and any ticket field values in the same request. Closing ends the ticket that fronts the conversation, so confirm with the user before calling it. handledBy is a user UUID — the userId from listUsers, not the id beside it. Requires the tickets:write scope.',
|
|
9
|
+
scope: 'tickets:write',
|
|
8
10
|
method: 'PATCH',
|
|
9
11
|
path: '/v1/tickets/close',
|
|
10
12
|
queryKeys,
|
|
11
13
|
inputSchema: z.object({
|
|
12
|
-
expand: expand('
|
|
13
|
-
ticketId: z.string().min(1).describe('
|
|
14
|
+
expand: expand(['account', 'conversation', 'assignee', 'handledBy'], 'Replace these ids on the returned ticket with the named object.'),
|
|
15
|
+
ticketId: z.string().min(1).describe('The ID of the ticket.'),
|
|
14
16
|
handledBy: z
|
|
15
17
|
.string()
|
|
16
18
|
.min(1)
|
|
17
19
|
.optional()
|
|
18
|
-
.describe('
|
|
20
|
+
.describe('User UUID of whoever handled the ticket, from listUsers userId.'),
|
|
19
21
|
isConverted: z
|
|
20
22
|
.boolean()
|
|
21
23
|
.optional()
|
|
22
|
-
.describe('
|
|
24
|
+
.describe('Whether the conversation led to a conversion.'),
|
|
23
25
|
totalRevenue: z
|
|
24
26
|
.number()
|
|
25
27
|
.min(0)
|
|
26
28
|
.optional()
|
|
27
|
-
.describe('
|
|
29
|
+
.describe('Conversion revenue recorded on close.'),
|
|
28
30
|
currency: z
|
|
29
31
|
.string()
|
|
30
32
|
.optional()
|
|
31
|
-
.describe('
|
|
33
|
+
.describe('Currency of the conversion revenue.'),
|
|
32
34
|
ticketFields: z
|
|
33
35
|
.object({})
|
|
34
36
|
.catchall(fieldValue)
|
|
35
37
|
.optional()
|
|
36
|
-
.describe('
|
|
38
|
+
.describe('Ticket field values to set while closing, keyed by field id from listTicketFields. Must be non-empty when sent.'),
|
|
37
39
|
}),
|
|
38
|
-
|
|
40
|
+
outputSchema: envelope(ticket, 'The ticket after it was closed.'),
|
|
41
|
+
annotations: {
|
|
42
|
+
readOnlyHint: false,
|
|
43
|
+
destructiveHint: true,
|
|
44
|
+
openWorldHint: true,
|
|
45
|
+
},
|
|
39
46
|
};
|
|
40
47
|
//# sourceMappingURL=close-ticket.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close-ticket.js","sourceRoot":"","sources":["../../../src/tools/tickets/close-ticket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"close-ticket.js","sourceRoot":"","sources":["../../../src/tools/tickets/close-ticket.ts"],"names":[],"mappings":"A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