File tree 3 files changed +205
-22
lines changed
3 files changed +205
-22
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const testCases = [
12
12
"filters": {"x": []},
13
13
"not_filters": {"y": []}
14
14
}],
15
+ "aggregatable_source_registration_time": "include",
15
16
"aggregatable_trigger_data": [{
16
17
"filters": {"a": ["b"]},
17
18
"key_piece": "0x1",
@@ -527,4 +528,21 @@ export const testCases = [
527
528
msg : "must match 'aws-cloud' (case-sensitive)" ,
528
529
} ] ,
529
530
} ,
531
+
532
+ {
533
+ name : "aggregatable-source-registrationt-time-wrong-type" ,
534
+ json : `{"aggregatable_source_registration_time": 1}` ,
535
+ expectedErrors : [ {
536
+ path : [ "aggregatable_source_registration_time" ] ,
537
+ msg : "must be a string" ,
538
+ } ] ,
539
+ } ,
540
+ {
541
+ name : "aggregatable-source-registration-time-unknown-value" ,
542
+ json : `{"aggregatable_source_registration_time": "OMIT"}` ,
543
+ expectedErrors : [ {
544
+ path : [ "aggregatable_source_registration_time" ] ,
545
+ msg : "must match 'omit' or 'include' (case-sensitive)" ,
546
+ } ] ,
547
+ } ,
530
548
] ;
Original file line number Diff line number Diff line change @@ -301,6 +301,15 @@ const aggregatableDedupKeys = list(
301
301
not_filters : optional ( filters ( ) ) ,
302
302
} ) )
303
303
304
+ const aggregatableSourceRegistrationTime = string ( ( state , value ) => {
305
+ const omit = 'omit'
306
+ const include = 'include'
307
+ if ( value === omit || value === include ) {
308
+ return
309
+ }
310
+ state . error ( `must match '${ omit } ' or '${ include } ' (case-sensitive)` )
311
+ } )
312
+
304
313
export function validateTrigger ( trigger ) {
305
314
const state = new State ( )
306
315
state . validate ( trigger , {
@@ -313,6 +322,7 @@ export function validateTrigger(trigger) {
313
322
filters : optional ( orFilters ) ,
314
323
not_filters : optional ( orFilters ) ,
315
324
aggregatable_deduplication_keys : optional ( aggregatableDedupKeys ) ,
325
+ aggregatable_source_registration_time : optional ( aggregatableSourceRegistrationTime ) ,
316
326
} )
317
327
return state . result ( )
318
328
}
You can’t perform that action at this time.
0 commit comments