@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
|
@@ -12,6 +12,7 @@ export default class ProfileUpdateStatus extends BaseCommand {
|
|
|
12
12
|
static apiMethod = "PUT";
|
|
13
13
|
static apiPath = "/profile/status";
|
|
14
14
|
static defaultColumns = ["title", "emoji", "expires_at", "is_away"];
|
|
15
|
+
static requiredFlags = ["emoji", "title"];
|
|
15
16
|
static args = {};
|
|
16
17
|
static flags = {
|
|
17
18
|
...BaseCommand.baseFlags,
|
|
@@ -59,15 +60,15 @@ export default class ProfileUpdateStatus 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: "Обязательные: --emoji <string>, --title <string>. pachca introspect profile update-status" });
|
|
66
64
|
}
|
|
67
65
|
}
|
|
66
|
+
const validationErrors = [];
|
|
68
67
|
if (flags['away-message'] && String(flags['away-message']).length > 1024) {
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
validationErrors.push({ message: `--away-message: максимум 1024 символов (передано: ${String(flags['away-message']).length})`, flag: 'away-message' });
|
|
69
|
+
}
|
|
70
|
+
if (validationErrors.length > 0) {
|
|
71
|
+
this.validationError(validationErrors);
|
|
71
72
|
}
|
|
72
73
|
this.checkScope("profile_status:write");
|
|
73
74
|
const body = { status: {
|
|
@@ -84,8 +85,7 @@ export default class ProfileUpdateStatus extends BaseCommand {
|
|
|
84
85
|
delete inner[k];
|
|
85
86
|
}
|
|
86
87
|
if (Object.keys(inner).length === 0) {
|
|
87
|
-
|
|
88
|
-
return;
|
|
88
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
89
89
|
}
|
|
90
90
|
const { data } = await this.apiRequest({
|
|
91
91
|
method: 'PUT',
|
|
@@ -97,4 +97,3 @@ export default class ProfileUpdateStatus extends BaseCommand {
|
|
|
97
97
|
this.output(result);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
//# sourceMappingURL=update-status.js.map
|
|
@@ -12,6 +12,7 @@ export default class ReactionsAdd extends BaseCommand {
|
|
|
12
12
|
static apiMethod = "POST";
|
|
13
13
|
static apiPath = "/messages/{id}/reactions";
|
|
14
14
|
static defaultColumns = ["name", "created_at", "user_id", "code"];
|
|
15
|
+
static requiredFlags = ["code"];
|
|
15
16
|
static args = {
|
|
16
17
|
id: Args.integer({
|
|
17
18
|
description: "Идентификатор сообщения",
|
|
@@ -53,10 +54,7 @@ export default class ReactionsAdd 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: "Обязательные: --code <string>. pachca introspect reactions add" });
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
this.checkScope("reactions:write");
|
|
@@ -79,4 +77,3 @@ export default class ReactionsAdd extends BaseCommand {
|
|
|
79
77
|
this.output(result);
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
|
-
//# sourceMappingURL=add.js.map
|
|
@@ -11,6 +11,7 @@ export default class ReactionsRemove extends BaseCommand {
|
|
|
11
11
|
static scope = "reactions:write";
|
|
12
12
|
static apiMethod = "DELETE";
|
|
13
13
|
static apiPath = "/messages/{id}/reactions";
|
|
14
|
+
static requiredFlags = ["code"];
|
|
14
15
|
static args = {
|
|
15
16
|
id: Args.integer({
|
|
16
17
|
description: "Идентификатор сообщения",
|
|
@@ -56,16 +57,12 @@ export default class ReactionsRemove extends BaseCommand {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
59
|
-
|
|
60
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
61
|
-
}
|
|
62
|
-
this.exit(2);
|
|
60
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --code <string>. pachca introspect reactions remove" });
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
63
|
if (!flags.force) {
|
|
66
64
|
if (!this.isInteractive()) {
|
|
67
|
-
|
|
68
|
-
this.exit(2);
|
|
65
|
+
this.validationError([{ message: 'Деструктивная операция требует флага --force', flag: 'force' }], { type: 'PACHCA_DESTRUCTIVE_OP_ERROR', hint: "pachca reactions remove <id> --force" });
|
|
69
66
|
}
|
|
70
67
|
const confirm = await clack.confirm({ message: 'Вы уверены?' });
|
|
71
68
|
if (clack.isCancel(confirm) || !confirm) {
|
|
@@ -85,4 +82,3 @@ export default class ReactionsRemove extends BaseCommand {
|
|
|
85
82
|
this.success('Удалено');
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
|
-
//# sourceMappingURL=remove.js.map
|
|
@@ -14,6 +14,7 @@ export default class SecurityList extends BaseCommand {
|
|
|
14
14
|
static apiMethod = "GET";
|
|
15
15
|
static apiPath = "/audit_events";
|
|
16
16
|
static defaultColumns = ["id", "created_at", "event_key", "entity_id", "entity_type"];
|
|
17
|
+
static requiredFlags = ["start-time", "end-time"];
|
|
17
18
|
static args = {};
|
|
18
19
|
static flags = {
|
|
19
20
|
...BaseCommand.baseFlags,
|
|
@@ -77,10 +78,7 @@ export default class SecurityList extends BaseCommand {
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
else {
|
|
80
|
-
|
|
81
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
82
|
-
}
|
|
83
|
-
this.exit(2);
|
|
81
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --start-time <string>, --end-time <string>. pachca introspect security list" });
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
this.checkScope("audit_events:read");
|
|
@@ -152,4 +150,3 @@ export default class SecurityList extends BaseCommand {
|
|
|
152
150
|
this.output(items);
|
|
153
151
|
}
|
|
154
152
|
}
|
|
155
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -5,14 +5,15 @@ import * as clack from '@clack/prompts';
|
|
|
5
5
|
export default class TasksCreate extends BaseCommand {
|
|
6
6
|
static description = "Новое напоминание";
|
|
7
7
|
static examples = [
|
|
8
|
+
"Форма заявки/запроса:\n $ pachca tasks create",
|
|
8
9
|
"Создать напоминание:\n $ pachca tasks create",
|
|
9
|
-
"Получить список предстоящих задач:\n $ pachca tasks list"
|
|
10
|
-
"Создать серию напоминаний:\n $ pachca tasks create"
|
|
10
|
+
"Получить список предстоящих задач:\n $ pachca tasks list"
|
|
11
11
|
];
|
|
12
12
|
static scope = "tasks:create";
|
|
13
13
|
static apiMethod = "POST";
|
|
14
14
|
static apiPath = "/tasks";
|
|
15
15
|
static defaultColumns = ["id", "content", "created_at", "kind", "due_at"];
|
|
16
|
+
static requiredFlags = ["kind"];
|
|
16
17
|
static args = {};
|
|
17
18
|
static flags = {
|
|
18
19
|
...BaseCommand.baseFlags,
|
|
@@ -32,7 +33,7 @@ export default class TasksCreate extends BaseCommand {
|
|
|
32
33
|
description: "Массив идентификаторов пользователей, привязываемых к напоминанию как «ответственные» (по умолчанию ответственным назначается вы)",
|
|
33
34
|
}),
|
|
34
35
|
'chat-id': Flags.integer({
|
|
35
|
-
description: "Идентификатор чата, к которому привязывается напоминание",
|
|
36
|
+
description: "Идентификатор чата, к которому привязывается напоминание (pachca chats list)",
|
|
36
37
|
}),
|
|
37
38
|
'all-day': Flags.boolean({
|
|
38
39
|
description: "Напоминание на весь день (без указания времени)",
|
|
@@ -76,10 +77,7 @@ export default class TasksCreate extends BaseCommand {
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
|
-
|
|
80
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
81
|
-
}
|
|
82
|
-
this.exit(2);
|
|
80
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --kind <string>. pachca introspect tasks create" });
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
this.checkScope("tasks:create");
|
|
@@ -109,4 +107,3 @@ export default class TasksCreate extends BaseCommand {
|
|
|
109
107
|
this.output(result);
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -14,7 +14,7 @@ export default class TasksDelete extends BaseCommand {
|
|
|
14
14
|
static apiPath = "/tasks/{id}";
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор напоминания",
|
|
17
|
+
description: "Идентификатор напоминания (pachca tasks list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -30,8 +30,7 @@ export default class TasksDelete 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 tasks 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 TasksDelete extends BaseCommand {
|
|
|
47
46
|
this.success('Удалено');
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -14,7 +14,7 @@ export default class TasksGet extends BaseCommand {
|
|
|
14
14
|
static defaultColumns = ["id", "content", "created_at", "kind", "due_at"];
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор напоминания",
|
|
17
|
+
description: "Идентификатор напоминания (pachca tasks list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -34,4 +34,3 @@ export default class TasksGet extends BaseCommand {
|
|
|
34
34
|
this.output(result);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -4,9 +4,9 @@ import { BaseCommand } from '../../base-command.js';
|
|
|
4
4
|
export default class TasksList extends BaseCommand {
|
|
5
5
|
static description = "Список напоминаний";
|
|
6
6
|
static examples = [
|
|
7
|
+
"Форма заявки/запроса:\n $ pachca tasks create",
|
|
7
8
|
"Создать напоминание:\n $ pachca tasks create",
|
|
8
|
-
"Получить список предстоящих задач:\n $ pachca tasks list"
|
|
9
|
-
"Создать серию напоминаний:\n $ pachca tasks create"
|
|
9
|
+
"Получить список предстоящих задач:\n $ pachca tasks list"
|
|
10
10
|
];
|
|
11
11
|
static scope = "tasks:read";
|
|
12
12
|
static apiMethod = "GET";
|
|
@@ -84,4 +84,3 @@ export default class TasksList extends BaseCommand {
|
|
|
84
84
|
this.output(items);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -14,7 +14,7 @@ export default class TasksUpdate extends BaseCommand {
|
|
|
14
14
|
static defaultColumns = ["id", "content", "created_at", "kind", "due_at"];
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор напоминания",
|
|
17
|
+
description: "Идентификатор напоминания (pachca tasks list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -79,8 +79,7 @@ export default class TasksUpdate extends BaseCommand {
|
|
|
79
79
|
delete inner[k];
|
|
80
80
|
}
|
|
81
81
|
if (Object.keys(inner).length === 0) {
|
|
82
|
-
|
|
83
|
-
return;
|
|
82
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
84
83
|
}
|
|
85
84
|
const { data } = await this.apiRequest({
|
|
86
85
|
method: 'PUT',
|
|
@@ -92,4 +91,3 @@ export default class TasksUpdate extends BaseCommand {
|
|
|
92
91
|
this.output(result);
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -13,6 +13,7 @@ export default class UsersCreate extends BaseCommand {
|
|
|
13
13
|
static apiMethod = "POST";
|
|
14
14
|
static apiPath = "/users";
|
|
15
15
|
static defaultColumns = ["id", "title", "first_name", "last_name", "email"];
|
|
16
|
+
static requiredFlags = ["email"];
|
|
16
17
|
static args = {};
|
|
17
18
|
static flags = {
|
|
18
19
|
...BaseCommand.baseFlags,
|
|
@@ -81,10 +82,7 @@ export default class UsersCreate extends BaseCommand {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
else {
|
|
84
|
-
|
|
85
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
86
|
-
}
|
|
87
|
-
this.exit(2);
|
|
85
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --email <string>. pachca introspect users create" });
|
|
88
86
|
}
|
|
89
87
|
}
|
|
90
88
|
this.checkScope("users:create");
|
|
@@ -124,4 +122,3 @@ export default class UsersCreate extends BaseCommand {
|
|
|
124
122
|
this.output(result);
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -14,7 +14,7 @@ export default class UsersDelete extends BaseCommand {
|
|
|
14
14
|
static apiPath = "/users/{id}";
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор пользователя",
|
|
17
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -30,8 +30,7 @@ export default class UsersDelete 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 users 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 UsersDelete extends BaseCommand {
|
|
|
47
46
|
this.success('Удалено');
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -14,7 +14,7 @@ export default class UsersGetStatus extends BaseCommand {
|
|
|
14
14
|
static defaultColumns = ["title", "emoji", "expires_at", "is_away"];
|
|
15
15
|
static args = {
|
|
16
16
|
user_id: Args.integer({
|
|
17
|
-
description: "Идентификатор пользователя",
|
|
17
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -34,4 +34,3 @@ export default class UsersGetStatus extends BaseCommand {
|
|
|
34
34
|
this.output(result);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=get-status.js.map
|
|
@@ -14,7 +14,7 @@ export default class UsersGet extends BaseCommand {
|
|
|
14
14
|
static defaultColumns = ["id", "title", "first_name", "last_name", "email"];
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор пользователя",
|
|
17
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -34,4 +34,3 @@ export default class UsersGet extends BaseCommand {
|
|
|
34
34
|
this.output(result);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -14,7 +14,7 @@ export default class UsersRemoveStatus extends BaseCommand {
|
|
|
14
14
|
static apiPath = "/users/{user_id}/status";
|
|
15
15
|
static args = {
|
|
16
16
|
user_id: Args.integer({
|
|
17
|
-
description: "Идентификатор пользователя",
|
|
17
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -30,8 +30,7 @@ export default class UsersRemoveStatus 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 users remove-status <user_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 UsersRemoveStatus extends BaseCommand {
|
|
|
47
46
|
this.success('Удалено');
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
//# sourceMappingURL=remove-status.js.map
|
|
@@ -13,9 +13,10 @@ export default class UsersUpdateStatus extends BaseCommand {
|
|
|
13
13
|
static apiMethod = "PUT";
|
|
14
14
|
static apiPath = "/users/{user_id}/status";
|
|
15
15
|
static defaultColumns = ["title", "emoji", "expires_at", "is_away"];
|
|
16
|
+
static requiredFlags = ["emoji", "title"];
|
|
16
17
|
static args = {
|
|
17
18
|
user_id: Args.integer({
|
|
18
|
-
description: "Идентификатор пользователя",
|
|
19
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
19
20
|
required: true,
|
|
20
21
|
}),
|
|
21
22
|
};
|
|
@@ -65,15 +66,15 @@ export default class UsersUpdateStatus extends BaseCommand {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
68
|
-
|
|
69
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
70
|
-
}
|
|
71
|
-
this.exit(2);
|
|
69
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --emoji <string>, --title <string>. pachca introspect users update-status" });
|
|
72
70
|
}
|
|
73
71
|
}
|
|
72
|
+
const validationErrors = [];
|
|
74
73
|
if (flags['away-message'] && String(flags['away-message']).length > 1024) {
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
validationErrors.push({ message: `--away-message: максимум 1024 символов (передано: ${String(flags['away-message']).length})`, flag: 'away-message' });
|
|
75
|
+
}
|
|
76
|
+
if (validationErrors.length > 0) {
|
|
77
|
+
this.validationError(validationErrors);
|
|
77
78
|
}
|
|
78
79
|
this.checkScope("user_status:write");
|
|
79
80
|
const body = { status: {
|
|
@@ -90,8 +91,7 @@ export default class UsersUpdateStatus extends BaseCommand {
|
|
|
90
91
|
delete inner[k];
|
|
91
92
|
}
|
|
92
93
|
if (Object.keys(inner).length === 0) {
|
|
93
|
-
|
|
94
|
-
return;
|
|
94
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
95
95
|
}
|
|
96
96
|
const { data } = await this.apiRequest({
|
|
97
97
|
method: 'PUT',
|
|
@@ -103,4 +103,3 @@ export default class UsersUpdateStatus extends BaseCommand {
|
|
|
103
103
|
this.output(result);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
//# sourceMappingURL=update-status.js.map
|
|
@@ -14,7 +14,7 @@ export default class UsersUpdate extends BaseCommand {
|
|
|
14
14
|
static defaultColumns = ["id", "title", "first_name", "last_name", "email"];
|
|
15
15
|
static args = {
|
|
16
16
|
id: Args.integer({
|
|
17
|
-
description: "Идентификатор пользователя",
|
|
17
|
+
description: "Идентификатор пользователя (pachca users list)",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -79,8 +79,7 @@ export default class UsersUpdate extends BaseCommand {
|
|
|
79
79
|
delete inner[k];
|
|
80
80
|
}
|
|
81
81
|
if (Object.keys(inner).length === 0) {
|
|
82
|
-
|
|
83
|
-
return;
|
|
82
|
+
this.validationError([{ message: 'Не указаны поля для обновления' }], { type: 'PACHCA_USAGE_ERROR' });
|
|
84
83
|
}
|
|
85
84
|
const { data } = await this.apiRequest({
|
|
86
85
|
method: 'PUT',
|
|
@@ -92,4 +91,3 @@ export default class UsersUpdate extends BaseCommand {
|
|
|
92
91
|
this.output(result);
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
|
-
//# sourceMappingURL=update.js.map
|
package/dist/commands/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../base-command.js';
|
|
2
2
|
export default class Version extends BaseCommand {
|
|
3
|
-
static description = '
|
|
3
|
+
static description = 'Версия CLI';
|
|
4
4
|
static examples = [
|
|
5
5
|
'<%= config.bin %> version',
|
|
6
6
|
];
|
|
@@ -20,4 +20,3 @@ export default class Version extends BaseCommand {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
//# sourceMappingURL=version.js.map
|
|
@@ -11,6 +11,7 @@ export default class ViewsOpen extends BaseCommand {
|
|
|
11
11
|
static scope = "views:write";
|
|
12
12
|
static apiMethod = "POST";
|
|
13
13
|
static apiPath = "/views/open";
|
|
14
|
+
static requiredFlags = ["title", "blocks", "type", "trigger-id"];
|
|
14
15
|
static args = {};
|
|
15
16
|
static flags = {
|
|
16
17
|
...BaseCommand.baseFlags,
|
|
@@ -69,35 +70,30 @@ export default class ViewsOpen extends BaseCommand {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
else {
|
|
72
|
-
|
|
73
|
-
process.stderr.write(`✗ Обязательный флаг --${field.flag} не передан\n`);
|
|
74
|
-
}
|
|
75
|
-
this.exit(2);
|
|
73
|
+
this.validationError(missingRequired.map((f) => ({ message: `Обязательный флаг --${f.flag} не передан`, flag: f.flag })), { hint: "Обязательные: --title <string>, --blocks <string>, --type <string>, --trigger-id <string>. pachca introspect views open" });
|
|
76
74
|
}
|
|
77
75
|
}
|
|
76
|
+
const validationErrors = [];
|
|
78
77
|
if (flags['title'] && String(flags['title']).length > 24) {
|
|
79
|
-
|
|
80
|
-
this.exit(2);
|
|
78
|
+
validationErrors.push({ message: `--title: максимум 24 символов (передано: ${String(flags['title']).length})`, flag: 'title' });
|
|
81
79
|
}
|
|
82
80
|
if (flags['close-text'] && String(flags['close-text']).length > 24) {
|
|
83
|
-
|
|
84
|
-
this.exit(2);
|
|
81
|
+
validationErrors.push({ message: `--close-text: максимум 24 символов (передано: ${String(flags['close-text']).length})`, flag: 'close-text' });
|
|
85
82
|
}
|
|
86
83
|
if (flags['submit-text'] && String(flags['submit-text']).length > 24) {
|
|
87
|
-
|
|
88
|
-
this.exit(2);
|
|
84
|
+
validationErrors.push({ message: `--submit-text: максимум 24 символов (передано: ${String(flags['submit-text']).length})`, flag: 'submit-text' });
|
|
89
85
|
}
|
|
90
86
|
if (flags['type'] && !["modal"].includes(flags['type'])) {
|
|
91
|
-
|
|
92
|
-
this.exit(2);
|
|
87
|
+
validationErrors.push({ message: `--type: допустимые значения — "modal"`, flag: 'type' });
|
|
93
88
|
}
|
|
94
89
|
if (flags['private-metadata'] && String(flags['private-metadata']).length > 3000) {
|
|
95
|
-
|
|
96
|
-
this.exit(2);
|
|
90
|
+
validationErrors.push({ message: `--private-metadata: максимум 3000 символов (передано: ${String(flags['private-metadata']).length})`, flag: 'private-metadata' });
|
|
97
91
|
}
|
|
98
92
|
if (flags['callback-id'] && String(flags['callback-id']).length > 255) {
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
validationErrors.push({ message: `--callback-id: максимум 255 символов (передано: ${String(flags['callback-id']).length})`, flag: 'callback-id' });
|
|
94
|
+
}
|
|
95
|
+
if (validationErrors.length > 0) {
|
|
96
|
+
this.validationError(validationErrors);
|
|
101
97
|
}
|
|
102
98
|
this.checkScope("views:write");
|
|
103
99
|
const body = {
|
|
@@ -132,4 +128,3 @@ export default class ViewsOpen extends BaseCommand {
|
|
|
132
128
|
this.output(result);
|
|
133
129
|
}
|
|
134
130
|
}
|
|
135
|
-
//# sourceMappingURL=open.js.map
|