@spectrum-ts/core 8.1.1 → 8.2.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.
|
@@ -447,6 +447,9 @@ interface Message<TPlatform extends string = string, TSender extends User = User
|
|
|
447
447
|
declare const editSchema: z.ZodObject<{
|
|
448
448
|
type: z.ZodLiteral<"edit">;
|
|
449
449
|
content: z.ZodCustom<{
|
|
450
|
+
type: "group";
|
|
451
|
+
items: Message<string, User, Space<unknown>>[];
|
|
452
|
+
} | {
|
|
450
453
|
type: "text";
|
|
451
454
|
text: string;
|
|
452
455
|
} | {
|
|
@@ -460,6 +463,26 @@ declare const editSchema: z.ZodObject<{
|
|
|
460
463
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
461
464
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
462
465
|
size?: number | undefined;
|
|
466
|
+
} | {
|
|
467
|
+
type: "poll";
|
|
468
|
+
title: string;
|
|
469
|
+
options: {
|
|
470
|
+
title: string;
|
|
471
|
+
}[];
|
|
472
|
+
} | {
|
|
473
|
+
type: "poll_option";
|
|
474
|
+
option: {
|
|
475
|
+
title: string;
|
|
476
|
+
};
|
|
477
|
+
poll: {
|
|
478
|
+
type: "poll";
|
|
479
|
+
title: string;
|
|
480
|
+
options: {
|
|
481
|
+
title: string;
|
|
482
|
+
}[];
|
|
483
|
+
};
|
|
484
|
+
selected: boolean;
|
|
485
|
+
title: string;
|
|
463
486
|
} | {
|
|
464
487
|
type: "contact";
|
|
465
488
|
user?: {
|
|
@@ -503,36 +526,20 @@ declare const editSchema: z.ZodObject<{
|
|
|
503
526
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
504
527
|
} | undefined;
|
|
505
528
|
raw?: unknown;
|
|
529
|
+
} | {
|
|
530
|
+
type: "reaction";
|
|
531
|
+
emoji: string;
|
|
532
|
+
target: Message<string, User, Space<unknown>>;
|
|
506
533
|
} | {
|
|
507
534
|
type: "custom";
|
|
508
535
|
raw: unknown;
|
|
509
536
|
} | {
|
|
510
|
-
type: "
|
|
511
|
-
|
|
512
|
-
options: {
|
|
513
|
-
title: string;
|
|
514
|
-
}[];
|
|
515
|
-
} | {
|
|
516
|
-
type: "poll_option";
|
|
517
|
-
option: {
|
|
518
|
-
title: string;
|
|
519
|
-
};
|
|
520
|
-
poll: {
|
|
521
|
-
type: "poll";
|
|
522
|
-
title: string;
|
|
523
|
-
options: {
|
|
524
|
-
title: string;
|
|
525
|
-
}[];
|
|
526
|
-
};
|
|
527
|
-
selected: boolean;
|
|
528
|
-
title: string;
|
|
529
|
-
} | {
|
|
530
|
-
type: "group";
|
|
531
|
-
items: Message<string, User, Space<unknown>>[];
|
|
537
|
+
type: "richlink";
|
|
538
|
+
url: string;
|
|
532
539
|
} | {
|
|
533
|
-
type: "
|
|
534
|
-
|
|
535
|
-
|
|
540
|
+
type: "streamText";
|
|
541
|
+
stream: () => AsyncIterable<string>;
|
|
542
|
+
format?: "markdown" | "plain" | undefined;
|
|
536
543
|
} | {
|
|
537
544
|
type: "voice";
|
|
538
545
|
mimeType: string;
|
|
@@ -541,13 +548,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
541
548
|
name?: string | undefined;
|
|
542
549
|
duration?: number | undefined;
|
|
543
550
|
size?: number | undefined;
|
|
544
|
-
} | {
|
|
545
|
-
type: "richlink";
|
|
546
|
-
url: string;
|
|
547
|
-
} | {
|
|
548
|
-
type: "streamText";
|
|
549
|
-
stream: () => AsyncIterable<string>;
|
|
550
|
-
format?: "markdown" | "plain" | undefined;
|
|
551
551
|
} | {
|
|
552
552
|
type: "app";
|
|
553
553
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -595,6 +595,9 @@ declare const editSchema: z.ZodObject<{
|
|
|
595
595
|
kind: "clear";
|
|
596
596
|
};
|
|
597
597
|
}, {
|
|
598
|
+
type: "group";
|
|
599
|
+
items: Message<string, User, Space<unknown>>[];
|
|
600
|
+
} | {
|
|
598
601
|
type: "text";
|
|
599
602
|
text: string;
|
|
600
603
|
} | {
|
|
@@ -608,6 +611,26 @@ declare const editSchema: z.ZodObject<{
|
|
|
608
611
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
609
612
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
610
613
|
size?: number | undefined;
|
|
614
|
+
} | {
|
|
615
|
+
type: "poll";
|
|
616
|
+
title: string;
|
|
617
|
+
options: {
|
|
618
|
+
title: string;
|
|
619
|
+
}[];
|
|
620
|
+
} | {
|
|
621
|
+
type: "poll_option";
|
|
622
|
+
option: {
|
|
623
|
+
title: string;
|
|
624
|
+
};
|
|
625
|
+
poll: {
|
|
626
|
+
type: "poll";
|
|
627
|
+
title: string;
|
|
628
|
+
options: {
|
|
629
|
+
title: string;
|
|
630
|
+
}[];
|
|
631
|
+
};
|
|
632
|
+
selected: boolean;
|
|
633
|
+
title: string;
|
|
611
634
|
} | {
|
|
612
635
|
type: "contact";
|
|
613
636
|
user?: {
|
|
@@ -651,36 +674,20 @@ declare const editSchema: z.ZodObject<{
|
|
|
651
674
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
652
675
|
} | undefined;
|
|
653
676
|
raw?: unknown;
|
|
677
|
+
} | {
|
|
678
|
+
type: "reaction";
|
|
679
|
+
emoji: string;
|
|
680
|
+
target: Message<string, User, Space<unknown>>;
|
|
654
681
|
} | {
|
|
655
682
|
type: "custom";
|
|
656
683
|
raw: unknown;
|
|
657
684
|
} | {
|
|
658
|
-
type: "
|
|
659
|
-
|
|
660
|
-
options: {
|
|
661
|
-
title: string;
|
|
662
|
-
}[];
|
|
663
|
-
} | {
|
|
664
|
-
type: "poll_option";
|
|
665
|
-
option: {
|
|
666
|
-
title: string;
|
|
667
|
-
};
|
|
668
|
-
poll: {
|
|
669
|
-
type: "poll";
|
|
670
|
-
title: string;
|
|
671
|
-
options: {
|
|
672
|
-
title: string;
|
|
673
|
-
}[];
|
|
674
|
-
};
|
|
675
|
-
selected: boolean;
|
|
676
|
-
title: string;
|
|
677
|
-
} | {
|
|
678
|
-
type: "group";
|
|
679
|
-
items: Message<string, User, Space<unknown>>[];
|
|
685
|
+
type: "richlink";
|
|
686
|
+
url: string;
|
|
680
687
|
} | {
|
|
681
|
-
type: "
|
|
682
|
-
|
|
683
|
-
|
|
688
|
+
type: "streamText";
|
|
689
|
+
stream: () => AsyncIterable<string>;
|
|
690
|
+
format?: "markdown" | "plain" | undefined;
|
|
684
691
|
} | {
|
|
685
692
|
type: "voice";
|
|
686
693
|
mimeType: string;
|
|
@@ -689,13 +696,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
689
696
|
name?: string | undefined;
|
|
690
697
|
duration?: number | undefined;
|
|
691
698
|
size?: number | undefined;
|
|
692
|
-
} | {
|
|
693
|
-
type: "richlink";
|
|
694
|
-
url: string;
|
|
695
|
-
} | {
|
|
696
|
-
type: "streamText";
|
|
697
|
-
stream: () => AsyncIterable<string>;
|
|
698
|
-
format?: "markdown" | "plain" | undefined;
|
|
699
699
|
} | {
|
|
700
700
|
type: "app";
|
|
701
701
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -968,6 +968,9 @@ declare function rename(displayName: string): ContentBuilder;
|
|
|
968
968
|
declare const replySchema: z.ZodObject<{
|
|
969
969
|
type: z.ZodLiteral<"reply">;
|
|
970
970
|
content: z.ZodCustom<{
|
|
971
|
+
type: "group";
|
|
972
|
+
items: Message<string, User, Space<unknown>>[];
|
|
973
|
+
} | {
|
|
971
974
|
type: "text";
|
|
972
975
|
text: string;
|
|
973
976
|
} | {
|
|
@@ -981,6 +984,26 @@ declare const replySchema: z.ZodObject<{
|
|
|
981
984
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
982
985
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
983
986
|
size?: number | undefined;
|
|
987
|
+
} | {
|
|
988
|
+
type: "poll";
|
|
989
|
+
title: string;
|
|
990
|
+
options: {
|
|
991
|
+
title: string;
|
|
992
|
+
}[];
|
|
993
|
+
} | {
|
|
994
|
+
type: "poll_option";
|
|
995
|
+
option: {
|
|
996
|
+
title: string;
|
|
997
|
+
};
|
|
998
|
+
poll: {
|
|
999
|
+
type: "poll";
|
|
1000
|
+
title: string;
|
|
1001
|
+
options: {
|
|
1002
|
+
title: string;
|
|
1003
|
+
}[];
|
|
1004
|
+
};
|
|
1005
|
+
selected: boolean;
|
|
1006
|
+
title: string;
|
|
984
1007
|
} | {
|
|
985
1008
|
type: "contact";
|
|
986
1009
|
user?: {
|
|
@@ -1024,36 +1047,20 @@ declare const replySchema: z.ZodObject<{
|
|
|
1024
1047
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1025
1048
|
} | undefined;
|
|
1026
1049
|
raw?: unknown;
|
|
1050
|
+
} | {
|
|
1051
|
+
type: "reaction";
|
|
1052
|
+
emoji: string;
|
|
1053
|
+
target: Message<string, User, Space<unknown>>;
|
|
1027
1054
|
} | {
|
|
1028
1055
|
type: "custom";
|
|
1029
1056
|
raw: unknown;
|
|
1030
1057
|
} | {
|
|
1031
|
-
type: "
|
|
1032
|
-
|
|
1033
|
-
options: {
|
|
1034
|
-
title: string;
|
|
1035
|
-
}[];
|
|
1036
|
-
} | {
|
|
1037
|
-
type: "poll_option";
|
|
1038
|
-
option: {
|
|
1039
|
-
title: string;
|
|
1040
|
-
};
|
|
1041
|
-
poll: {
|
|
1042
|
-
type: "poll";
|
|
1043
|
-
title: string;
|
|
1044
|
-
options: {
|
|
1045
|
-
title: string;
|
|
1046
|
-
}[];
|
|
1047
|
-
};
|
|
1048
|
-
selected: boolean;
|
|
1049
|
-
title: string;
|
|
1050
|
-
} | {
|
|
1051
|
-
type: "group";
|
|
1052
|
-
items: Message<string, User, Space<unknown>>[];
|
|
1058
|
+
type: "richlink";
|
|
1059
|
+
url: string;
|
|
1053
1060
|
} | {
|
|
1054
|
-
type: "
|
|
1055
|
-
|
|
1056
|
-
|
|
1061
|
+
type: "streamText";
|
|
1062
|
+
stream: () => AsyncIterable<string>;
|
|
1063
|
+
format?: "markdown" | "plain" | undefined;
|
|
1057
1064
|
} | {
|
|
1058
1065
|
type: "voice";
|
|
1059
1066
|
mimeType: string;
|
|
@@ -1062,13 +1069,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1062
1069
|
name?: string | undefined;
|
|
1063
1070
|
duration?: number | undefined;
|
|
1064
1071
|
size?: number | undefined;
|
|
1065
|
-
} | {
|
|
1066
|
-
type: "richlink";
|
|
1067
|
-
url: string;
|
|
1068
|
-
} | {
|
|
1069
|
-
type: "streamText";
|
|
1070
|
-
stream: () => AsyncIterable<string>;
|
|
1071
|
-
format?: "markdown" | "plain" | undefined;
|
|
1072
1072
|
} | {
|
|
1073
1073
|
type: "app";
|
|
1074
1074
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1116,6 +1116,9 @@ declare const replySchema: z.ZodObject<{
|
|
|
1116
1116
|
kind: "clear";
|
|
1117
1117
|
};
|
|
1118
1118
|
}, {
|
|
1119
|
+
type: "group";
|
|
1120
|
+
items: Message<string, User, Space<unknown>>[];
|
|
1121
|
+
} | {
|
|
1119
1122
|
type: "text";
|
|
1120
1123
|
text: string;
|
|
1121
1124
|
} | {
|
|
@@ -1129,6 +1132,26 @@ declare const replySchema: z.ZodObject<{
|
|
|
1129
1132
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1130
1133
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1131
1134
|
size?: number | undefined;
|
|
1135
|
+
} | {
|
|
1136
|
+
type: "poll";
|
|
1137
|
+
title: string;
|
|
1138
|
+
options: {
|
|
1139
|
+
title: string;
|
|
1140
|
+
}[];
|
|
1141
|
+
} | {
|
|
1142
|
+
type: "poll_option";
|
|
1143
|
+
option: {
|
|
1144
|
+
title: string;
|
|
1145
|
+
};
|
|
1146
|
+
poll: {
|
|
1147
|
+
type: "poll";
|
|
1148
|
+
title: string;
|
|
1149
|
+
options: {
|
|
1150
|
+
title: string;
|
|
1151
|
+
}[];
|
|
1152
|
+
};
|
|
1153
|
+
selected: boolean;
|
|
1154
|
+
title: string;
|
|
1132
1155
|
} | {
|
|
1133
1156
|
type: "contact";
|
|
1134
1157
|
user?: {
|
|
@@ -1172,36 +1195,20 @@ declare const replySchema: z.ZodObject<{
|
|
|
1172
1195
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1173
1196
|
} | undefined;
|
|
1174
1197
|
raw?: unknown;
|
|
1198
|
+
} | {
|
|
1199
|
+
type: "reaction";
|
|
1200
|
+
emoji: string;
|
|
1201
|
+
target: Message<string, User, Space<unknown>>;
|
|
1175
1202
|
} | {
|
|
1176
1203
|
type: "custom";
|
|
1177
1204
|
raw: unknown;
|
|
1178
1205
|
} | {
|
|
1179
|
-
type: "
|
|
1180
|
-
|
|
1181
|
-
options: {
|
|
1182
|
-
title: string;
|
|
1183
|
-
}[];
|
|
1184
|
-
} | {
|
|
1185
|
-
type: "poll_option";
|
|
1186
|
-
option: {
|
|
1187
|
-
title: string;
|
|
1188
|
-
};
|
|
1189
|
-
poll: {
|
|
1190
|
-
type: "poll";
|
|
1191
|
-
title: string;
|
|
1192
|
-
options: {
|
|
1193
|
-
title: string;
|
|
1194
|
-
}[];
|
|
1195
|
-
};
|
|
1196
|
-
selected: boolean;
|
|
1197
|
-
title: string;
|
|
1198
|
-
} | {
|
|
1199
|
-
type: "group";
|
|
1200
|
-
items: Message<string, User, Space<unknown>>[];
|
|
1206
|
+
type: "richlink";
|
|
1207
|
+
url: string;
|
|
1201
1208
|
} | {
|
|
1202
|
-
type: "
|
|
1203
|
-
|
|
1204
|
-
|
|
1209
|
+
type: "streamText";
|
|
1210
|
+
stream: () => AsyncIterable<string>;
|
|
1211
|
+
format?: "markdown" | "plain" | undefined;
|
|
1205
1212
|
} | {
|
|
1206
1213
|
type: "voice";
|
|
1207
1214
|
mimeType: string;
|
|
@@ -1210,13 +1217,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1210
1217
|
name?: string | undefined;
|
|
1211
1218
|
duration?: number | undefined;
|
|
1212
1219
|
size?: number | undefined;
|
|
1213
|
-
} | {
|
|
1214
|
-
type: "richlink";
|
|
1215
|
-
url: string;
|
|
1216
|
-
} | {
|
|
1217
|
-
type: "streamText";
|
|
1218
|
-
stream: () => AsyncIterable<string>;
|
|
1219
|
-
format?: "markdown" | "plain" | undefined;
|
|
1220
1220
|
} | {
|
|
1221
1221
|
type: "app";
|
|
1222
1222
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1267,6 +1267,10 @@ declare const replySchema: z.ZodObject<{
|
|
|
1267
1267
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
1268
1268
|
}, z.core.$strip>;
|
|
1269
1269
|
type Reply = z.infer<typeof replySchema>;
|
|
1270
|
+
declare const asReply: (input: {
|
|
1271
|
+
content: BaseContent;
|
|
1272
|
+
target: Message;
|
|
1273
|
+
}) => Reply;
|
|
1270
1274
|
declare function reply(content: ContentInput, target: Message | undefined): ContentBuilder;
|
|
1271
1275
|
//#endregion
|
|
1272
1276
|
//#region src/content/resolve.d.ts
|
|
@@ -6681,6 +6685,175 @@ declare const fromVCard: (vcf: string) => ContactInput;
|
|
|
6681
6685
|
declare const toVCard: (contact: Contact) => Promise<string>;
|
|
6682
6686
|
//#endregion
|
|
6683
6687
|
//#region src/content/types.d.ts
|
|
6688
|
+
declare const baseContentSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
6689
|
+
type: z.ZodLiteral<"text">;
|
|
6690
|
+
text: z.ZodString;
|
|
6691
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6692
|
+
type: z.ZodLiteral<"markdown">;
|
|
6693
|
+
markdown: z.ZodString;
|
|
6694
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6695
|
+
type: z.ZodLiteral<"streamText">;
|
|
6696
|
+
stream: z.ZodCustom<() => AsyncIterable<string>, () => AsyncIterable<string>>;
|
|
6697
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
6698
|
+
markdown: "markdown";
|
|
6699
|
+
plain: "plain";
|
|
6700
|
+
}>>;
|
|
6701
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6702
|
+
type: z.ZodLiteral<"custom">;
|
|
6703
|
+
raw: z.ZodUnknown;
|
|
6704
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6705
|
+
type: z.ZodLiteral<"attachment">;
|
|
6706
|
+
id: z.ZodString;
|
|
6707
|
+
name: z.ZodString;
|
|
6708
|
+
mimeType: z.ZodString;
|
|
6709
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
6710
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6711
|
+
stream: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
6712
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6713
|
+
type: z.ZodLiteral<"contact">;
|
|
6714
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
6715
|
+
__platform: z.ZodString;
|
|
6716
|
+
id: z.ZodString;
|
|
6717
|
+
}, z.core.$strip>>;
|
|
6718
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
6719
|
+
formatted: z.ZodOptional<z.ZodString>;
|
|
6720
|
+
first: z.ZodOptional<z.ZodString>;
|
|
6721
|
+
last: z.ZodOptional<z.ZodString>;
|
|
6722
|
+
middle: z.ZodOptional<z.ZodString>;
|
|
6723
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
6724
|
+
suffix: z.ZodOptional<z.ZodString>;
|
|
6725
|
+
}, z.core.$strip>>;
|
|
6726
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6727
|
+
value: z.ZodString;
|
|
6728
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
6729
|
+
mobile: "mobile";
|
|
6730
|
+
home: "home";
|
|
6731
|
+
work: "work";
|
|
6732
|
+
other: "other";
|
|
6733
|
+
}>>;
|
|
6734
|
+
}, z.core.$strip>>>;
|
|
6735
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6736
|
+
value: z.ZodString;
|
|
6737
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
6738
|
+
home: "home";
|
|
6739
|
+
work: "work";
|
|
6740
|
+
other: "other";
|
|
6741
|
+
}>>;
|
|
6742
|
+
}, z.core.$strip>>>;
|
|
6743
|
+
addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6744
|
+
street: z.ZodOptional<z.ZodString>;
|
|
6745
|
+
city: z.ZodOptional<z.ZodString>;
|
|
6746
|
+
region: z.ZodOptional<z.ZodString>;
|
|
6747
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
6748
|
+
country: z.ZodOptional<z.ZodString>;
|
|
6749
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
6750
|
+
home: "home";
|
|
6751
|
+
work: "work";
|
|
6752
|
+
other: "other";
|
|
6753
|
+
}>>;
|
|
6754
|
+
}, z.core.$strip>>>;
|
|
6755
|
+
org: z.ZodOptional<z.ZodObject<{
|
|
6756
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6757
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6758
|
+
department: z.ZodOptional<z.ZodString>;
|
|
6759
|
+
}, z.core.$strip>>;
|
|
6760
|
+
urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6761
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
6762
|
+
note: z.ZodOptional<z.ZodString>;
|
|
6763
|
+
photo: z.ZodOptional<z.ZodObject<{
|
|
6764
|
+
mimeType: z.ZodString;
|
|
6765
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6766
|
+
}, z.core.$strip>>;
|
|
6767
|
+
raw: z.ZodOptional<z.ZodUnknown>;
|
|
6768
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6769
|
+
type: z.ZodLiteral<"voice">;
|
|
6770
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6771
|
+
mimeType: z.ZodString;
|
|
6772
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
6773
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
6774
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6775
|
+
stream: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
6776
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6777
|
+
type: z.ZodLiteral<"richlink">;
|
|
6778
|
+
url: z.ZodURL;
|
|
6779
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6780
|
+
type: z.ZodLiteral<"app">;
|
|
6781
|
+
url: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
6782
|
+
layout: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodObject<{
|
|
6783
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
6784
|
+
subcaption: z.ZodOptional<z.ZodString>;
|
|
6785
|
+
trailingCaption: z.ZodOptional<z.ZodString>;
|
|
6786
|
+
trailingSubcaption: z.ZodOptional<z.ZodString>;
|
|
6787
|
+
image: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
6788
|
+
imageTitle: z.ZodOptional<z.ZodString>;
|
|
6789
|
+
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
6790
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
6791
|
+
}, z.core.$strip>>>;
|
|
6792
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6793
|
+
type: z.ZodLiteral<"reaction">;
|
|
6794
|
+
emoji: z.ZodString;
|
|
6795
|
+
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
6796
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6797
|
+
type: z.ZodLiteral<"group">;
|
|
6798
|
+
items: z.ZodArray<z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>>;
|
|
6799
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6800
|
+
type: z.ZodLiteral<"poll">;
|
|
6801
|
+
title: z.ZodString;
|
|
6802
|
+
options: z.ZodArray<z.ZodObject<{
|
|
6803
|
+
title: z.ZodString;
|
|
6804
|
+
}, z.core.$strip>>;
|
|
6805
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6806
|
+
type: z.ZodLiteral<"poll_option">;
|
|
6807
|
+
option: z.ZodObject<{
|
|
6808
|
+
title: z.ZodString;
|
|
6809
|
+
}, z.core.$strip>;
|
|
6810
|
+
poll: z.ZodObject<{
|
|
6811
|
+
type: z.ZodLiteral<"poll">;
|
|
6812
|
+
title: z.ZodString;
|
|
6813
|
+
options: z.ZodArray<z.ZodObject<{
|
|
6814
|
+
title: z.ZodString;
|
|
6815
|
+
}, z.core.$strip>>;
|
|
6816
|
+
}, z.core.$strip>;
|
|
6817
|
+
selected: z.ZodBoolean;
|
|
6818
|
+
title: z.ZodString;
|
|
6819
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6820
|
+
type: z.ZodLiteral<"effect">;
|
|
6821
|
+
content: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6822
|
+
type: z.ZodLiteral<"text">;
|
|
6823
|
+
text: z.ZodString;
|
|
6824
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6825
|
+
type: z.ZodLiteral<"markdown">;
|
|
6826
|
+
markdown: z.ZodString;
|
|
6827
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6828
|
+
type: z.ZodLiteral<"attachment">;
|
|
6829
|
+
id: z.ZodString;
|
|
6830
|
+
name: z.ZodString;
|
|
6831
|
+
mimeType: z.ZodString;
|
|
6832
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
6833
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6834
|
+
stream: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
6835
|
+
}, z.core.$strip>], "type">;
|
|
6836
|
+
effect: z.ZodString;
|
|
6837
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6838
|
+
type: z.ZodLiteral<"typing">;
|
|
6839
|
+
state: z.ZodEnum<{
|
|
6840
|
+
start: "start";
|
|
6841
|
+
stop: "stop";
|
|
6842
|
+
}>;
|
|
6843
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6844
|
+
type: z.ZodLiteral<"rename">;
|
|
6845
|
+
displayName: z.ZodString;
|
|
6846
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6847
|
+
type: z.ZodLiteral<"avatar">;
|
|
6848
|
+
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6849
|
+
kind: z.ZodLiteral<"set">;
|
|
6850
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6851
|
+
mimeType: z.ZodString;
|
|
6852
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6853
|
+
kind: z.ZodLiteral<"clear">;
|
|
6854
|
+
}, z.core.$strip>], "kind">;
|
|
6855
|
+
}, z.core.$strip>], "type">;
|
|
6856
|
+
type BaseContent = z.infer<typeof baseContentSchema>;
|
|
6684
6857
|
declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6685
6858
|
type: z.ZodLiteral<"text">;
|
|
6686
6859
|
text: z.ZodString;
|
|
@@ -6851,6 +7024,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6851
7024
|
}, z.core.$strip>, z.ZodObject<{
|
|
6852
7025
|
type: z.ZodLiteral<"reply">;
|
|
6853
7026
|
content: z.ZodCustom<{
|
|
7027
|
+
type: "group";
|
|
7028
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7029
|
+
} | {
|
|
6854
7030
|
type: "text";
|
|
6855
7031
|
text: string;
|
|
6856
7032
|
} | {
|
|
@@ -6864,6 +7040,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6864
7040
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6865
7041
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
6866
7042
|
size?: number | undefined;
|
|
7043
|
+
} | {
|
|
7044
|
+
type: "poll";
|
|
7045
|
+
title: string;
|
|
7046
|
+
options: {
|
|
7047
|
+
title: string;
|
|
7048
|
+
}[];
|
|
7049
|
+
} | {
|
|
7050
|
+
type: "poll_option";
|
|
7051
|
+
option: {
|
|
7052
|
+
title: string;
|
|
7053
|
+
};
|
|
7054
|
+
poll: {
|
|
7055
|
+
type: "poll";
|
|
7056
|
+
title: string;
|
|
7057
|
+
options: {
|
|
7058
|
+
title: string;
|
|
7059
|
+
}[];
|
|
7060
|
+
};
|
|
7061
|
+
selected: boolean;
|
|
7062
|
+
title: string;
|
|
6867
7063
|
} | {
|
|
6868
7064
|
type: "contact";
|
|
6869
7065
|
user?: {
|
|
@@ -6907,36 +7103,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6907
7103
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6908
7104
|
} | undefined;
|
|
6909
7105
|
raw?: unknown;
|
|
7106
|
+
} | {
|
|
7107
|
+
type: "reaction";
|
|
7108
|
+
emoji: string;
|
|
7109
|
+
target: Message<string, User, Space<unknown>>;
|
|
6910
7110
|
} | {
|
|
6911
7111
|
type: "custom";
|
|
6912
7112
|
raw: unknown;
|
|
6913
7113
|
} | {
|
|
6914
|
-
type: "
|
|
6915
|
-
|
|
6916
|
-
options: {
|
|
6917
|
-
title: string;
|
|
6918
|
-
}[];
|
|
6919
|
-
} | {
|
|
6920
|
-
type: "poll_option";
|
|
6921
|
-
option: {
|
|
6922
|
-
title: string;
|
|
6923
|
-
};
|
|
6924
|
-
poll: {
|
|
6925
|
-
type: "poll";
|
|
6926
|
-
title: string;
|
|
6927
|
-
options: {
|
|
6928
|
-
title: string;
|
|
6929
|
-
}[];
|
|
6930
|
-
};
|
|
6931
|
-
selected: boolean;
|
|
6932
|
-
title: string;
|
|
6933
|
-
} | {
|
|
6934
|
-
type: "group";
|
|
6935
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7114
|
+
type: "richlink";
|
|
7115
|
+
url: string;
|
|
6936
7116
|
} | {
|
|
6937
|
-
type: "
|
|
6938
|
-
|
|
6939
|
-
|
|
7117
|
+
type: "streamText";
|
|
7118
|
+
stream: () => AsyncIterable<string>;
|
|
7119
|
+
format?: "markdown" | "plain" | undefined;
|
|
6940
7120
|
} | {
|
|
6941
7121
|
type: "voice";
|
|
6942
7122
|
mimeType: string;
|
|
@@ -6945,13 +7125,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6945
7125
|
name?: string | undefined;
|
|
6946
7126
|
duration?: number | undefined;
|
|
6947
7127
|
size?: number | undefined;
|
|
6948
|
-
} | {
|
|
6949
|
-
type: "richlink";
|
|
6950
|
-
url: string;
|
|
6951
|
-
} | {
|
|
6952
|
-
type: "streamText";
|
|
6953
|
-
stream: () => AsyncIterable<string>;
|
|
6954
|
-
format?: "markdown" | "plain" | undefined;
|
|
6955
7128
|
} | {
|
|
6956
7129
|
type: "app";
|
|
6957
7130
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -6999,6 +7172,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6999
7172
|
kind: "clear";
|
|
7000
7173
|
};
|
|
7001
7174
|
}, {
|
|
7175
|
+
type: "group";
|
|
7176
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7177
|
+
} | {
|
|
7002
7178
|
type: "text";
|
|
7003
7179
|
text: string;
|
|
7004
7180
|
} | {
|
|
@@ -7012,6 +7188,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7012
7188
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7013
7189
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7014
7190
|
size?: number | undefined;
|
|
7191
|
+
} | {
|
|
7192
|
+
type: "poll";
|
|
7193
|
+
title: string;
|
|
7194
|
+
options: {
|
|
7195
|
+
title: string;
|
|
7196
|
+
}[];
|
|
7197
|
+
} | {
|
|
7198
|
+
type: "poll_option";
|
|
7199
|
+
option: {
|
|
7200
|
+
title: string;
|
|
7201
|
+
};
|
|
7202
|
+
poll: {
|
|
7203
|
+
type: "poll";
|
|
7204
|
+
title: string;
|
|
7205
|
+
options: {
|
|
7206
|
+
title: string;
|
|
7207
|
+
}[];
|
|
7208
|
+
};
|
|
7209
|
+
selected: boolean;
|
|
7210
|
+
title: string;
|
|
7015
7211
|
} | {
|
|
7016
7212
|
type: "contact";
|
|
7017
7213
|
user?: {
|
|
@@ -7055,36 +7251,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7055
7251
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7056
7252
|
} | undefined;
|
|
7057
7253
|
raw?: unknown;
|
|
7254
|
+
} | {
|
|
7255
|
+
type: "reaction";
|
|
7256
|
+
emoji: string;
|
|
7257
|
+
target: Message<string, User, Space<unknown>>;
|
|
7058
7258
|
} | {
|
|
7059
7259
|
type: "custom";
|
|
7060
7260
|
raw: unknown;
|
|
7061
7261
|
} | {
|
|
7062
|
-
type: "
|
|
7063
|
-
|
|
7064
|
-
options: {
|
|
7065
|
-
title: string;
|
|
7066
|
-
}[];
|
|
7067
|
-
} | {
|
|
7068
|
-
type: "poll_option";
|
|
7069
|
-
option: {
|
|
7070
|
-
title: string;
|
|
7071
|
-
};
|
|
7072
|
-
poll: {
|
|
7073
|
-
type: "poll";
|
|
7074
|
-
title: string;
|
|
7075
|
-
options: {
|
|
7076
|
-
title: string;
|
|
7077
|
-
}[];
|
|
7078
|
-
};
|
|
7079
|
-
selected: boolean;
|
|
7080
|
-
title: string;
|
|
7081
|
-
} | {
|
|
7082
|
-
type: "group";
|
|
7083
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7262
|
+
type: "richlink";
|
|
7263
|
+
url: string;
|
|
7084
7264
|
} | {
|
|
7085
|
-
type: "
|
|
7086
|
-
|
|
7087
|
-
|
|
7265
|
+
type: "streamText";
|
|
7266
|
+
stream: () => AsyncIterable<string>;
|
|
7267
|
+
format?: "markdown" | "plain" | undefined;
|
|
7088
7268
|
} | {
|
|
7089
7269
|
type: "voice";
|
|
7090
7270
|
mimeType: string;
|
|
@@ -7093,13 +7273,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7093
7273
|
name?: string | undefined;
|
|
7094
7274
|
duration?: number | undefined;
|
|
7095
7275
|
size?: number | undefined;
|
|
7096
|
-
} | {
|
|
7097
|
-
type: "richlink";
|
|
7098
|
-
url: string;
|
|
7099
|
-
} | {
|
|
7100
|
-
type: "streamText";
|
|
7101
|
-
stream: () => AsyncIterable<string>;
|
|
7102
|
-
format?: "markdown" | "plain" | undefined;
|
|
7103
7276
|
} | {
|
|
7104
7277
|
type: "app";
|
|
7105
7278
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7151,6 +7324,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7151
7324
|
}, z.core.$strip>, z.ZodObject<{
|
|
7152
7325
|
type: z.ZodLiteral<"edit">;
|
|
7153
7326
|
content: z.ZodCustom<{
|
|
7327
|
+
type: "group";
|
|
7328
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7329
|
+
} | {
|
|
7154
7330
|
type: "text";
|
|
7155
7331
|
text: string;
|
|
7156
7332
|
} | {
|
|
@@ -7164,6 +7340,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7164
7340
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7165
7341
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7166
7342
|
size?: number | undefined;
|
|
7343
|
+
} | {
|
|
7344
|
+
type: "poll";
|
|
7345
|
+
title: string;
|
|
7346
|
+
options: {
|
|
7347
|
+
title: string;
|
|
7348
|
+
}[];
|
|
7349
|
+
} | {
|
|
7350
|
+
type: "poll_option";
|
|
7351
|
+
option: {
|
|
7352
|
+
title: string;
|
|
7353
|
+
};
|
|
7354
|
+
poll: {
|
|
7355
|
+
type: "poll";
|
|
7356
|
+
title: string;
|
|
7357
|
+
options: {
|
|
7358
|
+
title: string;
|
|
7359
|
+
}[];
|
|
7360
|
+
};
|
|
7361
|
+
selected: boolean;
|
|
7362
|
+
title: string;
|
|
7167
7363
|
} | {
|
|
7168
7364
|
type: "contact";
|
|
7169
7365
|
user?: {
|
|
@@ -7207,36 +7403,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7207
7403
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7208
7404
|
} | undefined;
|
|
7209
7405
|
raw?: unknown;
|
|
7406
|
+
} | {
|
|
7407
|
+
type: "reaction";
|
|
7408
|
+
emoji: string;
|
|
7409
|
+
target: Message<string, User, Space<unknown>>;
|
|
7210
7410
|
} | {
|
|
7211
7411
|
type: "custom";
|
|
7212
7412
|
raw: unknown;
|
|
7213
7413
|
} | {
|
|
7214
|
-
type: "
|
|
7215
|
-
|
|
7216
|
-
options: {
|
|
7217
|
-
title: string;
|
|
7218
|
-
}[];
|
|
7219
|
-
} | {
|
|
7220
|
-
type: "poll_option";
|
|
7221
|
-
option: {
|
|
7222
|
-
title: string;
|
|
7223
|
-
};
|
|
7224
|
-
poll: {
|
|
7225
|
-
type: "poll";
|
|
7226
|
-
title: string;
|
|
7227
|
-
options: {
|
|
7228
|
-
title: string;
|
|
7229
|
-
}[];
|
|
7230
|
-
};
|
|
7231
|
-
selected: boolean;
|
|
7232
|
-
title: string;
|
|
7233
|
-
} | {
|
|
7234
|
-
type: "group";
|
|
7235
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7414
|
+
type: "richlink";
|
|
7415
|
+
url: string;
|
|
7236
7416
|
} | {
|
|
7237
|
-
type: "
|
|
7238
|
-
|
|
7239
|
-
|
|
7417
|
+
type: "streamText";
|
|
7418
|
+
stream: () => AsyncIterable<string>;
|
|
7419
|
+
format?: "markdown" | "plain" | undefined;
|
|
7240
7420
|
} | {
|
|
7241
7421
|
type: "voice";
|
|
7242
7422
|
mimeType: string;
|
|
@@ -7245,13 +7425,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7245
7425
|
name?: string | undefined;
|
|
7246
7426
|
duration?: number | undefined;
|
|
7247
7427
|
size?: number | undefined;
|
|
7248
|
-
} | {
|
|
7249
|
-
type: "richlink";
|
|
7250
|
-
url: string;
|
|
7251
|
-
} | {
|
|
7252
|
-
type: "streamText";
|
|
7253
|
-
stream: () => AsyncIterable<string>;
|
|
7254
|
-
format?: "markdown" | "plain" | undefined;
|
|
7255
7428
|
} | {
|
|
7256
7429
|
type: "app";
|
|
7257
7430
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7299,6 +7472,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7299
7472
|
kind: "clear";
|
|
7300
7473
|
};
|
|
7301
7474
|
}, {
|
|
7475
|
+
type: "group";
|
|
7476
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7477
|
+
} | {
|
|
7302
7478
|
type: "text";
|
|
7303
7479
|
text: string;
|
|
7304
7480
|
} | {
|
|
@@ -7312,6 +7488,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7312
7488
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7313
7489
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7314
7490
|
size?: number | undefined;
|
|
7491
|
+
} | {
|
|
7492
|
+
type: "poll";
|
|
7493
|
+
title: string;
|
|
7494
|
+
options: {
|
|
7495
|
+
title: string;
|
|
7496
|
+
}[];
|
|
7497
|
+
} | {
|
|
7498
|
+
type: "poll_option";
|
|
7499
|
+
option: {
|
|
7500
|
+
title: string;
|
|
7501
|
+
};
|
|
7502
|
+
poll: {
|
|
7503
|
+
type: "poll";
|
|
7504
|
+
title: string;
|
|
7505
|
+
options: {
|
|
7506
|
+
title: string;
|
|
7507
|
+
}[];
|
|
7508
|
+
};
|
|
7509
|
+
selected: boolean;
|
|
7510
|
+
title: string;
|
|
7315
7511
|
} | {
|
|
7316
7512
|
type: "contact";
|
|
7317
7513
|
user?: {
|
|
@@ -7355,36 +7551,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7355
7551
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7356
7552
|
} | undefined;
|
|
7357
7553
|
raw?: unknown;
|
|
7554
|
+
} | {
|
|
7555
|
+
type: "reaction";
|
|
7556
|
+
emoji: string;
|
|
7557
|
+
target: Message<string, User, Space<unknown>>;
|
|
7358
7558
|
} | {
|
|
7359
7559
|
type: "custom";
|
|
7360
7560
|
raw: unknown;
|
|
7361
7561
|
} | {
|
|
7362
|
-
type: "
|
|
7363
|
-
|
|
7364
|
-
options: {
|
|
7365
|
-
title: string;
|
|
7366
|
-
}[];
|
|
7367
|
-
} | {
|
|
7368
|
-
type: "poll_option";
|
|
7369
|
-
option: {
|
|
7370
|
-
title: string;
|
|
7371
|
-
};
|
|
7372
|
-
poll: {
|
|
7373
|
-
type: "poll";
|
|
7374
|
-
title: string;
|
|
7375
|
-
options: {
|
|
7376
|
-
title: string;
|
|
7377
|
-
}[];
|
|
7378
|
-
};
|
|
7379
|
-
selected: boolean;
|
|
7380
|
-
title: string;
|
|
7381
|
-
} | {
|
|
7382
|
-
type: "group";
|
|
7383
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7562
|
+
type: "richlink";
|
|
7563
|
+
url: string;
|
|
7384
7564
|
} | {
|
|
7385
|
-
type: "
|
|
7386
|
-
|
|
7387
|
-
|
|
7565
|
+
type: "streamText";
|
|
7566
|
+
stream: () => AsyncIterable<string>;
|
|
7567
|
+
format?: "markdown" | "plain" | undefined;
|
|
7388
7568
|
} | {
|
|
7389
7569
|
type: "voice";
|
|
7390
7570
|
mimeType: string;
|
|
@@ -7393,13 +7573,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7393
7573
|
name?: string | undefined;
|
|
7394
7574
|
duration?: number | undefined;
|
|
7395
7575
|
size?: number | undefined;
|
|
7396
|
-
} | {
|
|
7397
|
-
type: "richlink";
|
|
7398
|
-
url: string;
|
|
7399
|
-
} | {
|
|
7400
|
-
type: "streamText";
|
|
7401
|
-
stream: () => AsyncIterable<string>;
|
|
7402
|
-
format?: "markdown" | "plain" | undefined;
|
|
7403
7576
|
} | {
|
|
7404
7577
|
type: "app";
|
|
7405
7578
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7487,4 +7660,4 @@ declare function attachment(input: AttachmentInput, options?: {
|
|
|
7487
7660
|
name?: string;
|
|
7488
7661
|
}): ContentBuilder;
|
|
7489
7662
|
//#endregion
|
|
7490
|
-
export { FusorTokenData as $,
|
|
7663
|
+
export { FusorTokenData as $, asGroup as $t, isFusorEvent as A, photoActionSchema as An, reply as At, PlatformUser as B, PollOption as Bt, FusorVerify as C, AgentSender as Cn, text as Ct, WebhookRawResult as D, avatar as Dn, resolveContents as Dt, WebhookRawRequest as E, AvatarInput as En, richlink as Et, PlatformInstance as F, appLayoutSchema as Fn, asRead as Ft, Broadcaster as G, Markdown as Gt, ProviderMessageRecord as H, asPollOption as Ht, PlatformMessage as I, read as It, mergeStreams as J, DeltaExtractor as Jt, ManagedStream as K, asMarkdown as Kt, PlatformProviderConfig as L, Poll as Lt, EventProducer as M, AppLayout as Mn, Rename as Mt, Platform as N, AppUrl as Nn, rename as Nt, FusorEvent as O, PhotoInput as On, Reply as Ot, PlatformDef as P, app as Pn, Read as Pt, DedicatedTokenData as Q, Group as Qt, PlatformRuntime as R, PollChoice as Rt, FusorRespond as S, contact as Sn, asText as St, WebhookHandler as T, Avatar as Tn, asRichlink as Tt, SchemaMessage as U, option as Ut, ProviderMessage as V, asPoll as Vt, SpaceNamespace as W, poll as Wt, Store as X, StreamTextSource as Xt, stream as Y, StreamText as Yt, CloudPlatform as Z, TextStreamOptions as Zt, FusorClient as _, ContactInput as _n, voice as _t, Content as a, Space as an, SharedTokenData as at, FusorMessagesReturn as b, ContactPhone as bn, Typing as bt, fromVCard as c, asReaction as cn, SpectrumCloudError as ct, UnsupportedKind as d, asCustom as dn, TokenData as dt, group as en, ImessageInfoData as et, Spectrum as f, custom as fn, cloud as ft, isFusorClient as g, ContactEmail as gn, asVoice as gt, fusor as h, ContactDetails as hn, Voice as ht, attachment as i, Message as in, ProjectProfile as it, AnyPlatformDef as j, App as jn, replySchema as jt, fusorEvent as k, buildPhotoAction as kn, asReply as kt, toVCard as l, reaction as ln, SubscriptionData as lt, definePlatform as m, ContactAddress as mn, EmojiKey as mt, AttachmentInput as n, Edit as nn, PlatformsData as nt, ContentBuilder as o, Reaction as on, SlackTeamMeta as ot, SpectrumInstance as p, Contact as pn, Emoji as pt, broadcast as q, markdown as qt, asAttachment as r, edit as rn, ProjectData as rt, ContentInput as s, ReactionBuilder as sn, SlackTokenData as st, Attachment as t, groupSchema as tn, PlatformStatus as tt, UnsupportedError as u, reactionSchema as un, SubscriptionStatus as ut, FusorMessages as v, ContactName as vn, Unsend as vt, FusorVerifyRequest as w, User as wn, Richlink as wt, FusorReply as x, asContact as xn, typing as xt, FusorMessagesCtx as y, ContactOrg as yn, unsend as yt, PlatformSpace as z, PollChoiceInput as zt };
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as asGroup, An as photoActionSchema, Ft as asRead, H as ProviderMessageRecord, Ht as asPollOption, K as ManagedStream, Kt as asMarkdown, On as PhotoInput, St as asText, Tt as asRichlink, Vt as asPoll, cn as asReaction, dn as asCustom, gt as asVoice, jt as replySchema, kn as buildPhotoAction, kt as asReply, r as asAttachment, tn as groupSchema, un as reactionSchema, xn as asContact } from "./attachment-LmpkSsPn.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import { FetchSpanOptions, LogAttrs, LogAttrs as LogAttrs$1, LogLevel, PhotonLogger, SanitizeUrlOptions, createLogger, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel } from "@photon-ai/otel";
|
|
4
4
|
import { Token } from "marked";
|
|
@@ -123,4 +123,4 @@ declare const resumableOrderedStream: <TLive, TMissed, TOutput>(options: Resumab
|
|
|
123
123
|
*/
|
|
124
124
|
declare function errorAttrs(error: unknown, prefix?: string): LogAttrs$1;
|
|
125
125
|
//#endregion
|
|
126
|
-
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ResumableStreamItem, type SanitizeUrlOptions, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
126
|
+
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ResumableStreamItem, type SanitizeUrlOptions, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/authoring.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as asGroup, C as asPoll, D as asMarkdown, G as buildPhotoAction, I as textSchema, K as photoActionSchema, M as groupSchema, P as asText, S as reactionSchema, V as asContact, Y as attachmentSchema, Z as tracedFetch, _ as replySchema, b as asReaction, d as asVoice, h as asReply, i as stream, k as markdownSchema, l as renderInlineTokens, o as errorAttrs, p as asRichlink, q as asAttachment, v as asRead, w as asPollOption, z as asCustom } from "./stream-DAbdViJ9.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import { createLogger, createLogger as createLogger$1, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel } from "@photon-ai/otel";
|
|
4
4
|
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
@@ -422,4 +422,4 @@ const resumableOrderedStream = (options) => stream((emit, end) => {
|
|
|
422
422
|
};
|
|
423
423
|
});
|
|
424
424
|
//#endregion
|
|
425
|
-
export { asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
425
|
+
export { asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as FusorTokenData, A as isFusorEvent,
|
|
1
|
+
import { $ as FusorTokenData, A as isFusorEvent, At as reply, B as PlatformUser, Bt as PollOption, C as FusorVerify, Cn as AgentSender, Ct as text, D as WebhookRawResult, Dn as avatar, Dt as resolveContents, E as WebhookRawRequest, En as AvatarInput, Et as richlink, F as PlatformInstance, Fn as appLayoutSchema, G as Broadcaster, Gt as Markdown, I as PlatformMessage, It as read, J as mergeStreams, Jt as DeltaExtractor, K as ManagedStream, L as PlatformProviderConfig, Lt as Poll, M as EventProducer, Mn as AppLayout, Mt as Rename, N as Platform, Nn as AppUrl, Nt as rename, O as FusorEvent, Ot as Reply, P as PlatformDef, Pn as app, Pt as Read, Q as DedicatedTokenData, Qt as Group, R as PlatformRuntime, Rt as PollChoice, S as FusorRespond, Sn as contact, T as WebhookHandler, Tn as Avatar, U as SchemaMessage, Ut as option, V as ProviderMessage, W as SpaceNamespace, Wt as poll, X as Store, Xt as StreamTextSource, Y as stream, Yt as StreamText, Z as CloudPlatform, Zt as TextStreamOptions, _ as FusorClient, _n as ContactInput, _t as voice, a as Content, an as Space, at as SharedTokenData, b as FusorMessagesReturn, bn as ContactPhone, bt as Typing, c as fromVCard, ct as SpectrumCloudError, d as UnsupportedKind, dt as TokenData, en as group, et as ImessageInfoData, f as Spectrum, fn as custom, ft as cloud, g as isFusorClient, gn as ContactEmail, h as fusor, hn as ContactDetails, ht as Voice, i as attachment, in as Message, it as ProjectProfile, j as AnyPlatformDef, jn as App, k as fusorEvent, l as toVCard, ln as reaction, lt as SubscriptionData, m as definePlatform, mn as ContactAddress, mt as EmojiKey, n as AttachmentInput, nn as Edit, nt as PlatformsData, o as ContentBuilder, on as Reaction, ot as SlackTeamMeta, p as SpectrumInstance, pn as Contact, pt as Emoji, q as broadcast, qt as markdown, rn as edit, rt as ProjectData, s as ContentInput, sn as ReactionBuilder, st as SlackTokenData, t as Attachment, tt as PlatformStatus, u as UnsupportedError, ut as SubscriptionStatus, v as FusorMessages, vn as ContactName, vt as Unsend, w as FusorVerifyRequest, wn as User, wt as Richlink, x as FusorReply, xt as typing, y as FusorMessagesCtx, yn as ContactOrg, yt as unsend, z as PlatformSpace, zt as PollChoiceInput } from "./attachment-LmpkSsPn.js";
|
|
2
2
|
export { type AgentSender, type AnyPlatformDef, type App, type AppLayout, type AppUrl, type Attachment, type AttachmentInput, type Avatar, type AvatarInput, type Broadcaster, type CloudPlatform, type Contact, type ContactAddress, type ContactDetails, type ContactEmail, type ContactInput, type ContactName, type ContactOrg, type ContactPhone, type Content, type ContentBuilder, type ContentInput, type DedicatedTokenData, type DeltaExtractor, type Edit, Emoji, type EmojiKey, type EventProducer, type FusorClient, type FusorEvent, type FusorMessages, type FusorMessagesCtx, type FusorMessagesReturn, type FusorReply, type FusorRespond, type FusorTokenData, type FusorVerify, type FusorVerifyRequest, type Group, type ImessageInfoData, type ManagedStream, type Markdown, type Message, type Platform, type PlatformDef, type PlatformInstance, type PlatformMessage, type PlatformProviderConfig, type PlatformRuntime, type PlatformSpace, type PlatformStatus, type PlatformUser, type PlatformsData, type Poll, type PollChoice, type PollChoiceInput, type PollOption, type ProjectData, type ProjectProfile, type ProviderMessage, type Reaction, type ReactionBuilder, type Read, type Rename, type Reply, type Richlink, type SchemaMessage, type SharedTokenData, type SlackTeamMeta, type SlackTokenData, type Space, type SpaceNamespace, Spectrum, SpectrumCloudError, type SpectrumInstance, type Store, type StreamText, type StreamTextSource, type SubscriptionData, type SubscriptionStatus, type TextStreamOptions, type TokenData, type Typing, type Unsend, UnsupportedError, type UnsupportedKind, type User, type Voice, type WebhookHandler, type WebhookRawRequest, type WebhookRawResult, app, appLayoutSchema, attachment, avatar, broadcast, cloud, contact, custom, definePlatform, edit, fromVCard, fusor, fusorEvent, group, isFusorClient, isFusorEvent, markdown, mergeStreams, option, poll, reaction, read, rename, reply, resolveContents, richlink, stream, text, toVCard, typing, unsend, voice };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as custom, D as asMarkdown, E as poll, F as text, G as buildPhotoAction, H as contact, J as attachment, K as photoActionSchema, L as StreamConsumedError, N as resolveContents, O as markdown, P as asText, R as drainStreamText, T as option, U as fromVCard, V as asContact, W as toVCard, X as fetchUrlBytes, Z as tracedFetch, a as contentAttrs, c as markdownToPlainText, f as voice, g as reply, i as stream, j as group, m as richlink, n as createAsyncQueue, o as errorAttrs, q as asAttachment, r as mergeStreams, s as senderAttrs, t as broadcast, u as classifyIdentifier, x as reaction, y as read, z as asCustom } from "./stream-DAbdViJ9.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import ogs from "open-graph-scraper";
|
|
4
4
|
import { createLogger, setLogLevel, setupOtel, withSpan } from "@photon-ai/otel";
|
|
@@ -186,8 +186,8 @@ function avatar(input, options) {
|
|
|
186
186
|
}
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region src/content/edit.ts
|
|
189
|
-
const isMessage$
|
|
190
|
-
const isContent
|
|
189
|
+
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
190
|
+
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
191
191
|
/**
|
|
192
192
|
* An `edit` rewrites the content of a previously-sent outbound message.
|
|
193
193
|
*
|
|
@@ -202,8 +202,8 @@ const isContent$1 = (v) => typeof v === "object" && v !== null && "type" in v &&
|
|
|
202
202
|
*/
|
|
203
203
|
const editSchema = z.object({
|
|
204
204
|
type: z.literal("edit"),
|
|
205
|
-
content: z.custom(isContent
|
|
206
|
-
target: z.custom(isMessage$
|
|
205
|
+
content: z.custom(isContent, { message: "edit content must be a Content value" }),
|
|
206
|
+
target: z.custom(isMessage$1, { message: "edit target must be a Message" })
|
|
207
207
|
});
|
|
208
208
|
const asEdit = (input) => editSchema.parse({
|
|
209
209
|
type: "edit",
|
|
@@ -255,41 +255,6 @@ function rename(displayName) {
|
|
|
255
255
|
}) };
|
|
256
256
|
}
|
|
257
257
|
//#endregion
|
|
258
|
-
//#region src/content/reply.ts
|
|
259
|
-
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
260
|
-
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
261
|
-
/**
|
|
262
|
-
* A `reply` wraps inner content with the message it replies to.
|
|
263
|
-
*
|
|
264
|
-
* `space.send(reply(content, message))` is the canonical outbound API;
|
|
265
|
-
* `message.reply(content)` is sugar that delegates here. Providers see
|
|
266
|
-
* `reply` like any other content type and route to a threaded send.
|
|
267
|
-
*
|
|
268
|
-
* Reply cannot wrap `reply`, `edit`, `reaction`, `group`, `typing`,
|
|
269
|
-
* `rename`, `avatar`, `unsend`, or `read` content.
|
|
270
|
-
*/
|
|
271
|
-
const replySchema = z.object({
|
|
272
|
-
type: z.literal("reply"),
|
|
273
|
-
content: z.custom(isContent, { message: "reply content must be a Content value" }),
|
|
274
|
-
target: z.custom(isMessage$1, { message: "reply target must be a Message" })
|
|
275
|
-
});
|
|
276
|
-
const asReply = (input) => replySchema.parse({
|
|
277
|
-
type: "reply",
|
|
278
|
-
...input
|
|
279
|
-
});
|
|
280
|
-
function reply(content, target) {
|
|
281
|
-
return { build: async () => {
|
|
282
|
-
if (!target) throw new Error("reply() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
283
|
-
const [resolved] = await resolveContents([content]);
|
|
284
|
-
if (!resolved) throw new Error("reply() requires content");
|
|
285
|
-
if (resolved.type === "reply" || resolved.type === "edit" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend" || resolved.type === "read") throw new Error(`reply() cannot wrap "${resolved.type}" content`);
|
|
286
|
-
return asReply({
|
|
287
|
-
content: resolved,
|
|
288
|
-
target
|
|
289
|
-
});
|
|
290
|
-
} };
|
|
291
|
-
}
|
|
292
|
-
//#endregion
|
|
293
258
|
//#region src/content/typing.ts
|
|
294
259
|
/**
|
|
295
260
|
* A `typing` content value carries a typing-indicator signal — either
|
|
@@ -2572,8 +2537,8 @@ const rawDirection = (raw) => raw.direction === "inbound" || raw.direction === "
|
|
|
2572
2537
|
* record can carry its own `direction` when the provider knows better than the
|
|
2573
2538
|
* wrapping context, which matters for inbound reactions targeting outbound
|
|
2574
2539
|
* messages.
|
|
2575
|
-
* Recursion through `wrapNestedContent` handles reaction targets and
|
|
2576
|
-
* items, which providers return as nested raw records.
|
|
2540
|
+
* Recursion through `wrapNestedContent` handles reaction/reply targets and
|
|
2541
|
+
* group items, which providers return as nested raw records.
|
|
2577
2542
|
*/
|
|
2578
2543
|
function wrapProviderMessage(raw, ctx, direction) {
|
|
2579
2544
|
const effectiveDirection = rawDirection(raw) ?? direction;
|
|
@@ -2610,6 +2575,19 @@ const wrapNestedContent = (content, ctx, direction) => {
|
|
|
2610
2575
|
};
|
|
2611
2576
|
return content;
|
|
2612
2577
|
}
|
|
2578
|
+
if (content.type === "reply") {
|
|
2579
|
+
const wrappedInner = wrapNestedContent(content.content, ctx, direction);
|
|
2580
|
+
const target = content.target;
|
|
2581
|
+
if (isRawProviderRecord(target)) return {
|
|
2582
|
+
...content,
|
|
2583
|
+
content: wrappedInner,
|
|
2584
|
+
target: wrapProviderMessage(target, ctx, "inbound")
|
|
2585
|
+
};
|
|
2586
|
+
return {
|
|
2587
|
+
...content,
|
|
2588
|
+
content: wrappedInner
|
|
2589
|
+
};
|
|
2590
|
+
}
|
|
2613
2591
|
if (content.type === "edit") {
|
|
2614
2592
|
const target = content.target;
|
|
2615
2593
|
if (isRawProviderRecord(target)) return {
|
|
@@ -3042,7 +3020,7 @@ function definePlatform(name, rawDef) {
|
|
|
3042
3020
|
}
|
|
3043
3021
|
//#endregion
|
|
3044
3022
|
//#region src/build-env.ts
|
|
3045
|
-
const SPECTRUM_SDK_VERSION = "8.
|
|
3023
|
+
const SPECTRUM_SDK_VERSION = "8.2.0";
|
|
3046
3024
|
//#endregion
|
|
3047
3025
|
//#region src/utils/provider-packages.ts
|
|
3048
3026
|
const OFFICIAL_PROVIDER_PACKAGES = {
|
|
@@ -3756,9 +3734,9 @@ const asOptionalDate = (value) => typeof value === "string" ? new Date(value) :
|
|
|
3756
3734
|
* message with no resolvable platform) — the caller acknowledges it (200)
|
|
3757
3735
|
* rather than failing, since neither is fixed by a retry.
|
|
3758
3736
|
*
|
|
3759
|
-
* Reaction targets and group items are emitted as **raw nested records**;
|
|
3760
|
-
* `wrapProviderMessage`/`wrapNestedContent` pipeline turns them into
|
|
3761
|
-
* Messages, exactly as a provider's own `messages` handler would.
|
|
3737
|
+
* Reaction/reply targets and group items are emitted as **raw nested records**;
|
|
3738
|
+
* the `wrapProviderMessage`/`wrapNestedContent` pipeline turns them into
|
|
3739
|
+
* fully-built Messages, exactly as a provider's own `messages` handler would.
|
|
3762
3740
|
*/
|
|
3763
3741
|
function deserializeSpectrumMessage(envelope, ctx) {
|
|
3764
3742
|
if (envelope.event !== MESSAGES_EVENT) return null;
|
|
@@ -3799,6 +3777,7 @@ const mapContent = (content, platform, spaceRef, ctx) => {
|
|
|
3799
3777
|
};
|
|
3800
3778
|
case "contact": return deserializeContact(raw);
|
|
3801
3779
|
case "reaction": return deserializeReaction(raw, spaceRef);
|
|
3780
|
+
case "reply": return deserializeReply(raw, platform, spaceRef, ctx);
|
|
3802
3781
|
case "group": return deserializeGroup(raw, platform, spaceRef, ctx);
|
|
3803
3782
|
case "attachment": return deserializeAttachment(raw, platform, spaceRef, ctx);
|
|
3804
3783
|
default: return asCustom(content);
|
|
@@ -3822,6 +3801,11 @@ const deserializeReaction = (raw, spaceRef) => ({
|
|
|
3822
3801
|
emoji: asString(raw.emoji),
|
|
3823
3802
|
target: buildTargetRecord(raw.target, spaceRef)
|
|
3824
3803
|
});
|
|
3804
|
+
const deserializeReply = (raw, platform, spaceRef, ctx) => ({
|
|
3805
|
+
type: "reply",
|
|
3806
|
+
content: isRecord(raw.content) ? deserializeContent(raw.content, platform, spaceRef, ctx) : asCustom(raw.content),
|
|
3807
|
+
target: buildTargetRecord(raw.target, spaceRef)
|
|
3808
|
+
});
|
|
3825
3809
|
const buildTargetRecord = (target, spaceRef) => {
|
|
3826
3810
|
const ref = isRecord(target) ? target : {};
|
|
3827
3811
|
return {
|
|
@@ -701,7 +701,7 @@ function text(source, options) {
|
|
|
701
701
|
const resolveContents = (items) => Promise.all(items.map((c) => typeof c === "string" ? text(c).build() : c.build()));
|
|
702
702
|
//#endregion
|
|
703
703
|
//#region src/content/group.ts
|
|
704
|
-
const isMessage$
|
|
704
|
+
const isMessage$3 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
705
705
|
/**
|
|
706
706
|
* A `group` bundles multiple messages into one logical unit (e.g. an album
|
|
707
707
|
* of images sent together). Each item is a full `Message` — addressable by
|
|
@@ -713,7 +713,7 @@ const isMessage$2 = (v) => typeof v === "object" && v !== null && "id" in v && "
|
|
|
713
713
|
*/
|
|
714
714
|
const groupSchema = z.object({
|
|
715
715
|
type: z.literal("group"),
|
|
716
|
-
items: z.array(z.custom(isMessage$
|
|
716
|
+
items: z.array(z.custom(isMessage$3)).min(2)
|
|
717
717
|
});
|
|
718
718
|
const asGroup = (input) => groupSchema.parse({
|
|
719
719
|
type: "group",
|
|
@@ -807,11 +807,11 @@ function poll(title, ...rest) {
|
|
|
807
807
|
}
|
|
808
808
|
//#endregion
|
|
809
809
|
//#region src/content/reaction.ts
|
|
810
|
-
const isMessage$
|
|
810
|
+
const isMessage$2 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
811
811
|
const reactionSchema = z.object({
|
|
812
812
|
type: z.literal("reaction"),
|
|
813
813
|
emoji: z.string().min(1),
|
|
814
|
-
target: z.custom(isMessage$
|
|
814
|
+
target: z.custom(isMessage$2, { message: "reaction target must be a Message" })
|
|
815
815
|
});
|
|
816
816
|
const asReaction = (input) => reactionSchema.parse({
|
|
817
817
|
type: "reaction",
|
|
@@ -845,7 +845,7 @@ function reaction(emoji, target) {
|
|
|
845
845
|
}
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/content/read.ts
|
|
848
|
-
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
848
|
+
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
849
849
|
/**
|
|
850
850
|
* A `read` marks the conversation as read **up to** `target`, surfacing a
|
|
851
851
|
* read receipt to the sender where the platform supports one.
|
|
@@ -868,7 +868,7 @@ const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "co
|
|
|
868
868
|
*/
|
|
869
869
|
const readSchema = z.object({
|
|
870
870
|
type: z.literal("read"),
|
|
871
|
-
target: z.custom(isMessage, { message: "read target must be a Message" })
|
|
871
|
+
target: z.custom(isMessage$1, { message: "read target must be a Message" })
|
|
872
872
|
});
|
|
873
873
|
const asRead = (input) => readSchema.parse({
|
|
874
874
|
type: "read",
|
|
@@ -891,6 +891,41 @@ function read(target) {
|
|
|
891
891
|
} };
|
|
892
892
|
}
|
|
893
893
|
//#endregion
|
|
894
|
+
//#region src/content/reply.ts
|
|
895
|
+
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
896
|
+
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
897
|
+
/**
|
|
898
|
+
* A `reply` wraps inner content with the message it replies to.
|
|
899
|
+
*
|
|
900
|
+
* `space.send(reply(content, message))` is the canonical outbound API;
|
|
901
|
+
* `message.reply(content)` is sugar that delegates here. Providers see
|
|
902
|
+
* `reply` like any other content type and route to a threaded send.
|
|
903
|
+
*
|
|
904
|
+
* Reply cannot wrap `reply`, `edit`, `reaction`, `group`, `typing`,
|
|
905
|
+
* `rename`, `avatar`, `unsend`, or `read` content.
|
|
906
|
+
*/
|
|
907
|
+
const replySchema = z.object({
|
|
908
|
+
type: z.literal("reply"),
|
|
909
|
+
content: z.custom(isContent, { message: "reply content must be a Content value" }),
|
|
910
|
+
target: z.custom(isMessage, { message: "reply target must be a Message" })
|
|
911
|
+
});
|
|
912
|
+
const asReply = (input) => replySchema.parse({
|
|
913
|
+
type: "reply",
|
|
914
|
+
...input
|
|
915
|
+
});
|
|
916
|
+
function reply(content, target) {
|
|
917
|
+
return { build: async () => {
|
|
918
|
+
if (!target) throw new Error("reply() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
919
|
+
const [resolved] = await resolveContents([content]);
|
|
920
|
+
if (!resolved) throw new Error("reply() requires content");
|
|
921
|
+
if (resolved.type === "reply" || resolved.type === "edit" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend" || resolved.type === "read") throw new Error(`reply() cannot wrap "${resolved.type}" content`);
|
|
922
|
+
return asReply({
|
|
923
|
+
content: resolved,
|
|
924
|
+
target
|
|
925
|
+
});
|
|
926
|
+
} };
|
|
927
|
+
}
|
|
928
|
+
//#endregion
|
|
894
929
|
//#region src/content/richlink.ts
|
|
895
930
|
/**
|
|
896
931
|
* A URL the platform should render as a rich link preview.
|
|
@@ -1419,4 +1454,4 @@ function broadcast(source) {
|
|
|
1419
1454
|
};
|
|
1420
1455
|
}
|
|
1421
1456
|
//#endregion
|
|
1422
|
-
export {
|
|
1457
|
+
export { asGroup as A, custom as B, asPoll as C, asMarkdown as D, poll as E, text as F, buildPhotoAction as G, contact as H, textSchema as I, attachment as J, photoActionSchema as K, StreamConsumedError as L, groupSchema as M, resolveContents as N, markdown as O, asText as P, drainStreamText as R, reactionSchema as S, option as T, fromVCard as U, asContact as V, toVCard as W, fetchUrlBytes as X, attachmentSchema as Y, tracedFetch as Z, replySchema as _, contentAttrs as a, asReaction as b, markdownToPlainText as c, asVoice as d, voice as f, reply as g, asReply as h, stream as i, group as j, markdownSchema as k, renderInlineTokens as l, richlink as m, createAsyncQueue as n, errorAttrs as o, asRichlink as p, asAttachment as q, mergeStreams as r, senderAttrs as s, broadcast as t, classifyIdentifier as u, asRead as v, asPollOption as w, reaction as x, read as y, asCustom as z };
|