@pachca/cli 2026.7.1 → 2026.8.0
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 +18 -0
- package/README.md +1 -1
- package/README.template.md +1 -1
- package/dist/base-command.js +2 -0
- package/dist/client.js +51 -17
- package/dist/commands/bots/create.js +4 -4
- package/dist/commands/bots/delete.js +1 -1
- package/dist/commands/bots/get.js +1 -1
- package/dist/commands/bots/list-events.js +2 -2
- package/dist/commands/bots/list.js +2 -2
- package/dist/commands/bots/recreate-token-self.js +2 -2
- package/dist/commands/bots/recreate-token.js +2 -2
- package/dist/commands/bots/remove-event.js +1 -1
- package/dist/commands/bots/update-webhook.js +2 -2
- package/dist/commands/bots/update.js +3 -3
- package/dist/commands/chats/archive.js +3 -3
- package/dist/commands/chats/create.js +3 -3
- package/dist/commands/chats/download-export.js +2 -2
- package/dist/commands/chats/get.js +1 -1
- package/dist/commands/chats/list.js +4 -4
- package/dist/commands/chats/request-export.js +2 -2
- package/dist/commands/chats/unarchive.js +2 -2
- package/dist/commands/chats/update.js +2 -2
- package/dist/commands/custom-properties/list.js +2 -2
- package/dist/commands/files/direct-url.js +12 -12
- package/dist/commands/files/uploads.js +2 -2
- package/dist/commands/group-tags/create.js +2 -2
- package/dist/commands/group-tags/get.js +1 -1
- package/dist/commands/group-tags/list-users.js +2 -2
- package/dist/commands/group-tags/list.js +2 -2
- package/dist/commands/group-tags/update.js +1 -1
- package/dist/commands/members/add-group-tags.js +1 -1
- package/dist/commands/members/add.js +4 -4
- package/dist/commands/members/leave.js +1 -1
- package/dist/commands/members/list.js +3 -2
- package/dist/commands/members/remove.js +1 -1
- package/dist/commands/members/update.js +2 -2
- package/dist/commands/messages/create.js +4 -4
- package/dist/commands/messages/delete.js +1 -1
- package/dist/commands/messages/get.js +4 -4
- package/dist/commands/messages/list.js +3 -2
- package/dist/commands/messages/pin.js +2 -2
- package/dist/commands/messages/unfurl.js +4 -4
- package/dist/commands/messages/unpin.js +1 -1
- package/dist/commands/messages/update.js +4 -4
- package/dist/commands/oauth/token-info.js +2 -2
- package/dist/commands/profile/delete-avatar.js +1 -1
- package/dist/commands/profile/delete-status.js +1 -1
- package/dist/commands/profile/get-status.js +1 -1
- package/dist/commands/profile/get.js +3 -3
- package/dist/commands/profile/update-avatar.js +2 -2
- package/dist/commands/profile/update-status.js +2 -2
- package/dist/commands/reactions/add.js +2 -2
- package/dist/commands/reactions/list.js +1 -1
- package/dist/commands/reactions/remove.js +1 -1
- package/dist/commands/read-member/list-readers.js +2 -2
- package/dist/commands/search/list-chats.js +3 -3
- package/dist/commands/search/list-messages.js +2 -2
- package/dist/commands/search/list-users.js +4 -4
- package/dist/commands/security/list.js +5 -5
- package/dist/commands/tasks/create.js +5 -5
- package/dist/commands/tasks/delete.js +1 -1
- package/dist/commands/tasks/get.js +2 -2
- package/dist/commands/tasks/list.js +2 -2
- package/dist/commands/tasks/update.js +4 -4
- package/dist/commands/threads/add.js +3 -3
- package/dist/commands/threads/create.js +1 -1
- package/dist/commands/threads/get.js +1 -1
- package/dist/commands/threads/list.js +3 -2
- package/dist/commands/users/create.js +4 -4
- package/dist/commands/users/delete.js +1 -1
- package/dist/commands/users/get-status.js +2 -2
- package/dist/commands/users/get.js +2 -2
- package/dist/commands/users/list.js +4 -4
- package/dist/commands/users/remove-avatar.js +1 -1
- package/dist/commands/users/remove-status.js +1 -1
- package/dist/commands/users/update-avatar.js +2 -2
- package/dist/commands/users/update-status.js +2 -2
- package/dist/commands/users/update.js +3 -3
- package/dist/commands/views/open.js +4 -4
- package/dist/data/changelog.json +72 -0
- package/dist/data/endpoints.json +1 -1
- package/dist/data/workflows.json +6 -2
- package/dist/output.js +10 -2
- package/dist/profiles.js +7 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/data/workflows.json
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"steps": [
|
|
46
46
|
{
|
|
47
47
|
"description": "Получи или создай тред, возьми `thread.id` из ответа",
|
|
48
|
-
"command": "pachca
|
|
48
|
+
"command": "pachca threads add <ID>",
|
|
49
49
|
"notes": "Если тред уже существует, вернётся существующий"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"steps": [
|
|
141
141
|
{
|
|
142
142
|
"description": "Получи или создай тред, возьми `chat_id` из ответа",
|
|
143
|
-
"command": "pachca
|
|
143
|
+
"command": "pachca threads add <ID>"
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
"description": "Добавь бота в участники чата треда",
|
|
@@ -160,6 +160,10 @@
|
|
|
160
160
|
{
|
|
161
161
|
"description": "Если в ответе `meta.paginate.next_page` — пройди по страницам через `--cursor`",
|
|
162
162
|
"command": "pachca threads list --last-message-at-after=2026-05-19T00:00:00.000Z --cursor=<next_page>"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"description": "Для каждого треда возьми `chat_id` и подтяни сообщения",
|
|
166
|
+
"command": "pachca messages list --chat-id=<thread.chat_id>"
|
|
163
167
|
}
|
|
164
168
|
]
|
|
165
169
|
},
|
package/dist/output.js
CHANGED
|
@@ -45,8 +45,16 @@ function outputCsv(data, opts) {
|
|
|
45
45
|
const val = item[col];
|
|
46
46
|
if (val == null)
|
|
47
47
|
return '';
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
// Objects/arrays as JSON, matching outputPlain and outputTable —
|
|
49
|
+
// String() rendered them as "[object Object]" and lost the structure.
|
|
50
|
+
const str = typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
51
|
+
// A cell starting with =, +, - or @ is executed as a formula by Excel,
|
|
52
|
+
// Sheets and LibreOffice. Values here are user-authored (message text,
|
|
53
|
+
// names), so prefix a quote to neutralise it.
|
|
54
|
+
if (/^[=+\-@\t\r]/.test(str)) {
|
|
55
|
+
return `"'${str.replace(/"/g, '""')}"`;
|
|
56
|
+
}
|
|
57
|
+
if (/[",\n\r]/.test(str)) {
|
|
50
58
|
return `"${str.replace(/"/g, '""')}"`;
|
|
51
59
|
}
|
|
52
60
|
return str;
|
package/dist/profiles.js
CHANGED
|
@@ -143,15 +143,19 @@ export function setConfigValue(key, value) {
|
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Resolve the token to use, respecting priority:
|
|
146
|
-
* --token > PACHCA_TOKEN env >
|
|
146
|
+
* --token > --profile > PACHCA_TOKEN env > PACHCA_PROFILE env > active profile > error
|
|
147
|
+
*
|
|
148
|
+
* Explicit flags beat ambient environment. An exported PACHCA_TOKEN (common in
|
|
149
|
+
* CI and agent shells) used to win over an explicit `--profile staging`, so the
|
|
150
|
+
* command silently wrote to the wrong workspace with the wrong token.
|
|
147
151
|
*/
|
|
148
152
|
export function resolveToken(flags) {
|
|
149
153
|
// 1. --token flag (highest priority)
|
|
150
154
|
if (flags.token) {
|
|
151
155
|
return { token: flags.token };
|
|
152
156
|
}
|
|
153
|
-
// 2. PACHCA_TOKEN env
|
|
154
|
-
if (process.env.PACHCA_TOKEN) {
|
|
157
|
+
// 2. PACHCA_TOKEN env — unless a profile was named explicitly
|
|
158
|
+
if (!flags.profile && process.env.PACHCA_TOKEN) {
|
|
155
159
|
return { token: process.env.PACHCA_TOKEN };
|
|
156
160
|
}
|
|
157
161
|
// 3. --profile flag or PACHCA_PROFILE env
|