@@ -8,11 +8,7 @@ export const $RoutingConfigEventChannel = z.enum([
88 'LETTER' ,
99] ) ;
1010
11- export const $RoutingConfigStatus = z . enum ( [
12- 'DELETED' ,
13- 'DRAFT' ,
14- 'COMPLETED' ,
15- ] ) ;
11+ export const $RoutingConfigStatus = z . enum ( [ 'DELETED' , 'DRAFT' , 'COMPLETED' ] ) ;
1612
1713const accessibleFormats = [ 'x1' ] ;
1814
@@ -25,57 +21,71 @@ export type RoutingConfigEventChannelType = z.infer<
2521 typeof $RoutingConfigEventChannelType
2622> ;
2723
28- const $RoutingConfigEventConditionalTemplate = z . object ( {
29- language : z . enum ( languages ) . optional ( ) . meta ( {
24+ const $RoutingConfigEventConditionalTemplate = z
25+ . object ( {
26+ language : z . enum ( languages ) . optional ( ) . meta ( {
3027 description : 'Language override for the template' ,
3128 } ) ,
32- accessibleFormat : z . enum ( accessibleFormats ) . optional ( ) . meta ( {
29+ accessibleFormat : z . enum ( accessibleFormats ) . optional ( ) . meta ( {
3330 description : 'Communication preference override for the template' ,
3431 } ) ,
35- supplierReferences : z . record ( z . string ( ) , z . string ( ) ) . optional ( ) . meta ( {
32+ supplierReferences : z . record ( z . string ( ) , z . string ( ) ) . optional ( ) . meta ( {
3633 description : 'Supplier references that identify the template' ,
3734 } ) ,
38- templateId : z . string ( ) . regex ( / ^ [ \d A - F a - f ] { 8 } (?: - [ \d A - F a - f ] { 4 } ) { 3 } - [ \d A - F a - f ] { 12 } $ / ) . meta ( {
39- description : 'Unique identifier for the template' ,
40- } ) ,
41- } )
35+ templateId : z
36+ . string ( )
37+ // eslint-disable-next-line security/detect-unsafe-regex
38+ . regex ( / ^ [ \d A - F a - f ] { 8 } (?: - [ \d A - F a - f ] { 4 } ) { 3 } - [ \d A - F a - f ] { 12 } $ / )
39+ . meta ( {
40+ description : 'Unique identifier for the template' ,
41+ } ) ,
42+ } )
4243 . meta ( {
4344 id : 'ConditionalTemplate' ,
4445 } ) ;
4546export type RoutingConfigEventConditionalTemplate = z . infer <
4647 typeof $RoutingConfigEventConditionalTemplate
4748> ;
4849
49- const $CascadeItem = z . object ( {
50- channel : $RoutingConfigEventChannel . meta ( {
50+ const $CascadeItem = z
51+ . object ( {
52+ channel : $RoutingConfigEventChannel . meta ( {
5153 description : 'Communication type for this cascade item' ,
5254 } ) ,
53- channelType : $RoutingConfigEventChannelType . meta ( {
55+ channelType : $RoutingConfigEventChannelType . meta ( {
5456 description : 'Channel type for this cascade item' ,
5557 } ) ,
56- defaultTemplateId : z . string ( ) . regex ( / ^ [ \d A - F a - f ] { 8 } (?: - [ \d A - F a - f ] { 4 } ) { 3 } - [ \d A - F a - f ] { 12 } $ / ) . optional ( ) . meta ( {
57- description : 'Unique identifier for the template to use if no conditions for conditionalTemplates are satisfied' ,
58- } ) ,
59- supplierReferences : z . record ( z . string ( ) , z . string ( ) ) . optional ( ) . meta ( {
58+ defaultTemplateId : z
59+ . string ( )
60+ // eslint-disable-next-line security/detect-unsafe-regex
61+ . regex ( / ^ [ \d A - F a - f ] { 8 } (?: - [ \d A - F a - f ] { 4 } ) { 3 } - [ \d A - F a - f ] { 12 } $ / )
62+ . optional ( )
63+ . meta ( {
64+ description :
65+ 'Unique identifier for the template to use if no conditions for conditionalTemplates are satisfied' ,
66+ } ) ,
67+ supplierReferences : z . record ( z . string ( ) , z . string ( ) ) . optional ( ) . meta ( {
6068 description : 'Supplier references that identify the template' ,
6169 } ) ,
62- conditionalTemplates : z
63- . array ( $RoutingConfigEventConditionalTemplate )
64- . optional ( ) ,
65- cascadeGroups : z . array ( z . string ( ) ) . meta ( {
66- description : 'List of cascade groups that the cascade item will be included in' ,
70+ conditionalTemplates : z
71+ . array ( $RoutingConfigEventConditionalTemplate )
72+ . optional ( ) ,
73+ cascadeGroups : z . array ( z . string ( ) ) . meta ( {
74+ description :
75+ 'List of cascade groups that the cascade item will be included in' ,
6776 } ) ,
68- } )
77+ } )
6978 . meta ( {
7079 id : 'CascadeItem' ,
7180 } ) ;
7281export type CascadeItem = z . infer < typeof $CascadeItem > ;
7382
74- const $CascadeGroupOverride = z . object ( {
75- name : z . string ( ) ,
76- accessibleFormat : z . array ( z . string ( ) ) . optional ( ) ,
77- language : z . array ( z . string ( ) ) . optional ( ) ,
78- } )
83+ const $CascadeGroupOverride = z
84+ . object ( {
85+ name : z . string ( ) ,
86+ accessibleFormat : z . array ( z . string ( ) ) . optional ( ) ,
87+ language : z . array ( z . string ( ) ) . optional ( ) ,
88+ } )
7989 . meta ( {
8090 id : 'CascadeGroupOverride' ,
8191 } ) ;
@@ -88,23 +98,32 @@ export const $RoutingConfigEventV1Data = z.object({
8898 campaignId : z . string ( ) . meta ( {
8999 description : 'The campaign that is associated with the routing config' ,
90100 } ) ,
91- id : z . string ( ) . meta ( {
92- description : 'Unique identifier of the routing config' ,
93- } ) . regex ( / ^ [ \d A - F a - f ] { 8 } (?: - [ \d A - F a - f ] { 4 } ) { 3 } - [ \d A - F a - f ] { 12 } $ / ) ,
101+ id : z
102+ . string ( )
103+ . meta ( {
104+ description : 'Unique identifier of the routing config' ,
105+ } )
106+ // eslint-disable-next-line security/detect-unsafe-regex
107+ . regex ( / ^ [ \d A - F a - f ] { 8 } (?: - [ \d A - F a - f ] { 4 } ) { 3 } - [ \d A - F a - f ] { 12 } $ / ) ,
94108 name : z . string ( ) . meta ( {
95109 description : 'User-provided name identifying the routing config' ,
96110 } ) ,
97111 defaultCascadeGroup : z . string ( ) . meta ( {
98112 description : 'Default cascade group name' ,
99113 } ) ,
100- createdAt : z . string ( ) . regex ( / ^ \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } \. \d { 3 } Z $ / ) . meta ( {
101- description : 'Timestamp for when the routing config was created' ,
102- } ) ,
114+ createdAt : z
115+ . string ( )
116+ . regex ( / ^ \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } \. \d { 3 } Z $ / )
117+ . meta ( {
118+ description : 'Timestamp for when the routing config was created' ,
119+ } ) ,
103120 cascade : z . array ( $CascadeItem ) . meta ( {
104- description : 'Array defining the order of channels for the routing config and how they are configured' ,
121+ description :
122+ 'Array defining the order of channels for the routing config and how they are configured' ,
105123 } ) ,
106124 cascadeGroupOverrides : z . array ( $CascadeGroupOverride ) . meta ( {
107- description : 'Config defining non-default cascade groups and the conditons under which they will be used' ,
125+ description :
126+ 'Config defining non-default cascade groups and the conditons under which they will be used' ,
108127 } ) ,
109128 status : $RoutingConfigStatus . meta ( {
110129 description : 'Routing config status' ,
0 commit comments