@vercel/connect 2.6.0 → 2.7.0-snapshot-c4002eb2617b
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/README.md +15 -0
- package/dist/eve/index.d.ts +1 -0
- package/dist/eve/index.js +1 -0
- package/dist/eve/telegram-credentials.d.ts +30 -0
- package/dist/eve/telegram-credentials.js +27 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -224,6 +224,21 @@ export default teamsChannel({
|
|
|
224
224
|
});
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
+
For Telegram, `connectTelegramCredentials` resolves the bot token and verifies
|
|
228
|
+
updates that Connect forwards with Vercel OIDC. Connect registers the bot's
|
|
229
|
+
webhook and checks Telegram's secret-token header, so the deployment holds no
|
|
230
|
+
bot token or webhook secret.
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
import { connectTelegramCredentials } from '@vercel/connect/eve';
|
|
234
|
+
import { telegramChannel } from 'eve/channels/telegram';
|
|
235
|
+
|
|
236
|
+
export default telegramChannel({
|
|
237
|
+
botUsername: 'my_bot',
|
|
238
|
+
credentials: connectTelegramCredentials('telegram/my-agent'),
|
|
239
|
+
});
|
|
240
|
+
```
|
|
241
|
+
|
|
227
242
|
```ts
|
|
228
243
|
import { defineMcpClientConnection } from 'eve/connections';
|
|
229
244
|
import { connect } from '@vercel/connect/eve';
|
package/dist/eve/index.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ export { connectTeamsCredentials, type ConnectTeamsCredentialsParams, } from './
|
|
|
17
17
|
export { connectPhotonCredentials, type ConnectPhotonCredentialProvider, type PhotonCredentials, type ConnectPhotonCredentialsParams, } from './photon-credentials.js';
|
|
18
18
|
export { connectSlackCredentials, type ConnectSlackCredentialsParams, } from './slack-credentials.js';
|
|
19
19
|
export { connectSendblueCredentials, type ConnectSendblueCredentials, type ConnectSendblueCredentialsParams, } from './sendblue-credentials.js';
|
|
20
|
+
export { connectTelegramCredentials, type ConnectTelegramCredentialsParams, } from './telegram-credentials.js';
|
package/dist/eve/index.js
CHANGED
|
@@ -17,3 +17,4 @@ export { connectTeamsCredentials, } from './microsoft-teams-credentials.js';
|
|
|
17
17
|
export { connectPhotonCredentials, } from './photon-credentials.js';
|
|
18
18
|
export { connectSlackCredentials, } from './slack-credentials.js';
|
|
19
19
|
export { connectSendblueCredentials, } from './sendblue-credentials.js';
|
|
20
|
+
export { connectTelegramCredentials, } from './telegram-credentials.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TelegramChannelCredentials } from 'eve/channels/telegram';
|
|
2
|
+
import { type ConnectOptions, type ConnectTokenParams } from '../index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Token parameters accepted by {@link connectTelegramCredentials}.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors {@link ConnectTokenParams} from `@vercel/connect`, minus
|
|
7
|
+
* `subject`. Telegram bot tokens are app-scoped, so this helper pins the
|
|
8
|
+
* subject to `{ type: "app" }`.
|
|
9
|
+
*/
|
|
10
|
+
export type ConnectTelegramCredentialsParams = Omit<ConnectTokenParams, 'subject'>;
|
|
11
|
+
/**
|
|
12
|
+
* Build {@link TelegramChannelCredentials} backed by a Vercel Connect
|
|
13
|
+
* Telegram connector.
|
|
14
|
+
*
|
|
15
|
+
* Connect registers the bot's webhook, checks Telegram's secret-token header,
|
|
16
|
+
* and forwards each update with a Vercel OIDC token. `webhookVerifier`
|
|
17
|
+
* validates that token, so the eve deployment needs neither
|
|
18
|
+
* `TELEGRAM_BOT_TOKEN` nor `TELEGRAM_WEBHOOK_SECRET_TOKEN`.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { connectTelegramCredentials } from '@vercel/connect/eve';
|
|
22
|
+
* import { telegramChannel } from 'eve/channels/telegram';
|
|
23
|
+
*
|
|
24
|
+
* export default telegramChannel({
|
|
25
|
+
* botUsername: 'my_bot',
|
|
26
|
+
* credentials: connectTelegramCredentials('telegram/my-agent'),
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function connectTelegramCredentials(connector: string, params?: ConnectTelegramCredentialsParams, options?: ConnectOptions): TelegramChannelCredentials;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createConnectWebhookVerifier } from '../chat/webhook-verifier.js';
|
|
2
|
+
import { getToken, } from '../index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build {@link TelegramChannelCredentials} backed by a Vercel Connect
|
|
5
|
+
* Telegram connector.
|
|
6
|
+
*
|
|
7
|
+
* Connect registers the bot's webhook, checks Telegram's secret-token header,
|
|
8
|
+
* and forwards each update with a Vercel OIDC token. `webhookVerifier`
|
|
9
|
+
* validates that token, so the eve deployment needs neither
|
|
10
|
+
* `TELEGRAM_BOT_TOKEN` nor `TELEGRAM_WEBHOOK_SECRET_TOKEN`.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { connectTelegramCredentials } from '@vercel/connect/eve';
|
|
14
|
+
* import { telegramChannel } from 'eve/channels/telegram';
|
|
15
|
+
*
|
|
16
|
+
* export default telegramChannel({
|
|
17
|
+
* botUsername: 'my_bot',
|
|
18
|
+
* credentials: connectTelegramCredentials('telegram/my-agent'),
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function connectTelegramCredentials(connector, params = {}, options) {
|
|
23
|
+
return {
|
|
24
|
+
botToken: () => getToken(connector, { ...params, subject: { type: 'app' } }, options),
|
|
25
|
+
webhookVerifier: createConnectWebhookVerifier(),
|
|
26
|
+
};
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/connect",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0-snapshot-c4002eb2617b",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
60
60
|
"ai": "^6 || ^7.0.0-beta.0",
|
|
61
61
|
"better-auth": ">=1.5.0",
|
|
62
|
-
"eve": ">=0.39.1"
|
|
62
|
+
"eve": ">=0.39.1 || >=1.0.0-0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"@ai-sdk/mcp": {
|