@wirecat/cli-core 0.403.0 → 0.405.0
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/CHANGELOG.md +27 -0
- package/dist/cli/first-run.js +3 -3
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/messenger/messages-send-command.js +44 -3
- package/dist/cli/messenger/serve-relay.d.ts +1 -0
- package/dist/cli/setup-answers.d.ts +4 -2
- package/dist/cli/setup-answers.js +6 -3
- package/dist/entities/index.d.ts +380 -0
- package/dist/entities/index.js +2 -1
- package/dist/entities/message-write.d.ts +386 -0
- package/dist/entities/message-write.js +6 -0
- package/dist/ports/messenger.d.ts +2 -0
- package/dist/ports/traits.d.ts +2 -0
- package/dist/sends/index.d.ts +1 -1
- package/dist/sends/index.js +1 -1
- package/dist/sends/permissions.d.ts +1 -1
- package/dist/sends/permissions.js +2 -0
- package/dist/services/messages.d.ts +5 -0
- package/dist/services/messages.js +23 -0
- package/package.json +1 -1
- package/parity.json +61 -45
package/dist/entities/index.js
CHANGED
|
@@ -59,7 +59,7 @@ import { messageCounts } from "./message-counts.js";
|
|
|
59
59
|
import { messageLink } from "./message-link.js";
|
|
60
60
|
import { evidencePacket, messageLinks, messageTranscript } from "./message-read.js";
|
|
61
61
|
import { messageDownload, messageSync } from "./message-transfer.js";
|
|
62
|
-
import { messageWrite } from "./message-write.js";
|
|
62
|
+
import { messageSend, messageWrite } from "./message-write.js";
|
|
63
63
|
import { model } from "./model.js";
|
|
64
64
|
import { modelKey, removedModelKey, storedModelKey } from "./model-key.js";
|
|
65
65
|
import { note } from "./note.js";
|
|
@@ -123,6 +123,7 @@ export const ENTITIES = {
|
|
|
123
123
|
]),
|
|
124
124
|
message_link: messageLink,
|
|
125
125
|
message_write: messageWrite,
|
|
126
|
+
message_send: messageSend,
|
|
126
127
|
message_pin: messagePin,
|
|
127
128
|
message_star: messageStar,
|
|
128
129
|
message_deletion: messageDeletion,
|
|
@@ -376,3 +376,389 @@ export declare const messageWrite: v.StrictObjectSchema<{
|
|
|
376
376
|
}, undefined>, undefined>, undefined>;
|
|
377
377
|
readonly scheduled_for: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
378
378
|
}, undefined>;
|
|
379
|
+
export declare const draftWrite: v.StrictObjectSchema<{
|
|
380
|
+
readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
381
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
382
|
+
readonly saved: v.LiteralSchema<true, undefined>;
|
|
383
|
+
}, undefined>;
|
|
384
|
+
export declare const messageSend: v.UnionSchema<[v.StrictObjectSchema<{
|
|
385
|
+
readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
386
|
+
readonly message: v.StrictObjectSchema<{
|
|
387
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
388
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
389
|
+
readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
390
|
+
readonly account: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
391
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
392
|
+
readonly chat_title: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
393
|
+
readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
394
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
395
|
+
readonly sender_username: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
396
|
+
readonly sender_is_chat: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
397
|
+
readonly mentions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
|
|
398
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
399
|
+
readonly edited_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
400
|
+
readonly text: v.StringSchema<undefined>;
|
|
401
|
+
readonly transcript: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
402
|
+
readonly anchor: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
403
|
+
readonly excerpt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
404
|
+
readonly matched_in: v.OptionalSchema<v.PicklistSchema<["text", "transcript", "filename", "file", "context", "picture"], undefined>, undefined>;
|
|
405
|
+
readonly score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
406
|
+
readonly match: v.OptionalSchema<v.PicklistSchema<["words", "beginnings", "corrected"], undefined>, undefined>;
|
|
407
|
+
readonly corrections: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
408
|
+
readonly from: v.StringSchema<undefined>;
|
|
409
|
+
readonly to: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
410
|
+
}, undefined>, undefined>, undefined>;
|
|
411
|
+
readonly found_in: v.OptionalSchema<v.PicklistSchema<["archive", "server", "both"], undefined>, undefined>;
|
|
412
|
+
readonly discovery: v.OptionalSchema<v.StrictObjectSchema<{
|
|
413
|
+
readonly coverage: v.NumberSchema<undefined>;
|
|
414
|
+
readonly matched_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
415
|
+
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
416
|
+
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
417
|
+
}, undefined>, undefined>;
|
|
418
|
+
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
419
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
420
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
421
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
422
|
+
readonly text: v.StringSchema<undefined>;
|
|
423
|
+
}, undefined>, undefined>, undefined>;
|
|
424
|
+
readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
425
|
+
readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
|
|
426
|
+
readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
427
|
+
readonly kind: v.StringSchema<undefined>;
|
|
428
|
+
readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
429
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
430
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
431
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
432
|
+
readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
433
|
+
readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
434
|
+
readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
435
|
+
readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
436
|
+
readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
437
|
+
readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
438
|
+
readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
|
|
439
|
+
readonly origin: v.StringSchema<undefined>;
|
|
440
|
+
readonly extractor: v.StringSchema<undefined>;
|
|
441
|
+
readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
442
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
443
|
+
}, undefined>, undefined>;
|
|
444
|
+
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
445
|
+
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
446
|
+
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
447
|
+
readonly text: v.StringSchema<undefined>;
|
|
448
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
449
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
450
|
+
}, undefined>, undefined>;
|
|
451
|
+
readonly reply_to: v.NullableSchema<v.StrictObjectSchema<{
|
|
452
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
453
|
+
readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
454
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
455
|
+
readonly timestamp: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
456
|
+
readonly text: v.StringSchema<undefined>;
|
|
457
|
+
readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
|
|
458
|
+
readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
459
|
+
readonly kind: v.StringSchema<undefined>;
|
|
460
|
+
readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
461
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
462
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
463
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
464
|
+
readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
465
|
+
readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
466
|
+
readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
467
|
+
readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
468
|
+
readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
469
|
+
readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
470
|
+
readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
|
|
471
|
+
readonly origin: v.StringSchema<undefined>;
|
|
472
|
+
readonly extractor: v.StringSchema<undefined>;
|
|
473
|
+
readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
474
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
475
|
+
}, undefined>, undefined>;
|
|
476
|
+
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
477
|
+
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
478
|
+
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
479
|
+
readonly text: v.StringSchema<undefined>;
|
|
480
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
481
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
482
|
+
}, undefined>, undefined>;
|
|
483
|
+
readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
484
|
+
}, undefined>, undefined>;
|
|
485
|
+
readonly reply_to_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
486
|
+
readonly forwarded_from: v.NullableSchema<v.StrictObjectSchema<{
|
|
487
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
488
|
+
readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
489
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
490
|
+
readonly timestamp: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
491
|
+
readonly text: v.StringSchema<undefined>;
|
|
492
|
+
readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
|
|
493
|
+
readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
494
|
+
readonly kind: v.StringSchema<undefined>;
|
|
495
|
+
readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
496
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
497
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
498
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
499
|
+
readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
500
|
+
readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
501
|
+
readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
502
|
+
readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
503
|
+
readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
504
|
+
readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
505
|
+
readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
|
|
506
|
+
readonly origin: v.StringSchema<undefined>;
|
|
507
|
+
readonly extractor: v.StringSchema<undefined>;
|
|
508
|
+
readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
509
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
510
|
+
}, undefined>, undefined>;
|
|
511
|
+
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
512
|
+
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
513
|
+
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
514
|
+
readonly text: v.StringSchema<undefined>;
|
|
515
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
516
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
517
|
+
}, undefined>, undefined>;
|
|
518
|
+
readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
519
|
+
}, undefined>, undefined>;
|
|
520
|
+
readonly thread_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
521
|
+
readonly thread_root_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
522
|
+
readonly reactions: v.OptionalSchema<v.NullableSchema<v.StrictObjectSchema<{
|
|
523
|
+
readonly counts: v.ArraySchema<v.StrictObjectSchema<{
|
|
524
|
+
readonly reaction: v.StringSchema<undefined>;
|
|
525
|
+
readonly count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
526
|
+
}, undefined>, undefined>;
|
|
527
|
+
readonly mine: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
528
|
+
readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
529
|
+
}, undefined>, undefined>, undefined>;
|
|
530
|
+
readonly scheduled_for: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
531
|
+
readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
|
|
532
|
+
readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
|
|
533
|
+
readonly email: v.OptionalSchema<v.StrictObjectSchema<{
|
|
534
|
+
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
535
|
+
readonly from: v.NullableSchema<v.StrictObjectSchema<{
|
|
536
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
537
|
+
readonly address: v.StringSchema<undefined>;
|
|
538
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
539
|
+
}, undefined>, undefined>;
|
|
540
|
+
readonly to: v.ArraySchema<v.StrictObjectSchema<{
|
|
541
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
542
|
+
readonly address: v.StringSchema<undefined>;
|
|
543
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
544
|
+
}, undefined>, undefined>;
|
|
545
|
+
readonly cc: v.ArraySchema<v.StrictObjectSchema<{
|
|
546
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
547
|
+
readonly address: v.StringSchema<undefined>;
|
|
548
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
549
|
+
}, undefined>, undefined>;
|
|
550
|
+
readonly bcc: v.ArraySchema<v.StrictObjectSchema<{
|
|
551
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
552
|
+
readonly address: v.StringSchema<undefined>;
|
|
553
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
554
|
+
}, undefined>, undefined>;
|
|
555
|
+
readonly reply_addresses: v.ArraySchema<v.StrictObjectSchema<{
|
|
556
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
557
|
+
readonly address: v.StringSchema<undefined>;
|
|
558
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
559
|
+
}, undefined>, undefined>;
|
|
560
|
+
readonly labels: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
561
|
+
readonly thread: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
562
|
+
readonly read: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
563
|
+
readonly flagged: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
564
|
+
readonly sender_score: v.OptionalSchema<v.StrictObjectSchema<{
|
|
565
|
+
readonly score: v.NumberSchema<undefined>;
|
|
566
|
+
readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
567
|
+
readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
|
|
568
|
+
}, undefined>, undefined>;
|
|
569
|
+
}, undefined>, undefined>;
|
|
570
|
+
readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
571
|
+
}, undefined>;
|
|
572
|
+
/** An album's messages, in order; `message` is the first. Absent for a single message. */
|
|
573
|
+
readonly messages: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
574
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
575
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
576
|
+
readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
577
|
+
readonly account: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
578
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
579
|
+
readonly chat_title: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
580
|
+
readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
581
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
582
|
+
readonly sender_username: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
583
|
+
readonly sender_is_chat: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
584
|
+
readonly mentions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
|
|
585
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
586
|
+
readonly edited_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
587
|
+
readonly text: v.StringSchema<undefined>;
|
|
588
|
+
readonly transcript: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
589
|
+
readonly anchor: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
590
|
+
readonly excerpt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
591
|
+
readonly matched_in: v.OptionalSchema<v.PicklistSchema<["text", "transcript", "filename", "file", "context", "picture"], undefined>, undefined>;
|
|
592
|
+
readonly score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
593
|
+
readonly match: v.OptionalSchema<v.PicklistSchema<["words", "beginnings", "corrected"], undefined>, undefined>;
|
|
594
|
+
readonly corrections: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
595
|
+
readonly from: v.StringSchema<undefined>;
|
|
596
|
+
readonly to: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
597
|
+
}, undefined>, undefined>, undefined>;
|
|
598
|
+
readonly found_in: v.OptionalSchema<v.PicklistSchema<["archive", "server", "both"], undefined>, undefined>;
|
|
599
|
+
readonly discovery: v.OptionalSchema<v.StrictObjectSchema<{
|
|
600
|
+
readonly coverage: v.NumberSchema<undefined>;
|
|
601
|
+
readonly matched_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
602
|
+
readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
603
|
+
readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
604
|
+
}, undefined>, undefined>;
|
|
605
|
+
readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
606
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
607
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
608
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
609
|
+
readonly text: v.StringSchema<undefined>;
|
|
610
|
+
}, undefined>, undefined>, undefined>;
|
|
611
|
+
readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
612
|
+
readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
|
|
613
|
+
readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
614
|
+
readonly kind: v.StringSchema<undefined>;
|
|
615
|
+
readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
616
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
617
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
618
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
619
|
+
readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
620
|
+
readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
621
|
+
readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
622
|
+
readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
623
|
+
readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
624
|
+
readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
625
|
+
readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
|
|
626
|
+
readonly origin: v.StringSchema<undefined>;
|
|
627
|
+
readonly extractor: v.StringSchema<undefined>;
|
|
628
|
+
readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
629
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
630
|
+
}, undefined>, undefined>;
|
|
631
|
+
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
632
|
+
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
633
|
+
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
634
|
+
readonly text: v.StringSchema<undefined>;
|
|
635
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
636
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
637
|
+
}, undefined>, undefined>;
|
|
638
|
+
readonly reply_to: v.NullableSchema<v.StrictObjectSchema<{
|
|
639
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
640
|
+
readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
641
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
642
|
+
readonly timestamp: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
643
|
+
readonly text: v.StringSchema<undefined>;
|
|
644
|
+
readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
|
|
645
|
+
readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
646
|
+
readonly kind: v.StringSchema<undefined>;
|
|
647
|
+
readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
648
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
649
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
650
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
651
|
+
readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
652
|
+
readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
653
|
+
readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
654
|
+
readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
655
|
+
readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
656
|
+
readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
657
|
+
readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
|
|
658
|
+
readonly origin: v.StringSchema<undefined>;
|
|
659
|
+
readonly extractor: v.StringSchema<undefined>;
|
|
660
|
+
readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
661
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
662
|
+
}, undefined>, undefined>;
|
|
663
|
+
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
664
|
+
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
665
|
+
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
666
|
+
readonly text: v.StringSchema<undefined>;
|
|
667
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
668
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
669
|
+
}, undefined>, undefined>;
|
|
670
|
+
readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
671
|
+
}, undefined>, undefined>;
|
|
672
|
+
readonly reply_to_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
673
|
+
readonly forwarded_from: v.NullableSchema<v.StrictObjectSchema<{
|
|
674
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
675
|
+
readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
676
|
+
readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
677
|
+
readonly timestamp: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
678
|
+
readonly text: v.StringSchema<undefined>;
|
|
679
|
+
readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
|
|
680
|
+
readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
681
|
+
readonly kind: v.StringSchema<undefined>;
|
|
682
|
+
readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
683
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
684
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
685
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
686
|
+
readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
687
|
+
readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
688
|
+
readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
689
|
+
readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
690
|
+
readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
691
|
+
readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
692
|
+
readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
|
|
693
|
+
readonly origin: v.StringSchema<undefined>;
|
|
694
|
+
readonly extractor: v.StringSchema<undefined>;
|
|
695
|
+
readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
696
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
697
|
+
}, undefined>, undefined>;
|
|
698
|
+
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
699
|
+
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
700
|
+
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
701
|
+
readonly text: v.StringSchema<undefined>;
|
|
702
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
703
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
704
|
+
}, undefined>, undefined>;
|
|
705
|
+
readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
706
|
+
}, undefined>, undefined>;
|
|
707
|
+
readonly thread_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
708
|
+
readonly thread_root_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
709
|
+
readonly reactions: v.OptionalSchema<v.NullableSchema<v.StrictObjectSchema<{
|
|
710
|
+
readonly counts: v.ArraySchema<v.StrictObjectSchema<{
|
|
711
|
+
readonly reaction: v.StringSchema<undefined>;
|
|
712
|
+
readonly count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
713
|
+
}, undefined>, undefined>;
|
|
714
|
+
readonly mine: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
715
|
+
readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
716
|
+
}, undefined>, undefined>, undefined>;
|
|
717
|
+
readonly scheduled_for: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
718
|
+
readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
|
|
719
|
+
readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
|
|
720
|
+
readonly email: v.OptionalSchema<v.StrictObjectSchema<{
|
|
721
|
+
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
722
|
+
readonly from: v.NullableSchema<v.StrictObjectSchema<{
|
|
723
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
724
|
+
readonly address: v.StringSchema<undefined>;
|
|
725
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
726
|
+
}, undefined>, undefined>;
|
|
727
|
+
readonly to: v.ArraySchema<v.StrictObjectSchema<{
|
|
728
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
729
|
+
readonly address: v.StringSchema<undefined>;
|
|
730
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
731
|
+
}, undefined>, undefined>;
|
|
732
|
+
readonly cc: v.ArraySchema<v.StrictObjectSchema<{
|
|
733
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
734
|
+
readonly address: v.StringSchema<undefined>;
|
|
735
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
736
|
+
}, undefined>, undefined>;
|
|
737
|
+
readonly bcc: v.ArraySchema<v.StrictObjectSchema<{
|
|
738
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
739
|
+
readonly address: v.StringSchema<undefined>;
|
|
740
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
741
|
+
}, undefined>, undefined>;
|
|
742
|
+
readonly reply_addresses: v.ArraySchema<v.StrictObjectSchema<{
|
|
743
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
744
|
+
readonly address: v.StringSchema<undefined>;
|
|
745
|
+
readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
746
|
+
}, undefined>, undefined>;
|
|
747
|
+
readonly labels: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
748
|
+
readonly thread: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
749
|
+
readonly read: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
750
|
+
readonly flagged: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
751
|
+
readonly sender_score: v.OptionalSchema<v.StrictObjectSchema<{
|
|
752
|
+
readonly score: v.NumberSchema<undefined>;
|
|
753
|
+
readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
754
|
+
readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
|
|
755
|
+
}, undefined>, undefined>;
|
|
756
|
+
}, undefined>, undefined>;
|
|
757
|
+
readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
758
|
+
}, undefined>, undefined>, undefined>;
|
|
759
|
+
readonly scheduled_for: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
760
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
761
|
+
readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
762
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
763
|
+
readonly saved: v.LiteralSchema<true, undefined>;
|
|
764
|
+
}, undefined>], undefined>;
|
|
@@ -8,3 +8,9 @@ export const messageWrite = v.strictObject({
|
|
|
8
8
|
messages: v.optional(v.array(message)),
|
|
9
9
|
scheduled_for: v.optional(time),
|
|
10
10
|
});
|
|
11
|
+
export const draftWrite = v.strictObject({
|
|
12
|
+
operation_id: id,
|
|
13
|
+
chat_id: id,
|
|
14
|
+
saved: v.literal(true),
|
|
15
|
+
});
|
|
16
|
+
export const messageSend = v.union([messageWrite, draftWrite]);
|
|
@@ -110,6 +110,8 @@ export interface MessengerCore {
|
|
|
110
110
|
chat(chat: string): Promise<ChatCard>;
|
|
111
111
|
/** An option the messenger has no way to honour is refused, never dropped. */
|
|
112
112
|
send(chatId: Id, text: string, options: SendOptions): Promise<Sent>;
|
|
113
|
+
/** Save a nonempty draft for the owner to review and send; never sends a message. */
|
|
114
|
+
saveDraft?(chatId: Id, text: string, options: Pick<SendOptions, "replyTo" | "threadId" | "formatting" | "noPreview">): Promise<void>;
|
|
113
115
|
logout(): Promise<void>;
|
|
114
116
|
close(): Promise<void>;
|
|
115
117
|
}
|
package/dist/ports/traits.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface Fetching {
|
|
|
24
24
|
export type MediaOption = "spoiler" | "captionAbove" | "fileName";
|
|
25
25
|
/** What a messenger is and can do, as the services read it; the CLI's `Messenger` adds how its commands run. */
|
|
26
26
|
export interface MessengerTraits {
|
|
27
|
+
/** Opt in to `messages send --draft` only when the adapter implements `saveDraft`. */
|
|
28
|
+
drafts?: boolean;
|
|
27
29
|
counterFields?: readonly CounterField[];
|
|
28
30
|
app: AppIdentity;
|
|
29
31
|
provider: Provider;
|
package/dist/sends/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { type FloodDeadline, FloodMemory, type FloodState, FROZEN_HOLD_MS, flood
|
|
|
3
3
|
export { type Asker, type GuardRequest, guardFor, type SendGuard, type SendGuardOptions, sendGuard, sharedJournal, } from "./guard.js";
|
|
4
4
|
export { currentOperation, guardedWrite, type Operated } from "./guarded.js";
|
|
5
5
|
export { type AccountAction, type ChatAction, type SendEntry, SendJournal, type SendKind, type SendOutcome, sendsPathFor, } from "./journal.js";
|
|
6
|
-
export { assertStatsPermissionsCurrent, DEFAULT_PERMISSIONS, keyForCommand, keyForWrite, LEVELS, type Level, layerPermissions, levelFor, PERMISSIONS, type Permission, type PermissionKey, permissionFor, permissionOverrides, readKeysForCommand, skipFlagFor, WRITE_KEYS, } from "./permissions.js";
|
|
6
|
+
export { assertStatsPermissionsCurrent, CEILING_KEY, DEFAULT_PERMISSIONS, keyForCommand, keyForWrite, LEVELS, type Level, layerPermissions, levelFor, PERMISSIONS, type Permission, type PermissionKey, permissionFor, permissionOverrides, readKeysForCommand, skipFlagFor, WRITE_KEYS, } from "./permissions.js";
|
|
7
7
|
export { type Recipient, RecipientList, recipientsPathFor } from "./recipients.js";
|
|
8
8
|
export { newOperationId, newSendId } from "./send-id.js";
|
|
9
9
|
export { MAX_BUFFERED_UPLOAD_BYTES, readUpload, refusedPlace, uploadBlob, uploadBytes, uploadSize, } from "./upload.js";
|
package/dist/sends/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { FloodMemory, FROZEN_HOLD_MS, floodPathFor, LIMITED_HOLD_MS, } from "./f
|
|
|
2
2
|
export { guardFor, sendGuard, sharedJournal, } from "./guard.js";
|
|
3
3
|
export { currentOperation, guardedWrite } from "./guarded.js";
|
|
4
4
|
export { SendJournal, sendsPathFor, } from "./journal.js";
|
|
5
|
-
export { assertStatsPermissionsCurrent, DEFAULT_PERMISSIONS, keyForCommand, keyForWrite, LEVELS, layerPermissions, levelFor, PERMISSIONS, permissionFor, permissionOverrides, readKeysForCommand, skipFlagFor, WRITE_KEYS, } from "./permissions.js";
|
|
5
|
+
export { assertStatsPermissionsCurrent, CEILING_KEY, DEFAULT_PERMISSIONS, keyForCommand, keyForWrite, LEVELS, layerPermissions, levelFor, PERMISSIONS, permissionFor, permissionOverrides, readKeysForCommand, skipFlagFor, WRITE_KEYS, } from "./permissions.js";
|
|
6
6
|
export { RecipientList, recipientsPathFor } from "./recipients.js";
|
|
7
7
|
export { newOperationId, newSendId } from "./send-id.js";
|
|
8
8
|
export { MAX_BUFFERED_UPLOAD_BYTES, readUpload, refusedPlace, uploadBlob, uploadBytes, uploadSize, } from "./upload.js";
|
|
@@ -31,7 +31,7 @@ export declare const isBotApi: (path: readonly string[]) => boolean;
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const botApiAllowed: (levels: Readonly<Record<PermissionKey, Level>>) => boolean;
|
|
33
33
|
/** The resources at the top of the command tree, which `readOnly` and `allow` turn read-only as a whole. */
|
|
34
|
-
export declare const RESOURCES: readonly ["messages", "reactions", "polls", "topics", "chats", "contacts", "account", "bot", "conversations", "tags", "mentions", "search", "searches", "tasks", "replies", "attachments", "stats", "store", "metadata", "mcp", "server", "models", "schedule", "doctor", "images"];
|
|
34
|
+
export declare const RESOURCES: readonly ["messages", "drafts", "reactions", "polls", "topics", "chats", "contacts", "account", "bot", "conversations", "tags", "mentions", "search", "searches", "tasks", "replies", "attachments", "stats", "store", "metadata", "mcp", "server", "models", "schedule", "doctor", "images"];
|
|
35
35
|
/** The command path an old `allow` word stood for, as one key — what an MCP tool's `permission` is checked against. */
|
|
36
36
|
export declare const keyOfWord: (word: Permission) => PermissionKey;
|
|
37
37
|
/**
|
|
@@ -122,6 +122,7 @@ export const botApiAllowed = (levels) => {
|
|
|
122
122
|
/** The resources at the top of the command tree, which `readOnly` and `allow` turn read-only as a whole. */
|
|
123
123
|
export const RESOURCES = [
|
|
124
124
|
"messages",
|
|
125
|
+
"drafts",
|
|
125
126
|
"reactions",
|
|
126
127
|
"polls",
|
|
127
128
|
"topics",
|
|
@@ -316,6 +317,7 @@ export const writeOfKey = (key) => {
|
|
|
316
317
|
};
|
|
317
318
|
/** Write keys written out where a write is checked; `permission-keys.test.ts` keeps this list whole. */
|
|
318
319
|
const NAMED_WRITE_KEYS = [
|
|
320
|
+
"drafts",
|
|
319
321
|
"store.gaps.repair",
|
|
320
322
|
"messages.sync-first",
|
|
321
323
|
"messages.server-search",
|
|
@@ -159,6 +159,7 @@ export interface SendRequest {
|
|
|
159
159
|
/** A post of `chat`, a channel: the message goes to the post's discussion as a reply to it. */
|
|
160
160
|
commentTo?: Id;
|
|
161
161
|
}
|
|
162
|
+
export type DraftRequest = Pick<SendRequest, "chat" | "text" | "replyTo" | "threadId" | "markdown" | "html" | "noPreview">;
|
|
162
163
|
/** One message in a chat, as typed. */
|
|
163
164
|
export interface MessageTarget {
|
|
164
165
|
chat: string;
|
|
@@ -214,6 +215,10 @@ export interface MessagesService {
|
|
|
214
215
|
stats(query: SearchQuery & {
|
|
215
216
|
by: StatsGrouping;
|
|
216
217
|
}): Promise<MessageStats>;
|
|
218
|
+
saveDraft?(request: DraftRequest): Promise<Operated<{
|
|
219
|
+
chatId: Id;
|
|
220
|
+
saved: true;
|
|
221
|
+
}>>;
|
|
217
222
|
/** A reply is a send with `replyTo`. */
|
|
218
223
|
send(request: SendRequest): Promise<Operated<Sent>>;
|
|
219
224
|
/** With `markdown` or `html`, the marks are taken out as a send takes them. */
|
|
@@ -250,6 +250,29 @@ export const messagesService = (deps) => {
|
|
|
250
250
|
await remember(store, "stats", query);
|
|
251
251
|
return withRefresh(stats, refreshed);
|
|
252
252
|
}),
|
|
253
|
+
saveDraft: async ({ chat, text: typed, replyTo, threadId: typedThread, markdown, html, noPreview }) => {
|
|
254
|
+
if (typed.trim() === "")
|
|
255
|
+
throw new CliError("validation_error", "a draft needs nonempty text; clearing a draft is not supported");
|
|
256
|
+
const connection = await deps.connection();
|
|
257
|
+
const save = capability(connection, "saveDraft", "save a draft");
|
|
258
|
+
const prepared = await formatted(connection, typed, { markdown, html });
|
|
259
|
+
const { text, spans } = deps.agentText ? visibleFormattedText(prepared) : prepared;
|
|
260
|
+
if (text.trim() === "")
|
|
261
|
+
throw new CliError("validation_error", "a draft needs nonempty text after formatting");
|
|
262
|
+
const threadId = threadIdOf(typedThread);
|
|
263
|
+
const validate = threadId === undefined ? undefined : capability(connection, "validateThread", "save a draft in a forum topic");
|
|
264
|
+
const { id: chatId } = await connection.resolve(chat);
|
|
265
|
+
const operationId = newOperationId();
|
|
266
|
+
await guardedWrite(guard, { operationId, chatId, kind: "edit", key: "drafts", length: text.length }, () => save(chatId, text, {
|
|
267
|
+
...(replyTo === undefined ? {} : { replyTo }),
|
|
268
|
+
...(threadId === undefined ? {} : { threadId }),
|
|
269
|
+
...(spans.length === 0 ? {} : { formatting: spans }),
|
|
270
|
+
...(noPreview ? { noPreview } : {}),
|
|
271
|
+
}), undefined, validate === undefined || threadId === undefined
|
|
272
|
+
? undefined
|
|
273
|
+
: () => validate(chatId, threadId, { ...(replyTo === undefined ? {} : { replyTo }) }));
|
|
274
|
+
return { operationId, chatId, saved: true };
|
|
275
|
+
},
|
|
253
276
|
send: async ({ chat, text: typed, sendId, replyTo: typedReplyTo, threadId: typedThread, silent, noPreview, markdown, html, at, attachments = [], key, origin, spoiler, captionAbove, sendAs, commentTo, sticker, stickerFile, }) => {
|
|
254
277
|
const stickers = (sticker === undefined ? 0 : 1) + (stickerFile === undefined ? 0 : 1);
|
|
255
278
|
if (stickers > 0 && (stickers > 1 || typed.trim() !== "" || attachments.length > 0 || markdown || html))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.405.0",
|
|
4
4
|
"description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|