@pachca/cli 2026.3.8 → 2026.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/base-command.js +1 -43
- package/dist/commands/auth/list.js +0 -1
- package/dist/commands/auth/login.js +0 -9
- package/dist/commands/auth/status.js +0 -10
- package/dist/commands/bots/list-events.js +0 -1
- package/dist/commands/bots/remove-event.js +0 -1
- package/dist/commands/bots/update.js +0 -1
- package/dist/commands/chats/archive.js +0 -1
- package/dist/commands/chats/create.js +0 -1
- package/dist/commands/chats/get.js +0 -1
- package/dist/commands/chats/list.js +8 -9
- package/dist/commands/chats/unarchive.js +0 -1
- package/dist/commands/chats/update.js +0 -1
- package/dist/commands/commands.js +5 -12
- package/dist/commands/common/custom-properties.js +0 -1
- package/dist/commands/common/get-exports.js +0 -1
- package/dist/commands/common/request-export.js +0 -1
- package/dist/commands/common/uploads.js +0 -1
- package/dist/commands/group-tags/create.js +0 -1
- package/dist/commands/group-tags/delete.js +0 -1
- 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 +0 -1
- package/dist/commands/link-previews/add.js +0 -1
- package/dist/commands/members/add-group-tags.js +0 -1
- package/dist/commands/members/add.js +0 -1
- package/dist/commands/members/leave.js +0 -1
- package/dist/commands/members/list.js +0 -1
- package/dist/commands/members/remove-group-tag.js +0 -1
- package/dist/commands/members/remove.js +0 -1
- package/dist/commands/members/update.js +0 -1
- package/dist/commands/messages/create.js +9 -4
- package/dist/commands/messages/delete.js +0 -1
- package/dist/commands/messages/get.js +0 -1
- package/dist/commands/messages/list.js +9 -5
- package/dist/commands/messages/pin.js +0 -1
- package/dist/commands/messages/unpin.js +0 -1
- package/dist/commands/messages/update.js +0 -1
- package/dist/commands/profile/delete-status.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 +0 -1
- package/dist/commands/reactions/add.js +0 -1
- package/dist/commands/reactions/list.js +0 -1
- package/dist/commands/reactions/remove.js +0 -1
- 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 +0 -30
- package/dist/commands/tasks/create.js +0 -1
- package/dist/commands/tasks/delete.js +0 -1
- package/dist/commands/tasks/get.js +0 -1
- package/dist/commands/tasks/list.js +0 -1
- package/dist/commands/tasks/update.js +0 -1
- package/dist/commands/threads/add.js +0 -1
- package/dist/commands/threads/get.js +0 -1
- package/dist/commands/upload.js +0 -1
- package/dist/commands/users/create.js +0 -1
- package/dist/commands/users/delete.js +0 -1
- package/dist/commands/users/get-status.js +0 -1
- package/dist/commands/users/get.js +0 -1
- package/dist/commands/users/list.js +0 -1
- package/dist/commands/users/remove-status.js +0 -1
- package/dist/commands/users/update-status.js +0 -1
- package/dist/commands/users/update.js +0 -1
- package/dist/commands/views/open.js +0 -1
- package/dist/data/changelog.json +42 -0
- package/dist/hooks/init.js +1 -20
- package/dist/profiles.js +0 -8
- package/oclif.manifest.json +1 -12709
- package/package.json +1 -1
- package/dist/commands/auth/refresh.js +0 -67
package/package.json
CHANGED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Args } from '@oclif/core';
|
|
2
|
-
import { BaseCommand } from '../../base-command.js';
|
|
3
|
-
import { getActiveProfile, getProfile, setProfile } from '../../profiles.js';
|
|
4
|
-
import { request } from '../../client.js';
|
|
5
|
-
import { outputError } from '../../output.js';
|
|
6
|
-
export default class AuthRefresh extends BaseCommand {
|
|
7
|
-
static description = 'Обновление кешированных разрешений профиля';
|
|
8
|
-
static examples = [
|
|
9
|
-
'<%= config.bin %> auth refresh bot-support',
|
|
10
|
-
'<%= config.bin %> auth refresh',
|
|
11
|
-
];
|
|
12
|
-
static args = {
|
|
13
|
-
profile: Args.string({
|
|
14
|
-
description: 'Profile name to refresh',
|
|
15
|
-
required: false,
|
|
16
|
-
}),
|
|
17
|
-
};
|
|
18
|
-
static flags = {
|
|
19
|
-
...BaseCommand.baseFlags,
|
|
20
|
-
};
|
|
21
|
-
async run() {
|
|
22
|
-
const { args, flags } = await this.parse(AuthRefresh);
|
|
23
|
-
this.parsedFlags = flags;
|
|
24
|
-
const profileName = args.profile || flags.profile || process.env.PACHCA_PROFILE || getActiveProfile();
|
|
25
|
-
const format = this.getOutputFormat();
|
|
26
|
-
if (!profileName) {
|
|
27
|
-
outputError({ error: 'No profile specified. Run: pachca auth refresh <profile>', type: 'PACHCA_USAGE_ERROR', code: null }, format);
|
|
28
|
-
this.exit(2);
|
|
29
|
-
}
|
|
30
|
-
const profile = getProfile(profileName);
|
|
31
|
-
if (!profile) {
|
|
32
|
-
outputError({ error: `Profile "${profileName}" not found`, type: 'PACHCA_USAGE_ERROR', code: null }, format);
|
|
33
|
-
this.exit(2);
|
|
34
|
-
}
|
|
35
|
-
// Fetch fresh scopes
|
|
36
|
-
const response = await request({ method: 'GET', path: '/oauth/token/info', token: profile.token }, { quiet: flags.quiet });
|
|
37
|
-
const wrapper = response.data;
|
|
38
|
-
const newScopes = wrapper.data.scopes || [];
|
|
39
|
-
const oldScopes = profile.scopes || [];
|
|
40
|
-
// Update profile
|
|
41
|
-
profile.scopes = newScopes;
|
|
42
|
-
profile.scopes_refreshed_at = new Date().toISOString();
|
|
43
|
-
setProfile(profileName, profile);
|
|
44
|
-
// Calculate diff
|
|
45
|
-
const added = newScopes.filter((s) => !oldScopes.includes(s));
|
|
46
|
-
const removed = oldScopes.filter((s) => !newScopes.includes(s));
|
|
47
|
-
if (format === 'json') {
|
|
48
|
-
this.output({
|
|
49
|
-
profile: profileName,
|
|
50
|
-
scopes_before: oldScopes,
|
|
51
|
-
scopes_after: newScopes,
|
|
52
|
-
added,
|
|
53
|
-
removed,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
else if (!flags.quiet) {
|
|
57
|
-
this.success(`Скоупы обновлены [${profileName}]`);
|
|
58
|
-
if (added.length || removed.length) {
|
|
59
|
-
process.stderr.write(` Было: ${oldScopes.join(', ')}\n`);
|
|
60
|
-
process.stderr.write(` Стало: ${newScopes.join(', ')}`);
|
|
61
|
-
if (added.length)
|
|
62
|
-
process.stderr.write(` (+${added.length} новых)`);
|
|
63
|
-
process.stderr.write('\n');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|