@ihazz/bitrix24 1.1.12 → 1.1.14

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 (48) hide show
  1. package/README.md +77 -4
  2. package/dist/src/api.d.ts +10 -5
  3. package/dist/src/api.d.ts.map +1 -1
  4. package/dist/src/api.js +42 -8
  5. package/dist/src/api.js.map +1 -1
  6. package/dist/src/channel.d.ts +20 -1
  7. package/dist/src/channel.d.ts.map +1 -1
  8. package/dist/src/channel.js +2303 -81
  9. package/dist/src/channel.js.map +1 -1
  10. package/dist/src/i18n.d.ts +1 -0
  11. package/dist/src/i18n.d.ts.map +1 -1
  12. package/dist/src/i18n.js +79 -68
  13. package/dist/src/i18n.js.map +1 -1
  14. package/dist/src/inbound-handler.d.ts +10 -0
  15. package/dist/src/inbound-handler.d.ts.map +1 -1
  16. package/dist/src/inbound-handler.js +281 -16
  17. package/dist/src/inbound-handler.js.map +1 -1
  18. package/dist/src/media-service.d.ts +4 -0
  19. package/dist/src/media-service.d.ts.map +1 -1
  20. package/dist/src/media-service.js +147 -14
  21. package/dist/src/media-service.js.map +1 -1
  22. package/dist/src/message-utils.d.ts.map +1 -1
  23. package/dist/src/message-utils.js +113 -4
  24. package/dist/src/message-utils.js.map +1 -1
  25. package/dist/src/runtime.d.ts +1 -0
  26. package/dist/src/runtime.d.ts.map +1 -1
  27. package/dist/src/runtime.js.map +1 -1
  28. package/dist/src/send-service.d.ts +2 -1
  29. package/dist/src/send-service.d.ts.map +1 -1
  30. package/dist/src/send-service.js +34 -5
  31. package/dist/src/send-service.js.map +1 -1
  32. package/dist/src/state-paths.d.ts +1 -0
  33. package/dist/src/state-paths.d.ts.map +1 -1
  34. package/dist/src/state-paths.js +9 -0
  35. package/dist/src/state-paths.js.map +1 -1
  36. package/dist/src/types.d.ts +92 -0
  37. package/dist/src/types.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/src/api.ts +62 -13
  40. package/src/channel.ts +3746 -843
  41. package/src/i18n.ts +81 -68
  42. package/src/inbound-handler.ts +357 -17
  43. package/src/media-service.ts +185 -15
  44. package/src/message-utils.ts +144 -4
  45. package/src/runtime.ts +1 -0
  46. package/src/send-service.ts +52 -4
  47. package/src/state-paths.ts +11 -0
  48. package/src/types.ts +122 -0
package/src/types.ts CHANGED
@@ -346,12 +346,134 @@ export interface KeyboardNewline {
346
346
  /** B24 keyboard: flat array with NEWLINE separators between rows */
347
347
  export type B24Keyboard = (KeyboardButton | KeyboardNewline)[];
348
348
 
349
+ export type B24AttachColorToken = 'primary' | 'secondary' | 'alert' | 'base';
350
+
351
+ export interface B24AttachMessageBlock {
352
+ MESSAGE: string;
353
+ }
354
+
355
+ export interface B24AttachLinkValue {
356
+ LINK: string;
357
+ NAME?: string;
358
+ DESC?: string;
359
+ HTML?: string;
360
+ PREVIEW?: string;
361
+ WIDTH?: number;
362
+ HEIGHT?: number;
363
+ USER_ID?: number;
364
+ CHAT_ID?: number;
365
+ NETWORK_ID?: string;
366
+ }
367
+
368
+ export interface B24AttachLinkBlock {
369
+ LINK: B24AttachLinkValue;
370
+ }
371
+
372
+ export interface B24AttachImageItem {
373
+ LINK: string;
374
+ NAME?: string;
375
+ PREVIEW?: string;
376
+ WIDTH?: number;
377
+ HEIGHT?: number;
378
+ }
379
+
380
+ export interface B24AttachImageBlock {
381
+ IMAGE: B24AttachImageItem | B24AttachImageItem[];
382
+ }
383
+
384
+ export interface B24AttachFileItem {
385
+ LINK: string;
386
+ NAME?: string;
387
+ SIZE?: number;
388
+ }
389
+
390
+ export interface B24AttachFileBlock {
391
+ FILE: B24AttachFileItem | B24AttachFileItem[];
392
+ }
393
+
394
+ export interface B24AttachDelimiterValue {
395
+ SIZE?: number;
396
+ COLOR?: string;
397
+ }
398
+
399
+ export interface B24AttachDelimiterBlock {
400
+ DELIMITER: B24AttachDelimiterValue;
401
+ }
402
+
403
+ export type B24AttachGridDisplay = 'BLOCK' | 'LINE' | 'ROW' | 'TABLE';
404
+
405
+ export interface B24AttachGridItem {
406
+ DISPLAY: B24AttachGridDisplay;
407
+ NAME?: string;
408
+ VALUE?: string;
409
+ WIDTH?: number;
410
+ HEIGHT?: number;
411
+ COLOR_TOKEN?: B24AttachColorToken;
412
+ COLOR?: string;
413
+ LINK?: string;
414
+ USER_ID?: number;
415
+ CHAT_ID?: number;
416
+ }
417
+
418
+ export interface B24AttachGridBlock {
419
+ GRID: B24AttachGridItem[];
420
+ }
421
+
422
+ export interface B24AttachUserValue {
423
+ NAME?: string;
424
+ AVATAR?: string;
425
+ LINK?: string;
426
+ USER_ID?: number;
427
+ NETWORK_ID?: string;
428
+ }
429
+
430
+ export interface B24AttachUserBlock {
431
+ USER: B24AttachUserValue;
432
+ }
433
+
434
+ export type B24AttachBlock =
435
+ | B24AttachMessageBlock
436
+ | B24AttachLinkBlock
437
+ | B24AttachImageBlock
438
+ | B24AttachFileBlock
439
+ | B24AttachDelimiterBlock
440
+ | B24AttachGridBlock
441
+ | B24AttachUserBlock;
442
+
443
+ export interface B24AttachEnvelope {
444
+ ID?: number;
445
+ COLOR_TOKEN?: B24AttachColorToken;
446
+ COLOR?: string;
447
+ BLOCKS: B24AttachBlock[];
448
+ }
449
+
450
+ export type B24Attach = B24AttachEnvelope | B24AttachBlock[];
451
+
349
452
  export interface SendMessageResult {
350
453
  ok: boolean;
351
454
  messageId?: number;
352
455
  error?: string;
353
456
  }
354
457
 
458
+ // ─── Message Action Discovery ────────────────────────────────────────────────
459
+
460
+ export interface ChannelMessageToolSchemaContribution {
461
+ properties: Record<string, unknown>;
462
+ visibility?: 'current-channel' | 'all-configured';
463
+ }
464
+
465
+ export interface ChannelMessageToolDiscovery {
466
+ actions: string[];
467
+ capabilities: string[];
468
+ schema: ChannelMessageToolSchemaContribution | ChannelMessageToolSchemaContribution[] | null;
469
+ }
470
+
471
+ export interface ExtractedToolSendTarget {
472
+ to: string;
473
+ accountId?: string;
474
+ threadId?: string;
475
+ }
476
+
355
477
  // ─── FETCH Mode Context ─────────────────────────────────────────────────────
356
478
 
357
479
  /** Context passed from PollingService to InboundHandler for FETCH events */