@poncho-ai/messaging 0.8.0 → 0.8.1
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/index.js +12 -4
- package/package.json +1 -1
- package/src/adapters/slack/utils.ts +14 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/messaging@0.8.
|
|
2
|
+
> @poncho-ai/messaging@0.8.1 build /home/runner/work/poncho-ai/poncho-ai/packages/messaging
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist/index.js [22m[32m53.
|
|
11
|
-
[32mESM[39m ⚡️ Build success in
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m53.27 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 60ms
|
|
12
12
|
[34mDTS[39m Build start
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 5292ms
|
|
14
14
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m11.66 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @poncho-ai/messaging
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`69dd20a`](https://github.com/cesr/poncho-ai/commit/69dd20ae31ada0edaf281cf451729ffe37f4df71) Thanks [@cesr](https://github.com/cesr)! - fix: use GET for Slack conversations.replies API call so thread context is fetched correctly
|
|
8
|
+
|
|
3
9
|
## 0.8.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -204,14 +204,22 @@ var addReaction = async (token, channel, timestamp, reaction) => {
|
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
var fetchThreadMessages = async (token, channel, threadTs, excludeTs) => {
|
|
207
|
-
const
|
|
207
|
+
const params = new URLSearchParams({
|
|
208
208
|
channel,
|
|
209
209
|
ts: threadTs,
|
|
210
|
-
limit: 50
|
|
210
|
+
limit: "50"
|
|
211
211
|
});
|
|
212
|
+
const res = await fetch(
|
|
213
|
+
`${SLACK_API}/conversations.replies?${params.toString()}`,
|
|
214
|
+
{
|
|
215
|
+
method: "GET",
|
|
216
|
+
headers: { authorization: `Bearer ${token}` }
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
const result = await res.json();
|
|
212
220
|
if (!result.ok) {
|
|
213
|
-
console.
|
|
214
|
-
`[slack-adapter] conversations.replies failed: ${result.error}`
|
|
221
|
+
console.error(
|
|
222
|
+
`[slack-adapter] conversations.replies failed: ${result.error} \u2014 ensure the bot has the "channels:history" scope`
|
|
215
223
|
);
|
|
216
224
|
return [];
|
|
217
225
|
}
|
package/package.json
CHANGED
|
@@ -101,19 +101,28 @@ export const fetchThreadMessages = async (
|
|
|
101
101
|
threadTs: string,
|
|
102
102
|
excludeTs?: string,
|
|
103
103
|
): Promise<Array<{ user?: string; text?: string; ts: string }>> => {
|
|
104
|
-
const
|
|
104
|
+
const params = new URLSearchParams({
|
|
105
105
|
channel,
|
|
106
106
|
ts: threadTs,
|
|
107
|
-
limit: 50,
|
|
108
|
-
})
|
|
107
|
+
limit: "50",
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const res = await fetch(
|
|
111
|
+
`${SLACK_API}/conversations.replies?${params.toString()}`,
|
|
112
|
+
{
|
|
113
|
+
method: "GET",
|
|
114
|
+
headers: { authorization: `Bearer ${token}` },
|
|
115
|
+
},
|
|
116
|
+
);
|
|
117
|
+
const result = (await res.json()) as {
|
|
109
118
|
ok: boolean;
|
|
110
119
|
error?: string;
|
|
111
120
|
messages?: Array<{ user?: string; text?: string; ts: string }>;
|
|
112
121
|
};
|
|
113
122
|
|
|
114
123
|
if (!result.ok) {
|
|
115
|
-
console.
|
|
116
|
-
`[slack-adapter] conversations.replies failed: ${result.error}`,
|
|
124
|
+
console.error(
|
|
125
|
+
`[slack-adapter] conversations.replies failed: ${result.error} — ensure the bot has the "channels:history" scope`,
|
|
117
126
|
);
|
|
118
127
|
return [];
|
|
119
128
|
}
|