@@ -8,7 +8,7 @@ const attributesValidator = require('../utils/inputValidation/attributes');
88const trafficTypeValidator = require ( '../utils/inputValidation/trafficType' ) ;
99const eventTypeValidator = require ( '../utils/inputValidation/eventType' ) ;
1010const valueValidator = require ( '../utils/inputValidation/value' ) ;
11- const propertiesValidator = require ( '../utils/inputValidation/properties' ) ;
11+ const { validateProperties , validateEvaluationOptions } = require ( '../utils/inputValidation/properties' ) ;
1212const keysValidator = require ( '../utils/inputValidation/keys' ) ;
1313const clientController = require ( './client.controller' ) ;
1414const { parseValidators } = require ( '../utils/utils' ) ;
@@ -24,7 +24,7 @@ const treatmentValidation = (req, res, next) => {
2424 const bucketingKeyValidation = req . query [ 'bucketing-key' ] !== undefined ? keyValidator ( req . query [ 'bucketing-key' ] , 'bucketing-key' ) : null ;
2525 const featureFlagNameValidation = splitValidator ( req . query [ 'split-name' ] ) ;
2626 const attributesValidation = attributesValidator ( req . query . attributes ) ;
27- const optionsValidation = propertiesValidator ( req . query . options ) ;
27+ const optionsValidation = validateEvaluationOptions ( req . query . options ) ;
2828
2929 const error = parseValidators ( [ matchingKeyValidation , bucketingKeyValidation , featureFlagNameValidation , attributesValidation , optionsValidation ] ) ;
3030 if ( error . length ) {
@@ -58,7 +58,7 @@ const treatmentsValidation = (req, res, next) => {
5858 const bucketingKeyValidation = req . query [ 'bucketing-key' ] !== undefined ? keyValidator ( req . query [ 'bucketing-key' ] , 'bucketing-key' ) : null ;
5959 const featureFlagsNameValidation = splitsValidator ( req . query [ 'split-names' ] ) ;
6060 const attributesValidation = attributesValidator ( req . query . attributes ) ;
61- const optionsValidation = propertiesValidator ( req . query . options ) ;
61+ const optionsValidation = validateEvaluationOptions ( req . query . options ) ;
6262
6363 const error = parseValidators ( [ matchingKeyValidation , bucketingKeyValidation , featureFlagsNameValidation , attributesValidation , optionsValidation ] ) ;
6464 if ( error . length ) {
@@ -92,7 +92,7 @@ const flagSetsValidation = (req, res, next) => {
9292 const bucketingKeyValidation = req . query [ 'bucketing-key' ] !== undefined ? keyValidator ( req . query [ 'bucketing-key' ] , 'bucketing-key' ) : null ;
9393 const flagSetNameValidation = flagSetsValidator ( req . query [ 'flag-sets' ] ) ;
9494 const attributesValidation = attributesValidator ( req . query . attributes ) ;
95- const optionsValidation = propertiesValidator ( req . query . options ) ;
95+ const optionsValidation = validateEvaluationOptions ( req . query . options ) ;
9696
9797 const error = parseValidators ( [ matchingKeyValidation , bucketingKeyValidation , flagSetNameValidation , attributesValidation , optionsValidation ] ) ;
9898 if ( error . length ) {
@@ -126,7 +126,7 @@ const trackValidation = (req, res, next) => {
126126 const trafficTypeValidation = trafficTypeValidator ( req . query [ 'traffic-type' ] ) ;
127127 const eventTypeValidation = eventTypeValidator ( req . query [ 'event-type' ] ) ;
128128 const valueValidation = valueValidator ( req . query . value ) ;
129- const propertiesValidation = propertiesValidator ( req . query . properties ) ;
129+ const propertiesValidation = validateProperties ( req . query . properties ) ;
130130
131131 const error = parseValidators ( [ keyValidation , trafficTypeValidation , eventTypeValidation , valueValidation , propertiesValidation ] ) ;
132132 if ( error . length ) {
@@ -157,7 +157,7 @@ const trackValidation = (req, res, next) => {
157157const allTreatmentValidation = ( req , res , next ) => {
158158 const keysValidation = keysValidator ( req . query . keys ) ;
159159 const attributesValidation = attributesValidator ( req . query . attributes ) ;
160- const optionsValidation = propertiesValidator ( req . query . options ) ;
160+ const optionsValidation = validateEvaluationOptions ( req . query . options ) ;
161161
162162 const error = parseValidators ( [ keysValidation , attributesValidation , optionsValidation ] ) ;
163163 if ( error . length ) {
0 commit comments