This interface is used during the serialization of events into envelope (serialized object) which is sent to the services, the format is defined via the Common Schema 4.0 specification. The path and field names used are based on how the data is serialized to the service (CS 4.0 location) and not specifically the location on the event object you pass into the track methods (unless they are the same).

Implements

Constructors

Properties

addFieldSanitizer: ((fieldSanitizer: IFieldValueSanitizerProvider) => void)

Adds a field sanitizer to the evaluation list

addSanitizer: ((sanitizer: IValueSanitizer) => void)

Add a value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name.

clearCache: (() => void)

Clear the current value sanitizer cache.

getFieldType: ((value: any) => FieldValueSanitizerType) = getFieldValueType

Type declaration

handleField: ((path: string, name: string) => boolean)

Does this field value sanitizer handle this path / field combination

Type declaration

    • (path, name): boolean
    • Parameters

      • path: string

        The field path

      • name: string

        The name of the field

      Returns boolean

isEmpty?: (() => boolean)

Returns whether this ValueSanitizer is empty

Type declaration

    • (): boolean
    • Returns boolean

      true if it contains no chained sanitizers or field sanitizers, otherwise false

property: ((path: string, name: string, property: IEventProperty, stringifyObjects?: boolean) => IEventProperty)

Sanitizes the Property. It checks the that the property name and value are valid. It also checks/populates the correct type and pii of the property value.

Type declaration

    • (path, name, property, stringifyObjects?): IEventProperty
    • Parameters

      • path: string

        The root path of the property

      • name: string

        The property name.

      • property: IEventProperty

        The property value or an IEventProperty containing value, type ,pii and customer content.

      • OptionalstringifyObjects: boolean

        If supplied tells the sanitizer that it should JSON stringify() objects

      Returns IEventProperty

      IEventProperty containing valid name, value, pii and type or null if invalid.

rmFieldSanitizer: ((theFieldSanitizer: IFieldValueSanitizerProvider) => void)

Removes the field sanitizer to the evaluation list if present

rmSanitizer: ((theSanitizer: IValueSanitizer) => void)

Removes the value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name if present.

value: ((path: string, name: string, value: FieldValueSanitizerTypes, stringifyObjects?: boolean) => IEventProperty)

Sanitizes the value. It checks the that the property name and value are valid. It also checks/populates the correct type and pii of the property value.

Type declaration

    • (path, name, value, stringifyObjects?): IEventProperty
    • Parameters

      • path: string

        The root path of the property

      • name: string

        The property name.

      • value: FieldValueSanitizerTypes

        The property value or an IEventProperty containing value, type ,pii and customer content.

      • OptionalstringifyObjects: boolean

        If supplied tells the sanitizer that it should JSON stringify() objects

      Returns IEventProperty

      IEventProperty containing valid name, value, pii and type or null if invalid.