@dennisdamenace/clawtell 0.2.4 → 0.2.5
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/dist/index.d.ts +2 -104
- package/dist/index.js +6 -85
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -119,6 +119,7 @@ declare class ClawTell {
|
|
|
119
119
|
}): Promise<InboxResult>;
|
|
120
120
|
/**
|
|
121
121
|
* Mark a message as read.
|
|
122
|
+
* @deprecated Use ack([messageId]) instead for batch acknowledgment.
|
|
122
123
|
*/
|
|
123
124
|
markRead(messageId: string): Promise<{
|
|
124
125
|
success: boolean;
|
|
@@ -313,110 +314,7 @@ declare class ClawTell {
|
|
|
313
314
|
}>;
|
|
314
315
|
message: string;
|
|
315
316
|
}>;
|
|
316
|
-
/**
|
|
317
|
-
* List your configured delivery channels.
|
|
318
|
-
*
|
|
319
|
-
* @example
|
|
320
|
-
* ```typescript
|
|
321
|
-
* const { channels } = await client.deliveryChannels();
|
|
322
|
-
* for (const ch of channels) {
|
|
323
|
-
* console.log(`${ch.platform}: ${ch.enabled ? 'enabled' : 'disabled'}`);
|
|
324
|
-
* }
|
|
325
|
-
* ```
|
|
326
|
-
*/
|
|
327
|
-
deliveryChannels(): Promise<{
|
|
328
|
-
success: boolean;
|
|
329
|
-
channels: Array<{
|
|
330
|
-
id: string;
|
|
331
|
-
platform: string;
|
|
332
|
-
enabled: boolean;
|
|
333
|
-
verified: boolean;
|
|
334
|
-
verified_at: string | null;
|
|
335
|
-
last_used_at: string | null;
|
|
336
|
-
last_error: string | null;
|
|
337
|
-
priority: number;
|
|
338
|
-
created_at: string;
|
|
339
|
-
}>;
|
|
340
|
-
}>;
|
|
341
|
-
/**
|
|
342
|
-
* Add a delivery channel for offline message delivery.
|
|
343
|
-
*
|
|
344
|
-
* @param platform - "telegram", "discord", or "slack"
|
|
345
|
-
* @param credentials - Platform-specific credentials
|
|
346
|
-
* @param sendTestMessage - Whether to send a test message to verify
|
|
347
|
-
*
|
|
348
|
-
* @example
|
|
349
|
-
* ```typescript
|
|
350
|
-
* // Add Telegram
|
|
351
|
-
* await client.addDeliveryChannel('telegram', {
|
|
352
|
-
* botToken: '123456:ABC...',
|
|
353
|
-
* chatId: '987654321'
|
|
354
|
-
* });
|
|
355
|
-
*
|
|
356
|
-
* // Add Discord
|
|
357
|
-
* await client.addDeliveryChannel('discord', {
|
|
358
|
-
* webhookUrl: 'https://discord.com/api/webhooks/...'
|
|
359
|
-
* });
|
|
360
|
-
*
|
|
361
|
-
* // Add Slack
|
|
362
|
-
* await client.addDeliveryChannel('slack', {
|
|
363
|
-
* webhookUrl: 'https://hooks.slack.com/services/...'
|
|
364
|
-
* });
|
|
365
|
-
* ```
|
|
366
|
-
*/
|
|
367
|
-
addDeliveryChannel(platform: 'telegram' | 'discord' | 'slack', credentials: Record<string, string>, sendTestMessage?: boolean): Promise<{
|
|
368
|
-
success: boolean;
|
|
369
|
-
channel: {
|
|
370
|
-
id: string;
|
|
371
|
-
platform: string;
|
|
372
|
-
enabled: boolean;
|
|
373
|
-
verified: boolean;
|
|
374
|
-
verified_at: string | null;
|
|
375
|
-
};
|
|
376
|
-
testMessageSent: boolean;
|
|
377
|
-
}>;
|
|
378
|
-
/**
|
|
379
|
-
* Remove a delivery channel.
|
|
380
|
-
*
|
|
381
|
-
* @param platform - "telegram", "discord", or "slack"
|
|
382
|
-
*/
|
|
383
|
-
removeDeliveryChannel(platform: 'telegram' | 'discord' | 'slack'): Promise<{
|
|
384
|
-
success: boolean;
|
|
385
|
-
deleted: {
|
|
386
|
-
platform: string;
|
|
387
|
-
};
|
|
388
|
-
}>;
|
|
389
|
-
/**
|
|
390
|
-
* Discover available Telegram chats for a bot.
|
|
391
|
-
* Use this to find your chat ID when setting up Telegram delivery.
|
|
392
|
-
* You must send a message to your bot first.
|
|
393
|
-
*
|
|
394
|
-
* @param botToken - Your Telegram bot token from @BotFather
|
|
395
|
-
*
|
|
396
|
-
* @example
|
|
397
|
-
* ```typescript
|
|
398
|
-
* const result = await client.discoverTelegramChats('123456:ABC...');
|
|
399
|
-
* console.log(`Bot: @${result.botInfo.username}`);
|
|
400
|
-
* for (const chat of result.chats) {
|
|
401
|
-
* console.log(` Chat ID: ${chat.id} (${chat.type})`);
|
|
402
|
-
* }
|
|
403
|
-
* ```
|
|
404
|
-
*/
|
|
405
|
-
discoverTelegramChats(botToken: string): Promise<{
|
|
406
|
-
success: boolean;
|
|
407
|
-
platform: string;
|
|
408
|
-
botInfo: {
|
|
409
|
-
username: string;
|
|
410
|
-
first_name: string;
|
|
411
|
-
};
|
|
412
|
-
chats: Array<{
|
|
413
|
-
id: string;
|
|
414
|
-
title?: string;
|
|
415
|
-
type: string;
|
|
416
|
-
}>;
|
|
417
|
-
instructions: string;
|
|
418
|
-
}>;
|
|
419
317
|
}
|
|
420
|
-
declare const SDK_VERSION = "0.2.
|
|
318
|
+
declare const SDK_VERSION = "0.2.5";
|
|
421
319
|
|
|
422
320
|
export { type AllowlistEntry, AuthenticationError, ClawTell, type ClawTellConfig, ClawTellError, type InboxResult, type LookupResult, type Message, NotFoundError, type Profile, RateLimitError, SDK_VERSION, type SendResult, ClawTell as default };
|
package/dist/index.js
CHANGED
|
@@ -160,8 +160,10 @@ var ClawTell = class {
|
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Mark a message as read.
|
|
163
|
+
* @deprecated Use ack([messageId]) instead for batch acknowledgment.
|
|
163
164
|
*/
|
|
164
165
|
async markRead(messageId) {
|
|
166
|
+
console.warn("markRead() is deprecated, use ack([messageId]) instead");
|
|
165
167
|
return this.request("POST", `/messages/${messageId}/read`);
|
|
166
168
|
}
|
|
167
169
|
/**
|
|
@@ -401,92 +403,11 @@ var ClawTell = class {
|
|
|
401
403
|
}
|
|
402
404
|
});
|
|
403
405
|
}
|
|
404
|
-
//
|
|
405
|
-
//
|
|
406
|
-
//
|
|
407
|
-
/**
|
|
408
|
-
* List your configured delivery channels.
|
|
409
|
-
*
|
|
410
|
-
* @example
|
|
411
|
-
* ```typescript
|
|
412
|
-
* const { channels } = await client.deliveryChannels();
|
|
413
|
-
* for (const ch of channels) {
|
|
414
|
-
* console.log(`${ch.platform}: ${ch.enabled ? 'enabled' : 'disabled'}`);
|
|
415
|
-
* }
|
|
416
|
-
* ```
|
|
417
|
-
*/
|
|
418
|
-
async deliveryChannels() {
|
|
419
|
-
return this.request("GET", "/delivery-channels");
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Add a delivery channel for offline message delivery.
|
|
423
|
-
*
|
|
424
|
-
* @param platform - "telegram", "discord", or "slack"
|
|
425
|
-
* @param credentials - Platform-specific credentials
|
|
426
|
-
* @param sendTestMessage - Whether to send a test message to verify
|
|
427
|
-
*
|
|
428
|
-
* @example
|
|
429
|
-
* ```typescript
|
|
430
|
-
* // Add Telegram
|
|
431
|
-
* await client.addDeliveryChannel('telegram', {
|
|
432
|
-
* botToken: '123456:ABC...',
|
|
433
|
-
* chatId: '987654321'
|
|
434
|
-
* });
|
|
435
|
-
*
|
|
436
|
-
* // Add Discord
|
|
437
|
-
* await client.addDeliveryChannel('discord', {
|
|
438
|
-
* webhookUrl: 'https://discord.com/api/webhooks/...'
|
|
439
|
-
* });
|
|
440
|
-
*
|
|
441
|
-
* // Add Slack
|
|
442
|
-
* await client.addDeliveryChannel('slack', {
|
|
443
|
-
* webhookUrl: 'https://hooks.slack.com/services/...'
|
|
444
|
-
* });
|
|
445
|
-
* ```
|
|
446
|
-
*/
|
|
447
|
-
async addDeliveryChannel(platform, credentials, sendTestMessage = true) {
|
|
448
|
-
return this.request("POST", "/delivery-channels", {
|
|
449
|
-
body: {
|
|
450
|
-
platform,
|
|
451
|
-
credentials,
|
|
452
|
-
sendTestMessage
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Remove a delivery channel.
|
|
458
|
-
*
|
|
459
|
-
* @param platform - "telegram", "discord", or "slack"
|
|
460
|
-
*/
|
|
461
|
-
async removeDeliveryChannel(platform) {
|
|
462
|
-
return this.request("DELETE", `/delivery-channels?platform=${platform}`);
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Discover available Telegram chats for a bot.
|
|
466
|
-
* Use this to find your chat ID when setting up Telegram delivery.
|
|
467
|
-
* You must send a message to your bot first.
|
|
468
|
-
*
|
|
469
|
-
* @param botToken - Your Telegram bot token from @BotFather
|
|
470
|
-
*
|
|
471
|
-
* @example
|
|
472
|
-
* ```typescript
|
|
473
|
-
* const result = await client.discoverTelegramChats('123456:ABC...');
|
|
474
|
-
* console.log(`Bot: @${result.botInfo.username}`);
|
|
475
|
-
* for (const chat of result.chats) {
|
|
476
|
-
* console.log(` Chat ID: ${chat.id} (${chat.type})`);
|
|
477
|
-
* }
|
|
478
|
-
* ```
|
|
479
|
-
*/
|
|
480
|
-
async discoverTelegramChats(botToken) {
|
|
481
|
-
return this.request("POST", "/delivery-channels/discover", {
|
|
482
|
-
body: {
|
|
483
|
-
platform: "telegram",
|
|
484
|
-
botToken
|
|
485
|
-
}
|
|
486
|
-
});
|
|
487
|
-
}
|
|
406
|
+
// Delivery Channels - REMOVED
|
|
407
|
+
// These methods were removed in v0.2.5 as ClawTell now uses long polling.
|
|
408
|
+
// Messages are delivered via poll() instead of push delivery channels.
|
|
488
409
|
};
|
|
489
|
-
var SDK_VERSION = "0.2.
|
|
410
|
+
var SDK_VERSION = "0.2.5";
|
|
490
411
|
var index_default = ClawTell;
|
|
491
412
|
// Annotate the CommonJS export names for ESM import in node:
|
|
492
413
|
0 && (module.exports = {
|