@pachca/cli 2026.6.1 → 2026.6.3
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/CHANGELOG.md +14 -0
- package/README.md +24 -17
- package/dist/commands/bots/create.js +27 -0
- package/dist/commands/bots/recreate-token-self.js +26 -0
- package/dist/commands/bots/recreate-token.js +33 -0
- package/dist/commands/bots/update.js +27 -0
- package/dist/commands/{common/get-exports.js → chats/download-export.js} +5 -4
- package/dist/commands/{common → chats}/request-export.js +5 -4
- package/dist/commands/{common/custom-properties.js → custom-properties/list.js} +5 -4
- package/dist/commands/{common → files}/direct-url.js +4 -3
- package/dist/commands/{common → files}/uploads.js +4 -3
- package/dist/commands/{link-previews/add.js → messages/unfurl.js} +6 -5
- package/dist/commands/{profile/get-info.js → oauth/token-info.js} +4 -3
- package/dist/commands/search/list-messages.js +7 -0
- package/dist/commands/security/list.js +1 -1
- package/dist/data/alternatives.json +11 -8
- package/dist/data/changelog.json +52 -0
- package/dist/data/endpoints.json +1 -1
- package/dist/data/workflows.json +20 -6
- package/dist/lib/manifest.js +10 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.6.3 (24 июня 2026)
|
|
4
|
+
|
|
5
|
+
- **Изменено** (files, custom-properties, oauth): Команды реорганизованы по разделам: `common uploads`→`files uploads`, `common direct-url`→`files direct-url`, `common custom-properties`→`custom-properties list`, `common request-export`→`chats request-export`, `common get-exports`→`chats download-export`, `profile get-info`→`oauth token-info`, `link-previews add`→`messages unfurl`. Старые имена продолжают работать (скрытые алиасы)
|
|
6
|
+
- **Добавлено** (bots recreate-token): Новая команда — ротация токена бота по его `id` (нужны права администратора, владельца компании или создателя бота)
|
|
7
|
+
- **Добавлено** (bots recreate-token-self): Новая команда — бот перевыпускает собственный токен своим же токеном
|
|
8
|
+
- **Добавлено** (bots create): Настройки вебхука — параметры `ignore-self-messages` (игнорировать свои сообщения) и `events-history-enabled` (сохранять историю событий)
|
|
9
|
+
- **Добавлено** (bots update): Настройки вебхука — параметры `ignore-self-messages` (игнорировать свои сообщения) и `events-history-enabled` (сохранять историю событий)
|
|
10
|
+
|
|
11
|
+
## 2026.6.2 (19 июня 2026)
|
|
12
|
+
|
|
13
|
+
- **Добавлено** (bots create): Настройки входящего вебхука — параметры `template`, `template_engine`, `challenge_key`, `link_preview_enabled`
|
|
14
|
+
- **Добавлено** (bots update): Настройки входящего вебхука — параметры `template`, `template_engine`, `challenge_key`, `link_preview_enabled`
|
|
15
|
+
- **Добавлено** (search list-messages): Добавлен параметр `sort` — сортировка (`created_at` или `relevance`)
|
|
16
|
+
|
|
3
17
|
## 2026.6.1 (16 июня 2026)
|
|
4
18
|
|
|
5
19
|
- **Изменено** (bots create): Добавлен параметр `scopes` — выбор скоупов токена бота
|
package/README.md
CHANGED
|
@@ -78,10 +78,12 @@ pachca guide # список всех сценариев
|
|
|
78
78
|
|
|
79
79
|
| Команда | Описание |
|
|
80
80
|
|---------|---------|
|
|
81
|
+
| `pachca bots recreate-token-self` | Ротация собственного токена бота |
|
|
81
82
|
| `pachca bots update-webhook` | Саморегистрация вебхука бота |
|
|
82
83
|
| `pachca bots create` | Новый бот |
|
|
83
84
|
| `pachca bots get` | Информация о боте |
|
|
84
85
|
| `pachca bots update` | Редактирование бота |
|
|
86
|
+
| `pachca bots recreate-token` | Ротация токена бота |
|
|
85
87
|
| `pachca bots list-events` | История событий |
|
|
86
88
|
| `pachca bots remove-event` | Удаление события |
|
|
87
89
|
|
|
@@ -91,21 +93,13 @@ pachca guide # список всех сценариев
|
|
|
91
93
|
|---------|---------|
|
|
92
94
|
| `pachca chats create` | Новый чат |
|
|
93
95
|
| `pachca chats list` | Список чатов |
|
|
96
|
+
| `pachca chats request-export` | Экспорт сообщений |
|
|
97
|
+
| `pachca chats download-export` | Скачать архив экспорта |
|
|
94
98
|
| `pachca chats get` | Информация о чате |
|
|
95
99
|
| `pachca chats update` | Редактирование чата |
|
|
96
100
|
| `pachca chats archive` | Архивация чата |
|
|
97
101
|
| `pachca chats unarchive` | Разархивация чата |
|
|
98
102
|
|
|
99
|
-
### common
|
|
100
|
-
|
|
101
|
-
| Команда | Описание |
|
|
102
|
-
|---------|---------|
|
|
103
|
-
| `pachca common request-export` | Экспорт сообщений |
|
|
104
|
-
| `pachca common get-exports` | Скачать архив экспорта |
|
|
105
|
-
| `pachca common custom-properties` | Список дополнительных полей |
|
|
106
|
-
| `pachca common direct-url` | Загрузка файла |
|
|
107
|
-
| `pachca common uploads` | Получение подписи, ключа и других параметров |
|
|
108
|
-
|
|
109
103
|
### members
|
|
110
104
|
|
|
111
105
|
| Команда | Описание |
|
|
@@ -118,6 +112,19 @@ pachca guide # список всех сценариев
|
|
|
118
112
|
| `pachca members remove` | Исключение пользователя |
|
|
119
113
|
| `pachca members update` | Редактирование роли |
|
|
120
114
|
|
|
115
|
+
### custom-properties
|
|
116
|
+
|
|
117
|
+
| Команда | Описание |
|
|
118
|
+
|---------|---------|
|
|
119
|
+
| `pachca custom-properties list` | Список дополнительных полей |
|
|
120
|
+
|
|
121
|
+
### files
|
|
122
|
+
|
|
123
|
+
| Команда | Описание |
|
|
124
|
+
|---------|---------|
|
|
125
|
+
| `pachca files direct-url` | Загрузка файла |
|
|
126
|
+
| `pachca files uploads` | Получение подписи, ключа и других параметров |
|
|
127
|
+
|
|
121
128
|
### group-tags
|
|
122
129
|
|
|
123
130
|
| Команда | Описание |
|
|
@@ -138,15 +145,10 @@ pachca guide # список всех сценариев
|
|
|
138
145
|
| `pachca messages get` | Информация о сообщении |
|
|
139
146
|
| `pachca messages update` | Редактирование сообщения |
|
|
140
147
|
| `pachca messages delete` | Удаление сообщения |
|
|
148
|
+
| `pachca messages unfurl` | Unfurl (разворачивание ссылок) |
|
|
141
149
|
| `pachca messages pin` | Закрепление сообщения |
|
|
142
150
|
| `pachca messages unpin` | Открепление сообщения |
|
|
143
151
|
|
|
144
|
-
### link-previews
|
|
145
|
-
|
|
146
|
-
| Команда | Описание |
|
|
147
|
-
|---------|---------|
|
|
148
|
-
| `pachca link-previews add` | Unfurl (разворачивание ссылок) |
|
|
149
|
-
|
|
150
152
|
### reactions
|
|
151
153
|
|
|
152
154
|
| Команда | Описание |
|
|
@@ -169,11 +171,16 @@ pachca guide # список всех сценариев
|
|
|
169
171
|
| `pachca threads list` | Список тредов |
|
|
170
172
|
| `pachca threads get` | Информация о треде |
|
|
171
173
|
|
|
174
|
+
### oauth
|
|
175
|
+
|
|
176
|
+
| Команда | Описание |
|
|
177
|
+
|---------|---------|
|
|
178
|
+
| `pachca oauth token-info` | Информация о токене |
|
|
179
|
+
|
|
172
180
|
### profile
|
|
173
181
|
|
|
174
182
|
| Команда | Описание |
|
|
175
183
|
|---------|---------|
|
|
176
|
-
| `pachca profile get-info` | Информация о токене |
|
|
177
184
|
| `pachca profile get` | Свой профиль |
|
|
178
185
|
| `pachca profile update-avatar` | Загрузка своего аватара |
|
|
179
186
|
| `pachca profile delete-avatar` | Удаление своего аватара |
|
|
@@ -37,6 +37,27 @@ export default class BotsCreate extends BaseCommand {
|
|
|
37
37
|
'scopes': Flags.string({
|
|
38
38
|
description: "Скоупы (права доступа) токена бота. Если не указано, бот получает набор по умолчанию.",
|
|
39
39
|
}),
|
|
40
|
+
'template': Flags.string({
|
|
41
|
+
description: "Шаблон форматирования входящего вебхука",
|
|
42
|
+
}),
|
|
43
|
+
'template-engine': Flags.string({
|
|
44
|
+
description: "Шаблонизатор для обработки шаблона входящего вебхука",
|
|
45
|
+
}),
|
|
46
|
+
'challenge-key': Flags.string({
|
|
47
|
+
description: "Название поля проверки для верификации входящего вебхука",
|
|
48
|
+
}),
|
|
49
|
+
'link-preview-enabled': Flags.boolean({
|
|
50
|
+
description: "Показывать превью ссылок в сообщениях входящего вебхука",
|
|
51
|
+
allowNo: true,
|
|
52
|
+
}),
|
|
53
|
+
'ignore-self-messages': Flags.boolean({
|
|
54
|
+
description: "Игнорировать входящие сообщения, отправленные самим ботом",
|
|
55
|
+
allowNo: true,
|
|
56
|
+
}),
|
|
57
|
+
'events-history-enabled': Flags.boolean({
|
|
58
|
+
description: "Сохранять историю событий бота для последующего получения через метод истории событий",
|
|
59
|
+
allowNo: true,
|
|
60
|
+
}),
|
|
40
61
|
};
|
|
41
62
|
async run() {
|
|
42
63
|
const { args, flags } = await this.parse(BotsCreate);
|
|
@@ -75,6 +96,12 @@ export default class BotsCreate extends BaseCommand {
|
|
|
75
96
|
trigger_on: flags['trigger-on'],
|
|
76
97
|
commands: flags['commands'] ? this.parseJSON(flags['commands'], 'commands') : undefined,
|
|
77
98
|
scopes: flags['scopes'] ? this.parseJSON(flags['scopes'], 'scopes') : undefined,
|
|
99
|
+
template: flags['template'],
|
|
100
|
+
template_engine: flags['template-engine'],
|
|
101
|
+
challenge_key: flags['challenge-key'],
|
|
102
|
+
link_preview_enabled: flags['link-preview-enabled'],
|
|
103
|
+
ignore_self_messages: flags['ignore-self-messages'],
|
|
104
|
+
events_history_enabled: flags['events-history-enabled'],
|
|
78
105
|
} };
|
|
79
106
|
// Clean undefined fields
|
|
80
107
|
const inner = body['webhook'];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class BotsRecreateTokenSelf extends BaseCommand {
|
|
3
|
+
static description = "Ротация собственного токена бота";
|
|
4
|
+
static examples = [
|
|
5
|
+
"Ротация токена бота:\n $ pachca bots recreate-token-self"
|
|
6
|
+
];
|
|
7
|
+
static scope = "bot_self:write";
|
|
8
|
+
static apiMethod = "POST";
|
|
9
|
+
static apiPath = "/bot/recreate_token";
|
|
10
|
+
static defaultColumns = ["id", "webhook", "access_token"];
|
|
11
|
+
static args = {};
|
|
12
|
+
static flags = {
|
|
13
|
+
...BaseCommand.baseFlags,
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
const { args, flags } = await this.parse(BotsRecreateTokenSelf);
|
|
17
|
+
this.parsedFlags = flags;
|
|
18
|
+
const { data } = await this.apiRequest({
|
|
19
|
+
method: 'POST',
|
|
20
|
+
path: '/bot/recreate_token',
|
|
21
|
+
});
|
|
22
|
+
const responseBody = data;
|
|
23
|
+
const result = responseBody.data ?? responseBody;
|
|
24
|
+
this.output(result);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Auto-generated from openapi.yaml — DO NOT EDIT
|
|
2
|
+
import { Args } from '@oclif/core';
|
|
3
|
+
import { BaseCommand } from '../../base-command.js';
|
|
4
|
+
export default class BotsRecreateToken extends BaseCommand {
|
|
5
|
+
static description = "Ротация токена бота";
|
|
6
|
+
static examples = [
|
|
7
|
+
"Ротация токена бота:\n $ pachca bots recreate-token"
|
|
8
|
+
];
|
|
9
|
+
static scope = "bots:write";
|
|
10
|
+
static apiMethod = "POST";
|
|
11
|
+
static apiPath = "/bots/{id}/recreate_token";
|
|
12
|
+
static defaultColumns = ["id", "webhook", "access_token"];
|
|
13
|
+
static args = {
|
|
14
|
+
id: Args.integer({
|
|
15
|
+
description: "Идентификатор бота (pachca bots list)",
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
...BaseCommand.baseFlags,
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args, flags } = await this.parse(BotsRecreateToken);
|
|
24
|
+
this.parsedFlags = flags;
|
|
25
|
+
const { data } = await this.apiRequest({
|
|
26
|
+
method: 'POST',
|
|
27
|
+
path: `/bots/${args.id}/recreate_token`,
|
|
28
|
+
});
|
|
29
|
+
const responseBody = data;
|
|
30
|
+
const result = responseBody.data ?? responseBody;
|
|
31
|
+
this.output(result);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -39,6 +39,27 @@ export default class BotsUpdate extends BaseCommand {
|
|
|
39
39
|
'scopes': Flags.string({
|
|
40
40
|
description: "Скоупы (права доступа) токена бота. Если не указано, бот получает набор по умолчанию.",
|
|
41
41
|
}),
|
|
42
|
+
'template': Flags.string({
|
|
43
|
+
description: "Шаблон форматирования входящего вебхука",
|
|
44
|
+
}),
|
|
45
|
+
'template-engine': Flags.string({
|
|
46
|
+
description: "Шаблонизатор для обработки шаблона входящего вебхука",
|
|
47
|
+
}),
|
|
48
|
+
'challenge-key': Flags.string({
|
|
49
|
+
description: "Название поля проверки для верификации входящего вебхука",
|
|
50
|
+
}),
|
|
51
|
+
'link-preview-enabled': Flags.boolean({
|
|
52
|
+
description: "Показывать превью ссылок в сообщениях входящего вебхука",
|
|
53
|
+
allowNo: true,
|
|
54
|
+
}),
|
|
55
|
+
'ignore-self-messages': Flags.boolean({
|
|
56
|
+
description: "Игнорировать входящие сообщения, отправленные самим ботом",
|
|
57
|
+
allowNo: true,
|
|
58
|
+
}),
|
|
59
|
+
'events-history-enabled': Flags.boolean({
|
|
60
|
+
description: "Сохранять историю событий бота для последующего получения через метод истории событий",
|
|
61
|
+
allowNo: true,
|
|
62
|
+
}),
|
|
42
63
|
};
|
|
43
64
|
async run() {
|
|
44
65
|
const { args, flags } = await this.parse(BotsUpdate);
|
|
@@ -51,6 +72,12 @@ export default class BotsUpdate extends BaseCommand {
|
|
|
51
72
|
trigger_on: flags['trigger-on'],
|
|
52
73
|
commands: flags['commands'] ? this.parseJSON(flags['commands'], 'commands') : undefined,
|
|
53
74
|
scopes: flags['scopes'] ? this.parseJSON(flags['scopes'], 'scopes') : undefined,
|
|
75
|
+
template: flags['template'],
|
|
76
|
+
template_engine: flags['template-engine'],
|
|
77
|
+
challenge_key: flags['challenge-key'],
|
|
78
|
+
link_preview_enabled: flags['link-preview-enabled'],
|
|
79
|
+
ignore_self_messages: flags['ignore-self-messages'],
|
|
80
|
+
events_history_enabled: flags['events-history-enabled'],
|
|
54
81
|
} };
|
|
55
82
|
// Clean undefined fields
|
|
56
83
|
const inner = body['webhook'];
|
|
@@ -3,18 +3,19 @@ import { Args, Flags } from '@oclif/core';
|
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
4
|
import { downloadFile } from '../../client.js';
|
|
5
5
|
import { formatSize } from '../../utils.js';
|
|
6
|
-
export default class
|
|
6
|
+
export default class ChatsDownloadExport extends BaseCommand {
|
|
7
7
|
static description = "Скачать архив экспорта";
|
|
8
8
|
static examples = [
|
|
9
|
-
"Экспорт истории чата:\n $ pachca
|
|
9
|
+
"Экспорт истории чата:\n $ pachca chats download-export"
|
|
10
10
|
];
|
|
11
|
+
static hiddenAliases = ["common:get-exports"];
|
|
11
12
|
static scope = "chat_exports:read";
|
|
12
13
|
static plan = "corporation";
|
|
13
14
|
static apiMethod = "GET";
|
|
14
15
|
static apiPath = "/chats/exports/{id}";
|
|
15
16
|
static args = {
|
|
16
17
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор экспорта",
|
|
18
|
+
description: "Идентификатор экспорта (pachca chats list)",
|
|
18
19
|
required: true,
|
|
19
20
|
}),
|
|
20
21
|
};
|
|
@@ -25,7 +26,7 @@ export default class CommonGetExports extends BaseCommand {
|
|
|
25
26
|
}),
|
|
26
27
|
};
|
|
27
28
|
async run() {
|
|
28
|
-
const { args, flags } = await this.parse(
|
|
29
|
+
const { args, flags } = await this.parse(ChatsDownloadExport);
|
|
29
30
|
this.parsedFlags = flags;
|
|
30
31
|
const { data } = await this.apiRequest({
|
|
31
32
|
method: 'GET',
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { Flags } from '@oclif/core';
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
4
|
import * as clack from '@clack/prompts';
|
|
5
|
-
export default class
|
|
5
|
+
export default class ChatsRequestExport extends BaseCommand {
|
|
6
6
|
static description = "Экспорт сообщений";
|
|
7
7
|
static examples = [
|
|
8
|
-
"Экспорт истории чата:\n $ pachca
|
|
8
|
+
"Экспорт истории чата:\n $ pachca chats request-export"
|
|
9
9
|
];
|
|
10
|
+
static hiddenAliases = ["common:request-export"];
|
|
10
11
|
static scope = "chat_exports:write";
|
|
11
12
|
static plan = "corporation";
|
|
12
13
|
static apiMethod = "POST";
|
|
@@ -33,7 +34,7 @@ export default class CommonRequestExport extends BaseCommand {
|
|
|
33
34
|
}),
|
|
34
35
|
};
|
|
35
36
|
async run() {
|
|
36
|
-
const { args, flags } = await this.parse(
|
|
37
|
+
const { args, flags } = await this.parse(ChatsRequestExport);
|
|
37
38
|
this.parsedFlags = flags;
|
|
38
39
|
const missingRequired = [
|
|
39
40
|
{ flag: 'start-at', label: "Дата начала для экспорта (ISO-8601, UTC+0) в формате YYYY-MM-DD", type: 'string' },
|
|
@@ -60,7 +61,7 @@ export default class CommonRequestExport extends BaseCommand {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
else {
|
|
63
|
-
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --start-at <string>, --end-at <string>, --webhook-url <string>. pachca introspect
|
|
64
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --start-at <string>, --end-at <string>, --webhook-url <string>. pachca introspect chats request-export" });
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
const body = {
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { Flags } from '@oclif/core';
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
4
|
import * as clack from '@clack/prompts';
|
|
5
|
-
export default class
|
|
5
|
+
export default class CustomPropertiesList extends BaseCommand {
|
|
6
6
|
static description = "Список дополнительных полей";
|
|
7
7
|
static examples = [
|
|
8
|
-
"Получить кастомные поля профиля:\n $ pachca
|
|
8
|
+
"Получить кастомные поля профиля:\n $ pachca custom-properties list"
|
|
9
9
|
];
|
|
10
|
+
static hiddenAliases = ["common:custom-properties"];
|
|
10
11
|
static scope = "custom_properties:read";
|
|
11
12
|
static apiMethod = "GET";
|
|
12
13
|
static apiPath = "/custom_properties";
|
|
@@ -21,7 +22,7 @@ export default class CommonCustomProperties extends BaseCommand {
|
|
|
21
22
|
}),
|
|
22
23
|
};
|
|
23
24
|
async run() {
|
|
24
|
-
const { args, flags } = await this.parse(
|
|
25
|
+
const { args, flags } = await this.parse(CustomPropertiesList);
|
|
25
26
|
this.parsedFlags = flags;
|
|
26
27
|
const missingRequired = [
|
|
27
28
|
{ flag: 'entity-type', label: "Тип сущности", type: 'string' },
|
|
@@ -46,7 +47,7 @@ export default class CommonCustomProperties extends BaseCommand {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
else {
|
|
49
|
-
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --entity-type <string>. pachca introspect
|
|
50
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --entity-type <string>. pachca introspect custom-properties list" });
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
const { data } = await this.apiRequest({
|
|
@@ -4,8 +4,9 @@ import { BaseCommand } from '../../base-command.js';
|
|
|
4
4
|
import * as clack from '@clack/prompts';
|
|
5
5
|
import * as fs from 'node:fs';
|
|
6
6
|
import * as path from 'node:path';
|
|
7
|
-
export default class
|
|
7
|
+
export default class FilesDirectUrl extends BaseCommand {
|
|
8
8
|
static description = "Загрузка файла";
|
|
9
|
+
static hiddenAliases = ["common:direct-url"];
|
|
9
10
|
static apiMethod = "POST";
|
|
10
11
|
static apiPath = "/direct_url";
|
|
11
12
|
static requiredFlags = ["content-disposition", "acl", "policy", "x-amz-credential", "x-amz-algorithm", "x-amz-date", "x-amz-signature", "key"];
|
|
@@ -45,7 +46,7 @@ export default class CommonDirectUrl extends BaseCommand {
|
|
|
45
46
|
}),
|
|
46
47
|
};
|
|
47
48
|
async run() {
|
|
48
|
-
const { args, flags } = await this.parse(
|
|
49
|
+
const { args, flags } = await this.parse(FilesDirectUrl);
|
|
49
50
|
this.parsedFlags = flags;
|
|
50
51
|
const missingRequired = [
|
|
51
52
|
{ flag: 'content-disposition', label: "Параметр Content-Disposition, полученный в ответе на запрос [Получение подписи, ключа и других параметров](POST /uploads)", type: 'string' },
|
|
@@ -77,7 +78,7 @@ export default class CommonDirectUrl extends BaseCommand {
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
else {
|
|
80
|
-
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --content-disposition <string>, --acl <string>, --policy <string>, --x-amz-credential <string>, --x-amz-algorithm <string>, --x-amz-date <string>, --x-amz-signature <string>, --key <string>. pachca introspect
|
|
81
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --content-disposition <string>, --acl <string>, --policy <string>, --x-amz-credential <string>, --x-amz-algorithm <string>, --x-amz-date <string>, --x-amz-signature <string>, --key <string>. pachca introspect files direct-url" });
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
let formData;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command.js';
|
|
2
|
-
export default class
|
|
2
|
+
export default class FilesUploads extends BaseCommand {
|
|
3
3
|
static description = "Получение подписи, ключа и других параметров";
|
|
4
4
|
static examples = [
|
|
5
|
-
"Изменить вложения сообщения:\n $ pachca
|
|
5
|
+
"Изменить вложения сообщения:\n $ pachca files uploads"
|
|
6
6
|
];
|
|
7
|
+
static hiddenAliases = ["common:uploads"];
|
|
7
8
|
static scope = "uploads:write";
|
|
8
9
|
static apiMethod = "POST";
|
|
9
10
|
static apiPath = "/uploads";
|
|
@@ -13,7 +14,7 @@ export default class CommonUploads extends BaseCommand {
|
|
|
13
14
|
...BaseCommand.baseFlags,
|
|
14
15
|
};
|
|
15
16
|
async run() {
|
|
16
|
-
const { args, flags } = await this.parse(
|
|
17
|
+
const { args, flags } = await this.parse(FilesUploads);
|
|
17
18
|
this.parsedFlags = flags;
|
|
18
19
|
const { data } = await this.apiRequest({
|
|
19
20
|
method: 'POST',
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
import { Args, Flags } from '@oclif/core';
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
4
|
import * as clack from '@clack/prompts';
|
|
5
|
-
export default class
|
|
5
|
+
export default class MessagesUnfurl extends BaseCommand {
|
|
6
6
|
static description = "Unfurl (разворачивание ссылок)";
|
|
7
7
|
static examples = [
|
|
8
|
-
"Разворачивание ссылок (unfurling):\n $ pachca
|
|
8
|
+
"Разворачивание ссылок (unfurling):\n $ pachca messages unfurl"
|
|
9
9
|
];
|
|
10
|
+
static hiddenAliases = ["link-previews:add"];
|
|
10
11
|
static scope = "link_previews:write";
|
|
11
12
|
static apiMethod = "POST";
|
|
12
13
|
static apiPath = "/messages/{id}/link_previews";
|
|
13
14
|
static requiredFlags = ["link-previews"];
|
|
14
15
|
static args = {
|
|
15
16
|
id: Args.integer({
|
|
16
|
-
description: "Идентификатор сообщения",
|
|
17
|
+
description: "Идентификатор сообщения (pachca messages list)",
|
|
17
18
|
required: true,
|
|
18
19
|
}),
|
|
19
20
|
};
|
|
@@ -24,7 +25,7 @@ export default class LinkPreviewsAdd extends BaseCommand {
|
|
|
24
25
|
}),
|
|
25
26
|
};
|
|
26
27
|
async run() {
|
|
27
|
-
const { args, flags } = await this.parse(
|
|
28
|
+
const { args, flags } = await this.parse(MessagesUnfurl);
|
|
28
29
|
this.parsedFlags = flags;
|
|
29
30
|
const missingRequired = [
|
|
30
31
|
{ flag: 'link-previews', label: "`JSON` карта предпросмотров ссылок, где каждый ключ — `URL`, который был получен в исходящем вебхуке о новом сообщении.", type: 'string' },
|
|
@@ -49,7 +50,7 @@ export default class LinkPreviewsAdd extends BaseCommand {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
52
|
-
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --link-previews <string>. pachca introspect
|
|
53
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --link-previews <string>. pachca introspect messages unfurl" });
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
const body = {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command.js';
|
|
2
|
-
export default class
|
|
2
|
+
export default class OauthTokenInfo extends BaseCommand {
|
|
3
3
|
static description = "Информация о токене";
|
|
4
4
|
static examples = [
|
|
5
|
-
"Проверить свой токен:\n $ pachca
|
|
5
|
+
"Проверить свой токен:\n $ pachca oauth token-info"
|
|
6
6
|
];
|
|
7
|
+
static hiddenAliases = ["profile:get-info"];
|
|
7
8
|
static apiMethod = "GET";
|
|
8
9
|
static apiPath = "/oauth/token/info";
|
|
9
10
|
static defaultColumns = ["id", "name", "created_at", "token", "user_id"];
|
|
@@ -12,7 +13,7 @@ export default class ProfileGetInfo extends BaseCommand {
|
|
|
12
13
|
...BaseCommand.baseFlags,
|
|
13
14
|
};
|
|
14
15
|
async run() {
|
|
15
|
-
const { args, flags } = await this.parse(
|
|
16
|
+
const { args, flags } = await this.parse(OauthTokenInfo);
|
|
16
17
|
this.parsedFlags = flags;
|
|
17
18
|
const { data } = await this.apiRequest({
|
|
18
19
|
method: 'GET',
|
|
@@ -20,6 +20,11 @@ export default class SearchListMessages extends BaseCommand {
|
|
|
20
20
|
description: "Направление сортировки",
|
|
21
21
|
options: ["asc", "desc"],
|
|
22
22
|
}),
|
|
23
|
+
'sort': Flags.string({
|
|
24
|
+
description: "Сортировка результатов",
|
|
25
|
+
options: ["created_at", "relevance"],
|
|
26
|
+
default: "created_at",
|
|
27
|
+
}),
|
|
23
28
|
'created-from': Flags.string({
|
|
24
29
|
description: "Фильтр по дате создания (от)",
|
|
25
30
|
}),
|
|
@@ -60,6 +65,7 @@ export default class SearchListMessages extends BaseCommand {
|
|
|
60
65
|
const query = {
|
|
61
66
|
query: flags['query'],
|
|
62
67
|
order: flags['order'],
|
|
68
|
+
sort: flags['sort'],
|
|
63
69
|
'created_from': flags['created-from'],
|
|
64
70
|
'created_to': flags['created-to'],
|
|
65
71
|
'chat_ids': flags['chat-ids']?.split(','),
|
|
@@ -113,6 +119,7 @@ export default class SearchListMessages extends BaseCommand {
|
|
|
113
119
|
query: {
|
|
114
120
|
query: flags['query'],
|
|
115
121
|
order: flags['order'],
|
|
122
|
+
sort: flags['sort'],
|
|
116
123
|
'created_from': flags['created-from'],
|
|
117
124
|
'created_to': flags['created-to'],
|
|
118
125
|
'chat_ids': flags['chat-ids']?.split(','),
|
|
@@ -24,7 +24,7 @@ export default class SecurityList extends BaseCommand {
|
|
|
24
24
|
}),
|
|
25
25
|
'event-key': Flags.string({
|
|
26
26
|
description: "Фильтр по конкретному типу события",
|
|
27
|
-
options: ["user_login", "user_logout", "user_2fa_fail", "user_2fa_success", "user_created", "user_deleted", "user_role_changed", "user_updated", "tag_created", "tag_deleted", "user_added_to_tag", "user_removed_from_tag", "chat_created", "chat_renamed", "chat_permission_changed", "user_chat_join", "user_chat_leave", "tag_added_to_chat", "tag_removed_from_chat", "message_updated", "message_deleted", "message_created", "reaction_created", "reaction_deleted", "thread_created", "access_token_created", "access_token_updated", "access_token_destroy", "kms_encrypt", "kms_decrypt", "audit_events_accessed", "dlp_violation_detected", "search_users_api", "search_chats_api", "search_messages_api"],
|
|
27
|
+
options: ["user_login", "user_logout", "user_2fa_fail", "user_2fa_success", "user_created", "user_deleted", "user_role_changed", "user_updated", "tag_created", "tag_deleted", "user_added_to_tag", "user_removed_from_tag", "chat_created", "chat_renamed", "chat_permission_changed", "user_chat_join", "user_chat_leave", "tag_added_to_chat", "tag_removed_from_chat", "message_updated", "message_deleted", "message_created", "reaction_created", "reaction_deleted", "thread_created", "access_token_created", "access_token_updated", "access_token_destroy", "kms_encrypt", "kms_decrypt", "audit_events_accessed", "dlp_violation_detected", "search_users_api", "search_chats_api", "search_messages_api", "bot_scopes_updated", "bot_webhook_settings_updated", "bot_token_recreated"],
|
|
28
28
|
}),
|
|
29
29
|
'actor-id': Flags.string({
|
|
30
30
|
description: "Идентификатор пользователя, выполнившего действие",
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"security:list": "Журнал аудита событий",
|
|
3
|
+
"bots:recreate-token-self": "Ротация собственного токена бота",
|
|
3
4
|
"bots:update-webhook": "Саморегистрация вебхука бота",
|
|
4
5
|
"bots:create": "Новый бот",
|
|
5
6
|
"bots:get": "Информация о боте",
|
|
6
7
|
"bots:update": "Редактирование бота",
|
|
8
|
+
"bots:recreate-token": "Ротация токена бота",
|
|
7
9
|
"chats:create": "Новый чат",
|
|
8
10
|
"chats:list": "Список чатов",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
+
"chats:request-export": "Экспорт сообщений",
|
|
12
|
+
"chats:download-export": "Скачать архив экспорта",
|
|
11
13
|
"chats:get": "Информация о чате",
|
|
12
14
|
"chats:update": "Редактирование чата",
|
|
13
15
|
"chats:archive": "Архивация чата",
|
|
@@ -19,8 +21,8 @@
|
|
|
19
21
|
"members:remove": "Исключение пользователя",
|
|
20
22
|
"members:update": "Редактирование роли",
|
|
21
23
|
"chats:unarchive": "Разархивация чата",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
+
"custom-properties:list": "Список дополнительных полей",
|
|
25
|
+
"files:direct-url": "Загрузка файла",
|
|
24
26
|
"group-tags:create": "Новый тег",
|
|
25
27
|
"group-tags:list": "Список тегов сотрудников",
|
|
26
28
|
"group-tags:get": "Информация о теге",
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
"messages:get": "Информация о сообщении",
|
|
33
35
|
"messages:update": "Редактирование сообщения",
|
|
34
36
|
"messages:delete": "Удаление сообщения",
|
|
35
|
-
"
|
|
37
|
+
"messages:unfurl": "Unfurl (разворачивание ссылок)",
|
|
36
38
|
"messages:pin": "Закрепление сообщения",
|
|
37
39
|
"messages:unpin": "Открепление сообщения",
|
|
38
40
|
"reactions:add": "Добавление реакции",
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
"reactions:list": "Список реакций",
|
|
41
43
|
"read-member:list-readers": "Список прочитавших сообщение",
|
|
42
44
|
"threads:add": "Новый тред",
|
|
43
|
-
"
|
|
45
|
+
"oauth:token-info": "Информация о токене",
|
|
44
46
|
"profile:get": "Свой профиль",
|
|
45
47
|
"profile:update-avatar": "Загрузка своего аватара",
|
|
46
48
|
"profile:delete-avatar": "Удаление своего аватара",
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
"tasks:delete": "Удаление напоминания",
|
|
58
60
|
"threads:list": "Список тредов",
|
|
59
61
|
"threads:get": "Информация о треде",
|
|
60
|
-
"
|
|
62
|
+
"files:uploads": "Получение подписи, ключа и других параметров",
|
|
61
63
|
"users:create": "Новый сотрудник",
|
|
62
64
|
"users:list": "Список сотрудников",
|
|
63
65
|
"users:get": "Информация о сотруднике",
|
|
@@ -72,10 +74,11 @@
|
|
|
72
74
|
"bots:list-events": "История событий",
|
|
73
75
|
"bots:remove-event": "Удаление события",
|
|
74
76
|
"skill:pachca-users": "pachca-users",
|
|
77
|
+
"skill:pachca-oauth": "pachca-oauth",
|
|
75
78
|
"skill:pachca-profile": "получить профиль, мой профиль, установить свой статус",
|
|
79
|
+
"skill:pachca-bots": "pachca-bots",
|
|
76
80
|
"skill:pachca-chats": "pachca-chats",
|
|
77
81
|
"skill:pachca-search": "найти сообщение по тексту, полнотекстовый поиск",
|
|
78
82
|
"skill:pachca-messages": "pachca-messages",
|
|
79
|
-
"skill:pachca-bots": "pachca-bots",
|
|
80
83
|
"skill:pachca-forms": "pachca-forms"
|
|
81
84
|
}
|
package/dist/data/changelog.json
CHANGED
|
@@ -1,4 +1,56 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "2026.6.3",
|
|
4
|
+
"date": "24 июня 2026",
|
|
5
|
+
"changes": [
|
|
6
|
+
{
|
|
7
|
+
"type": "~",
|
|
8
|
+
"command": "files, custom-properties, oauth",
|
|
9
|
+
"description": "Команды реорганизованы по разделам: `common uploads`→`files uploads`, `common direct-url`→`files direct-url`, `common custom-properties`→`custom-properties list`, `common request-export`→`chats request-export`, `common get-exports`→`chats download-export`, `profile get-info`→`oauth token-info`, `link-previews add`→`messages unfurl`. Старые имена продолжают работать (скрытые алиасы)"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "+",
|
|
13
|
+
"command": "bots recreate-token",
|
|
14
|
+
"description": "Новая команда — ротация токена бота по его `id` (нужны права администратора, владельца компании или создателя бота)"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "+",
|
|
18
|
+
"command": "bots recreate-token-self",
|
|
19
|
+
"description": "Новая команда — бот перевыпускает собственный токен своим же токеном"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "+",
|
|
23
|
+
"command": "bots create",
|
|
24
|
+
"description": "Настройки вебхука — параметры `ignore-self-messages` (игнорировать свои сообщения) и `events-history-enabled` (сохранять историю событий)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "+",
|
|
28
|
+
"command": "bots update",
|
|
29
|
+
"description": "Настройки вебхука — параметры `ignore-self-messages` (игнорировать свои сообщения) и `events-history-enabled` (сохранять историю событий)"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"version": "2026.6.2",
|
|
35
|
+
"date": "19 июня 2026",
|
|
36
|
+
"changes": [
|
|
37
|
+
{
|
|
38
|
+
"type": "+",
|
|
39
|
+
"command": "bots create",
|
|
40
|
+
"description": "Настройки входящего вебхука — параметры `template`, `template_engine`, `challenge_key`, `link_preview_enabled`"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "+",
|
|
44
|
+
"command": "bots update",
|
|
45
|
+
"description": "Настройки входящего вебхука — параметры `template`, `template_engine`, `challenge_key`, `link_preview_enabled`"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "+",
|
|
49
|
+
"command": "search list-messages",
|
|
50
|
+
"description": "Добавлен параметр `sort` — сортировка (`created_at` или `relevance`)"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
2
54
|
{
|
|
3
55
|
"version": "2026.6.1",
|
|
4
56
|
"date": "16 июня 2026",
|