@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
|
@@ -2,7 +2,7 @@ import { Args } from '@oclif/core';
|
|
|
2
2
|
import { BaseCommand } from '../../base-command.js';
|
|
3
3
|
import { setConfigValue } from '../../profiles.js';
|
|
4
4
|
export default class ConfigSet extends BaseCommand {
|
|
5
|
-
static description = '
|
|
5
|
+
static description = 'Установка значения конфигурации';
|
|
6
6
|
static examples = [
|
|
7
7
|
'<%= config.bin %> config set defaults.output json',
|
|
8
8
|
'<%= config.bin %> config set defaults.timeout 60',
|
|
@@ -27,4 +27,3 @@ export default class ConfigSet extends BaseCommand {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=set.js.map
|
package/dist/commands/doctor.js
CHANGED
|
@@ -4,7 +4,7 @@ import semver from 'semver';
|
|
|
4
4
|
import { BaseCommand } from '../base-command.js';
|
|
5
5
|
import { getActiveProfile, getProfile, getConfigFilePath, getConfigFilePermissions, } from '../profiles.js';
|
|
6
6
|
export default class Doctor extends BaseCommand {
|
|
7
|
-
static description = '
|
|
7
|
+
static description = 'Диагностика окружения: Node.js, сеть, токен, конфигурация';
|
|
8
8
|
static examples = [
|
|
9
9
|
'<%= config.bin %> doctor',
|
|
10
10
|
'<%= config.bin %> doctor -o json',
|
|
@@ -172,4 +172,3 @@ export default class Doctor extends BaseCommand {
|
|
|
172
172
|
process.stderr.write(`${icons[status]} ${message}\n`);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
//# sourceMappingURL=doctor.js.map
|
|
@@ -12,6 +12,7 @@ export default class GroupTagsCreate extends BaseCommand {
|
|
|
12
12
|
static apiMethod = "POST";
|
|
13
13
|
static apiPath = "/group_tags";
|
|
14
14
|
static defaultColumns = ["id", "name", "users_count"];
|
|
15
|
+
static requiredFlags = ["name"];
|
|
15
16
|
static args = {};
|
|
16
17
|
static flags = {
|
|
17
18
|
...BaseCommand.baseFlags,
|
|
@@ -45,10 +46,7 @@ export default class GroupTagsCreate extends BaseCommand {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
else {
|
|
48
|
-
|
|
49
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
50
|
-
}
|
|
51
|
-
this.exit(2);
|
|
49
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --name <string>. pachca introspect group-tags create" });
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
this.checkScope("group_tags:write");
|
|
@@ -71,4 +69,3 @@ export default class GroupTagsCreate extends BaseCommand {
|
|
|
71
69
|
this.output(result);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -25,8 +25,7 @@ export default class GroupTagsDelete extends BaseCommand {
|
|
|
25
25
|
this.parsedFlags = flags;
|
|
26
26
|
if (!flags.force) {
|
|
27
27
|
if (!this.isInteractive()) {
|
|
28
|
-
|
|
29
|
-
this.exit(2);
|
|
28
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca group-tags delete <id> --force" });
|
|
30
29
|
}
|
|
31
30
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
32
31
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -42,4 +41,3 @@ export default class GroupTagsDelete extends BaseCommand {
|
|
|
42
41
|
this.success('Удалено');
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -8,6 +8,7 @@ export default class GroupTagsUpdate extends BaseCommand {
|
|
|
8
8
|
static apiMethod = "PUT";
|
|
9
9
|
static apiPath = "/group_tags/{id}";
|
|
10
10
|
static defaultColumns = ["id", "name", "users_count"];
|
|
11
|
+
static requiredFlags = ["name"];
|
|
11
12
|
static args = {
|
|
12
13
|
id: Args.integer({
|
|
13
14
|
description: "Идентификатор тега",
|
|
@@ -46,10 +47,7 @@ export default class GroupTagsUpdate extends BaseCommand {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
else {
|
|
49
|
-
|
|
50
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
51
|
-
}
|
|
52
|
-
this.exit(2);
|
|
50
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --name <string>. pachca introspect group-tags update" });
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
this.checkScope("group_tags:write");
|
|
@@ -63,8 +61,7 @@ export default class GroupTagsUpdate extends BaseCommand {
|
|
|
63
61
|
delete inner[k];
|
|
64
62
|
}
|
|
65
63
|
if (Object.keys(inner).length === 0) {
|
|
66
|
-
|
|
67
|
-
return;
|
|
64
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
68
65
|
}
|
|
69
66
|
const { data } = await this.apiRequest({
|
|
70
67
|
method: 'PUT',
|
|
@@ -76,4 +73,3 @@ export default class GroupTagsUpdate extends BaseCommand {
|
|
|
76
73
|
this.output(result);
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
|
-
//# sourceMappingURL=update.js.map
|
package/dist/commands/guide.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { BaseCommand } from '../base-command.js';
|
|
3
3
|
export default class Guide extends BaseCommand {
|
|
4
|
-
static description = '
|
|
4
|
+
static description = 'Поиск сценариев использования';
|
|
5
5
|
static examples = [
|
|
6
6
|
'<%= config.bin %> guide "отправить файл"',
|
|
7
7
|
'<%= config.bin %> guide "создать бота"',
|
|
@@ -74,13 +74,14 @@ export default class Guide extends BaseCommand {
|
|
|
74
74
|
process.stdout.write(` Сценарий: ${w.title} (${w.skill})\n\n`);
|
|
75
75
|
for (let i = 0; i < w.steps.length; i++) {
|
|
76
76
|
const step = w.steps[i];
|
|
77
|
-
process.stdout.write(` ${i + 1}. ${step.description}\n`);
|
|
78
77
|
if (step.command) {
|
|
79
|
-
process.stdout.write(`
|
|
78
|
+
process.stdout.write(` ${i + 1}. $ ${step.command}\n`);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
process.stdout.write(` ${i + 1}. ${step.description}\n`);
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
process.stdout.write('\n');
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
|
-
//# sourceMappingURL=guide.js.map
|
|
@@ -3,7 +3,7 @@ import * as path from 'node:path';
|
|
|
3
3
|
import { Args } from '@oclif/core';
|
|
4
4
|
import { BaseCommand } from '../base-command.js';
|
|
5
5
|
export default class Introspect extends BaseCommand {
|
|
6
|
-
static description = '
|
|
6
|
+
static description = 'Метаданные команды в машиночитаемом формате';
|
|
7
7
|
static examples = [
|
|
8
8
|
'<%= config.bin %> introspect messages create',
|
|
9
9
|
'<%= config.bin %> introspect',
|
|
@@ -51,22 +51,31 @@ export default class Introspect extends BaseCommand {
|
|
|
51
51
|
// Single command introspection
|
|
52
52
|
const cmdMeta = commands[commandId];
|
|
53
53
|
if (!cmdMeta) {
|
|
54
|
-
|
|
55
|
-
this.exit(2);
|
|
54
|
+
this.validationError([{ message: `Command not found: ${commandArgs.join(' ')}` }], { hint: 'pachca introspect', type: 'PACHCA_COMMAND_NOT_FOUND' });
|
|
56
55
|
}
|
|
56
|
+
const baseFlagNames = new Set(['output', 'columns', 'no-header', 'no-truncate', 'profile', 'token', 'quiet', 'no-color', 'verbose', 'no-input', 'dry-run', 'timeout', 'no-retry', 'json']);
|
|
57
|
+
const requiredFlagNames = new Set(cmdMeta.requiredFlags || []);
|
|
57
58
|
const flagsMeta = cmdMeta.flags;
|
|
58
59
|
const flagEntries = flagsMeta
|
|
59
60
|
? Object.entries(flagsMeta)
|
|
60
|
-
.filter(([name]) => !
|
|
61
|
+
.filter(([name]) => !baseFlagNames.has(name))
|
|
61
62
|
.map(([name, meta]) => ({
|
|
62
63
|
name,
|
|
63
64
|
type: meta.type || 'string',
|
|
64
|
-
required:
|
|
65
|
+
required: requiredFlagNames.has(name),
|
|
65
66
|
description: meta.description || '',
|
|
66
67
|
...(meta.options ? { options: meta.options } : {}),
|
|
67
68
|
...(meta.maxLength ? { maxLength: meta.maxLength } : {}),
|
|
68
69
|
}))
|
|
69
70
|
: [];
|
|
71
|
+
const argsMeta = cmdMeta.args;
|
|
72
|
+
const argEntries = argsMeta
|
|
73
|
+
? Object.entries(argsMeta).map(([name, meta]) => ({
|
|
74
|
+
name,
|
|
75
|
+
required: meta.required || false,
|
|
76
|
+
description: meta.description || '',
|
|
77
|
+
}))
|
|
78
|
+
: [];
|
|
70
79
|
const result = {
|
|
71
80
|
command: `pachca ${commandId.replace(/:/g, ' ')}`,
|
|
72
81
|
summary: cmdMeta.summary || cmdMeta.description || '',
|
|
@@ -74,9 +83,9 @@ export default class Introspect extends BaseCommand {
|
|
|
74
83
|
path: cmdMeta.apiPath || null,
|
|
75
84
|
scope: cmdMeta.scope || null,
|
|
76
85
|
plan: cmdMeta.plan || null,
|
|
86
|
+
...(argEntries.length > 0 ? { args: argEntries } : {}),
|
|
77
87
|
flags: flagEntries,
|
|
78
88
|
};
|
|
79
89
|
this.output(result);
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
|
-
//# sourceMappingURL=introspect.js.map
|
|
@@ -10,6 +10,7 @@ export default class LinkPreviewsAdd extends BaseCommand {
|
|
|
10
10
|
static scope = "link_previews:write";
|
|
11
11
|
static apiMethod = "POST";
|
|
12
12
|
static apiPath = "/messages/{id}/link_previews";
|
|
13
|
+
static requiredFlags = ["link-previews"];
|
|
13
14
|
static args = {
|
|
14
15
|
id: Args.integer({
|
|
15
16
|
description: "Идентификатор сообщения",
|
|
@@ -48,10 +49,7 @@ export default class LinkPreviewsAdd extends BaseCommand {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
else {
|
|
51
|
-
|
|
52
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
53
|
-
}
|
|
54
|
-
this.exit(2);
|
|
52
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --link-previews <string>. pachca introspect link-previews add" });
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
this.checkScope("link_previews:write");
|
|
@@ -73,4 +71,3 @@ export default class LinkPreviewsAdd extends BaseCommand {
|
|
|
73
71
|
this.output(result);
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
//# sourceMappingURL=add.js.map
|
|
@@ -7,6 +7,7 @@ export default class MembersAddGroupTags extends BaseCommand {
|
|
|
7
7
|
static scope = "chat_members:write";
|
|
8
8
|
static apiMethod = "POST";
|
|
9
9
|
static apiPath = "/chats/{id}/group_tags";
|
|
10
|
+
static requiredFlags = ["group-tag-ids"];
|
|
10
11
|
static args = {
|
|
11
12
|
id: Args.integer({
|
|
12
13
|
description: "Идентификатор чата",
|
|
@@ -45,10 +46,7 @@ export default class MembersAddGroupTags extends BaseCommand {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
else {
|
|
48
|
-
|
|
49
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
50
|
-
}
|
|
51
|
-
this.exit(2);
|
|
49
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --group-tag-ids <string>. pachca introspect members add-group-tags" });
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
this.checkScope("chat_members:write");
|
|
@@ -70,4 +68,3 @@ export default class MembersAddGroupTags extends BaseCommand {
|
|
|
70
68
|
this.output(result);
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
|
-
//# sourceMappingURL=add-group-tags.js.map
|
|
@@ -12,6 +12,7 @@ export default class MembersAdd extends BaseCommand {
|
|
|
12
12
|
static scope = "chat_members:write";
|
|
13
13
|
static apiMethod = "POST";
|
|
14
14
|
static apiPath = "/chats/{id}/members";
|
|
15
|
+
static requiredFlags = ["member-ids"];
|
|
15
16
|
static args = {
|
|
16
17
|
id: Args.integer({
|
|
17
18
|
description: "Идентификатор чата (беседа, канал или чат треда)",
|
|
@@ -54,10 +55,7 @@ export default class MembersAdd extends BaseCommand {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
else {
|
|
57
|
-
|
|
58
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
59
|
-
}
|
|
60
|
-
this.exit(2);
|
|
58
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --member-ids <string>. pachca introspect members add" });
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
this.checkScope("chat_members:write");
|
|
@@ -80,4 +78,3 @@ export default class MembersAdd extends BaseCommand {
|
|
|
80
78
|
this.output(result);
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
|
-
//# sourceMappingURL=add.js.map
|
|
@@ -28,8 +28,7 @@ export default class MembersLeave 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 members leave <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 MembersLeave extends BaseCommand {
|
|
|
45
44
|
this.success('Удалено');
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
//# sourceMappingURL=leave.js.map
|
|
@@ -13,7 +13,7 @@ export default class MembersRemoveGroupTag extends BaseCommand {
|
|
|
13
13
|
required: true,
|
|
14
14
|
}),
|
|
15
15
|
tag_id: Args.integer({
|
|
16
|
-
description: "Идентификатор тега",
|
|
16
|
+
description: "Идентификатор тега (pachca tags list)",
|
|
17
17
|
required: true,
|
|
18
18
|
}),
|
|
19
19
|
};
|
|
@@ -29,8 +29,7 @@ export default class MembersRemoveGroupTag extends BaseCommand {
|
|
|
29
29
|
this.parsedFlags = flags;
|
|
30
30
|
if (!flags.force) {
|
|
31
31
|
if (!this.isInteractive()) {
|
|
32
|
-
|
|
33
|
-
this.exit(2);
|
|
32
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca members remove-group-tag <id> <tag_id> --force" });
|
|
34
33
|
}
|
|
35
34
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
36
35
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -46,4 +45,3 @@ export default class MembersRemoveGroupTag extends BaseCommand {
|
|
|
46
45
|
this.success('Удалено');
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
//# sourceMappingURL=remove-group-tag.js.map
|
|
@@ -17,7 +17,7 @@ export default class MembersRemove extends BaseCommand {
|
|
|
17
17
|
required: true,
|
|
18
18
|
}),
|
|
19
19
|
user_id: Args.integer({
|
|
20
|
-
description: "Идентификатор пользователя",
|
|
20
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
21
21
|
required: true,
|
|
22
22
|
}),
|
|
23
23
|
};
|
|
@@ -33,8 +33,7 @@ export default class MembersRemove extends BaseCommand {
|
|
|
33
33
|
this.parsedFlags = flags;
|
|
34
34
|
if (!flags.force) {
|
|
35
35
|
if (!this.isInteractive()) {
|
|
36
|
-
|
|
37
|
-
this.exit(2);
|
|
36
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca members remove <id> <user_id> --force" });
|
|
38
37
|
}
|
|
39
38
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
40
39
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -50,4 +49,3 @@ export default class MembersRemove extends BaseCommand {
|
|
|
50
49
|
this.success('Удалено');
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
//# sourceMappingURL=remove.js.map
|
|
@@ -11,13 +11,14 @@ export default class MembersUpdate extends BaseCommand {
|
|
|
11
11
|
static scope = "chat_members:write";
|
|
12
12
|
static apiMethod = "PUT";
|
|
13
13
|
static apiPath = "/chats/{id}/members/{user_id}";
|
|
14
|
+
static requiredFlags = ["role"];
|
|
14
15
|
static args = {
|
|
15
16
|
id: Args.integer({
|
|
16
17
|
description: "Идентификатор чата",
|
|
17
18
|
required: true,
|
|
18
19
|
}),
|
|
19
20
|
user_id: Args.integer({
|
|
20
|
-
description: "Идентификатор пользователя",
|
|
21
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
21
22
|
required: true,
|
|
22
23
|
}),
|
|
23
24
|
};
|
|
@@ -53,10 +54,7 @@ export default class MembersUpdate extends BaseCommand {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
else {
|
|
56
|
-
|
|
57
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
58
|
-
}
|
|
59
|
-
this.exit(2);
|
|
57
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --role <string>. pachca introspect members update" });
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
this.checkScope("chat_members:write");
|
|
@@ -69,8 +67,7 @@ export default class MembersUpdate extends BaseCommand {
|
|
|
69
67
|
delete body[k];
|
|
70
68
|
}
|
|
71
69
|
if (Object.keys(body).length === 0) {
|
|
72
|
-
|
|
73
|
-
return;
|
|
70
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
74
71
|
}
|
|
75
72
|
const { data } = await this.apiRequest({
|
|
76
73
|
method: 'PUT',
|
|
@@ -82,4 +79,3 @@ export default class MembersUpdate extends BaseCommand {
|
|
|
82
79
|
this.output(result);
|
|
83
80
|
}
|
|
84
81
|
}
|
|
85
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -13,6 +13,7 @@ export default class MessagesCreate extends BaseCommand {
|
|
|
13
13
|
static apiMethod = "POST";
|
|
14
14
|
static apiPath = "/messages";
|
|
15
15
|
static defaultColumns = ["id", "content", "created_at", "entity_type", "entity_id"];
|
|
16
|
+
static requiredFlags = ["entity-id", "content"];
|
|
16
17
|
static args = {};
|
|
17
18
|
static flags = {
|
|
18
19
|
...BaseCommand.baseFlags,
|
|
@@ -20,7 +21,7 @@ export default class MessagesCreate extends BaseCommand {
|
|
|
20
21
|
description: "Тип сущности",
|
|
21
22
|
}),
|
|
22
23
|
'entity-id': Flags.integer({
|
|
23
|
-
description: "Идентификатор сущности",
|
|
24
|
+
description: "Идентификатор сущности (pachca chats list | pachca users list)",
|
|
24
25
|
}),
|
|
25
26
|
'content': Flags.string({
|
|
26
27
|
description: "Текст сообщения",
|
|
@@ -84,19 +85,18 @@ export default class MessagesCreate extends BaseCommand {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
else {
|
|
87
|
-
|
|
88
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
89
|
-
}
|
|
90
|
-
this.exit(2);
|
|
88
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --entity-id <integer>, --content <string>. pachca introspect messages create" });
|
|
91
89
|
}
|
|
92
90
|
}
|
|
91
|
+
const validationErrors = [];
|
|
93
92
|
if (flags['display-avatar-url'] && String(flags['display-avatar-url']).length > 255) {
|
|
94
|
-
|
|
95
|
-
this.exit(2);
|
|
93
|
+
validationErrors.push({ message: `--display-avatar-url: максимум 255 символов (передано: ${String(flags['display-avatar-url']).length})`, flag: 'display-avatar-url' });
|
|
96
94
|
}
|
|
97
95
|
if (flags['display-name'] && String(flags['display-name']).length > 255) {
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
validationErrors.push({ message: `--display-name: максимум 255 символов (передано: ${String(flags['display-name']).length})`, flag: 'display-name' });
|
|
97
|
+
}
|
|
98
|
+
if (validationErrors.length > 0) {
|
|
99
|
+
this.validationError(validationErrors);
|
|
100
100
|
}
|
|
101
101
|
this.checkScope("messages:create");
|
|
102
102
|
const body = { message: {
|
|
@@ -127,4 +127,3 @@ export default class MessagesCreate extends BaseCommand {
|
|
|
127
127
|
this.output(result);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -14,7 +14,7 @@ export default class MessagesDelete extends BaseCommand {
|
|
|
14
14
|
static apiPath = "/messages/{id}";
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор сообщения",
|
|
17
|
+
description: "Идентификатор сообщения (pachca messages list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -30,8 +30,7 @@ export default class MessagesDelete extends BaseCommand {
|
|
|
30
30
|
this.parsedFlags = flags;
|
|
31
31
|
if (!flags.force) {
|
|
32
32
|
if (!this.isInteractive()) {
|
|
33
|
-
|
|
34
|
-
this.exit(2);
|
|
33
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca messages delete <id> --force" });
|
|
35
34
|
}
|
|
36
35
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
37
36
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -47,4 +46,3 @@ export default class MessagesDelete extends BaseCommand {
|
|
|
47
46
|
this.success('Удалено');
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -14,7 +14,7 @@ export default class MessagesGet extends BaseCommand {
|
|
|
14
14
|
static defaultColumns = ["id", "content", "created_at", "entity_type", "entity_id"];
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор сообщения",
|
|
17
|
+
description: "Идентификатор сообщения (pachca messages list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -34,4 +34,3 @@ export default class MessagesGet extends BaseCommand {
|
|
|
34
34
|
this.output(result);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -13,6 +13,7 @@ export default class MessagesList extends BaseCommand {
|
|
|
13
13
|
static apiMethod = "GET";
|
|
14
14
|
static apiPath = "/messages";
|
|
15
15
|
static defaultColumns = ["id", "content", "created_at", "entity_type", "entity_id"];
|
|
16
|
+
static requiredFlags = ["chat-id"];
|
|
16
17
|
static args = {};
|
|
17
18
|
static flags = {
|
|
18
19
|
...BaseCommand.baseFlags,
|
|
@@ -59,10 +60,7 @@ export default class MessagesList 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: "Обязательные: --chat-id <integer>. pachca introspect messages list" });
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
66
|
this.checkScope("messages:read");
|
|
@@ -124,4 +122,3 @@ export default class MessagesList extends BaseCommand {
|
|
|
124
122
|
this.output(items);
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -12,7 +12,7 @@ export default class MessagesPin extends BaseCommand {
|
|
|
12
12
|
static apiPath = "/messages/{id}/pin";
|
|
13
13
|
static args = {
|
|
14
14
|
id: Args.integer({
|
|
15
|
-
description: "Идентификатор сообщения",
|
|
15
|
+
description: "Идентификатор сообщения (pachca messages list)",
|
|
16
16
|
required: true,
|
|
17
17
|
}),
|
|
18
18
|
};
|
|
@@ -32,4 +32,3 @@ export default class MessagesPin extends BaseCommand {
|
|
|
32
32
|
this.output(result);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=pin.js.map
|
|
@@ -13,7 +13,7 @@ export default class MessagesUnpin extends BaseCommand {
|
|
|
13
13
|
static apiPath = "/messages/{id}/pin";
|
|
14
14
|
static args = {
|
|
15
15
|
id: Args.integer({
|
|
16
|
-
description: "Идентификатор сообщения",
|
|
16
|
+
description: "Идентификатор сообщения (pachca messages list)",
|
|
17
17
|
required: true,
|
|
18
18
|
}),
|
|
19
19
|
};
|
|
@@ -29,8 +29,7 @@ export default class MessagesUnpin extends BaseCommand {
|
|
|
29
29
|
this.parsedFlags = flags;
|
|
30
30
|
if (!flags.force) {
|
|
31
31
|
if (!this.isInteractive()) {
|
|
32
|
-
|
|
33
|
-
this.exit(2);
|
|
32
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca messages unpin <id> --force" });
|
|
34
33
|
}
|
|
35
34
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
36
35
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -46,4 +45,3 @@ export default class MessagesUnpin extends BaseCommand {
|
|
|
46
45
|
this.success('Удалено');
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
//# sourceMappingURL=unpin.js.map
|
|
@@ -14,7 +14,7 @@ export default class MessagesUpdate extends BaseCommand {
|
|
|
14
14
|
static defaultColumns = ["id", "content", "created_at", "entity_type", "entity_id"];
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор сообщения",
|
|
17
|
+
description: "Идентификатор сообщения (pachca messages list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -62,8 +62,7 @@ export default class MessagesUpdate extends BaseCommand {
|
|
|
62
62
|
delete inner[k];
|
|
63
63
|
}
|
|
64
64
|
if (Object.keys(inner).length === 0) {
|
|
65
|
-
|
|
66
|
-
return;
|
|
65
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
67
66
|
}
|
|
68
67
|
const { data } = await this.apiRequest({
|
|
69
68
|
method: 'PUT',
|
|
@@ -75,4 +74,3 @@ export default class MessagesUpdate extends BaseCommand {
|
|
|
75
74
|
this.output(result);
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -24,8 +24,7 @@ export default class ProfileDeleteStatus extends BaseCommand {
|
|
|
24
24
|
this.parsedFlags = flags;
|
|
25
25
|
if (!flags.force) {
|
|
26
26
|
if (!this.isInteractive()) {
|
|
27
|
-
|
|
28
|
-
this.exit(2);
|
|
27
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca profile delete-status --force" });
|
|
29
28
|
}
|
|
30
29
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
31
30
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -41,4 +40,3 @@ export default class ProfileDeleteStatus extends BaseCommand {
|
|
|
41
40
|
this.success('Удалено');
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
//# sourceMappingURL=delete-status.js.map
|