@pachca/cli 2026.5.0 → 2026.5.2
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 +12 -0
- package/README.md +17 -14
- package/README.template.md +3 -3
- package/dist/api-introspect.js +60 -0
- package/dist/base-command.js +5 -0
- package/dist/commands/api.js +89 -7
- package/dist/commands/auth/login.js +2 -2
- package/dist/commands/auth/logout.js +1 -1
- package/dist/commands/auth/switch.js +1 -1
- package/dist/commands/bots/list-events.js +9 -2
- package/dist/commands/chats/list.js +9 -2
- package/dist/commands/commands.js +1 -1
- package/dist/commands/config/get.js +1 -1
- package/dist/commands/config/set.js +2 -2
- package/dist/commands/group-tags/list-users.js +9 -2
- package/dist/commands/group-tags/list.js +9 -2
- package/dist/commands/guide.js +1 -1
- package/dist/commands/introspect.js +6 -44
- package/dist/commands/members/list.js +9 -2
- package/dist/commands/messages/list.js +9 -2
- package/dist/commands/reactions/list.js +9 -2
- package/dist/commands/read-member/list-readers.js +9 -2
- package/dist/commands/search/list-chats.js +9 -2
- package/dist/commands/search/list-messages.js +9 -2
- package/dist/commands/search/list-users.js +9 -2
- package/dist/commands/security/list.js +9 -2
- package/dist/commands/tasks/list.js +9 -2
- package/dist/commands/users/create.js +4 -0
- package/dist/commands/users/list.js +9 -2
- package/dist/data/changelog.json +39 -0
- package/dist/data/endpoints.json +1 -0
- package/dist/data/workflows.json +16 -0
- package/dist/lib/manifest.js +72 -0
- package/dist/output.js +31 -0
- package/dist/profiles.js +6 -0
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
|
@@ -47,12 +47,19 @@ export default class ReadMemberListReaders extends BaseCommand {
|
|
|
47
47
|
const items = body.data;
|
|
48
48
|
if (items)
|
|
49
49
|
allData.push(...items);
|
|
50
|
-
if (!items || items.length === 0)
|
|
51
|
-
break;
|
|
52
50
|
const meta = body.meta;
|
|
53
51
|
const paginate = meta?.paginate;
|
|
54
52
|
nextCursor = paginate?.next_page;
|
|
55
53
|
pages++;
|
|
54
|
+
// Условие конца: списочные методы — has_next === false; методы поиска и /users?query= (без has_next) — пустой data
|
|
55
|
+
const hasNext = paginate?.has_next;
|
|
56
|
+
if (typeof hasNext === 'boolean') {
|
|
57
|
+
if (!hasNext)
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
else if (!items || items.length === 0) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
56
63
|
if (process.stderr.isTTY) {
|
|
57
64
|
const total = paginate?.total;
|
|
58
65
|
const progress = total ? `${allData.length} / ${total}` : String(allData.length);
|
|
@@ -76,12 +76,19 @@ export default class SearchListChats extends BaseCommand {
|
|
|
76
76
|
const items = body.data;
|
|
77
77
|
if (items)
|
|
78
78
|
allData.push(...items);
|
|
79
|
-
if (!items || items.length === 0)
|
|
80
|
-
break;
|
|
81
79
|
const meta = body.meta;
|
|
82
80
|
const paginate = meta?.paginate;
|
|
83
81
|
nextCursor = paginate?.next_page;
|
|
84
82
|
pages++;
|
|
83
|
+
// Условие конца: списочные методы — has_next === false; методы поиска и /users?query= (без has_next) — пустой data
|
|
84
|
+
const hasNext = paginate?.has_next;
|
|
85
|
+
if (typeof hasNext === 'boolean') {
|
|
86
|
+
if (!hasNext)
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
else if (!items || items.length === 0) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
85
92
|
if (process.stderr.isTTY) {
|
|
86
93
|
const total = paginate?.total;
|
|
87
94
|
const progress = total ? `${allData.length} / ${total}` : String(allData.length);
|
|
@@ -73,12 +73,19 @@ export default class SearchListMessages extends BaseCommand {
|
|
|
73
73
|
const items = body.data;
|
|
74
74
|
if (items)
|
|
75
75
|
allData.push(...items);
|
|
76
|
-
if (!items || items.length === 0)
|
|
77
|
-
break;
|
|
78
76
|
const meta = body.meta;
|
|
79
77
|
const paginate = meta?.paginate;
|
|
80
78
|
nextCursor = paginate?.next_page;
|
|
81
79
|
pages++;
|
|
80
|
+
// Условие конца: списочные методы — has_next === false; методы поиска и /users?query= (без has_next) — пустой data
|
|
81
|
+
const hasNext = paginate?.has_next;
|
|
82
|
+
if (typeof hasNext === 'boolean') {
|
|
83
|
+
if (!hasNext)
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
else if (!items || items.length === 0) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
82
89
|
if (process.stderr.isTTY) {
|
|
83
90
|
const total = paginate?.total;
|
|
84
91
|
const progress = total ? `${allData.length} / ${total}` : String(allData.length);
|
|
@@ -71,12 +71,19 @@ export default class SearchListUsers extends BaseCommand {
|
|
|
71
71
|
const items = body.data;
|
|
72
72
|
if (items)
|
|
73
73
|
allData.push(...items);
|
|
74
|
-
if (!items || items.length === 0)
|
|
75
|
-
break;
|
|
76
74
|
const meta = body.meta;
|
|
77
75
|
const paginate = meta?.paginate;
|
|
78
76
|
nextCursor = paginate?.next_page;
|
|
79
77
|
pages++;
|
|
78
|
+
// Условие конца: списочные методы — has_next === false; методы поиска и /users?query= (без has_next) — пустой data
|
|
79
|
+
const hasNext = paginate?.has_next;
|
|
80
|
+
if (typeof hasNext === 'boolean') {
|
|
81
|
+
if (!hasNext)
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
else if (!items || items.length === 0) {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
80
87
|
if (process.stderr.isTTY) {
|
|
81
88
|
const total = paginate?.total;
|
|
82
89
|
const progress = total ? `${allData.length} / ${total}` : String(allData.length);
|
|
@@ -75,12 +75,19 @@ export default class SecurityList extends BaseCommand {
|
|
|
75
75
|
const items = body.data;
|
|
76
76
|
if (items)
|
|
77
77
|
allData.push(...items);
|
|
78
|
-
if (!items || items.length === 0)
|
|
79
|
-
break;
|
|
80
78
|
const meta = body.meta;
|
|
81
79
|
const paginate = meta?.paginate;
|
|
82
80
|
nextCursor = paginate?.next_page;
|
|
83
81
|
pages++;
|
|
82
|
+
// Условие конца: списочные методы — has_next === false; методы поиска и /users?query= (без has_next) — пустой data
|
|
83
|
+
const hasNext = paginate?.has_next;
|
|
84
|
+
if (typeof hasNext === 'boolean') {
|
|
85
|
+
if (!hasNext)
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
else if (!items || items.length === 0) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
84
91
|
if (process.stderr.isTTY) {
|
|
85
92
|
const total = paginate?.total;
|
|
86
93
|
const progress = total ? `${allData.length} / ${total}` : String(allData.length);
|
|
@@ -45,12 +45,19 @@ export default class TasksList extends BaseCommand {
|
|
|
45
45
|
const items = body.data;
|
|
46
46
|
if (items)
|
|
47
47
|
allData.push(...items);
|
|
48
|
-
if (!items || items.length === 0)
|
|
49
|
-
break;
|
|
50
48
|
const meta = body.meta;
|
|
51
49
|
const paginate = meta?.paginate;
|
|
52
50
|
nextCursor = paginate?.next_page;
|
|
53
51
|
pages++;
|
|
52
|
+
// Условие конца: списочные методы — has_next === false; методы поиска и /users?query= (без has_next) — пустой data
|
|
53
|
+
const hasNext = paginate?.has_next;
|
|
54
|
+
if (typeof hasNext === 'boolean') {
|
|
55
|
+
if (!hasNext)
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
else if (!items || items.length === 0) {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
54
61
|
if (process.stderr.isTTY) {
|
|
55
62
|
const total = paginate?.total;
|
|
56
63
|
const progress = total ? `${allData.length} / ${total}` : String(allData.length);
|
|
@@ -48,6 +48,9 @@ export default class UsersCreate extends BaseCommand {
|
|
|
48
48
|
'list-tags': Flags.string({
|
|
49
49
|
description: "Массив тегов, привязываемых к сотруднику",
|
|
50
50
|
}),
|
|
51
|
+
'chat-ids': Flags.string({
|
|
52
|
+
description: "Идентификаторы чатов, в которые сотрудник будет добавлен сразу при создании. Для роли `guest` параметр обязателен и должен содержать ровно один активный чат.",
|
|
53
|
+
}),
|
|
51
54
|
'custom-properties': Flags.string({
|
|
52
55
|
description: "Задаваемые дополнительные поля",
|
|
53
56
|
}),
|
|
@@ -97,6 +100,7 @@ export default class UsersCreate extends BaseCommand {
|
|
|
97
100
|
role: flags['role'],
|
|
98
101
|
suspended: flags['suspended'],
|
|
99
102
|
list_tags: flags['list-tags'] ? this.parseJSON(flags['list-tags'], 'list-tags') : undefined,
|
|
103
|
+
chat_ids: flags['chat-ids'] ? this.parseJSON(flags['chat-ids'], 'chat-ids') : undefined,
|
|
100
104
|
custom_properties: flags['custom-properties'] ? this.parseJSON(flags['custom-properties'], 'custom-properties') : undefined,
|
|
101
105
|
},
|
|
102
106
|
skip_email_notify: flags['skip-email-notify'],
|
|
@@ -49,12 +49,19 @@ export default class UsersList extends BaseCommand {
|
|
|
49
49
|
const items = body.data;
|
|
50
50
|
if (items)
|
|
51
51
|
allData.push(...items);
|
|
52
|
-
if (!items || items.length === 0)
|
|
53
|
-
break;
|
|
54
52
|
const meta = body.meta;
|
|
55
53
|
const paginate = meta?.paginate;
|
|
56
54
|
nextCursor = paginate?.next_page;
|
|
57
55
|
pages++;
|
|
56
|
+
// Условие конца: списочные методы — has_next === false; методы поиска и /users?query= (без has_next) — пустой data
|
|
57
|
+
const hasNext = paginate?.has_next;
|
|
58
|
+
if (typeof hasNext === 'boolean') {
|
|
59
|
+
if (!hasNext)
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
else if (!items || items.length === 0) {
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
58
65
|
if (process.stderr.isTTY) {
|
|
59
66
|
const total = paginate?.total;
|
|
60
67
|
const progress = total ? `${allData.length} / ${total}` : String(allData.length);
|
package/dist/data/changelog.json
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "2026.5.2",
|
|
4
|
+
"date": "17 мая 2026",
|
|
5
|
+
"changes": [
|
|
6
|
+
{
|
|
7
|
+
"type": "+",
|
|
8
|
+
"command": "users create",
|
|
9
|
+
"description": "Параметр `--chat-ids` — добавить сотрудника в указанные чаты сразу при создании. Параметр `--role` теперь принимает значение `guest`: для роли `guest` нужно передать `--chat-ids` ровно с одним активным чатом, иначе API вернёт `400`"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "+",
|
|
13
|
+
"command": "api",
|
|
14
|
+
"description": "Список эндпоинтов и справка по API прямо в CLI: `pachca api ls` (список всех эндпоинтов), `pachca api <МЕТОД> <путь> --describe` / `--spec` / `--docs` (параметры, тело, схема, пример). Данные берутся из той же OpenAPI-спецификации, из которой собран CLI, — всегда совпадают с актуальным API. Агенту не нужно искать эндпоинт в документации"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "+",
|
|
18
|
+
"command": "api",
|
|
19
|
+
"description": "Флаг `--data` — тело запроса инлайн JSON-строкой (`pachca api POST /messages --data '{...}'`)"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "+",
|
|
23
|
+
"description": "Флаг `--plain` — плоский TSV-вывод для скриптов: без заголовка, колонка id первой, без цвета и обрезки"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "+",
|
|
27
|
+
"description": "Переменная окружения `PACHCA_HOME` — переопределение каталога конфига (для изоляции в CI, тестах и у агентов)"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"version": "2026.5.1",
|
|
33
|
+
"date": "6 мая 2026",
|
|
34
|
+
"changes": [
|
|
35
|
+
{
|
|
36
|
+
"type": "~",
|
|
37
|
+
"description": "Поддержка обновлённого формата курсорной пагинации в list-командах"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
2
41
|
{
|
|
3
42
|
"version": "2026.5.0",
|
|
4
43
|
"date": "4 мая 2026",
|