@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,245 @@
|
|
|
1
|
+
export const BITRIX_CAPABILITIES = Object.freeze([
|
|
2
|
+
{
|
|
3
|
+
capability: "crm.read",
|
|
4
|
+
flag: "crmRead",
|
|
5
|
+
scopes: ["crm"],
|
|
6
|
+
label: "Читать CRM",
|
|
7
|
+
hint: "Лиды, сделки, контакты, компании, дела, таймлайн, товарные строки",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
capability: "chat.read",
|
|
11
|
+
flag: "chatRead",
|
|
12
|
+
scopes: ["im"],
|
|
13
|
+
label: "Читать чаты",
|
|
14
|
+
hint: "Чаты, сообщения, участники и поиск по переписке",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
capability: "openlines.read",
|
|
18
|
+
flag: "openlinesRead",
|
|
19
|
+
scopes: ["imopenlines"],
|
|
20
|
+
label: "Читать открытые линии",
|
|
21
|
+
hint: "Диалоги с клиентами из открытых линий и их история",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
capability: "user.read",
|
|
25
|
+
flag: "userRead",
|
|
26
|
+
scopes: ["user", "user_basic", "user_brief"],
|
|
27
|
+
label: "Читать сотрудников",
|
|
28
|
+
hint: "Свой профиль и поиск сотрудников по имени, e-mail, отделу",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
capability: "department.read",
|
|
32
|
+
flag: "departmentRead",
|
|
33
|
+
scopes: ["department"],
|
|
34
|
+
label: "Читать структуру компании",
|
|
35
|
+
hint: "Подразделения, родительские отделы и руководители",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
capability: "tasks.read",
|
|
39
|
+
flag: "tasksRead",
|
|
40
|
+
scopes: ["task"],
|
|
41
|
+
label: "Читать задачи",
|
|
42
|
+
hint: "Задачи по фильтрам и полная карточка задачи",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
capability: "calendar.read",
|
|
46
|
+
flag: "calendarRead",
|
|
47
|
+
scopes: ["calendar"],
|
|
48
|
+
label: "Читать календарь",
|
|
49
|
+
hint: "События календаря и занятость сотрудников",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
capability: "disk.read",
|
|
53
|
+
flag: "diskRead",
|
|
54
|
+
scopes: ["disk"],
|
|
55
|
+
label: "Читать файлы Диска",
|
|
56
|
+
hint: "Поиск по файлам и папкам, включая текст внутри документов",
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
/**
|
|
60
|
+
* Every model-reachable operation. The provider refuses any operation that is
|
|
61
|
+
* not listed here, so this table — together with `requiredCapability` — is the
|
|
62
|
+
* permission surface.
|
|
63
|
+
*/
|
|
64
|
+
export const BITRIX_OPERATIONS = Object.freeze({
|
|
65
|
+
"crm.search": {
|
|
66
|
+
capability: "crm.read",
|
|
67
|
+
method: "crm.item.list",
|
|
68
|
+
list: "items",
|
|
69
|
+
},
|
|
70
|
+
"crm.get": { capability: "crm.read", method: "crm.item.get" },
|
|
71
|
+
"crm.fields": { capability: "crm.read", method: "crm.item.fields" },
|
|
72
|
+
"crm.funnels": {
|
|
73
|
+
capability: "crm.read",
|
|
74
|
+
method: "crm.category.list",
|
|
75
|
+
list: "categories",
|
|
76
|
+
},
|
|
77
|
+
"crm.statuses": {
|
|
78
|
+
capability: "crm.read",
|
|
79
|
+
method: "crm.status.list",
|
|
80
|
+
list: "self",
|
|
81
|
+
},
|
|
82
|
+
"crm.activities": {
|
|
83
|
+
capability: "crm.read",
|
|
84
|
+
method: "crm.activity.list",
|
|
85
|
+
list: "self",
|
|
86
|
+
},
|
|
87
|
+
"crm.activity": { capability: "crm.read", method: "crm.activity.get" },
|
|
88
|
+
"crm.timeline": {
|
|
89
|
+
capability: "crm.read",
|
|
90
|
+
method: "crm.timeline.comment.list",
|
|
91
|
+
list: "self",
|
|
92
|
+
},
|
|
93
|
+
"crm.stageHistory": {
|
|
94
|
+
capability: "crm.read",
|
|
95
|
+
method: "crm.stagehistory.list",
|
|
96
|
+
list: "items",
|
|
97
|
+
},
|
|
98
|
+
"crm.productRows": {
|
|
99
|
+
capability: "crm.read",
|
|
100
|
+
method: "crm.item.productrow.list",
|
|
101
|
+
list: "productRows",
|
|
102
|
+
},
|
|
103
|
+
"crm.duplicates": {
|
|
104
|
+
capability: "crm.read",
|
|
105
|
+
method: "crm.duplicate.findbycomm",
|
|
106
|
+
},
|
|
107
|
+
"crm.requisites": {
|
|
108
|
+
capability: "crm.read",
|
|
109
|
+
method: "crm.requisite.list",
|
|
110
|
+
list: "self",
|
|
111
|
+
},
|
|
112
|
+
"crm.callTranscript": {
|
|
113
|
+
capability: "crm.read",
|
|
114
|
+
method: "crm.activity.call.getTranscript",
|
|
115
|
+
},
|
|
116
|
+
"user.current": { capability: "user.read", method: "user.current" },
|
|
117
|
+
/**
|
|
118
|
+
* Bitrix24 documents `user.search` inconsistently (the parameter table wants
|
|
119
|
+
* FIND inside `FILTER`, every example puts filter keys at the top level), so
|
|
120
|
+
* the catalog calls `user.get` instead: `FILTER` there has one documented
|
|
121
|
+
* shape and `NAME_SEARCH` gives the same accelerated name search.
|
|
122
|
+
*/
|
|
123
|
+
"user.list": { capability: "user.read", method: "user.get", list: "self" },
|
|
124
|
+
"user.fields": { capability: "user.read", method: "user.fields" },
|
|
125
|
+
"user.departments": {
|
|
126
|
+
capability: "department.read",
|
|
127
|
+
method: "department.get",
|
|
128
|
+
list: "self",
|
|
129
|
+
},
|
|
130
|
+
"chat.search": {
|
|
131
|
+
capability: "chat.read",
|
|
132
|
+
method: "im.search.chat.list",
|
|
133
|
+
list: "self",
|
|
134
|
+
},
|
|
135
|
+
"chat.messages": {
|
|
136
|
+
capability: "chat.read",
|
|
137
|
+
method: "im.dialog.messages.get",
|
|
138
|
+
},
|
|
139
|
+
"chat.messageSearch": {
|
|
140
|
+
capability: "chat.read",
|
|
141
|
+
method: "im.dialog.messages.search",
|
|
142
|
+
},
|
|
143
|
+
"chat.recent": {
|
|
144
|
+
capability: "chat.read",
|
|
145
|
+
method: "im.recent.get",
|
|
146
|
+
list: "self",
|
|
147
|
+
},
|
|
148
|
+
"chat.users": {
|
|
149
|
+
capability: "chat.read",
|
|
150
|
+
method: "im.search.user.list",
|
|
151
|
+
list: "map",
|
|
152
|
+
},
|
|
153
|
+
"chat.find": {
|
|
154
|
+
capability: "chat.read",
|
|
155
|
+
method: "im.chat.get",
|
|
156
|
+
},
|
|
157
|
+
"chat.participants": {
|
|
158
|
+
capability: "chat.read",
|
|
159
|
+
method: "im.chat.user.list",
|
|
160
|
+
list: "self",
|
|
161
|
+
},
|
|
162
|
+
"chat.userData": {
|
|
163
|
+
capability: "chat.read",
|
|
164
|
+
method: "im.user.list.get",
|
|
165
|
+
list: "self",
|
|
166
|
+
},
|
|
167
|
+
"openlines.dialog": {
|
|
168
|
+
capability: "openlines.read",
|
|
169
|
+
method: "imopenlines.dialog.get",
|
|
170
|
+
},
|
|
171
|
+
"openlines.history": {
|
|
172
|
+
capability: "openlines.read",
|
|
173
|
+
method: "imopenlines.session.history.get",
|
|
174
|
+
},
|
|
175
|
+
"tasks.list": {
|
|
176
|
+
capability: "tasks.read",
|
|
177
|
+
method: "tasks.task.list",
|
|
178
|
+
list: "tasks",
|
|
179
|
+
},
|
|
180
|
+
"tasks.get": { capability: "tasks.read", method: "tasks.task.get" },
|
|
181
|
+
"tasks.history": {
|
|
182
|
+
capability: "tasks.read",
|
|
183
|
+
method: "tasks.task.history.list",
|
|
184
|
+
list: "list",
|
|
185
|
+
},
|
|
186
|
+
"tasks.results": {
|
|
187
|
+
capability: "tasks.read",
|
|
188
|
+
method: "tasks.task.result.list",
|
|
189
|
+
list: "self",
|
|
190
|
+
},
|
|
191
|
+
/**
|
|
192
|
+
* The only operation with a positional body: Bitrix24 documents that
|
|
193
|
+
* `task.elapseditem.getlist` takes `[taskId, order, filter, select, params]`
|
|
194
|
+
* as a JSON array and fails when they arrive as named fields.
|
|
195
|
+
*/
|
|
196
|
+
"tasks.elapsed": {
|
|
197
|
+
capability: "tasks.read",
|
|
198
|
+
method: "task.elapseditem.getlist",
|
|
199
|
+
list: "self",
|
|
200
|
+
},
|
|
201
|
+
"calendar.events": {
|
|
202
|
+
capability: "calendar.read",
|
|
203
|
+
method: "calendar.event.get",
|
|
204
|
+
list: "self",
|
|
205
|
+
},
|
|
206
|
+
"calendar.accessibility": {
|
|
207
|
+
capability: "calendar.read",
|
|
208
|
+
method: "calendar.accessibility.get",
|
|
209
|
+
},
|
|
210
|
+
"disk.search": {
|
|
211
|
+
capability: "disk.read",
|
|
212
|
+
method: "disk.file.search",
|
|
213
|
+
list: "self",
|
|
214
|
+
},
|
|
215
|
+
"disk.file": { capability: "disk.read", method: "disk.file.get" },
|
|
216
|
+
"disk.storages": {
|
|
217
|
+
capability: "disk.read",
|
|
218
|
+
method: "disk.storage.getList",
|
|
219
|
+
list: "self",
|
|
220
|
+
},
|
|
221
|
+
"disk.storageChildren": {
|
|
222
|
+
capability: "disk.read",
|
|
223
|
+
method: "disk.storage.getChildren",
|
|
224
|
+
list: "self",
|
|
225
|
+
},
|
|
226
|
+
"disk.folderChildren": {
|
|
227
|
+
capability: "disk.read",
|
|
228
|
+
method: "disk.folder.getChildren",
|
|
229
|
+
list: "self",
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
/** Capabilities this deployment allows, in catalog order. */
|
|
233
|
+
export function enabledCapabilities(flags) {
|
|
234
|
+
return BITRIX_CAPABILITIES.filter((item) => flags[item.flag]).map((item) => item.capability);
|
|
235
|
+
}
|
|
236
|
+
/** Label and hint per capability, for clients that render what we declare. */
|
|
237
|
+
export const BITRIX24_CAPABILITY_INFO = Object.freeze(Object.fromEntries(BITRIX_CAPABILITIES.map((item) => [
|
|
238
|
+
item.capability,
|
|
239
|
+
{ label: item.label, hint: item.hint },
|
|
240
|
+
])));
|
|
241
|
+
/** Capability an operation needs, or undefined when the catalog has none. */
|
|
242
|
+
export function bitrix24OperationCapability(operation) {
|
|
243
|
+
return BITRIX_OPERATIONS[operation]?.capability;
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/providers/bitrix24/catalog.ts"],"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,CACjC,KAAoB;IAEpB,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAC/D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAC1B,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAEjC,MAAM,CAAC,MAAM,CACf,MAAM,CAAC,WAAW,CAChB,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IAChC,IAAI,CAAC,UAAU;IACf,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;CACvC,CAAC,CACsD,CAC3D,CAAC;AAEF,6EAA6E;AAC7E,MAAM,UAAU,2BAA2B,CACzC,SAAiB;IAEjB,OAAO,iBAAiB,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
export const BITRIX24_DEFAULTS = Object.freeze({
|
|
3
|
+
enabled: true,
|
|
4
|
+
crmRead: true,
|
|
5
|
+
chatRead: true,
|
|
6
|
+
openlinesRead: true,
|
|
7
|
+
userRead: true,
|
|
8
|
+
departmentRead: true,
|
|
9
|
+
tasksRead: true,
|
|
10
|
+
calendarRead: true,
|
|
11
|
+
diskRead: true,
|
|
12
|
+
});
|
|
13
|
+
/** Config slice of this provider, as it appears under `bitrix24:` in YAML. */
|
|
14
|
+
export const bitrix24ConfigSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
enabled: z.boolean().default(true),
|
|
17
|
+
crmRead: z.boolean().default(true),
|
|
18
|
+
chatRead: z.boolean().default(true),
|
|
19
|
+
openlinesRead: z.boolean().default(true),
|
|
20
|
+
userRead: z.boolean().default(true),
|
|
21
|
+
departmentRead: z.boolean().default(true),
|
|
22
|
+
tasksRead: z.boolean().default(true),
|
|
23
|
+
calendarRead: z.boolean().default(true),
|
|
24
|
+
diskRead: z.boolean().default(true),
|
|
25
|
+
})
|
|
26
|
+
.default(BITRIX24_DEFAULTS);
|
|
27
|
+
export function resolveBitrix24Config(input = {}) {
|
|
28
|
+
return Object.freeze({
|
|
29
|
+
enabled: input.enabled ?? BITRIX24_DEFAULTS.enabled,
|
|
30
|
+
crmRead: input.crmRead ?? BITRIX24_DEFAULTS.crmRead,
|
|
31
|
+
chatRead: input.chatRead ?? BITRIX24_DEFAULTS.chatRead,
|
|
32
|
+
openlinesRead: input.openlinesRead ?? BITRIX24_DEFAULTS.openlinesRead,
|
|
33
|
+
userRead: input.userRead ?? BITRIX24_DEFAULTS.userRead,
|
|
34
|
+
departmentRead: input.departmentRead ?? BITRIX24_DEFAULTS.departmentRead,
|
|
35
|
+
tasksRead: input.tasksRead ?? BITRIX24_DEFAULTS.tasksRead,
|
|
36
|
+
calendarRead: input.calendarRead ?? BITRIX24_DEFAULTS.calendarRead,
|
|
37
|
+
diskRead: input.diskRead ?? BITRIX24_DEFAULTS.diskRead,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/providers/bitrix24/config.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAoBzC,MAAM,CAAC,MAAM,iBAAiB,GAAkB,MAAM,CAAC,MAAM,CAAC;IAC5D,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,8EAA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C,cAAc;QACxE,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS;QACzD,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,iBAAiB,CAAC,YAAY;QAClE,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,iBAAiB,CAAC,QAAQ;KACvD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { IntegrationError } from "../../errors.js";
|
|
2
|
+
import { BITRIX_CAPABILITIES, BITRIX_OPERATIONS, BITRIX24_CAPABILITY_INFO, bitrix24OperationCapability, enabledCapabilities, } from "./catalog.js";
|
|
3
|
+
import { BITRIX_HANDLERS, BITRIX_PROJECTIONS } from "./operations.js";
|
|
4
|
+
import { BitrixTransport, credentialFromPlaintext, parseBitrixWebhook, } from "./transport.js";
|
|
5
|
+
export { credentialFromPlaintext, parseBitrixWebhook, } from "./transport.js";
|
|
6
|
+
function itemsOf(result, shape) {
|
|
7
|
+
if (shape === "self")
|
|
8
|
+
return Array.isArray(result) ? result : [];
|
|
9
|
+
if (shape === "map") {
|
|
10
|
+
return typeof result === "object" &&
|
|
11
|
+
result !== null &&
|
|
12
|
+
!Array.isArray(result)
|
|
13
|
+
? Object.values(result)
|
|
14
|
+
: [];
|
|
15
|
+
}
|
|
16
|
+
if (typeof result !== "object" || result === null)
|
|
17
|
+
return [];
|
|
18
|
+
const held = result[shape];
|
|
19
|
+
return Array.isArray(held) ? held : [];
|
|
20
|
+
}
|
|
21
|
+
function offsetOf(params) {
|
|
22
|
+
if (typeof params !== "object" || params === null || Array.isArray(params)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
const record = params;
|
|
26
|
+
// IM methods page with OFFSET, CRM and task methods with start.
|
|
27
|
+
const offset = record["start"] ?? record["OFFSET"];
|
|
28
|
+
return typeof offset === "number" && Number.isFinite(offset)
|
|
29
|
+
? offset
|
|
30
|
+
: undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Every list operation answers with the same envelope, so the model does not
|
|
34
|
+
* have to learn six response shapes and never loses the pagination cursor.
|
|
35
|
+
*/
|
|
36
|
+
function collect(operation, definition, response, params) {
|
|
37
|
+
const projection = BITRIX_PROJECTIONS[operation];
|
|
38
|
+
if (projection !== undefined)
|
|
39
|
+
return projection(response.result);
|
|
40
|
+
if (definition.list === undefined)
|
|
41
|
+
return response.result;
|
|
42
|
+
const items = itemsOf(response.result, definition.list);
|
|
43
|
+
const offset = offsetOf(params);
|
|
44
|
+
const pagination = {
|
|
45
|
+
...(offset === undefined ? {} : { start: offset }),
|
|
46
|
+
...(response.next === undefined ? {} : { next: response.next }),
|
|
47
|
+
...(response.total === undefined ? {} : { total: response.total }),
|
|
48
|
+
};
|
|
49
|
+
return Object.keys(pagination).length === 0
|
|
50
|
+
? { items }
|
|
51
|
+
: { items, pagination };
|
|
52
|
+
}
|
|
53
|
+
/** Bitrix24 provider: incoming-webhook credentials over the Bitrix24 REST API. */
|
|
54
|
+
export class Bitrix24Provider {
|
|
55
|
+
config;
|
|
56
|
+
id = "bitrix24";
|
|
57
|
+
displayName = "Bitrix24";
|
|
58
|
+
/** What this deployment allows; the webhook scope probe narrows it per user. */
|
|
59
|
+
capabilities;
|
|
60
|
+
capabilityInfo = BITRIX24_CAPABILITY_INFO;
|
|
61
|
+
transport;
|
|
62
|
+
constructor(config, fetcher = fetch) {
|
|
63
|
+
this.config = config;
|
|
64
|
+
this.transport = new BitrixTransport(config, fetcher);
|
|
65
|
+
this.capabilities = Object.freeze(enabledCapabilities(config.bitrix24));
|
|
66
|
+
}
|
|
67
|
+
/** Keep only the secret part of an operator-supplied webhook URL. */
|
|
68
|
+
parseCredential(raw) {
|
|
69
|
+
return parseBitrixWebhook(raw, this.config.allowedPortalSuffixes);
|
|
70
|
+
}
|
|
71
|
+
operationCapability(operation) {
|
|
72
|
+
return bitrix24OperationCapability(operation);
|
|
73
|
+
}
|
|
74
|
+
async validate(context) {
|
|
75
|
+
const credential = credentialFromPlaintext(context.credential);
|
|
76
|
+
const profile = await this.transport.call(credential, "profile", {});
|
|
77
|
+
if (typeof profile.result !== "object" || profile.result === null) {
|
|
78
|
+
throw new IntegrationError("ProviderUnavailable", "Provider identity is unavailable");
|
|
79
|
+
}
|
|
80
|
+
const fields = profile.result;
|
|
81
|
+
const first = typeof fields["NAME"] === "string" ? fields["NAME"] : "";
|
|
82
|
+
const last = typeof fields["LAST_NAME"] === "string" ? fields["LAST_NAME"] : "";
|
|
83
|
+
const scopes = await this.grantedScopes(credential);
|
|
84
|
+
return {
|
|
85
|
+
tenantId: new URL(credential.webhookBaseUrl).hostname,
|
|
86
|
+
externalUserId: String(fields["ID"] ?? ""),
|
|
87
|
+
displayName: `${first} ${last}`.trim() || "Пользователь Bitrix24",
|
|
88
|
+
capabilities: scopes === undefined
|
|
89
|
+
? this.capabilities
|
|
90
|
+
: this.capabilities.filter((capability) => {
|
|
91
|
+
const definition = BITRIX_CAPABILITIES.find((item) => item.capability === capability);
|
|
92
|
+
return (definition !== undefined &&
|
|
93
|
+
definition.scopes.some((scope) => scopes.includes(scope)));
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async execute(context, operation, input) {
|
|
98
|
+
const credential = credentialFromPlaintext(context.credential);
|
|
99
|
+
const definition = BITRIX_OPERATIONS[operation];
|
|
100
|
+
const handler = BITRIX_HANDLERS[operation];
|
|
101
|
+
if (definition === undefined || handler === undefined) {
|
|
102
|
+
throw new IntegrationError("InvalidRequest", "Unsupported Bitrix24 operation");
|
|
103
|
+
}
|
|
104
|
+
const params = handler(input, { externalUserId: context.externalUserId });
|
|
105
|
+
const response = await this.transport.call(credential, definition.method, params);
|
|
106
|
+
return collect(operation, definition, response, params);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The scopes the connected webhook was actually granted. A portal that
|
|
110
|
+
* refuses `scope` only costs precision: the deployment switches still bound
|
|
111
|
+
* what the agent may try.
|
|
112
|
+
*/
|
|
113
|
+
async grantedScopes(credential) {
|
|
114
|
+
try {
|
|
115
|
+
const response = await this.transport.call(credential, "scope", {});
|
|
116
|
+
if (!Array.isArray(response.result))
|
|
117
|
+
return undefined;
|
|
118
|
+
return response.result
|
|
119
|
+
.filter((item) => typeof item === "string")
|
|
120
|
+
.map((item) => item.toLowerCase());
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export default Bitrix24Provider;
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/bitrix24/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOnD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,mBAAmB,GAGpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GAEnB,MAAM,gBAAgB,CAAC;AAExB,SAAS,OAAO,CAAC,MAAe,EAAE,KAAsB;IACtD,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACpB,OAAO,OAAO,MAAM,KAAK,QAAQ;YAC/B,MAAM,KAAK,IAAI;YACf,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YACtB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,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