@pachca/cli 2026.3.2 → 2026.3.4
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 +40 -0
- package/dist/base-command.js +34 -4
- package/dist/client.js +40 -7
- package/dist/commands/api.js +1 -2
- package/dist/commands/auth/list.js +1 -2
- package/dist/commands/auth/login.js +1 -2
- package/dist/commands/auth/logout.js +1 -2
- package/dist/commands/auth/refresh.js +1 -2
- package/dist/commands/auth/status.js +1 -2
- package/dist/commands/auth/switch.js +1 -2
- package/dist/commands/bots/list-events.js +0 -1
- package/dist/commands/bots/remove-event.js +2 -4
- package/dist/commands/bots/update.js +4 -8
- package/dist/commands/changelog.js +15 -3
- package/dist/commands/chats/archive.js +1 -2
- package/dist/commands/chats/create.js +2 -5
- package/dist/commands/chats/get.js +1 -2
- package/dist/commands/chats/list.js +0 -1
- package/dist/commands/chats/unarchive.js +1 -2
- package/dist/commands/chats/update.js +2 -4
- package/dist/commands/commands.js +2 -2
- package/dist/commands/common/custom-properties.js +2 -6
- package/dist/commands/common/direct-url.js +2 -5
- package/dist/commands/common/get-exports.js +0 -1
- package/dist/commands/common/request-export.js +2 -5
- package/dist/commands/common/uploads.js +0 -1
- package/dist/commands/config/get.js +1 -2
- package/dist/commands/config/list.js +1 -2
- package/dist/commands/config/set.js +1 -2
- package/dist/commands/doctor.js +1 -2
- package/dist/commands/group-tags/create.js +2 -5
- package/dist/commands/group-tags/delete.js +1 -3
- package/dist/commands/group-tags/get.js +0 -1
- package/dist/commands/group-tags/list-users.js +0 -1
- package/dist/commands/group-tags/list.js +0 -1
- package/dist/commands/group-tags/update.js +3 -7
- package/dist/commands/guide.js +5 -4
- package/dist/commands/introspect.js +15 -6
- package/dist/commands/link-previews/add.js +2 -5
- package/dist/commands/members/add-group-tags.js +2 -5
- package/dist/commands/members/add.js +2 -5
- package/dist/commands/members/leave.js +1 -3
- package/dist/commands/members/list.js +0 -1
- package/dist/commands/members/remove-group-tag.js +2 -4
- package/dist/commands/members/remove.js +2 -4
- package/dist/commands/members/update.js +4 -8
- package/dist/commands/messages/create.js +9 -10
- package/dist/commands/messages/delete.js +2 -4
- package/dist/commands/messages/get.js +1 -2
- package/dist/commands/messages/list.js +2 -5
- package/dist/commands/messages/pin.js +1 -2
- package/dist/commands/messages/unpin.js +2 -4
- package/dist/commands/messages/update.js +2 -4
- package/dist/commands/profile/delete-status.js +1 -3
- package/dist/commands/profile/get-info.js +0 -1
- package/dist/commands/profile/get-status.js +0 -1
- package/dist/commands/profile/get.js +0 -1
- package/dist/commands/profile/update-status.js +8 -9
- package/dist/commands/reactions/add.js +2 -5
- package/dist/commands/reactions/list.js +0 -1
- package/dist/commands/reactions/remove.js +3 -7
- package/dist/commands/read-member/list-readers.js +0 -1
- package/dist/commands/search/list-chats.js +0 -1
- package/dist/commands/search/list-messages.js +0 -1
- package/dist/commands/search/list-users.js +0 -1
- package/dist/commands/security/list.js +2 -5
- package/dist/commands/tasks/create.js +5 -8
- package/dist/commands/tasks/delete.js +2 -4
- package/dist/commands/tasks/get.js +1 -2
- package/dist/commands/tasks/list.js +2 -3
- package/dist/commands/tasks/update.js +2 -4
- package/dist/commands/thread/add.js +0 -1
- package/dist/commands/thread/get.js +0 -1
- package/dist/commands/users/create.js +2 -5
- package/dist/commands/users/delete.js +2 -4
- package/dist/commands/users/get-status.js +1 -2
- package/dist/commands/users/get.js +1 -2
- package/dist/commands/users/list.js +0 -1
- package/dist/commands/users/remove-status.js +2 -4
- package/dist/commands/users/update-status.js +9 -10
- package/dist/commands/users/update.js +2 -4
- package/dist/commands/version.js +1 -2
- package/dist/commands/views/open.js +12 -17
- package/dist/data/changelog.json +33 -297
- package/dist/data/workflows.json +118 -346
- package/dist/get-version.js +0 -1
- package/dist/hooks/command-not-found.js +0 -1
- package/dist/hooks/init.js +2 -3
- package/dist/hooks/postrun.js +1 -2
- package/dist/index.js +0 -1
- package/dist/output.js +9 -3
- package/dist/profiles.js +0 -1
- package/dist/utils.js +0 -1
- package/oclif.manifest.json +870 -792
- package/package.json +62 -6
- package/dist/base-command.d.ts +0 -78
- package/dist/base-command.d.ts.map +0 -1
- package/dist/base-command.js.map +0 -1
- package/dist/client.d.ts +0 -45
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/commands/api.d.ts +0 -38
- package/dist/commands/api.d.ts.map +0 -1
- package/dist/commands/api.js.map +0 -1
- package/dist/commands/auth/list.d.ts +0 -23
- package/dist/commands/auth/list.d.ts.map +0 -1
- package/dist/commands/auth/list.js.map +0 -1
- package/dist/commands/auth/login.d.ts +0 -23
- package/dist/commands/auth/login.d.ts.map +0 -1
- package/dist/commands/auth/login.js.map +0 -1
- package/dist/commands/auth/logout.d.ts +0 -26
- package/dist/commands/auth/logout.d.ts.map +0 -1
- package/dist/commands/auth/logout.js.map +0 -1
- package/dist/commands/auth/refresh.d.ts +0 -26
- package/dist/commands/auth/refresh.d.ts.map +0 -1
- package/dist/commands/auth/refresh.js.map +0 -1
- package/dist/commands/auth/status.d.ts +0 -23
- package/dist/commands/auth/status.d.ts.map +0 -1
- package/dist/commands/auth/status.js.map +0 -1
- package/dist/commands/auth/switch.d.ts +0 -26
- package/dist/commands/auth/switch.d.ts.map +0 -1
- package/dist/commands/auth/switch.js.map +0 -1
- package/dist/commands/bots/list-events.d.ts +0 -31
- package/dist/commands/bots/list-events.d.ts.map +0 -1
- package/dist/commands/bots/list-events.js.map +0 -1
- package/dist/commands/bots/remove-event.d.ts +0 -30
- package/dist/commands/bots/remove-event.d.ts.map +0 -1
- package/dist/commands/bots/remove-event.js.map +0 -1
- package/dist/commands/bots/update.d.ts +0 -34
- package/dist/commands/bots/update.d.ts.map +0 -1
- package/dist/commands/bots/update.js.map +0 -1
- package/dist/commands/changelog.d.ts +0 -23
- package/dist/commands/changelog.d.ts.map +0 -1
- package/dist/commands/changelog.js.map +0 -1
- package/dist/commands/chats/archive.d.ts +0 -32
- package/dist/commands/chats/archive.d.ts.map +0 -1
- package/dist/commands/chats/archive.js.map +0 -1
- package/dist/commands/chats/create.d.ts +0 -33
- package/dist/commands/chats/create.d.ts.map +0 -1
- package/dist/commands/chats/create.js.map +0 -1
- package/dist/commands/chats/get.d.ts +0 -33
- package/dist/commands/chats/get.d.ts.map +0 -1
- package/dist/commands/chats/get.js.map +0 -1
- package/dist/commands/chats/list.d.ts +0 -37
- package/dist/commands/chats/list.d.ts.map +0 -1
- package/dist/commands/chats/list.js.map +0 -1
- package/dist/commands/chats/unarchive.d.ts +0 -32
- package/dist/commands/chats/unarchive.d.ts.map +0 -1
- package/dist/commands/chats/unarchive.js.map +0 -1
- package/dist/commands/chats/update.d.ts +0 -35
- package/dist/commands/chats/update.d.ts.map +0 -1
- package/dist/commands/chats/update.js.map +0 -1
- package/dist/commands/commands.d.ts +0 -24
- package/dist/commands/commands.d.ts.map +0 -1
- package/dist/commands/commands.js.map +0 -1
- package/dist/commands/common/custom-properties.d.ts +0 -29
- package/dist/commands/common/custom-properties.d.ts.map +0 -1
- package/dist/commands/common/custom-properties.js.map +0 -1
- package/dist/commands/common/direct-url.d.ts +0 -34
- package/dist/commands/common/direct-url.d.ts.map +0 -1
- package/dist/commands/common/direct-url.js.map +0 -1
- package/dist/commands/common/get-exports.d.ts +0 -34
- package/dist/commands/common/get-exports.d.ts.map +0 -1
- package/dist/commands/common/get-exports.js.map +0 -1
- package/dist/commands/common/request-export.d.ts +0 -33
- package/dist/commands/common/request-export.d.ts.map +0 -1
- package/dist/commands/common/request-export.js.map +0 -1
- package/dist/commands/common/uploads.d.ts +0 -28
- package/dist/commands/common/uploads.d.ts.map +0 -1
- package/dist/commands/common/uploads.js.map +0 -1
- package/dist/commands/config/get.d.ts +0 -26
- package/dist/commands/config/get.d.ts.map +0 -1
- package/dist/commands/config/get.js.map +0 -1
- package/dist/commands/config/list.d.ts +0 -23
- package/dist/commands/config/list.d.ts.map +0 -1
- package/dist/commands/config/list.js.map +0 -1
- package/dist/commands/config/set.d.ts +0 -27
- package/dist/commands/config/set.d.ts.map +0 -1
- package/dist/commands/config/set.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -24
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/group-tags/create.d.ts +0 -29
- package/dist/commands/group-tags/create.d.ts.map +0 -1
- package/dist/commands/group-tags/create.js.map +0 -1
- package/dist/commands/group-tags/delete.d.ts +0 -32
- package/dist/commands/group-tags/delete.d.ts.map +0 -1
- package/dist/commands/group-tags/delete.js.map +0 -1
- package/dist/commands/group-tags/get.d.ts +0 -32
- package/dist/commands/group-tags/get.d.ts.map +0 -1
- package/dist/commands/group-tags/get.js.map +0 -1
- package/dist/commands/group-tags/list-users.d.ts +0 -36
- package/dist/commands/group-tags/list-users.d.ts.map +0 -1
- package/dist/commands/group-tags/list-users.js.map +0 -1
- package/dist/commands/group-tags/list.d.ts +0 -32
- package/dist/commands/group-tags/list.d.ts.map +0 -1
- package/dist/commands/group-tags/list.js.map +0 -1
- package/dist/commands/group-tags/update.d.ts +0 -33
- package/dist/commands/group-tags/update.d.ts.map +0 -1
- package/dist/commands/group-tags/update.js.map +0 -1
- package/dist/commands/guide.d.ts +0 -26
- package/dist/commands/guide.d.ts.map +0 -1
- package/dist/commands/guide.js.map +0 -1
- package/dist/commands/introspect.d.ts +0 -27
- package/dist/commands/introspect.d.ts.map +0 -1
- package/dist/commands/introspect.js.map +0 -1
- package/dist/commands/link-previews/add.d.ts +0 -33
- package/dist/commands/link-previews/add.d.ts.map +0 -1
- package/dist/commands/link-previews/add.js.map +0 -1
- package/dist/commands/members/add-group-tags.d.ts +0 -32
- package/dist/commands/members/add-group-tags.d.ts.map +0 -1
- package/dist/commands/members/add-group-tags.js.map +0 -1
- package/dist/commands/members/add.d.ts +0 -34
- package/dist/commands/members/add.d.ts.map +0 -1
- package/dist/commands/members/add.js.map +0 -1
- package/dist/commands/members/leave.d.ts +0 -33
- package/dist/commands/members/leave.d.ts.map +0 -1
- package/dist/commands/members/leave.js.map +0 -1
- package/dist/commands/members/list.d.ts +0 -37
- package/dist/commands/members/list.d.ts.map +0 -1
- package/dist/commands/members/list.js.map +0 -1
- package/dist/commands/members/remove-group-tag.d.ts +0 -36
- package/dist/commands/members/remove-group-tag.d.ts.map +0 -1
- package/dist/commands/members/remove-group-tag.js.map +0 -1
- package/dist/commands/members/remove.d.ts +0 -37
- package/dist/commands/members/remove.d.ts.map +0 -1
- package/dist/commands/members/remove.js.map +0 -1
- package/dist/commands/members/update.d.ts +0 -37
- package/dist/commands/members/update.d.ts.map +0 -1
- package/dist/commands/members/update.js.map +0 -1
- package/dist/commands/messages/create.d.ts +0 -38
- package/dist/commands/messages/create.d.ts.map +0 -1
- package/dist/commands/messages/create.js.map +0 -1
- package/dist/commands/messages/delete.d.ts +0 -33
- package/dist/commands/messages/delete.d.ts.map +0 -1
- package/dist/commands/messages/delete.js.map +0 -1
- package/dist/commands/messages/get.d.ts +0 -33
- package/dist/commands/messages/get.d.ts.map +0 -1
- package/dist/commands/messages/get.js.map +0 -1
- package/dist/commands/messages/list.d.ts +0 -33
- package/dist/commands/messages/list.d.ts.map +0 -1
- package/dist/commands/messages/list.js.map +0 -1
- package/dist/commands/messages/pin.d.ts +0 -32
- package/dist/commands/messages/pin.d.ts.map +0 -1
- package/dist/commands/messages/pin.js.map +0 -1
- package/dist/commands/messages/unpin.d.ts +0 -33
- package/dist/commands/messages/unpin.d.ts.map +0 -1
- package/dist/commands/messages/unpin.js.map +0 -1
- package/dist/commands/messages/update.d.ts +0 -38
- package/dist/commands/messages/update.d.ts.map +0 -1
- package/dist/commands/messages/update.js.map +0 -1
- package/dist/commands/profile/delete-status.d.ts +0 -28
- package/dist/commands/profile/delete-status.d.ts.map +0 -1
- package/dist/commands/profile/delete-status.js.map +0 -1
- package/dist/commands/profile/get-info.d.ts +0 -27
- package/dist/commands/profile/get-info.d.ts.map +0 -1
- package/dist/commands/profile/get-info.js.map +0 -1
- package/dist/commands/profile/get-status.d.ts +0 -28
- package/dist/commands/profile/get-status.d.ts.map +0 -1
- package/dist/commands/profile/get-status.js.map +0 -1
- package/dist/commands/profile/get.d.ts +0 -28
- package/dist/commands/profile/get.d.ts.map +0 -1
- package/dist/commands/profile/get.js.map +0 -1
- package/dist/commands/profile/update-status.d.ts +0 -33
- package/dist/commands/profile/update-status.d.ts.map +0 -1
- package/dist/commands/profile/update-status.js.map +0 -1
- package/dist/commands/reactions/add.d.ts +0 -35
- package/dist/commands/reactions/add.d.ts.map +0 -1
- package/dist/commands/reactions/add.js.map +0 -1
- package/dist/commands/reactions/list.d.ts +0 -36
- package/dist/commands/reactions/list.d.ts.map +0 -1
- package/dist/commands/reactions/list.js.map +0 -1
- package/dist/commands/reactions/remove.d.ts +0 -35
- package/dist/commands/reactions/remove.d.ts.map +0 -1
- package/dist/commands/reactions/remove.js.map +0 -1
- package/dist/commands/read-member/list-readers.d.ts +0 -35
- package/dist/commands/read-member/list-readers.d.ts.map +0 -1
- package/dist/commands/read-member/list-readers.js.map +0 -1
- package/dist/commands/search/list-chats.d.ts +0 -38
- package/dist/commands/search/list-chats.d.ts.map +0 -1
- package/dist/commands/search/list-chats.js.map +0 -1
- package/dist/commands/search/list-messages.d.ts +0 -38
- package/dist/commands/search/list-messages.d.ts.map +0 -1
- package/dist/commands/search/list-messages.js.map +0 -1
- package/dist/commands/search/list-users.d.ts +0 -37
- package/dist/commands/search/list-users.d.ts.map +0 -1
- package/dist/commands/search/list-users.js.map +0 -1
- package/dist/commands/security/list.d.ts +0 -39
- package/dist/commands/security/list.d.ts.map +0 -1
- package/dist/commands/security/list.js.map +0 -1
- package/dist/commands/tasks/create.d.ts +0 -36
- package/dist/commands/tasks/create.d.ts.map +0 -1
- package/dist/commands/tasks/create.js.map +0 -1
- package/dist/commands/tasks/delete.d.ts +0 -33
- package/dist/commands/tasks/delete.d.ts.map +0 -1
- package/dist/commands/tasks/delete.js.map +0 -1
- package/dist/commands/tasks/get.d.ts +0 -33
- package/dist/commands/tasks/get.d.ts.map +0 -1
- package/dist/commands/tasks/get.js.map +0 -1
- package/dist/commands/tasks/list.d.ts +0 -31
- package/dist/commands/tasks/list.d.ts.map +0 -1
- package/dist/commands/tasks/list.js.map +0 -1
- package/dist/commands/tasks/update.d.ts +0 -42
- package/dist/commands/tasks/update.d.ts.map +0 -1
- package/dist/commands/tasks/update.js.map +0 -1
- package/dist/commands/thread/add.d.ts +0 -33
- package/dist/commands/thread/add.d.ts.map +0 -1
- package/dist/commands/thread/add.js.map +0 -1
- package/dist/commands/thread/get.d.ts +0 -32
- package/dist/commands/thread/get.d.ts.map +0 -1
- package/dist/commands/thread/get.js.map +0 -1
- package/dist/commands/users/create.d.ts +0 -40
- package/dist/commands/users/create.d.ts.map +0 -1
- package/dist/commands/users/create.js.map +0 -1
- package/dist/commands/users/delete.d.ts +0 -33
- package/dist/commands/users/delete.d.ts.map +0 -1
- package/dist/commands/users/delete.js.map +0 -1
- package/dist/commands/users/get-status.d.ts +0 -33
- package/dist/commands/users/get-status.d.ts.map +0 -1
- package/dist/commands/users/get-status.js.map +0 -1
- package/dist/commands/users/get.d.ts +0 -33
- package/dist/commands/users/get.d.ts.map +0 -1
- package/dist/commands/users/get.js.map +0 -1
- package/dist/commands/users/list.d.ts +0 -32
- package/dist/commands/users/list.d.ts.map +0 -1
- package/dist/commands/users/list.js.map +0 -1
- package/dist/commands/users/remove-status.d.ts +0 -33
- package/dist/commands/users/remove-status.d.ts.map +0 -1
- package/dist/commands/users/remove-status.js.map +0 -1
- package/dist/commands/users/update-status.d.ts +0 -38
- package/dist/commands/users/update-status.d.ts.map +0 -1
- package/dist/commands/users/update-status.js.map +0 -1
- package/dist/commands/users/update.d.ts +0 -44
- package/dist/commands/users/update.d.ts.map +0 -1
- package/dist/commands/users/update.js.map +0 -1
- package/dist/commands/version.d.ts +0 -23
- package/dist/commands/version.d.ts.map +0 -1
- package/dist/commands/version.js.map +0 -1
- package/dist/commands/views/open.d.ts +0 -35
- package/dist/commands/views/open.d.ts.map +0 -1
- package/dist/commands/views/open.js.map +0 -1
- package/dist/get-version.d.ts +0 -7
- package/dist/get-version.d.ts.map +0 -1
- package/dist/get-version.js.map +0 -1
- package/dist/hooks/command-not-found.d.ts +0 -4
- package/dist/hooks/command-not-found.d.ts.map +0 -1
- package/dist/hooks/command-not-found.js.map +0 -1
- package/dist/hooks/init.d.ts +0 -4
- package/dist/hooks/init.d.ts.map +0 -1
- package/dist/hooks/init.js.map +0 -1
- package/dist/hooks/postrun.d.ts +0 -4
- package/dist/hooks/postrun.d.ts.map +0 -1
- package/dist/hooks/postrun.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/output.d.ts +0 -26
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js.map +0 -1
- package/dist/profiles.d.ts +0 -52
- package/dist/profiles.d.ts.map +0 -1
- package/dist/profiles.js.map +0 -1
- package/dist/utils.d.ts +0 -21
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2026.3.4 (5 марта 2026)
|
|
4
|
+
|
|
5
|
+
- **Добавлено** (all): Переменная окружения PACHCA_API_URL для использования кастомного base URL
|
|
6
|
+
- **Изменено** (all): Исправлено выравнивание в уведомлении о доступном обновлении
|
|
7
|
+
|
|
8
|
+
## 2026.3.3 (4 марта 2026)
|
|
9
|
+
|
|
10
|
+
- **Добавлено** (all): Структурированные ошибки валидации: type, flag, hint в JSON-выводе
|
|
11
|
+
- **Добавлено** (all): Батчинг ошибок валидации — все ошибки выводятся разом, а не по одной
|
|
12
|
+
- **Добавлено** (all): Hint-подсказки в ошибках авторизации и профиля (pachca auth login, pachca auth list)
|
|
13
|
+
- **Добавлено** (all): Описания команд и топиков переведены на русский язык
|
|
14
|
+
- **Добавлено** (all): Подсказки связанных команд в описаниях ID-флагов (pachca chats list, pachca users list)
|
|
15
|
+
- **Изменено** (introspect): Аргументы команды (args) в выводе, requiredFlags, улучшенная ошибка «команда не найдена»
|
|
16
|
+
- **Изменено** (commands): Поле summary в выводе команд
|
|
17
|
+
- **Изменено** (guide): Компактный вывод шагов ($ command), структурированные данные сценариев, фильтрация шагов без CLI-команд
|
|
18
|
+
|
|
19
|
+
## 2026.3.2 (4 марта 2026)
|
|
20
|
+
|
|
21
|
+
- **Изменено** (auth login): Исправлена обработка ответа /oauth/token/info (обёртка { data })
|
|
22
|
+
- **Изменено** (auth refresh): Исправлена обработка ответа /oauth/token/info (обёртка { data })
|
|
23
|
+
- **Изменено** (doctor): Исправлена обработка ответа /oauth/token/info (обёртка { data })
|
|
24
|
+
- **Изменено** (commands): --available фильтрует недоступные команды вместо колонки available
|
|
25
|
+
- **Изменено** (auth login): Fallback-имя «User #ID» вместо «Unknown» при недоступном профиле
|
|
26
|
+
- **Изменено** (all): --version пропускает проверку авторизации
|
|
27
|
+
|
|
28
|
+
## 2026.3.1 (4 марта 2026)
|
|
29
|
+
|
|
30
|
+
- **Добавлено** (all): Все флаги в kebab-case (--first-name, --entity-id, --phone-number)
|
|
31
|
+
- **Добавлено** (all): Boolean-флаги с --no- префиксом (--suspended / --no-suspended)
|
|
32
|
+
- **Добавлено** (all): Хинт «через запятую» для массивных параметров (--chat-ids, --user-ids)
|
|
33
|
+
- **Добавлено** (all): DELETE --json выводит {"ok":true} в stdout
|
|
34
|
+
- **Добавлено** (all): POST/DELETE не ретраятся при сетевых ошибках
|
|
35
|
+
- **Добавлено** (common direct-url): Флаги в kebab-case, корректные wire names в FormData
|
|
36
|
+
- **Добавлено** (chats list): Флаг --sort-last-message-at (был --sort-last_message_at)
|
|
37
|
+
- **Добавлено** (guide): Поиск по сценариям использования API
|
|
38
|
+
- **Добавлено** (doctor): Диагностика окружения (Node.js, сеть, токен, версия)
|
|
39
|
+
- **Добавлено** (introspect): Метаинформация о командах и флагах для агентов
|
|
40
|
+
- **Добавлено** (api): Прямые HTTP-запросы с -f/-F, --input, --query
|
package/dist/base-command.js
CHANGED
|
@@ -105,9 +105,40 @@ export class BaseCommand extends Command {
|
|
|
105
105
|
return JSON.parse(value);
|
|
106
106
|
}
|
|
107
107
|
catch {
|
|
108
|
-
this.
|
|
108
|
+
this.validationError([{ message: `Invalid JSON in --${flagName}`, flag: flagName }]);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Report validation error(s) with structured output and exit.
|
|
113
|
+
*/
|
|
114
|
+
validationError(errors, opts) {
|
|
115
|
+
const format = this.getOutputFormat();
|
|
116
|
+
const type = opts?.type ?? 'PACHCA_VALIDATION_ERROR';
|
|
117
|
+
const helpCmd = this.id ? `pachca introspect ${this.id.replace(/:/g, ' ')}` : undefined;
|
|
118
|
+
const hint = opts?.hint ?? helpCmd;
|
|
119
|
+
if (errors.length === 1) {
|
|
120
|
+
outputError({
|
|
121
|
+
error: errors[0].message,
|
|
122
|
+
code: null,
|
|
123
|
+
type,
|
|
124
|
+
...(errors[0].flag ? { flag: `--${errors[0].flag}` } : {}),
|
|
125
|
+
...(hint ? { hint } : {}),
|
|
126
|
+
}, format);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
outputError({
|
|
130
|
+
error: 'Validation failed',
|
|
131
|
+
code: null,
|
|
132
|
+
type,
|
|
133
|
+
errors: errors.map((e) => ({
|
|
134
|
+
message: e.message,
|
|
135
|
+
...(e.flag ? { flag: `--${e.flag}` } : {}),
|
|
136
|
+
})),
|
|
137
|
+
...(hint ? { hint } : {}),
|
|
138
|
+
}, format);
|
|
139
|
+
}
|
|
140
|
+
this.exit(2);
|
|
141
|
+
}
|
|
111
142
|
/**
|
|
112
143
|
* Get client flags for the HTTP client.
|
|
113
144
|
*/
|
|
@@ -234,7 +265,7 @@ export class BaseCommand extends Command {
|
|
|
234
265
|
if (err instanceof TokenNotFoundError) {
|
|
235
266
|
const format = this.getOutputFormat();
|
|
236
267
|
if (format === 'json' || !process.stderr.isTTY) {
|
|
237
|
-
outputError({ error: 'Token not found', type: 'PACHCA_AUTH_ERROR', code: null }, format);
|
|
268
|
+
outputError({ error: 'Token not found', type: 'PACHCA_AUTH_ERROR', code: null, hint: 'pachca auth login --token <your-token>' }, format);
|
|
238
269
|
}
|
|
239
270
|
else {
|
|
240
271
|
process.stderr.write(`✗ Токен не найден. Войдите в аккаунт:\n\n`);
|
|
@@ -247,11 +278,10 @@ export class BaseCommand extends Command {
|
|
|
247
278
|
this.exit(3);
|
|
248
279
|
}
|
|
249
280
|
if (err instanceof ProfileNotFoundError) {
|
|
250
|
-
outputError({ error: `Profile "${err.profileName}" not found`, type: 'PACHCA_USAGE_ERROR', code: null }, this.getOutputFormat());
|
|
281
|
+
outputError({ error: `Profile "${err.profileName}" not found`, type: 'PACHCA_USAGE_ERROR', code: null, hint: 'pachca auth list' }, this.getOutputFormat());
|
|
251
282
|
this.exit(2);
|
|
252
283
|
}
|
|
253
284
|
// Default oclif error handling
|
|
254
285
|
throw err;
|
|
255
286
|
}
|
|
256
287
|
}
|
|
257
|
-
//# sourceMappingURL=base-command.js.map
|
package/dist/client.js
CHANGED
|
@@ -5,11 +5,27 @@ import { pipeline } from 'node:stream/promises';
|
|
|
5
5
|
import { spinner } from '@clack/prompts';
|
|
6
6
|
import ansis from 'ansis';
|
|
7
7
|
import { isInteractive } from './utils.js';
|
|
8
|
-
const
|
|
8
|
+
const DEFAULT_BASE_URL = 'https://api.pachca.com/api/shared/v1';
|
|
9
|
+
function getBaseUrl() {
|
|
10
|
+
const envUrl = process.env.PACHCA_API_URL;
|
|
11
|
+
if (!envUrl)
|
|
12
|
+
return DEFAULT_BASE_URL;
|
|
13
|
+
try {
|
|
14
|
+
const parsed = new URL(envUrl);
|
|
15
|
+
if (parsed.protocol !== 'https:' && parsed.hostname !== 'localhost' && parsed.hostname !== '127.0.0.1') {
|
|
16
|
+
process.stderr.write('Warning: PACHCA_API_URL uses non-HTTPS protocol\n');
|
|
17
|
+
}
|
|
18
|
+
return envUrl.replace(/\/+$/, '');
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
process.stderr.write(`Warning: invalid PACHCA_API_URL, using default\n`);
|
|
22
|
+
return DEFAULT_BASE_URL;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
9
25
|
const MAX_RETRIES = 3;
|
|
10
26
|
const DEFAULT_TIMEOUT = 30;
|
|
11
27
|
function buildUrl(apiPath, query) {
|
|
12
|
-
const url = new URL(apiPath.startsWith('/') ? `${
|
|
28
|
+
const url = new URL(apiPath.startsWith('/') ? `${getBaseUrl()}${apiPath}` : `${getBaseUrl()}/${apiPath}`);
|
|
13
29
|
if (query) {
|
|
14
30
|
for (const [key, value] of Object.entries(query)) {
|
|
15
31
|
if (value !== undefined) {
|
|
@@ -184,14 +200,32 @@ function createApiError(status, body, requestId) {
|
|
|
184
200
|
request_id: requestId,
|
|
185
201
|
});
|
|
186
202
|
}
|
|
187
|
-
// ApiError format: {errors: [{message
|
|
203
|
+
// ApiError format: {errors: [{key, value, message, code, payload}]}
|
|
188
204
|
if (isRecord(body) && Array.isArray(body.errors) && body.errors.length > 0) {
|
|
189
|
-
const
|
|
205
|
+
const apiErrors = body.errors;
|
|
206
|
+
const errorType = status === 422 ? 'PACHCA_VALIDATION_ERROR' : 'PACHCA_API_ERROR';
|
|
207
|
+
if (apiErrors.length === 1) {
|
|
208
|
+
const e = apiErrors[0];
|
|
209
|
+
return new ApiError({
|
|
210
|
+
error: e.key ? `${e.key}: ${e.message || `HTTP ${status}`}` : (e.message || `HTTP ${status}`),
|
|
211
|
+
code: status,
|
|
212
|
+
type: errorType,
|
|
213
|
+
request_id: requestId,
|
|
214
|
+
...(e.key ? { field: e.key } : {}),
|
|
215
|
+
...(e.code ? { validation_code: e.code } : {}),
|
|
216
|
+
});
|
|
217
|
+
}
|
|
190
218
|
return new ApiError({
|
|
191
|
-
error:
|
|
219
|
+
error: 'Validation failed',
|
|
192
220
|
code: status,
|
|
193
|
-
type:
|
|
221
|
+
type: errorType,
|
|
194
222
|
request_id: requestId,
|
|
223
|
+
errors: apiErrors.map((e) => ({
|
|
224
|
+
...(e.key ? { field: e.key } : {}),
|
|
225
|
+
message: e.message || '',
|
|
226
|
+
...(e.code ? { code: e.code } : {}),
|
|
227
|
+
...(e.value !== undefined && e.value !== null ? { value: e.value } : {}),
|
|
228
|
+
})),
|
|
195
229
|
});
|
|
196
230
|
}
|
|
197
231
|
// Fallback
|
|
@@ -273,4 +307,3 @@ function isRecord(value) {
|
|
|
273
307
|
function sleep(ms) {
|
|
274
308
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
275
309
|
}
|
|
276
|
-
//# sourceMappingURL=client.js.map
|
package/dist/commands/api.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Args, Flags } from '@oclif/core';
|
|
|
3
3
|
import { BaseCommand } from '../base-command.js';
|
|
4
4
|
import { outputError } from '../output.js';
|
|
5
5
|
export default class Api extends BaseCommand {
|
|
6
|
-
static description = '
|
|
6
|
+
static description = 'Произвольный запрос к API';
|
|
7
7
|
static examples = [
|
|
8
8
|
'<%= config.bin %> api GET /messages --query chat_id=123',
|
|
9
9
|
'<%= config.bin %> api POST /messages -F message[chat_id]=12345 -f message[content]="Привет"',
|
|
@@ -209,4 +209,3 @@ export function parseTypedValue(value) {
|
|
|
209
209
|
}
|
|
210
210
|
return value;
|
|
211
211
|
}
|
|
212
|
-
//# sourceMappingURL=api.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command.js';
|
|
2
2
|
import { listProfiles, getActiveProfile } from '../../profiles.js';
|
|
3
3
|
export default class AuthList extends BaseCommand {
|
|
4
|
-
static description = '
|
|
4
|
+
static description = 'Список сохранённых профилей';
|
|
5
5
|
static examples = [
|
|
6
6
|
'<%= config.bin %> auth list',
|
|
7
7
|
'<%= config.bin %> auth list -o json',
|
|
@@ -36,4 +36,3 @@ export default class AuthList extends BaseCommand {
|
|
|
36
36
|
this.output(entries);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -5,7 +5,7 @@ import { setProfile, setActiveProfile, getActiveProfile } from '../../profiles.j
|
|
|
5
5
|
import { ApiError, request } from '../../client.js';
|
|
6
6
|
import { outputError } from '../../output.js';
|
|
7
7
|
export default class AuthLogin extends BaseCommand {
|
|
8
|
-
static description = '
|
|
8
|
+
static description = 'Авторизация и сохранение токена';
|
|
9
9
|
static examples = [
|
|
10
10
|
'<%= config.bin %> auth login',
|
|
11
11
|
'<%= config.bin %> auth login --profile personal',
|
|
@@ -138,4 +138,3 @@ export default class AuthLogin extends BaseCommand {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
//# sourceMappingURL=login.js.map
|
|
@@ -4,7 +4,7 @@ import { BaseCommand } from '../../base-command.js';
|
|
|
4
4
|
import { listProfiles, deleteProfile } from '../../profiles.js';
|
|
5
5
|
import { outputError } from '../../output.js';
|
|
6
6
|
export default class AuthLogout extends BaseCommand {
|
|
7
|
-
static description = '
|
|
7
|
+
static description = 'Удаление сохранённого профиля';
|
|
8
8
|
static examples = [
|
|
9
9
|
'<%= config.bin %> auth logout bot-notify',
|
|
10
10
|
'<%= config.bin %> auth logout',
|
|
@@ -78,4 +78,3 @@ export default class AuthLogout extends BaseCommand {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
//# sourceMappingURL=logout.js.map
|
|
@@ -4,7 +4,7 @@ import { getActiveProfile, getProfile, setProfile } from '../../profiles.js';
|
|
|
4
4
|
import { request } from '../../client.js';
|
|
5
5
|
import { outputError } from '../../output.js';
|
|
6
6
|
export default class AuthRefresh extends BaseCommand {
|
|
7
|
-
static description = '
|
|
7
|
+
static description = 'Обновление кешированных разрешений профиля';
|
|
8
8
|
static examples = [
|
|
9
9
|
'<%= config.bin %> auth refresh bot-support',
|
|
10
10
|
'<%= config.bin %> auth refresh',
|
|
@@ -65,4 +65,3 @@ export default class AuthRefresh extends BaseCommand {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
//# sourceMappingURL=refresh.js.map
|
|
@@ -2,7 +2,7 @@ import { BaseCommand } from '../../base-command.js';
|
|
|
2
2
|
import { getActiveProfile, getProfile } from '../../profiles.js';
|
|
3
3
|
import { outputError } from '../../output.js';
|
|
4
4
|
export default class AuthStatus extends BaseCommand {
|
|
5
|
-
static description = '
|
|
5
|
+
static description = 'Статус текущего профиля';
|
|
6
6
|
static examples = [
|
|
7
7
|
'<%= config.bin %> auth status',
|
|
8
8
|
'<%= config.bin %> auth status -o json',
|
|
@@ -48,4 +48,3 @@ export default class AuthStatus extends BaseCommand {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
//# sourceMappingURL=status.js.map
|
|
@@ -3,7 +3,7 @@ import { BaseCommand } from '../../base-command.js';
|
|
|
3
3
|
import { listProfiles, setActiveProfile } from '../../profiles.js';
|
|
4
4
|
import { outputError } from '../../output.js';
|
|
5
5
|
export default class AuthSwitch extends BaseCommand {
|
|
6
|
-
static description = '
|
|
6
|
+
static description = 'Переключение активного профиля';
|
|
7
7
|
static examples = [
|
|
8
8
|
'<%= config.bin %> auth switch bot-support',
|
|
9
9
|
];
|
|
@@ -34,4 +34,3 @@ export default class AuthSwitch extends BaseCommand {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=switch.js.map
|
|
@@ -12,7 +12,7 @@ export default class BotsRemoveEvent extends BaseCommand {
|
|
|
12
12
|
static apiPath = "/webhooks/events/{id}";
|
|
13
13
|
static args = {
|
|
14
14
|
id: Args.string({
|
|
15
|
-
description: "Идентификатор события",
|
|
15
|
+
description: "Идентификатор события (pachca bots list)",
|
|
16
16
|
required: true,
|
|
17
17
|
}),
|
|
18
18
|
};
|
|
@@ -28,8 +28,7 @@ export default class BotsRemoveEvent extends BaseCommand {
|
|
|
28
28
|
this.parsedFlags = flags;
|
|
29
29
|
if (!flags.force) {
|
|
30
30
|
if (!this.isInteractive()) {
|
|
31
|
-
|
|
32
|
-
this.exit(2);
|
|
31
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca bots remove-event <id> --force" });
|
|
33
32
|
}
|
|
34
33
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
35
34
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -45,4 +44,3 @@ export default class BotsRemoveEvent extends BaseCommand {
|
|
|
45
44
|
this.success('Удалено');
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
//# sourceMappingURL=remove-event.js.map
|
|
@@ -11,9 +11,10 @@ export default class BotsUpdate extends BaseCommand {
|
|
|
11
11
|
static apiMethod = "PUT";
|
|
12
12
|
static apiPath = "/bots/{id}";
|
|
13
13
|
static defaultColumns = ["id"];
|
|
14
|
+
static requiredFlags = ["webhook"];
|
|
14
15
|
static args = {
|
|
15
16
|
id: Args.integer({
|
|
16
|
-
description: "Идентификатор бота",
|
|
17
|
+
description: "Идентификатор бота (pachca bots list)",
|
|
17
18
|
required: true,
|
|
18
19
|
}),
|
|
19
20
|
};
|
|
@@ -49,10 +50,7 @@ export default class BotsUpdate extends BaseCommand {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
52
|
-
|
|
53
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
54
|
-
}
|
|
55
|
-
this.exit(2);
|
|
53
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --webhook <string>. pachca introspect bots update" });
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
56
|
this.checkScope("bots:write");
|
|
@@ -66,8 +64,7 @@ export default class BotsUpdate extends BaseCommand {
|
|
|
66
64
|
delete inner[k];
|
|
67
65
|
}
|
|
68
66
|
if (Object.keys(inner).length === 0) {
|
|
69
|
-
|
|
70
|
-
return;
|
|
67
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
71
68
|
}
|
|
72
69
|
const { data } = await this.apiRequest({
|
|
73
70
|
method: 'PUT',
|
|
@@ -79,4 +76,3 @@ export default class BotsUpdate extends BaseCommand {
|
|
|
79
76
|
this.output(result);
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
1
2
|
import { BaseCommand } from '../base-command.js';
|
|
2
3
|
export default class Changelog extends BaseCommand {
|
|
3
|
-
static description = '
|
|
4
|
+
static description = 'История изменений CLI';
|
|
4
5
|
static examples = [
|
|
5
6
|
'<%= config.bin %> changelog',
|
|
6
7
|
'<%= config.bin %> changelog -o json',
|
|
@@ -14,7 +15,7 @@ export default class Changelog extends BaseCommand {
|
|
|
14
15
|
let entries = [];
|
|
15
16
|
try {
|
|
16
17
|
const data = await import('../data/changelog.json', { with: { type: 'json' } });
|
|
17
|
-
entries = (data.default || data);
|
|
18
|
+
entries = (data.default || data).filter((e) => e.version !== '0.0.0');
|
|
18
19
|
}
|
|
19
20
|
catch {
|
|
20
21
|
entries = [];
|
|
@@ -28,6 +29,18 @@ export default class Changelog extends BaseCommand {
|
|
|
28
29
|
process.stdout.write('Нет записей в changelog.\n');
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
32
|
+
// Sort by version descending (newest first)
|
|
33
|
+
entries.sort((a, b) => {
|
|
34
|
+
const av = semver.valid(a.version);
|
|
35
|
+
const bv = semver.valid(b.version);
|
|
36
|
+
if (av && bv)
|
|
37
|
+
return semver.rcompare(av, bv);
|
|
38
|
+
if (av)
|
|
39
|
+
return -1;
|
|
40
|
+
if (bv)
|
|
41
|
+
return 1;
|
|
42
|
+
return 0;
|
|
43
|
+
});
|
|
31
44
|
for (const entry of entries) {
|
|
32
45
|
process.stdout.write(`${entry.version} (${entry.date})\n`);
|
|
33
46
|
for (const change of entry.changes) {
|
|
@@ -37,4 +50,3 @@ export default class Changelog extends BaseCommand {
|
|
|
37
50
|
}
|
|
38
51
|
}
|
|
39
52
|
}
|
|
40
|
-
//# sourceMappingURL=changelog.js.map
|
|
@@ -12,7 +12,7 @@ export default class ChatsArchive extends BaseCommand {
|
|
|
12
12
|
static apiPath = "/chats/{id}/archive";
|
|
13
13
|
static args = {
|
|
14
14
|
id: Args.integer({
|
|
15
|
-
description: "Идентификатор чата",
|
|
15
|
+
description: "Идентификатор чата (pachca chats list)",
|
|
16
16
|
required: true,
|
|
17
17
|
}),
|
|
18
18
|
};
|
|
@@ -32,4 +32,3 @@ export default class ChatsArchive extends BaseCommand {
|
|
|
32
32
|
this.output(result);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=archive.js.map
|
|
@@ -13,6 +13,7 @@ export default class ChatsCreate extends BaseCommand {
|
|
|
13
13
|
static apiMethod = "POST";
|
|
14
14
|
static apiPath = "/chats";
|
|
15
15
|
static defaultColumns = ["id", "name", "created_at", "owner_id", "channel"];
|
|
16
|
+
static requiredFlags = ["name"];
|
|
16
17
|
static args = {};
|
|
17
18
|
static flags = {
|
|
18
19
|
...BaseCommand.baseFlags,
|
|
@@ -60,10 +61,7 @@ export default class ChatsCreate extends BaseCommand {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
else {
|
|
63
|
-
|
|
64
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
65
|
-
}
|
|
66
|
-
this.exit(2);
|
|
64
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --name <string>. pachca introspect chats create" });
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
this.checkScope("chats:create");
|
|
@@ -90,4 +88,3 @@ export default class ChatsCreate extends BaseCommand {
|
|
|
90
88
|
this.output(result);
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -12,7 +12,7 @@ export default class ChatsGet extends BaseCommand {
|
|
|
12
12
|
static defaultColumns = ["id", "name", "created_at", "owner_id", "channel"];
|
|
13
13
|
static args = {
|
|
14
14
|
id: Args.integer({
|
|
15
|
-
description: "Идентификатор чата",
|
|
15
|
+
description: "Идентификатор чата (pachca chats list)",
|
|
16
16
|
required: true,
|
|
17
17
|
}),
|
|
18
18
|
};
|
|
@@ -32,4 +32,3 @@ export default class ChatsGet extends BaseCommand {
|
|
|
32
32
|
this.output(result);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -11,7 +11,7 @@ export default class ChatsUnarchive extends BaseCommand {
|
|
|
11
11
|
static apiPath = "/chats/{id}/unarchive";
|
|
12
12
|
static args = {
|
|
13
13
|
id: Args.integer({
|
|
14
|
-
description: "Идентификатор чата",
|
|
14
|
+
description: "Идентификатор чата (pachca chats list)",
|
|
15
15
|
required: true,
|
|
16
16
|
}),
|
|
17
17
|
};
|
|
@@ -31,4 +31,3 @@ export default class ChatsUnarchive extends BaseCommand {
|
|
|
31
31
|
this.output(result);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
//# sourceMappingURL=unarchive.js.map
|
|
@@ -12,7 +12,7 @@ export default class ChatsUpdate extends BaseCommand {
|
|
|
12
12
|
static defaultColumns = ["id", "name", "created_at", "owner_id", "channel"];
|
|
13
13
|
static args = {
|
|
14
14
|
id: Args.integer({
|
|
15
|
-
description: "Идентификатор чата",
|
|
15
|
+
description: "Идентификатор чата (pachca chats list)",
|
|
16
16
|
required: true,
|
|
17
17
|
}),
|
|
18
18
|
};
|
|
@@ -41,8 +41,7 @@ export default class ChatsUpdate extends BaseCommand {
|
|
|
41
41
|
delete inner[k];
|
|
42
42
|
}
|
|
43
43
|
if (Object.keys(inner).length === 0) {
|
|
44
|
-
|
|
45
|
-
return;
|
|
44
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
46
45
|
}
|
|
47
46
|
const { data } = await this.apiRequest({
|
|
48
47
|
method: 'PUT',
|
|
@@ -54,4 +53,3 @@ export default class ChatsUpdate extends BaseCommand {
|
|
|
54
53
|
this.output(result);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -3,7 +3,7 @@ import { BaseCommand } from '../base-command.js';
|
|
|
3
3
|
import { resolveToken, TokenNotFoundError } from '../profiles.js';
|
|
4
4
|
import { request } from '../client.js';
|
|
5
5
|
export default class Commands extends BaseCommand {
|
|
6
|
-
static description = '
|
|
6
|
+
static description = 'Список всех команд';
|
|
7
7
|
static examples = [
|
|
8
8
|
'<%= config.bin %> commands',
|
|
9
9
|
'<%= config.bin %> commands --available',
|
|
@@ -63,10 +63,10 @@ export default class Commands extends BaseCommand {
|
|
|
63
63
|
.filter((cmd) => !cmd.scope || tokenScopes.includes(cmd.scope))
|
|
64
64
|
.map((cmd) => ({
|
|
65
65
|
command: cmd.command,
|
|
66
|
+
summary: cmd.summary,
|
|
66
67
|
scope: cmd.scope,
|
|
67
68
|
plan: cmd.plan,
|
|
68
69
|
}));
|
|
69
70
|
this.output(entries);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
//# sourceMappingURL=commands.js.map
|
|
@@ -5,13 +5,13 @@ import * as clack from '@clack/prompts';
|
|
|
5
5
|
export default class CommonCustomProperties extends BaseCommand {
|
|
6
6
|
static description = "Список дополнительных полей";
|
|
7
7
|
static examples = [
|
|
8
|
-
"Создать напоминание:\n $ pachca common custom-properties",
|
|
9
8
|
"Получить кастомные поля профиля:\n $ pachca common custom-properties"
|
|
10
9
|
];
|
|
11
10
|
static scope = "custom_properties:read";
|
|
12
11
|
static apiMethod = "GET";
|
|
13
12
|
static apiPath = "/custom_properties";
|
|
14
13
|
static defaultColumns = ["id", "name", "data_type"];
|
|
14
|
+
static requiredFlags = ["entity-type"];
|
|
15
15
|
static args = {};
|
|
16
16
|
static flags = {
|
|
17
17
|
...BaseCommand.baseFlags,
|
|
@@ -46,10 +46,7 @@ export default class CommonCustomProperties extends BaseCommand {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
|
|
50
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
51
|
-
}
|
|
52
|
-
this.exit(2);
|
|
49
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --entity-type <string>. pachca introspect common custom-properties" });
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
this.checkScope("custom_properties:read");
|
|
@@ -65,4 +62,3 @@ export default class CommonCustomProperties extends BaseCommand {
|
|
|
65
62
|
this.output(result);
|
|
66
63
|
}
|
|
67
64
|
}
|
|
68
|
-
//# sourceMappingURL=custom-properties.js.map
|
|
@@ -8,6 +8,7 @@ export default class CommonDirectUrl extends BaseCommand {
|
|
|
8
8
|
static description = "Загрузка файла";
|
|
9
9
|
static apiMethod = "POST";
|
|
10
10
|
static apiPath = "/direct_url";
|
|
11
|
+
static requiredFlags = ["content-disposition", "acl", "policy", "x-amz-credential", "x-amz-algorithm", "x-amz-date", "x-amz-signature", "key"];
|
|
11
12
|
static args = {};
|
|
12
13
|
static flags = {
|
|
13
14
|
...BaseCommand.baseFlags,
|
|
@@ -72,10 +73,7 @@ export default class CommonDirectUrl extends BaseCommand {
|
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
else {
|
|
75
|
-
|
|
76
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
77
|
-
}
|
|
78
|
-
this.exit(2);
|
|
76
|
+
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 common direct-url" });
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
let formData;
|
|
@@ -119,4 +117,3 @@ export default class CommonDirectUrl extends BaseCommand {
|
|
|
119
117
|
this.output(result);
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
|
-
//# sourceMappingURL=direct-url.js.map
|
|
@@ -11,6 +11,7 @@ export default class CommonRequestExport extends BaseCommand {
|
|
|
11
11
|
static plan = "corporation";
|
|
12
12
|
static apiMethod = "POST";
|
|
13
13
|
static apiPath = "/chats/exports";
|
|
14
|
+
static requiredFlags = ["start-at", "end-at", "webhook-url"];
|
|
14
15
|
static args = {};
|
|
15
16
|
static flags = {
|
|
16
17
|
...BaseCommand.baseFlags,
|
|
@@ -59,10 +60,7 @@ export default class CommonRequestExport extends BaseCommand {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
else {
|
|
62
|
-
|
|
63
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
64
|
-
}
|
|
65
|
-
this.exit(2);
|
|
63
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --start-at <string>, --end-at <string>, --webhook-url <string>. pachca introspect common request-export" });
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
66
|
this.checkScope("chat_exports:write");
|
|
@@ -88,4 +86,3 @@ export default class CommonRequestExport extends BaseCommand {
|
|
|
88
86
|
this.output(result);
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
//# sourceMappingURL=request-export.js.map
|
|
@@ -2,7 +2,7 @@ import { Args } from '@oclif/core';
|
|
|
2
2
|
import { BaseCommand } from '../../base-command.js';
|
|
3
3
|
import { getConfigValue } from '../../profiles.js';
|
|
4
4
|
export default class ConfigGet extends BaseCommand {
|
|
5
|
-
static description = '
|
|
5
|
+
static description = 'Получение значения конфигурации';
|
|
6
6
|
static examples = [
|
|
7
7
|
'<%= config.bin %> config get defaults.output',
|
|
8
8
|
];
|
|
@@ -25,4 +25,3 @@ export default class ConfigGet extends BaseCommand {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command.js';
|
|
2
2
|
import { readConfig } from '../../profiles.js';
|
|
3
3
|
export default class ConfigList extends BaseCommand {
|
|
4
|
-
static description = '
|
|
4
|
+
static description = 'Список всех настроек';
|
|
5
5
|
static examples = [
|
|
6
6
|
'<%= config.bin %> config list',
|
|
7
7
|
'<%= config.bin %> config list -o json',
|
|
@@ -46,4 +46,3 @@ function flattenConfig(obj, exclude = [], prefix = '') {
|
|
|
46
46
|
}
|
|
47
47
|
return entries;
|
|
48
48
|
}
|
|
49
|
-
//# sourceMappingURL=list.js.map
|