@yadsh/dsh-qa-integrations 0.5.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/LICENSE +21 -0
- package/README.md +617 -0
- package/compatibility.json +10 -0
- package/cordis.patch.yml +5 -0
- package/lib/broker.js +239 -0
- package/lib/broker.js.map +1 -0
- package/lib/client/bitrix24.js +33 -0
- package/lib/client/bitrix24.js.map +1 -0
- package/lib/client/card.js +33 -0
- package/lib/client/card.js.map +1 -0
- package/lib/client/confluence.js +148 -0
- package/lib/client/confluence.js.map +1 -0
- package/lib/client/copy.js +18 -0
- package/lib/client/copy.js.map +1 -0
- package/lib/client/gitlab.js +64 -0
- package/lib/client/gitlab.js.map +1 -0
- package/lib/client/index.js +71 -0
- package/lib/client/index.js.map +1 -0
- package/lib/client/integrations.js +34 -0
- package/lib/client/integrations.js.map +1 -0
- package/lib/client/jira.js +150 -0
- package/lib/client/jira.js.map +1 -0
- package/lib/client/provider-card.js +143 -0
- package/lib/client/provider-card.js.map +1 -0
- package/lib/client/styles.js +35 -0
- package/lib/client/styles.js.map +1 -0
- package/lib/client/teamcity.js +55 -0
- package/lib/client/teamcity.js.map +1 -0
- package/lib/client.js +8069 -0
- package/lib/client.js.map +1 -0
- package/lib/coerce.js +69 -0
- package/lib/coerce.js.map +1 -0
- package/lib/config.js +51 -0
- package/lib/config.js.map +1 -0
- package/lib/errors.js +14 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.js +510 -0
- package/lib/index.js.map +1 -0
- package/lib/providers/bitrix24/catalog.js +245 -0
- package/lib/providers/bitrix24/catalog.js.map +1 -0
- package/lib/providers/bitrix24/config.js +40 -0
- package/lib/providers/bitrix24/config.js.map +1 -0
- package/lib/providers/bitrix24/index.js +128 -0
- package/lib/providers/bitrix24/index.js.map +1 -0
- package/lib/providers/bitrix24/operations.js +491 -0
- package/lib/providers/bitrix24/operations.js.map +1 -0
- package/lib/providers/bitrix24/tools.js +1035 -0
- package/lib/providers/bitrix24/tools.js.map +1 -0
- package/lib/providers/bitrix24/transport.js +142 -0
- package/lib/providers/bitrix24/transport.js.map +1 -0
- package/lib/providers/confluence/adf.js +348 -0
- package/lib/providers/confluence/adf.js.map +1 -0
- package/lib/providers/confluence/catalog.js +135 -0
- package/lib/providers/confluence/catalog.js.map +1 -0
- package/lib/providers/confluence/config.js +196 -0
- package/lib/providers/confluence/config.js.map +1 -0
- package/lib/providers/confluence/cql.js +78 -0
- package/lib/providers/confluence/cql.js.map +1 -0
- package/lib/providers/confluence/index.js +319 -0
- package/lib/providers/confluence/index.js.map +1 -0
- package/lib/providers/confluence/operations.js +653 -0
- package/lib/providers/confluence/operations.js.map +1 -0
- package/lib/providers/confluence/tools.js +282 -0
- package/lib/providers/confluence/tools.js.map +1 -0
- package/lib/providers/confluence/transport.js +247 -0
- package/lib/providers/confluence/transport.js.map +1 -0
- package/lib/providers/contract.js +2 -0
- package/lib/providers/contract.js.map +1 -0
- package/lib/providers/gitlab/catalog.js +171 -0
- package/lib/providers/gitlab/catalog.js.map +1 -0
- package/lib/providers/gitlab/config.js +141 -0
- package/lib/providers/gitlab/config.js.map +1 -0
- package/lib/providers/gitlab/index.js +227 -0
- package/lib/providers/gitlab/index.js.map +1 -0
- package/lib/providers/gitlab/operations.js +794 -0
- package/lib/providers/gitlab/operations.js.map +1 -0
- package/lib/providers/gitlab/tools.js +859 -0
- package/lib/providers/gitlab/tools.js.map +1 -0
- package/lib/providers/gitlab/transport.js +140 -0
- package/lib/providers/gitlab/transport.js.map +1 -0
- package/lib/providers/jira/adf.js +235 -0
- package/lib/providers/jira/adf.js.map +1 -0
- package/lib/providers/jira/catalog.js +145 -0
- package/lib/providers/jira/catalog.js.map +1 -0
- package/lib/providers/jira/config.js +198 -0
- package/lib/providers/jira/config.js.map +1 -0
- package/lib/providers/jira/index.js +301 -0
- package/lib/providers/jira/index.js.map +1 -0
- package/lib/providers/jira/jql.js +299 -0
- package/lib/providers/jira/jql.js.map +1 -0
- package/lib/providers/jira/operations.js +617 -0
- package/lib/providers/jira/operations.js.map +1 -0
- package/lib/providers/jira/tools.js +341 -0
- package/lib/providers/jira/tools.js.map +1 -0
- package/lib/providers/jira/transport.js +227 -0
- package/lib/providers/jira/transport.js.map +1 -0
- package/lib/providers/registry.js +21 -0
- package/lib/providers/registry.js.map +1 -0
- package/lib/providers/shared/account.js +20 -0
- package/lib/providers/shared/account.js.map +1 -0
- package/lib/providers/shared/host.js +15 -0
- package/lib/providers/shared/host.js.map +1 -0
- package/lib/providers/shared/http.js +148 -0
- package/lib/providers/shared/http.js.map +1 -0
- package/lib/providers/teamcity/artifacts.js +155 -0
- package/lib/providers/teamcity/artifacts.js.map +1 -0
- package/lib/providers/teamcity/catalog.js +155 -0
- package/lib/providers/teamcity/catalog.js.map +1 -0
- package/lib/providers/teamcity/config.js +262 -0
- package/lib/providers/teamcity/config.js.map +1 -0
- package/lib/providers/teamcity/index.js +228 -0
- package/lib/providers/teamcity/index.js.map +1 -0
- package/lib/providers/teamcity/locators.js +95 -0
- package/lib/providers/teamcity/locators.js.map +1 -0
- package/lib/providers/teamcity/logs.js +113 -0
- package/lib/providers/teamcity/logs.js.map +1 -0
- package/lib/providers/teamcity/network.js +160 -0
- package/lib/providers/teamcity/network.js.map +1 -0
- package/lib/providers/teamcity/operations.js +625 -0
- package/lib/providers/teamcity/operations.js.map +1 -0
- package/lib/providers/teamcity/tools.js +480 -0
- package/lib/providers/teamcity/tools.js.map +1 -0
- package/lib/providers/teamcity/transport.js +126 -0
- package/lib/providers/teamcity/transport.js.map +1 -0
- package/lib/redaction.js +38 -0
- package/lib/redaction.js.map +1 -0
- package/lib/repository.js +414 -0
- package/lib/repository.js.map +1 -0
- package/lib/secrets/key-provider.js +76 -0
- package/lib/secrets/key-provider.js.map +1 -0
- package/lib/secrets/secret-store.js +93 -0
- package/lib/secrets/secret-store.js.map +1 -0
- package/lib/shared/settings.js +19 -0
- package/lib/shared/settings.js.map +1 -0
- package/lib/tool-kit.js +55 -0
- package/lib/tool-kit.js.map +1 -0
- package/lib/tools.js +28 -0
- package/lib/tools.js.map +1 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +1689 -0
- package/lib/typert.remote-client.d.ts +84 -0
- package/lib/typert.remote-client.js +1429 -0
- package/lib/types/broker.d.ts +30 -0
- package/lib/types/client/bitrix24.d.ts +18 -0
- package/lib/types/client/card.d.ts +13 -0
- package/lib/types/client/confluence.d.ts +17 -0
- package/lib/types/client/copy.d.ts +7 -0
- package/lib/types/client/gitlab.d.ts +15 -0
- package/lib/types/client/index.d.ts +13 -0
- package/lib/types/client/integrations.d.ts +28 -0
- package/lib/types/client/jira.d.ts +17 -0
- package/lib/types/client/provider-card.d.ts +63 -0
- package/lib/types/client/styles.d.ts +7 -0
- package/lib/types/client/teamcity.d.ts +19 -0
- package/lib/types/coerce.d.ts +18 -0
- package/lib/types/config.d.ts +48 -0
- package/lib/types/errors.d.ts +26 -0
- package/lib/types/index.d.ts +170 -0
- package/lib/types/providers/bitrix24/catalog.d.ts +48 -0
- package/lib/types/providers/bitrix24/config.d.ts +43 -0
- package/lib/types/providers/bitrix24/index.d.ts +31 -0
- package/lib/types/providers/bitrix24/operations.d.ts +13 -0
- package/lib/types/providers/bitrix24/tools.d.ts +9 -0
- package/lib/types/providers/bitrix24/transport.d.ts +26 -0
- package/lib/types/providers/confluence/adf.d.ts +22 -0
- package/lib/types/providers/confluence/catalog.d.ts +59 -0
- package/lib/types/providers/confluence/config.d.ts +68 -0
- package/lib/types/providers/confluence/cql.d.ts +43 -0
- package/lib/types/providers/confluence/index.d.ts +73 -0
- package/lib/types/providers/confluence/operations.d.ts +92 -0
- package/lib/types/providers/confluence/tools.d.ts +15 -0
- package/lib/types/providers/confluence/transport.d.ts +77 -0
- package/lib/types/providers/contract.d.ts +33 -0
- package/lib/types/providers/gitlab/catalog.d.ts +49 -0
- package/lib/types/providers/gitlab/config.d.ts +50 -0
- package/lib/types/providers/gitlab/index.d.ts +49 -0
- package/lib/types/providers/gitlab/operations.d.ts +40 -0
- package/lib/types/providers/gitlab/tools.d.ts +15 -0
- package/lib/types/providers/gitlab/transport.d.ts +52 -0
- package/lib/types/providers/jira/adf.d.ts +27 -0
- package/lib/types/providers/jira/catalog.d.ts +74 -0
- package/lib/types/providers/jira/config.d.ts +73 -0
- package/lib/types/providers/jira/index.d.ts +79 -0
- package/lib/types/providers/jira/jql.d.ts +51 -0
- package/lib/types/providers/jira/operations.d.ts +58 -0
- package/lib/types/providers/jira/tools.d.ts +17 -0
- package/lib/types/providers/jira/transport.d.ts +65 -0
- package/lib/types/providers/registry.d.ts +9 -0
- package/lib/types/providers/shared/account.d.ts +10 -0
- package/lib/types/providers/shared/host.d.ts +9 -0
- package/lib/types/providers/shared/http.d.ts +51 -0
- package/lib/types/providers/teamcity/artifacts.d.ts +45 -0
- package/lib/types/providers/teamcity/catalog.d.ts +55 -0
- package/lib/types/providers/teamcity/config.d.ts +66 -0
- package/lib/types/providers/teamcity/index.d.ts +62 -0
- package/lib/types/providers/teamcity/locators.d.ts +47 -0
- package/lib/types/providers/teamcity/logs.d.ts +31 -0
- package/lib/types/providers/teamcity/network.d.ts +32 -0
- package/lib/types/providers/teamcity/operations.d.ts +84 -0
- package/lib/types/providers/teamcity/tools.d.ts +15 -0
- package/lib/types/providers/teamcity/transport.d.ts +53 -0
- package/lib/types/redaction.d.ts +3 -0
- package/lib/types/repository.d.ts +48 -0
- package/lib/types/secrets/key-provider.d.ts +30 -0
- package/lib/types/secrets/secret-store.d.ts +12 -0
- package/lib/types/shared/settings.d.ts +19 -0
- package/lib/types/tool-kit.d.ts +26 -0
- package/lib/types/tools.d.ts +16 -0
- package/lib/types/types.d.ts +138 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/package.json +143 -0
|
@@ -0,0 +1,1035 @@
|
|
|
1
|
+
import { optionalBoolean, optionalDate, optionalInteger, requiredDate, requiredInteger, requiredIntegerList, requiredStringList, requiredText, } from "../../coerce.js";
|
|
2
|
+
import { createToolKit } from "../../tool-kit.js";
|
|
3
|
+
export const BITRIX24_TOOL_NAMES = [
|
|
4
|
+
"bitrix_search_crm",
|
|
5
|
+
"bitrix_get_crm_item",
|
|
6
|
+
"bitrix_get_crm_fields",
|
|
7
|
+
"bitrix_get_crm_funnels",
|
|
8
|
+
"bitrix_get_crm_statuses",
|
|
9
|
+
"bitrix_get_crm_activities",
|
|
10
|
+
"bitrix_get_crm_activity",
|
|
11
|
+
"bitrix_get_crm_timeline",
|
|
12
|
+
"bitrix_get_crm_stage_history",
|
|
13
|
+
"bitrix_get_crm_product_rows",
|
|
14
|
+
"bitrix_find_crm_duplicates",
|
|
15
|
+
"bitrix_get_crm_requisites",
|
|
16
|
+
"bitrix_get_call_transcript",
|
|
17
|
+
"bitrix_get_current_user",
|
|
18
|
+
"bitrix_search_users",
|
|
19
|
+
"bitrix_get_departments",
|
|
20
|
+
"bitrix_get_user_fields",
|
|
21
|
+
"bitrix_search_chats",
|
|
22
|
+
"bitrix_get_chat_messages",
|
|
23
|
+
"bitrix_search_chat_messages",
|
|
24
|
+
"bitrix_get_recent_chats",
|
|
25
|
+
"bitrix_search_chat_users",
|
|
26
|
+
"bitrix_find_chat",
|
|
27
|
+
"bitrix_get_chat_participants",
|
|
28
|
+
"bitrix_get_chat_user_data",
|
|
29
|
+
"bitrix_get_openline_dialog",
|
|
30
|
+
"bitrix_get_openline_history",
|
|
31
|
+
"bitrix_search_tasks",
|
|
32
|
+
"bitrix_get_task",
|
|
33
|
+
"bitrix_get_task_history",
|
|
34
|
+
"bitrix_get_task_results",
|
|
35
|
+
"bitrix_get_task_elapsed_time",
|
|
36
|
+
"bitrix_get_calendar_events",
|
|
37
|
+
"bitrix_get_calendar_accessibility",
|
|
38
|
+
"bitrix_search_files",
|
|
39
|
+
"bitrix_get_file",
|
|
40
|
+
"bitrix_get_drives",
|
|
41
|
+
"bitrix_get_storage_items",
|
|
42
|
+
"bitrix_get_folder_items",
|
|
43
|
+
];
|
|
44
|
+
const ENTITY_TYPE_HINT = "Bitrix CRM entity type: 1 lead, 2 deal, 3 contact, 4 company, 31 invoice, or a smart-process type id.";
|
|
45
|
+
const DIALOG_ID_HINT = 'Bitrix dialog id such as "chat1489"; some methods also accept a bare numeric chat id.';
|
|
46
|
+
const DATE_HINT = "Date in YYYY-MM-DD form.";
|
|
47
|
+
const START_HINT = "Pagination offset; Bitrix returns at most 50 items per page and the answer carries the next offset.";
|
|
48
|
+
export function createBitrix24Tools(options) {
|
|
49
|
+
const kit = createToolKit({ ...options, provider: "bitrix24" });
|
|
50
|
+
const tool = kit.tool;
|
|
51
|
+
return [
|
|
52
|
+
tool({
|
|
53
|
+
name: "bitrix_search_crm",
|
|
54
|
+
description: "Search CRM items (leads, deals, contacts, companies, invoices, smart processes) visible to the connected Bitrix24 account. Read-only; returns id, title and assignment, use bitrix_get_crm_item for full fields.",
|
|
55
|
+
parameters: {
|
|
56
|
+
entityTypeId: {
|
|
57
|
+
type: "number",
|
|
58
|
+
required: true,
|
|
59
|
+
description: ENTITY_TYPE_HINT,
|
|
60
|
+
},
|
|
61
|
+
query: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Optional case-insensitive substring of the item title, up to 200 characters.",
|
|
64
|
+
},
|
|
65
|
+
assignedToMe: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
description: "Only items assigned to the connected Bitrix24 user. Useful for 'my deals'.",
|
|
68
|
+
},
|
|
69
|
+
start: { type: "number", description: START_HINT },
|
|
70
|
+
},
|
|
71
|
+
operation: "crm.search",
|
|
72
|
+
input: (args) => ({
|
|
73
|
+
entityTypeId: requiredInteger(args["entityTypeId"], "entityTypeId"),
|
|
74
|
+
...(args["query"] === undefined
|
|
75
|
+
? {}
|
|
76
|
+
: { query: requiredText(args["query"], "query", 1, 200) }),
|
|
77
|
+
...(args["assignedToMe"] === undefined
|
|
78
|
+
? {}
|
|
79
|
+
: {
|
|
80
|
+
assignedToMe: optionalBoolean(args["assignedToMe"], "assignedToMe"),
|
|
81
|
+
}),
|
|
82
|
+
...(args["start"] === undefined
|
|
83
|
+
? {}
|
|
84
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
85
|
+
}),
|
|
86
|
+
}),
|
|
87
|
+
tool({
|
|
88
|
+
name: "bitrix_get_crm_item",
|
|
89
|
+
description: "Read one CRM item by id, including its custom fields and communication data (phone, e-mail, IM). Read-only.",
|
|
90
|
+
parameters: {
|
|
91
|
+
entityTypeId: {
|
|
92
|
+
type: "number",
|
|
93
|
+
required: true,
|
|
94
|
+
description: ENTITY_TYPE_HINT,
|
|
95
|
+
},
|
|
96
|
+
id: {
|
|
97
|
+
type: "number",
|
|
98
|
+
required: true,
|
|
99
|
+
description: "CRM item id.",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
operation: "crm.get",
|
|
103
|
+
input: (args) => ({
|
|
104
|
+
entityTypeId: requiredInteger(args["entityTypeId"], "entityTypeId"),
|
|
105
|
+
id: requiredInteger(args["id"], "id"),
|
|
106
|
+
}),
|
|
107
|
+
}),
|
|
108
|
+
tool({
|
|
109
|
+
name: "bitrix_get_crm_fields",
|
|
110
|
+
description: "Describe the fields of a CRM entity type, including the portal's custom UF_CRM_* fields. Call this before answering questions about fields you have not seen. Read-only.",
|
|
111
|
+
parameters: {
|
|
112
|
+
entityTypeId: {
|
|
113
|
+
type: "number",
|
|
114
|
+
required: true,
|
|
115
|
+
description: ENTITY_TYPE_HINT,
|
|
116
|
+
},
|
|
117
|
+
originalUfNames: {
|
|
118
|
+
type: "boolean",
|
|
119
|
+
description: "Return custom field names as stored (UF_CRM_2_1639...) instead of camelCase.",
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
operation: "crm.fields",
|
|
123
|
+
input: (args) => ({
|
|
124
|
+
entityTypeId: requiredInteger(args["entityTypeId"], "entityTypeId"),
|
|
125
|
+
...(args["originalUfNames"] === undefined
|
|
126
|
+
? {}
|
|
127
|
+
: {
|
|
128
|
+
originalUfNames: optionalBoolean(args["originalUfNames"], "originalUfNames"),
|
|
129
|
+
}),
|
|
130
|
+
}),
|
|
131
|
+
}),
|
|
132
|
+
tool({
|
|
133
|
+
name: "bitrix_get_crm_funnels",
|
|
134
|
+
description: "List the sales funnels (categories) of a CRM entity type. Read-only.",
|
|
135
|
+
parameters: {
|
|
136
|
+
entityTypeId: {
|
|
137
|
+
type: "number",
|
|
138
|
+
required: true,
|
|
139
|
+
description: ENTITY_TYPE_HINT,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
operation: "crm.funnels",
|
|
143
|
+
input: (args) => ({
|
|
144
|
+
entityTypeId: requiredInteger(args["entityTypeId"], "entityTypeId"),
|
|
145
|
+
}),
|
|
146
|
+
}),
|
|
147
|
+
tool({
|
|
148
|
+
name: "bitrix_get_crm_statuses",
|
|
149
|
+
description: 'Decode CRM stage and dictionary ids into names. Read-only. entityId is a Bitrix status dictionary: "STATUS" for lead stages, "DEAL_STAGE" for the default deal funnel, "DEAL_STAGE_<categoryId>" for another funnel (see bitrix_get_crm_funnels), plus dictionaries such as SOURCE, INDUSTRY, DEAL_TYPE.',
|
|
150
|
+
parameters: {
|
|
151
|
+
entityId: {
|
|
152
|
+
type: "string",
|
|
153
|
+
required: true,
|
|
154
|
+
description: "Status dictionary id, for example STATUS or DEAL_STAGE_1.",
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
operation: "crm.statuses",
|
|
158
|
+
input: (args) => ({
|
|
159
|
+
entityId: requiredText(args["entityId"], "entityId", 1, 64),
|
|
160
|
+
}),
|
|
161
|
+
}),
|
|
162
|
+
tool({
|
|
163
|
+
name: "bitrix_get_crm_activities",
|
|
164
|
+
description: "List CRM activities (calls, meetings, e-mails, tasks) with deadline and completion state. Read-only; use bitrix_get_crm_activity for one activity's full description or call transcript. Dates are served by Bitrix without a timezone guarantee.",
|
|
165
|
+
parameters: {
|
|
166
|
+
entityTypeId: {
|
|
167
|
+
type: "number",
|
|
168
|
+
description: `Optional owner filter. ${ENTITY_TYPE_HINT}`,
|
|
169
|
+
},
|
|
170
|
+
entityId: {
|
|
171
|
+
type: "number",
|
|
172
|
+
description: "Optional owner id; combine with entityTypeId to read one deal's or lead's activities.",
|
|
173
|
+
},
|
|
174
|
+
assignedToMe: {
|
|
175
|
+
type: "boolean",
|
|
176
|
+
description: "Only activities of the connected Bitrix24 user.",
|
|
177
|
+
},
|
|
178
|
+
openOnly: {
|
|
179
|
+
type: "boolean",
|
|
180
|
+
description: "Only unfinished activities.",
|
|
181
|
+
},
|
|
182
|
+
deadlineTo: {
|
|
183
|
+
type: "string",
|
|
184
|
+
description: `Only activities due on or before this date. ${DATE_HINT}`,
|
|
185
|
+
},
|
|
186
|
+
start: { type: "number", description: START_HINT },
|
|
187
|
+
},
|
|
188
|
+
operation: "crm.activities",
|
|
189
|
+
input: (args) => ({
|
|
190
|
+
...(args["entityTypeId"] === undefined
|
|
191
|
+
? {}
|
|
192
|
+
: {
|
|
193
|
+
entityTypeId: optionalInteger(args["entityTypeId"], "entityTypeId"),
|
|
194
|
+
}),
|
|
195
|
+
...(args["entityId"] === undefined
|
|
196
|
+
? {}
|
|
197
|
+
: { entityId: optionalInteger(args["entityId"], "entityId") }),
|
|
198
|
+
...(args["assignedToMe"] === undefined
|
|
199
|
+
? {}
|
|
200
|
+
: {
|
|
201
|
+
assignedToMe: optionalBoolean(args["assignedToMe"], "assignedToMe"),
|
|
202
|
+
}),
|
|
203
|
+
...(args["openOnly"] === undefined
|
|
204
|
+
? {}
|
|
205
|
+
: { openOnly: optionalBoolean(args["openOnly"], "openOnly") }),
|
|
206
|
+
...(args["deadlineTo"] === undefined
|
|
207
|
+
? {}
|
|
208
|
+
: { deadlineTo: optionalDate(args["deadlineTo"], "deadlineTo") }),
|
|
209
|
+
...(args["start"] === undefined
|
|
210
|
+
? {}
|
|
211
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
212
|
+
}),
|
|
213
|
+
}),
|
|
214
|
+
tool({
|
|
215
|
+
name: "bitrix_get_crm_activity",
|
|
216
|
+
description: "Read one CRM activity in full, including its description and provider data. Read-only.",
|
|
217
|
+
parameters: {
|
|
218
|
+
id: {
|
|
219
|
+
type: "number",
|
|
220
|
+
required: true,
|
|
221
|
+
description: "Activity id from bitrix_get_crm_activities.",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
operation: "crm.activity",
|
|
225
|
+
input: (args) => ({ id: requiredInteger(args["id"], "id") }),
|
|
226
|
+
}),
|
|
227
|
+
tool({
|
|
228
|
+
name: "bitrix_get_crm_timeline",
|
|
229
|
+
description: "Read the timeline comments (manager notes) of a lead, deal, contact or company. Read-only.",
|
|
230
|
+
parameters: {
|
|
231
|
+
entityTypeId: {
|
|
232
|
+
type: "number",
|
|
233
|
+
required: true,
|
|
234
|
+
description: "Timeline entity type: 1 lead, 2 deal, 3 contact, 4 company.",
|
|
235
|
+
},
|
|
236
|
+
entityId: {
|
|
237
|
+
type: "number",
|
|
238
|
+
required: true,
|
|
239
|
+
description: "CRM item id.",
|
|
240
|
+
},
|
|
241
|
+
start: { type: "number", description: START_HINT },
|
|
242
|
+
},
|
|
243
|
+
operation: "crm.timeline",
|
|
244
|
+
input: (args) => ({
|
|
245
|
+
entityTypeId: requiredInteger(args["entityTypeId"], "entityTypeId"),
|
|
246
|
+
entityId: requiredInteger(args["entityId"], "entityId"),
|
|
247
|
+
...(args["start"] === undefined
|
|
248
|
+
? {}
|
|
249
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
250
|
+
}),
|
|
251
|
+
}),
|
|
252
|
+
tool({
|
|
253
|
+
name: "bitrix_get_crm_stage_history",
|
|
254
|
+
description: "Read how a CRM item moved through the funnel: stage changes with timestamps. Read-only. Answers 'how long has it been on this stage' and 'where was it returned from'.",
|
|
255
|
+
parameters: {
|
|
256
|
+
entityTypeId: {
|
|
257
|
+
type: "number",
|
|
258
|
+
required: true,
|
|
259
|
+
description: ENTITY_TYPE_HINT,
|
|
260
|
+
},
|
|
261
|
+
entityId: {
|
|
262
|
+
type: "number",
|
|
263
|
+
description: "Optional CRM item id; without it the portal returns its own paged slice.",
|
|
264
|
+
},
|
|
265
|
+
start: { type: "number", description: START_HINT },
|
|
266
|
+
},
|
|
267
|
+
operation: "crm.stageHistory",
|
|
268
|
+
input: (args) => ({
|
|
269
|
+
entityTypeId: requiredInteger(args["entityTypeId"], "entityTypeId"),
|
|
270
|
+
...(args["entityId"] === undefined
|
|
271
|
+
? {}
|
|
272
|
+
: { entityId: optionalInteger(args["entityId"], "entityId") }),
|
|
273
|
+
...(args["start"] === undefined
|
|
274
|
+
? {}
|
|
275
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
276
|
+
}),
|
|
277
|
+
}),
|
|
278
|
+
tool({
|
|
279
|
+
name: "bitrix_get_crm_product_rows",
|
|
280
|
+
description: "List the product rows of a CRM item: what is being sold, quantity, price and discounts. Read-only.",
|
|
281
|
+
parameters: {
|
|
282
|
+
ownerType: {
|
|
283
|
+
type: "string",
|
|
284
|
+
required: true,
|
|
285
|
+
description: 'Owner type code from the CRM object types reference, for example "D" for a deal.',
|
|
286
|
+
},
|
|
287
|
+
ownerId: {
|
|
288
|
+
type: "number",
|
|
289
|
+
required: true,
|
|
290
|
+
description: "CRM item id.",
|
|
291
|
+
},
|
|
292
|
+
start: { type: "number", description: START_HINT },
|
|
293
|
+
},
|
|
294
|
+
operation: "crm.productRows",
|
|
295
|
+
input: (args) => ({
|
|
296
|
+
ownerType: requiredText(args["ownerType"], "ownerType", 1, 8),
|
|
297
|
+
ownerId: requiredInteger(args["ownerId"], "ownerId"),
|
|
298
|
+
...(args["start"] === undefined
|
|
299
|
+
? {}
|
|
300
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
301
|
+
}),
|
|
302
|
+
}),
|
|
303
|
+
tool({
|
|
304
|
+
name: "bitrix_find_crm_duplicates",
|
|
305
|
+
description: "Find CRM leads, contacts and companies that share a phone number or e-mail. Read-only; at most 20 values per call.",
|
|
306
|
+
parameters: {
|
|
307
|
+
type: {
|
|
308
|
+
type: "string",
|
|
309
|
+
enum: ["PHONE", "EMAIL"],
|
|
310
|
+
required: true,
|
|
311
|
+
description: "What the values are.",
|
|
312
|
+
},
|
|
313
|
+
values: {
|
|
314
|
+
type: "array",
|
|
315
|
+
items: { type: "string" },
|
|
316
|
+
required: true,
|
|
317
|
+
description: "Up to 20 phone numbers or e-mail addresses.",
|
|
318
|
+
},
|
|
319
|
+
entityType: {
|
|
320
|
+
type: "string",
|
|
321
|
+
enum: ["LEAD", "CONTACT", "COMPANY"],
|
|
322
|
+
description: "Restrict the search to one entity type.",
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
operation: "crm.duplicates",
|
|
326
|
+
input: (args) => ({
|
|
327
|
+
type: requiredText(args["type"], "type", 4, 5),
|
|
328
|
+
values: requiredStringList(args["values"], "values", 20, 320),
|
|
329
|
+
...(args["entityType"] === undefined
|
|
330
|
+
? {}
|
|
331
|
+
: {
|
|
332
|
+
entityType: requiredText(args["entityType"], "entityType", 4, 8),
|
|
333
|
+
}),
|
|
334
|
+
}),
|
|
335
|
+
}),
|
|
336
|
+
tool({
|
|
337
|
+
name: "bitrix_get_crm_requisites",
|
|
338
|
+
description: "List the billing requisites (ИНН, КПП, address, bank details) of a contact or a company. Read-only; the portal returns every available field.",
|
|
339
|
+
parameters: {
|
|
340
|
+
entityTypeId: {
|
|
341
|
+
type: "number",
|
|
342
|
+
required: true,
|
|
343
|
+
description: "Requisite owner type: 3 contact, 4 company.",
|
|
344
|
+
},
|
|
345
|
+
entityId: {
|
|
346
|
+
type: "number",
|
|
347
|
+
required: true,
|
|
348
|
+
description: "Contact or company id.",
|
|
349
|
+
},
|
|
350
|
+
start: { type: "number", description: START_HINT },
|
|
351
|
+
},
|
|
352
|
+
operation: "crm.requisites",
|
|
353
|
+
input: (args) => ({
|
|
354
|
+
entityTypeId: requiredInteger(args["entityTypeId"], "entityTypeId"),
|
|
355
|
+
entityId: requiredInteger(args["entityId"], "entityId"),
|
|
356
|
+
...(args["start"] === undefined
|
|
357
|
+
? {}
|
|
358
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
359
|
+
}),
|
|
360
|
+
}),
|
|
361
|
+
tool({
|
|
362
|
+
name: "bitrix_get_call_transcript",
|
|
363
|
+
description: "Read the ready-made AI transcription of one call activity. Read-only; it never starts transcription generation, and answers null while the transcription is not ready or when call processing failed.",
|
|
364
|
+
parameters: {
|
|
365
|
+
activityId: {
|
|
366
|
+
type: "number",
|
|
367
|
+
required: true,
|
|
368
|
+
description: "Call activity id, for example from bitrix_get_crm_activities (activities of type 2).",
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
operation: "crm.callTranscript",
|
|
372
|
+
input: (args) => ({
|
|
373
|
+
activityId: requiredInteger(args["activityId"], "activityId"),
|
|
374
|
+
}),
|
|
375
|
+
}),
|
|
376
|
+
tool({
|
|
377
|
+
name: "bitrix_get_current_user",
|
|
378
|
+
description: "Identify the Bitrix24 user this connection belongs to. Read-only.",
|
|
379
|
+
parameters: {},
|
|
380
|
+
operation: "user.current",
|
|
381
|
+
input: () => ({}),
|
|
382
|
+
}),
|
|
383
|
+
tool({
|
|
384
|
+
name: "bitrix_search_users",
|
|
385
|
+
description: "Find Bitrix24 employees by name, e-mail or department. Read-only. Use it to turn an assignedById from a CRM item into a person. Returned fields depend on the webhook's user scope.",
|
|
386
|
+
parameters: {
|
|
387
|
+
query: {
|
|
388
|
+
type: "string",
|
|
389
|
+
description: "Name search phrase, at least 2 characters.",
|
|
390
|
+
},
|
|
391
|
+
email: {
|
|
392
|
+
type: "string",
|
|
393
|
+
description: "Exact e-mail address.",
|
|
394
|
+
},
|
|
395
|
+
departmentId: {
|
|
396
|
+
type: "number",
|
|
397
|
+
description: "Only employees of this department.",
|
|
398
|
+
},
|
|
399
|
+
activeOnly: {
|
|
400
|
+
type: "boolean",
|
|
401
|
+
description: "Skip dismissed employees.",
|
|
402
|
+
},
|
|
403
|
+
start: { type: "number", description: START_HINT },
|
|
404
|
+
},
|
|
405
|
+
operation: "user.list",
|
|
406
|
+
input: (args) => ({
|
|
407
|
+
...(args["query"] === undefined
|
|
408
|
+
? {}
|
|
409
|
+
: { query: requiredText(args["query"], "query", 2, 120) }),
|
|
410
|
+
...(args["email"] === undefined
|
|
411
|
+
? {}
|
|
412
|
+
: { email: requiredText(args["email"], "email", 3, 320) }),
|
|
413
|
+
...(args["departmentId"] === undefined
|
|
414
|
+
? {}
|
|
415
|
+
: {
|
|
416
|
+
departmentId: optionalInteger(args["departmentId"], "departmentId"),
|
|
417
|
+
}),
|
|
418
|
+
...(args["activeOnly"] === undefined
|
|
419
|
+
? {}
|
|
420
|
+
: { activeOnly: optionalBoolean(args["activeOnly"], "activeOnly") }),
|
|
421
|
+
...(args["start"] === undefined
|
|
422
|
+
? {}
|
|
423
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
424
|
+
}),
|
|
425
|
+
}),
|
|
426
|
+
tool({
|
|
427
|
+
name: "bitrix_get_departments",
|
|
428
|
+
description: "List company departments with their parent department and head. Read-only; the first page covers up to 50 departments.",
|
|
429
|
+
parameters: {
|
|
430
|
+
parentId: {
|
|
431
|
+
type: "number",
|
|
432
|
+
description: "Only direct children of this department.",
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
operation: "user.departments",
|
|
436
|
+
input: (args) => args["parentId"] === undefined
|
|
437
|
+
? {}
|
|
438
|
+
: { parentId: optionalInteger(args["parentId"], "parentId") },
|
|
439
|
+
}),
|
|
440
|
+
tool({
|
|
441
|
+
name: "bitrix_get_user_fields",
|
|
442
|
+
description: "List the employee field codes the connected webhook may read, with their labels. Read-only; call it before answering questions about employee fields. Custom user fields are not included.",
|
|
443
|
+
parameters: {},
|
|
444
|
+
operation: "user.fields",
|
|
445
|
+
input: () => ({}),
|
|
446
|
+
}),
|
|
447
|
+
tool({
|
|
448
|
+
name: "bitrix_search_chats",
|
|
449
|
+
description: "Search group chats and open-line dialogs by title and participant names. Read-only; returns chat objects whose entity_id may point at a CRM item.",
|
|
450
|
+
parameters: {
|
|
451
|
+
query: {
|
|
452
|
+
type: "string",
|
|
453
|
+
required: true,
|
|
454
|
+
description: "At least two characters.",
|
|
455
|
+
},
|
|
456
|
+
limit: { type: "number", description: "1-50; defaults to 10." },
|
|
457
|
+
start: {
|
|
458
|
+
type: "number",
|
|
459
|
+
description: "Offset of the first chat to return; defaults to 0.",
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
operation: "chat.search",
|
|
463
|
+
input: (args) => ({
|
|
464
|
+
query: requiredText(args["query"], "query", 2, 200),
|
|
465
|
+
...(args["limit"] === undefined
|
|
466
|
+
? {}
|
|
467
|
+
: { limit: optionalInteger(args["limit"], "limit", 1, 50) }),
|
|
468
|
+
...(args["start"] === undefined
|
|
469
|
+
? {}
|
|
470
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
471
|
+
}),
|
|
472
|
+
}),
|
|
473
|
+
tool({
|
|
474
|
+
name: "bitrix_get_chat_messages",
|
|
475
|
+
description: "Read recent messages of a chat by dialog id. Read-only. Page backwards by passing the id of the oldest message you already have as lastId.",
|
|
476
|
+
parameters: {
|
|
477
|
+
dialogId: {
|
|
478
|
+
type: "string",
|
|
479
|
+
required: true,
|
|
480
|
+
description: DIALOG_ID_HINT,
|
|
481
|
+
},
|
|
482
|
+
limit: { type: "number", description: "1-50; defaults to 20." },
|
|
483
|
+
lastId: {
|
|
484
|
+
type: "number",
|
|
485
|
+
description: "Return messages older than this message id.",
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
operation: "chat.messages",
|
|
489
|
+
input: (args) => ({
|
|
490
|
+
dialogId: requiredText(args["dialogId"], "dialogId", 1, 80),
|
|
491
|
+
...(args["limit"] === undefined
|
|
492
|
+
? {}
|
|
493
|
+
: { limit: optionalInteger(args["limit"], "limit", 1, 50) }),
|
|
494
|
+
...(args["lastId"] === undefined
|
|
495
|
+
? {}
|
|
496
|
+
: { lastId: optionalInteger(args["lastId"], "lastId") }),
|
|
497
|
+
}),
|
|
498
|
+
}),
|
|
499
|
+
tool({
|
|
500
|
+
name: "bitrix_search_chat_messages",
|
|
501
|
+
description: "Search inside one chat by text and date range. Read-only; answers 'what did the client write about X'.",
|
|
502
|
+
parameters: {
|
|
503
|
+
dialogId: {
|
|
504
|
+
type: "string",
|
|
505
|
+
required: true,
|
|
506
|
+
description: DIALOG_ID_HINT,
|
|
507
|
+
},
|
|
508
|
+
query: {
|
|
509
|
+
type: "string",
|
|
510
|
+
description: "Text to look for, longer than two characters.",
|
|
511
|
+
},
|
|
512
|
+
dateFrom: { type: "string", description: DATE_HINT },
|
|
513
|
+
dateTo: { type: "string", description: DATE_HINT },
|
|
514
|
+
limit: { type: "number", description: "1-200; defaults to 30." },
|
|
515
|
+
lastId: {
|
|
516
|
+
type: "number",
|
|
517
|
+
description: "Return messages older than this message id.",
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
operation: "chat.messageSearch",
|
|
521
|
+
input: (args) => ({
|
|
522
|
+
dialogId: requiredText(args["dialogId"], "dialogId", 1, 80),
|
|
523
|
+
...(args["query"] === undefined
|
|
524
|
+
? {}
|
|
525
|
+
: { query: requiredText(args["query"], "query", 2, 200) }),
|
|
526
|
+
...(args["dateFrom"] === undefined
|
|
527
|
+
? {}
|
|
528
|
+
: { dateFrom: optionalDate(args["dateFrom"], "dateFrom") }),
|
|
529
|
+
...(args["dateTo"] === undefined
|
|
530
|
+
? {}
|
|
531
|
+
: { dateTo: optionalDate(args["dateTo"], "dateTo") }),
|
|
532
|
+
...(args["limit"] === undefined
|
|
533
|
+
? {}
|
|
534
|
+
: { limit: optionalInteger(args["limit"], "limit", 1, 200) }),
|
|
535
|
+
...(args["lastId"] === undefined
|
|
536
|
+
? {}
|
|
537
|
+
: { lastId: optionalInteger(args["lastId"], "lastId") }),
|
|
538
|
+
}),
|
|
539
|
+
}),
|
|
540
|
+
tool({
|
|
541
|
+
name: "bitrix_get_recent_chats",
|
|
542
|
+
description: "List the connected user's most recent dialogs with their last message and unread counter. Read-only; answers 'what is waiting for me in chats'.",
|
|
543
|
+
parameters: {
|
|
544
|
+
skipOpenlines: {
|
|
545
|
+
type: "boolean",
|
|
546
|
+
description: "Leave out open-line dialogs.",
|
|
547
|
+
},
|
|
548
|
+
onlyOpenlines: {
|
|
549
|
+
type: "boolean",
|
|
550
|
+
description: "Only open-line dialogs.",
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
operation: "chat.recent",
|
|
554
|
+
input: (args) => ({
|
|
555
|
+
...(args["skipOpenlines"] === undefined
|
|
556
|
+
? {}
|
|
557
|
+
: {
|
|
558
|
+
skipOpenlines: optionalBoolean(args["skipOpenlines"], "skipOpenlines"),
|
|
559
|
+
}),
|
|
560
|
+
...(args["onlyOpenlines"] === undefined
|
|
561
|
+
? {}
|
|
562
|
+
: {
|
|
563
|
+
onlyOpenlines: optionalBoolean(args["onlyOpenlines"], "onlyOpenlines"),
|
|
564
|
+
}),
|
|
565
|
+
}),
|
|
566
|
+
}),
|
|
567
|
+
tool({
|
|
568
|
+
name: "bitrix_search_chat_users",
|
|
569
|
+
description: "Find employees as chat contacts, including their presence status and phone numbers. Read-only; the alternative to bitrix_search_users when contact details matter.",
|
|
570
|
+
parameters: {
|
|
571
|
+
query: {
|
|
572
|
+
type: "string",
|
|
573
|
+
required: true,
|
|
574
|
+
description: "At least two characters.",
|
|
575
|
+
},
|
|
576
|
+
limit: { type: "number", description: "1-50; defaults to 10." },
|
|
577
|
+
start: {
|
|
578
|
+
type: "number",
|
|
579
|
+
description: "Offset of the first contact to return; defaults to 0.",
|
|
580
|
+
},
|
|
581
|
+
},
|
|
582
|
+
operation: "chat.users",
|
|
583
|
+
input: (args) => ({
|
|
584
|
+
query: requiredText(args["query"], "query", 2, 200),
|
|
585
|
+
...(args["limit"] === undefined
|
|
586
|
+
? {}
|
|
587
|
+
: { limit: optionalInteger(args["limit"], "limit", 1, 50) }),
|
|
588
|
+
...(args["start"] === undefined
|
|
589
|
+
? {}
|
|
590
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
591
|
+
}),
|
|
592
|
+
}),
|
|
593
|
+
tool({
|
|
594
|
+
name: "bitrix_find_chat",
|
|
595
|
+
description: "Find the chat attached to another Bitrix24 object: the discussion chat of a CRM entity, an open-line chat, a task chat, a calendar event chat or a group chat. Read-only; returns the chat id to use with the other chat tools, or null when there is none.",
|
|
596
|
+
parameters: {
|
|
597
|
+
entityType: {
|
|
598
|
+
type: "string",
|
|
599
|
+
enum: [
|
|
600
|
+
"CRM",
|
|
601
|
+
"LINES",
|
|
602
|
+
"LIVECHAT",
|
|
603
|
+
"TASKS",
|
|
604
|
+
"TASKS_TASK",
|
|
605
|
+
"CALENDAR",
|
|
606
|
+
"SONET_GROUP",
|
|
607
|
+
"MAIL",
|
|
608
|
+
"CALL",
|
|
609
|
+
"VIDEOCONF",
|
|
610
|
+
"ANNOUNCEMENT",
|
|
611
|
+
"AI_ASSISTANT_PRIVATE",
|
|
612
|
+
],
|
|
613
|
+
required: true,
|
|
614
|
+
description: "What entityId identifies. CRM is the entity's discussion chat, LINES the open line seen by the operator, LIVECHAT the same dialog seen by the client.",
|
|
615
|
+
},
|
|
616
|
+
entityId: {
|
|
617
|
+
type: "string",
|
|
618
|
+
required: true,
|
|
619
|
+
description: 'Entity code in the format that entityType expects: "DEAL|1663", "LEAD|13", "CONTACT|25", "COMPANY|7" for CRM, "DYNAMIC_<entityTypeId>|<itemId>" for smart processes, a task id for TASKS, a calendar event id for CALENDAR, a group id for SONET_GROUP.',
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
operation: "chat.find",
|
|
623
|
+
input: (args) => ({
|
|
624
|
+
entityType: requiredText(args["entityType"], "entityType", 2, 32),
|
|
625
|
+
entityId: requiredText(args["entityId"], "entityId", 1, 200),
|
|
626
|
+
}),
|
|
627
|
+
}),
|
|
628
|
+
tool({
|
|
629
|
+
name: "bitrix_get_chat_participants",
|
|
630
|
+
description: "List the user ids participating in a chat. Read-only; the portal returns an empty list when the connected user may not see the participants.",
|
|
631
|
+
parameters: {
|
|
632
|
+
chatId: {
|
|
633
|
+
type: "number",
|
|
634
|
+
required: true,
|
|
635
|
+
description: "Numeric chat id from bitrix_find_chat, bitrix_search_chats or bitrix_get_openline_dialog.",
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
operation: "chat.participants",
|
|
639
|
+
input: (args) => ({
|
|
640
|
+
chatId: requiredInteger(args["chatId"], "chatId"),
|
|
641
|
+
}),
|
|
642
|
+
}),
|
|
643
|
+
tool({
|
|
644
|
+
name: "bitrix_get_chat_user_data",
|
|
645
|
+
description: "Read chat profiles of the given users: full name, position, departments, phones, e-mail and presence. Read-only; use it to put names to the ids from bitrix_get_chat_participants.",
|
|
646
|
+
parameters: {
|
|
647
|
+
users: {
|
|
648
|
+
type: "array",
|
|
649
|
+
items: { type: "number" },
|
|
650
|
+
required: true,
|
|
651
|
+
description: "Bitrix user ids, up to 50.",
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
operation: "chat.userData",
|
|
655
|
+
input: (args) => ({
|
|
656
|
+
users: requiredIntegerList(args["users"], "users", 50),
|
|
657
|
+
}),
|
|
658
|
+
}),
|
|
659
|
+
tool({
|
|
660
|
+
name: "bitrix_get_openline_dialog",
|
|
661
|
+
description: "Read one open-line (customer) dialog: participants, connector entity link, counters and permissions. Read-only. Pass a dialogId, a sessionId or the client's userCode, at least one.",
|
|
662
|
+
parameters: {
|
|
663
|
+
dialogId: {
|
|
664
|
+
type: "string",
|
|
665
|
+
description: 'Open-line dialog id such as "chat29".',
|
|
666
|
+
},
|
|
667
|
+
sessionId: {
|
|
668
|
+
type: "number",
|
|
669
|
+
description: "Session id from bitrix_get_openline_history or bitrix_get_recent_chats.",
|
|
670
|
+
},
|
|
671
|
+
userCode: {
|
|
672
|
+
type: "string",
|
|
673
|
+
description: 'External client code from a dialog\'s entity_id or a session\'s entityId, for example "livechat|22|1761|587" or "telegrambot|2|209607941|744". Finds the dialog from the client side.',
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
operation: "openlines.dialog",
|
|
677
|
+
input: (args) => ({
|
|
678
|
+
...(args["dialogId"] === undefined
|
|
679
|
+
? {}
|
|
680
|
+
: { dialogId: requiredText(args["dialogId"], "dialogId", 1, 80) }),
|
|
681
|
+
...(args["sessionId"] === undefined
|
|
682
|
+
? {}
|
|
683
|
+
: { sessionId: optionalInteger(args["sessionId"], "sessionId") }),
|
|
684
|
+
...(args["userCode"] === undefined
|
|
685
|
+
? {}
|
|
686
|
+
: { userCode: requiredText(args["userCode"], "userCode", 3, 200) }),
|
|
687
|
+
}),
|
|
688
|
+
}),
|
|
689
|
+
tool({
|
|
690
|
+
name: "bitrix_get_openline_history",
|
|
691
|
+
description: "Read the whole message history of one open-line session with the customer, plus its participants and files. Read-only; pass a sessionId or a numeric chatId, at least one.",
|
|
692
|
+
parameters: {
|
|
693
|
+
sessionId: {
|
|
694
|
+
type: "number",
|
|
695
|
+
description: "Session id; more precise than chatId.",
|
|
696
|
+
},
|
|
697
|
+
chatId: {
|
|
698
|
+
type: "number",
|
|
699
|
+
description: "Numeric chat id without the chat prefix; the last session of that chat is used.",
|
|
700
|
+
},
|
|
701
|
+
},
|
|
702
|
+
operation: "openlines.history",
|
|
703
|
+
input: (args) => ({
|
|
704
|
+
...(args["sessionId"] === undefined
|
|
705
|
+
? {}
|
|
706
|
+
: { sessionId: optionalInteger(args["sessionId"], "sessionId") }),
|
|
707
|
+
...(args["chatId"] === undefined
|
|
708
|
+
? {}
|
|
709
|
+
: { chatId: optionalInteger(args["chatId"], "chatId") }),
|
|
710
|
+
}),
|
|
711
|
+
}),
|
|
712
|
+
tool({
|
|
713
|
+
name: "bitrix_search_tasks",
|
|
714
|
+
description: "Search Bitrix24 tasks by title, responsible person, group and deadline. Read-only. Answers 'what is on me' and 'what is overdue'. Bitrix real status 5 means completed.",
|
|
715
|
+
parameters: {
|
|
716
|
+
query: {
|
|
717
|
+
type: "string",
|
|
718
|
+
description: "Substring of the task title.",
|
|
719
|
+
},
|
|
720
|
+
assignedToMe: {
|
|
721
|
+
type: "boolean",
|
|
722
|
+
description: "Only tasks whose responsible person is the connected user.",
|
|
723
|
+
},
|
|
724
|
+
createdByMe: {
|
|
725
|
+
type: "boolean",
|
|
726
|
+
description: "Only tasks created by the connected user.",
|
|
727
|
+
},
|
|
728
|
+
openOnly: {
|
|
729
|
+
type: "boolean",
|
|
730
|
+
description: "Skip completed tasks.",
|
|
731
|
+
},
|
|
732
|
+
groupId: {
|
|
733
|
+
type: "number",
|
|
734
|
+
description: "Only tasks of this workgroup or project.",
|
|
735
|
+
},
|
|
736
|
+
deadlineTo: {
|
|
737
|
+
type: "string",
|
|
738
|
+
description: `Only tasks due on or before this date. ${DATE_HINT}`,
|
|
739
|
+
},
|
|
740
|
+
start: { type: "number", description: START_HINT },
|
|
741
|
+
},
|
|
742
|
+
operation: "tasks.list",
|
|
743
|
+
input: (args) => ({
|
|
744
|
+
...(args["query"] === undefined
|
|
745
|
+
? {}
|
|
746
|
+
: { query: requiredText(args["query"], "query", 1, 200) }),
|
|
747
|
+
...(args["assignedToMe"] === undefined
|
|
748
|
+
? {}
|
|
749
|
+
: {
|
|
750
|
+
assignedToMe: optionalBoolean(args["assignedToMe"], "assignedToMe"),
|
|
751
|
+
}),
|
|
752
|
+
...(args["createdByMe"] === undefined
|
|
753
|
+
? {}
|
|
754
|
+
: {
|
|
755
|
+
createdByMe: optionalBoolean(args["createdByMe"], "createdByMe"),
|
|
756
|
+
}),
|
|
757
|
+
...(args["openOnly"] === undefined
|
|
758
|
+
? {}
|
|
759
|
+
: { openOnly: optionalBoolean(args["openOnly"], "openOnly") }),
|
|
760
|
+
...(args["groupId"] === undefined
|
|
761
|
+
? {}
|
|
762
|
+
: { groupId: optionalInteger(args["groupId"], "groupId") }),
|
|
763
|
+
...(args["deadlineTo"] === undefined
|
|
764
|
+
? {}
|
|
765
|
+
: { deadlineTo: optionalDate(args["deadlineTo"], "deadlineTo") }),
|
|
766
|
+
...(args["start"] === undefined
|
|
767
|
+
? {}
|
|
768
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
769
|
+
}),
|
|
770
|
+
}),
|
|
771
|
+
tool({
|
|
772
|
+
name: "bitrix_get_task",
|
|
773
|
+
description: "Read one task in full: description, creator, responsible person, dates, checklist and linked CRM items (ufCrmTask). Read-only.",
|
|
774
|
+
parameters: {
|
|
775
|
+
taskId: {
|
|
776
|
+
type: "number",
|
|
777
|
+
required: true,
|
|
778
|
+
description: "Task id from bitrix_search_tasks.",
|
|
779
|
+
},
|
|
780
|
+
},
|
|
781
|
+
operation: "tasks.get",
|
|
782
|
+
input: (args) => ({ taskId: requiredInteger(args["taskId"], "taskId") }),
|
|
783
|
+
}),
|
|
784
|
+
tool({
|
|
785
|
+
name: "bitrix_get_task_history",
|
|
786
|
+
description: "Read the change log of a task: what changed, when and by whom. Read-only; Bitrix24 returns a single page of up to 50 records, newest first unless the order is reversed here.",
|
|
787
|
+
parameters: {
|
|
788
|
+
taskId: {
|
|
789
|
+
type: "number",
|
|
790
|
+
required: true,
|
|
791
|
+
description: "Task id.",
|
|
792
|
+
},
|
|
793
|
+
event: {
|
|
794
|
+
type: "string",
|
|
795
|
+
description: "Only records of one event type, for example COMMENT, REAL_STATUS, DEADLINE, RESPONSIBLE_ID, CREATED_BY, GROUP_ID, CHECKLIST_ITEM_CHECK, TIME_SPENT_IN_LOGS.",
|
|
796
|
+
},
|
|
797
|
+
start: { type: "number", description: START_HINT },
|
|
798
|
+
},
|
|
799
|
+
operation: "tasks.history",
|
|
800
|
+
input: (args) => ({
|
|
801
|
+
taskId: requiredInteger(args["taskId"], "taskId"),
|
|
802
|
+
...(args["event"] === undefined
|
|
803
|
+
? {}
|
|
804
|
+
: { event: requiredText(args["event"], "event", 2, 40) }),
|
|
805
|
+
...(args["start"] === undefined
|
|
806
|
+
? {}
|
|
807
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
808
|
+
}),
|
|
809
|
+
}),
|
|
810
|
+
tool({
|
|
811
|
+
name: "bitrix_get_task_results",
|
|
812
|
+
description: "Read the results attached to a task: text, author, dates and files. Read-only.",
|
|
813
|
+
parameters: {
|
|
814
|
+
taskId: {
|
|
815
|
+
type: "number",
|
|
816
|
+
required: true,
|
|
817
|
+
description: "Task id.",
|
|
818
|
+
},
|
|
819
|
+
start: { type: "number", description: START_HINT },
|
|
820
|
+
},
|
|
821
|
+
operation: "tasks.results",
|
|
822
|
+
input: (args) => ({
|
|
823
|
+
taskId: requiredInteger(args["taskId"], "taskId"),
|
|
824
|
+
...(args["start"] === undefined
|
|
825
|
+
? {}
|
|
826
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
827
|
+
}),
|
|
828
|
+
}),
|
|
829
|
+
tool({
|
|
830
|
+
name: "bitrix_get_task_elapsed_time",
|
|
831
|
+
description: "Read the time tracking records of a task: who logged how long, with the comment and the date. Read-only; 50 records per page.",
|
|
832
|
+
parameters: {
|
|
833
|
+
taskId: {
|
|
834
|
+
type: "number",
|
|
835
|
+
required: true,
|
|
836
|
+
description: "Task id.",
|
|
837
|
+
},
|
|
838
|
+
loggedBy: {
|
|
839
|
+
type: "number",
|
|
840
|
+
description: "Only the records logged by this Bitrix user id; a filter on the records, not an identity selector.",
|
|
841
|
+
},
|
|
842
|
+
page: {
|
|
843
|
+
type: "number",
|
|
844
|
+
description: "Page number starting at 1; defaults to 1.",
|
|
845
|
+
},
|
|
846
|
+
},
|
|
847
|
+
operation: "tasks.elapsed",
|
|
848
|
+
input: (args) => ({
|
|
849
|
+
taskId: requiredInteger(args["taskId"], "taskId"),
|
|
850
|
+
...(args["loggedBy"] === undefined
|
|
851
|
+
? {}
|
|
852
|
+
: { loggedBy: optionalInteger(args["loggedBy"], "loggedBy") }),
|
|
853
|
+
...(args["page"] === undefined
|
|
854
|
+
? {}
|
|
855
|
+
: { page: optionalInteger(args["page"], "page") }),
|
|
856
|
+
}),
|
|
857
|
+
}),
|
|
858
|
+
tool({
|
|
859
|
+
name: "bitrix_get_calendar_events",
|
|
860
|
+
description: "List calendar events of a user, a workgroup or the company calendar for a date range, including attendees and CRM links. Read-only. Omit ownerId to read the connected user's own calendar.",
|
|
861
|
+
parameters: {
|
|
862
|
+
type: {
|
|
863
|
+
type: "string",
|
|
864
|
+
enum: ["user", "group", "company_calendar"],
|
|
865
|
+
description: 'Calendar kind; defaults to "user".',
|
|
866
|
+
},
|
|
867
|
+
ownerId: {
|
|
868
|
+
type: "number",
|
|
869
|
+
description: "Calendar owner: a user id, a group id (required for type group) or 0 for the company calendar.",
|
|
870
|
+
},
|
|
871
|
+
from: {
|
|
872
|
+
type: "string",
|
|
873
|
+
description: `Range start; defaults to one month ago. ${DATE_HINT}`,
|
|
874
|
+
},
|
|
875
|
+
to: {
|
|
876
|
+
type: "string",
|
|
877
|
+
description: `Range end; defaults to three months ahead. ${DATE_HINT}`,
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
operation: "calendar.events",
|
|
881
|
+
input: (args) => ({
|
|
882
|
+
...(args["type"] === undefined
|
|
883
|
+
? {}
|
|
884
|
+
: { type: requiredText(args["type"], "type", 4, 20) }),
|
|
885
|
+
...(args["ownerId"] === undefined
|
|
886
|
+
? {}
|
|
887
|
+
: { ownerId: optionalInteger(args["ownerId"], "ownerId", 0) }),
|
|
888
|
+
...(args["from"] === undefined
|
|
889
|
+
? {}
|
|
890
|
+
: { from: optionalDate(args["from"], "from") }),
|
|
891
|
+
...(args["to"] === undefined
|
|
892
|
+
? {}
|
|
893
|
+
: { to: optionalDate(args["to"], "to") }),
|
|
894
|
+
}),
|
|
895
|
+
}),
|
|
896
|
+
tool({
|
|
897
|
+
name: "bitrix_get_calendar_accessibility",
|
|
898
|
+
description: "Read when the given employees are busy or free, so a meeting can be proposed before creating it. Read-only.",
|
|
899
|
+
parameters: {
|
|
900
|
+
users: {
|
|
901
|
+
type: "array",
|
|
902
|
+
items: { type: "number" },
|
|
903
|
+
required: true,
|
|
904
|
+
description: "Bitrix user ids, up to 50.",
|
|
905
|
+
},
|
|
906
|
+
from: {
|
|
907
|
+
type: "string",
|
|
908
|
+
required: true,
|
|
909
|
+
description: `Range start. ${DATE_HINT}`,
|
|
910
|
+
},
|
|
911
|
+
to: {
|
|
912
|
+
type: "string",
|
|
913
|
+
required: true,
|
|
914
|
+
description: `Range end. ${DATE_HINT}`,
|
|
915
|
+
},
|
|
916
|
+
},
|
|
917
|
+
operation: "calendar.accessibility",
|
|
918
|
+
input: (args) => ({
|
|
919
|
+
users: requiredIntegerList(args["users"], "users", 50),
|
|
920
|
+
from: requiredDate(args["from"], "from"),
|
|
921
|
+
to: requiredDate(args["to"], "to"),
|
|
922
|
+
}),
|
|
923
|
+
}),
|
|
924
|
+
tool({
|
|
925
|
+
name: "bitrix_search_files",
|
|
926
|
+
description: "Search Bitrix24 Drive files and folders the connected user can read. Read-only; for documents the index also covers text inside the file, so this is full-text enterprise search.",
|
|
927
|
+
parameters: {
|
|
928
|
+
query: {
|
|
929
|
+
type: "string",
|
|
930
|
+
required: true,
|
|
931
|
+
description: "Search phrase, 3 to 255 characters.",
|
|
932
|
+
},
|
|
933
|
+
type: {
|
|
934
|
+
type: "string",
|
|
935
|
+
enum: ["file", "folder", "all"],
|
|
936
|
+
description: 'Object kind; defaults to "file".',
|
|
937
|
+
},
|
|
938
|
+
storageId: {
|
|
939
|
+
type: "number",
|
|
940
|
+
description: "Only inside this drive.",
|
|
941
|
+
},
|
|
942
|
+
folderId: {
|
|
943
|
+
type: "number",
|
|
944
|
+
description: "Only inside this folder and its subfolders.",
|
|
945
|
+
},
|
|
946
|
+
start: {
|
|
947
|
+
type: "number",
|
|
948
|
+
description: "Pagination offset; Bitrix returns 50 objects per page and stops moving past 1000.",
|
|
949
|
+
},
|
|
950
|
+
},
|
|
951
|
+
operation: "disk.search",
|
|
952
|
+
input: (args) => ({
|
|
953
|
+
query: requiredText(args["query"], "query", 3, 255),
|
|
954
|
+
...(args["type"] === undefined
|
|
955
|
+
? {}
|
|
956
|
+
: { type: requiredText(args["type"], "type", 4, 6) }),
|
|
957
|
+
...(args["storageId"] === undefined
|
|
958
|
+
? {}
|
|
959
|
+
: { storageId: optionalInteger(args["storageId"], "storageId") }),
|
|
960
|
+
...(args["folderId"] === undefined
|
|
961
|
+
? {}
|
|
962
|
+
: { folderId: optionalInteger(args["folderId"], "folderId") }),
|
|
963
|
+
...(args["start"] === undefined
|
|
964
|
+
? {}
|
|
965
|
+
: { start: optionalInteger(args["start"], "start", 0, 1_000) }),
|
|
966
|
+
}),
|
|
967
|
+
}),
|
|
968
|
+
tool({
|
|
969
|
+
name: "bitrix_get_file",
|
|
970
|
+
description: "Read the metadata and download link of one Bitrix24 Drive file. Read-only.",
|
|
971
|
+
parameters: {
|
|
972
|
+
id: {
|
|
973
|
+
type: "number",
|
|
974
|
+
required: true,
|
|
975
|
+
description: "File id from bitrix_search_files.",
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
operation: "disk.file",
|
|
979
|
+
input: (args) => ({ id: requiredInteger(args["id"], "id") }),
|
|
980
|
+
}),
|
|
981
|
+
tool({
|
|
982
|
+
name: "bitrix_get_drives",
|
|
983
|
+
description: "List the Bitrix24 Drive storages the connected user can read, with the storage ids the other Drive tools take. Read-only.",
|
|
984
|
+
parameters: {
|
|
985
|
+
start: {
|
|
986
|
+
type: "number",
|
|
987
|
+
description: "Pagination offset; Bitrix returns at most 50 storages per page.",
|
|
988
|
+
},
|
|
989
|
+
},
|
|
990
|
+
operation: "disk.storages",
|
|
991
|
+
input: (args) => args["start"] === undefined
|
|
992
|
+
? {}
|
|
993
|
+
: { start: optionalInteger(args["start"], "start", 0) },
|
|
994
|
+
}),
|
|
995
|
+
tool({
|
|
996
|
+
name: "bitrix_get_storage_items",
|
|
997
|
+
description: "List the files and folders in the root of one Drive storage. Read-only; only objects the connected user may read are returned.",
|
|
998
|
+
parameters: {
|
|
999
|
+
storageId: {
|
|
1000
|
+
type: "number",
|
|
1001
|
+
required: true,
|
|
1002
|
+
description: "Storage id from bitrix_get_drives.",
|
|
1003
|
+
},
|
|
1004
|
+
start: { type: "number", description: START_HINT },
|
|
1005
|
+
},
|
|
1006
|
+
operation: "disk.storageChildren",
|
|
1007
|
+
input: (args) => ({
|
|
1008
|
+
storageId: requiredInteger(args["storageId"], "storageId"),
|
|
1009
|
+
...(args["start"] === undefined
|
|
1010
|
+
? {}
|
|
1011
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
1012
|
+
}),
|
|
1013
|
+
}),
|
|
1014
|
+
tool({
|
|
1015
|
+
name: "bitrix_get_folder_items",
|
|
1016
|
+
description: "List the files and folders inside one Drive folder. Read-only; only objects the connected user may read are returned.",
|
|
1017
|
+
parameters: {
|
|
1018
|
+
folderId: {
|
|
1019
|
+
type: "number",
|
|
1020
|
+
required: true,
|
|
1021
|
+
description: "Folder id from bitrix_get_storage_items or a nested bitrix_get_folder_items call.",
|
|
1022
|
+
},
|
|
1023
|
+
start: { type: "number", description: START_HINT },
|
|
1024
|
+
},
|
|
1025
|
+
operation: "disk.folderChildren",
|
|
1026
|
+
input: (args) => ({
|
|
1027
|
+
folderId: requiredInteger(args["folderId"], "folderId"),
|
|
1028
|
+
...(args["start"] === undefined
|
|
1029
|
+
? {}
|
|
1030
|
+
: { start: optionalInteger(args["start"], "start", 0) }),
|
|
1031
|
+
}),
|
|
1032
|
+
}),
|
|
1033
|
+
];
|
|
1034
|
+
}
|
|
1035
|
+
//# sourceMappingURL=tools.js.map
|