@pachca/cli 2026.7.1 → 2026.7.2

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/README.template.md +1 -1
  4. package/dist/base-command.js +2 -0
  5. package/dist/client.js +51 -17
  6. package/dist/commands/bots/create.js +4 -4
  7. package/dist/commands/bots/delete.js +1 -1
  8. package/dist/commands/bots/get.js +1 -1
  9. package/dist/commands/bots/list-events.js +2 -2
  10. package/dist/commands/bots/list.js +2 -2
  11. package/dist/commands/bots/recreate-token-self.js +2 -2
  12. package/dist/commands/bots/recreate-token.js +2 -2
  13. package/dist/commands/bots/remove-event.js +1 -1
  14. package/dist/commands/bots/update-webhook.js +2 -2
  15. package/dist/commands/bots/update.js +3 -3
  16. package/dist/commands/chats/archive.js +3 -3
  17. package/dist/commands/chats/create.js +3 -3
  18. package/dist/commands/chats/download-export.js +2 -2
  19. package/dist/commands/chats/get.js +1 -1
  20. package/dist/commands/chats/list.js +4 -4
  21. package/dist/commands/chats/request-export.js +2 -2
  22. package/dist/commands/chats/unarchive.js +2 -2
  23. package/dist/commands/chats/update.js +2 -2
  24. package/dist/commands/custom-properties/list.js +2 -2
  25. package/dist/commands/files/direct-url.js +12 -12
  26. package/dist/commands/files/uploads.js +2 -2
  27. package/dist/commands/group-tags/create.js +2 -2
  28. package/dist/commands/group-tags/get.js +1 -1
  29. package/dist/commands/group-tags/list-users.js +2 -2
  30. package/dist/commands/group-tags/list.js +2 -2
  31. package/dist/commands/group-tags/update.js +1 -1
  32. package/dist/commands/members/add-group-tags.js +1 -1
  33. package/dist/commands/members/add.js +4 -4
  34. package/dist/commands/members/leave.js +1 -1
  35. package/dist/commands/members/list.js +3 -2
  36. package/dist/commands/members/remove.js +1 -1
  37. package/dist/commands/members/update.js +2 -2
  38. package/dist/commands/messages/create.js +4 -4
  39. package/dist/commands/messages/delete.js +1 -1
  40. package/dist/commands/messages/get.js +4 -4
  41. package/dist/commands/messages/list.js +2 -2
  42. package/dist/commands/messages/pin.js +2 -2
  43. package/dist/commands/messages/unfurl.js +4 -4
  44. package/dist/commands/messages/unpin.js +1 -1
  45. package/dist/commands/messages/update.js +4 -4
  46. package/dist/commands/oauth/token-info.js +2 -2
  47. package/dist/commands/profile/delete-avatar.js +1 -1
  48. package/dist/commands/profile/delete-status.js +1 -1
  49. package/dist/commands/profile/get-status.js +1 -1
  50. package/dist/commands/profile/get.js +3 -3
  51. package/dist/commands/profile/update-avatar.js +2 -2
  52. package/dist/commands/profile/update-status.js +2 -2
  53. package/dist/commands/reactions/add.js +2 -2
  54. package/dist/commands/reactions/list.js +1 -1
  55. package/dist/commands/reactions/remove.js +1 -1
  56. package/dist/commands/read-member/list-readers.js +2 -2
  57. package/dist/commands/search/list-chats.js +3 -3
  58. package/dist/commands/search/list-messages.js +2 -2
  59. package/dist/commands/search/list-users.js +4 -4
  60. package/dist/commands/security/list.js +5 -5
  61. package/dist/commands/tasks/create.js +5 -5
  62. package/dist/commands/tasks/delete.js +1 -1
  63. package/dist/commands/tasks/get.js +2 -2
  64. package/dist/commands/tasks/list.js +2 -2
  65. package/dist/commands/tasks/update.js +4 -4
  66. package/dist/commands/threads/add.js +3 -3
  67. package/dist/commands/threads/create.js +1 -1
  68. package/dist/commands/threads/get.js +1 -1
  69. package/dist/commands/threads/list.js +3 -2
  70. package/dist/commands/users/create.js +4 -4
  71. package/dist/commands/users/delete.js +1 -1
  72. package/dist/commands/users/get-status.js +2 -2
  73. package/dist/commands/users/get.js +2 -2
  74. package/dist/commands/users/list.js +4 -4
  75. package/dist/commands/users/remove-avatar.js +1 -1
  76. package/dist/commands/users/remove-status.js +1 -1
  77. package/dist/commands/users/update-avatar.js +2 -2
  78. package/dist/commands/users/update-status.js +2 -2
  79. package/dist/commands/users/update.js +3 -3
  80. package/dist/commands/views/open.js +4 -4
  81. package/dist/data/changelog.json +51 -0
  82. package/dist/data/endpoints.json +1 -1
  83. package/dist/data/workflows.json +2 -2
  84. package/dist/output.js +10 -2
  85. package/dist/profiles.js +7 -3
  86. package/oclif.manifest.json +1 -1
  87. package/package.json +1 -1
@@ -45,7 +45,7 @@
45
45
  "steps": [
46
46
  {
47
47
  "description": "Получи или создай тред, возьми `thread.id` из ответа",
48
- "command": "pachca thread add <ID>",
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 thread add <ID>"
143
+ "command": "pachca threads add <ID>"
144
144
  },
145
145
  {
146
146
  "description": "Добавь бота в участники чата треда",
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
- const str = String(val);
49
- if (str.includes(',') || str.includes('"') || str.includes('\n')) {
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 > --profile/PACHCA_PROFILE > active profile > error
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