@closerepo/notification-contracts 1.10.0 → 1.12.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/dist/index.d.ts +797 -187
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
//#region src/browser-payload.d.ts
|
|
3
|
+
/** Data-only FCM transport consumed by the single notification service worker. */
|
|
4
|
+
declare const notificationBrowserPayloadSchema: z.ZodObject<{
|
|
5
|
+
eventId: z.ZodUUID;
|
|
6
|
+
deliverBy: z.ZodISODateTime;
|
|
7
|
+
locale: z.ZodString;
|
|
8
|
+
contentLocale: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
body: z.ZodString;
|
|
11
|
+
url: z.ZodURL;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
type NotificationBrowserPayload = z.infer<typeof notificationBrowserPayloadSchema>;
|
|
14
|
+
//#endregion
|
|
2
15
|
//#region src/index.d.ts
|
|
3
16
|
declare const notificationDeliveryContractVersionV1: 1;
|
|
4
17
|
declare const notificationDeliveryContractVersionV2: 2;
|
|
@@ -6,6 +19,8 @@ declare const notificationDeliveryContractVersionV3: 3;
|
|
|
6
19
|
declare const notificationDeliveryContractVersionV4: 4;
|
|
7
20
|
declare const notificationDeliveryContractVersionV5: 5;
|
|
8
21
|
declare const notificationDeliveryContractVersionV7: 7;
|
|
22
|
+
declare const notificationDeliveryContractVersionV8: 8;
|
|
23
|
+
declare const notificationDeliveryContractVersionV9: 9;
|
|
9
24
|
declare const notificationDeliveryMaximumDestinationsV1 = 20;
|
|
10
25
|
declare const notificationDeliveryRequestMaximumUtf8BytesV1: number;
|
|
11
26
|
declare const notificationDeliveryMaximumDeadlineMillisecondsV1: number;
|
|
@@ -16,6 +31,7 @@ declare const notificationDeliveryMaximumDeadlineMillisecondsV3: number;
|
|
|
16
31
|
declare const notificationDeliveryRequestMaximumUtf8BytesV4: number;
|
|
17
32
|
declare const notificationDeliveryMaximumDeadlineMillisecondsV4: number;
|
|
18
33
|
declare const notificationDeliveryRequestMaximumUtf8BytesV5: number;
|
|
34
|
+
declare const notificationDeliveryRequestMaximumUtf8BytesV9: number;
|
|
19
35
|
declare const notificationDeliveryMaximumDeadlineMillisecondsV5: number;
|
|
20
36
|
declare const localTaskDeliveryContractVersionV1: 1;
|
|
21
37
|
declare const localTaskDeliveryRequestMaximumUtf8BytesV1: number;
|
|
@@ -30,6 +46,8 @@ declare const notificationDestinationFailureCodesV1: readonly ["provider_timeout
|
|
|
30
46
|
declare const notificationDeliveryRejectionCodesV1: readonly ["invalid_request", "request_too_large", "producer_scope_mismatch", "route_not_allowed", "event_identity_conflict", "route_not_found", "route_empty", "delivery_deadline_invalid"];
|
|
31
47
|
declare const notificationValidationIssueCodesV1: readonly ["invalid_type", "invalid_value", "too_small", "too_big", "invalid_format", "unrecognized_keys", "custom"];
|
|
32
48
|
declare const notificationMessageVariantKeys: readonly ["source", "zh-CN"];
|
|
49
|
+
declare const notificationDeliveryChannelKeys: readonly ["qq", "tg", "wechat", "lark"];
|
|
50
|
+
type NotificationDeliveryChannelKey = (typeof notificationDeliveryChannelKeys)[number];
|
|
33
51
|
declare const notificationDeliveryRequestV1Schema: z.ZodObject<{
|
|
34
52
|
message: z.ZodObject<{
|
|
35
53
|
type: z.ZodLiteral<"link_summary">;
|
|
@@ -537,158 +555,85 @@ declare const notificationDeliveryRequestV7Schema: z.ZodObject<{
|
|
|
537
555
|
}, z.core.$strict>;
|
|
538
556
|
}, z.core.$strict>;
|
|
539
557
|
type NotificationDeliveryRequestV7 = z.infer<typeof notificationDeliveryRequestV7Schema>;
|
|
540
|
-
/**
|
|
541
|
-
declare
|
|
542
|
-
|
|
543
|
-
} | {
|
|
544
|
-
routeKeys: string[];
|
|
545
|
-
}): string[];
|
|
546
|
-
type NotificationDeliveryRequestV6 = z.infer<typeof notificationDeliveryRequestV6Schema>;
|
|
547
|
-
declare const creatorDraftTaskV1Schema: z.ZodObject<{
|
|
548
|
-
type: z.ZodLiteral<"creator.draft.v1">;
|
|
549
|
-
templateId: z.ZodString;
|
|
550
|
-
signalType: z.ZodString;
|
|
551
|
-
sourceTextZh: z.ZodString;
|
|
552
|
-
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
553
|
-
}, z.core.$strict>;
|
|
554
|
-
declare const localTaskDeliveryRequestV1Schema: z.ZodObject<{
|
|
555
|
-
contractVersion: z.ZodLiteral<1>;
|
|
556
|
-
eventType: z.ZodLiteral<"local-task.delivery.requested">;
|
|
557
|
-
eventId: z.ZodString;
|
|
558
|
-
producer: z.ZodObject<{
|
|
559
|
-
key: z.ZodString;
|
|
560
|
-
environment: z.ZodString;
|
|
561
|
-
}, z.core.$strict>;
|
|
562
|
-
routeKey: z.ZodString;
|
|
563
|
-
occurredAt: z.ZodString;
|
|
564
|
-
requestedAt: z.ZodString;
|
|
565
|
-
deliverBy: z.ZodString;
|
|
566
|
-
subject: z.ZodObject<{
|
|
567
|
-
id: z.ZodString;
|
|
568
|
-
revision: z.ZodNumber;
|
|
569
|
-
type: z.ZodLiteral<"creator-event">;
|
|
570
|
-
}, z.core.$strict>;
|
|
571
|
-
task: z.ZodObject<{
|
|
572
|
-
type: z.ZodLiteral<"creator.draft.v1">;
|
|
573
|
-
templateId: z.ZodString;
|
|
574
|
-
signalType: z.ZodString;
|
|
575
|
-
sourceTextZh: z.ZodString;
|
|
576
|
-
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
577
|
-
}, z.core.$strict>;
|
|
578
|
-
}, z.core.$strict>;
|
|
579
|
-
declare const localTaskDeliveryRequestSchema: z.ZodObject<{
|
|
580
|
-
contractVersion: z.ZodLiteral<1>;
|
|
581
|
-
eventType: z.ZodLiteral<"local-task.delivery.requested">;
|
|
582
|
-
eventId: z.ZodString;
|
|
583
|
-
producer: z.ZodObject<{
|
|
584
|
-
key: z.ZodString;
|
|
585
|
-
environment: z.ZodString;
|
|
586
|
-
}, z.core.$strict>;
|
|
587
|
-
routeKey: z.ZodString;
|
|
588
|
-
occurredAt: z.ZodString;
|
|
589
|
-
requestedAt: z.ZodString;
|
|
590
|
-
deliverBy: z.ZodString;
|
|
591
|
-
subject: z.ZodObject<{
|
|
592
|
-
id: z.ZodString;
|
|
593
|
-
revision: z.ZodNumber;
|
|
594
|
-
type: z.ZodLiteral<"creator-event">;
|
|
595
|
-
}, z.core.$strict>;
|
|
596
|
-
task: z.ZodObject<{
|
|
597
|
-
type: z.ZodLiteral<"creator.draft.v1">;
|
|
598
|
-
templateId: z.ZodString;
|
|
599
|
-
signalType: z.ZodString;
|
|
600
|
-
sourceTextZh: z.ZodString;
|
|
601
|
-
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
602
|
-
}, z.core.$strict>;
|
|
603
|
-
}, z.core.$strict>;
|
|
604
|
-
declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
558
|
+
/** Frozen channel copy shares message bodies and links; omitted channels use default variants. */
|
|
559
|
+
declare const notificationDeliveryRequestV8Schema: z.ZodObject<{
|
|
560
|
+
contractVersion: z.ZodLiteral<8>;
|
|
605
561
|
message: z.ZodObject<{
|
|
606
|
-
type: z.ZodLiteral<"
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
facts: z.ZodArray<z.ZodObject<{
|
|
610
|
-
label: z.ZodString;
|
|
611
|
-
value: z.ZodString;
|
|
612
|
-
}, z.core.$strict>>;
|
|
613
|
-
primaryLink: z.ZodObject<{
|
|
614
|
-
label: z.ZodString;
|
|
615
|
-
url: z.ZodString;
|
|
616
|
-
}, z.core.$strict>;
|
|
617
|
-
sourceLink: z.ZodOptional<z.ZodObject<{
|
|
618
|
-
label: z.ZodString;
|
|
562
|
+
type: z.ZodLiteral<"structured_notification">;
|
|
563
|
+
links: z.ZodArray<z.ZodObject<{
|
|
564
|
+
key: z.ZodString;
|
|
619
565
|
url: z.ZodString;
|
|
620
566
|
}, z.core.$strict>>;
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
key: z.ZodString;
|
|
626
|
-
environment: z.ZodString;
|
|
627
|
-
}, z.core.$strict>;
|
|
628
|
-
routeKey: z.ZodString;
|
|
629
|
-
occurredAt: z.ZodString;
|
|
630
|
-
requestedAt: z.ZodString;
|
|
631
|
-
deliverBy: z.ZodString;
|
|
632
|
-
subject: z.ZodObject<{
|
|
633
|
-
type: z.ZodString;
|
|
634
|
-
id: z.ZodString;
|
|
635
|
-
revision: z.ZodNumber;
|
|
636
|
-
}, z.core.$strict>;
|
|
637
|
-
contractVersion: z.ZodLiteral<1>;
|
|
638
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
639
|
-
message: z.ZodObject<{
|
|
640
|
-
type: z.ZodLiteral<"localized_link_summary">;
|
|
567
|
+
bodies: z.ZodArray<z.ZodObject<{
|
|
568
|
+
key: z.ZodString;
|
|
569
|
+
value: z.ZodString;
|
|
570
|
+
}, z.core.$strict>>;
|
|
641
571
|
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
572
|
+
key: z.ZodLiteral<"source">;
|
|
642
573
|
title: z.ZodString;
|
|
643
|
-
|
|
644
|
-
|
|
574
|
+
locale: z.ZodLiteral<"und">;
|
|
575
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
576
|
+
key: z.ZodString;
|
|
645
577
|
label: z.ZodString;
|
|
578
|
+
}, z.core.$strict>>;
|
|
579
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
580
|
+
key: z.ZodString;
|
|
581
|
+
type: z.ZodLiteral<"text">;
|
|
582
|
+
label: z.ZodOptional<z.ZodString>;
|
|
646
583
|
value: z.ZodString;
|
|
584
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
585
|
+
key: z.ZodString;
|
|
586
|
+
type: z.ZodLiteral<"fields">;
|
|
587
|
+
items: z.ZodArray<z.ZodObject<{
|
|
588
|
+
label: z.ZodString;
|
|
589
|
+
value: z.ZodString;
|
|
590
|
+
}, z.core.$strict>>;
|
|
591
|
+
}, z.core.$strict>], "type">>;
|
|
592
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
593
|
+
key: z.ZodString;
|
|
594
|
+
label: z.ZodString;
|
|
647
595
|
}, z.core.$strict>>;
|
|
648
|
-
|
|
649
|
-
locale: z.ZodLiteral<"und">;
|
|
596
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
650
597
|
}, z.core.$strict>, z.ZodObject<{
|
|
598
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
651
599
|
title: z.ZodString;
|
|
652
|
-
|
|
653
|
-
|
|
600
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
601
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
602
|
+
key: z.ZodString;
|
|
654
603
|
label: z.ZodString;
|
|
604
|
+
}, z.core.$strict>>;
|
|
605
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
606
|
+
key: z.ZodString;
|
|
607
|
+
type: z.ZodLiteral<"text">;
|
|
608
|
+
label: z.ZodOptional<z.ZodString>;
|
|
655
609
|
value: z.ZodString;
|
|
610
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
611
|
+
key: z.ZodString;
|
|
612
|
+
type: z.ZodLiteral<"fields">;
|
|
613
|
+
items: z.ZodArray<z.ZodObject<{
|
|
614
|
+
label: z.ZodString;
|
|
615
|
+
value: z.ZodString;
|
|
616
|
+
}, z.core.$strict>>;
|
|
617
|
+
}, z.core.$strict>], "type">>;
|
|
618
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
619
|
+
key: z.ZodString;
|
|
620
|
+
label: z.ZodString;
|
|
656
621
|
}, z.core.$strict>>;
|
|
657
|
-
|
|
658
|
-
locale: z.ZodLiteral<"zh-CN">;
|
|
622
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
659
623
|
}, z.core.$strict>], "key">>;
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
url: z.ZodString;
|
|
667
|
-
}, z.core.$strict>>;
|
|
668
|
-
}, z.core.$strict>;
|
|
669
|
-
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
670
|
-
eventId: z.ZodString;
|
|
671
|
-
producer: z.ZodObject<{
|
|
672
|
-
key: z.ZodString;
|
|
673
|
-
environment: z.ZodString;
|
|
674
|
-
}, z.core.$strict>;
|
|
675
|
-
routeKey: z.ZodString;
|
|
676
|
-
occurredAt: z.ZodString;
|
|
677
|
-
requestedAt: z.ZodString;
|
|
678
|
-
deliverBy: z.ZodString;
|
|
679
|
-
subject: z.ZodObject<{
|
|
680
|
-
type: z.ZodString;
|
|
681
|
-
id: z.ZodString;
|
|
682
|
-
revision: z.ZodNumber;
|
|
683
|
-
}, z.core.$strict>;
|
|
684
|
-
contractVersion: z.ZodLiteral<2>;
|
|
685
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
686
|
-
message: z.ZodObject<{
|
|
687
|
-
type: z.ZodLiteral<"structured_notification">;
|
|
688
|
-
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
624
|
+
channelVariants: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
625
|
+
qq: "qq";
|
|
626
|
+
tg: "tg";
|
|
627
|
+
wechat: "wechat";
|
|
628
|
+
lark: "lark";
|
|
629
|
+
}> & z.core.$partial, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
689
630
|
key: z.ZodLiteral<"source">;
|
|
690
|
-
locale: z.ZodLiteral<"und">;
|
|
691
631
|
title: z.ZodString;
|
|
632
|
+
locale: z.ZodLiteral<"und">;
|
|
633
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
634
|
+
key: z.ZodString;
|
|
635
|
+
label: z.ZodString;
|
|
636
|
+
}, z.core.$strict>>;
|
|
692
637
|
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
693
638
|
key: z.ZodString;
|
|
694
639
|
type: z.ZodLiteral<"text">;
|
|
@@ -702,10 +647,19 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
702
647
|
value: z.ZodString;
|
|
703
648
|
}, z.core.$strict>>;
|
|
704
649
|
}, z.core.$strict>], "type">>;
|
|
650
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
651
|
+
key: z.ZodString;
|
|
652
|
+
label: z.ZodString;
|
|
653
|
+
}, z.core.$strict>>;
|
|
654
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
705
655
|
}, z.core.$strict>, z.ZodObject<{
|
|
706
656
|
key: z.ZodLiteral<"zh-CN">;
|
|
707
|
-
locale: z.ZodLiteral<"zh-CN">;
|
|
708
657
|
title: z.ZodString;
|
|
658
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
659
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
660
|
+
key: z.ZodString;
|
|
661
|
+
label: z.ZodString;
|
|
662
|
+
}, z.core.$strict>>;
|
|
709
663
|
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
710
664
|
key: z.ZodString;
|
|
711
665
|
type: z.ZodLiteral<"text">;
|
|
@@ -719,37 +673,20 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
719
673
|
value: z.ZodString;
|
|
720
674
|
}, z.core.$strict>>;
|
|
721
675
|
}, z.core.$strict>], "type">>;
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}, z.core.$strict
|
|
728
|
-
}, z.core.$strict>;
|
|
729
|
-
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
730
|
-
eventId: z.ZodString;
|
|
731
|
-
producer: z.ZodObject<{
|
|
732
|
-
key: z.ZodString;
|
|
733
|
-
environment: z.ZodString;
|
|
734
|
-
}, z.core.$strict>;
|
|
735
|
-
routeKey: z.ZodString;
|
|
736
|
-
occurredAt: z.ZodString;
|
|
737
|
-
requestedAt: z.ZodString;
|
|
738
|
-
deliverBy: z.ZodString;
|
|
739
|
-
subject: z.ZodObject<{
|
|
740
|
-
type: z.ZodString;
|
|
741
|
-
id: z.ZodString;
|
|
742
|
-
revision: z.ZodNumber;
|
|
676
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
677
|
+
key: z.ZodString;
|
|
678
|
+
label: z.ZodString;
|
|
679
|
+
}, z.core.$strict>>;
|
|
680
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
681
|
+
}, z.core.$strict>], "key">>>>;
|
|
743
682
|
}, z.core.$strict>;
|
|
744
|
-
|
|
745
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
683
|
+
routeKeys: z.ZodArray<z.ZodString>;
|
|
746
684
|
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
747
685
|
eventId: z.ZodString;
|
|
748
686
|
producer: z.ZodObject<{
|
|
749
687
|
key: z.ZodString;
|
|
750
688
|
environment: z.ZodString;
|
|
751
689
|
}, z.core.$strict>;
|
|
752
|
-
routeKey: z.ZodString;
|
|
753
690
|
occurredAt: z.ZodString;
|
|
754
691
|
requestedAt: z.ZodString;
|
|
755
692
|
deliverBy: z.ZodString;
|
|
@@ -758,18 +695,47 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
758
695
|
id: z.ZodString;
|
|
759
696
|
revision: z.ZodNumber;
|
|
760
697
|
}, z.core.$strict>;
|
|
761
|
-
|
|
698
|
+
}, z.core.$strict>;
|
|
699
|
+
type NotificationDeliveryRequestV8 = z.infer<typeof notificationDeliveryRequestV8Schema>;
|
|
700
|
+
/** Producer-owned copy; a fallback keeps the intended audience separate from the actual language. */
|
|
701
|
+
declare const notificationBrowserMessageSchema: z.ZodObject<{
|
|
702
|
+
locale: z.ZodString;
|
|
703
|
+
contentLocale: z.ZodString;
|
|
704
|
+
title: z.ZodString;
|
|
705
|
+
body: z.ZodString;
|
|
706
|
+
url: z.ZodString;
|
|
707
|
+
}, z.core.$strict>;
|
|
708
|
+
/** Audience and browser copy are additive; historical channel contracts keep their exact validation. */
|
|
709
|
+
declare const notificationDeliveryRequestV9Schema: z.ZodObject<{
|
|
710
|
+
contractVersion: z.ZodLiteral<9>;
|
|
711
|
+
audience: z.ZodOptional<z.ZodObject<{
|
|
712
|
+
topics: z.ZodArray<z.ZodString>;
|
|
713
|
+
}, z.core.$strict>>;
|
|
714
|
+
browserMessages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
715
|
+
locale: z.ZodString;
|
|
716
|
+
contentLocale: z.ZodString;
|
|
717
|
+
title: z.ZodString;
|
|
718
|
+
body: z.ZodString;
|
|
719
|
+
url: z.ZodString;
|
|
720
|
+
}, z.core.$strict>>>;
|
|
762
721
|
message: z.ZodObject<{
|
|
763
722
|
type: z.ZodLiteral<"structured_notification">;
|
|
764
723
|
links: z.ZodArray<z.ZodObject<{
|
|
765
|
-
|
|
724
|
+
key: z.ZodString;
|
|
766
725
|
url: z.ZodString;
|
|
726
|
+
}, z.core.$strict>>;
|
|
727
|
+
bodies: z.ZodArray<z.ZodObject<{
|
|
767
728
|
key: z.ZodString;
|
|
729
|
+
value: z.ZodString;
|
|
768
730
|
}, z.core.$strict>>;
|
|
769
731
|
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
770
732
|
key: z.ZodLiteral<"source">;
|
|
771
|
-
locale: z.ZodLiteral<"und">;
|
|
772
733
|
title: z.ZodString;
|
|
734
|
+
locale: z.ZodLiteral<"und">;
|
|
735
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
736
|
+
key: z.ZodString;
|
|
737
|
+
label: z.ZodString;
|
|
738
|
+
}, z.core.$strict>>;
|
|
773
739
|
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
774
740
|
key: z.ZodString;
|
|
775
741
|
type: z.ZodLiteral<"text">;
|
|
@@ -783,10 +749,414 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
783
749
|
value: z.ZodString;
|
|
784
750
|
}, z.core.$strict>>;
|
|
785
751
|
}, z.core.$strict>], "type">>;
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
}, z.core.$strict
|
|
752
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
753
|
+
key: z.ZodString;
|
|
754
|
+
label: z.ZodString;
|
|
755
|
+
}, z.core.$strict>>;
|
|
756
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
757
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
758
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
759
|
+
title: z.ZodString;
|
|
760
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
761
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
762
|
+
key: z.ZodString;
|
|
763
|
+
label: z.ZodString;
|
|
764
|
+
}, z.core.$strict>>;
|
|
765
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
766
|
+
key: z.ZodString;
|
|
767
|
+
type: z.ZodLiteral<"text">;
|
|
768
|
+
label: z.ZodOptional<z.ZodString>;
|
|
769
|
+
value: z.ZodString;
|
|
770
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
771
|
+
key: z.ZodString;
|
|
772
|
+
type: z.ZodLiteral<"fields">;
|
|
773
|
+
items: z.ZodArray<z.ZodObject<{
|
|
774
|
+
label: z.ZodString;
|
|
775
|
+
value: z.ZodString;
|
|
776
|
+
}, z.core.$strict>>;
|
|
777
|
+
}, z.core.$strict>], "type">>;
|
|
778
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
779
|
+
key: z.ZodString;
|
|
780
|
+
label: z.ZodString;
|
|
781
|
+
}, z.core.$strict>>;
|
|
782
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
783
|
+
}, z.core.$strict>], "key">>;
|
|
784
|
+
channelVariants: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
785
|
+
qq: "qq";
|
|
786
|
+
tg: "tg";
|
|
787
|
+
wechat: "wechat";
|
|
788
|
+
lark: "lark";
|
|
789
|
+
}> & z.core.$partial, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
790
|
+
key: z.ZodLiteral<"source">;
|
|
791
|
+
title: z.ZodString;
|
|
792
|
+
locale: z.ZodLiteral<"und">;
|
|
793
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
794
|
+
key: z.ZodString;
|
|
795
|
+
label: z.ZodString;
|
|
796
|
+
}, z.core.$strict>>;
|
|
797
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
798
|
+
key: z.ZodString;
|
|
799
|
+
type: z.ZodLiteral<"text">;
|
|
800
|
+
label: z.ZodOptional<z.ZodString>;
|
|
801
|
+
value: z.ZodString;
|
|
802
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
803
|
+
key: z.ZodString;
|
|
804
|
+
type: z.ZodLiteral<"fields">;
|
|
805
|
+
items: z.ZodArray<z.ZodObject<{
|
|
806
|
+
label: z.ZodString;
|
|
807
|
+
value: z.ZodString;
|
|
808
|
+
}, z.core.$strict>>;
|
|
809
|
+
}, z.core.$strict>], "type">>;
|
|
810
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
811
|
+
key: z.ZodString;
|
|
812
|
+
label: z.ZodString;
|
|
813
|
+
}, z.core.$strict>>;
|
|
814
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
815
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
816
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
817
|
+
title: z.ZodString;
|
|
818
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
819
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
820
|
+
key: z.ZodString;
|
|
821
|
+
label: z.ZodString;
|
|
822
|
+
}, z.core.$strict>>;
|
|
823
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
824
|
+
key: z.ZodString;
|
|
825
|
+
type: z.ZodLiteral<"text">;
|
|
826
|
+
label: z.ZodOptional<z.ZodString>;
|
|
827
|
+
value: z.ZodString;
|
|
828
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
829
|
+
key: z.ZodString;
|
|
830
|
+
type: z.ZodLiteral<"fields">;
|
|
831
|
+
items: z.ZodArray<z.ZodObject<{
|
|
832
|
+
label: z.ZodString;
|
|
833
|
+
value: z.ZodString;
|
|
834
|
+
}, z.core.$strict>>;
|
|
835
|
+
}, z.core.$strict>], "type">>;
|
|
836
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
837
|
+
key: z.ZodString;
|
|
838
|
+
label: z.ZodString;
|
|
839
|
+
}, z.core.$strict>>;
|
|
840
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
841
|
+
}, z.core.$strict>], "key">>>>;
|
|
842
|
+
}, z.core.$strict>;
|
|
843
|
+
routeKeys: z.ZodArray<z.ZodString>;
|
|
844
|
+
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
845
|
+
eventId: z.ZodString;
|
|
846
|
+
producer: z.ZodObject<{
|
|
847
|
+
key: z.ZodString;
|
|
848
|
+
environment: z.ZodString;
|
|
849
|
+
}, z.core.$strict>;
|
|
850
|
+
occurredAt: z.ZodString;
|
|
851
|
+
requestedAt: z.ZodString;
|
|
852
|
+
deliverBy: z.ZodString;
|
|
853
|
+
subject: z.ZodObject<{
|
|
854
|
+
type: z.ZodString;
|
|
855
|
+
id: z.ZodString;
|
|
856
|
+
revision: z.ZodNumber;
|
|
857
|
+
}, z.core.$strict>;
|
|
858
|
+
}, z.core.$strict>;
|
|
859
|
+
type NotificationDeliveryRequestV9 = z.infer<typeof notificationDeliveryRequestV9Schema>;
|
|
860
|
+
type NotificationBrowserMessage = z.infer<typeof notificationBrowserMessageSchema>;
|
|
861
|
+
type NotificationMessageVariantsV6 = NotificationDeliveryRequestV6['message']['variants'];
|
|
862
|
+
/** Reads routing facts from current envelopes and historical single-route records. */
|
|
863
|
+
declare function notificationRouteKeys(value: {
|
|
864
|
+
routeKey: string;
|
|
865
|
+
} | {
|
|
866
|
+
routeKeys: string[];
|
|
867
|
+
}): string[];
|
|
868
|
+
type NotificationDeliveryRequestV6 = z.infer<typeof notificationDeliveryRequestV6Schema>;
|
|
869
|
+
declare const creatorDraftTaskV1Schema: z.ZodObject<{
|
|
870
|
+
type: z.ZodLiteral<"creator.draft.v1">;
|
|
871
|
+
templateId: z.ZodString;
|
|
872
|
+
signalType: z.ZodString;
|
|
873
|
+
sourceTextZh: z.ZodString;
|
|
874
|
+
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
875
|
+
}, z.core.$strict>;
|
|
876
|
+
declare const localTaskDeliveryRequestV1Schema: z.ZodObject<{
|
|
877
|
+
contractVersion: z.ZodLiteral<1>;
|
|
878
|
+
eventType: z.ZodLiteral<"local-task.delivery.requested">;
|
|
879
|
+
eventId: z.ZodString;
|
|
880
|
+
producer: z.ZodObject<{
|
|
881
|
+
key: z.ZodString;
|
|
882
|
+
environment: z.ZodString;
|
|
883
|
+
}, z.core.$strict>;
|
|
884
|
+
routeKey: z.ZodString;
|
|
885
|
+
occurredAt: z.ZodString;
|
|
886
|
+
requestedAt: z.ZodString;
|
|
887
|
+
deliverBy: z.ZodString;
|
|
888
|
+
subject: z.ZodObject<{
|
|
889
|
+
id: z.ZodString;
|
|
890
|
+
revision: z.ZodNumber;
|
|
891
|
+
type: z.ZodLiteral<"creator-event">;
|
|
892
|
+
}, z.core.$strict>;
|
|
893
|
+
task: z.ZodObject<{
|
|
894
|
+
type: z.ZodLiteral<"creator.draft.v1">;
|
|
895
|
+
templateId: z.ZodString;
|
|
896
|
+
signalType: z.ZodString;
|
|
897
|
+
sourceTextZh: z.ZodString;
|
|
898
|
+
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
899
|
+
}, z.core.$strict>;
|
|
900
|
+
}, z.core.$strict>;
|
|
901
|
+
declare const localTaskDeliveryRequestSchema: z.ZodObject<{
|
|
902
|
+
contractVersion: z.ZodLiteral<1>;
|
|
903
|
+
eventType: z.ZodLiteral<"local-task.delivery.requested">;
|
|
904
|
+
eventId: z.ZodString;
|
|
905
|
+
producer: z.ZodObject<{
|
|
906
|
+
key: z.ZodString;
|
|
907
|
+
environment: z.ZodString;
|
|
908
|
+
}, z.core.$strict>;
|
|
909
|
+
routeKey: z.ZodString;
|
|
910
|
+
occurredAt: z.ZodString;
|
|
911
|
+
requestedAt: z.ZodString;
|
|
912
|
+
deliverBy: z.ZodString;
|
|
913
|
+
subject: z.ZodObject<{
|
|
914
|
+
id: z.ZodString;
|
|
915
|
+
revision: z.ZodNumber;
|
|
916
|
+
type: z.ZodLiteral<"creator-event">;
|
|
917
|
+
}, z.core.$strict>;
|
|
918
|
+
task: z.ZodObject<{
|
|
919
|
+
type: z.ZodLiteral<"creator.draft.v1">;
|
|
920
|
+
templateId: z.ZodString;
|
|
921
|
+
signalType: z.ZodString;
|
|
922
|
+
sourceTextZh: z.ZodString;
|
|
923
|
+
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
924
|
+
}, z.core.$strict>;
|
|
925
|
+
}, z.core.$strict>;
|
|
926
|
+
declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
927
|
+
message: z.ZodObject<{
|
|
928
|
+
type: z.ZodLiteral<"link_summary">;
|
|
929
|
+
title: z.ZodString;
|
|
930
|
+
summary: z.ZodString;
|
|
931
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
932
|
+
label: z.ZodString;
|
|
933
|
+
value: z.ZodString;
|
|
934
|
+
}, z.core.$strict>>;
|
|
935
|
+
primaryLink: z.ZodObject<{
|
|
936
|
+
label: z.ZodString;
|
|
937
|
+
url: z.ZodString;
|
|
938
|
+
}, z.core.$strict>;
|
|
939
|
+
sourceLink: z.ZodOptional<z.ZodObject<{
|
|
940
|
+
label: z.ZodString;
|
|
941
|
+
url: z.ZodString;
|
|
942
|
+
}, z.core.$strict>>;
|
|
943
|
+
}, z.core.$strict>;
|
|
944
|
+
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
945
|
+
eventId: z.ZodString;
|
|
946
|
+
producer: z.ZodObject<{
|
|
947
|
+
key: z.ZodString;
|
|
948
|
+
environment: z.ZodString;
|
|
949
|
+
}, z.core.$strict>;
|
|
950
|
+
routeKey: z.ZodString;
|
|
951
|
+
occurredAt: z.ZodString;
|
|
952
|
+
requestedAt: z.ZodString;
|
|
953
|
+
deliverBy: z.ZodString;
|
|
954
|
+
subject: z.ZodObject<{
|
|
955
|
+
type: z.ZodString;
|
|
956
|
+
id: z.ZodString;
|
|
957
|
+
revision: z.ZodNumber;
|
|
958
|
+
}, z.core.$strict>;
|
|
959
|
+
contractVersion: z.ZodLiteral<1>;
|
|
960
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
961
|
+
message: z.ZodObject<{
|
|
962
|
+
type: z.ZodLiteral<"localized_link_summary">;
|
|
963
|
+
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
964
|
+
title: z.ZodString;
|
|
965
|
+
summary: z.ZodString;
|
|
966
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
967
|
+
label: z.ZodString;
|
|
968
|
+
value: z.ZodString;
|
|
969
|
+
}, z.core.$strict>>;
|
|
970
|
+
key: z.ZodLiteral<"source">;
|
|
971
|
+
locale: z.ZodLiteral<"und">;
|
|
972
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
973
|
+
title: z.ZodString;
|
|
974
|
+
summary: z.ZodString;
|
|
975
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
976
|
+
label: z.ZodString;
|
|
977
|
+
value: z.ZodString;
|
|
978
|
+
}, z.core.$strict>>;
|
|
979
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
980
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
981
|
+
}, z.core.$strict>], "key">>;
|
|
982
|
+
primaryLink: z.ZodObject<{
|
|
983
|
+
label: z.ZodString;
|
|
984
|
+
url: z.ZodString;
|
|
985
|
+
}, z.core.$strict>;
|
|
986
|
+
sourceLink: z.ZodOptional<z.ZodObject<{
|
|
987
|
+
label: z.ZodString;
|
|
988
|
+
url: z.ZodString;
|
|
989
|
+
}, z.core.$strict>>;
|
|
990
|
+
}, z.core.$strict>;
|
|
991
|
+
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
992
|
+
eventId: z.ZodString;
|
|
993
|
+
producer: z.ZodObject<{
|
|
994
|
+
key: z.ZodString;
|
|
995
|
+
environment: z.ZodString;
|
|
996
|
+
}, z.core.$strict>;
|
|
997
|
+
routeKey: z.ZodString;
|
|
998
|
+
occurredAt: z.ZodString;
|
|
999
|
+
requestedAt: z.ZodString;
|
|
1000
|
+
deliverBy: z.ZodString;
|
|
1001
|
+
subject: z.ZodObject<{
|
|
1002
|
+
type: z.ZodString;
|
|
1003
|
+
id: z.ZodString;
|
|
1004
|
+
revision: z.ZodNumber;
|
|
1005
|
+
}, z.core.$strict>;
|
|
1006
|
+
contractVersion: z.ZodLiteral<2>;
|
|
1007
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1008
|
+
message: z.ZodObject<{
|
|
1009
|
+
type: z.ZodLiteral<"structured_notification">;
|
|
1010
|
+
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1011
|
+
key: z.ZodLiteral<"source">;
|
|
1012
|
+
locale: z.ZodLiteral<"und">;
|
|
1013
|
+
title: z.ZodString;
|
|
1014
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1015
|
+
key: z.ZodString;
|
|
1016
|
+
type: z.ZodLiteral<"text">;
|
|
1017
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1018
|
+
value: z.ZodString;
|
|
1019
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1020
|
+
key: z.ZodString;
|
|
1021
|
+
type: z.ZodLiteral<"fields">;
|
|
1022
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1023
|
+
label: z.ZodString;
|
|
1024
|
+
value: z.ZodString;
|
|
1025
|
+
}, z.core.$strict>>;
|
|
1026
|
+
}, z.core.$strict>], "type">>;
|
|
1027
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1028
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
1029
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
1030
|
+
title: z.ZodString;
|
|
1031
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1032
|
+
key: z.ZodString;
|
|
1033
|
+
type: z.ZodLiteral<"text">;
|
|
1034
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1035
|
+
value: z.ZodString;
|
|
1036
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1037
|
+
key: z.ZodString;
|
|
1038
|
+
type: z.ZodLiteral<"fields">;
|
|
1039
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1040
|
+
label: z.ZodString;
|
|
1041
|
+
value: z.ZodString;
|
|
1042
|
+
}, z.core.$strict>>;
|
|
1043
|
+
}, z.core.$strict>], "type">>;
|
|
1044
|
+
}, z.core.$strict>], "key">>;
|
|
1045
|
+
links: z.ZodArray<z.ZodObject<{
|
|
1046
|
+
label: z.ZodString;
|
|
1047
|
+
url: z.ZodString;
|
|
1048
|
+
key: z.ZodString;
|
|
1049
|
+
}, z.core.$strict>>;
|
|
1050
|
+
}, z.core.$strict>;
|
|
1051
|
+
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
1052
|
+
eventId: z.ZodString;
|
|
1053
|
+
producer: z.ZodObject<{
|
|
1054
|
+
key: z.ZodString;
|
|
1055
|
+
environment: z.ZodString;
|
|
1056
|
+
}, z.core.$strict>;
|
|
1057
|
+
routeKey: z.ZodString;
|
|
1058
|
+
occurredAt: z.ZodString;
|
|
1059
|
+
requestedAt: z.ZodString;
|
|
1060
|
+
deliverBy: z.ZodString;
|
|
1061
|
+
subject: z.ZodObject<{
|
|
1062
|
+
type: z.ZodString;
|
|
1063
|
+
id: z.ZodString;
|
|
1064
|
+
revision: z.ZodNumber;
|
|
1065
|
+
}, z.core.$strict>;
|
|
1066
|
+
contractVersion: z.ZodLiteral<3>;
|
|
1067
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1068
|
+
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
1069
|
+
eventId: z.ZodString;
|
|
1070
|
+
producer: z.ZodObject<{
|
|
1071
|
+
key: z.ZodString;
|
|
1072
|
+
environment: z.ZodString;
|
|
1073
|
+
}, z.core.$strict>;
|
|
1074
|
+
routeKey: z.ZodString;
|
|
1075
|
+
occurredAt: z.ZodString;
|
|
1076
|
+
requestedAt: z.ZodString;
|
|
1077
|
+
deliverBy: z.ZodString;
|
|
1078
|
+
subject: z.ZodObject<{
|
|
1079
|
+
type: z.ZodString;
|
|
1080
|
+
id: z.ZodString;
|
|
1081
|
+
revision: z.ZodNumber;
|
|
1082
|
+
}, z.core.$strict>;
|
|
1083
|
+
contractVersion: z.ZodLiteral<4>;
|
|
1084
|
+
message: z.ZodObject<{
|
|
1085
|
+
type: z.ZodLiteral<"structured_notification">;
|
|
1086
|
+
links: z.ZodArray<z.ZodObject<{
|
|
1087
|
+
label: z.ZodString;
|
|
1088
|
+
url: z.ZodString;
|
|
1089
|
+
key: z.ZodString;
|
|
1090
|
+
}, z.core.$strict>>;
|
|
1091
|
+
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1092
|
+
key: z.ZodLiteral<"source">;
|
|
1093
|
+
locale: z.ZodLiteral<"und">;
|
|
1094
|
+
title: z.ZodString;
|
|
1095
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1096
|
+
key: z.ZodString;
|
|
1097
|
+
type: z.ZodLiteral<"text">;
|
|
1098
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1099
|
+
value: z.ZodString;
|
|
1100
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1101
|
+
key: z.ZodString;
|
|
1102
|
+
type: z.ZodLiteral<"fields">;
|
|
1103
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1104
|
+
label: z.ZodString;
|
|
1105
|
+
value: z.ZodString;
|
|
1106
|
+
}, z.core.$strict>>;
|
|
1107
|
+
}, z.core.$strict>], "type">>;
|
|
1108
|
+
body: z.ZodObject<{
|
|
1109
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1110
|
+
value: z.ZodString;
|
|
1111
|
+
}, z.core.$strict>;
|
|
1112
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1113
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
1114
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
1115
|
+
title: z.ZodString;
|
|
1116
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1117
|
+
key: z.ZodString;
|
|
1118
|
+
type: z.ZodLiteral<"text">;
|
|
1119
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1120
|
+
value: z.ZodString;
|
|
1121
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1122
|
+
key: z.ZodString;
|
|
1123
|
+
type: z.ZodLiteral<"fields">;
|
|
1124
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1125
|
+
label: z.ZodString;
|
|
1126
|
+
value: z.ZodString;
|
|
1127
|
+
}, z.core.$strict>>;
|
|
1128
|
+
}, z.core.$strict>], "type">>;
|
|
1129
|
+
body: z.ZodObject<{
|
|
1130
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1131
|
+
value: z.ZodString;
|
|
1132
|
+
}, z.core.$strict>;
|
|
1133
|
+
}, z.core.$strict>], "key">>;
|
|
1134
|
+
}, z.core.$strict>;
|
|
1135
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1136
|
+
message: z.ZodObject<{
|
|
1137
|
+
type: z.ZodLiteral<"structured_notification">;
|
|
1138
|
+
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1139
|
+
key: z.ZodLiteral<"source">;
|
|
1140
|
+
locale: z.ZodLiteral<"und">;
|
|
1141
|
+
title: z.ZodString;
|
|
1142
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1143
|
+
key: z.ZodString;
|
|
1144
|
+
type: z.ZodLiteral<"text">;
|
|
1145
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1146
|
+
value: z.ZodString;
|
|
1147
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1148
|
+
key: z.ZodString;
|
|
1149
|
+
type: z.ZodLiteral<"fields">;
|
|
1150
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1151
|
+
label: z.ZodString;
|
|
1152
|
+
value: z.ZodString;
|
|
1153
|
+
}, z.core.$strict>>;
|
|
1154
|
+
}, z.core.$strict>], "type">>;
|
|
1155
|
+
bodyLabel: z.ZodOptional<z.ZodString>;
|
|
1156
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1157
|
+
key: z.ZodString;
|
|
1158
|
+
label: z.ZodString;
|
|
1159
|
+
}, z.core.$strict>>;
|
|
790
1160
|
}, z.core.$strict>, z.ZodObject<{
|
|
791
1161
|
key: z.ZodLiteral<"zh-CN">;
|
|
792
1162
|
locale: z.ZodLiteral<"zh-CN">;
|
|
@@ -804,19 +1174,56 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
804
1174
|
value: z.ZodString;
|
|
805
1175
|
}, z.core.$strict>>;
|
|
806
1176
|
}, z.core.$strict>], "type">>;
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1177
|
+
bodyLabel: z.ZodOptional<z.ZodString>;
|
|
1178
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1179
|
+
key: z.ZodString;
|
|
1180
|
+
label: z.ZodString;
|
|
1181
|
+
}, z.core.$strict>>;
|
|
811
1182
|
}, z.core.$strict>], "key">>;
|
|
1183
|
+
links: z.ZodArray<z.ZodObject<{
|
|
1184
|
+
key: z.ZodString;
|
|
1185
|
+
url: z.ZodString;
|
|
1186
|
+
}, z.core.$strict>>;
|
|
1187
|
+
body: z.ZodObject<{
|
|
1188
|
+
value: z.ZodString;
|
|
1189
|
+
}, z.core.$strict>;
|
|
1190
|
+
}, z.core.$strict>;
|
|
1191
|
+
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
1192
|
+
eventId: z.ZodString;
|
|
1193
|
+
producer: z.ZodObject<{
|
|
1194
|
+
key: z.ZodString;
|
|
1195
|
+
environment: z.ZodString;
|
|
1196
|
+
}, z.core.$strict>;
|
|
1197
|
+
routeKey: z.ZodString;
|
|
1198
|
+
occurredAt: z.ZodString;
|
|
1199
|
+
requestedAt: z.ZodString;
|
|
1200
|
+
deliverBy: z.ZodString;
|
|
1201
|
+
subject: z.ZodObject<{
|
|
1202
|
+
type: z.ZodString;
|
|
1203
|
+
id: z.ZodString;
|
|
1204
|
+
revision: z.ZodNumber;
|
|
812
1205
|
}, z.core.$strict>;
|
|
1206
|
+
contractVersion: z.ZodLiteral<5>;
|
|
813
1207
|
}, z.core.$strict>, z.ZodObject<{
|
|
1208
|
+
contractVersion: z.ZodLiteral<6>;
|
|
814
1209
|
message: z.ZodObject<{
|
|
815
1210
|
type: z.ZodLiteral<"structured_notification">;
|
|
1211
|
+
links: z.ZodArray<z.ZodObject<{
|
|
1212
|
+
key: z.ZodString;
|
|
1213
|
+
url: z.ZodString;
|
|
1214
|
+
}, z.core.$strict>>;
|
|
1215
|
+
bodies: z.ZodArray<z.ZodObject<{
|
|
1216
|
+
key: z.ZodString;
|
|
1217
|
+
value: z.ZodString;
|
|
1218
|
+
}, z.core.$strict>>;
|
|
816
1219
|
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
817
1220
|
key: z.ZodLiteral<"source">;
|
|
818
|
-
locale: z.ZodLiteral<"und">;
|
|
819
1221
|
title: z.ZodString;
|
|
1222
|
+
locale: z.ZodLiteral<"und">;
|
|
1223
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1224
|
+
key: z.ZodString;
|
|
1225
|
+
label: z.ZodString;
|
|
1226
|
+
}, z.core.$strict>>;
|
|
820
1227
|
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
821
1228
|
key: z.ZodString;
|
|
822
1229
|
type: z.ZodLiteral<"text">;
|
|
@@ -830,15 +1237,19 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
830
1237
|
value: z.ZodString;
|
|
831
1238
|
}, z.core.$strict>>;
|
|
832
1239
|
}, z.core.$strict>], "type">>;
|
|
833
|
-
|
|
834
|
-
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1240
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
835
1241
|
key: z.ZodString;
|
|
836
1242
|
label: z.ZodString;
|
|
837
1243
|
}, z.core.$strict>>;
|
|
1244
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
838
1245
|
}, z.core.$strict>, z.ZodObject<{
|
|
839
1246
|
key: z.ZodLiteral<"zh-CN">;
|
|
840
|
-
locale: z.ZodLiteral<"zh-CN">;
|
|
841
1247
|
title: z.ZodString;
|
|
1248
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
1249
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1250
|
+
key: z.ZodString;
|
|
1251
|
+
label: z.ZodString;
|
|
1252
|
+
}, z.core.$strict>>;
|
|
842
1253
|
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
843
1254
|
key: z.ZodString;
|
|
844
1255
|
type: z.ZodLiteral<"text">;
|
|
@@ -852,19 +1263,94 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
852
1263
|
value: z.ZodString;
|
|
853
1264
|
}, z.core.$strict>>;
|
|
854
1265
|
}, z.core.$strict>], "type">>;
|
|
855
|
-
|
|
856
|
-
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1266
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
857
1267
|
key: z.ZodString;
|
|
858
1268
|
label: z.ZodString;
|
|
859
1269
|
}, z.core.$strict>>;
|
|
1270
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
860
1271
|
}, z.core.$strict>], "key">>;
|
|
1272
|
+
}, z.core.$strict>;
|
|
1273
|
+
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
1274
|
+
eventId: z.ZodString;
|
|
1275
|
+
producer: z.ZodObject<{
|
|
1276
|
+
key: z.ZodString;
|
|
1277
|
+
environment: z.ZodString;
|
|
1278
|
+
}, z.core.$strict>;
|
|
1279
|
+
routeKey: z.ZodString;
|
|
1280
|
+
occurredAt: z.ZodString;
|
|
1281
|
+
requestedAt: z.ZodString;
|
|
1282
|
+
deliverBy: z.ZodString;
|
|
1283
|
+
subject: z.ZodObject<{
|
|
1284
|
+
type: z.ZodString;
|
|
1285
|
+
id: z.ZodString;
|
|
1286
|
+
revision: z.ZodNumber;
|
|
1287
|
+
}, z.core.$strict>;
|
|
1288
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1289
|
+
contractVersion: z.ZodLiteral<7>;
|
|
1290
|
+
routeKeys: z.ZodArray<z.ZodString>;
|
|
1291
|
+
message: z.ZodObject<{
|
|
1292
|
+
type: z.ZodLiteral<"structured_notification">;
|
|
861
1293
|
links: z.ZodArray<z.ZodObject<{
|
|
862
1294
|
key: z.ZodString;
|
|
863
1295
|
url: z.ZodString;
|
|
864
1296
|
}, z.core.$strict>>;
|
|
865
|
-
|
|
1297
|
+
bodies: z.ZodArray<z.ZodObject<{
|
|
1298
|
+
key: z.ZodString;
|
|
866
1299
|
value: z.ZodString;
|
|
867
|
-
}, z.core.$strict
|
|
1300
|
+
}, z.core.$strict>>;
|
|
1301
|
+
variants: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1302
|
+
key: z.ZodLiteral<"source">;
|
|
1303
|
+
title: z.ZodString;
|
|
1304
|
+
locale: z.ZodLiteral<"und">;
|
|
1305
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1306
|
+
key: z.ZodString;
|
|
1307
|
+
label: z.ZodString;
|
|
1308
|
+
}, z.core.$strict>>;
|
|
1309
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1310
|
+
key: z.ZodString;
|
|
1311
|
+
type: z.ZodLiteral<"text">;
|
|
1312
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1313
|
+
value: z.ZodString;
|
|
1314
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1315
|
+
key: z.ZodString;
|
|
1316
|
+
type: z.ZodLiteral<"fields">;
|
|
1317
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1318
|
+
label: z.ZodString;
|
|
1319
|
+
value: z.ZodString;
|
|
1320
|
+
}, z.core.$strict>>;
|
|
1321
|
+
}, z.core.$strict>], "type">>;
|
|
1322
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
1323
|
+
key: z.ZodString;
|
|
1324
|
+
label: z.ZodString;
|
|
1325
|
+
}, z.core.$strict>>;
|
|
1326
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
1327
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1328
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
1329
|
+
title: z.ZodString;
|
|
1330
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
1331
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1332
|
+
key: z.ZodString;
|
|
1333
|
+
label: z.ZodString;
|
|
1334
|
+
}, z.core.$strict>>;
|
|
1335
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1336
|
+
key: z.ZodString;
|
|
1337
|
+
type: z.ZodLiteral<"text">;
|
|
1338
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1339
|
+
value: z.ZodString;
|
|
1340
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1341
|
+
key: z.ZodString;
|
|
1342
|
+
type: z.ZodLiteral<"fields">;
|
|
1343
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1344
|
+
label: z.ZodString;
|
|
1345
|
+
value: z.ZodString;
|
|
1346
|
+
}, z.core.$strict>>;
|
|
1347
|
+
}, z.core.$strict>], "type">>;
|
|
1348
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
1349
|
+
key: z.ZodString;
|
|
1350
|
+
label: z.ZodString;
|
|
1351
|
+
}, z.core.$strict>>;
|
|
1352
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
1353
|
+
}, z.core.$strict>], "key">>;
|
|
868
1354
|
}, z.core.$strict>;
|
|
869
1355
|
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
870
1356
|
eventId: z.ZodString;
|
|
@@ -872,7 +1358,6 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
872
1358
|
key: z.ZodString;
|
|
873
1359
|
environment: z.ZodString;
|
|
874
1360
|
}, z.core.$strict>;
|
|
875
|
-
routeKey: z.ZodString;
|
|
876
1361
|
occurredAt: z.ZodString;
|
|
877
1362
|
requestedAt: z.ZodString;
|
|
878
1363
|
deliverBy: z.ZodString;
|
|
@@ -881,9 +1366,8 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
881
1366
|
id: z.ZodString;
|
|
882
1367
|
revision: z.ZodNumber;
|
|
883
1368
|
}, z.core.$strict>;
|
|
884
|
-
contractVersion: z.ZodLiteral<5>;
|
|
885
1369
|
}, z.core.$strict>, z.ZodObject<{
|
|
886
|
-
contractVersion: z.ZodLiteral<
|
|
1370
|
+
contractVersion: z.ZodLiteral<8>;
|
|
887
1371
|
message: z.ZodObject<{
|
|
888
1372
|
type: z.ZodLiteral<"structured_notification">;
|
|
889
1373
|
links: z.ZodArray<z.ZodObject<{
|
|
@@ -947,14 +1431,72 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
947
1431
|
}, z.core.$strict>>;
|
|
948
1432
|
footer: z.ZodOptional<z.ZodString>;
|
|
949
1433
|
}, z.core.$strict>], "key">>;
|
|
1434
|
+
channelVariants: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
1435
|
+
qq: "qq";
|
|
1436
|
+
tg: "tg";
|
|
1437
|
+
wechat: "wechat";
|
|
1438
|
+
lark: "lark";
|
|
1439
|
+
}> & z.core.$partial, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1440
|
+
key: z.ZodLiteral<"source">;
|
|
1441
|
+
title: z.ZodString;
|
|
1442
|
+
locale: z.ZodLiteral<"und">;
|
|
1443
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1444
|
+
key: z.ZodString;
|
|
1445
|
+
label: z.ZodString;
|
|
1446
|
+
}, z.core.$strict>>;
|
|
1447
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1448
|
+
key: z.ZodString;
|
|
1449
|
+
type: z.ZodLiteral<"text">;
|
|
1450
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1451
|
+
value: z.ZodString;
|
|
1452
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1453
|
+
key: z.ZodString;
|
|
1454
|
+
type: z.ZodLiteral<"fields">;
|
|
1455
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1456
|
+
label: z.ZodString;
|
|
1457
|
+
value: z.ZodString;
|
|
1458
|
+
}, z.core.$strict>>;
|
|
1459
|
+
}, z.core.$strict>], "type">>;
|
|
1460
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
1461
|
+
key: z.ZodString;
|
|
1462
|
+
label: z.ZodString;
|
|
1463
|
+
}, z.core.$strict>>;
|
|
1464
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
1465
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1466
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
1467
|
+
title: z.ZodString;
|
|
1468
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
1469
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1470
|
+
key: z.ZodString;
|
|
1471
|
+
label: z.ZodString;
|
|
1472
|
+
}, z.core.$strict>>;
|
|
1473
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1474
|
+
key: z.ZodString;
|
|
1475
|
+
type: z.ZodLiteral<"text">;
|
|
1476
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
value: z.ZodString;
|
|
1478
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1479
|
+
key: z.ZodString;
|
|
1480
|
+
type: z.ZodLiteral<"fields">;
|
|
1481
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1482
|
+
label: z.ZodString;
|
|
1483
|
+
value: z.ZodString;
|
|
1484
|
+
}, z.core.$strict>>;
|
|
1485
|
+
}, z.core.$strict>], "type">>;
|
|
1486
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
1487
|
+
key: z.ZodString;
|
|
1488
|
+
label: z.ZodString;
|
|
1489
|
+
}, z.core.$strict>>;
|
|
1490
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
1491
|
+
}, z.core.$strict>], "key">>>>;
|
|
950
1492
|
}, z.core.$strict>;
|
|
1493
|
+
routeKeys: z.ZodArray<z.ZodString>;
|
|
951
1494
|
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
952
1495
|
eventId: z.ZodString;
|
|
953
1496
|
producer: z.ZodObject<{
|
|
954
1497
|
key: z.ZodString;
|
|
955
1498
|
environment: z.ZodString;
|
|
956
1499
|
}, z.core.$strict>;
|
|
957
|
-
routeKey: z.ZodString;
|
|
958
1500
|
occurredAt: z.ZodString;
|
|
959
1501
|
requestedAt: z.ZodString;
|
|
960
1502
|
deliverBy: z.ZodString;
|
|
@@ -964,8 +1506,17 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
964
1506
|
revision: z.ZodNumber;
|
|
965
1507
|
}, z.core.$strict>;
|
|
966
1508
|
}, z.core.$strict>, z.ZodObject<{
|
|
967
|
-
contractVersion: z.ZodLiteral<
|
|
968
|
-
|
|
1509
|
+
contractVersion: z.ZodLiteral<9>;
|
|
1510
|
+
audience: z.ZodOptional<z.ZodObject<{
|
|
1511
|
+
topics: z.ZodArray<z.ZodString>;
|
|
1512
|
+
}, z.core.$strict>>;
|
|
1513
|
+
browserMessages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1514
|
+
locale: z.ZodString;
|
|
1515
|
+
contentLocale: z.ZodString;
|
|
1516
|
+
title: z.ZodString;
|
|
1517
|
+
body: z.ZodString;
|
|
1518
|
+
url: z.ZodString;
|
|
1519
|
+
}, z.core.$strict>>>;
|
|
969
1520
|
message: z.ZodObject<{
|
|
970
1521
|
type: z.ZodLiteral<"structured_notification">;
|
|
971
1522
|
links: z.ZodArray<z.ZodObject<{
|
|
@@ -1029,7 +1580,66 @@ declare const notificationDeliveryRequestSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
1029
1580
|
}, z.core.$strict>>;
|
|
1030
1581
|
footer: z.ZodOptional<z.ZodString>;
|
|
1031
1582
|
}, z.core.$strict>], "key">>;
|
|
1583
|
+
channelVariants: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
1584
|
+
qq: "qq";
|
|
1585
|
+
tg: "tg";
|
|
1586
|
+
wechat: "wechat";
|
|
1587
|
+
lark: "lark";
|
|
1588
|
+
}> & z.core.$partial, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1589
|
+
key: z.ZodLiteral<"source">;
|
|
1590
|
+
title: z.ZodString;
|
|
1591
|
+
locale: z.ZodLiteral<"und">;
|
|
1592
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1593
|
+
key: z.ZodString;
|
|
1594
|
+
label: z.ZodString;
|
|
1595
|
+
}, z.core.$strict>>;
|
|
1596
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1597
|
+
key: z.ZodString;
|
|
1598
|
+
type: z.ZodLiteral<"text">;
|
|
1599
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1600
|
+
value: z.ZodString;
|
|
1601
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1602
|
+
key: z.ZodString;
|
|
1603
|
+
type: z.ZodLiteral<"fields">;
|
|
1604
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1605
|
+
label: z.ZodString;
|
|
1606
|
+
value: z.ZodString;
|
|
1607
|
+
}, z.core.$strict>>;
|
|
1608
|
+
}, z.core.$strict>], "type">>;
|
|
1609
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
1610
|
+
key: z.ZodString;
|
|
1611
|
+
label: z.ZodString;
|
|
1612
|
+
}, z.core.$strict>>;
|
|
1613
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
1614
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1615
|
+
key: z.ZodLiteral<"zh-CN">;
|
|
1616
|
+
title: z.ZodString;
|
|
1617
|
+
locale: z.ZodLiteral<"zh-CN">;
|
|
1618
|
+
linkLabels: z.ZodArray<z.ZodObject<{
|
|
1619
|
+
key: z.ZodString;
|
|
1620
|
+
label: z.ZodString;
|
|
1621
|
+
}, z.core.$strict>>;
|
|
1622
|
+
sections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1623
|
+
key: z.ZodString;
|
|
1624
|
+
type: z.ZodLiteral<"text">;
|
|
1625
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1626
|
+
value: z.ZodString;
|
|
1627
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1628
|
+
key: z.ZodString;
|
|
1629
|
+
type: z.ZodLiteral<"fields">;
|
|
1630
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1631
|
+
label: z.ZodString;
|
|
1632
|
+
value: z.ZodString;
|
|
1633
|
+
}, z.core.$strict>>;
|
|
1634
|
+
}, z.core.$strict>], "type">>;
|
|
1635
|
+
bodyRefs: z.ZodArray<z.ZodObject<{
|
|
1636
|
+
key: z.ZodString;
|
|
1637
|
+
label: z.ZodString;
|
|
1638
|
+
}, z.core.$strict>>;
|
|
1639
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
1640
|
+
}, z.core.$strict>], "key">>>>;
|
|
1032
1641
|
}, z.core.$strict>;
|
|
1642
|
+
routeKeys: z.ZodArray<z.ZodString>;
|
|
1033
1643
|
eventType: z.ZodLiteral<"notification.delivery.requested">;
|
|
1034
1644
|
eventId: z.ZodString;
|
|
1035
1645
|
producer: z.ZodObject<{
|
|
@@ -2303,4 +2913,4 @@ interface NotificationMessageDeliveryServiceV4 {
|
|
|
2303
2913
|
/** Multi-route message delivery; historical requests and receipts remain supported. */
|
|
2304
2914
|
interface NotificationMessageDeliveryServiceV5 extends NotificationMessageDeliveryServiceV4 {}
|
|
2305
2915
|
//#endregion
|
|
2306
|
-
export { CreatorDraftTaskV1, LocalTaskDeliverResultV1, LocalTaskDeliveryReceiptV1, LocalTaskDeliveryRequest, LocalTaskDeliveryRequestV1, LocalTaskDeliveryServiceV1, LocalTaskGetReceiptResultV1, NotificationDeliverResultV1, NotificationDeliverResultV2, NotificationDeliveryReceiptV1, NotificationDeliveryReceiptV2, NotificationDeliveryReceiptV3, NotificationDeliveryRejectionV1, NotificationDeliveryRequest, NotificationDeliveryRequestV1, NotificationDeliveryRequestV2, NotificationDeliveryRequestV3, NotificationDeliveryRequestV4, NotificationDeliveryRequestV5, NotificationDeliveryRequestV6, NotificationDeliveryRequestV7, NotificationDeliveryServiceV1, NotificationDeliveryServiceV2, NotificationDeliveryServiceV3, NotificationGetReceiptResultV1, NotificationGetReceiptResultV2, NotificationMessageBody, NotificationMessageDeliveryServiceV4, NotificationMessageDeliveryServiceV5, NotificationMessageReceipt, NotificationMessageVariantKey, NotificationSharedMessageBody, NotificationStructuredMessageSection, NotificationStructuredMessageVariant, localTaskDeliveryContractVersionV1, localTaskDeliveryMaximumDeadlineMillisecondsV1, localTaskDeliveryRequestMaximumUtf8BytesV1, localTaskDeliveryRequestSchema, localTaskDeliveryRequestV1Schema, notificationDeliverResultV1Schema, notificationDeliverResultV2Schema, notificationDeliveryContractVersionV1, notificationDeliveryContractVersionV2, notificationDeliveryContractVersionV3, notificationDeliveryContractVersionV4, notificationDeliveryContractVersionV5, notificationDeliveryContractVersionV7, notificationDeliveryMaximumDeadlineMillisecondsV1, notificationDeliveryMaximumDeadlineMillisecondsV2, notificationDeliveryMaximumDeadlineMillisecondsV3, notificationDeliveryMaximumDeadlineMillisecondsV4, notificationDeliveryMaximumDeadlineMillisecondsV5, notificationDeliveryMaximumDestinationsV1, notificationDeliveryReasonsV1, notificationDeliveryReasonsV2, notificationDeliveryReceiptV1Schema, notificationDeliveryReceiptV2Schema, notificationDeliveryReceiptV3Schema, notificationDeliveryRejectionCodesV1, notificationDeliveryRejectionV1Schema, notificationDeliveryRequestMaximumUtf8BytesV1, notificationDeliveryRequestMaximumUtf8BytesV2, notificationDeliveryRequestMaximumUtf8BytesV3, notificationDeliveryRequestMaximumUtf8BytesV4, notificationDeliveryRequestMaximumUtf8BytesV5, notificationDeliveryRequestSchema, notificationDeliveryRequestV1Schema, notificationDeliveryRequestV2Schema, notificationDeliveryRequestV3Schema, notificationDeliveryRequestV4Schema, notificationDeliveryRequestV5Schema, notificationDeliveryRequestV6Schema, notificationDeliveryRequestV7Schema, notificationDeliveryStatesV1, notificationDeliveryStatesV2, notificationDestinationFailureCodesV1, notificationDestinationStatesV1, notificationDestinationStatesV2, notificationGetReceiptResultV1Schema, notificationGetReceiptResultV2Schema, notificationMessageReceiptSchema, notificationMessageVariantKeys, notificationRouteKeys, notificationValidationIssueCodesV1, safeDeliveryCauseSchema };
|
|
2916
|
+
export { CreatorDraftTaskV1, LocalTaskDeliverResultV1, LocalTaskDeliveryReceiptV1, LocalTaskDeliveryRequest, LocalTaskDeliveryRequestV1, LocalTaskDeliveryServiceV1, LocalTaskGetReceiptResultV1, NotificationBrowserMessage, type NotificationBrowserPayload, NotificationDeliverResultV1, NotificationDeliverResultV2, NotificationDeliveryChannelKey, NotificationDeliveryReceiptV1, NotificationDeliveryReceiptV2, NotificationDeliveryReceiptV3, NotificationDeliveryRejectionV1, NotificationDeliveryRequest, NotificationDeliveryRequestV1, NotificationDeliveryRequestV2, NotificationDeliveryRequestV3, NotificationDeliveryRequestV4, NotificationDeliveryRequestV5, NotificationDeliveryRequestV6, NotificationDeliveryRequestV7, NotificationDeliveryRequestV8, NotificationDeliveryRequestV9, NotificationDeliveryServiceV1, NotificationDeliveryServiceV2, NotificationDeliveryServiceV3, NotificationGetReceiptResultV1, NotificationGetReceiptResultV2, NotificationMessageBody, NotificationMessageDeliveryServiceV4, NotificationMessageDeliveryServiceV5, NotificationMessageReceipt, NotificationMessageVariantKey, NotificationMessageVariantsV6, NotificationSharedMessageBody, NotificationStructuredMessageSection, NotificationStructuredMessageVariant, localTaskDeliveryContractVersionV1, localTaskDeliveryMaximumDeadlineMillisecondsV1, localTaskDeliveryRequestMaximumUtf8BytesV1, localTaskDeliveryRequestSchema, localTaskDeliveryRequestV1Schema, notificationBrowserMessageSchema, notificationBrowserPayloadSchema, notificationDeliverResultV1Schema, notificationDeliverResultV2Schema, notificationDeliveryChannelKeys, notificationDeliveryContractVersionV1, notificationDeliveryContractVersionV2, notificationDeliveryContractVersionV3, notificationDeliveryContractVersionV4, notificationDeliveryContractVersionV5, notificationDeliveryContractVersionV7, notificationDeliveryContractVersionV8, notificationDeliveryContractVersionV9, notificationDeliveryMaximumDeadlineMillisecondsV1, notificationDeliveryMaximumDeadlineMillisecondsV2, notificationDeliveryMaximumDeadlineMillisecondsV3, notificationDeliveryMaximumDeadlineMillisecondsV4, notificationDeliveryMaximumDeadlineMillisecondsV5, notificationDeliveryMaximumDestinationsV1, notificationDeliveryReasonsV1, notificationDeliveryReasonsV2, notificationDeliveryReceiptV1Schema, notificationDeliveryReceiptV2Schema, notificationDeliveryReceiptV3Schema, notificationDeliveryRejectionCodesV1, notificationDeliveryRejectionV1Schema, notificationDeliveryRequestMaximumUtf8BytesV1, notificationDeliveryRequestMaximumUtf8BytesV2, notificationDeliveryRequestMaximumUtf8BytesV3, notificationDeliveryRequestMaximumUtf8BytesV4, notificationDeliveryRequestMaximumUtf8BytesV5, notificationDeliveryRequestMaximumUtf8BytesV9, notificationDeliveryRequestSchema, notificationDeliveryRequestV1Schema, notificationDeliveryRequestV2Schema, notificationDeliveryRequestV3Schema, notificationDeliveryRequestV4Schema, notificationDeliveryRequestV5Schema, notificationDeliveryRequestV6Schema, notificationDeliveryRequestV7Schema, notificationDeliveryRequestV8Schema, notificationDeliveryRequestV9Schema, notificationDeliveryStatesV1, notificationDeliveryStatesV2, notificationDestinationFailureCodesV1, notificationDestinationStatesV1, notificationDestinationStatesV2, notificationGetReceiptResultV1Schema, notificationGetReceiptResultV2Schema, notificationMessageReceiptSchema, notificationMessageVariantKeys, notificationRouteKeys, notificationValidationIssueCodesV1, safeDeliveryCauseSchema };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";const t=1,n=2,r=3,i=4,a=5,o=7,ee=20,s=32*1024,c=1380*60*1e3,te=s,ne=c,l=s,u=c,d=s,f=c,p=s,m=c,re=1,h=32*1024,ie=10080*60*1e3,g=[`pending`,`delivering`,`partial`,`delivered`,`failed`,`expired`],_=[`accepted`,`enqueue_retry_wait`,`in_progress`,`partial_delivery`,`complete`,`retry_exhausted`,`delivery_deadline_exceeded`,`destination_configuration_unavailable`],v=[...g,`unconfirmed`],y=[..._,`delivery_unconfirmed`],b=[`pending`,`delivering`,`delivered`,`failed`,`expired`],x=[...b,`unconfirmed`],S=[`provider_timeout`,`provider_rate_limited`,`provider_unavailable`,`provider_rejected`,`destination_configuration_unavailable`,`delivery_interrupted`,`retry_exhausted`],C=[`invalid_request`,`request_too_large`,`producer_scope_mismatch`,`route_not_allowed`,`event_identity_conflict`,`route_not_found`,`route_empty`,`delivery_deadline_invalid`],w=[`invalid_type`,`invalid_value`,`too_small`,`too_big`,`invalid_format`,`unrecognized_keys`,`custom`],ae=[`source`,`zh-CN`],oe=new TextEncoder,T=/^[a-z][a-z0-9-]{0,62}$/,se=/^[a-z][a-z0-9-]{0,31}(?:\.[a-z][a-z0-9-]{0,31}){1,3}$/,ce=/^[A-Z0-9][\w.:-]{0,127}$/i;function le(e){return[...e].length}function E(t){return e.string().refine(e=>le(e)>0,{message:`too_small`}).refine(e=>le(e)<=t,{message:`too_big`})}const D=e.string().datetime({offset:!0}),O=e.object({key:e.string().regex(T),environment:e.string().regex(T)}).strict(),k=e.object({type:e.string().regex(T),id:e.string().regex(ce),revision:e.number().int().positive()}).strict(),A=e.string().min(1).max(127).regex(se),j=e.object({label:E(48),url:E(2048).refine(e=>[...e].every(e=>{let t=e.codePointAt(0);return t!==void 0&&t>31&&t!==127}),{message:`invalid_https_url`}).refine(e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},{message:`invalid_https_url`})}).strict(),M={eventType:e.literal(`notification.delivery.requested`),eventId:e.string().uuid(),producer:O,routeKey:A,occurredAt:D,requestedAt:D,deliverBy:D,subject:k},ue=e.object({contractVersion:e.literal(1),...M,message:e.object({type:e.literal(`link_summary`),title:E(160),summary:E(1200),facts:e.array(e.object({label:E(48),value:E(500)}).strict()).max(10),primaryLink:j,sourceLink:j.optional()}).strict()}).strict();function N(e,t,n,r){let i=Date.parse(e.requestedAt),a=Date.parse(e.deliverBy);(!Number.isFinite(i)||!Number.isFinite(a)||a<=i||a-i>n)&&t.addIssue({code:`custom`,message:`delivery_deadline_invalid`,path:[`deliverBy`]}),oe.encode(JSON.stringify(e)).byteLength>r&&t.addIssue({code:`custom`,message:`request_too_large`})}const P=ue.superRefine((e,t)=>N(e,t,c,s)),F={title:E(160),summary:E(1200),facts:e.array(e.object({label:E(48),value:E(500)}).strict()).max(10)},de=e.discriminatedUnion(`key`,[e.object({key:e.literal(`source`),locale:e.literal(`und`),...F}).strict(),e.object({key:e.literal(`zh-CN`),locale:e.literal(`zh-CN`),...F}).strict()]),fe=e.array(de).min(1).max(2).superRefine((e,t)=>{e.filter(e=>e.key===`source`).length!==1&&t.addIssue({code:`custom`,message:`source_variant_required_once`}),new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_variant_duplicate`})}),I=e.object({contractVersion:e.literal(2),...M,message:e.object({type:e.literal(`localized_link_summary`),variants:fe,primaryLink:j,sourceLink:j.optional()}).strict()}).strict().superRefine((e,t)=>N(e,t,ne,te)),pe=e.discriminatedUnion(`type`,[e.object({key:e.string().regex(T),type:e.literal(`text`),label:E(48).optional(),value:E(4e3)}).strict(),e.object({key:e.string().regex(T),type:e.literal(`fields`),items:e.array(e.object({label:E(48),value:E(1200)}).strict()).min(1).max(20)}).strict()]),L=e.array(pe).max(30).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_section_duplicate`})}),R=L.min(1),z=e.discriminatedUnion(`key`,[e.object({key:e.literal(`source`),locale:e.literal(`und`),title:E(160),sections:R}).strict(),e.object({key:e.literal(`zh-CN`),locale:e.literal(`zh-CN`),title:E(160),sections:R}).strict()]),B=(e,t,n=!1)=>{e.filter(e=>e.key===`source`).length!==1&&t.addIssue({code:`custom`,message:`source_variant_required_once`}),new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_variant_duplicate`});let r=e.find(e=>e.key===`source`),i=e.find(e=>e.key===`zh-CN`);if(r&&i){let a=new Set(r.sections.map(e=>e.key)),o=new Set(i.sections.map(e=>e.key)),ee=r.sections.filter(e=>!n||e.type!==`text`||o.has(e.key)).map(e=>`${e.key}:${e.type}`),s=i.sections.filter(e=>!n||e.type!==`text`||a.has(e.key)).map(e=>`${e.key}:${e.type}`);JSON.stringify(ee)!==JSON.stringify(s)&&t.addIssue({code:`custom`,message:`message_variant_structure_mismatch`,path:[e.indexOf(i),`sections`]})}},me=e.array(z).min(1).max(2).superRefine(B),V=e.object({contractVersion:e.literal(3),...M,message:e.object({type:e.literal(`structured_notification`),variants:me,links:e.array(e.object({key:e.string().regex(T),...j.shape}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_duplicate`})})}).strict()}).strict(),H=V.superRefine((e,t)=>N(e,t,u,l)),U=e.object({label:E(48).optional(),value:E(d)}).strict(),he=e.discriminatedUnion(`key`,[z.options[0].extend({body:U}),z.options[1].extend({body:U})]),W=V.extend({contractVersion:e.literal(4),message:V.shape.message.extend({variants:e.array(he).min(1).max(2).superRefine(B)})}).superRefine((e,t)=>N(e,t,f,d)),G=e.discriminatedUnion(`key`,[z.options[0].extend({bodyLabel:E(48).optional(),linkLabels:e.array(e.object({key:e.string().regex(T),label:E(48)}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_label_duplicate`})})}),z.options[1].extend({bodyLabel:E(48).optional(),linkLabels:e.array(e.object({key:e.string().regex(T),label:E(48)}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_label_duplicate`})})})]),ge=e.object({value:E(p)}).strict(),K=e.object({contractVersion:e.literal(5),...M,message:e.object({type:e.literal(`structured_notification`),variants:e.array(G).min(1).max(2).superRefine(B),links:e.array(e.object({key:e.string().regex(T),url:j.shape.url}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_duplicate`})}),body:ge}).strict()}).strict().superRefine((e,t)=>{N(e,t,m,p);let n=e.message.links.map(e=>e.key);for(let[r,i]of e.message.variants.entries()){let e=i.linkLabels.map(e=>e.key);JSON.stringify(e)!==JSON.stringify(n)&&t.addIssue({code:`custom`,message:`message_variant_link_labels_mismatch`,path:[`message`,`variants`,r,`linkLabels`]})}}),q=e.object({...K.shape,contractVersion:e.literal(6),message:K.shape.message.omit({body:!0}).extend({bodies:e.array(e.object({key:e.string().regex(T),value:E(p)}).strict()).max(2),variants:e.array(e.discriminatedUnion(`key`,[G.options[0].omit({bodyLabel:!0}).extend({sections:L,bodyRefs:e.array(e.object({key:e.string().regex(T),label:E(48)}).strict()).max(2),footer:E(500).optional()}),G.options[1].omit({bodyLabel:!0}).extend({sections:L,bodyRefs:e.array(e.object({key:e.string().regex(T),label:E(48)}).strict()).max(2),footer:E(500).optional()})])).min(1).max(2).superRefine((e,t)=>B(e,t,!0))})}).strict().superRefine(J);function J(e,t){N(e,t,m,p);let n=e.message.bodies.map(e=>e.key),r=e.message.links.map(e=>e.key);new Set(n).size!==n.length&&t.addIssue({code:`custom`,message:`message_body_duplicate`});for(let i of e.message.variants){let e=i.bodyRefs.map(e=>e.key);(new Set(e).size!==e.length||e.some(e=>!n.includes(e)))&&t.addIssue({code:`custom`,message:`message_body_reference_invalid`}),JSON.stringify(i.linkLabels.map(e=>e.key))!==JSON.stringify(r)&&t.addIssue({code:`custom`,message:`message_variant_link_labels_mismatch`})}}const _e=e.array(A).min(1).superRefine((e,t)=>{new Set(e).size!==e.length&&t.addIssue({code:`custom`,message:`route_key_duplicate`})}),{routeKey:ve,...ye}=q.shape,be=q.shape.message,xe=e.object({...ye,contractVersion:e.literal(7),routeKeys:_e,message:be}).strict().superRefine(J);function Se(e){return`routeKeys`in e?[...e.routeKeys].sort():[e.routeKey]}const Ce=e.object({type:e.literal(`creator.draft.v1`),templateId:e.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),signalType:e.string().regex(/^[a-z][a-z0-9_]*$/),sourceTextZh:E(h),sourceUrl:j.shape.url.optional()}).strict(),we=e.object({contractVersion:e.literal(1),eventType:e.literal(`local-task.delivery.requested`),eventId:e.string().uuid(),producer:O,routeKey:A,occurredAt:D,requestedAt:D,deliverBy:D,subject:k.extend({type:e.literal(`creator-event`)}),task:Ce}).strict().superRefine((e,t)=>N(e,t,ie,h)),Te=we,Ee=e.union([P,I,H,W,K,q,xe]),De=e.object({destinationKey:e.string().min(1),state:e.enum(b),attempts:e.number().int().min(0).max(4),failureCode:e.enum(S).nullable(),lastAttemptAt:D.nullable(),nextAttemptAt:D.nullable(),leaseExpiresAt:D.nullable()}).strict(),Y=e.object({contractVersion:e.literal(1),eventId:e.string().uuid(),producer:O,routeKey:A,subject:k,state:e.enum(g),reason:e.enum(_),terminal:e.boolean(),acceptedAt:D,updatedAt:D,deliverBy:D,terminalAt:D.nullable(),destinations:e.array(De).min(1).max(20)}).strict(),X=e.object({name:e.string().min(1).max(100),message:e.string().max(500).optional(),code:e.union([e.string().max(100),e.number()]).optional(),status:e.union([e.string().max(100),e.number()]).optional()}).strict(),Oe=X.extend({cause:X.extend({cause:X.extend({cause:X.optional()}).optional()}).optional()}),ke=De.extend({state:e.enum(x),attempts:e.number().int().min(0),revision:e.number().int().min(0),cause:Oe.nullable(),unconfirmedAt:D.nullable()}),Z=Y.extend({contractVersion:e.literal(2),state:e.enum(v),reason:e.enum(y),revision:e.number().int().min(0),destinations:e.array(ke).min(1).max(20)}),Ae=Z.omit({routeKey:!0}).extend({contractVersion:e.literal(3),routeKeys:_e}),Q=e.union([Y,Z,Ae]),je=e.object({path:e.array(e.union([e.string(),e.number().int().min(0)])).max(16),code:e.enum(w)}).strict(),Me=e.object({code:e.literal(`invalid_request`),issues:e.array(je).max(20).optional()}).strict(),Ne=e.object({code:e.enum(C.filter(e=>e!==`invalid_request`))}).strict(),$=e.union([Me,Ne]),Pe=e.discriminatedUnion(`status`,[e.object({status:e.literal(`accepted`),receipt:Y}).strict(),e.object({status:e.literal(`rejected`),error:$}).strict()]),Fe=e.discriminatedUnion(`status`,[e.object({status:e.literal(`found`),receipt:Y}).strict(),e.object({status:e.literal(`not_found`)}).strict(),e.object({status:e.literal(`unavailable`),error:e.object({code:e.literal(`receipt_unavailable`)}).strict()}).strict()]),Ie=e.discriminatedUnion(`status`,[e.object({status:e.literal(`accepted`),receipt:Q}).strict(),e.object({status:e.literal(`rejected`),error:$}).strict()]),Le=e.discriminatedUnion(`status`,[e.object({status:e.literal(`found`),receipt:Q}).strict(),e.object({status:e.literal(`not_found`)}).strict(),e.object({status:e.literal(`unavailable`),error:e.object({code:e.literal(`receipt_unavailable`)}).strict()}).strict()]);export{re as localTaskDeliveryContractVersionV1,ie as localTaskDeliveryMaximumDeadlineMillisecondsV1,h as localTaskDeliveryRequestMaximumUtf8BytesV1,Te as localTaskDeliveryRequestSchema,we as localTaskDeliveryRequestV1Schema,Pe as notificationDeliverResultV1Schema,Ie as notificationDeliverResultV2Schema,t as notificationDeliveryContractVersionV1,n as notificationDeliveryContractVersionV2,r as notificationDeliveryContractVersionV3,i as notificationDeliveryContractVersionV4,a as notificationDeliveryContractVersionV5,o as notificationDeliveryContractVersionV7,c as notificationDeliveryMaximumDeadlineMillisecondsV1,ne as notificationDeliveryMaximumDeadlineMillisecondsV2,u as notificationDeliveryMaximumDeadlineMillisecondsV3,f as notificationDeliveryMaximumDeadlineMillisecondsV4,m as notificationDeliveryMaximumDeadlineMillisecondsV5,ee as notificationDeliveryMaximumDestinationsV1,_ as notificationDeliveryReasonsV1,y as notificationDeliveryReasonsV2,Y as notificationDeliveryReceiptV1Schema,Z as notificationDeliveryReceiptV2Schema,Ae as notificationDeliveryReceiptV3Schema,C as notificationDeliveryRejectionCodesV1,$ as notificationDeliveryRejectionV1Schema,s as notificationDeliveryRequestMaximumUtf8BytesV1,te as notificationDeliveryRequestMaximumUtf8BytesV2,l as notificationDeliveryRequestMaximumUtf8BytesV3,d as notificationDeliveryRequestMaximumUtf8BytesV4,p as notificationDeliveryRequestMaximumUtf8BytesV5,Ee as notificationDeliveryRequestSchema,P as notificationDeliveryRequestV1Schema,I as notificationDeliveryRequestV2Schema,H as notificationDeliveryRequestV3Schema,W as notificationDeliveryRequestV4Schema,K as notificationDeliveryRequestV5Schema,q as notificationDeliveryRequestV6Schema,xe as notificationDeliveryRequestV7Schema,g as notificationDeliveryStatesV1,v as notificationDeliveryStatesV2,S as notificationDestinationFailureCodesV1,b as notificationDestinationStatesV1,x as notificationDestinationStatesV2,Fe as notificationGetReceiptResultV1Schema,Le as notificationGetReceiptResultV2Schema,Q as notificationMessageReceiptSchema,ae as notificationMessageVariantKeys,Se as notificationRouteKeys,w as notificationValidationIssueCodesV1,Oe as safeDeliveryCauseSchema};
|
|
1
|
+
import{z as e}from"zod";const t=e.strictObject({eventId:e.uuid(),deliverBy:e.iso.datetime(),locale:e.string().min(1).max(35),contentLocale:e.string().min(1).max(35),title:e.string().trim().min(1).max(512),body:e.string(),url:e.url().refine(e=>new URL(e).protocol===`https:`,`notification_https_target_required`)}),n=1,r=2,i=3,a=4,o=5,s=7,ee=8,te=9,ne=20,c=32*1024,l=1380*60*1e3,u=c,d=l,f=c,re=l,p=c,ie=l,m=c,ae=64*1024,h=l,oe=1,g=32*1024,_=10080*60*1e3,v=[`pending`,`delivering`,`partial`,`delivered`,`failed`,`expired`],y=[`accepted`,`enqueue_retry_wait`,`in_progress`,`partial_delivery`,`complete`,`retry_exhausted`,`delivery_deadline_exceeded`,`destination_configuration_unavailable`],b=[...v,`unconfirmed`],x=[...y,`delivery_unconfirmed`],S=[`pending`,`delivering`,`delivered`,`failed`,`expired`],se=[...S,`unconfirmed`],ce=[`provider_timeout`,`provider_rate_limited`,`provider_unavailable`,`provider_rejected`,`destination_configuration_unavailable`,`delivery_interrupted`,`retry_exhausted`],le=[`invalid_request`,`request_too_large`,`producer_scope_mismatch`,`route_not_allowed`,`event_identity_conflict`,`route_not_found`,`route_empty`,`delivery_deadline_invalid`],ue=[`invalid_type`,`invalid_value`,`too_small`,`too_big`,`invalid_format`,`unrecognized_keys`,`custom`],de=[`source`,`zh-CN`],C=[`qq`,`tg`,`wechat`,`lark`],fe=new TextEncoder,w=/^[a-z][a-z0-9-]{0,62}$/,pe=/^[a-z][a-z0-9-]{0,31}(?:\.[a-z][a-z0-9-]{0,31}){1,3}$/,me=/^[A-Z0-9][\w.:-]{0,127}$/i;function he(e){return[...e].length}function T(t){return e.string().refine(e=>he(e)>0,{message:`too_small`}).refine(e=>he(e)<=t,{message:`too_big`})}const E=e.string().datetime({offset:!0}),D=e.object({key:e.string().regex(w),environment:e.string().regex(w)}).strict(),O=e.object({type:e.string().regex(w),id:e.string().regex(me),revision:e.number().int().positive()}).strict(),k=e.string().min(1).max(127).regex(pe),A=e.object({label:T(48),url:T(2048).refine(e=>[...e].every(e=>{let t=e.codePointAt(0);return t!==void 0&&t>31&&t!==127}),{message:`invalid_https_url`}).refine(e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},{message:`invalid_https_url`})}).strict(),j={eventType:e.literal(`notification.delivery.requested`),eventId:e.string().uuid(),producer:D,routeKey:k,occurredAt:E,requestedAt:E,deliverBy:E,subject:O},ge=e.object({contractVersion:e.literal(1),...j,message:e.object({type:e.literal(`link_summary`),title:T(160),summary:T(1200),facts:e.array(e.object({label:T(48),value:T(500)}).strict()).max(10),primaryLink:A,sourceLink:A.optional()}).strict()}).strict();function M(e,t,n,r){let i=Date.parse(e.requestedAt),a=Date.parse(e.deliverBy);(!Number.isFinite(i)||!Number.isFinite(a)||a<=i||a-i>n)&&t.addIssue({code:`custom`,message:`delivery_deadline_invalid`,path:[`deliverBy`]}),fe.encode(JSON.stringify(e)).byteLength>r&&t.addIssue({code:`custom`,message:`request_too_large`})}const N=ge.superRefine((e,t)=>M(e,t,l,c)),P={title:T(160),summary:T(1200),facts:e.array(e.object({label:T(48),value:T(500)}).strict()).max(10)},_e=e.discriminatedUnion(`key`,[e.object({key:e.literal(`source`),locale:e.literal(`und`),...P}).strict(),e.object({key:e.literal(`zh-CN`),locale:e.literal(`zh-CN`),...P}).strict()]),ve=e.array(_e).min(1).max(2).superRefine((e,t)=>{e.filter(e=>e.key===`source`).length!==1&&t.addIssue({code:`custom`,message:`source_variant_required_once`}),new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_variant_duplicate`})}),F=e.object({contractVersion:e.literal(2),...j,message:e.object({type:e.literal(`localized_link_summary`),variants:ve,primaryLink:A,sourceLink:A.optional()}).strict()}).strict().superRefine((e,t)=>M(e,t,d,u)),ye=e.discriminatedUnion(`type`,[e.object({key:e.string().regex(w),type:e.literal(`text`),label:T(48).optional(),value:T(4e3)}).strict(),e.object({key:e.string().regex(w),type:e.literal(`fields`),items:e.array(e.object({label:T(48),value:T(1200)}).strict()).min(1).max(20)}).strict()]),I=e.array(ye).max(30).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_section_duplicate`})}),L=I.min(1),R=e.discriminatedUnion(`key`,[e.object({key:e.literal(`source`),locale:e.literal(`und`),title:T(160),sections:L}).strict(),e.object({key:e.literal(`zh-CN`),locale:e.literal(`zh-CN`),title:T(160),sections:L}).strict()]),z=(e,t,n=!1)=>{e.filter(e=>e.key===`source`).length!==1&&t.addIssue({code:`custom`,message:`source_variant_required_once`}),new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_variant_duplicate`});let r=e.find(e=>e.key===`source`),i=e.find(e=>e.key===`zh-CN`);if(r&&i){let a=new Set(r.sections.map(e=>e.key)),o=new Set(i.sections.map(e=>e.key)),s=r.sections.filter(e=>!n||e.type!==`text`||o.has(e.key)).map(e=>`${e.key}:${e.type}`),ee=i.sections.filter(e=>!n||e.type!==`text`||a.has(e.key)).map(e=>`${e.key}:${e.type}`);JSON.stringify(s)!==JSON.stringify(ee)&&t.addIssue({code:`custom`,message:`message_variant_structure_mismatch`,path:[e.indexOf(i),`sections`]})}},be=e.array(R).min(1).max(2).superRefine(z),B=e.object({contractVersion:e.literal(3),...j,message:e.object({type:e.literal(`structured_notification`),variants:be,links:e.array(e.object({key:e.string().regex(w),...A.shape}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_duplicate`})})}).strict()}).strict(),xe=B.superRefine((e,t)=>M(e,t,re,f)),Se=e.object({label:T(48).optional(),value:T(p)}).strict(),Ce=e.discriminatedUnion(`key`,[R.options[0].extend({body:Se}),R.options[1].extend({body:Se})]),we=B.extend({contractVersion:e.literal(4),message:B.shape.message.extend({variants:e.array(Ce).min(1).max(2).superRefine(z)})}).superRefine((e,t)=>M(e,t,ie,p)),V=e.discriminatedUnion(`key`,[R.options[0].extend({bodyLabel:T(48).optional(),linkLabels:e.array(e.object({key:e.string().regex(w),label:T(48)}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_label_duplicate`})})}),R.options[1].extend({bodyLabel:T(48).optional(),linkLabels:e.array(e.object({key:e.string().regex(w),label:T(48)}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_label_duplicate`})})})]),Te=e.object({value:T(m)}).strict(),H=e.object({contractVersion:e.literal(5),...j,message:e.object({type:e.literal(`structured_notification`),variants:e.array(V).min(1).max(2).superRefine(z),links:e.array(e.object({key:e.string().regex(w),url:A.shape.url}).strict()).max(10).superRefine((e,t)=>{new Set(e.map(e=>e.key)).size!==e.length&&t.addIssue({code:`custom`,message:`message_link_duplicate`})}),body:Te}).strict()}).strict().superRefine((e,t)=>{M(e,t,h,m);let n=e.message.links.map(e=>e.key);for(let[r,i]of e.message.variants.entries()){let e=i.linkLabels.map(e=>e.key);JSON.stringify(e)!==JSON.stringify(n)&&t.addIssue({code:`custom`,message:`message_variant_link_labels_mismatch`,path:[`message`,`variants`,r,`linkLabels`]})}}),U=e.object({...H.shape,contractVersion:e.literal(6),message:H.shape.message.omit({body:!0}).extend({bodies:e.array(e.object({key:e.string().regex(w),value:T(m)}).strict()).max(2),variants:e.array(e.discriminatedUnion(`key`,[V.options[0].omit({bodyLabel:!0}).extend({sections:I,bodyRefs:e.array(e.object({key:e.string().regex(w),label:T(48)}).strict()).max(2),footer:T(500).optional()}),V.options[1].omit({bodyLabel:!0}).extend({sections:I,bodyRefs:e.array(e.object({key:e.string().regex(w),label:T(48)}).strict()).max(2),footer:T(500).optional()})])).min(1).max(2).superRefine((e,t)=>z(e,t,!0))})}).strict().superRefine(W);function W(e,t){M(e,t,h,m);let n=e.message.bodies.map(e=>e.key),r=e.message.links.map(e=>e.key);new Set(n).size!==n.length&&t.addIssue({code:`custom`,message:`message_body_duplicate`}),Ee(e.message.variants,n,r,t)}function Ee(e,t,n,r,i){for(let[a,o]of e.entries()){let e=o.bodyRefs.map(e=>e.key);(new Set(e).size!==e.length||e.some(e=>!t.includes(e)))&&r.addIssue({code:`custom`,message:`message_body_reference_invalid`,...i?{path:[...i,a,`bodyRefs`]}:{}}),JSON.stringify(o.linkLabels.map(e=>e.key))!==JSON.stringify(n)&&r.addIssue({code:`custom`,message:`message_variant_link_labels_mismatch`,...i?{path:[...i,a,`linkLabels`]}:{}})}}const De=e.array(k).min(1).superRefine((e,t)=>{new Set(e).size!==e.length&&t.addIssue({code:`custom`,message:`route_key_duplicate`})}),{routeKey:Oe,...ke}=U.shape,G=U.shape.message,K=e.object({...ke,contractVersion:e.literal(7),routeKeys:De,message:G}).strict().superRefine(W),q=e.object({...K.shape,contractVersion:e.literal(8),message:G.extend({channelVariants:e.partialRecord(e.enum(C),G.shape.variants).optional()})}).strict().superRefine((e,t)=>{W(e,t);let n=e.message.variants.map(e=>`${e.key}:${e.locale}`).sort(),r=e.message.bodies.map(e=>e.key),i=e.message.links.map(e=>e.key);for(let a of C){let o=e.message.channelVariants?.[a];if(!o)continue;let s=[`message`,`channelVariants`,a];JSON.stringify(o.map(e=>`${e.key}:${e.locale}`).sort())!==JSON.stringify(n)&&t.addIssue({code:`custom`,message:`message_channel_variant_languages_mismatch`,path:s}),Ee(o,r,i,t,s)}}),Ae=e.object({locale:T(35),contentLocale:T(35),title:T(160).refine(e=>e.trim().length>0,`browser_message_title_blank`),body:e.string().max(8192),url:A.shape.url}).strict(),je=e.object({...q.shape,contractVersion:e.literal(9),audience:e.object({topics:e.array(T(128)).min(1).max(2).superRefine((e,t)=>{new Set(e).size!==e.length&&t.addIssue({code:`custom`,message:`audience_topic_duplicate`})})}).strict().optional(),browserMessages:e.array(Ae).min(1).max(5).superRefine((e,t)=>{new Set(e.map(e=>e.locale)).size!==e.length&&t.addIssue({code:`custom`,message:`browser_message_locale_duplicate`})}).optional()}).strict().superRefine((e,t)=>{let{audience:n,browserMessages:r,...i}=e,a=q.safeParse({...i,contractVersion:8});if(a.success)M(e,t,h,ae);else for(let e of a.error.issues)t.addIssue({...e});r!==void 0&&n===void 0&&t.addIssue({code:`custom`,message:`browser_message_audience_missing`,path:[`audience`]})});function Me(e){return`routeKeys`in e?[...e.routeKeys].sort():[e.routeKey]}const Ne=e.object({type:e.literal(`creator.draft.v1`),templateId:e.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),signalType:e.string().regex(/^[a-z][a-z0-9_]*$/),sourceTextZh:T(g),sourceUrl:A.shape.url.optional()}).strict(),Pe=e.object({contractVersion:e.literal(1),eventType:e.literal(`local-task.delivery.requested`),eventId:e.string().uuid(),producer:D,routeKey:k,occurredAt:E,requestedAt:E,deliverBy:E,subject:O.extend({type:e.literal(`creator-event`)}),task:Ne}).strict().superRefine((e,t)=>M(e,t,_,g)),Fe=Pe,Ie=e.union([N,F,xe,we,H,U,K,q,je]),Le=e.object({destinationKey:e.string().min(1),state:e.enum(S),attempts:e.number().int().min(0).max(4),failureCode:e.enum(ce).nullable(),lastAttemptAt:E.nullable(),nextAttemptAt:E.nullable(),leaseExpiresAt:E.nullable()}).strict(),J=e.object({contractVersion:e.literal(1),eventId:e.string().uuid(),producer:D,routeKey:k,subject:O,state:e.enum(v),reason:e.enum(y),terminal:e.boolean(),acceptedAt:E,updatedAt:E,deliverBy:E,terminalAt:E.nullable(),destinations:e.array(Le).min(1).max(20)}).strict(),Y=e.object({name:e.string().min(1).max(100),message:e.string().max(500).optional(),code:e.union([e.string().max(100),e.number()]).optional(),status:e.union([e.string().max(100),e.number()]).optional()}).strict(),X=Y.extend({cause:Y.extend({cause:Y.extend({cause:Y.optional()}).optional()}).optional()}),Re=Le.extend({state:e.enum(se),attempts:e.number().int().min(0),revision:e.number().int().min(0),cause:X.nullable(),unconfirmedAt:E.nullable()}),Z=J.extend({contractVersion:e.literal(2),state:e.enum(b),reason:e.enum(x),revision:e.number().int().min(0),destinations:e.array(Re).min(1).max(20)}),ze=Z.omit({routeKey:!0}).extend({contractVersion:e.literal(3),routeKeys:De}),Q=e.union([J,Z,ze]),Be=e.object({path:e.array(e.union([e.string(),e.number().int().min(0)])).max(16),code:e.enum(ue)}).strict(),Ve=e.object({code:e.literal(`invalid_request`),issues:e.array(Be).max(20).optional()}).strict(),He=e.object({code:e.enum(le.filter(e=>e!==`invalid_request`))}).strict(),$=e.union([Ve,He]),Ue=e.discriminatedUnion(`status`,[e.object({status:e.literal(`accepted`),receipt:J}).strict(),e.object({status:e.literal(`rejected`),error:$}).strict()]),We=e.discriminatedUnion(`status`,[e.object({status:e.literal(`found`),receipt:J}).strict(),e.object({status:e.literal(`not_found`)}).strict(),e.object({status:e.literal(`unavailable`),error:e.object({code:e.literal(`receipt_unavailable`)}).strict()}).strict()]),Ge=e.discriminatedUnion(`status`,[e.object({status:e.literal(`accepted`),receipt:Q}).strict(),e.object({status:e.literal(`rejected`),error:$}).strict()]),Ke=e.discriminatedUnion(`status`,[e.object({status:e.literal(`found`),receipt:Q}).strict(),e.object({status:e.literal(`not_found`)}).strict(),e.object({status:e.literal(`unavailable`),error:e.object({code:e.literal(`receipt_unavailable`)}).strict()}).strict()]);export{oe as localTaskDeliveryContractVersionV1,_ as localTaskDeliveryMaximumDeadlineMillisecondsV1,g as localTaskDeliveryRequestMaximumUtf8BytesV1,Fe as localTaskDeliveryRequestSchema,Pe as localTaskDeliveryRequestV1Schema,Ae as notificationBrowserMessageSchema,t as notificationBrowserPayloadSchema,Ue as notificationDeliverResultV1Schema,Ge as notificationDeliverResultV2Schema,C as notificationDeliveryChannelKeys,n as notificationDeliveryContractVersionV1,r as notificationDeliveryContractVersionV2,i as notificationDeliveryContractVersionV3,a as notificationDeliveryContractVersionV4,o as notificationDeliveryContractVersionV5,s as notificationDeliveryContractVersionV7,ee as notificationDeliveryContractVersionV8,te as notificationDeliveryContractVersionV9,l as notificationDeliveryMaximumDeadlineMillisecondsV1,d as notificationDeliveryMaximumDeadlineMillisecondsV2,re as notificationDeliveryMaximumDeadlineMillisecondsV3,ie as notificationDeliveryMaximumDeadlineMillisecondsV4,h as notificationDeliveryMaximumDeadlineMillisecondsV5,ne as notificationDeliveryMaximumDestinationsV1,y as notificationDeliveryReasonsV1,x as notificationDeliveryReasonsV2,J as notificationDeliveryReceiptV1Schema,Z as notificationDeliveryReceiptV2Schema,ze as notificationDeliveryReceiptV3Schema,le as notificationDeliveryRejectionCodesV1,$ as notificationDeliveryRejectionV1Schema,c as notificationDeliveryRequestMaximumUtf8BytesV1,u as notificationDeliveryRequestMaximumUtf8BytesV2,f as notificationDeliveryRequestMaximumUtf8BytesV3,p as notificationDeliveryRequestMaximumUtf8BytesV4,m as notificationDeliveryRequestMaximumUtf8BytesV5,ae as notificationDeliveryRequestMaximumUtf8BytesV9,Ie as notificationDeliveryRequestSchema,N as notificationDeliveryRequestV1Schema,F as notificationDeliveryRequestV2Schema,xe as notificationDeliveryRequestV3Schema,we as notificationDeliveryRequestV4Schema,H as notificationDeliveryRequestV5Schema,U as notificationDeliveryRequestV6Schema,K as notificationDeliveryRequestV7Schema,q as notificationDeliveryRequestV8Schema,je as notificationDeliveryRequestV9Schema,v as notificationDeliveryStatesV1,b as notificationDeliveryStatesV2,ce as notificationDestinationFailureCodesV1,S as notificationDestinationStatesV1,se as notificationDestinationStatesV2,We as notificationGetReceiptResultV1Schema,Ke as notificationGetReceiptResultV2Schema,Q as notificationMessageReceiptSchema,de as notificationMessageVariantKeys,Me as notificationRouteKeys,ue as notificationValidationIssueCodesV1,X as safeDeliveryCauseSchema};
|